Now on revision 106544. ------------------------------------------------------------ revno: 106544 committer: Chong Yidong branch nick: trunk timestamp: Tue 2011-11-29 14:07:51 +0800 message: * frame.el (auto-raise-mode, auto-lower-mode): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-11-28 19:43:52 +0000 +++ lisp/ChangeLog 2011-11-29 06:07:51 +0000 @@ -1,3 +1,7 @@ +2011-11-29 Chong Yidong + + * frame.el (auto-raise-mode, auto-lower-mode): Doc fix. + 2011-11-28 Stefan Monnier * files.el (find-file): Don't use force-same-window (bug#10144). === modified file 'lisp/frame.el' --- lisp/frame.el 2011-11-15 17:37:37 +0000 +++ lisp/frame.el 2011-11-29 06:07:51 +0000 @@ -1133,15 +1133,21 @@ (list (cons 'border-color color-name)))) (define-minor-mode auto-raise-mode - "Toggle whether or not the selected frame should auto-raise. + "Toggle whether or not selected frames should auto-raise. With a prefix argument ARG, enable Auto Raise mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. -Note that this controls Emacs's own auto-raise feature. -Some window managers allow you to enable auto-raise for certain windows. -You can use that for Emacs windows if you wish, but if you do, -that is beyond the control of Emacs and this command has no effect on it." +Auto Raise mode does nothing under most window managers, which +switch focus on mouse clicks. It only has an effect if your +window manager switches focus on mouse movement (in which case +you should also change `focus-follows-mouse' to t). Then, +enabling Auto Raise mode causes any graphical Emacs frame which +acquires focus to be automatically raised. + +Note that this minor mode controls Emacs's own auto-raise +feature. Window managers that switch focus on mouse movement +often have their own auto-raise feature." :variable (frame-parameter nil 'auto-raise) (if (frame-parameter nil 'auto-raise) (raise-frame))) @@ -1152,10 +1158,16 @@ positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. -Note that this controls Emacs's own auto-lower feature. -Some window managers allow you to enable auto-lower for certain windows. -You can use that for Emacs windows if you wish, but if you do, -that is beyond the control of Emacs and this command has no effect on it." +Auto Lower mode does nothing under most window managers, which +switch focus on mouse clicks. It only has an effect if your +window manager switches focus on mouse movement (in which case +you should also change `focus-follows-mouse' to t). Then, +enabling Auto Lower Mode causes any graphical Emacs frame which +loses focus to be automatically lowered. + +Note that this minor mode controls Emacs's own auto-lower +feature. Window managers that switch focus on mouse movement +often have their own features for raising or lowering frames." :variable (frame-parameter nil 'auto-lower)) (defun set-frame-name (name) ------------------------------------------------------------ revno: 106543 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10144 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2011-11-28 14:43:52 -0500 message: * lisp/files.el (find-file): Don't use force-same-window. * lisp/window.el (switch-to-buffer): Better match Emacs-23 behavior and only use pop-to-buffer if the selected window can't be used. (pop-to-buffer-same-window): Use display-buffer--same-window-action. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-11-28 18:03:11 +0000 +++ lisp/ChangeLog 2011-11-28 19:43:52 +0000 @@ -1,3 +1,10 @@ +2011-11-28 Stefan Monnier + + * files.el (find-file): Don't use force-same-window (bug#10144). + * window.el (switch-to-buffer): Better match Emacs-23 behavior and only + use pop-to-buffer if the selected window can't be used. + (pop-to-buffer-same-window): Use display-buffer--same-window-action. + 2011-11-28 Eli Zaretskii * vc/diff-mode.el (diff-mode-map): Don't inherit 'z' => 'M-z' from === modified file 'lisp/files.el' --- lisp/files.el 2011-11-20 02:29:42 +0000 +++ lisp/files.el 2011-11-28 19:43:52 +0000 @@ -1343,7 +1343,7 @@ (let ((value (find-file-noselect filename nil nil wildcards))) (if (listp value) (mapcar 'switch-to-buffer (nreverse value)) - (switch-to-buffer value nil 'force-same-window)))) + (switch-to-buffer value)))) (defun find-file-other-window (filename &optional wildcards) "Edit file FILENAME, in another window. === modified file 'lisp/window.el' --- lisp/window.el 2011-11-27 04:43:11 +0000 +++ lisp/window.el 2011-11-28 19:43:52 +0000 @@ -4515,6 +4515,12 @@ (set-window-dedicated-p window dedicated)) (window--display-buffer-1 window))) +;; FIXME: Not implemented. +;; FIXME: By the way, there could be more levels of dedication: +;; - `barely' dedicated doesn't prevent reuse of the window, only records that +;; the window hasn't been used for something else yet. +;; - `softly' dedicated only allows reuse when asked explicitly. +;; - `strongly' never allows reuse. (defvar display-buffer-mark-dedicated nil "If non-nil, `display-buffer' marks the windows it creates as dedicated. The actual non-nil value of this variable will be copied to the @@ -4945,10 +4951,7 @@ NORECORD, if non-nil means do not put this buffer at the front of the list of recently selected ones." - (pop-to-buffer buffer - '(display-buffer-same-window - (inhibit-same-window . nil)) - norecord)) + (pop-to-buffer buffer display-buffer--same-window-action norecord)) (defun read-buffer-to-switch (prompt) "Read the name of a buffer to switch to, prompting with PROMPT. @@ -5013,21 +5016,23 @@ (interactive (list (read-buffer-to-switch "Switch to buffer: ") nil 'force-same-window)) (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name))) - (if (null force-same-window) - (pop-to-buffer buffer display-buffer--same-window-action norecord) - (cond - ;; Don't call set-window-buffer if it's not needed since it - ;; might signal an error (e.g. if the window is dedicated). - ((eq buffer (window-buffer))) - ((window-minibuffer-p) - (error "Cannot switch buffers in minibuffer window")) - ((eq (window-dedicated-p) t) - (error "Cannot switch buffers in a dedicated window")) - (t (set-window-buffer nil buffer))) + (cond + ;; Don't call set-window-buffer if it's not needed since it + ;; might signal an error (e.g. if the window is dedicated). + ((eq buffer (window-buffer))) + ((window-minibuffer-p) + (if force-same-window + (error "Cannot switch buffers in minibuffer window") + (pop-to-buffer buffer norecord))) + ((eq (window-dedicated-p) t) + (if force-same-window + (error "Cannot switch buffers in a dedicated window") + (pop-to-buffer buffer norecord))) + (t (set-window-buffer nil buffer))) - (unless norecord - (select-window (selected-window))) - (set-buffer buffer)))) + (unless norecord + (select-window (selected-window))) + (set-buffer buffer))) (defun switch-to-buffer-other-window (buffer-or-name &optional norecord) "Select the buffer specified by BUFFER-OR-NAME in another window. ------------------------------------------------------------ revno: 106542 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2011-11-28 20:03:11 +0200 message: Prevent Diff Mode from stealing M-z binding. lisp/vc/diff-mode.el (diff-mode-map): Don't inherit 'z' => 'M-z' from special-mode-map. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-11-28 06:26:39 +0000 +++ lisp/ChangeLog 2011-11-28 18:03:11 +0000 @@ -1,3 +1,8 @@ +2011-11-28 Eli Zaretskii + + * vc/diff-mode.el (diff-mode-map): Don't inherit 'z' => 'M-z' from + special-mode-map. + 2011-11-28 Chong Yidong * emacs-lisp/easy-mmode.el (define-minor-mode): Fix default doc. === modified file 'lisp/vc/diff-mode.el' --- lisp/vc/diff-mode.el 2011-10-20 00:26:14 +0000 +++ lisp/vc/diff-mode.el 2011-11-28 18:03:11 +0000 @@ -146,7 +146,7 @@ ;; but not all since they may hide useful M- global ;; bindings when editing. (set-keymap-parent map diff-mode-shared-map) - (dolist (key '("A" "r" "R" "g" "q" "W")) + (dolist (key '("A" "r" "R" "g" "q" "W" "z")) (define-key map key nil)) map)) ;; From compilation-minor-mode. ------------------------------------------------------------ revno: 106541 committer: Chong Yidong branch nick: trunk timestamp: Mon 2011-11-28 23:28:04 +0800 message: Updates to Text chapter of manual. * doc/emacs/text.texi (Words): Add xref to Position Info. (Paragraphs): Add xref to Regexps. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-11-28 11:12:00 +0000 +++ doc/emacs/ChangeLog 2011-11-28 15:28:04 +0000 @@ -1,5 +1,8 @@ 2011-11-28 Chong Yidong + * text.texi (Words): Add xref to Position Info. + (Paragraphs): Add xref to Regexps. + * indent.texi (Indentation): Rewrite introduction. Move table to Indentation Commands node. (Indentation Commands): Add index entries to table. Copyedits. === modified file 'doc/emacs/text.texi' --- doc/emacs/text.texi 2011-10-12 17:38:34 +0000 +++ doc/emacs/text.texi 2011-11-28 15:28:04 +0000 @@ -78,8 +78,8 @@ @cindex words @cindex Meta commands and words - Emacs has commands for moving over or operating on words. By convention, -the keys for them are all Meta characters. + Emacs defines several commands for moving over or operating on +words: @table @kbd @item M-f @@ -157,13 +157,17 @@ word delimiter. @xref{Syntax Tables,, Syntax Tables, elisp, The Emacs Lisp Reference Manual}. + In addition, see @ref{Position Info} for the @kbd{M-=} +(@code{count-words-region}) and @kbd{M-x count-words} commands, which +count and report the number of words in the region or buffer. + @node Sentences @section Sentences @cindex sentences @cindex manipulating sentences - The Emacs commands for manipulating sentences and paragraphs are mostly -on Meta keys, so as to be like the word-handling commands. + The Emacs commands for manipulating sentences and paragraphs are +mostly on Meta keys, like the word-handling commands. @table @kbd @item M-a @@ -180,12 +184,12 @@ @kindex M-e @findex backward-sentence @findex forward-sentence - The commands @kbd{M-a} and @kbd{M-e} (@code{backward-sentence} and -@code{forward-sentence}) move to the beginning and end of the current -sentence, respectively. They were chosen to resemble @kbd{C-a} and -@kbd{C-e}, which move to the beginning and end of a line. Unlike -them, @kbd{M-a} and @kbd{M-e} move over successive sentences if -repeated. + The commands @kbd{M-a} (@code{backward-sentence}) and @kbd{M-e} +(@code{forward-sentence}) move to the beginning and end of the current +sentence, respectively. Their bindings were chosen to resemble +@kbd{C-a} and @kbd{C-e}, which move to the beginning and end of a +line. Unlike them, @kbd{M-a} and @kbd{M-e} move over successive +sentences if repeated. Moving backward over a sentence places point just before the first character of the sentence; moving forward places point right after the @@ -207,15 +211,14 @@ to the beginning of a sentence. The sentence commands assume that you follow the American typist's -convention of putting two spaces at the end of a sentence; they consider -a sentence to end wherever there is a @samp{.}, @samp{?} or @samp{!} +convention of putting two spaces at the end of a sentence. That is, a +sentence ends wherever there is a @samp{.}, @samp{?} or @samp{!} followed by the end of a line or two spaces, with any number of -@samp{)}, @samp{]}, @samp{'}, or @samp{"} characters allowed in between. -A sentence also begins or ends wherever a paragraph begins or ends. -It is useful to follow this convention, because it makes a distinction -between periods that end a sentence and periods that indicate -abbreviations; that enables the Emacs sentence commands to distinguish, -too. These commands do not stop for periods that indicate abbreviations. +@samp{)}, @samp{]}, @samp{'}, or @samp{"} characters allowed in +between. A sentence also begins or ends wherever a paragraph begins +or ends. It is useful to follow this convention, because it allows +the Emacs sentence commands to distinguish between periods that end a +sentence and periods that indicate abbreviations. @vindex sentence-end-double-space If you want to use just one space between sentences, you can set the @@ -225,7 +228,7 @@ sentences and those that indicate abbreviations. For convenient and reliable editing, we therefore recommend you follow the two-space convention. The variable @code{sentence-end-double-space} also -affects filling (@pxref{Fill Commands}) in related ways. +affects filling (@pxref{Fill Commands}). @vindex sentence-end The variable @code{sentence-end} controls how to recognize the end @@ -237,19 +240,14 @@ value of @code{sentence-end-double-space}. @vindex sentence-end-without-period - Some languages do not use periods to indicate the end of a sentence. -For example, sentences in Thai end with a double space but without a -period. Set the variable @code{sentence-end-without-period} to + Some languages, such as Thai, do not use periods to indicate the end +of a sentence. Set the variable @code{sentence-end-without-period} to @code{t} in such cases. @node Paragraphs @section Paragraphs @cindex paragraphs @cindex manipulating paragraphs -@kindex M-@{ -@kindex M-@} -@findex backward-paragraph -@findex forward-paragraph The Emacs commands for manipulating paragraphs are also on Meta keys. @@ -262,23 +260,15 @@ Put point and mark around this or next paragraph (@code{mark-paragraph}). @end table - @kbd{M-@{} moves to the beginning of the current or previous -paragraph, while @kbd{M-@}} moves to the end of the current or next -paragraph. Blank lines and text-formatter command lines separate -paragraphs and are not considered part of any paragraph. If there is -a blank line before the paragraph, @kbd{M-@{} moves to the blank line, -because that is convenient in practice. - - In Text mode, an indented line is not a paragraph break. If you -want indented lines to have this effect, use Paragraph-Indent Text -mode instead. @xref{Text Mode}. - - In major modes for programs, paragraphs begin and end only at blank -lines. This makes the paragraph commands useful, even though there -are no paragraphs as such in a program. - - When you have set a fill prefix, then paragraphs are delimited by -all lines which don't start with the fill prefix. @xref{Filling}. +@kindex M-@{ +@kindex M-@} +@findex backward-paragraph +@findex forward-paragraph + @kbd{M-@{} (@code{backward-paragraph}) moves to the beginning of the +current or previous paragraph (see below for the definition of a +paragraph). @kbd{M-@}} (@code{forward-paragraph}) moves to the end of +the current or next paragraph. If there is a blank line before the +paragraph, @kbd{M-@{} moves to the blank line. @kindex M-h @findex mark-paragraph @@ -287,31 +277,42 @@ @kbd{M-h C-w} kills the paragraph around or after point. @kbd{M-h} puts point at the beginning and mark at the end of the paragraph point was in. If point is between paragraphs (in a run of blank lines, or -at a boundary), the paragraph following point is surrounded by point -and mark. If there are blank lines preceding the first line of the -paragraph, one of these blank lines is included in the region. If the -region is already active, the command sets the mark without changing -point; furthermore, each subsequent @kbd{M-h} further advances the +at a boundary), @kbd{M-h} sets the region around the paragraph +following point. If there are blank lines preceding the first line of +the paragraph, one of these blank lines is included in the region. If +the region is already active, the command sets the mark without +changing point, and each subsequent @kbd{M-h} further advances the mark by one paragraph. + The definition of a paragraph depends on the major mode. In +Fundamental mode, as well as Text mode and related modes, a paragraph +is separated each neighboring paragraph another by one or more +@dfn{blank lines}---lines that are either empty, or consist solely of +space, tab and/or formfeed characters. In programming language modes, +paragraphs are usually defined in a similar way, so that you can use +the paragraph commands even though there are no paragraphs as such in +a program. + + Note that an indented line is @emph{not} itself a paragraph break in +Text mode. If you want indented lines to separate paragraphs, use +Paragraph-Indent Text mode instead. @xref{Text Mode}. + + If you set a fill prefix, then paragraphs are delimited by all lines +which don't start with the fill prefix. @xref{Filling}. + @vindex paragraph-start @vindex paragraph-separate The precise definition of a paragraph boundary is controlled by the variables @code{paragraph-separate} and @code{paragraph-start}. The -value of @code{paragraph-start} is a regexp that should match any line -that either starts or separates paragraphs. The value of -@code{paragraph-separate} is another regexp that should match only lines -that separate paragraphs without being part of any paragraph (for -example, blank lines). Lines that start a new paragraph and are -contained in it must match only @code{paragraph-start}, not -@code{paragraph-separate}. Each regular expression must match at the -left margin. For example, in Fundamental mode, @code{paragraph-start} -is @w{@code{"\f\\|[ \t]*$"}}, and @code{paragraph-separate} is -@w{@code{"[ \t\f]*$"}}. - - Normally it is desirable for page boundaries to separate paragraphs. -The default values of these variables recognize the usual separator for -pages. +value of @code{paragraph-start} is a regular expression that should +match lines that either start or separate paragraphs +(@pxref{Regexps}). The value of @code{paragraph-separate} is another +regular expression that should match lines that separate paragraphs +without being part of any paragraph (for example, blank lines). Lines +that start a new paragraph and are contained in it must match only +@code{paragraph-start}, not @code{paragraph-separate}. For example, +in Fundamental mode, @code{paragraph-start} is @w{@code{"\f\\|[ +\t]*$"}}, and @code{paragraph-separate} is @w{@code{"[ \t\f]*$"}}. @node Pages @section Pages === modified file 'etc/NEWS' --- etc/NEWS 2011-11-23 07:17:48 +0000 +++ etc/NEWS 2011-11-28 15:28:04 +0000 @@ -253,6 +253,7 @@ ** New basic faces `error', `warning', `success' are available to highlight strings that indicate failure, caution or successful operation. +--- ** Lucid menus and dialogs can display antialiased fonts if Emacs is built with Xft. To change font, use the X resource font, for example: Emacs.pane.menubar.font: Courier-12 @@ -379,7 +380,7 @@ by default. ** Menu-bar changes - +--- *** `menu-bar-select-buffer-function' lets you choose another operation instead of `switch-to-buffer' when selecting an item in the Buffers menu. ------------------------------------------------------------ revno: 106540 committer: Glenn Morris branch nick: trunk timestamp: Mon 2011-11-28 06:18:31 -0500 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2011-11-24 11:19:06 +0000 +++ autogen/config.in 2011-11-28 11:18:31 +0000 @@ -351,6 +351,9 @@ /* Define to 1 if you have the `gtk_widget_set_has_window' function. */ #undef HAVE_GTK_WIDGET_SET_HAS_WINDOW +/* Define to 1 if you have the `gtk_window_set_has_resize_grip' function. */ +#undef HAVE_GTK_WINDOW_SET_HAS_RESIZE_GRIP + /* Define to 1 if you have the `g_type_init' function. */ #undef HAVE_G_TYPE_INIT === modified file 'autogen/configure' --- autogen/configure 2011-11-22 11:20:22 +0000 +++ autogen/configure 2011-11-28 11:18:31 +0000 @@ -11217,7 +11217,8 @@ for ac_func in gtk_widget_get_window gtk_widget_set_has_window \ gtk_dialog_get_action_area gtk_widget_get_sensitive \ gtk_widget_get_mapped gtk_adjustment_get_page_size \ - gtk_orientable_set_orientation + gtk_orientable_set_orientation \ + gtk_window_set_has_resize_grip do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -11230,7 +11231,6 @@ fi done - fi HAVE_DBUS=no ------------------------------------------------------------ revno: 106539 committer: Chong Yidong branch nick: trunk timestamp: Mon 2011-11-28 19:12:00 +0800 message: Update Indentation chapter of Emacs manual. * indent.texi (Indentation): Rewrite introduction. Move table to Indentation Commands node. (Indentation Commands): Add index entries to table. Copyedits. (Tab Stops, Just Spaces): Copyedits. (Indent Convenience): New node. Document electric-indent-mode. * programs.texi (Basic Indent): * windows.texi (Pop Up Window): Fix kindex entry. diff: === modified file 'admin/FOR-RELEASE' --- admin/FOR-RELEASE 2011-11-28 06:24:48 +0000 +++ admin/FOR-RELEASE 2011-11-28 11:12:00 +0000 @@ -173,7 +173,7 @@ frames.texi cyd glossary.texi help.texi cyd -indent.texi +indent.texi cyd killing.texi cyd kmacro.texi cyd macos.texi === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-11-28 06:24:48 +0000 +++ doc/emacs/ChangeLog 2011-11-28 11:12:00 +0000 @@ -1,5 +1,16 @@ 2011-11-28 Chong Yidong + * indent.texi (Indentation): Rewrite introduction. Move table to + Indentation Commands node. + (Indentation Commands): Add index entries to table. Copyedits. + (Tab Stops, Just Spaces): Copyedits. + (Indent Convenience): New node. Document electric-indent-mode. + + * programs.texi (Basic Indent): + * windows.texi (Pop Up Window): Fix kindex entry. + +2011-11-28 Chong Yidong + * modes.texi (Major Modes): Move major-mode variable doc here from Choosing Modes. Document describe-mode. Document prog-mode-hook and text-mode-hook. Add example of using hooks. === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2011-11-27 08:22:37 +0000 +++ doc/emacs/emacs.texi 2011-11-28 11:12:00 +0000 @@ -551,10 +551,10 @@ Indentation -* Indentation Commands:: Various commands and techniques for indentation. -* Tab Stops:: You can set arbitrary "tab stops" and then - indent to the next tab stop when you want to. -* Just Spaces:: You can request indentation using just spaces. +* Indentation Commands:: More commands for performing indentation. +* Tab Stops:: Stop points for indentation in Text modes. +* Just Spaces:: Using only space characters for indentation. +* Indent Convenience:: Optional indentation features. Commands for Human Languages === modified file 'doc/emacs/indent.texi' --- doc/emacs/indent.texi 2011-07-10 04:05:33 +0000 +++ doc/emacs/indent.texi 2011-11-28 11:12:00 +0000 @@ -8,214 +8,154 @@ @cindex tabs @cindex columns (indentation) - This chapter describes the Emacs commands that add, remove, or -adjust indentation. +@cindex whitespace character + @dfn{Indentation} refers to inserting or adjusting @dfn{whitespace +characters} (space and/or tab characters) at the beginning of a line +of text. This chapter documents indentation commands and options +which are common to Text mode and related modes, as well as +programming language modes. @xref{Program Indent}, for additional +documentation about indenting in programming modes. + +@findex indent-for-tab-command +@kindex TAB @r{(indentation)} + The simplest way to perform indentation is the @key{TAB} key. In +most major modes, this runs the command @code{indent-for-tab-command}. +(In C and related modes, @key{TAB} runs the command +@code{c-indent-line-or-region}, which behaves similarly). + +@table @key +@item TAB +Insert whitespace, or indent the current line, in a mode-appropriate +way (@code{indent-for-tab-command}). If the region is active, indent +all the lines within it. +@end table + + The exact behavior of @key{TAB} depends on the major mode. In Text +mode and related major modes, @key{TAB} normally inserts some +combination of space and tab characters to advance point to the next +tab stop (@pxref{Tab Stops}). For this purpose, the position of the +first non-whitespace character on the preceding line is treated as an +additional tab stop, so you can use @key{TAB} to ``align'' point with +the preceding line. If the region is active (@pxref{Using Region}), +@key{TAB} acts specially: it indents each line in the region so that +its first non-whitespace character is aligned with the preceding line. + + In programming modes, @key{TAB} indents the current line of code in +a way that makes sense given the code in the preceding lines. If the +region is active, all the lines in the region are indented this way. +If point was initially within the current line's indentation, it is +repositioned to the first non-whitespace character on the line. + + If you just want to insert a tab character in the buffer, type +@kbd{C-q @key{TAB}} (@pxref{Inserting Text}). + +@menu +* Indentation Commands:: More commands for performing indentation. +* Tab Stops:: Stop points for indentation in Text modes. +* Just Spaces:: Using only space characters for indentation. +* Indent Convenience:: Optional indentation features. +@end menu + +@node Indentation Commands +@section Indentation Commands + +Apart from the @key{TAB} (@code{indent-for-tab-command}) command, +Emacs provides a variety of commands to perform indentation in other +ways. @table @kbd -@item @key{TAB} -Indent the current line appropriately, in a mode-dependent fashion. -@item @kbd{C-j} +@item C-j +@kindex C-j +@findex newline-and-indent Perform @key{RET} followed by @key{TAB} (@code{newline-and-indent}). -@item M-^ -Merge the previous and the current line (@code{delete-indentation}). -This would cancel the effect of a preceding @kbd{C-j}. + @item C-M-o -Split the current line at point; text on the line after point becomes a -new line indented to the same column where point is located -(@code{split-line}). +@kindex C-M-o +@findex split-line +Split the current line at point (@code{split-line}). The text on the +line after point becomes a new line, indented to the same column where +point is located. This command first moves point forward over any +spaces and tabs. Afterward, point is positioned before the inserted +newline. + +@kindex M-m +@findex back-to-indentation @item M-m -Move (forward or back) to the first nonblank character on the current -line (@code{back-to-indentation}). -@item C-M-\ -Indent lines in the region to the same column (@code{indent-region}). -@item C-x @key{TAB} -Shift lines in the region rigidly right or left (@code{indent-rigidly}). +Move (forward or back) to the first non-whitespace character on the +current line (@code{back-to-indentation}). If there are no +non-whitespace characters on the line, move to the end of the line. + @item M-i -Indent from point to the next prespecified tab stop column -(@code{tab-to-tab-stop}). +@kindex M-i +@findex tab-to-tab-stop +Indent whitespace at point, up to the next tab stop +(@code{tab-to-tab-stop}). @xref{Tab Stops}. + +@findex indent-relative @item M-x indent-relative -Indent from point to under an indentation point in the previous line. -@end table - -@noindent -The @key{TAB} key runs @code{indent-for-tab-command} in most major -modes (in C and related modes, @key{TAB} runs a separate command, -@code{c-indent-line-or-region}, which behaves similarly). The major -mode determines just what this entails. - - In text modes, @key{TAB} inserts some combination of space and tab -characters to advance point to the next tab stop (@pxref{Tab Stops}). -If the region is active and spans multiple lines, it advances the -first character of each of those lines to the next tab stop -(@pxref{Using Region}). For the purposes of this command, the -position of the first non-whitespace character on the preceding line -is treated as an additional tab stop. Thus, you can use @key{TAB} to -``align'' point with the preceding line. - - In programming modes, @key{TAB} adds or removes some combination of -space and tab characters at the start of the line, in a way that makes -sense given the text in the preceding lines. If the region is active -and spans multiple lines, all those lines are indented this way. If -point was initially within the current line's indentation, it is -positioned after that indentation; otherwise, it remains at same point -in the newly-indented text. @xref{Program Indent}. - -@vindex tab-width - Normally, indentation commands insert (or remove) an optimal mix of -@dfn{tab characters} and spaces to align to the desired column. Tab -characters (@acronym{ASCII} code 9) are displayed as a stretch of -empty space extending to the next @dfn{display tab stop}. By default, -there is one display tab stop every eight columns; the number of -columns is determined by the variable @code{tab-width}. You can -insert a single tab character by typing @kbd{C-q @key{TAB}}. -@xref{Text Display}. - -@findex edit-tab-stops -@findex tab-to-tab-stop -@kindex M-i - The command @kbd{M-i} (@code{tab-to-tab-stop}) adjusts the -whitespace characters around point, inserting just enough whitespace -to advance point up to the next tab stop. By default, this involves -deleting the existing whitespace and inserting a single tab character. - - @xref{Just Spaces}, for how to disable use of tabs. However, -@kbd{C-q @key{TAB}} always inserts a tab, even when tabs are disabled -for the indentation commands. - -@vindex tab-always-indent - The variable @code{tab-always-indent} tweaks the behavior of the -@key{TAB} (@code{indent-for-tab-command}) command. The default value, -@code{t}, gives the behavior described above. If you change the value -to the symbol @code{complete}, then @key{TAB} first tries to indent -the current line, and if the line was already indented, it tries to -complete the text at point (@pxref{Symbol Completion}). If the value -is @code{nil}, then @key{TAB} indents the current line only if point -is at the left margin or in the line's indentation; otherwise, it -inserts a real tab character. - -@menu -* Indentation Commands:: Various commands and techniques for indentation. -* Tab Stops:: You can set arbitrary "tab stops" and then - indent to the next tab stop when you want to. -* Just Spaces:: You can request indentation using just spaces. -@end menu - -@node Indentation Commands, Tab Stops, Indentation, Indentation -@section Indentation Commands and Techniques - -@kindex M-m -@findex back-to-indentation - To move over the indentation on a line, do @kbd{M-m} -(@code{back-to-indentation}). This command, given anywhere on a line, -positions point at the first nonblank character on the line, if any, -or else at the end of the line. - - To insert an indented line before the current line, do @kbd{C-a C-o -@key{TAB}}. To make an indented line after the current line, use -@kbd{C-e C-j}. - - If you just want to insert a tab character in the buffer, type -@kbd{C-q @key{TAB}}. - -@kindex C-M-o -@findex split-line - @kbd{C-M-o} (@code{split-line}) moves the text from point to the end of -the line vertically down, so that the current line becomes two lines. -@kbd{C-M-o} first moves point forward over any spaces and tabs. Then it -inserts after point a newline and enough indentation to reach the same -column point is on. Point remains before the inserted newline; in this -regard, @kbd{C-M-o} resembles @kbd{C-o}. - +Insert whitespace at point, until point is aligned with the first +non-whitespace character on the previous line (actually, the last +non-blank line). If point is already farther right than that, run +@code{tab-to-tab-stop} instead---unless called with a numeric +argument, in which case do nothing. + +@item M-^ @kindex M-^ @findex delete-indentation - To join two lines cleanly, use the @kbd{M-^} -(@code{delete-indentation}) command. It deletes the indentation at -the front of the current line, and the line boundary as well, -replacing them with a single space. As a special case (useful for -Lisp code) the single space is omitted if the characters to be joined -are consecutive open parentheses or closing parentheses, or if the -junction follows another newline. To delete just the indentation of a -line, go to the beginning of the line and use @kbd{M-\} -(@code{delete-horizontal-space}), which deletes all spaces and tabs -around the cursor. - - If you have a fill prefix, @kbd{M-^} deletes the fill prefix if it +Merge the previous and the current line (@code{delete-indentation}). +This ``joins'' the two lines cleanly, by replacing any indentation at +the front of the current line, together with the line boundary, with a +single space. + +As a special case (useful for Lisp code), the single space is omitted +if the characters to be joined are consecutive opening and closing +parentheses, or if the junction follows another newline. + +If there is a fill prefix, @kbd{M-^} deletes the fill prefix if it appears after the newline that is deleted. @xref{Fill Prefix}. +@item C-M-\ @kindex C-M-\ +@findex indent-region +Indent all the lines in the region, as though you had typed @key{TAB} +at the beginning of each line (@code{indent-region}). + +If a numeric argument is supplied, indent every line in the region to +that column number. + +@item C-x @key{TAB} @kindex C-x TAB -@findex indent-region @findex indent-rigidly - There are also commands for changing the indentation of several lines -at once. They apply to all the lines that begin in the region. -@kbd{C-M-\} (@code{indent-region}) indents each line in the ``usual'' -way, as if you had typed @key{TAB} at the beginning of the line. A -numeric argument specifies the column to indent to, and each line is -shifted left or right so that its first nonblank character appears in -that column. @kbd{C-x @key{TAB}} (@code{indent-rigidly}) moves all of -the lines in the region right by its argument (left, for negative -arguments). The whole group of lines moves rigidly sideways, which is -how the command gets its name. - @cindex remove indentation - To remove all indentation from all of the lines in the region, -invoke @kbd{C-x @key{TAB}} with a large negative argument, such as --1000. - -@findex indent-relative - @kbd{M-x indent-relative} indents at point based on the previous line -(actually, the last nonempty line). It inserts whitespace at point, moving -point, until it is underneath the next indentation point in the previous line. -An indentation point is the end of a sequence of whitespace or the end of -the line. If point is farther right than any indentation point in the -previous line, @code{indent-relative} runs @code{tab-to-tab-stop} -@ifnottex -(@pxref{Tab Stops}), -@end ifnottex -@iftex -(see next section), -@end iftex -unless it is called with a numeric argument, in which case it does -nothing. - - @xref{Format Indentation}, for another way of specifying the -indentation for part of your text. - -@node Tab Stops, Just Spaces, Indentation Commands, Indentation +Shift each line in the region by a fixed distance, to the right or +left (@code{indent-rigidly}). The distance to move is determined by +the numeric argument (positive to move rightward, negative to move +leftward). + +This command can be used to remove all indentation from the lines in +the region, by invoking it with a large negative argument, +e.g. @kbd{C-u -1000 C-x @key{TAB}}. +@end table + +@node Tab Stops @section Tab Stops - @cindex tab stops -@cindex using tab stops in making tables -@cindex tables, indentation for -@kindex M-i -@findex tab-to-tab-stop - For typing in tables, you can use @kbd{M-i} (@code{tab-to-tab-stop}). -This command inserts indentation before point, enough to reach the -next tab stop column. + +@vindex tab-stop-list + Emacs defines certain column numbers to be @dfn{tab stops}. These +are used as stopping points by @key{TAB} when inserting whitespace in +Text mode and related modes (@pxref{Indentation}), and by commands +like @kbd{M-i} (@pxref{Indentation Commands}). By default, tab stops +are located every 8 columns. These positions are stored in the +variable @code{tab-stop-list}, whose value is a list of column numbers +in increasing order. @findex edit-tab-stops -@findex edit-tab-stops-note-changes @kindex C-c C-c @r{(Edit Tab Stops)} -@vindex tab-stop-list - You can change the tab stops used by @kbd{M-i} and other indentation -commands, so that they need not be spaced every eight characters, or -even regularly spaced. The tab stops are stored in the variable -@code{tab-stop-list}, as a list of column numbers in increasing order. - - A convenient way to set the tab stops is with @kbd{M-x -edit-tab-stops}, which creates and selects a buffer containing a -description of the tab stop settings. You can edit this buffer to -specify different tab stops, and then type @kbd{C-c C-c} to make those -new tab stops take effect. The buffer uses Overwrite mode -(@pxref{Minor Modes}). @code{edit-tab-stops} records which buffer was -current when you invoked it, and stores the tab stops back in that -buffer; normally all buffers share the same tab stops and changing -them in one buffer affects all, but if you happen to make -@code{tab-stop-list} local in one buffer then @code{edit-tab-stops} in -that buffer will edit the local settings. - - Here is what the text representing the tab stops looks like for ordinary -tab stops every eight columns. + Instead of customizing the variable @code{tab-stop-list} directly, a +convenient way to view and set tab stops is via the command @kbd{M-x +edit-tab-stops}. This switches to a buffer containing a description +of the tab stop settings, which looks like this: @example : : : : : : @@ -224,37 +164,77 @@ To install changes, type C-c C-c @end example - The first line contains a colon at each tab stop. The remaining lines -are present just to help you see where the colons are and know what to do. - - Note that the tab stops that control @code{tab-to-tab-stop} have -nothing to do with how tab characters are displayed in the buffer. -Tab characters are always displayed as empty spaces extending to the -next display tab stop, which occurs every @code{tab-width} columns -regardless of the contents of @code{tab-stop-list}. @xref{Text +@noindent +The first line contains a colon at each tab stop. The numbers on the +next two lines are present just to indicate where the colons are. + + You can edit this buffer to specify different tab stops by placing +colons on the desired columns. The buffer uses Overwrite mode +(@pxref{Minor Modes}). When you are done, type @kbd{C-c C-c} to make +the new tab stops take effect. Normally, the new tab stop settings +apply to all buffers. However, if you have made the +@code{tab-stop-list} variable local to the buffer where you called +@kbd{M-x edit-tab-stops} (@pxref{Locals}), then the new tab stop +settings apply only to that buffer. To save the tab stop settings for +future Emacs sessions, use the Customize interface to save the value +of @code{tab-stop-list} (@pxref{Easy Customization}). + + Note that the tab stops discussed in this section have nothing to do +with how tab characters are displayed in the buffer. Tab characters +are always displayed as empty spaces extending to the next +@dfn{display tab stop}. @xref{Text Display}. + +@node Just Spaces +@section Tabs vs. Spaces + +@vindex tab-width + Normally, indentation commands insert (or remove) an optimal mix of +space characters and tab characters to align to the desired column. +Tab characters are displayed as a stretch of empty space extending to +the next @dfn{display tab stop}. By default, there is one display tab +stop every @code{tab-width} columns (the default is 8). @xref{Text Display}. -@node Just Spaces,, Tab Stops, Indentation -@section Tabs vs. Spaces - @vindex indent-tabs-mode - Emacs normally uses both tabs and spaces to indent lines. If you -prefer, all indentation can be made from spaces only. To request -this, set @code{indent-tabs-mode} to @code{nil}. This is a per-buffer -variable, so altering the variable affects only the current buffer, -but there is a default value which you can change as well. -@xref{Locals}. + If you prefer, all indentation can be made from spaces only. To +request this, set the buffer-local variable @code{indent-tabs-mode} to +@code{nil}. @xref{Locals}, for information about setting buffer-local +variables. Note, however, that @kbd{C-q @key{TAB}} always inserts a +tab character, regardless of the value of @code{indent-tabs-mode}. - A tab is not always displayed in the same way. By default, tabs are -eight columns wide, but some people like to customize their editors to -use a different tab width (e.g., by changing the variable -@code{tab-width} in Emacs). By using spaces only, you can make sure -that your file looks the same regardless of the tab width setting. + One reason to set @code{indent-tabs-mode} to @code{nil} is that not +all editors display tab characters in the same way. Emacs users, too, +may have different customized values of @code{tab-width}. By using +spaces only, you can make sure that your file always looks the same. +If you only care about how it looks within Emacs, another way to +tackle this problem is to set the @code{tab-width} variable in a +file-local variable (@pxref{File Variables}). @findex tabify @findex untabify There are also commands to convert tabs to spaces or vice versa, always -preserving the columns of all nonblank text. @kbd{M-x tabify} scans the +preserving the columns of all non-whitespace text. @kbd{M-x tabify} scans the region for sequences of spaces, and converts sequences of at least two spaces to tabs if that can be done without changing indentation. @kbd{M-x untabify} changes all tabs in the region to appropriate numbers of spaces. + +@node Indent Convenience +@section Convenience Features for Indentation + +@vindex tab-always-indent + The variable @code{tab-always-indent} tweaks the behavior of the +@key{TAB} (@code{indent-for-tab-command}) command. The default value, +@code{t}, gives the behavior described in @ref{Indentation}. If you +change the value to the symbol @code{complete}, then @key{TAB} first +tries to indent the current line, and if the line was already +indented, it tries to complete the text at point (@pxref{Symbol +Completion}). If the value is @code{nil}, then @key{TAB} indents the +current line only if point is at the left margin or in the line's +indentation; otherwise, it inserts a tab character. + +@cindex Electric Indent mode +@cindex mode, Electric Indent +@findex electric-indent-mode + Electric Indent mode is a global minor mode that automatically +indents the line after every @key{RET} you type. To toggle this minor +mode, type @kbd{M-x electric-indent-mode}. === modified file 'doc/emacs/programs.texi' --- doc/emacs/programs.texi 2011-10-24 02:01:54 +0000 +++ doc/emacs/programs.texi 2011-11-28 11:12:00 +0000 @@ -397,7 +397,7 @@ Use @kbd{C-q @key{TAB}} to insert a tab character at point. -@kindex C-j +@kindex C-j @r{(indenting source code)} @findex newline-and-indent When entering lines of new code, use @kbd{C-j} (@code{newline-and-indent}), which inserts a newline and then adjusts === modified file 'doc/emacs/windows.texi' --- doc/emacs/windows.texi 2011-11-27 08:22:37 +0000 +++ doc/emacs/windows.texi 2011-11-28 11:12:00 +0000 @@ -193,6 +193,7 @@ @findex display-buffer @item C-x 4 C-o @var{bufname} @key{RET} +@kindex C-x 4 C-o Display buffer @var{bufname} in some window, without trying to select it (@code{display-buffer}). @xref{Displaying Buffers}, for details about how the window is chosen. @@ -421,7 +422,7 @@ @end itemize @node Window Convenience -@section Window Handling Convenience Features and Customization +@section Convenience Features for Window Handling @findex winner-mode @cindex Winner mode ------------------------------------------------------------ revno: 106538 committer: Julien Danjou branch nick: emacs-trunk timestamp: Mon 2011-11-28 10:24:08 +0100 message: erc-dcc: allow SEND commands containing quoted filenames with spaces in them * erc-dcc.el (erc-dcc-ctcp-query-send-regexp): Updated regexp to match quoted filenames with spaces inside. (erc-dcc-handle-ctcp-send): Updated regexp match group numbers, added processing of escaped quotes and backslashes if filename itself was in quotes. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2011-11-20 03:48:53 +0000 +++ lisp/erc/ChangeLog 2011-11-28 09:24:08 +0000 @@ -1,3 +1,11 @@ +2011-11-28 Mike Kazantsev (tiny change) + + * erc-dcc.el (erc-dcc-ctcp-query-send-regexp): Updated regexp to + match quoted filenames with spaces inside. + (erc-dcc-handle-ctcp-send): Updated regexp match group numbers, + added processing of escaped quotes and backslashes if filename + itself was in quotes. + 2011-11-20 Juanma Barranquero * erc-log.el (erc-logging-enabled): Fix typo. === modified file 'lisp/erc/erc-dcc.el' --- lisp/erc/erc-dcc.el 2011-04-26 13:50:09 +0000 +++ lisp/erc/erc-dcc.el 2011-11-28 09:24:08 +0000 @@ -649,7 +649,16 @@ ?q query ?n nick ?u login ?h host)))) (defconst erc-dcc-ctcp-query-send-regexp - "^DCC SEND \\([^ ]+\\) \\([0-9]+\\) \\([0-9]+\\) *\\([0-9]*\\)") + (concat "^DCC SEND \\(" + ;; Following part matches either filename without spaces + ;; or filename enclosed in double quotes with any number + ;; of escaped double quotes inside. + "\"\\(\\(.*?\\(\\\\\"\\)?\\)+?\\)\"\\|\\([^ ]+\\)" + "\\) \\([0-9]+\\) \\([0-9]+\\) *\\([0-9]*\\)")) + +(defsubst erc-dcc-unquote-filename (filename) + (erc-replace-regexp-in-string "\\\\\\\\" "\\" + (erc-replace-regexp-in-string "\\\\\"" "\"" filename t t) t t)) (defun erc-dcc-handle-ctcp-send (proc query nick login host to) "This is called if a CTCP DCC SEND subcommand is sent to the client. @@ -664,10 +673,12 @@ 'dcc-request-bogus ?r "SEND" ?n nick ?u login ?h host)) ((string-match erc-dcc-ctcp-query-send-regexp query) - (let ((filename (match-string 1 query)) - (ip (erc-decimal-to-ip (match-string 2 query))) - (port (match-string 3 query)) - (size (match-string 4 query))) + (let ((filename + (or (match-string 3 query) + (erc-dcc-unquote-filename (match-string 2 query)))) + (ip (erc-decimal-to-ip (match-string 6 query))) + (port (match-string 7 query)) + (size (match-string 8 query))) ;; FIXME: a warning really should also be sent ;; if the ip address != the host the dcc sender is on. (erc-display-message ------------------------------------------------------------ revno: 106537 committer: Paul Eggert branch nick: trunk timestamp: Mon 2011-11-28 00:20:58 -0800 message: Remove GCPRO-related macros that exist only to avoid shadowing locals. * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR) (GCPRO6_VAR, UNGCPRO_VAR): Remove. See . All uses changed to use GCPRO1 etc. (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO): Revert to old implementation (i.e., before 2011-03-11). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-11-28 01:07:01 +0000 +++ src/ChangeLog 2011-11-28 08:20:58 +0000 @@ -1,3 +1,13 @@ +2011-11-28 Paul Eggert + + Remove GCPRO-related macros that exist only to avoid shadowing locals. + * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR) + (GCPRO6_VAR, UNGCPRO_VAR): Remove. See + . + All uses changed to use GCPRO1 etc. + (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO): + Revert to old implementation (i.e., before 2011-03-11). + 2011-11-28 YAMAMOTO Mitsuharu * dispnew.c (scrolling_window): Truncate overlaps in copy destination === modified file 'src/dired.c' --- src/dired.c 2011-11-17 09:09:20 +0000 +++ src/dired.c 2011-11-28 08:20:58 +0000 @@ -229,11 +229,11 @@ int len; int wanted = 0; Lisp_Object name, finalname; - struct gcpro inner_gcpro1, inner_gcpro2; + struct gcpro gcpro1, gcpro2; len = NAMLEN (dp); name = finalname = make_unibyte_string (dp->d_name, len); - GCPRO2_VAR (finalname, name, inner_gcpro); + GCPRO2 (finalname, name); /* Note: DECODE_FILE can GC; it should protect its argument, though. */ @@ -289,23 +289,23 @@ /* Construct an expanded filename for the directory entry. Use the decoded names for input to Ffile_attributes. */ Lisp_Object decoded_fullname, fileattrs; - struct gcpro innermost_gcpro1, innermost_gcpro2; + struct gcpro gcpro1, gcpro2; decoded_fullname = fileattrs = Qnil; - GCPRO2_VAR (decoded_fullname, fileattrs, innermost_gcpro); + GCPRO2 (decoded_fullname, fileattrs); /* Both Fexpand_file_name and Ffile_attributes can GC. */ decoded_fullname = Fexpand_file_name (name, directory); fileattrs = Ffile_attributes (decoded_fullname, id_format); list = Fcons (Fcons (finalname, fileattrs), list); - UNGCPRO_VAR (innermost_gcpro); + UNGCPRO; } else list = Fcons (finalname, list); } - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; } } @@ -673,11 +673,11 @@ if (!NILP (predicate)) { Lisp_Object val; - struct gcpro inner_gcpro1; + struct gcpro gcpro1; - GCPRO1_VAR (name, inner_gcpro); + GCPRO1 (name); val = call1 (predicate, name); - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; if (NILP (val)) continue; === modified file 'src/keyboard.c' --- src/keyboard.c 2011-11-20 19:35:27 +0000 +++ src/keyboard.c 2011-11-28 08:20:58 +0000 @@ -2998,7 +2998,7 @@ { Lisp_Object keys; int key_count, key_count_reset; - struct gcpro inner_gcpro1; + struct gcpro gcpro1; int count = SPECPDL_INDEX (); /* Save the echo status. */ @@ -3026,7 +3026,7 @@ keys = Fcopy_sequence (this_command_keys); else keys = Qnil; - GCPRO1_VAR (keys, inner_gcpro); + GCPRO1 (keys); /* Clear out this_command_keys. */ this_command_key_count = 0; @@ -3064,7 +3064,7 @@ if (saved_immediate_echo) echo_now (); - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; /* The input method can return no events. */ if (! CONSP (tem)) @@ -9053,9 +9053,9 @@ int junk; #endif - struct gcpro outer_gcpro1; + struct gcpro gcpro1; - GCPRO1_VAR (fake_prefixed_keys, outer_gcpro); + GCPRO1 (fake_prefixed_keys); raw_keybuf_count = 0; last_nonmenu_event = Qnil; @@ -9351,7 +9351,7 @@ if (EQ (key, Qt)) { unbind_to (count, Qnil); - UNGCPRO_VAR (outer_gcpro); + UNGCPRO; return -1; } @@ -10049,7 +10049,7 @@ add_command_key (keybuf[t]); } - UNGCPRO_VAR (outer_gcpro); + UNGCPRO; return t; } === modified file 'src/lisp.h' --- src/lisp.h 2011-11-27 18:52:53 +0000 +++ src/lisp.h 2011-11-28 08:20:58 +0000 @@ -2223,143 +2223,127 @@ || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) -#define GCPRO1(var) \ - GCPRO1_VAR (var, gcpro) -#define GCPRO2(var1, var2) \ - GCPRO2_VAR (var1, var2, gcpro) -#define GCPRO3(var1, var2, var3) \ - GCPRO3_VAR (var1, var2, var3, gcpro) -#define GCPRO4(var1, var2, var3, var4) \ - GCPRO4_VAR (var1, var2, var3, var4, gcpro) -#define GCPRO5(var1, var2, var3, var4, var5) \ - GCPRO5_VAR (var1, var2, var3, var4, var5, gcpro) -#define GCPRO6(var1, var2, var3, var4, var5, var6) \ - GCPRO6_VAR (var1, var2, var3, var4, var5, var6, gcpro) -#define UNGCPRO UNGCPRO_VAR (gcpro) - #if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS /* Do something silly with gcproN vars just so gcc shuts up. */ /* You get warnings from MIPSPro... */ -#define GCPRO1_VAR(var, gcpro) ((void) gcpro##1) -#define GCPRO2_VAR(var1, var2, gcpro) \ - ((void) gcpro##2, (void) gcpro##1) -#define GCPRO3_VAR(var1, var2, var3, gcpro) \ - ((void) gcpro##3, (void) gcpro##2, (void) gcpro##1) -#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ - ((void) gcpro##4, (void) gcpro##3, (void) gcpro##2, (void) gcpro##1) -#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ - ((void) gcpro##5, (void) gcpro##4, (void) gcpro##3, (void) gcpro##2, \ - (void) gcpro##1) -#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ - ((void) gcpro##6, (void) gcpro##5, (void) gcpro##4, (void) gcpro##3, \ - (void) gcpro##2, (void) gcpro##1) -#define UNGCPRO_VAR(gcpro) ((void) 0) +#define GCPRO1(varname) ((void) gcpro1) +#define GCPRO2(varname1, varname2) ((void) gcpro2, (void) gcpro1) +#define GCPRO3(varname1, varname2, varname3) \ + ((void) gcpro3, (void) gcpro2, (void) gcpro1) +#define GCPRO4(varname1, varname2, varname3, varname4) \ + ((void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1) +#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ + ((void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1) +#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ + ((void) gcpro6, (void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, \ + (void) gcpro1) +#define UNGCPRO ((void) 0) #else /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ #ifndef DEBUG_GCPRO -#define GCPRO1_VAR(var1, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcprolist = &gcpro##1; } - -#define GCPRO2_VAR(var1, var2, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcprolist = &gcpro##2; } - -#define GCPRO3_VAR(var1, var2, var3, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcprolist = &gcpro##3; } - -#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ - gcprolist = &gcpro##4; } - -#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ - gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ - gcprolist = &gcpro##5; } - -#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ - gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ - gcpro##6 .next = &gcpro##5; gcpro##6 .var = &var6; gcpro##6 .nvars = 1; \ - gcprolist = &gcpro##6; } - -#define UNGCPRO_VAR(gcpro) (gcprolist = gcpro##1 .next) +#define GCPRO1(varname) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ + gcprolist = &gcpro1; } + +#define GCPRO2(varname1, varname2) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcprolist = &gcpro2; } + +#define GCPRO3(varname1, varname2, varname3) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcprolist = &gcpro3; } + +#define GCPRO4(varname1, varname2, varname3, varname4) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcprolist = &gcpro4; } + +#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcprolist = &gcpro5; } + +#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ + gcprolist = &gcpro6; } + +#define UNGCPRO (gcprolist = gcpro1.next) #else extern int gcpro_level; -#define GCPRO1_VAR(var1, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##1 .level = gcpro_level++; \ - gcprolist = &gcpro##1; } - -#define GCPRO2_VAR(var1, var2, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##1 .level = gcpro_level; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##2 .level = gcpro_level++; \ - gcprolist = &gcpro##2; } - -#define GCPRO3_VAR(var1, var2, var3, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##1 .level = gcpro_level; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##3 .level = gcpro_level++; \ - gcprolist = &gcpro##3; } - -#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##1 .level = gcpro_level; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ - gcpro##4 .level = gcpro_level++; \ - gcprolist = &gcpro##4; } - -#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##1 .level = gcpro_level; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ - gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ - gcpro##5 .level = gcpro_level++; \ - gcprolist = &gcpro##5; } - -#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ - {gcpro##1 .next = gcprolist; gcpro##1 .var = &var1; gcpro##1 .nvars = 1; \ - gcpro##1 .level = gcpro_level; \ - gcpro##2 .next = &gcpro##1; gcpro##2 .var = &var2; gcpro##2 .nvars = 1; \ - gcpro##3 .next = &gcpro##2; gcpro##3 .var = &var3; gcpro##3 .nvars = 1; \ - gcpro##4 .next = &gcpro##3; gcpro##4 .var = &var4; gcpro##4 .nvars = 1; \ - gcpro##5 .next = &gcpro##4; gcpro##5 .var = &var5; gcpro##5 .nvars = 1; \ - gcpro##6 .next = &gcpro##5; gcpro##6 .var = &var6; gcpro##6 .nvars = 1; \ - gcpro##6 .level = gcpro_level++; \ - gcprolist = &gcpro##6; } - -#define UNGCPRO_VAR(gcpro) \ - ((--gcpro_level != gcpro##1 .level) \ - ? (abort (), 0) \ - : ((gcprolist = gcpro##1 .next), 0)) +#define GCPRO1(varname) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level++; \ + gcprolist = &gcpro1; } + +#define GCPRO2(varname1, varname2) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro2.level = gcpro_level++; \ + gcprolist = &gcpro2; } + +#define GCPRO3(varname1, varname2, varname3) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro3.level = gcpro_level++; \ + gcprolist = &gcpro3; } + +#define GCPRO4(varname1, varname2, varname3, varname4) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro4.level = gcpro_level++; \ + gcprolist = &gcpro4; } + +#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcpro5.level = gcpro_level++; \ + gcprolist = &gcpro5; } + +#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ + gcpro6.level = gcpro_level++; \ + gcprolist = &gcpro6; } + +#define UNGCPRO \ + ((--gcpro_level != gcpro1.level) \ + ? (abort (), 0) \ + : ((gcprolist = gcpro1.next), 0)) #endif /* DEBUG_GCPRO */ #endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ === modified file 'src/process.c' --- src/process.c 2011-11-26 07:42:44 +0000 +++ src/process.c 2011-11-28 08:20:58 +0000 @@ -3474,7 +3474,7 @@ { /* Setup coding systems for communicating with the network stream. */ - struct gcpro inner_gcpro1; + struct gcpro gcpro1; /* Qt denotes we have not yet called Ffind_operation_coding_system. */ Lisp_Object coding_systems = Qt; Lisp_Object fargs[5], val; @@ -3502,9 +3502,9 @@ { fargs[0] = Qopen_network_stream, fargs[1] = name, fargs[2] = buffer, fargs[3] = host, fargs[4] = service; - GCPRO1_VAR (proc, inner_gcpro); + GCPRO1 (proc); coding_systems = Ffind_operation_coding_system (5, fargs); - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; } if (CONSP (coding_systems)) val = XCAR (coding_systems); @@ -3535,9 +3535,9 @@ { fargs[0] = Qopen_network_stream, fargs[1] = name, fargs[2] = buffer, fargs[3] = host, fargs[4] = service; - GCPRO1_VAR (proc, inner_gcpro); + GCPRO1 (proc); coding_systems = Ffind_operation_coding_system (5, fargs); - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; } } if (CONSP (coding_systems)) === modified file 'src/xfns.c' --- src/xfns.c 2011-11-20 07:30:16 +0000 +++ src/xfns.c 2011-11-28 08:20:58 +0000 @@ -3166,7 +3166,7 @@ to get the color reference counts right, so initialize them! */ { Lisp_Object black; - struct gcpro inner_gcpro1; + struct gcpro gcpro1; /* Function x_decode_color can signal an error. Make sure to initialize color slots so that we won't try @@ -3179,7 +3179,7 @@ f->output_data.x->mouse_pixel = -1; black = build_string ("black"); - GCPRO1_VAR (black, inner_gcpro); + GCPRO1 (black); FRAME_FOREGROUND_PIXEL (f) = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); FRAME_BACKGROUND_PIXEL (f) @@ -3192,7 +3192,7 @@ = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); f->output_data.x->mouse_pixel = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; } /* Specify the parent under which to make this X window. */ @@ -4620,7 +4620,7 @@ to get the color reference counts right, so initialize them! */ { Lisp_Object black; - struct gcpro inner_gcpro1; + struct gcpro gcpro1; /* Function x_decode_color can signal an error. Make sure to initialize color slots so that we won't try @@ -4633,7 +4633,7 @@ f->output_data.x->mouse_pixel = -1; black = build_string ("black"); - GCPRO1_VAR (black, inner_gcpro); + GCPRO1 (black); FRAME_FOREGROUND_PIXEL (f) = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); FRAME_BACKGROUND_PIXEL (f) @@ -4646,7 +4646,7 @@ = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); f->output_data.x->mouse_pixel = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); - UNGCPRO_VAR (inner_gcpro); + UNGCPRO; } /* Set the name; the functions to which we pass f expect the name to ------------------------------------------------------------ revno: 106536 committer: Chong Yidong branch nick: trunk timestamp: Mon 2011-11-28 14:26:39 +0800 message: * emacs-lisp/easy-mmode.el (define-minor-mode): Fix default doc. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-11-27 08:33:25 +0000 +++ lisp/ChangeLog 2011-11-28 06:26:39 +0000 @@ -1,3 +1,7 @@ +2011-11-28 Chong Yidong + + * emacs-lisp/easy-mmode.el (define-minor-mode): Fix default doc. + 2011-11-27 Nick Roberts * progmodes/gdb-mi.el (gdb-init-1): Condition execution of === modified file 'lisp/emacs-lisp/easy-mmode.el' --- lisp/emacs-lisp/easy-mmode.el 2011-10-27 03:01:40 +0000 +++ lisp/emacs-lisp/easy-mmode.el 2011-11-28 06:26:39 +0000 @@ -233,10 +233,10 @@ (defun ,modefun (&optional arg ,@extra-args) ,(or doc (format (concat "Toggle %s on or off. -Interactively, with no prefix argument, toggle the mode. -With universal prefix ARG turn mode on. -With zero or negative ARG turn mode off. -\\{%s}") pretty-name keymap-sym)) +With a prefix argument ARG, enable %s if ARG is +positive, and disable it otherwise. If called from Lisp, enable +the mode if ARG is omitted or nil. +\\{%s}") pretty-name pretty-name keymap-sym)) ;; Use `toggle' rather than (if ,mode 0 1) so that using ;; repeat-command still does the toggling correctly. (interactive (list (or current-prefix-arg 'toggle)))