------------------------------------------------------------ revno: 116779 fixes bug: http://debbugs.gnu.org/16971 committer: Dmitry Gutov branch nick: trunk timestamp: Mon 2014-03-17 08:48:09 +0200 message: Restore compatibility with legacy comment-start-skip values * lisp/newcomment.el (comment-beginning): If `comment-start-skip' doesn't match, move back one char and try again. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-17 06:22:58 +0000 +++ lisp/ChangeLog 2014-03-17 06:48:09 +0000 @@ -1,5 +1,8 @@ 2014-03-17 Dmitry Gutov + * newcomment.el (comment-beginning): If `comment-start-skip' + doesn't match, move back one char and try again. (Bug#16971) + * emacs-lisp/lisp-mode.el (lisp-mode-variables): Set `comment-use-syntax' to t to avoid the unnecessary runtime check. Set `comment-start-skip' to a simpler value that doesn't try to === modified file 'lisp/newcomment.el' --- lisp/newcomment.el 2014-01-01 07:43:34 +0000 +++ lisp/newcomment.el 2014-03-17 06:48:09 +0000 @@ -523,7 +523,12 @@ (when (nth 4 state) (goto-char (nth 8 state)) (prog1 (point) - (when (looking-at comment-start-skip) + (when (or (looking-at comment-start-skip) + ;; Some older modes use regexps that check the + ;; char before the comment for quoting. (Bug#16971) + (save-excursion + (forward-char -1) + (looking-at comment-start-skip))) (goto-char (match-end 0)))))) ;; Can't rely on the syntax table, let's guess based on font-lock. (unless (eq (get-text-property (point) 'face) 'font-lock-string-face) ------------------------------------------------------------ revno: 116778 fixes bug: http://debbugs.gnu.org/16971 committer: Dmitry Gutov branch nick: trunk timestamp: Mon 2014-03-17 08:22:58 +0200 message: Fix debbugs#16971 * lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): Set `comment-use-syntax' to t to avoid the unnecessary runtime check. Set `comment-start-skip' to a simpler value that doesn't try to check if the semicolon is escaped (this is handled by `syntax-ppss' now). * lisp/progmodes/scheme.el (scheme-mode-variables): Same. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-16 09:26:58 +0000 +++ lisp/ChangeLog 2014-03-17 06:22:58 +0000 @@ -1,3 +1,13 @@ +2014-03-17 Dmitry Gutov + + * emacs-lisp/lisp-mode.el (lisp-mode-variables): Set + `comment-use-syntax' to t to avoid the unnecessary runtime check. + Set `comment-start-skip' to a simpler value that doesn't try to + check if the semicolon is escaped (this is handled by + `syntax-ppss' now). (Bug#16971) + + * progmodes/scheme.el (scheme-mode-variables): Same. + 2014-03-16 Martin Rudalics Fix behavior of with-temp-buffer-window (Bug#16816, Bug#17007). === modified file 'lisp/emacs-lisp/lisp-mode.el' --- lisp/emacs-lisp/lisp-mode.el 2014-02-10 01:34:22 +0000 +++ lisp/emacs-lisp/lisp-mode.el 2014-03-17 06:22:58 +0000 @@ -449,15 +449,10 @@ (setq-local outline-level 'lisp-outline-level) (setq-local add-log-current-defun-function #'lisp-current-defun-name) (setq-local comment-start ";") - ;; Look within the line for a ; following an even number of backslashes - ;; after either a non-backslash or the line beginning. - (setq-local comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") - ;; Font lock mode uses this only when it KNOWS a comment is starting. - (setq-local font-lock-comment-start-skip ";+ *") + (setq-local comment-start-skip ";+ *") (setq-local comment-add 1) ;default to `;;' in comment-region (setq-local comment-column 40) - ;; Don't get confused by `;' in doc strings when paragraph-filling. - (setq-local comment-use-global-state t) + (setq-local comment-use-syntax t) (setq-local imenu-generic-expression lisp-imenu-generic-expression) (setq-local multibyte-syntax-as-symbol t) ;; (setq-local syntax-begin-function 'beginning-of-defun) ;;Bug#16247. === modified file 'lisp/progmodes/scheme.el' --- lisp/progmodes/scheme.el 2014-01-01 07:43:34 +0000 +++ lisp/progmodes/scheme.el 2014-03-17 06:22:58 +0000 @@ -140,11 +140,8 @@ (setq-local add-log-current-defun-function #'lisp-current-defun-name) (setq-local comment-start ";") (setq-local comment-add 1) - ;; Look within the line for a ; following an even number of backslashes - ;; after either a non-backslash or the line beginning. - (setq-local comment-start-skip - "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*") - (setq-local font-lock-comment-start-skip ";+ *") + (setq-local comment-start-skip ";+[ \t]*") + (setq-local comment-use-syntax t) (setq-local comment-column 40) (setq-local parse-sexp-ignore-comments t) (setq-local lisp-indent-function 'scheme-indent-function) ------------------------------------------------------------ revno: 116777 [merge] committer: Bill Wohler branch nick: trunk timestamp: Sun 2014-03-16 17:50:05 -0700 message: Merge from mh-e; up to r106766. diff: === modified file 'lisp/mh-e/ChangeLog' --- lisp/mh-e/ChangeLog 2014-03-06 02:02:46 +0000 +++ lisp/mh-e/ChangeLog 2014-03-17 00:50:05 +0000 @@ -1,3 +1,9 @@ +2014-03-16 Bill Wohler + + * mh-folder.el (mh-regenerate-headers): Fix scan: bad message list + `unseen' error (closes SF #471). + * mh-e.el (mh-version): Add +bzr to version. + 2014-03-06 Glenn Morris * mh-compat.el (mh-display-completion-list): === modified file 'lisp/mh-e/mh-e.el' --- lisp/mh-e/mh-e.el 2014-01-01 07:43:34 +0000 +++ lisp/mh-e/mh-e.el 2014-02-24 02:04:35 +0000 @@ -5,7 +5,7 @@ ;; Author: Bill Wohler ;; Maintainer: Bill Wohler -;; Version: 8.5 +;; Version: 8.5+bzr ;; Keywords: mail ;; This file is part of GNU Emacs. @@ -127,7 +127,7 @@ ;; Try to keep variables local to a single file. Provide accessors if ;; variables are shared. Use this section as a last resort. -(defconst mh-version "8.5" "Version number of MH-E.") +(defconst mh-version "8.5+bzr" "Version number of MH-E.") ;; Variants === modified file 'lisp/mh-e/mh-folder.el' --- lisp/mh-e/mh-folder.el 2014-01-01 07:43:34 +0000 +++ lisp/mh-e/mh-folder.el 2014-02-24 02:04:35 +0000 @@ -1817,15 +1817,13 @@ "-width" (window-width) folder range) (goto-char scan-start) - (cond ((looking-at "scan: no messages in") - (keep-lines mh-scan-valid-regexp)) ; Flush random scan lines - ((looking-at (if (mh-variant-p 'gnu-mh) - "scan: message set .* does not exist" - "scan: bad message list ")) - (keep-lines mh-scan-valid-regexp)) - ((looking-at "scan: ")) ; Keep error messages + (cond ((or (looking-at "scan: no messages in") + (looking-at "scan: message set .* does not exist") + (looking-at "scan: bad message list ")) + (keep-lines mh-scan-valid-regexp)) ; flush common scan output + ((looking-at "scan: ")) ; keep unexpected error messages (t - (keep-lines mh-scan-valid-regexp))) ; Flush random scan lines + (keep-lines mh-scan-valid-regexp))) ; flush random scan output (setq mh-seq-list (mh-read-folder-sequences folder nil)) (mh-notate-user-sequences) (or update === modified file 'lisp/mh-e/mh-thread.el' --- lisp/mh-e/mh-thread.el 2014-01-01 07:43:34 +0000 +++ lisp/mh-e/mh-thread.el 2014-02-24 02:04:35 +0000 @@ -27,9 +27,11 @@ ;; The threading portion of this files tries to implement the ;; algorithm described at: ;; http://www.jwz.org/doc/threading.html -;; It also begins to implement the IMAP Threading extension RFC. The -;; implementation lacks the reference and subject canonicalization of -;; the RFC. +;; It also begins to implement the threading section of the IMAP - +;; SORT and THREAD Extensions RFC at: +;; http://tools.ietf.org/html/rfc5256 +;; The implementation lacks the reference and subject canonicalization +;; of the RFC. ;; In the presentation buffer, children messages are shown indented ;; with either [ ] or < > around them. Square brackets ([ ]) denote ------------------------------------------------------------ revno: 116776 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2014-03-16 18:31:50 +0200 message: src/ChangeLog: Fix a typo in last commit. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-16 16:28:34 +0000 +++ src/ChangeLog 2014-03-16 16:31:50 +0000 @@ -1,7 +1,7 @@ 2014-03-16 Eli Zaretskii * search.c (find_newline): Speed up the function when using the - newline cache, by halving the number of call to + newline cache, by halving the number of calls to region_cache_forward and region_cache_backward. (Bug#16830) 2014-03-15 Juanma Barranquero ------------------------------------------------------------ revno: 116775 fixes bug: http://debbugs.gnu.org/16830 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2014-03-16 18:28:34 +0200 message: Fix bug #16830 with slow search for newlines in forward-line. src/search.c (find_newline): Speed up the function when using the newline cache, by halving the number of calls to region_cache_forward and region_cache_backward. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-15 11:16:12 +0000 +++ src/ChangeLog 2014-03-16 16:28:34 +0000 @@ -1,3 +1,9 @@ +2014-03-16 Eli Zaretskii + + * search.c (find_newline): Speed up the function when using the + newline cache, by halving the number of call to + region_cache_forward and region_cache_backward. (Bug#16830) + 2014-03-15 Juanma Barranquero * buffer.c (Fset_buffer): Document return value (bug#17015). === modified file 'src/search.c' --- src/search.c 2014-01-01 17:44:48 +0000 +++ src/search.c 2014-03-16 16:28:34 +0000 @@ -715,19 +715,62 @@ examine. */ ptrdiff_t tem, ceiling_byte = end_byte - 1; - /* If we're looking for a newline, consult the newline cache - to see where we can avoid some scanning. */ + /* If we're using the newline cache, consult it to see whether + we can avoid some scanning. */ if (newline_cache) { ptrdiff_t next_change; + int result = 1; + immediate_quit = 0; - while (region_cache_forward - (cache_buffer, newline_cache, start, &next_change)) - start = next_change; + while (start < end && result) + { + ptrdiff_t lim1; + + result = region_cache_forward (cache_buffer, newline_cache, + start, &next_change); + if (result) + { + start = next_change; + lim1 = next_change = end; + } + else + lim1 = min (next_change, end); + + /* The cache returned zero for this region; see if + this is because the region is known and includes + only newlines. While at that, count any newlines + we bump into, and exit if we found enough off them. */ + start_byte = CHAR_TO_BYTE (start); + while (start < lim1 + && FETCH_BYTE (start_byte) == '\n') + { + start_byte++; + start++; + if (--count == 0) + { + if (bytepos) + *bytepos = start_byte; + return start; + } + } + /* If we found a non-newline character before hitting + position where the cache will again return non-zero + (i.e. no newlines beyond that position), it means + this region is not yet known to the cache, and we + must resort to the "dumb loop" method. */ + if (start < next_change && !result) + break; + result = 1; + } + if (start >= end) + { + start = end; + start_byte = end_byte; + break; + } immediate_quit = allow_quit; - start_byte = CHAR_TO_BYTE (start); - /* START should never be after END. */ if (start_byte > ceiling_byte) start_byte = ceiling_byte; @@ -762,9 +805,9 @@ unsigned char *nl = memchr (lim_addr + cursor, '\n', - cursor); next = nl ? nl - lim_addr : 0; - /* If we're looking for newlines, cache the fact that - this line's region is free of them. */ - if (newline_cache) + /* If we're using the newline cache, cache the fact that + the region we just traversed is free of newlines. */ + if (newline_cache && cursor != next) { know_region_cache (cache_buffer, newline_cache, BYTE_TO_CHAR (lim_byte + cursor), @@ -800,14 +843,47 @@ if (newline_cache) { ptrdiff_t next_change; + int result = 1; + immediate_quit = 0; - while (region_cache_backward - (cache_buffer, newline_cache, start, &next_change)) - start = next_change; + while (start > end && result) + { + ptrdiff_t lim1; + + result = region_cache_backward (cache_buffer, newline_cache, + start, &next_change); + if (result) + { + start = next_change; + lim1 = next_change = end; + } + else + lim1 = max (next_change, end); + start_byte = CHAR_TO_BYTE (start); + while (start > lim1 + && FETCH_BYTE (start_byte - 1) == '\n') + { + if (++count == 0) + { + if (bytepos) + *bytepos = start_byte; + return start; + } + start_byte--; + start--; + } + if (start > next_change && !result) + break; + result = 1; + } + if (start <= end) + { + start = end; + start_byte = end_byte; + break; + } immediate_quit = allow_quit; - start_byte = CHAR_TO_BYTE (start); - /* Start should never be at or before end. */ if (start_byte <= ceiling_byte) start_byte = ceiling_byte + 1; @@ -840,7 +916,7 @@ /* If we're looking for newlines, cache the fact that this line's region is free of them. */ - if (newline_cache) + if (newline_cache && cursor != prev + 1) { know_region_cache (cache_buffer, newline_cache, BYTE_TO_CHAR (ceiling_byte + prev + 1), ------------------------------------------------------------ revno: 116774 committer: martin rudalics branch nick: trunk timestamp: Sun 2014-03-16 10:26:58 +0100 message: Fix behavior of with-temp-buffer-window (Bug#16816, Bug#17007). * window.el (with-temp-buffer-window): Don't make BUFFER-OR-NAME current (Bug#16816, Bug#17007). (with-current-buffer-window): New macro doing the same as `with-temp-buffer-window' but with BUFFER-OR-NAME current. * help.el (help-print-return-message): Warn in doc-string to not use this in `with-help-window'. (describe-bindings-internal): Call `describe-buffer-bindings' from within help buffer. See Juanma's scenario in (Bug#16816). (with-help-window): Update doc-string. * dired.el (dired-mark-pop-up): * files.el (save-buffers-kill-emacs): * register.el (register-preview): Use `with-current-buffer-window' instead of `with-temp-buffer-window'. * display.texi (Temporary Displays): Rewrite descriptions of `with-output-to-temp-buffer' and `with-temp-buffer-window'. * help.texi (Help Functions): Rewrite description of `with-help-window'. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-15 03:07:06 +0000 +++ doc/lispref/ChangeLog 2014-03-16 09:26:58 +0000 @@ -1,3 +1,10 @@ +2014-03-16 Martin Rudalics + + * display.texi (Temporary Displays): Rewrite descriptions of + `with-output-to-temp-buffer' and `with-temp-buffer-window'. + * help.texi (Help Functions): Rewrite description of + `with-help-window'. + 2014-03-15 Dmitry Gutov * display.texi (Blinking): Update WRT to the new @@ -6,7 +13,7 @@ 2014-03-14 Martin Rudalics * display.texi (Temporary Displays): Say that - with-temp-buffer-window makes its buffer current. + `with-temp-buffer-window' makes its buffer current. * frames.texi (Size and Position): Describe new option `frame-resize-pixelwise'. Rewrite descriptions of `set-frame-size', `set-frame-height' and `set-frame-width'. === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2014-03-15 03:07:06 +0000 +++ doc/lispref/display.texi 2014-03-16 09:26:58 +0000 @@ -1094,29 +1094,29 @@ buffer and then present it to the user for perusal rather than for editing. Many help commands use this feature. -@defmac with-output-to-temp-buffer buffer-name forms@dots{} -This function executes @var{forms} while arranging to insert any output -they print into the buffer named @var{buffer-name}, which is first -created if necessary, and put into Help mode. Finally, the buffer is -displayed in some window, but not selected. (See the similar -form @code{with-temp-buffer-window} below.) +@defmac with-output-to-temp-buffer buffer-name body@dots{} +This function executes the forms in @var{body} while arranging to insert +any output they print into the buffer named @var{buffer-name}, which is +first created if necessary, and put into Help mode. (See the similar +form @code{with-temp-buffer-window} below.) Finally, the buffer is +displayed in some window, but that window is not selected. -If the @var{forms} do not change the major mode in the output buffer, -so that it is still Help mode at the end of their execution, then -@code{with-output-to-temp-buffer} makes this buffer read-only at the -end, and also scans it for function and variable names to make them -into clickable cross-references. @xref{Docstring hyperlinks, , Tips -for Documentation Strings}, in particular the item on hyperlinks in +If the forms in @var{body} do not change the major mode in the output +buffer, so that it is still Help mode at the end of their execution, +then @code{with-output-to-temp-buffer} makes this buffer read-only at +the end, and also scans it for function and variable names to make them +into clickable cross-references. @xref{Docstring hyperlinks, , Tips for +Documentation Strings}, in particular the item on hyperlinks in documentation strings, for more details. -The string @var{buffer-name} specifies the temporary buffer, which -need not already exist. The argument must be a string, not a buffer. -The buffer is erased initially (with no questions asked), and it is -marked as unmodified after @code{with-output-to-temp-buffer} exits. +The string @var{buffer-name} specifies the temporary buffer, which need +not already exist. The argument must be a string, not a buffer. The +buffer is erased initially (with no questions asked), and it is marked +as unmodified after @code{with-output-to-temp-buffer} exits. @code{with-output-to-temp-buffer} binds @code{standard-output} to the -temporary buffer, then it evaluates the forms in @var{forms}. Output -using the Lisp output functions within @var{forms} goes by default to +temporary buffer, then it evaluates the forms in @var{body}. Output +using the Lisp output functions within @var{body} goes by default to that buffer (but screen display and messages in the echo area, although they are ``output'' in the general sense of the word, are not affected). @xref{Output Functions}. @@ -1124,7 +1124,7 @@ Several hooks are available for customizing the behavior of this construct; they are listed below. -The value of the last form in @var{forms} is returned. +The value of the last form in @var{body} is returned. @example @group @@ -1174,28 +1174,34 @@ is current, and the window it was displayed in is selected. @end defvar -@defmac with-temp-buffer-window buffer-or-name action quit-function forms@dots{} +@defmac with-temp-buffer-window buffer-or-name action quit-function body@dots{} This macro is similar to @code{with-output-to-temp-buffer}. Like that -construct, it executes @var{forms} while arranging to insert any output -they print into the buffer named @var{buffer-or-name} and displays the +construct, it executes @var{body} while arranging to insert any output +it prints into the buffer named @var{buffer-or-name} and displays that buffer in some window. Unlike @code{with-output-to-temp-buffer}, -however, this makes the buffer current and does not switch to Help mode. - -The argument @var{buffer-or-name} specifies the temporary buffer. -It can be either a buffer, which must already exist, or a string, -in which case a buffer of that name is created if necessary. -The buffer is marked as unmodified and read-only when -@code{with-temp-buffer-window} exits. +however, it does not automatically switch that buffer to Help mode. + +Like @code{with-output-to-temp-buffer} it neither makes the buffer +specified by @var{buffer-or-name} current when executing @var{body}. +@findex with-current-buffer-window +The otherwise identical macro @code{with-current-buffer-window} can be +used to execute @var{body} with that buffer current. + +The argument @var{buffer-or-name} specifies the temporary buffer. It +can be either a buffer, which must already exist, or a string, in which +case a buffer of that name is created, if necessary. The buffer is +marked as unmodified and read-only when @code{with-temp-buffer-window} +exits. This macro does not call @code{temp-buffer-show-function}. Rather, it passes the @var{action} argument to @code{display-buffer} in order to display the buffer. -The value of the last form in @var{forms} is returned, unless the -argument @var{quit-function} is specified. In that case, -it is called with two arguments: the window showing the buffer -and the result of @var{forms}. The final return value is then -whatever @var{quit-function} returns. +The value of the last form in @var{body} is returned, unless the +argument @var{quit-function} is specified. In that case, it is called +with two arguments: the window showing the buffer and the result of +@var{body}. The final return value is then whatever +@var{quit-function} returns. @vindex temp-buffer-window-setup-hook @vindex temp-buffer-window-show-hook === modified file 'doc/lispref/help.texi' --- doc/lispref/help.texi 2014-01-08 19:16:10 +0000 +++ doc/lispref/help.texi 2014-03-16 09:26:58 +0000 @@ -649,14 +649,17 @@ @file{*Help*}; if such a buffer does not exist, it is first created. @end defun +@vindex help-window-select @defmac with-help-window buffer-name body@dots{} -This macro evaluates the @var{body} forms, inserting any output they -produce into a buffer named @var{buffer-name} like -@code{with-output-to-temp-buffer} (@pxref{Temporary Displays}). -(Usually, @var{buffer-name} should be the value returned by the -function @code{help-buffer}.) It also puts the specified buffer into -Help mode and displays a message telling the user how to quit and -scroll the help window. +This macro evaluates @var{body} like @code{with-output-to-temp-buffer} +(@pxref{Temporary Displays}), inserting any output produced by its forms +into a buffer named @var{buffer-name}. (Usually, @var{buffer-name} +should be the value returned by the function @code{help-buffer}.) It +also puts the specified buffer into Help mode and displays a message +telling the user how to quit and scroll the help window. It selects the +help window if the current value of the user option +@code{help-window-select} has been set accordingly. It returns the last +value in @var{body}. @end defmac @defun help-setup-xref item interactive-p === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-16 03:47:31 +0000 +++ lisp/ChangeLog 2014-03-16 09:26:58 +0000 @@ -1,3 +1,20 @@ +2014-03-16 Martin Rudalics + + Fix behavior of with-temp-buffer-window (Bug#16816, Bug#17007). + * window.el (with-temp-buffer-window): Don't make BUFFER-OR-NAME + current (Bug#16816, Bug#17007). + (with-current-buffer-window): New macro doing the same as + `with-temp-buffer-window' but with BUFFER-OR-NAME current. + * help.el (help-print-return-message): Warn in doc-string to not + use this in `with-help-window'. + (describe-bindings-internal): Call `describe-buffer-bindings' + from within help buffer. See Juanma's scenario in (Bug#16816). + (with-help-window): Update doc-string. + * dired.el (dired-mark-pop-up): + * files.el (save-buffers-kill-emacs): + * register.el (register-preview): Use `with-current-buffer-window' + instead of `with-temp-buffer-window'. + 2014-03-16 Juanma Barranquero * textmodes/rst.el (rst-arabic-to-roman, rst-roman-to-arabic): === modified file 'lisp/dired.el' --- lisp/dired.el 2014-02-26 19:18:49 +0000 +++ lisp/dired.el 2014-03-16 09:26:58 +0000 @@ -3087,7 +3087,7 @@ (apply function args) (let ((buffer (get-buffer-create (or buffer-or-name " *Marked Files*")))) (with-current-buffer buffer - (with-temp-buffer-window + (with-current-buffer-window buffer (cons 'display-buffer-below-selected '((window-height . fit-window-to-buffer))) === modified file 'lisp/files.el' --- lisp/files.el 2014-03-10 18:48:35 +0000 +++ lisp/files.el 2014-03-16 09:26:58 +0000 @@ -6534,7 +6534,7 @@ (setq active t)) (setq processes (cdr processes))) (or (not active) - (with-temp-buffer-window + (with-current-buffer-window (get-buffer-create "*Process List*") nil #'(lambda (window _value) (with-selected-window window === modified file 'lisp/help.el' --- lisp/help.el 2014-03-14 00:32:41 +0000 +++ lisp/help.el 2014-03-16 09:26:58 +0000 @@ -133,7 +133,9 @@ It computes a message, and applies the optional argument FUNCTION to it. If FUNCTION is nil, it applies `message', thus displaying the message. In addition, this function sets up `help-return-method', which see, that -specifies what to do when the user exits the help buffer." +specifies what to do when the user exits the help buffer. + +Do not call this in the scope of `with-help-window'." (and (not (get-buffer-window standard-output)) (let ((first-message (cond ((or @@ -498,7 +500,10 @@ then we display only bindings that start with that prefix." (let ((buf (current-buffer))) (with-help-window (help-buffer) - (describe-buffer-bindings buf prefix menus)))) + ;; Be aware that `describe-buffer-bindings' puts its output into + ;; the current buffer. + (with-current-buffer (help-buffer) + (describe-buffer-bindings buf prefix menus))))) (defun where-is (definition &optional insert) "Print message listing key sequences that invoke the command DEFINITION. @@ -1180,28 +1185,25 @@ ;; providing the following additional twists: ;; (1) It puts the buffer in `help-mode' (via `help-mode-setup') and -;; adds cross references (via `help-mode-finish'). +;; adds cross references (via `help-mode-finish'). ;; (2) It issues a message telling how to scroll and quit the help -;; window (via `help-window-setup'). +;; window (via `help-window-setup'). ;; (3) An option (customizable via `help-window-select') to select the -;; help window automatically. +;; help window automatically. ;; (4) A marker (`help-window-point-marker') to move point in the help -;; window to an arbitrary buffer position. - -;; Note: It's usually always wrong to use `help-print-return-message' in -;; the body of `with-help-window'. +;; window to an arbitrary buffer position. (defmacro with-help-window (buffer-name &rest body) - "Display buffer with name BUFFER-NAME in a help window. -Evaluate the forms in BODY with the buffer specified by -BUFFER-NAME current, put that buffer in `help-mode', display the -buffer in a window (see `with-temp-buffer-window' for details) -and issue a message how to deal with that \"help\" window when -it's no more needed. Select the help window if the current value -of the user option `help-window-select' says so. Return last -value in BODY." + "Display buffer named BUFFER-NAME in a help window. +Evaluate the forms in BODY with standard output bound to a buffer +called BUFFER-NAME (creating it if it does not exist), put that +buffer in `help-mode', display the buffer in a window (see +`with-temp-buffer-window' for details) and issue a message how to +deal with that \"help\" window when it's no more needed. Select +the help window if the current value of the user option +`help-window-select' says so. Return last value in BODY." (declare (indent 1) (debug t)) `(progn ;; Make `help-window-point-marker' point nowhere. The only place === modified file 'lisp/register.el' --- lisp/register.el 2014-03-12 21:16:34 +0000 +++ lisp/register.el 2014-03-16 09:26:58 +0000 @@ -134,7 +134,7 @@ If SHOW-EMPTY is non-nil show the window even if no registers. Format of each entry is controlled by the variable `register-preview-function'." (when (or show-empty (consp register-alist)) - (with-temp-buffer-window + (with-current-buffer-window buffer (cons 'display-buffer-below-selected '((window-height . fit-window-to-buffer))) === modified file 'lisp/window.el' --- lisp/window.el 2014-03-12 07:28:23 +0000 +++ lisp/window.el 2014-03-16 09:26:58 +0000 @@ -143,21 +143,22 @@ window)))) (defmacro with-temp-buffer-window (buffer-or-name action quit-function &rest body) - "Evaluate BODY in a buffer BUFFER-OR-NAME and show that buffer. + "Bind `standard-output' to BUFFER-OR-NAME, eval BODY, show the buffer. BUFFER-OR-NAME must specify either a live buffer, or the name of a buffer (if it does not exist, this macro creates it). Make the buffer specified by BUFFER-OR-NAME empty before running -BODY and make that buffer current for running the forms in BODY. -In addition, bind `standard-output' to that buffer, so that -output generated with `prin1' and similar functions in BODY goes -into that buffer. +BODY and bind `standard-output' to that buffer, so that output +generated with `prin1' and similar functions in BODY goes into +that buffer. Do not make that buffer current for running the +forms in BODY. Use `with-current-buffer-window' instead if you +need to run BODY with that buffer current. At the end of BODY, mark the specified buffer unmodified and read-only, and display it in a window (but do not select it). The display happens by calling `display-buffer' passing it the ACTION argument. If `temp-buffer-resize-mode' is enabled, the -corresponding window may shrink automatically. +corresponding window may be resized automatically. Return the value returned by BODY, unless QUIT-FUNCTION specifies a function. In that case, run that function with two arguments - @@ -177,10 +178,29 @@ display it temporarily selected. This construct is similar to `with-output-to-temp-buffer' but, -unlike that, makes BUFFER-OR-NAME current when running BODY. -Also, it neither runs `temp-buffer-setup-hook' which usually puts -the buffer in Help mode, nor `temp-buffer-show-function' (the -ACTION argument replaces this)." +neither runs `temp-buffer-setup-hook' which usually puts the +buffer in Help mode, nor `temp-buffer-show-function' (the ACTION +argument replaces this)." + (declare (debug t)) + (let ((buffer (make-symbol "buffer")) + (window (make-symbol "window")) + (value (make-symbol "value"))) + `(let* ((,buffer (temp-buffer-window-setup ,buffer-or-name)) + (standard-output ,buffer) + ,window ,value) + (setq ,value (progn ,@body)) + (with-current-buffer ,buffer + (setq ,window (temp-buffer-window-show ,buffer ,action))) + + (if (functionp ,quit-function) + (funcall ,quit-function ,window ,value) + ,value)))) + +(defmacro with-current-buffer-window (buffer-or-name action quit-function &rest body) + "Evaluate BODY with a buffer BUFFER-OR-NAME current and show that buffer. +This construct is like `with-temp-buffer-window' but unlike that +makes the buffer specified by BUFFER-OR-NAME current for running +BODY." (declare (debug t)) (let ((buffer (make-symbol "buffer")) (window (make-symbol "window")) ------------------------------------------------------------ revno: 116773 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2014-03-16 04:48:56 +0100 message: lisp/textmodes/css-mode.el: Fix typo in comment. diff: === modified file 'lisp/textmodes/css-mode.el' --- lisp/textmodes/css-mode.el 2014-01-01 07:43:34 +0000 +++ lisp/textmodes/css-mode.el 2014-03-16 03:48:56 +0000 @@ -237,7 +237,7 @@ ;; FIXME: attribute selectors don't work well because they may contain ;; strings which have already been highlighted as f-l-string-face and ;; thus prevent this highlighting from being applied (actually now that - ;; I use `append' this should work better). But really the part of hte + ;; I use `append' this should work better). But really the part of the ;; selector between [...] should simply not be highlighted. (,(concat "^\\([ \t]*[^@:{}\n][^:{}]+\\(?::" (regexp-opt css-pseudo-ids t) "\\(?:([^)]+)\\)?[^:{\n]*\\)*\\)\\(?:\n[ \t]*\\)*{") ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.