Now on revision 109809. ------------------------------------------------------------ revno: 109809 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12293 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-08-28 16:14:21 -0400 message: * cl-lib.el (buffer-string): Simplify last change. diff: === modified file 'lisp/emacs-lisp/cl-lib.el' --- lisp/emacs-lisp/cl-lib.el 2012-08-28 19:35:35 +0000 +++ lisp/emacs-lisp/cl-lib.el 2012-08-28 20:14:21 +0000 @@ -635,8 +635,7 @@ (set-buffer-modified-p ,flag))) (gv-define-simple-setter buffer-name rename-buffer t) (gv-define-setter buffer-string (store) - ;; Eval `store' first since it may look at the buffer. - (macroexp-let2 nil s store `(progn (erase-buffer) (insert ,s)))) + `(insert (prog1 ,store (erase-buffer)))) (gv-define-simple-setter buffer-substring cl--set-buffer-substring) (gv-define-simple-setter current-buffer set-buffer) (gv-define-simple-setter current-case-table set-case-table) ------------------------------------------------------------ revno: 109808 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12293 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-08-28 15:35:35 -0400 message: * lisp/emacs-lisp/cl-lib.el (buffer-string): Fix setter macro. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-28 16:01:59 +0000 +++ lisp/ChangeLog 2012-08-28 19:35:35 +0000 @@ -1,3 +1,7 @@ +2012-08-28 Stefan Monnier + + * emacs-lisp/cl-lib.el (buffer-string): Fix setter macro (bug#12293). + 2012-08-28 Leo Liu * progmodes/sh-script.el (sh-dynamic-complete-functions): Adapt to @@ -53,8 +57,8 @@ 2012-08-26 Chong Yidong - * progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): New - variable, replacing gdb-frame-parameters. + * progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): + New variable, replacing gdb-frame-parameters. (gdb-frame-io-buffer, gdb-frame-breakpoints-buffer) (gdb-frame-threads-buffer, gdb-frame-memory-buffer) (gdb-frame-disassembly-buffer, gdb-frame-stack-buffer) @@ -130,17 +134,17 @@ 2012-08-22 Martin Rudalics - * window.el (walk-window-tree, window-with-parameter): New - optional argument MINIBUF to control whether these functions + * window.el (walk-window-tree, window-with-parameter): + New optional argument MINIBUF to control whether these functions should run on the minibuffer window. (window-at-side-list): Don't operate on minibuffer window. (window-in-direction): Simplify and rewrite doc-string. - (window--size-ignore): Rename to window--size-ignore-p. Update - callers. + (window--size-ignore): Rename to window--size-ignore-p. + Update callers. (display-buffer-in-atom-window, window--major-non-side-window) (window--major-side-window, display-buffer-in-major-side-window) - (delete-side-window, display-buffer-in-side-window): New - functions. + (delete-side-window, display-buffer-in-side-window): + New functions. (window--side-check, window-deletable-p, delete-window) (delete-other-windows, split-window): Handle side windows and atomic windows appropriately. @@ -192,8 +196,8 @@ * window.el (window-point-1, set-window-point-1): Remove. (window-in-direction, record-window-buffer) (set-window-buffer-start-and-point, split-window-below) - (window--state-get-1, display-buffer-record-window): Replace - calls to window-point-1 and set-window-point-1 by calls to + (window--state-get-1, display-buffer-record-window): + Replace calls to window-point-1 and set-window-point-1 by calls to window-point and set-window-point respectively. 2012-08-21 Glenn Morris @@ -311,8 +315,8 @@ (yank-excluded-properties): Add font-lock-face and category. (yank): Doc fix. - * subr.el (remove-yank-excluded-properties): Obey - yank-handled-properties. The special handling of font-lock-face + * subr.el (remove-yank-excluded-properties): + Obey yank-handled-properties. The special handling of font-lock-face and category is now done this way, instead of being hard-coded. (insert-for-yank-1): Remove font-lock-face handling. (yank-handle-font-lock-face-property) @@ -326,8 +330,8 @@ 2012-08-17 Michael Albinus - * net/tramp-sh.el (tramp-sh-handle-start-file-process): Eliminate - superfluous prompt. (Bug#12203) + * net/tramp-sh.el (tramp-sh-handle-start-file-process): + Eliminate superfluous prompt. (Bug#12203) 2012-08-17 Chong Yidong @@ -354,8 +358,8 @@ (next-buffer, previous-buffer, split-window, balance-windows-2) (set-window-text-height, window-buffer-height) (fit-window-to-buffer, shrink-window-if-larger-than-buffer) - (truncated-partial-width-window-p): Minor code adjustments. In - doc-strings state whether the argument window has to denote a + (truncated-partial-width-window-p): Minor code adjustments. + In doc-strings state whether the argument window has to denote a live, valid or any window. 2012-08-16 Phil Sainty (tiny change) === modified file 'lisp/emacs-lisp/cl-lib.el' --- lisp/emacs-lisp/cl-lib.el 2012-08-15 16:29:11 +0000 +++ lisp/emacs-lisp/cl-lib.el 2012-08-28 19:35:35 +0000 @@ -635,7 +635,8 @@ (set-buffer-modified-p ,flag))) (gv-define-simple-setter buffer-name rename-buffer t) (gv-define-setter buffer-string (store) - `(progn (erase-buffer) (insert ,store))) + ;; Eval `store' first since it may look at the buffer. + (macroexp-let2 nil s store `(progn (erase-buffer) (insert ,s)))) (gv-define-simple-setter buffer-substring cl--set-buffer-substring) (gv-define-simple-setter current-buffer set-buffer) (gv-define-simple-setter current-case-table set-case-table) ------------------------------------------------------------ revno: 109807 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-28 15:26:41 -0400 message: * admin/bzrmerge.el (bzrmerge-merges): Allow unversioned files in the tree. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-08-28 16:08:50 +0000 +++ admin/ChangeLog 2012-08-28 19:26:41 +0000 @@ -1,3 +1,7 @@ +2012-08-28 Glenn Morris + + * bzrmerge.el (bzrmerge-merges): Allow unversioned files in the tree. + 2012-08-28 Andreas Schwab * charsets/mule-charsets.el (header): Fix typo. === modified file 'admin/bzrmerge.el' --- admin/bzrmerge.el 2012-08-11 02:12:12 +0000 +++ admin/bzrmerge.el 2012-08-28 19:26:41 +0000 @@ -45,16 +45,23 @@ (erase-buffer) ;; We generally want to make sure we start with a clean tree, but we also ;; want to allow restarts (i.e. with some part of FROM already merged but - ;; not yet committed). + ;; not yet committed). Unversioned (unknown) files in the tree + ;; are also ok. (call-process "bzr" nil t nil "status" "-v") (goto-char (point-min)) (when (re-search-forward "^conflicts:\n" nil t) (error "You still have unresolved conflicts")) - (let ((merges ())) + (let ((merges ()) + found) (if (not (re-search-forward "^pending merges:\n" nil t)) (when (save-excursion (goto-char (point-min)) - (re-search-forward "^[a-z ]*:\n" nil t)) + (while (and + (re-search-forward "^\\([a-z ]*\\):\n" nil t) + (not + (setq found + (not (equal "unknown" (match-string 1))))))) + found) (error "You still have uncommitted changes")) ;; This is really stupid, but it seems there's no easy way to figure ;; out which revisions have been merged already. The only info I can ------------------------------------------------------------ revno: 109806 committer: Andreas Schwab branch nick: emacs timestamp: Tue 2012-08-28 18:08:50 +0200 message: * admin/charsets/mule-charsets.el (header): Fix typo. * etc/charsets/MULE-ethiopic.map: Fix typo in comment. * etc/charsets/MULE-ipa.map: Likewise. * etc/charsets/MULE-is13194.map: Likewise. * etc/charsets/MULE-lviscii.map: Likewise. * etc/charsets/MULE-sisheng.map: Likewise. * etc/charsets/MULE-tibetan.map: Likewise. * etc/charsets/MULE-uviscii.map: Likewise. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-08-28 16:01:59 +0000 +++ admin/ChangeLog 2012-08-28 16:08:50 +0000 @@ -1,3 +1,7 @@ +2012-08-28 Andreas Schwab + + * charsets/mule-charsets.el (header): Fix typo. + 2012-08-24 Paul Eggert On assertion failure, print backtrace if available. === modified file 'admin/charsets/mule-charsets.el' --- admin/charsets/mule-charsets.el 2011-07-14 01:09:00 +0000 +++ admin/charsets/mule-charsets.el 2012-08-28 16:08:50 +0000 @@ -45,7 +45,7 @@ (defconst header (format - "# Generated by running amdin/charsets/mule-charsets.el in Emacs %d.%d.\n" + "# Generated by running admin/charsets/mule-charsets.el in Emacs %d.%d.\n" emacs-major-version emacs-minor-version)) (dolist (elt charset-alist) === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-08-28 16:01:59 +0000 +++ etc/ChangeLog 2012-08-28 16:08:50 +0000 @@ -1,3 +1,13 @@ +2012-08-28 Andreas Schwab + + * charsets/MULE-ethiopic.map: Fix typo in comment. + * charsets/MULE-ipa.map: Likewise. + * charsets/MULE-is13194.map: Likewise. + * charsets/MULE-lviscii.map: Likewise. + * charsets/MULE-sisheng.map: Likewise. + * charsets/MULE-tibetan.map: Likewise. + * charsets/MULE-uviscii.map: Likewise. + 2012-08-09 Chong Yidong * images/splash.svg, images/splash.png: Tweak SVG paths to improve === modified file 'etc/charsets/MULE-ethiopic.map' --- etc/charsets/MULE-ethiopic.map 2009-06-12 12:34:00 +0000 +++ etc/charsets/MULE-ethiopic.map 2012-08-28 16:08:50 +0000 @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x2121 0x1200 0x2122 0x1201 0x2123 0x1202 === modified file 'etc/charsets/MULE-ipa.map' --- etc/charsets/MULE-ipa.map 2009-06-12 12:34:00 +0000 +++ etc/charsets/MULE-ipa.map 2012-08-28 16:08:50 +0000 @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x20 0x0069 0x21 0x026A 0x22 0x0065 === modified file 'etc/charsets/MULE-is13194.map' --- etc/charsets/MULE-is13194.map 2009-06-12 12:34:00 +0000 +++ etc/charsets/MULE-is13194.map 2012-08-28 16:08:50 +0000 @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x21 0x0901 0x22 0x0902 0x23 0x0903 === modified file 'etc/charsets/MULE-lviscii.map' --- etc/charsets/MULE-lviscii.map 2009-06-12 12:34:00 +0000 +++ etc/charsets/MULE-lviscii.map 2012-08-28 16:08:50 +0000 @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x21 0x1EAF 0x22 0x1EB1 0x23 0x1EB7 === modified file 'etc/charsets/MULE-sisheng.map' --- etc/charsets/MULE-sisheng.map 2009-06-12 12:34:00 +0000 +++ etc/charsets/MULE-sisheng.map 2012-08-28 16:08:50 +0000 @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x21 0x0101 0x22 0x00E1 0x23 0x01CE === modified file 'etc/charsets/MULE-tibetan.map' --- etc/charsets/MULE-tibetan.map 2009-06-12 12:34:00 +0000 +++ etc/charsets/MULE-tibetan.map 2012-08-28 16:08:50 +0000 @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x2130 0x0F00 0x2131 0x0F01 0x2132 0x0F02 === modified file 'etc/charsets/MULE-uviscii.map' --- etc/charsets/MULE-uviscii.map 2009-06-12 12:34:00 +0000 +++ etc/charsets/MULE-uviscii.map 2012-08-28 16:08:50 +0000 @@ -1,4 +1,4 @@ -# Generated by running amdin/charsets/mule-charsets.el in Emacs 22.3. +# Generated by running admin/charsets/mule-charsets.el in Emacs 22.3. 0x21 0x1EAE 0x22 0x1EB0 0x23 0x1EB6 ------------------------------------------------------------ revno: 109805 committer: Jan D. branch nick: trunk timestamp: Tue 2012-08-28 18:05:17 +0200 message: Improve NS dialogs. Add close button, remove ugly casts. * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize button_values to NULL. Call setStykeMask so dialogs get a close button. (windowShouldClose:): Set window_closed. (dealloc): New member, free button_values. (process_dialog:): Make member function. Remove window argument, replace window with self. Count buttons and allocate and store values in button_values. (addButton:value:row:): value is int with the name tag. Call setTag with tag. Remove return self, declare return value as void. (addString:row:): Remove return self, declare return value as void. (addSplit): Remove return self, declare return value as void. (clicked:): Remove return self, declare return value as void. Set dialog_return to button_values[seltag]. Code formatting change. (initFromContents:isQuestion:): Adjust call to process_dialog. Code formatting change. (timeout_handler:): Set timer_fired to YES. (runDialogAt:): Set timer_fired to NO. Handle click on close button as quit. * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL. Add window_closed and button_values. Add void as return value for add(Button|String|Split). addButton takes int instead of Lisp_Object. Add process_dialog as new member. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-28 16:01:59 +0000 +++ src/ChangeLog 2012-08-28 16:05:17 +0000 @@ -1,3 +1,29 @@ +2012-08-28 Jan Djärv + + * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize + button_values to NULL. Call setStykeMask so dialogs get a close button. + (windowShouldClose:): Set window_closed. + (dealloc): New member, free button_values. + (process_dialog:): Make member function. Remove window argument, + replace window with self. Count buttons and allocate and store values + in button_values. + (addButton:value:row:): value is int with the name tag. Call setTag + with tag. Remove return self, declare return value as void. + (addString:row:): Remove return self, declare return value as void. + (addSplit): Remove return self, declare return value as void. + (clicked:): Remove return self, declare return value as void. + Set dialog_return to button_values[seltag]. Code formatting change. + (initFromContents:isQuestion:): Adjust call to process_dialog. + Code formatting change. + (timeout_handler:): Set timer_fired to YES. + (runDialogAt:): Set timer_fired to NO. + Handle click on close button as quit. + + * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL. + Add window_closed and button_values. Add void as return value for + add(Button|String|Split). addButton takes int instead of Lisp_Object. + Add process_dialog as new member. + 2012-08-28 Eli Zaretskii * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-08-28 16:01:59 +0000 +++ src/nsmenu.m 2012-08-28 16:05:17 +0000 @@ -1498,6 +1498,7 @@ NSImage *img; dialog_return = Qundefined; + button_values = NULL; area.origin.x = 3*SPACER; area.origin.y = 2*SPACER; area.size.width = ICONSIZE; @@ -1579,44 +1580,65 @@ [self setOneShot: YES]; [self setReleasedWhenClosed: YES]; [self setHidesOnDeactivate: YES]; + [self setStyleMask: + NSTitledWindowMask|NSClosableWindowMask|NSUtilityWindowMask]; + return self; } - (BOOL)windowShouldClose: (id)sender { + window_closed = YES; [NSApp stop:self]; return NO; } +- (void)dealloc +{ + xfree (button_values); + [super dealloc]; +} -void process_dialog (id window, Lisp_Object list) +- (void)process_dialog: (Lisp_Object) list { - Lisp_Object item; + Lisp_Object item, lst = list; int row = 0; + int buttons = 0, btnnr = 0; + + for (; XTYPE (lst) == Lisp_Cons; lst = XCDR (lst)) + { + item = XCAR (list); + if (XTYPE (item) == Lisp_Cons) + ++buttons; + } + + if (buttons > 0) + button_values = (Lisp_Object *) xmalloc (buttons * sizeof (*button_values)); for (; XTYPE (list) == Lisp_Cons; list = XCDR (list)) { item = XCAR (list); if (XTYPE (item) == Lisp_String) { - [window addString: SSDATA (item) row: row++]; + [self addString: SSDATA (item) row: row++]; } else if (XTYPE (item) == Lisp_Cons) { - [window addButton: SSDATA (XCAR (item)) - value: XCDR (item) row: row++]; + button_values[btnnr] = XCDR (item); + [self addButton: SSDATA (XCAR (item)) value: btnnr row: row++]; + ++btnnr; } else if (NILP (item)) { - [window addSplit]; + [self addSplit]; row = 0; } } } -- addButton: (char *)str value: (Lisp_Object)val row: (int)row +- (void)addButton: (char *)str value: (int)tag row: (int)row { id cell; @@ -1629,15 +1651,13 @@ [cell setTarget: self]; [cell setAction: @selector (clicked: )]; [cell setTitle: [NSString stringWithUTF8String: str]]; - [cell setTag: XHASH (val)]; // FIXME: BIG UGLY HACK!! + [cell setTag: tag]; [cell setBordered: YES]; [cell setEnabled: YES]; - - return self; } -- addString: (char *)str row: (int)row +- (void)addString: (char *)str row: (int)row { id cell; @@ -1650,36 +1670,28 @@ [cell setTitle: [NSString stringWithUTF8String: str]]; [cell setBordered: YES]; [cell setEnabled: NO]; - - return self; } -- addSplit +- (void)addSplit { [matrix addColumn]; cols++; - return self; } -- clicked: sender +- (void)clicked: sender { NSArray *sellist = nil; EMACS_INT seltag; sellist = [sender selectedCells]; - if ([sellist count]<1) - return self; + if ([sellist count] < 1) + return; seltag = [[sellist objectAtIndex: 0] tag]; - if (seltag != XHASH (Qundefined)) // FIXME: BIG UGLY HACK!! - { - dialog_return = seltag; - [NSApp stop:self]; - } - - return self; + dialog_return = button_values[seltag]; + [NSApp stop:self]; } @@ -1691,7 +1703,7 @@ if (XTYPE (contents) == Lisp_Cons) { head = Fcar (contents); - process_dialog (self, Fcdr (contents)); + [self process_dialog: Fcdr (contents)]; } else head = contents; @@ -1711,7 +1723,7 @@ if (cols == 1 && rows > 1) /* Never told where to split */ { [matrix addColumn]; - for (i = 0; i branch nick: trunk timestamp: Tue 2012-08-28 09:01:59 -0700 message: Merge from emacs-24; up to r108124 diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-28 09:01:54 +0000 +++ lisp/ChangeLog 2012-08-28 16:01:59 +0000 @@ -1,3 +1,35 @@ +2012-08-28 Leo Liu + + * progmodes/sh-script.el (sh-dynamic-complete-functions): Adapt to + completion-at-point. (Bug#12220) + + * skeleton.el (skeleton-untabify): Change to nil (bug#12223). + + * progmodes/sh-script.el (sh-indent-comment): Change to t (bug#12267). + +2012-08-28 Stefan Monnier + + * files.el (safe-local-eval-forms): Fix before-save-hook entry to + be buffer-local; add delete-trailing-whitespace (bug#12259). + +2012-08-28 Jeremy Moore (tiny change) + + * progmodes/hideif.el (hif-compress-define-list): + Fix typo. (Bug#11951) + +2012-08-28 Dan Nicolaescu + + * progmodes/hideshow.el (hs-block-end-regexp): Restore lost + buffer local setting. + + * net/rcirc.el (rcirc-split-message): Fix for buffer-local + rcirc-encode-coding-system. + +2012-08-28 Leo Liu + + * net/rcirc.el (rcirc-split-message): New function. + (rcirc-send-message): Use it. (Bug#12051) + 2012-08-28 Juri Linkov * info.el (Info-fontify-node): Hide empty lines at the end of @@ -566,6 +598,7 @@ * files.el (hack-local-variables-filter): If an eval: form is not known to be safe, and enable-local-variables is :safe, then ignore the form totally, as is done for non-eval forms. (Bug#12155) + This is CVE-2012-3479. 2012-08-10 Stefan Monnier === modified file 'lisp/files.el' --- lisp/files.el 2012-08-15 16:29:11 +0000 +++ lisp/files.el 2012-08-28 16:01:59 +0000 @@ -2837,7 +2837,8 @@ ;; This should be here at least as long as Emacs supports write-file-hooks. '((add-hook 'write-file-hooks 'time-stamp) (add-hook 'write-file-functions 'time-stamp) - (add-hook 'before-save-hook 'time-stamp)) + (add-hook 'before-save-hook 'time-stamp nil t) + (add-hook 'before-save-hook 'delete-trailing-whitespace nil t)) "Expressions that are considered safe in an `eval:' local variable. Add expressions to this list if you want Emacs to evaluate them, when they appear in an `eval' local variable specification, without first === modified file 'lisp/net/rcirc.el' --- lisp/net/rcirc.el 2012-08-15 16:29:11 +0000 +++ lisp/net/rcirc.el 2012-08-28 16:01:59 +0000 @@ -802,26 +802,36 @@ (defvar rcirc-max-message-length 420 "Messages longer than this value will be split.") +(defun rcirc-split-message (message) + "Split MESSAGE into chunks within `rcirc-max-message-length'." + ;; `rcirc-encode-coding-system' can have buffer-local value. + (let ((encoding rcirc-encode-coding-system)) + (with-temp-buffer + (insert message) + (goto-char (point-min)) + (let (result) + (while (not (eobp)) + (goto-char (or (byte-to-position rcirc-max-message-length) + (point-max))) + ;; max message length is 512 including CRLF + (while (and (not (bobp)) + (> (length (encode-coding-region + (point-min) (point) encoding t)) + rcirc-max-message-length)) + (forward-char -1)) + (push (delete-and-extract-region (point-min) (point)) result)) + (nreverse result))))) + (defun rcirc-send-message (process target message &optional noticep silent) "Send TARGET associated with PROCESS a privmsg with text MESSAGE. If NOTICEP is non-nil, send a notice instead of privmsg. If SILENT is non-nil, do not print the message in any irc buffer." - ;; max message length is 512 including CRLF - (let* ((response (if noticep "NOTICE" "PRIVMSG")) - (oversize (> (length message) rcirc-max-message-length)) - (text (if oversize - (substring message 0 rcirc-max-message-length) - message)) - (text (if (string= text "") - " " - text)) - (more (if oversize - (substring message rcirc-max-message-length)))) + (let ((response (if noticep "NOTICE" "PRIVMSG"))) (rcirc-get-buffer-create process target) - (rcirc-send-string process (concat response " " target " :" text)) - (unless silent - (rcirc-print process (rcirc-nick process) response target text)) - (when more (rcirc-send-message process target more noticep)))) + (dolist (msg (rcirc-split-message message)) + (rcirc-send-string process (concat response " " target " :" msg)) + (unless silent + (rcirc-print process (rcirc-nick process) response target msg))))) (defvar rcirc-input-ring nil) (defvar rcirc-input-ring-index 0) === modified file 'lisp/progmodes/hideif.el' --- lisp/progmodes/hideif.el 2012-01-19 07:21:25 +0000 +++ lisp/progmodes/hideif.el 2012-08-22 07:17:52 +0000 @@ -1003,7 +1003,7 @@ "Compress the define list ENV into a list of defined symbols only." (let ((new-defs nil)) (dolist (def env new-defs) - (if (hif-lookup (car def)) (push (car env) new-defs))))) + (if (hif-lookup (car def)) (push (car def) new-defs))))) (defun hide-ifdef-set-define-alist (name) "Set the association for NAME to `hide-ifdef-env'." === modified file 'lisp/progmodes/hideshow.el' --- lisp/progmodes/hideshow.el 2012-04-10 23:34:25 +0000 +++ lisp/progmodes/hideshow.el 2012-08-28 16:01:59 +0000 @@ -408,6 +408,8 @@ (defvar hs-block-end-regexp nil "Regexp for end of block.") +(make-variable-buffer-local 'hs-block-end-regexp) + (defvar hs-forward-sexp-func 'forward-sexp "Function used to do a `forward-sexp'. === modified file 'lisp/progmodes/sh-script.el' --- lisp/progmodes/sh-script.el 2012-08-15 16:29:11 +0000 +++ lisp/progmodes/sh-script.el 2012-08-28 16:01:59 +0000 @@ -202,6 +202,11 @@ (require 'comint)) (require 'executable) +(autoload 'comint-completion-at-point "comint") +(autoload 'comint-filename-completion "comint") +(autoload 'shell-command-completion "shell") +(autoload 'shell-environment-variable-completion "shell") + (defvar font-lock-comment-face) (defvar font-lock-set-defaults) (defvar font-lock-string-face) @@ -470,7 +475,6 @@ (define-key map "\C-\M-x" 'sh-execute-region) (define-key map "\C-c\C-x" 'executable-interpret) - (define-key map [remap complete-tag] 'comint-dynamic-complete) (define-key map [remap delete-backward-char] 'backward-delete-char-untabify) (define-key map "\C-c:" 'sh-set-shell) @@ -553,9 +557,9 @@ "Value to use for `skeleton-pair-default-alist' in Shell-Script mode.") (defcustom sh-dynamic-complete-functions - '(shell-dynamic-complete-environment-variable - shell-dynamic-complete-command - comint-dynamic-complete-filename) + '(shell-environment-variable-completion + shell-command-completion + comint-filename-completion) "Functions for doing TAB dynamic completion." :type '(repeat function) :group 'sh-script) @@ -1187,7 +1191,7 @@ :group 'sh-indentation) (put 'sh-basic-offset 'safe-local-variable 'integerp) -(defcustom sh-indent-comment nil +(defcustom sh-indent-comment t "How a comment line is to be indented. nil means leave it as it is; t means indent it as a normal line, aligning it to previous non-blank @@ -1198,6 +1202,7 @@ (const :tag "Indent as a normal line." t) (integer :menu-tag "Indent to this col (0 means first col)." :tag "Indent to column number.") ) + :version "24.3" :group 'sh-indentation) @@ -1485,6 +1490,7 @@ (set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table) (set (make-local-variable 'comint-dynamic-complete-functions) sh-dynamic-complete-functions) + (add-hook 'completion-at-point-functions 'comint-completion-at-point nil t) ;; we can't look if previous line ended with `\' (set (make-local-variable 'comint-prompt-regexp) "^[ \t]*") (set (make-local-variable 'imenu-case-fold-search) nil) @@ -4109,20 +4115,6 @@ ;; various other commands -(autoload 'comint-dynamic-complete "comint" - "Dynamically perform completion at point." t) - -(autoload 'shell-dynamic-complete-command "shell" - "Dynamically complete the command at point." t) - -(autoload 'comint-dynamic-complete-filename "comint" - "Dynamically complete the filename at point." t) - -(autoload 'shell-dynamic-complete-environment-variable "shell" - "Dynamically complete the environment variable at point." t) - - - (defun sh-beginning-of-command () ;; FIXME: Redefine using SMIE. "Move point to successive beginnings of commands." === modified file 'lisp/skeleton.el' --- lisp/skeleton.el 2012-05-18 01:46:20 +0000 +++ lisp/skeleton.el 2012-08-28 16:01:59 +0000 @@ -77,7 +77,7 @@ "Function for transforming a skeleton proxy's aliases' variable value.") (defvaralias 'skeleton-filter 'skeleton-filter-function) -(defvar skeleton-untabify t +(defvar skeleton-untabify nil ; bug#12223 "When non-nil untabifies when deleting backwards with element -ARG.") (defvar skeleton-newline-indent-rigidly nil === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-28 14:09:43 +0000 +++ src/ChangeLog 2012-08-28 16:01:59 +0000 @@ -1,3 +1,12 @@ +2012-08-28 Eli Zaretskii + + * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it + is not one of the heaps we manage. (Bug#12242) + +2012-08-28 Glenn Morris + + * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747) + 2012-08-28 Martin Rudalics * window.c (Fset_window_configuration): Remove handling of === modified file 'src/eval.c' --- src/eval.c 2012-08-26 03:30:56 +0000 +++ src/eval.c 2012-08-28 16:01:59 +0000 @@ -544,11 +544,10 @@ you're making a mistake. Think: what do you want to do when the command is called from a keyboard macro? -This function is meant for implementing advice and other -function-modifying features. Instead of using this, it is sometimes -cleaner to give your function an extra optional argument whose -`interactive' spec specifies non-nil unconditionally (\"p\" is a good -way to do this), or via (not (or executing-kbd-macro noninteractive)). */) +Instead of using this function, it is sometimes cleaner to give your +function an extra optional argument whose `interactive' spec specifies +non-nil unconditionally (\"p\" is a good way to do this), or via +\(not (or executing-kbd-macro noninteractive)). */) (Lisp_Object kind) { return ((INTERACTIVE || !EQ (kind, intern ("interactive"))) === modified file 'src/ralloc.c' --- src/ralloc.c 2012-07-05 18:35:48 +0000 +++ src/ralloc.c 2012-08-28 16:01:59 +0000 @@ -670,6 +670,7 @@ free_bloc (bloc_ptr bloc) { heap_ptr heap = bloc->heap; + heap_ptr h; if (r_alloc_freeze_level) { @@ -699,20 +700,38 @@ bloc->prev->next = bloc->next; } - /* Update the records of which blocs are in HEAP. */ - if (heap->first_bloc == bloc) - { - if (bloc->next != 0 && bloc->next->heap == heap) - heap->first_bloc = bloc->next; - else - heap->first_bloc = heap->last_bloc = NIL_BLOC; - } - if (heap->last_bloc == bloc) - { - if (bloc->prev != 0 && bloc->prev->heap == heap) - heap->last_bloc = bloc->prev; - else - heap->first_bloc = heap->last_bloc = NIL_BLOC; + /* Sometimes, 'heap' obtained from bloc->heap above is not really a + 'heap' structure. It can even be beyond the current break point, + which will cause crashes when we dereference it below (see + bug#12242). Evidently, the reason is bloc allocations done while + use_relocatable_buffers was non-positive, because additional + memory we get then is not recorded in the heaps we manage. If + bloc->heap records such a "heap", we cannot (and don't need to) + update its records. So we validate the 'heap' value by making + sure it is one of the heaps we manage via the heaps linked list, + and don't touch a 'heap' that isn't found there. This avoids + accessing memory we know nothing about. */ + for (h = first_heap; h != NIL_HEAP; h = h->next) + if (heap == h) + break; + + if (h) + { + /* Update the records of which blocs are in HEAP. */ + if (heap->first_bloc == bloc) + { + if (bloc->next != 0 && bloc->next->heap == heap) + heap->first_bloc = bloc->next; + else + heap->first_bloc = heap->last_bloc = NIL_BLOC; + } + if (heap->last_bloc == bloc) + { + if (bloc->prev != 0 && bloc->prev->heap == heap) + heap->last_bloc = bloc->prev; + else + heap->first_bloc = heap->last_bloc = NIL_BLOC; + } } relinquish (); === modified file 'test/ChangeLog' --- test/ChangeLog 2012-08-19 16:19:05 +0000 +++ test/ChangeLog 2012-08-28 16:01:59 +0000 @@ -1,3 +1,8 @@ +2012-08-28 Chong Yidong + + * automated/files.el: Test every combination of values for + enable-local-variables and enable-local-eval. + 2012-08-19 Chong Yidong * redisplay-testsuite.el (test-redisplay): Use switch-to-buffer. === modified file 'test/automated/files.el' --- test/automated/files.el 2012-08-10 07:13:06 +0000 +++ test/automated/files.el 2012-08-14 04:04:25 +0000 @@ -21,32 +21,129 @@ (require 'ert) -(defvar files-test-var1 nil) +;; Set to t if the local variable was set, `query' if the query was +;; triggered. +(defvar files-test-result) + +(defvar files-test-safe-result) +(put 'files-test-safe-result 'safe-local-variable 'booleanp) (defun files-test-fun1 () - (setq files-test-var1 t)) - -(ert-deftest files-test-bug12155 () - "Test for http://debbugs.gnu.org/12155 ." - (with-temp-buffer - (insert "text\n" - ";; Local Variables:\n" - ";; eval: (files-test-fun1)\n" - ";; End:\n") - (let ((enable-local-variables :safe) - (enable-local-eval 'maybe)) - (hack-local-variables) - (should (eq files-test-var1 nil))))) - -(ert-deftest files-test-disable-local-variables () - "Test that setting enable-local-variables to nil works." - (with-temp-buffer - (insert "text\n" - ";; Local Variables:\n" - ";; files-test-var1: t\n" - ";; End:\n") - (let ((enable-local-variables nil)) - (hack-local-variables) - (should (eq files-test-var1 nil))))) + (setq files-test-result t)) + +;; Test combinations: +;; `enable-local-variables' t, nil, :safe, :all, or something else. +;; `enable-local-eval' t, nil, or something else. + +(defvar files-test-local-variable-data + ;; Unsafe eval form + '((("eval: (files-test-fun1)") + (t t (eq files-test-result t)) + (t nil (eq files-test-result nil)) + (t maybe (eq files-test-result 'query)) + (nil t (eq files-test-result nil)) + (nil nil (eq files-test-result nil)) + (nil maybe (eq files-test-result nil)) + (:safe t (eq files-test-result nil)) + (:safe nil (eq files-test-result nil)) + (:safe maybe (eq files-test-result nil)) + (:all t (eq files-test-result t)) + (:all nil (eq files-test-result nil)) + (:all maybe (eq files-test-result t)) ; This combination is ambiguous. + (maybe t (eq files-test-result 'query)) + (maybe nil (eq files-test-result 'query)) + (maybe maybe (eq files-test-result 'query))) + ;; Unsafe local variable value + (("files-test-result: t") + (t t (eq files-test-result 'query)) + (t nil (eq files-test-result 'query)) + (t maybe (eq files-test-result 'query)) + (nil t (eq files-test-result nil)) + (nil nil (eq files-test-result nil)) + (nil maybe (eq files-test-result nil)) + (:safe t (eq files-test-result nil)) + (:safe nil (eq files-test-result nil)) + (:safe maybe (eq files-test-result nil)) + (:all t (eq files-test-result t)) + (:all nil (eq files-test-result t)) + (:all maybe (eq files-test-result t)) + (maybe t (eq files-test-result 'query)) + (maybe nil (eq files-test-result 'query)) + (maybe maybe (eq files-test-result 'query))) + ;; Safe local variable + (("files-test-safe-result: t") + (t t (eq files-test-safe-result t)) + (t nil (eq files-test-safe-result t)) + (t maybe (eq files-test-safe-result t)) + (nil t (eq files-test-safe-result nil)) + (nil nil (eq files-test-safe-result nil)) + (nil maybe (eq files-test-safe-result nil)) + (:safe t (eq files-test-safe-result t)) + (:safe nil (eq files-test-safe-result t)) + (:safe maybe (eq files-test-safe-result t)) + (:all t (eq files-test-safe-result t)) + (:all nil (eq files-test-safe-result t)) + (:all maybe (eq files-test-safe-result t)) + (maybe t (eq files-test-result 'query)) + (maybe nil (eq files-test-result 'query)) + (maybe maybe (eq files-test-result 'query))) + ;; Safe local variable with unsafe value + (("files-test-safe-result: 1") + (t t (eq files-test-result 'query)) + (t nil (eq files-test-result 'query)) + (t maybe (eq files-test-result 'query)) + (nil t (eq files-test-safe-result nil)) + (nil nil (eq files-test-safe-result nil)) + (nil maybe (eq files-test-safe-result nil)) + (:safe t (eq files-test-safe-result nil)) + (:safe nil (eq files-test-safe-result nil)) + (:safe maybe (eq files-test-safe-result nil)) + (:all t (eq files-test-safe-result 1)) + (:all nil (eq files-test-safe-result 1)) + (:all maybe (eq files-test-safe-result 1)) + (maybe t (eq files-test-result 'query)) + (maybe nil (eq files-test-result 'query)) + (maybe maybe (eq files-test-result 'query)))) + "List of file-local variable tests. +Each list element should have the form + + (LOCAL-VARS-LIST . TEST-LIST) + +where LOCAL-VARS-LISTS should be a list of local variable +definitions (strings) and TEST-LIST is a list of tests to +perform. Each entry of TEST-LIST should have the form + + (ENABLE-LOCAL-VARIABLES ENABLE-LOCAL-EVAL FORM) + +where ENABLE-LOCAL-VARIABLES is the value to assign to +`enable-local-variables', ENABLE-LOCAL-EVAL is the value to +assign to `enable-local-eval', and FORM is a desired `should' +form.") + +(defun file-test--do-local-variables-test (str test-settings) + (with-temp-buffer + (insert str) + (let ((enable-local-variables (nth 0 test-settings)) + (enable-local-eval (nth 1 test-settings)) + (files-test-result nil) + (files-test-queried nil) + (files-test-safe-result nil)) + (hack-local-variables) + (eval (nth 2 test-settings))))) + +(ert-deftest files-test-local-variables () + "Test the file-local variables implementation." + (unwind-protect + (progn + (defadvice hack-local-variables-confirm (around files-test activate) + (setq files-test-result 'query) + nil) + (dolist (test files-test-local-variable-data) + (let ((str (concat "text\n\n;; Local Variables:\n;; " + (mapconcat 'identity (car test) "\n;; ") + "\n;; End:\n"))) + (dolist (subtest (cdr test)) + (should (file-test--do-local-variables-test str subtest)))))) + (ad-disable-advice 'hack-local-variables-confirm 'around 'files-test))) ;;; files.el ends here ------------------------------------------------------------ revno: 109803 committer: martin rudalics branch nick: trunk timestamp: Tue 2012-08-28 16:09:43 +0200 message: In Fset_window_configuration install revison of reverted fix. * window.c (Fset_window_configuration): Install revision of reverted fix. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-28 13:51:09 +0000 +++ src/ChangeLog 2012-08-28 14:09:43 +0000 @@ -1,7 +1,8 @@ 2012-08-28 Martin Rudalics * window.c (Fset_window_configuration): Remove handling of - auto-buffer-name window parameter. + auto-buffer-name window parameter. Install revision of reverted + fix. 2012-08-28 Dmitry Antipov === modified file 'src/window.c' --- src/window.c 2012-08-28 13:51:09 +0000 +++ src/window.c 2012-08-28 14:09:43 +0000 @@ -5615,6 +5615,21 @@ int previous_frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f); int previous_frame_tool_bar_lines = FRAME_TOOL_BAR_LINES (f); + /* Don't do this within the main loop below: This may call Lisp + code and is thus potentially unsafe while input is blocked. */ + for (k = 0; k < saved_windows->header.size; k++) + { + p = SAVED_WINDOW_N (saved_windows, k); + window = p->window; + w = XWINDOW (window); + if (!NILP (w->buffer) + && !EQ (w->buffer, p->buffer) + && !NILP (BVAR (XBUFFER (p->buffer), name))) + /* If a window we restore gets another buffer, record the + window's old buffer. */ + call1 (Qrecord_window_buffer, window); + } + /* The mouse highlighting code could get screwed up if it runs during this. */ BLOCK_INPUT; ------------------------------------------------------------ revno: 109802 committer: martin rudalics branch nick: trunk timestamp: Tue 2012-08-28 15:51:09 +0200 message: Remove handling of auto-buffer-name window parameter. * window.c (Fset_window_configuration): Remove handling of auto-buffer-name window parameter. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-28 10:59:17 +0000 +++ src/ChangeLog 2012-08-28 13:51:09 +0000 @@ -1,3 +1,8 @@ +2012-08-28 Martin Rudalics + + * window.c (Fset_window_configuration): Remove handling of + auto-buffer-name window parameter. + 2012-08-28 Dmitry Antipov Do not allow to set major mode for a dead buffer. === modified file 'src/window.c' --- src/window.c 2012-08-28 06:20:08 +0000 +++ src/window.c 2012-08-28 13:51:09 +0000 @@ -62,7 +62,7 @@ static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; static Lisp_Object Qsafe, Qabove, Qbelow; -static Lisp_Object Qauto_buffer_name, Qclone_of; +static Lisp_Object Qclone_of; static int displayed_window_lines (struct window *); static int count_windows (struct window *); @@ -5540,7 +5540,6 @@ struct Lisp_Vector *saved_windows; Lisp_Object new_current_buffer; Lisp_Object frame; - Lisp_Object auto_buffer_name; FRAME_PTR f; ptrdiff_t old_point = -1; @@ -5794,18 +5793,6 @@ BUF_PT_BYTE (XBUFFER (w->buffer))); w->start_at_line_beg = 1; } - else if (STRINGP (auto_buffer_name = - Fwindow_parameter (window, Qauto_buffer_name)) - && SCHARS (auto_buffer_name) != 0 - && (wset_buffer (w, Fget_buffer_create (auto_buffer_name)), - !NILP (w->buffer))) - { - set_marker_restricted (w->start, - make_number (0), w->buffer); - set_marker_restricted (w->pointm, - make_number (0), w->buffer); - w->start_at_line_beg = 1; - } else /* Window has no live buffer, get one. */ { @@ -6711,7 +6698,6 @@ DEFSYM (Qtemp_buffer_show_hook, "temp-buffer-show-hook"); DEFSYM (Qabove, "above"); DEFSYM (Qbelow, "below"); - DEFSYM (Qauto_buffer_name, "auto-buffer-name"); DEFSYM (Qclone_of, "clone-of"); staticpro (&Vwindow_list); ------------------------------------------------------------ revno: 109801 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-08-28 14:59:17 +0400 message: Do not allow to set major mode for a dead buffer. * buffer.c (Fset_buffer_major_mode): Signal an error if the buffer is dead. (Fother_buffer, other_buffer_safely): Remove redundant nested declaration. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-28 06:20:08 +0000 +++ src/ChangeLog 2012-08-28 10:59:17 +0000 @@ -1,5 +1,13 @@ 2012-08-28 Dmitry Antipov + Do not allow to set major mode for a dead buffer. + * buffer.c (Fset_buffer_major_mode): Signal an error + if the buffer is dead. + (Fother_buffer, other_buffer_safely): Remove redundant + nested declaration. + +2012-08-28 Dmitry Antipov + Always use set_buffer_if_live to restore original buffer at unwind. * buffer.h (record_unwind_current_buffer): New function. * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c: === modified file 'src/buffer.c' --- src/buffer.c 2012-08-28 06:20:08 +0000 +++ src/buffer.c 2012-08-28 10:59:17 +0000 @@ -1553,7 +1553,6 @@ exists, return the buffer `*scratch*' (creating it if necessary). */) (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame) { - Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer); Lisp_Object tail, buf, pred; Lisp_Object notsogood = Qnil; @@ -1624,7 +1623,6 @@ Lisp_Object other_buffer_safely (Lisp_Object buffer) { - Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer); Lisp_Object tail, buf; tail = Vbuffer_alist; @@ -2064,8 +2062,10 @@ CHECK_BUFFER (buffer); - if (STRINGP (BVAR (XBUFFER (buffer), name)) - && strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0) + if (NILP (BVAR (XBUFFER (buffer), name))) + error ("Attempt to set major mode for a dead buffer"); + + if (strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0) function = find_symbol_value (intern ("initial-major-mode")); else { ------------------------------------------------------------ revno: 109800 committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2012-08-28 09:40:11 +0000 message: gnus-sum.el (gnus-summary-enter-digest-group): Work for encoding and charset diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-08-22 10:37:55 +0000 +++ lisp/gnus/ChangeLog 2012-08-28 09:40:11 +0000 @@ -1,3 +1,9 @@ +2012-08-28 Katsumi Yamaoka + + * gnus-sum.el (gnus-summary-enter-digest-group): Decode content + transfer encoding first; bind gnus-newsgroup-charset to the charset + that the article specifies (Bug#12209). + 2012-08-22 Katsumi Yamaoka * gnus-cus.el (gnus-group-customize): Decode values posting-style holds. === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2012-07-24 22:17:17 +0000 +++ lisp/gnus/gnus-sum.el 2012-08-28 09:40:11 +0000 @@ -9137,7 +9137,7 @@ (list (cons 'save-article-group ogroup)))) (case-fold-search t) (buf (current-buffer)) - dig to-address) + dig to-address charset) (with-current-buffer gnus-original-article-buffer ;; Have the digest group inherit the main mail address of ;; the parent article. @@ -9150,16 +9150,32 @@ to-address)))))) (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) (insert-buffer-substring gnus-original-article-buffer) - ;; Remove lines that may lead nndoc to misinterpret the - ;; document type. (narrow-to-region (goto-char (point-min)) (or (search-forward "\n\n" nil t) (point))) + ;; Remove lines that may lead nndoc to misinterpret the + ;; document type. (goto-char (point-min)) (delete-matching-lines "^Path:\\|^From ") + ;; Parse charset, and decode content transfer encoding. + (setq charset (mail-content-type-get + (mail-header-parse-content-type + (or (gnus-fetch-field "content-type") "")) + 'charset)) + (let ((encoding (gnus-fetch-field "content-transfer-encoding"))) + (when encoding + (message-remove-header "content-transfer-encoding") + (goto-char (point-max)) + (widen) + (narrow-to-region (point) (point-max)) + (mm-decode-content-transfer-encoding + (intern (downcase (mail-header-strip encoding)))))) (widen)) (unwind-protect - (if (let ((gnus-newsgroup-ephemeral-charset gnus-newsgroup-charset) + (if (let ((gnus-newsgroup-ephemeral-charset + (if charset + (intern (downcase (gnus-strip-whitespace charset))) + gnus-newsgroup-charset)) (gnus-newsgroup-ephemeral-ignored-charsets gnus-newsgroup-ignored-charsets)) (gnus-group-read-ephemeral-group ------------------------------------------------------------ revno: 109799 fixes bug: http://debbugs.gnu.org/12272 committer: Juri Linkov branch nick: trunk timestamp: Tue 2012-08-28 12:01:54 +0300 message: * lisp/info.el (Info-fontify-node): Hide empty lines at the end of the node. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-27 09:05:55 +0000 +++ lisp/ChangeLog 2012-08-28 09:01:54 +0000 @@ -1,3 +1,8 @@ +2012-08-28 Juri Linkov + + * info.el (Info-fontify-node): Hide empty lines at the end of + the node. (Bug#12272) + 2012-08-27 Drew Adams * dired.el (dired-pop-to-buffer): Make window start at beginning === modified file 'lisp/info.el' --- lisp/info.el 2012-08-22 23:30:47 +0000 +++ lisp/info.el 2012-08-28 09:01:54 +0000 @@ -4825,6 +4825,12 @@ mouse-face highlight help-echo "mouse-2: go to this URL")))) + ;; Hide empty lines at the end of the node. + (goto-char (point-max)) + (skip-chars-backward "\n") + (when (< (1+ (point)) (point-max)) + (put-text-property (1+ (point)) (point-max) 'invisible t)) + (set-buffer-modified-p nil)))) ;;; Speedbar support: ------------------------------------------------------------ revno: 109798 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-08-28 10:20:08 +0400 message: Always use set_buffer_if_live to restore original buffer at unwind. * buffer.h (record_unwind_current_buffer): New function. * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c: * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c: * undo.c, window.c: Adjust users. * buffer.c (set_buffer_if_live): Fix comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-28 05:49:02 +0000 +++ src/ChangeLog 2012-08-28 06:20:08 +0000 @@ -1,5 +1,14 @@ 2012-08-28 Dmitry Antipov + Always use set_buffer_if_live to restore original buffer at unwind. + * buffer.h (record_unwind_current_buffer): New function. + * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c: + * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c: + * undo.c, window.c: Adjust users. + * buffer.c (set_buffer_if_live): Fix comment. + +2012-08-28 Dmitry Antipov + Fix usage of set_buffer_internal. * buffer.h (set_buffer_internal): Make it BUFFER_INLINE. * buffer.c (set_buffer_if_live): Use set_buffer_internal. === modified file 'src/buffer.c' --- src/buffer.c 2012-08-28 05:49:02 +0000 +++ src/buffer.c 2012-08-28 06:20:08 +0000 @@ -2204,7 +2204,7 @@ return buffer; } -/* Set the current buffer to BUFFER provided it is alive. */ +/* Set the current buffer to BUFFER provided if it is alive. */ Lisp_Object set_buffer_if_live (Lisp_Object buffer) === modified file 'src/buffer.h' --- src/buffer.h 2012-08-28 05:49:02 +0000 +++ src/buffer.h 2012-08-28 06:20:08 +0000 @@ -1038,6 +1038,15 @@ set_buffer_internal_1 (b); } +/* Arrange to go back to the original buffer after the next + call to unbind_to if the original buffer is still alive. */ + +BUFFER_INLINE void +record_unwind_current_buffer (void) +{ + record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); +} + /* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements. If NEXTP is non-NULL, return next overlay there. See overlay_at arg CHANGE_REQ for meaning of CHRQ arg. */ === modified file 'src/bytecode.c' --- src/bytecode.c 2012-08-25 03:11:12 +0000 +++ src/bytecode.c 2012-08-28 06:20:08 +0000 @@ -1051,7 +1051,7 @@ CASE (Bsave_current_buffer): /* Obsolete since ??. */ CASE (Bsave_current_buffer_1): - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); + record_unwind_current_buffer (); NEXT; CASE (Bsave_window_excursion): /* Obsolete since 24.1. */ === modified file 'src/dispnew.c' --- src/dispnew.c 2012-08-28 00:33:56 +0000 +++ src/dispnew.c 2012-08-28 06:20:08 +0000 @@ -5762,7 +5762,7 @@ UNBLOCK_INPUT; - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); run_window_configuration_change_hook (f); === modified file 'src/editfns.c' --- src/editfns.c 2012-08-21 23:39:56 +0000 +++ src/editfns.c 2012-08-28 06:20:08 +0000 @@ -946,13 +946,10 @@ usage: (save-current-buffer &rest BODY) */) (Lisp_Object args) { - Lisp_Object val; ptrdiff_t count = SPECPDL_INDEX (); - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); - - val = Fprogn (args); - return unbind_to (count, val); + record_unwind_current_buffer (); + return unbind_to (count, Fprogn (args)); } DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0, === modified file 'src/fileio.c' --- src/fileio.c 2012-08-28 05:49:02 +0000 +++ src/fileio.c 2012-08-28 06:20:08 +0000 @@ -3480,7 +3480,7 @@ Lisp_Object workbuf; struct buffer *buf; - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); workbuf = Fget_buffer_create (build_string (" *code-converting-work*")); buf = XBUFFER (workbuf); === modified file 'src/fns.c' --- src/fns.c 2012-08-28 05:49:02 +0000 +++ src/fns.c 2012-08-28 06:20:08 +0000 @@ -4656,7 +4656,7 @@ { struct buffer *prev = current_buffer; - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); CHECK_BUFFER (object); === modified file 'src/insdel.c' --- src/insdel.c 2012-08-28 05:49:02 +0000 +++ src/insdel.c 2012-08-28 06:20:08 +0000 @@ -2117,7 +2117,7 @@ return Qnil; } - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (combine_after_change_buffer); === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-28 05:49:02 +0000 +++ src/keyboard.c 2012-08-28 06:20:08 +0000 @@ -9572,7 +9572,7 @@ because we may get input from a subprocess which wants to change the selected window and stuff (say, emacsclient). */ - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); if (! FRAME_LIVE_P (XFRAME (selected_frame))) Fkill_emacs (Qnil); === modified file 'src/keymap.c' --- src/keymap.c 2012-08-18 06:06:39 +0000 +++ src/keymap.c 2012-08-28 06:20:08 +0000 @@ -1570,9 +1570,7 @@ would not be a problem here, but it is easier to keep things the same. */ - - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - + record_unwind_current_buffer (); set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); } } === modified file 'src/minibuf.c' --- src/minibuf.c 2012-08-18 06:06:39 +0000 +++ src/minibuf.c 2012-08-28 06:20:08 +0000 @@ -817,7 +817,7 @@ while the buffer doesn't know about them any more. */ delete_all_overlays (XBUFFER (buf)); reset_buffer (XBUFFER (buf)); - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (buf); if (!NILP (Ffboundp (intern ("minibuffer-inactive-mode")))) call0 (intern ("minibuffer-inactive-mode")); === modified file 'src/print.c' --- src/print.c 2012-08-28 05:49:02 +0000 +++ src/print.c 2012-08-28 06:20:08 +0000 @@ -487,7 +487,7 @@ register struct buffer *old = current_buffer; register Lisp_Object buf; - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (Fget_buffer_create (build_string (bufname))); === modified file 'src/process.c' --- src/process.c 2012-08-27 17:23:48 +0000 +++ src/process.c 2012-08-28 06:20:08 +0000 @@ -5196,7 +5196,7 @@ /* There's no good reason to let process filters change the current buffer, and many callers of accept-process-output, sit-for, and friends don't expect current-buffer to be changed from under them. */ - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); + record_unwind_current_buffer (); /* Read and dispose of the process output. */ outstream = p->filter; @@ -6587,7 +6587,7 @@ /* There's no good reason to let sentinels change the current buffer, and many callers of accept-process-output, sit-for, and friends don't expect current-buffer to be changed from under them. */ - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); + record_unwind_current_buffer (); sentinel = p->sentinel; if (NILP (sentinel)) === modified file 'src/textprop.c' --- src/textprop.c 2012-08-17 21:12:11 +0000 +++ src/textprop.c 2012-08-28 06:20:08 +0000 @@ -760,7 +760,7 @@ if (BUFFERP (object) && current_buffer != XBUFFER (object)) { - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (object); } @@ -843,7 +843,7 @@ if (BUFFERP (object) && current_buffer != XBUFFER (object)) { - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (object); } === modified file 'src/undo.c' --- src/undo.c 2012-08-18 06:06:39 +0000 +++ src/undo.c 2012-08-28 06:20:08 +0000 @@ -324,7 +324,7 @@ /* Make the buffer current to get its local values of variables such as undo_limit. Also so that Vundo_outer_limit_function can tell which buffer to operate on. */ - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); + record_unwind_current_buffer (); set_buffer_internal (b); list = BVAR (b, undo_list); === modified file 'src/window.c' --- src/window.c 2012-08-27 21:07:32 +0000 +++ src/window.c 2012-08-28 06:20:08 +0000 @@ -3101,7 +3101,7 @@ /* Use the right buffer. Matters when running the local hooks. */ if (current_buffer != XBUFFER (Fwindow_buffer (Qnil))) { - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (Fwindow_buffer (Qnil)); } @@ -3205,7 +3205,7 @@ because that might itself be a local variable. */ if (window_initialized) { - record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); + record_unwind_current_buffer (); Fset_buffer (buffer); } ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.