Now on revision 106039. Conflicting tags: mh-e-doc-8.3 mh-e-8.3 ------------------------------------------------------------ revno: 106039 committer: martin rudalics branch nick: trunk timestamp: Sun 2011-10-09 14:33:56 +0200 message: Add version tag for frame-auto-hide-function (Bug#9699). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-09 09:38:25 +0000 +++ lisp/ChangeLog 2011-10-09 12:33:56 +0000 @@ -1,3 +1,8 @@ +2011-10-09 Martin Rudalics + + * window.el (frame-auto-hide-function): Add version tag. + (Bug#9699) + 2011-10-09 Michael Albinus * net/tramp.el (tramp-file-name-handler): Add 'debug to the error === modified file 'lisp/window.el' --- lisp/window.el 2011-10-08 14:01:55 +0000 +++ lisp/window.el 2011-10-09 12:33:56 +0000 @@ -2772,7 +2772,8 @@ (const :tag "Do nothing" ignore) function) :group 'windows - :group 'frames) + :group 'frames + :version "24.1") (defun window--delete (&optional window dedicated-only kill) "Delete WINDOW if possible. ------------------------------------------------------------ revno: 106038 committer: martin rudalics branch nick: trunk timestamp: Sun 2011-10-09 14:26:29 +0200 message: Describe frame-auto-hide-function and related issues. * buffers.texi (The Buffer List): Describe how bury-buffer deals with the selected window. * windows.texi (Buffers and Windows): Reformulate text on how replace-buffer-in-windows deals with a window. (Quitting Windows): Describe how quit-window deals with a standalone frame. Describe new option frame-auto-hide-function. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-10-08 20:53:06 +0000 +++ doc/lispref/ChangeLog 2011-10-09 12:26:29 +0000 @@ -1,3 +1,12 @@ +2011-10-09 Martin Rudalics + + * buffers.texi (The Buffer List): Describe how bury-buffer deals + with the selected window. + * windows.texi (Buffers and Windows): Reformulate text on how + replace-buffer-in-windows deals with a window. + (Quitting Windows): Describe how quit-window deals with a + standalone frame. Describe new option frame-auto-hide-function. + 2011-10-08 Glenn Morris * symbols.texi (Other Plists): Markup fix. (Bug#9702) === modified file 'doc/lispref/buffers.texi' --- doc/lispref/buffers.texi 2011-09-24 22:49:32 +0000 +++ doc/lispref/buffers.texi 2011-10-09 12:26:29 +0000 @@ -884,23 +884,28 @@ @code{other-buffer} to return. The argument can be either a buffer itself or the name of one. -@code{bury-buffer} operates on each frame's @code{buffer-list} parameter -as well as the fundamental buffer list; therefore, the buffer that you -bury will come last in the value of @code{(buffer-list @var{frame})} and -in the value of @code{(buffer-list)}. +This functions operates on each frame's @code{buffer-list} parameter as +well as the fundamental buffer list; therefore, the buffer that you bury +will come last in the value of @code{(buffer-list @var{frame})} and in +the value of @code{(buffer-list)}. In addition, it also puts the buffer +at the end of the list of buffer of the selected window (@pxref{Window +History}) provided it is shown in that window. -If @var{buffer-or-name} is @code{nil} or omitted, this means to bury -the current buffer. In addition, if the buffer is displayed in the -selected window, this switches to some other buffer (obtained using -@code{other-buffer}) in the selected window. @xref{Switching -Buffers}. But if the selected window is dedicated to its buffer, it -deletes that window if there are other windows left on its frame. -Otherwise, if the selected window is the only window on its frame, it -iconifies that frame. If @var{buffer-or-name} is displayed in some +If @var{buffer-or-name} is @code{nil} or omitted, this means to bury the +current buffer. In addition, if the current buffer is displayed in the +selected window, this makes sure that the window is either deleted or +another buffer is shown in it. More precisely, if the window is +dedicated (@pxref{Dedicated Windows}) and there are other windows on its +frame, the window is deleted. If the window is both dedicated and the +only window on its frame's terminal, the function specified by +@code{frame-auto-hide-function} (@pxref{Quitting Windows}) will deal +with the window. If the window is not dedicated to its buffer, it calls +@code{switch-to-prev-buffer} (@pxref{Window History}) to show another +buffer in that window. If @var{buffer-or-name} is displayed in some other window, it remains displayed there. To replace a buffer in all the windows that display it, use -@code{replace-buffer-in-windows}. @xref{Buffers and Windows}. +@code{replace-buffer-in-windows}, @xref{Buffers and Windows}. @end deffn @deffn Command unbury-buffer === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2011-10-01 22:16:24 +0000 +++ doc/lispref/windows.texi 2011-10-09 12:26:29 +0000 @@ -2076,16 +2076,17 @@ all windows displaying it. For each such window, it choose another buffer using @code{switch-to-prev-buffer} (@pxref{Window History}). -@var{buffer-or-name} may be a buffer, or the name of an existing -buffer; it defaults to the current buffer. +The argument @var{buffer-or-name} may be a buffer, or the name of an +existing buffer; it defaults to the current buffer. If a window displaying @var{buffer-or-name} is dedicated -(@pxref{Dedicated Windows}), has never displayed any other buffers and -is not the only window on its frame, that window is deleted. If that -window is the only window on its frame and there are other frames on the -frame's terminal, that frame is deleted too; otherwise, the buffer -provided by the function @code{switch-to-prev-buffer} (@pxref{Window -History}) is displayed instead. +(@pxref{Dedicated Windows}) and is not the only window on its frame, +that window is deleted. If that window is the only window on its frame +and there are other frames on the frame's terminal, that frame is dealt +with by the function spcecified by @code{frame-auto-hide-function} +(@pxref{Quitting Windows}). Otherwise, the buffer provided by the +function @code{switch-to-prev-buffer} (@pxref{Window History}) is +displayed in the window instead. @end deffn @@ -2784,14 +2785,14 @@ @section Quitting Windows When you want to get rid of a window used for displaying a buffer you -can use the function @code{delete-window} (@pxref{Deleting Windows}) to -remove that window from its frame. If the buffer has been shown on a -separate frame, you might want to call @code{delete-frame} -(@pxref{Deleting Frames}) instead. If, on the other hand, a window has -been reused for displaying the buffer, you might prefer showing the -buffer previously shown in that window by calling the function -@code{switch-to-prev-buffer} (@pxref{Window History}). Finally, you -might want to either bury (@pxref{The Buffer List}) or kill +can call @code{delete-window} or @code{delete-windows-on} +(@pxref{Deleting Windows}) to remove that window from its frame. If the +buffer is shown on a separate frame, you might want to call +@code{delete-frame} (@pxref{Deleting Frames}) instead. If, on the other +hand, a window has been reused for displaying the buffer, you might +prefer showing the buffer previously shown in that window by calling the +function @code{switch-to-prev-buffer} (@pxref{Window History}). +Finally, you might want to either bury (@pxref{The Buffer List}) or kill (@pxref{Killing Buffers}) the window's buffer. The following function uses information on how the window for @@ -2807,9 +2808,12 @@ Quitting @var{window} means to proceed as follows: If @var{window} was created specially for displaying its current buffer, delete @var{window} provided its frame contains at least one other live window. If -@var{window} is the only window on its frame and other frames still -exist, delete the frame together with @var{window}. If, however, there -are no other frames left, display some other buffer in @var{window}. +@var{window} is the only window on its frame and there are other frames +on the frame's terminal, the value of @var{kill} determines how to +proceed with the window. If @var{kill} is @code{nil}, the fate of the +frame is determined by calling @code{frame-auto-hide-function} (see +below) with that frame as sole argument. If @var{kill} is +non-@code{nil}, the frame is deleted unconditionally. If @var{window} was reused for displaying its buffer, this command tries to display the buffer previously shown in it. It also tries to restore @@ -2831,6 +2835,31 @@ (@pxref{Window Parameters}) and resets that parameter to @code{nil} after it's done. +The following option specifies how to deal with a frame containing just +one window that shall be either quit or whose buffer shall be buried. + +@defopt frame-auto-hide-function +The function specified by this option is called to automatically hide +frames. This function is called with one argument - a frame. + +The function specified here is called by @code{bury-buffer} (@pxref{The +Buffer List}) when the selected window is dedicated and shows the buffer +that shall be buried. It is also called by @code{quit-window} (see +above) when the frame of the window that shall be quit has been +specially created for displaying that window's buffer and the buffer +shall be buried. + +The default is to call @code{iconify-frame} (@pxref{Visibility of +Frames}). Alternatively, you may either specify @code{delete-frame} +(@pxref{Deleting Frames}) to remove the frame from its display, +@code{ignore} to leave the frame unchanged, or any other function that +can take a frame as its sole argument. + +Note that the function specified by this option is called if and only if +there's at least one other frame on the terminal of the frame it's +supposed to handle and that frame contains only one live window. +@end defopt + @node Window Point @section Windows and Point === modified file 'etc/NEWS' --- etc/NEWS 2011-10-08 19:17:34 +0000 +++ etc/NEWS 2011-10-09 12:26:29 +0000 @@ -1106,6 +1106,11 @@ The behavior of `quit-window' has been changed in order to restore the state before the last buffer display operation in that window. ++++ +*** The new option `frame-auto-hide-function' lets you choose between +iconfying or deleting a frame when burying a buffer shown in a dedicated +frame or quitting a window showing a buffer in a frame of its own. + ** Completion *** New variable completion-extra-properties used to specify extra properties ------------------------------------------------------------ revno: 106037 committer: Michael Albinus branch nick: trunk timestamp: Sun 2011-10-09 11:38:25 +0200 message: * net/tramp.el (tramp-file-name-handler): Add 'debug to the error condition. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-09 01:44:43 +0000 +++ lisp/ChangeLog 2011-10-09 09:38:25 +0000 @@ -1,3 +1,8 @@ +2011-10-09 Michael Albinus + + * net/tramp.el (tramp-file-name-handler): Add 'debug to the error + condition. + 2011-10-09 Leo Liu * mail/smtpmail.el (smtpmail-send-data): Add a missing space. === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2011-09-21 10:42:55 +0000 +++ lisp/net/tramp.el 2011-10-09 09:38:25 +0000 @@ -1886,7 +1886,7 @@ (apply foreign operation args)) ;; Trace that somebody has interrupted the operation. - (quit + ((debug quit) (let (tramp-message-show-message) (tramp-message v 1 "Interrupt received in operation %s" @@ -1898,6 +1898,9 @@ ;; operations shall return at least a default value ;; in order to give the user a chance to correct the ;; file name in the minibuffer. + ;; We cannot use 'debug as error handler. In order + ;; to get a full backtrace, one could apply + ;; (setq debug-on-error t debug-on-signal t) (error (cond ((and completion (zerop (length localname)) @@ -3850,9 +3853,9 @@ ;; * Run emerge on two remote files. Bug is described here: ;; . ;; (Bug#6850) - -;; Functions for file-name-handler-alist: -;; diff-latest-backup-file -- in diff.el +;; * It would be very useful if it were possible to load or save a +;; buffer using Tramp in a non-blocking way so that use of Emacs on +;; other buffers could continue. (Bug#9617) ;;; tramp.el ends here ------------------------------------------------------------ revno: 106036 committer: Leo Liu branch nick: trunk timestamp: Sun 2011-10-09 09:44:43 +0800 message: Add a missing space in smtpmail-send-data http://debbugs.gnu.org/9701 diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-08 21:52:08 +0000 +++ lisp/ChangeLog 2011-10-09 01:44:43 +0000 @@ -1,3 +1,8 @@ +2011-10-09 Leo Liu + + * mail/smtpmail.el (smtpmail-send-data): Add a missing space. + (Bug#9701) + 2011-10-08 Glenn Morris * progmodes/f90.el (f90-calculate-indent): Give preprocessor lines === modified file 'lisp/mail/smtpmail.el' --- lisp/mail/smtpmail.el 2011-09-27 17:45:18 +0000 +++ lisp/mail/smtpmail.el 2011-10-09 01:44:43 +0000 @@ -924,7 +924,7 @@ (defun smtpmail-send-data (process buffer) (let ((data-continue t) sending-data (pr (with-current-buffer buffer - (make-progress-reporter "Sending email" + (make-progress-reporter "Sending email " (point-min) (point-max))))) (with-current-buffer buffer (goto-char (point-min))) ------------------------------------------------------------ revno: 106035 fixes bug(s): http://debbugs.gnu.org/9690 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-10-08 14:52:08 -0700 message: f90 indentation fix. * lisp/progmodes/f90.el (f90-calculate-indent): Give preprocessor lines before the first code statement zero indent. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-08 16:37:46 +0000 +++ lisp/ChangeLog 2011-10-08 21:52:08 +0000 @@ -1,3 +1,8 @@ +2011-10-08 Glenn Morris + + * progmodes/f90.el (f90-calculate-indent): Give preprocessor lines + before the first code statement zero indent. (Bug#9690) + 2011-10-08 Chong Yidong * simple.el (count-words-region): Always count in the region. === modified file 'lisp/progmodes/f90.el' --- lisp/progmodes/f90.el 2011-09-20 06:36:45 +0000 +++ lisp/progmodes/f90.el 2011-10-08 21:52:08 +0000 @@ -1489,14 +1489,19 @@ (if (not (f90-previous-statement)) ;; If f90-previous-statement returns nil, we must have been ;; called from on or before the first line of the first statement. - (setq icol (if (save-excursion - ;; f90-previous-statement has moved us over - ;; comment/blank lines, so we need to get - ;; back to the first code statement. - (when (looking-at "[ \t]*\\([!#]\\|$\\)") - (f90-next-statement)) - (skip-chars-forward " \t0-9") - (f90-looking-at-program-block-start)) + (setq icol (if (or (save-excursion + (goto-char pnt) + (beginning-of-line) + ;; Preprocessor line before code statement. + (looking-at "[ \t]*#")) + (progn + ;; f90-previous-statement has moved us over + ;; comment/blank lines, so we need to get + ;; back to the first code statement. + (when (looking-at "[ \t]*\\([!#]\\|$\\)") + (f90-next-statement)) + (skip-chars-forward " \t0-9") + (f90-looking-at-program-block-start))) 0 ;; No explicit PROGRAM start statement. f90-program-indent)) ------------------------------------------------------------ revno: 106034 fixes bug(s): http://debbugs.gnu.org/8479 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-10-08 14:07:23 -0700 message: Small callint.c fix. * src/callint.c (Fcall_interactively): Give a more explicit error for the 'c' case with a non-character input. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-10-08 13:03:43 +0000 +++ src/ChangeLog 2011-10-08 21:07:23 +0000 @@ -1,3 +1,8 @@ +2011-10-08 Glenn Morris + + * callint.c (Fcall_interactively): Give a more explicit error for the + 'c' case with a non-character input. (Bug#8479) + 2011-10-08 Eli Zaretskii * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left === modified file 'src/callint.c' --- src/callint.c 2011-07-09 07:06:04 +0000 +++ src/callint.c 2011-10-08 21:07:23 +0000 @@ -535,6 +535,8 @@ message1_nolog ((char *) 0); /* Passing args[i] directly stimulates compiler bug */ teml = args[i]; + /* See bug#8479. */ + if (! CHARACTERP (teml)) error ("Non-character input-event"); visargs[i] = Fchar_to_string (teml); break; ------------------------------------------------------------ revno: 106033 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-10-08 14:00:41 -0700 message: * doc/misc/Makefile.in: Fix ert rules. Ref: http://lists.gnu.org/archive/html/emacs-devel/2011-10/msg00224.html diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-10-06 22:11:15 +0000 +++ doc/misc/ChangeLog 2011-10-08 21:00:41 +0000 @@ -1,3 +1,7 @@ +2011-10-08 Glenn Morris + + * Makefile.in: Fix ert rules. + 2011-10-06 Lars Magne Ingebrigtsen * gnus.texi (Gnus Utility Functions): Add more references and === modified file 'doc/misc/Makefile.in' --- doc/misc/Makefile.in 2011-05-20 00:41:03 +0000 +++ doc/misc/Makefile.in 2011-10-08 21:00:41 +0000 @@ -370,12 +370,13 @@ $(ENVADD) $(TEXI2PDF) $< ert : $(infodir)/ert -$(infodir)/ert: ert.texi $(infodir) - cd $(srcdir); $(MAKEINFO) ert.texi -ert.dvi: ert.texi - $(ENVADD) $(TEXI2DVI) ${srcdir}/ert.texi -ert.pdf: ert.texi - $(ENVADD) $(TEXI2PDF) ${srcdir}/ert.texi +$(infodir)/ert: ert.texi + $(mkinfodir) + cd $(srcdir); $(MAKEINFO) $(MAKEINFO_OPTS) $< +ert.dvi: ${srcdir}/ert.texi + $(ENVADD) $(TEXI2DVI) $< +ert.pdf: ${srcdir}/ert.texi + $(ENVADD) $(TEXI2PDF) $< eshell : $(infodir)/eshell $(infodir)/eshell: eshell.texi ------------------------------------------------------------ revno: 106032 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-10-08 13:53:06 -0700 message: * doc/lispref/symbols.texi (Other Plists): Markup fix. (Bug#9702) diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-10-08 20:52:03 +0000 +++ doc/lispref/ChangeLog 2011-10-08 20:53:06 +0000 @@ -1,5 +1,7 @@ 2011-10-08 Glenn Morris + * symbols.texi (Other Plists): Markup fix. (Bug#9702) + * positions.texi (Excursions): Update warning message. 2011-10-05 Chong Yidong === modified file 'doc/lispref/symbols.texi' --- doc/lispref/symbols.texi 2011-01-25 04:08:28 +0000 +++ doc/lispref/symbols.texi 2011-10-08 20:53:06 +0000 @@ -541,7 +541,7 @@ (plist-get '(foo 4 bad) 'foo) @result{} 4 (plist-get '(foo 4 bad) 'bad) - @result{} @code{nil} + @result{} nil (plist-get '(foo 4 bad) 'bar) @result{} nil @end example ------------------------------------------------------------ revno: 106031 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-10-08 13:52:03 -0700 message: * doc/lispref/positions.texi (Excursions): Update warning message. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-10-05 21:39:54 +0000 +++ doc/lispref/ChangeLog 2011-10-08 20:52:03 +0000 @@ -1,3 +1,7 @@ +2011-10-08 Glenn Morris + + * positions.texi (Excursions): Update warning message. + 2011-10-05 Chong Yidong * display.texi (Low-Level Font, Face Attributes, Font Lookup): Fix === modified file 'doc/lispref/positions.texi' --- doc/lispref/positions.texi 2011-04-08 18:53:26 +0000 +++ doc/lispref/positions.texi 2011-10-08 20:52:03 +0000 @@ -832,7 +832,7 @@ during an excursion: @example -Warning: @code{save-excursion} defeated by @code{set-buffer} +Warning: Use `with-current-buffer' rather than save-excursion+set-buffer @end example @noindent ------------------------------------------------------------ revno: 106030 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-10-08 15:17:34 -0400 message: * doc/emacs/mini.texi (Completion Options): Document completion-cycle-threshold. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-10-08 17:29:45 +0000 +++ doc/emacs/ChangeLog 2011-10-08 19:17:34 +0000 @@ -1,3 +1,7 @@ +2011-10-08 Chong Yidong + + * mini.texi (Completion Options): Add completion-cycle-threshold. + 2011-10-08 Eli Zaretskii * mule.texi (Bidirectional Editing): Correct some inaccuracies. === modified file 'doc/emacs/mini.texi' --- doc/emacs/mini.texi 2011-10-08 15:08:50 +0000 +++ doc/emacs/mini.texi 2011-10-08 19:17:34 +0000 @@ -462,24 +462,26 @@ non-@code{nil}. The default value is @code{nil} on systems that have case-sensitive file-names, such as GNU/Linux; it is non-@code{nil} on systems that have case-insensitive file-names, such as Microsoft -Windows. When completing buffer names, case is significant by -default; to ignore case differences, change the variable -@code{read-buffer-completion-ignore-case} to a non-@code{nil} value. +Windows. When completing buffer names, case differences are ignored +if the variable @code{read-buffer-completion-ignore-case} is +non-@code{nil}; the default is @code{nil}. @vindex completion-ignored-extensions @cindex ignored file names, in completion When completing file names, Emacs usually omits certain alternatives -that are considered unlikely to be chosen. The variable -@code{completion-ignored-extensions} contains a list of strings; a -file name ending in any of those strings is ignored as a completion -alternative. The standard value of this variable has several elements -including @code{".o"}, @code{".elc"}, and @code{"~"}. For example, if -a directory contains @samp{foo.c} and @samp{foo.elc}, @samp{foo} +that are considered unlikely to be chosen, as determined by the list +variable @code{completion-ignored-extensions}. Each element in the +list should be a string; any file name ending in such a string is +ignored as a completion alternative. Any element ending in a slash +(@file{/}) represents a subdirectory name. The standard value of +@code{completion-ignored-extensions} has several elements including +@code{".o"}, @code{".elc"}, and @code{"~"}. For example, if a +directory contains @samp{foo.c} and @samp{foo.elc}, @samp{foo} completes to @samp{foo.c}. However, if @emph{all} possible completions end in ``ignored'' strings, they are not ignored: in the -previous example, @samp{foo.e} completes to @samp{foo.elc}. -Displaying the completion list disregards -@code{completion-ignored-extensions}; all completions are listed. +previous example, @samp{foo.e} completes to @samp{foo.elc}. Emacs +disregards @code{completion-ignored-extensions} when showing +completion alternatives in the completion list. @vindex completion-auto-help If @code{completion-auto-help} is set to @code{nil}, the completion @@ -490,11 +492,18 @@ echoes @samp{Next char not unique}; the second @key{TAB} does the completion list buffer. - If an element of @code{completion-ignored-extensions} ends in a -slash (@file{/}), it's a subdirectory name; that directory and its -contents are ignored. Elements of -@code{completion-ignored-extensions} that do not end in a slash are -ordinary file names. +@vindex completion-cycle-threshold + If @code{completion-cycle-threshold} is non-@code{nil}, completion +commands can ``cycle'' through completion alternatives. Normally, if +there is more than one completion alternative for the text in the +minibuffer, a completion command completes up to the longest common +substring. If you change @code{completion-cycle-threshold} to +@code{t}, the completion command instead completes to the first of +those completion alternatives; each subsequent invocation of the +completion command replaces that with the next completion alternative, +in a cyclic manner. If you give @code{completion-cycle-threshold} a +numeric value @var{n}, completion commands switch to this cycling +behavior only when there are fewer than @var{n} alternatives. @cindex Icomplete mode @findex icomplete-mode === modified file 'etc/NEWS' --- etc/NEWS 2011-10-08 16:37:46 +0000 +++ etc/NEWS 2011-10-08 19:17:34 +0000 @@ -103,7 +103,7 @@ --- *** Completion in a non-minibuffer now tries to detect the end of completion and pops down the *Completions* buffer accordingly. - ++++ *** Completion can cycle, depending on completion-cycle-threshold. +++ *** New completion style `substring'. @@ -112,13 +112,6 @@ *** Completion of buffers now uses substring completion by default. -*** `completing-read' can be customized using the new variable -`completing-read-function'. - -*** minibuffer-local-filename-must-match-map is not used any more. -Instead, the bindings in minibuffer-local-filename-completion-map are combined -with minibuffer-local-must-match-map. - ** Mail changes The default of `send-mail-function' is now `sendmail-query-once', @@ -1133,6 +1126,13 @@ - `display-sort-function' to specify how to sort entries in *Completions*. - `cycle-sort-function' to specify how to sort entries when cycling. +*** minibuffer-local-filename-must-match-map is not used any more. +Instead, the bindings in minibuffer-local-filename-completion-map are +combined with minibuffer-local-must-match-map. + +*** New variable `completing-read-function' allows overriding the +behavior of `completing-read'. + ** `glyphless-char-display' can now distinguish between graphical and text terminal display, via a char-table entry that is a cons cell. ------------------------------------------------------------ revno: 106029 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-10-08 19:29:45 +0200 message: doc/emacs/mule.texi (Bidirectional Editing): Correct some inaccuracies. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-10-08 16:37:46 +0000 +++ doc/emacs/ChangeLog 2011-10-08 17:29:45 +0000 @@ -1,3 +1,7 @@ +2011-10-08 Eli Zaretskii + + * mule.texi (Bidirectional Editing): Correct some inaccuracies. + 2011-10-08 Chong Yidong * basic.texi (Position Info): Omit page commands. Document === modified file 'doc/emacs/mule.texi' --- doc/emacs/mule.texi 2011-07-28 17:18:25 +0000 +++ doc/emacs/mule.texi 2011-10-08 17:29:45 +0000 @@ -1707,10 +1707,9 @@ Each paragraph of bidirectional text can have its own @dfn{base direction}, either right-to-left or left-to-right. (Paragraph -boundaries are defined by the regular expressions -@code{paragraph-start} and @code{paragraph-separate}, see -@ref{Paragraphs}.) Text in left-to-right paragraphs begins at the -left margin of the window and is truncated or continued when it +boundaries are empty lines, i.e.@: lines consisting entirely of +whitespace characters.) Text in left-to-right paragraphs begins at +the left margin of the window and is truncated or continued when it reaches the right margin. By contrast, text in right-to-left paragraphs begins at the right margin and is continued or truncated at the left margin. @@ -1734,8 +1733,8 @@ the right-to-left direction on the following paragraph, while @code{LEFT-TO-RIGHT MARK}, or @sc{lrm} forces the left-to-right direction. (You can use @kbd{C-x 8 RET} to insert these characters.) -In a GUI session, the @sc{lrm} and @sc{rlm} characters display as -blanks. +In a GUI session, the @sc{lrm} and @sc{rlm} characters display as very +thin blank characters; on text terminals they display as blanks. Because characters are reordered for display, Emacs commands that operate in the logical order or on stretches of buffer positions may ------------------------------------------------------------ revno: 106028 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-10-08 12:37:46 -0400 message: Rework count-words-region. New command count-words. See discussion at http://lists.gnu.org/archive/html/emacs-devel/2011-10/msg00193.html * lisp/simple.el (count-words-region): Always count in the region. Report the number of lines and characters too. (count-words): New command, which counts in the buffer if the region is inactive, as count-words-region used to. (count-words--message): New function. Handle plurals. (count-lines-region): Make it an alias for count-words-region. * lisp/bindings.el (esc-map): Replace count-lines-region with count-words-region. * doc/emacs/basic.texi (Position Info): Omit page commands. Document count-words-region and count-words. * doc/emacs/text.texi (Pages): Move what-page documentation here. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-10-08 15:08:50 +0000 +++ doc/emacs/ChangeLog 2011-10-08 16:37:46 +0000 @@ -1,5 +1,12 @@ 2011-10-08 Chong Yidong + * basic.texi (Position Info): Omit page commands. Document + count-words-region and count-words. + + * text.texi (Pages): Move what-page documentation here. + +2011-10-08 Chong Yidong + * mini.texi (Minibuffer File): Minor copyedits. Use xref to Remote Files node instead of linking directly to the Tramp manual. (Minibuffer Edit): Add xref to Blank Lines. === modified file 'doc/emacs/basic.texi' --- doc/emacs/basic.texi 2011-10-07 16:22:04 +0000 +++ doc/emacs/basic.texi 2011-10-08 16:37:46 +0000 @@ -23,7 +23,7 @@ * Help: Basic Help. Asking what a character does. * Blank Lines:: Making and deleting blank lines. * Continuation Lines:: How Emacs displays lines too wide for the screen. -* Position Info:: What page, line, row, or column is point on? +* Position Info:: What line, row, or column is point on? * Arguments:: Numeric arguments for repeating a command N times. * Repeating:: Repeating the previous command quickly. @end menu @@ -569,28 +569,26 @@ @section Cursor Position Information Here are commands to get information about the size and position of -parts of the buffer, and to count lines. +parts of the buffer, and to count words and lines. @table @kbd -@item M-x what-page -Display the page number of point, and the line number within that page. @item M-x what-line -Display the line number of point in the whole buffer. +Display the line number of point. @item M-x line-number-mode @itemx M-x column-number-mode Toggle automatic display of the current line number or column number. @xref{Optional Mode Line}. @item M-= -Display the number of lines in the region (@code{count-lines-region}). -@xref{Mark}, for information about the region. - -@item C-x l -Display the number of lines in the current page -(@code{count-lines-page}). @xref{Pages}. - -@item M-x count-words-region -Display the number of words in the region. +Display the number of lines, words, and characters that are present in +the region (@code{count-words-region}). @xref{Mark}, for information +about the region. + +@item M-x count-words +Display the number of lines, words, and characters that are present in +the buffer. If the region is active (@pxref{Mark}), display the +numbers for the region instead. + @item C-x = Display the character code of character after point, character position of point, and column of point (@code{what-cursor-position}). @@ -602,7 +600,6 @@ @xref{Optional Mode Line}. @end table -@findex what-page @findex what-line @cindex line number commands @cindex location of point @@ -616,16 +613,14 @@ @code{what-line} displays both the line number relative to the narrowed region and the line number relative to the whole buffer. - @kbd{M-x what-page} counts pages from the beginning of the file, and -counts lines within the page, showing both numbers in the echo area. -@xref{Pages}. - @kindex M-= -@findex count-lines-region - @kbd{M-=} (@code{count-lines-region}) displays the number of lines -in the region (@pxref{Mark}), while @kbd{C-x l} -(@code{count-lines-page}) counts the lines in the current page -(@pxref{Pages}). +@findex count-words-region +@findex count-words + @kbd{M-=} (@code{count-words-region}) displays a message reporting +the number of lines, words, and characters in the region. @kbd{M-x +count-words} displays a similar message for the entire buffer, or for +the region if the region is @dfn{active}. @xref{Mark}, for an +explanation of the region. @kindex C-x = @findex what-cursor-position === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2011-10-08 15:08:50 +0000 +++ doc/emacs/emacs.texi 2011-10-08 16:37:46 +0000 @@ -264,7 +264,7 @@ * Basic Help:: Asking what a character does. * Blank Lines:: Making and deleting blank lines. * Continuation Lines:: How Emacs displays lines too wide for the screen. -* Position Info:: What page, line, row, or column is point on? +* Position Info:: What line, row, or column is point on? * Arguments:: Numeric arguments for repeating a command N times. * Repeating:: Repeating the previous command quickly. === modified file 'doc/emacs/text.texi' --- doc/emacs/text.texi 2011-08-25 16:13:59 +0000 +++ doc/emacs/text.texi 2011-10-08 16:37:46 +0000 @@ -332,6 +332,8 @@ commands to move over them and operate on them. @table @kbd +@item M-x what-page +Display the page number of point, and the line number within that page. @item C-x [ Move point to previous page boundary (@code{backward-page}). @item C-x ] @@ -342,6 +344,10 @@ Count the lines in this page (@code{count-lines-page}). @end table +@findex what-page + @kbd{M-x what-page} counts pages from the beginning of the file, and +counts lines within the page, showing both numbers in the echo area. + @kindex C-x [ @kindex C-x ] @findex forward-page === modified file 'etc/NEWS' --- etc/NEWS 2011-10-08 15:08:50 +0000 +++ etc/NEWS 2011-10-08 16:37:46 +0000 @@ -455,7 +455,10 @@ *** M-s C-e in Isearch is now bound to isearch-yank-line. +++ -** New command `count-words-region'. This does what you expect. +** New commands `count-words-region' and `count-words'. + +*** `count-lines-region' is now an alias for `count-words-region', +bound to M-=, which shows the number of lines, words, and characters. ** The default value of `backup-by-copying-when-mismatch' is now t. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-08 14:01:55 +0000 +++ lisp/ChangeLog 2011-10-08 16:37:46 +0000 @@ -1,3 +1,15 @@ +2011-10-08 Chong Yidong + + * simple.el (count-words-region): Always count in the region. + Report the number of lines and characters too. + (count-words): New command, which counts in the buffer if the + region is inactive, as count-words-region used to. + (count-words--message): New function. Handle plurals. + (count-lines-region): Make it an alias for count-words-region. + + * bindings.el (esc-map): Replace count-lines-region with + count-words-region. + 2011-10-08 Martin Rudalics * window.el (window--delete): Delete dedicated frame === modified file 'lisp/bindings.el' --- lisp/bindings.el 2011-10-07 16:05:10 +0000 +++ lisp/bindings.el 2011-10-08 16:37:46 +0000 @@ -773,7 +773,7 @@ (define-key ctl-x-map "\C-o" 'delete-blank-lines) (define-key esc-map " " 'just-one-space) (define-key esc-map "z" 'zap-to-char) -(define-key esc-map "=" 'count-lines-region) +(define-key esc-map "=" 'count-words-region) (define-key ctl-x-map "=" 'what-cursor-position) (define-key esc-map ":" 'eval-expression) ;; Define ESC ESC : like ESC : for people who type ESC ESC out of habit. === modified file 'lisp/simple.el' --- lisp/simple.el 2011-10-01 20:32:01 +0000 +++ lisp/simple.el 2011-10-08 16:37:46 +0000 @@ -945,28 +945,46 @@ (forward-line (1- line))))) (defun count-words-region (start end) - "Count the number of words in the active region. -If the region is not active, counts the number of words in the buffer." - (interactive (if (use-region-p) (list (region-beginning) (region-end)) - (list (point-min) (point-max)))) - (let ((count 0)) + "Return the number of words between START and END. +If called interactively, print a message reporting the number of +lines, words, and characters in the region." + (interactive "r") + (let ((words 0)) (save-excursion (save-restriction (narrow-to-region start end) (goto-char (point-min)) (while (forward-word 1) - (setq count (1+ count))))) + (setq words (1+ words))))) (when (called-interactively-p 'interactive) - (message "%s has %d words" - (if (use-region-p) "Region" "Buffer") - count)) - count)) - -(defun count-lines-region (start end) - "Print number of lines and characters in the region." - (interactive "r") - (message "Region has %d lines, %d characters" - (count-lines start end) (- end start))) + (count-words--message "Region" + (count-lines start end) + words + (- end start))) + words)) + +(defun count-words () + "Display the number of lines, words, and characters in the buffer. +In Transient Mark mode when the mark is active, display the +number of lines, words, and characters in the region." + (interactive) + (if (use-region-p) + (call-interactively 'count-words-region) + (let* ((beg (point-min)) + (end (point-max)) + (lines (count-lines beg end)) + (words (count-words-region beg end)) + (chars (- end beg))) + (count-words--message "Buffer" lines words chars)))) + +(defun count-words--message (str lines words chars) + (message "%s has %d line%s, %d word%s, and %d character%s." + str + lines (if (= lines 1) "" "s") + words (if (= words 1) "" "s") + chars (if (= chars 1) "" "s"))) + +(defalias 'count-lines-region 'count-words-region) (defun what-line () "Print the current buffer line number and narrowed line number of point." ------------------------------------------------------------ revno: 106027 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-10-08 11:08:50 -0400 message: Document completion styles in Emacs manual; copyedits. * doc/emacs/mini.texi (Minibuffer File): Minor copyedits. Use xref to Remote Files node instead of linking directly to the Tramp manual. (Minibuffer Edit): Add xref to Blank Lines. (Completion): Add xref to Symbol Completion. Remove redundant example, which is repeated in the next node. (Completion Commands): Minor clarifications. (Completion Styles): New node, split from Completion Commands. Document substring and initials styles. (Strict Completion): Remove information duplicated in other nodes. (Completion Options): Consolidate case difference discussion here. * doc/emacs/files.texi (File Names): Add index entries. * doc/emacs/help.texi (Help Mode): Fix kindex entries. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-10-07 16:22:04 +0000 +++ doc/emacs/ChangeLog 2011-10-08 15:08:50 +0000 @@ -1,3 +1,20 @@ +2011-10-08 Chong Yidong + + * mini.texi (Minibuffer File): Minor copyedits. Use xref to + Remote Files node instead of linking directly to the Tramp manual. + (Minibuffer Edit): Add xref to Blank Lines. + (Completion): Add xref to Symbol Completion. Remove redundant + example, which is repeated in the next node. + (Completion Commands): Minor clarifications. + (Completion Styles): New node, split from Completion Commands. + Document substring and initials styles. + (Strict Completion): Remove information duplicated in other nodes. + (Completion Options): Consolidate case difference discussion here. + + * help.texi (Help Mode): Fix kindex entries. + + * files.texi (File Names): Add index entries. + 2011-10-07 Chong Yidong * basic.texi (Inserting Text): Add xref to Completion. Add === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2011-09-24 18:19:20 +0000 +++ doc/emacs/emacs.texi 2011-10-08 15:08:50 +0000 @@ -282,6 +282,7 @@ * Completion Example:: Examples of using completion. * Completion Commands:: A list of completion commands. * Strict Completion:: Different types of completion. +* Completion Styles:: How completion matches are chosen. * Completion Options:: Options for completion. Help === modified file 'doc/emacs/files.texi' --- doc/emacs/files.texi 2011-08-28 21:15:20 +0000 +++ doc/emacs/files.texi 2011-10-08 15:08:50 +0000 @@ -54,11 +54,13 @@ appear in the variable @code{completion-ignored-extensions} (@pxref{Completion Options}). +@cindex default file name For most operations, there is a @dfn{default file name} which is used if you type just @key{RET} to enter an empty argument. Normally, the default file name is the name of the file visited in the current buffer. +@cindex default directory @vindex default-directory @vindex insert-default-directory Each buffer has a @dfn{default directory} which is normally the same @@ -1863,7 +1865,7 @@ @cindex file name caching @cindex cache of file names @pindex find -@kindex C-@key{TAB} +@kindex C-TAB @findex file-cache-minibuffer-complete You can use the @dfn{file name cache} to make it easy to locate a file by name, without having to remember exactly where it is located. === modified file 'doc/emacs/help.texi' --- doc/emacs/help.texi 2011-08-28 21:15:20 +0000 +++ doc/emacs/help.texi 2011-10-08 15:08:50 +0000 @@ -443,9 +443,9 @@ the @code{browse-url} command to view the page in the browser you choose. @xref{Browse-URL}. -@kindex @key{TAB} @r{(Help mode)} +@kindex TAB @r{(Help mode)} @findex help-next-ref -@kindex S-@key{TAB} @r{(Help mode)} +@kindex S-TAB @r{(Help mode)} @findex help-previous-ref There are convenient commands to move point to cross references in the help text. @key{TAB} (@code{help-next-ref}) moves point down to === modified file 'doc/emacs/mini.texi' --- doc/emacs/mini.texi 2011-08-04 00:58:07 +0000 +++ doc/emacs/mini.texi 2011-10-08 15:08:50 +0000 @@ -15,9 +15,9 @@ @cindex prompt When the minibuffer is in use, it appears in the echo area, with a -cursor. The minibuffer display starts with a @dfn{prompt} in a -distinct color, usually ending with a colon. The prompt states what -kind of input is expected, and how it will be used. +cursor. The minibuffer starts with a @dfn{prompt} in a distinct +color, usually ending with a colon. The prompt states what kind of +input is expected, and how it will be used. The simplest way to enter a minibuffer argument is to type the text, then @key{RET} to submit the argument and exit the minibuffer. You @@ -26,19 +26,17 @@ @cindex default argument Sometimes, a @dfn{default argument} appears in the prompt, inside -parentheses before the colon. The default will be used as the -argument value if you just type @key{RET}. For example, commands that -read buffer names usually show a buffer name as the default; you can -type @key{RET} to operate on that default buffer. +parentheses before the colon. This default will be used as the +argument if you just type @key{RET}. For example, commands that read +buffer names usually show a buffer name as the default; you can type +@key{RET} to operate on that default buffer. Since the minibuffer appears in the echo area, it can conflict with -other uses of the echo area. If an error occurs while the minibuffer -is active, the error message hides the minibuffer for a few seconds, -or until you type something; then the minibuffer comes back. If a -command such as @kbd{C-x =} needs to display a message in the echo -area, the message hides the minibuffer for a few seconds, or until you -type something; then the minibuffer comes back. While the minibuffer -is in use, keystrokes do not echo. +other uses of the echo area. If an error message or an informative +message is emitted while the minibuffer is active, the message hides +the minibuffer for a few seconds, or until you type something; then +the minibuffer comes back. While the minibuffer is in use, keystrokes +do not echo. @menu * Minibuffer File:: Entering file names with the minibuffer. @@ -52,6 +50,7 @@ @node Minibuffer File @section Minibuffers for File Names +@cindex default directory Commands such as @kbd{C-x C-f} (@code{find-file}) use the minibuffer to read a file name argument (@pxref{Basic Files}). When the minibuffer is used to read a file name, it typically starts out with @@ -92,7 +91,7 @@ second slash in the pair.'' In the example above, @file{/u2/emacs/src/} is ignored, so the argument you supplied is @file{/etc/termcap}. The ignored part of the file name is dimmed if -the terminal allows it (to disable this dimming, turn off File Name +the terminal allows it. (To disable this dimming, turn off File Name Shadow mode with the command @kbd{M-x file-name-shadow-mode}.) @cindex home directory shorthand @@ -108,11 +107,11 @@ home directory, Emacs uses several alternatives. For MS-Windows, see @ref{Windows HOME}; for MS-DOS, see @ifnottex -@ref{MS-DOS File Names, HOME on MS-DOS}. +@ref{MS-DOS File Names}. @end ifnottex @iftex -@ref{MS-DOS File Names, HOME on MS-DOS,, emacs, the Emacs Manual}, in -the main Emacs manual. +@ref{MS-DOS File Names, HOME on MS-DOS,, emacs, the digital version of +the Emacs Manual}. @end iftex On these systems, the @file{~@var{user-id}/} construct is supported only for the current user, i.e., only if @var{user-id} is the current @@ -125,9 +124,8 @@ Nonetheless, relative file name arguments are still interpreted based on the same default directory. - For rules how to read remote file names in the minibuffer, see -@ref{Filename completion, file name completion,, tramp}, in the Tramp -manual. + You can also enter remote file names in the minibuffer. +@xref{Remote Files}. @node Minibuffer Edit @section Editing in the Minibuffer @@ -136,17 +134,17 @@ usual Emacs commands are available for editing the argument text. (The prompt, however, is @dfn{read-only}, and cannot be changed.) - Since @key{RET} in the minibuffer is defined to exit the minibuffer, -you can't use it to insert a newline in the minibuffer. To do that, -type @kbd{C-o} or @kbd{C-q C-j}. (The newline character is really the -@acronym{ASCII} character control-J.) + Since @key{RET} in the minibuffer submits the argument, you can't +use it to insert a newline. You can do that with @kbd{C-q C-j}, which +inserts a @kbd{C-j} control character, which is formally equivalent to +a newline character (@pxref{Inserting Text}). Alternatively, you can +use the @kbd{C-o} (@code{open-line}) command (@pxref{Blank Lines}). - Inside a minibuffer, the keys @kbd{@key{TAB}}, @kbd{@key{SPC}}, and -@kbd{@key{?}} are often bound to commands that perform -@dfn{completion}. @xref{Completion}. You can use @kbd{C-q} -(@code{quoted-insert}) to insert a @key{TAB}, @key{SPC}, or @key{?} -character. For example, @kbd{C-q @key{TAB}} inserts a @key{TAB} -character. @xref{Inserting Text}. + Inside a minibuffer, the keys @key{TAB}, @key{SPC}, and @kbd{?} are +often bound to @dfn{completion commands}, which allow you to easily +fill in the desired text without typing all of it. @xref{Completion}. +As with @key{RET}, you can use @kbd{C-q} to insert a @key{TAB}, +@key{SPC}, or @samp{?} character. For convenience, @kbd{C-a} (@code{move-beginning-of-line}) in a minibuffer moves point to the beginning of the argument text, not the @@ -203,35 +201,28 @@ @c it, the tutorial needs to be adjusted. @cindex completion - Sometimes, you can use a feature called @dfn{completion} to help you -enter arguments. This means that after you type part of the argument, -Emacs can fill in the rest, or some of it, based on what you have -typed so far. + You can often use a feature called @dfn{completion} to help enter +arguments. This means that after you type part of the argument, Emacs +can fill in the rest, or some of it, based on what was typed so far. +@cindex completion alternative When completion is available, certain keys (usually @key{TAB}, -@key{RET}, and @key{SPC}) are rebound to complete the text in the -minibuffer into a longer string chosen from a set of @dfn{completion -alternatives}. The set of completion alternatives depends on the -command that requested the argument, and on what you have typed so -far. In addition, you can usually type @kbd{?} to display a list of -possible completions. - - For example, @kbd{M-x} uses the minibuffer to read the name of a -command, so completion works by matching the minibuffer text against -the names of existing Emacs commands. So, to run the command -@code{insert-buffer}, you can type @kbd{M-x ins @key{SPC} b @key{RET}} -instead of the full @kbd{M-x insert-buffer @key{RET}}. - - Case is significant in completion when it is significant in the -argument you are entering, such as command names. Thus, -@samp{insert-buffer} is not a valid completion for @samp{IN}. -Completion ignores case distinctions for certain arguments in which -case does not matter. +@key{RET}, and @key{SPC}) are rebound in the minibuffer to special +completion commands (@pxref{Completion Commands}). These commands +attempt to complete the text in the minibuffer, based on a set of +@dfn{completion alternatives} provided by the command that requested +the argument. You can usually type @kbd{?} to see a list of +completion alternatives. + + Although completion is usually done in the minibuffer, the feature +is sometimes available in ordinary buffers too. @xref{Symbol +Completion}. @menu * Example: Completion Example. Examples of using completion. * Commands: Completion Commands. A list of completion commands. * Strict Completion:: Different types of completion. +* Completion Styles:: How completion matches are chosen. * Options: Completion Options. Options for completion. @end menu @@ -239,24 +230,31 @@ @subsection Completion Example @kindex TAB @r{(completion)} - A concrete example may help here. If you type @kbd{M-x a u -@key{TAB}}, the @key{TAB} looks for alternatives (in this case, -command names) that start with @samp{au}. There are several, -including @code{auto-fill-mode} and @code{autoconf-mode}, but they all -begin with @code{auto}, so the @samp{au} in the minibuffer completes -to @samp{auto}. + A simple example may help here. @kbd{M-x} uses the minibuffer to +read the name of a command, so completion works by matching the +minibuffer text against the names of existing Emacs commands. Suppose +you wish to run the command @code{auto-fill-mode}. You can do that by +typing @kbd{M-x auto-fill-mode @key{RET}}, but it is easier to use +completion. + + If you type @kbd{M-x a u @key{TAB}}, the @key{TAB} looks for +completion alternatives (in this case, command names) that start with +@samp{au}. There are several, including @code{auto-fill-mode} and +@code{autoconf-mode}, but they all begin with @code{auto}, so the +@samp{au} in the minibuffer completes to @samp{auto}. If you type @key{TAB} again immediately, it cannot determine the next character; it could be @samp{-}, @samp{a}, or @samp{c}. So it does not add any characters; instead, @key{TAB} displays a list of all possible completions in another window. - Next, type @kbd{- f}. The minibuffer now contains @samp{auto-f}, -and the only command name that starts with this is -@code{auto-fill-mode}. If you now type @key{TAB}, completion fills in -the rest of the argument @samp{auto-fill-mode} into the minibuffer. -You have been able to enter @samp{auto-fill-mode} by typing just -@kbd{a u @key{TAB} - f @key{TAB}}. + Next, type @kbd{-f}. The minibuffer now contains @samp{auto-f}, and +the only command name that starts with this is @code{auto-fill-mode}. +If you now type @key{TAB}, completion fills in the rest of the +argument @samp{auto-fill-mode} into the minibuffer. + + Hence, typing just @kbd{a u @key{TAB} - f @key{TAB}} allows you to +enter @samp{auto-fill-mode}. @node Completion Commands @subsection Completion Commands @@ -272,60 +270,24 @@ (@code{minibuffer-complete}). @item @key{SPC} Complete up to one word from the minibuffer text before point -(@code{minibuffer-complete-word}). @key{SPC} for completion is not -available when entering a file name, since file names often include -spaces. +(@code{minibuffer-complete-word}). This command is not available for +arguments that often include spaces, such as file names. @item @key{RET} Submit the text in the minibuffer as the argument, possibly completing -first as described in the next -@iftex -subsection (@code{minibuffer-complete-and-exit}). -@end iftex -@ifnottex -node (@code{minibuffer-complete-and-exit}). @xref{Strict Completion}. -@end ifnottex +first (@code{minibuffer-complete-and-exit}). @xref{Strict Completion}. @item ? -Display a list of possible completions of the text before point -(@code{minibuffer-completion-help}). +Display a list of completions (@code{minibuffer-completion-help}). @end table -@kindex TAB +@kindex TAB @r{(completion)} @findex minibuffer-complete @key{TAB} (@code{minibuffer-complete}) is the most fundamental -completion command. It searches for all possible completion -alternatives that match the existing minibuffer text, and attempts to -complete as much as it can. The matching of completion alternatives -to the minibuffer text is performed according to somewhat intricate -rules, which are designed so that plausible completions are offered -under most circumstances. A valid completion alternative must satisfy -the following criteria: - -@itemize @bullet -@item -The minibuffer text before point must be the same as the beginning of -the completion alternative. If there is any minibuffer text after -point, it must be a substring of the remainder of the completion -alternative. - -@item -If no completion alternative satisfies the above rules, try using -@dfn{partial completion} rules: divide the minibuffer text into words -separated by hyphens or spaces, and complete each word separately. -Thus, when completing command names, @samp{em-l-m} completes to -@samp{emacs-lisp-mode}. - -@item -If there is still no completion alternative, try the first rule again, -but ignore the minibuffer text after point (i.e., don't try matching -it). -@end itemize - -@noindent -When performing these comparisons, a @samp{*} in the minibuffer text -acts as a @dfn{wildcard}---it matches any character at the -corresponding position in the completion alternative. - -@kindex SPC +completion command. It searches for all possible completions that +match the existing minibuffer text, and attempts to complete as much +as it can. @xref{Completion Styles}, for how completion alternatives +are chosen. + +@kindex SPC @r{(completion)} @findex minibuffer-complete-word @key{SPC} (@code{minibuffer-complete-word}) completes like @key{TAB}, but only up to the next hyphen or space. If you have @@ -334,50 +296,52 @@ giving @samp{auto-fill-}. Another @key{SPC} at this point completes all the way to @samp{auto-fill-mode}. +@kindex ? @r{(completion)} +@cindex completion list If @key{TAB} or @key{SPC} is unable to complete, it displays a list -of possible completions (if there are any) in a separate window. You -can choose a completion from this list using the following commands: +of matching completion alternatives (if there are any) in another +window. You can display the same list with @kbd{?} +(@code{minibuffer-completion-help}). The following commands can be +used with the completion list: @table @kbd @findex mouse-choose-completion @item Mouse-1 @itemx Mouse-2 -Clicking mouse button 1 or 2 on a completion possibility chooses that -completion (@code{mouse-choose-completion}). +Clicking mouse button 1 or 2 on a completion alternative chooses it +(@code{mouse-choose-completion}). @findex switch-to-completions @item M-v @itemx @key{PageUp} @itemx @key{prior} Typing @kbd{M-v}, while in the minibuffer, selects the window showing -the completion list buffer (@code{switch-to-completions}). This paves -the way for using the commands below. Typing @key{PageUp} or -@key{prior} does the same, as does selecting that window in other -ways. +the completion list (@code{switch-to-completions}). This paves the +way for using the commands below. @key{PageUp} or @key{prior} does +the same. You can also select the window in other ways +(@pxref{Windows}). @findex choose-completion @item @key{RET} -Typing @key{RET}, while in the completion list buffer, chooses the -completion that point is in or next to (@code{choose-completion}). To -use this command, you must first switch to the completion list window. +While in the completion list buffer, this chooses the completion at +point (@code{choose-completion}). @findex next-completion @item @key{Right} -Typing the right-arrow key @key{Right}, while in the completion list -buffer, moves point to the following completion possibility -(@code{next-completion}). +While in the completion list buffer, this moves point to the following +completion alternative (@code{next-completion}). @findex previous-completion @item @key{Left} -Typing the left-arrow key @key{Left}, while in the completion list -buffer, moves point to the previous completion possibility -(@code{previous-completion}). +While in the completion list buffer, this moves point to the previous +completion alternative (@code{previous-completion}). @end table @node Strict Completion @subsection Strict Completion - There are three different ways that @key{RET} can do completion, + There are three ways that the @key{RET} +(@code{minibuffer-complete-and-exit}) completion command can act, depending on how the argument will be used. @itemize @bullet @@ -406,14 +370,117 @@ as you have entered it. @end itemize - The completion commands display a list of all possible completions -whenever they can't determine even one more character by completion. -Also, typing @kbd{?} explicitly requests such a list. You can scroll -the list with @kbd{C-M-v} (@pxref{Other Window}). + Like the other completion commands, @key{RET} displays a list of all +possible completions whenever it is supposed to complete but is unable +to complete any further. + +@node Completion Styles +@subsection How Completion Alternatives Are Chosen +@cindex completion style + + Completion commands work by narrowing a large list of possible +completion alternatives to a smaller subset that ``matches'' what you +have typed in the minibuffer. In @ref{Completion Example}, we gave a +simple example of such matching. The procedure of determining what +constitutes a ``match'' is quite intricate. Emacs attempts to offer +plausible completions under most circumstances. + + Emacs performs completion using one or more @dfn{completion +styles}---sets of criteria for matching minibuffer text to completion +alternatives. During completion, Emacs tries each completion style in +turn. If a style yields one or more matches, that is used as the list +of completion alternatives. If a style produces no matches, Emacs +falls back on the next style. + +@vindex completion-styles + The list variable @code{completion-styles} specifies the completion +styles to use. Each list element is the name of a completion style (a +Lisp symbol). The default completion styles are (in order): + +@table @code +@item basic +A matching completion alternative must have the same beginning as the +text in the minibuffer before point. Furthermore, if there is any +text in the minibuffer after point, the rest of the completion +alternative must contain that text as a substring. + +@findex partial completion +@item partial-completion +This aggressive completion style divides the minibuffer text into +words separated by hyphens or spaces, and completes each word +separately. (For example, when completing command names, +@samp{em-l-m} completes to @samp{emacs-lisp-mode}.) + +Furthermore, a @samp{*} in the minibuffer text is treated as a +@dfn{wildcard}---it matches any character at the corresponding +position in the completion alternative. + +@item emacs22 +This completion style is similar to @code{basic}, except that it +ignores the text in the minibuffer after point. It is so-named +because it corresponds to the completion behavior in Emacs 22 and +earlier. +@end table + +@noindent +The following additional completion styles are also defined, and you +can add them to @code{completion-styles} if you wish +(@pxref{Customization}): + +@table @code +@item substring +A matching completion alternative must contain the text in the +minibuffer before point, and the text in the minibuffer after point, +as substrings (in that same order). + +Thus, if the text in the minibuffer is @samp{foobar}, with point +between @samp{foo} and @samp{bar}, that matches +@samp{@var{a}foo@var{b}bar@var{c}}, where @var{a}, @var{b}, and +@var{c} can be any string including the empty string. + +@item initials +This very aggressive completion style attempts to complete acronyms +and initialisms. For example, when completing command names, it +matches @samp{lch} to @samp{list-command-history}. +@end table @node Completion Options @subsection Completion Options +@cindex case-sensitivity and completion +@cindex case in completion + Case is significant when completing case-sensitive arguments, such +as command names. For example, when completing command names, +@samp{AU} does not complete to @samp{auto-fill-mode}. Case +differences are ignored when completing arguments in which case does +not matter. + +@vindex read-file-name-completion-ignore-case +@vindex read-buffer-completion-ignore-case + When completing file names, case differences are ignored if the +variable @code{read-file-name-completion-ignore-case} is +non-@code{nil}. The default value is @code{nil} on systems that have +case-sensitive file-names, such as GNU/Linux; it is non-@code{nil} on +systems that have case-insensitive file-names, such as Microsoft +Windows. When completing buffer names, case is significant by +default; to ignore case differences, change the variable +@code{read-buffer-completion-ignore-case} to a non-@code{nil} value. + +@vindex completion-ignored-extensions +@cindex ignored file names, in completion + When completing file names, Emacs usually omits certain alternatives +that are considered unlikely to be chosen. The variable +@code{completion-ignored-extensions} contains a list of strings; a +file name ending in any of those strings is ignored as a completion +alternative. The standard value of this variable has several elements +including @code{".o"}, @code{".elc"}, and @code{"~"}. For example, if +a directory contains @samp{foo.c} and @samp{foo.elc}, @samp{foo} +completes to @samp{foo.c}. However, if @emph{all} possible +completions end in ``ignored'' strings, they are not ignored: in the +previous example, @samp{foo.e} completes to @samp{foo.elc}. +Displaying the completion list disregards +@code{completion-ignored-extensions}; all completions are listed. + @vindex completion-auto-help If @code{completion-auto-help} is set to @code{nil}, the completion commands never display the completion list buffer; you must type @@ -423,51 +490,12 @@ echoes @samp{Next char not unique}; the second @key{TAB} does the completion list buffer. -@vindex completion-ignored-extensions -@cindex ignored file names, in completion - When completing file names, certain file names are usually ignored. -The variable @code{completion-ignored-extensions} contains a list of -strings; a file name ending in any of those strings is ignored as a -completion candidate. The standard value of this variable has several -elements including @code{".o"}, @code{".elc"}, and @code{"~"}. For -example, if a directory contains @samp{foo.c} and @samp{foo.elc}, -@samp{foo} completes to @samp{foo.c}. However, if @emph{all} possible -completions end in ``ignored'' strings, they are not ignored: in the -previous example, @samp{foo.e} completes to @samp{foo.elc}. -Displaying a list of possible completions disregards -@code{completion-ignored-extensions}; it shows them all. - If an element of @code{completion-ignored-extensions} ends in a slash (@file{/}), it's a subdirectory name; that directory and its contents are ignored. Elements of @code{completion-ignored-extensions} that do not end in a slash are ordinary file names. -@cindex case-sensitivity and completion -@vindex read-file-name-completion-ignore-case -@vindex read-buffer-completion-ignore-case - When completing file names, Emacs ignores case differences if the -variable @code{read-file-name-completion-ignore-case} is -non-@code{nil}. The default value is @code{nil} on systems that have -case-sensitive file-names, such as GNU/Linux; it is non-@code{nil} on -systems that have case-insensitive file-names, such as Microsoft -Windows. When completing buffer names, Emacs ignores case differences -if @code{read-buffer-completion-ignore-case} is non-@code{nil} (the -default value is @code{nil}). - -@vindex completion-styles - You can customize the matching rules for completion alternatives -using the variable @code{completion-styles}. Its value should be a -list of symbols, each representing a @dfn{completion style}; valid -style symbols are @code{basic}, @code{partial-completion}, -@code{emacs22}, @code{emacs21}, and @code{initials}. When completing, -Emacs attempts to use the first completion style in the list; if this -does not return any completion alternatives, it tries the next -completion style in the list, and so on. The completion rules -described in @ref{Completion Commands} correspond to the default value -of @code{completion-styles}, which is @code{(basic partial-completion -emacs22)}. - @cindex Icomplete mode @findex icomplete-mode Icomplete mode presents a constantly-updated display that tells you === modified file 'etc/NEWS' --- etc/NEWS 2011-10-07 16:22:04 +0000 +++ etc/NEWS 2011-10-08 15:08:50 +0000 @@ -100,12 +100,12 @@ rather than their own completion code. *** `completion-at-point' now handles tags and semantic completion. - +--- *** Completion in a non-minibuffer now tries to detect the end of completion and pops down the *Completions* buffer accordingly. *** Completion can cycle, depending on completion-cycle-threshold. - ++++ *** New completion style `substring'. *** Completion style can be set per-category `completion-category-overrides'. ------------------------------------------------------------ revno: 106026 committer: martin rudalics branch nick: trunk timestamp: Sat 2011-10-08 16:01:55 +0200 message: Fix doc-string typo in switch-to-buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-08 13:52:16 +0000 +++ lisp/ChangeLog 2011-10-08 14:01:55 +0000 @@ -2,6 +2,7 @@ * window.el (window--delete): Delete dedicated frame unconditionally when argument KILL is non-nil. (Bug#9699) + (switch-to-buffer): Fix doc-string typo. 2011-10-08 Thierry Volpiatto === modified file 'lisp/window.el' --- lisp/window.el 2011-10-08 13:52:16 +0000 +++ lisp/window.el 2011-10-08 14:01:55 +0000 @@ -4977,7 +4977,7 @@ If FORCE-SAME-WINDOW is non-nil, BUFFER-OR-NAME must be displayed in the selected window; signal an error if that is impossible (e.g. if the selected window is minibuffer-only). If -non-nil, BUFFER-OR-NAME may be displayed in another window. +nil, BUFFER-OR-NAME may be displayed in another window. Return the buffer switched to." (interactive ------------------------------------------------------------ revno: 106025 committer: martin rudalics branch nick: trunk timestamp: Sat 2011-10-08 15:52:16 +0200 message: Delete dedicated frame when killing its buffer. (Bug#9699) * window.el (window--delete): Delete dedicated frame unconditionally when argument KILL is non-nil. (Bug#9699) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-08 06:08:00 +0000 +++ lisp/ChangeLog 2011-10-08 13:52:16 +0000 @@ -1,3 +1,8 @@ +2011-10-08 Martin Rudalics + + * window.el (window--delete): Delete dedicated frame + unconditionally when argument KILL is non-nil. (Bug#9699) + 2011-10-08 Thierry Volpiatto * lisp/eshell/eshell.el (eshell-command): Avoid using hooks. === modified file 'lisp/window.el' --- lisp/window.el 2011-10-05 08:59:13 +0000 +++ lisp/window.el 2011-10-08 13:52:16 +0000 @@ -2780,7 +2780,7 @@ Optional argument DEDICATED-ONLY non-nil means to delete WINDOW only if it's dedicated to its buffer. Optional argument KILL means the buffer shown in window will be killed. Return non-nil -if WINDOW gets deleted." +if WINDOW gets deleted or its frame is auto-hidden." (setq window (window-normalize-live-window window)) (unless (and dedicated-only (not (window-dedicated-p window))) (let* ((buffer (window-buffer window)) @@ -2788,8 +2788,11 @@ (cond ((eq deletable 'frame) (let ((frame (window-frame window))) - (when (functionp frame-auto-hide-function) - (funcall frame-auto-hide-function frame))) + (cond + (kill + (delete-frame frame)) + ((functionp frame-auto-hide-function) + (funcall frame-auto-hide-function frame)))) 'frame) (deletable (delete-window window) ------------------------------------------------------------ revno: 106024 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-10-08 15:03:43 +0200 message: Fix cursor positioning in hscrolled lines with R2L characters. src/xdisp.c (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L lines that are hscrolled on the left. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-10-08 12:15:08 +0000 +++ src/ChangeLog 2011-10-08 13:03:43 +0000 @@ -2,6 +2,8 @@ * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left lines. + (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L + lines that are hscrolled on the left. * dispnew.c (buffer_posn_from_coords): Account for a possible presence of header-line. (Bug#4426) === modified file 'src/xdisp.c' --- src/xdisp.c 2011-10-08 12:15:08 +0000 +++ src/xdisp.c 2011-10-08 13:03:43 +0000 @@ -13890,7 +13890,11 @@ ? glyph_after > glyphs_end : glyph_after < glyphs_end))))) { - cursor = glyph_after; + if (!match_with_avoid_cursor + && row->truncated_on_left_p && pt_old < bpos_min) + cursor = glyph_before; + else + cursor = glyph_after; x = -1; } else if (string_seen) ------------------------------------------------------------ revno: 106023 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-10-08 14:15:08 +0200 message: src/xdisp.c (hscroll_window_tree): Support hscroll in right-to-left lines. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-10-08 10:58:50 +0000 +++ src/ChangeLog 2011-10-08 12:15:08 +0000 @@ -1,5 +1,8 @@ 2011-10-08 Eli Zaretskii + * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left + lines. + * dispnew.c (buffer_posn_from_coords): Account for a possible presence of header-line. (Bug#4426) === modified file 'src/xdisp.c' --- src/xdisp.c 2011-09-28 14:37:27 +0000 +++ src/xdisp.c 2011-10-08 12:15:08 +0000 @@ -12065,6 +12065,7 @@ = (desired_cursor_row->enabled_p ? desired_cursor_row : current_cursor_row); + int row_r2l_p = cursor_row->reversed_p; text_area_width = window_box_width (w, TEXT_AREA); @@ -12072,11 +12073,31 @@ h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer)) - && ((XFASTINT (w->hscroll) - && w->cursor.x <= h_margin) - || (cursor_row->enabled_p - && cursor_row->truncated_on_right_p - && (w->cursor.x >= text_area_width - h_margin)))) + /* For left-to-right rows, hscroll when cursor is either + (i) inside the right hscroll margin, or (ii) if it is + inside the left margin and the window is already + hscrolled. */ + && ((!row_r2l_p + && ((XFASTINT (w->hscroll) + && w->cursor.x <= h_margin) + || (cursor_row->enabled_p + && cursor_row->truncated_on_right_p + && (w->cursor.x >= text_area_width - h_margin)))) + /* For right-to-left rows, the logic is similar, + except that rules for scrolling to left and right + are reversed. E.g., if cursor.x <= h_margin, we + need to hscroll "to the right" unconditionally, + and that will scroll the screen to the left so as + to reveal the next portion of the row. */ + || (row_r2l_p + && ((cursor_row->enabled_p + /* FIXME: It is confusing to set the + truncated_on_right_p flag when R2L rows + are actually truncated on the left. */ + && cursor_row->truncated_on_right_p + && w->cursor.x <= h_margin) + || (XFASTINT (w->hscroll) + && (w->cursor.x >= text_area_width - h_margin)))))) { struct it it; int hscroll; @@ -12111,7 +12132,9 @@ ? (text_area_width - 4 * FRAME_COLUMN_WIDTH (it.f)) : (text_area_width / 2)))) / FRAME_COLUMN_WIDTH (it.f); - else if (w->cursor.x >= text_area_width - h_margin) + else if ((!row_r2l_p + && w->cursor.x >= text_area_width - h_margin) + || (row_r2l_p && w->cursor.x <= h_margin)) { if (hscroll_relative_p) wanted_x = text_area_width * (1 - hscroll_step_rel) ------------------------------------------------------------ revno: 106022 fixes bug(s): http://debbugs.gnu.org/4426 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-10-08 12:58:50 +0200 message: Fix bug #4426 with buffer_posn_from_coords when header line is present. dispnew.c (buffer_posn_from_coords): Account it.vpos for a possible presence of header-line. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-10-07 13:08:47 +0000 +++ src/ChangeLog 2011-10-08 10:58:50 +0000 @@ -1,3 +1,8 @@ +2011-10-08 Eli Zaretskii + + * dispnew.c (buffer_posn_from_coords): Account for a possible + presence of header-line. (Bug#4426) + 2011-10-07 Stefan Monnier * buffer.c (syms_of_buffer) : Don't === modified file 'src/dispnew.c' --- src/dispnew.c 2011-09-24 14:38:16 +0000 +++ src/dispnew.c 2011-10-08 10:58:50 +0000 @@ -5261,6 +5261,10 @@ CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); start_display (&it, w, startp); + /* start_display takes into account the header-line row, but IT's + vpos still counts from the glyph row that includes the window's + start position. Adjust for a possible header-line row. */ + it.vpos += WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; x0 = *x; ------------------------------------------------------------ revno: 106021 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-10-08 06:18:34 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2011-10-03 10:18:29 +0000 +++ autogen/configure 2011-10-08 10:18:34 +0000 @@ -6969,6 +6969,8 @@ # Code from module stat: # Code from module stdarg: + + # Code from module stdbool: # Code from module stddef: # Code from module stdint: @@ -21903,12 +21905,6 @@ gl_gnulib_enabled_sigprocmask=true - if $condition; then - func_gl_gnulib_m4code_raise - fi - if $condition; then - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi fi } func_gl_gnulib_m4code_stat () @@ -22040,13 +22036,10 @@ gl_gnulib_enabled_stat=true - if $condition; then + if test $REPLACE_STAT = 1; then func_gl_gnulib_m4code_dosname fi - if $condition; then - func_gl_gnulib_m4code_pathmax - fi - if $condition; then + if test $REPLACE_STAT = 1; then func_gl_gnulib_m4code_verify fi fi @@ -22161,12 +22154,6 @@ gl_gnulib_enabled_verify=true fi } - if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi - if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi if test $REPLACE_GETOPT = 1; then func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 fi ------------------------------------------------------------ revno: 106020 committer: thierry volpiatto + + * lisp/eshell/eshell.el (eshell-command): Avoid using hooks. + 2011-10-07 Chong Yidong * bindings.el ([M-left],[M-right]): Bind to left-word and === modified file 'lisp/eshell/eshell.el' --- lisp/eshell/eshell.el 2011-10-06 15:18:48 +0000 +++ lisp/eshell/eshell.el 2011-10-08 06:08:00 +0000 @@ -344,16 +344,16 @@ (require 'esh-cmd) (unless arg (setq arg current-prefix-arg)) - (unwind-protect - (let ((eshell-non-interactive-p t)) - ;; Enable `eshell-mode' only in this minibuffer. - (minibuffer-with-setup-hook 'eshell-mode - (add-hook 'minibuffer-exit-hook 'eshell-add-command-to-history) - (add-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) - (unless command - (setq command (read-from-minibuffer "Emacs shell command: "))))) - (remove-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) - (remove-hook 'minibuffer-exit-hook 'eshell-add-command-to-history)) + (let ((eshell-non-interactive-p t)) + ;; Enable `eshell-mode' only in this minibuffer. + (minibuffer-with-setup-hook #'(lambda () + (eshell-mode) + (eshell-return-exits-minibuffer)) + (unwind-protect + (unless command + (setq command (read-from-minibuffer "Emacs shell command: "))) + (when command + (eshell-add-input-to-history command))))) (unless command (error "No command specified!")) ;; redirection into the current buffer is achieved by adding an ------------------------------------------------------------ revno: 106019 committer: Paul Eggert branch nick: trunk timestamp: Fri 2011-10-07 14:15:00 -0700 message: Merge from gnulib, fixing some 'configure' typos (Bug#9696). * lib/signal.in.h, lib/sigprocmask.c, m4/gl-comp.m4: * m4/gnulib-common.m4: Merge from gnulib. Without this, 'configure' would say "func_gl_gnulib_m4code_pathmax: command not found" on powerpc-apple-darwin9.8.0. diff: === modified file 'ChangeLog' --- ChangeLog 2011-10-07 07:23:44 +0000 +++ ChangeLog 2011-10-07 21:15:00 +0000 @@ -1,5 +1,11 @@ 2011-10-07 Paul Eggert + Merge from gnulib, fixing some 'configure' typos (Bug#9696). + * lib/signal.in.h, lib/sigprocmask.c, m4/gl-comp.m4: + * m4/gnulib-common.m4: Merge from gnulib. + Without this, 'configure' would say "func_gl_gnulib_m4code_pathmax: + command not found" on powerpc-apple-darwin9.8.0. + * configure.in (GC_LISP_OBJECT_ALIGNMENT): Remove. This is now done by src/alloc.c. === modified file 'lib/signal.in.h' --- lib/signal.in.h 2011-09-26 21:30:18 +0000 +++ lib/signal.in.h 2011-10-07 21:15:00 +0000 @@ -178,6 +178,10 @@ #if @GNULIB_SIGPROCMASK@ # if !@HAVE_POSIX_SIGNALBLOCKING@ +# ifndef GNULIB_defined_signal_blocking +# define GNULIB_defined_signal_blocking 1 +# endif + /* Maximum signal number + 1. */ # ifndef NSIG # define NSIG 32 @@ -303,18 +307,10 @@ # endif _GL_CXXALIASWARN (signal); -/* Raise signal SIG. */ # if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef raise -# define raise rpl_raise -# endif -_GL_FUNCDECL_RPL (raise, int, (int sig)); -_GL_CXXALIAS_RPL (raise, int, (int sig)); -# else -_GL_CXXALIAS_SYS (raise, int, (int sig)); +/* Raise signal SIGPIPE. */ +_GL_EXTERN_C int _gl_raise_SIGPIPE (void); # endif -_GL_CXXALIASWARN (raise); #elif defined GNULIB_POSIXCHECK # undef sigaddset === modified file 'lib/sigprocmask.c' --- lib/sigprocmask.c 2011-09-26 21:30:18 +0000 +++ lib/sigprocmask.c 2011-10-07 21:15:00 +0000 @@ -330,27 +330,19 @@ } #if GNULIB_defined_SIGPIPE -/* Raise the signal SIG. */ +/* Raise the signal SIGPIPE. */ int -rpl_raise (int sig) -# undef raise +_gl_raise_SIGPIPE (void) { - switch (sig) + if (blocked_set & (1U << SIGPIPE)) + pending_array[SIGPIPE] = 1; + else { - case SIGPIPE: - if (blocked_set & (1U << sig)) - pending_array[sig] = 1; - else - { - handler_t handler = SIGPIPE_handler; - if (handler == SIG_DFL) - exit (128 + SIGPIPE); - else if (handler != SIG_IGN) - (*handler) (sig); - } - return 0; - default: /* System defined signal */ - return raise (sig); + handler_t handler = SIGPIPE_handler; + if (handler == SIG_DFL) + exit (128 + SIGPIPE); + else if (handler != SIG_IGN) + (*handler) (SIGPIPE); } } #endif === modified file 'm4/gl-comp.m4' --- m4/gl-comp.m4 2011-09-26 21:30:18 +0000 +++ m4/gl-comp.m4 2011-10-07 21:15:00 +0000 @@ -79,9 +79,9 @@ # Code from module stdarg: dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode dnl for the builtin va_copy to work. With Autoconf 2.60 or later, - dnl AC_PROG_CC_STDC arranges for this. With older Autoconf AC_PROG_CC_STDC + dnl gl_PROG_CC_C99 arranges for this. With older Autoconf gl_PROG_CC_C99 dnl shouldn't hurt, though installers are on their own to set c99 mode. - AC_REQUIRE([AC_PROG_CC_STDC]) + gl_PROG_CC_C99 # Code from module stdbool: # Code from module stddef: # Code from module stdint: @@ -246,12 +246,6 @@ fi gl_SIGNAL_MODULE_INDICATOR([sigprocmask]) gl_gnulib_enabled_sigprocmask=true - if $condition; then - func_gl_gnulib_m4code_raise - fi - if $condition; then - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi fi } func_gl_gnulib_m4code_stat () @@ -264,13 +258,10 @@ fi gl_SYS_STAT_MODULE_INDICATOR([stat]) gl_gnulib_enabled_stat=true - if $condition; then + if test $REPLACE_STAT = 1; then func_gl_gnulib_m4code_dosname fi - if $condition; then - func_gl_gnulib_m4code_pathmax - fi - if $condition; then + if test $REPLACE_STAT = 1; then func_gl_gnulib_m4code_verify fi fi @@ -305,12 +296,6 @@ gl_gnulib_enabled_verify=true fi } - if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi - if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi if test $REPLACE_GETOPT = 1; then func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 fi === modified file 'm4/gnulib-common.m4' --- m4/gnulib-common.m4 2011-09-03 23:08:32 +0000 +++ m4/gnulib-common.m4 2011-10-07 21:15:00 +0000 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 30 +# gnulib-common.m4 serial 31 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -211,6 +211,29 @@ [m4_define([AS_VAR_IF], [AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) +# gl_PROG_CC_C99 +# Modifies the value of the shell variable CC in an attempt to make $CC +# understand ISO C99 source code. +# This is like AC_PROG_CC_C99, except that +# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60, +# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC +# , +# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99 +# . +# Remaining problems: +# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options +# to CC twice +# . +# - AC_PROG_CC_STDC is likely to change when C1X is an ISO standard. +AC_DEFUN([gl_PROG_CC_C99], +[ + dnl Change that version number to the minimum Autoconf version that supports + dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls. + m4_version_prereq([9.0], + [AC_REQUIRE([AC_PROG_CC_C99])], + [AC_REQUIRE([AC_PROG_CC_STDC])]) +]) + # gl_PROG_AR_RANLIB # Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler. # The user can set the variables AR, ARFLAGS, RANLIB if he wants to override ------------------------------------------------------------ revno: 106018 committer: Paul Eggert branch nick: trunk timestamp: Fri 2011-10-07 09:42:32 -0700 message: * alloc.c: Add comment. diff: === modified file 'src/alloc.c' --- src/alloc.c 2011-10-07 07:23:44 +0000 +++ src/alloc.c 2011-10-07 16:42:32 +0000 @@ -4235,6 +4235,11 @@ } +/* Alignment of Lisp_Object and pointer values. Use offsetof, as it + sometimes returns a smaller alignment than GCC's __alignof__ and + mark_memory might miss objects if __alignof__ were used. For + example, on x86 with WIDE_EMACS_INT, __alignof__ (Lisp_Object) is 8 + but GC_LISP_OBJECT_ALIGNMENT should be 4. */ #ifndef GC_LISP_OBJECT_ALIGNMENT # define GC_LISP_OBJECT_ALIGNMENT offsetof (struct {char a; Lisp_Object b;}, b) #endif ------------------------------------------------------------ revno: 106017 committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-10-07 12:22:04 -0400 message: Copyedits and updates for Emacs manual's first few chapters. * doc/emacs/basic.texi (Inserting Text): Add xref to Completion. Add ucs-insert example, and document prefix argument. (Moving Point): Fix introduction; C-f/C-b are no longer equivalent to left/right. Tweak left-char and right-char descriptions. M-left and M-right are now bound to left-word/right-word. (Erasing): Document delete-forward-char. * doc/emacs/commands.texi (User Input): Define "input event" more clearly. (Keys): Add xref to Echo Area. (Commands): Clarify relation between commands and functions. * doc/emacs/entering.texi (Entering Emacs): Define "startup screen". Document window-splitting behavior with command-line inputs. (Exiting): Remove obsolete paragraph about shells without suspend functionality. * doc/emacs/frames.texi (Non-Window Terminals): Index just "text-only terminal", which is used throughout the manual now. * doc/emacs/screen.texi (Screen, Menu Bar): Copyedits. (Point): Remove duplicate paragraph on cursors, also in Screen. (Mode Line): Trailing dashes no longer shown on X displays. diff: === modified file 'admin/FOR-RELEASE' --- admin/FOR-RELEASE 2011-07-19 07:15:15 +0000 +++ admin/FOR-RELEASE 2011-10-07 16:22:04 +0000 @@ -158,7 +158,7 @@ calendar.texi cal-xtra.texi cmdargs.texi -commands.texi +commands.texi cyd custom.texi dired.texi dired-xtra.texi @@ -166,7 +166,7 @@ emacs.texi emacs-xtra.texi emerge-xtra.texi -entering.texi +entering.texi cyd files.texi fixit.texi fortran-xtra.texi @@ -190,7 +190,7 @@ programs.texi regs.texi rmail.texi -screen.texi +screen.texi cyd search.texi sending.texi text.texi === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-10-06 15:13:45 +0000 +++ doc/emacs/ChangeLog 2011-10-07 16:22:04 +0000 @@ -1,3 +1,28 @@ +2011-10-07 Chong Yidong + + * basic.texi (Inserting Text): Add xref to Completion. Add + ucs-insert example, and document prefix argument. + (Moving Point): Fix introduction; C-f/C-b are no longer equivalent + to left/right. Tweak left-char and right-char descriptions. + M-left and M-right are now bound to left-word/right-word. + (Erasing): Document delete-forward-char. + + * screen.texi (Screen, Menu Bar): Copyedits. + (Point): Remove duplicate paragraph on cursors, also in Screen. + (Mode Line): Trailing dashes no longer shown on X displays. + + * frames.texi (Non-Window Terminals): Index just "text-only + terminal", which is used throughout the manual now. + + * entering.texi (Entering Emacs): Define "startup screen". + Document window-splitting behavior with command-line inputs. + (Exiting): Remove obsolete paragraph about shells without suspend + functionality. + + * commands.texi (User Input): Define "input event" more clearly. + (Keys): Add xref to Echo Area. + (Commands): Clarify relation between commands and functions. + 2011-10-06 Chong Yidong * misc.texi (emacsclient Options): Document how emacsclient runs === modified file 'doc/emacs/basic.texi' --- doc/emacs/basic.texi 2011-10-01 21:54:33 +0000 +++ doc/emacs/basic.texi 2011-10-07 16:22:04 +0000 @@ -10,7 +10,7 @@ Here we explain the basics of how to enter text, make corrections, and save the text in a file. If this material is new to you, we suggest you first run the Emacs learn-by-doing tutorial, by typing -@kbd{Control-h t} inside Emacs. (@code{help-with-tutorial}). +@kbd{C-h t} (@code{help-with-tutorial}). @menu @@ -41,20 +41,20 @@ @kindex RET @cindex newline - To end a line and start a new one, type @key{RET}. This key may be -labeled @key{Return} or @key{Enter} on your keyboard, but we refer to -it as @key{RET} in this manual. Pressing it inserts a newline -character in the buffer. If point is at the end of the line, this -creates a new blank line after it; if point is in the middle of a -line, the line is split at that position. + To end a line and start a new one, type @key{RET} (@code{newline}). +(The @key{RET} key may be labeled @key{Return} or @key{Enter} on your +keyboard, but we refer to it as @key{RET} in this manual.) This +command inserts a newline character into the buffer. If point is at +the end of the line, the effect is to create a new blank line after +it; if point is in the middle of a line, the line is split at that +position. As we explain later in this manual, you can change the way Emacs handles text insertion by turning on @dfn{minor modes}. For instance, -if you turn on a minor mode called @dfn{Auto Fill} mode, Emacs can -split lines automatically when they become too long (@pxref{Filling}). -If you turn on a minor mode called @dfn{Overwrite} mode, inserted -characters replace (overwrite) existing text, instead of shoving it to -the right. @xref{Minor Modes}. +the minor mode called Auto Fill mode splits lines automatically when +they get too long (@pxref{Filling}). The minor mode called Overwrite +mode causes inserted characters to replace (overwrite) existing text, +instead of shoving it to the right. @xref{Minor Modes}. @cindex quoting @kindex C-q @@ -80,9 +80,10 @@ @kbd{C-q} followed by a sequence of octal digits inserts the character with the specified octal character code. You can use any number of octal digits; any non-digit terminates the sequence. If the -terminating character is @key{RET}, it serves only to terminate the -sequence. Any other non-digit terminates the sequence and then acts -as normal input---thus, @kbd{C-q 1 0 1 B} inserts @samp{AB}. +terminating character is @key{RET}, that @key{RET} serves only to +terminate the sequence. Any other non-digit terminates the sequence +and then acts as normal input---thus, @kbd{C-q 1 0 1 B} inserts +@samp{AB}. The use of octal sequences is disabled in ordinary non-binary Overwrite mode, to give you a convenient way to insert a digit instead @@ -96,21 +97,28 @@ the letters @kbd{a} to @kbd{f} serve as part of a character code, just like digits. Case is ignored. - A numeric argument tells @kbd{C-q} how many copies of the quoted -character to insert (@pxref{Arguments}). - @findex ucs-insert @kindex C-x 8 RET @cindex Unicode characters, inserting @cindex insert Unicode character @cindex characters, inserting by name or code-point - Instead of @kbd{C-q}, you can use @kbd{C-x 8 @key{RET}} -(@code{ucs-insert}) to insert a character based on its Unicode name or -code-point. This command prompts for a character to insert, using -the minibuffer; you can specify the character using either (i) the -character's name in the Unicode standard, or (ii) the character's -code-point in the Unicode standard. If you specify the character's -name, the command provides completion. + Instead of @kbd{C-q}, you can use the command @kbd{C-x 8 @key{RET}} +(@code{ucs-insert}). This prompts for the Unicode name or code-point +of a character, using the minibuffer. If you enter a name, the +command provides completion (@pxref{Completion}). If you enter a +code-point, it should be a hexadecimal number (which is the convention +for Unicode). The command then inserts the corresponding character +into the buffer. For example, both of the following insert the +infinity sign (Unicode code-point @code{#x221E}): + +@example +@kbd{C-x 8 @key{RET} infinity @key{RET}} +@kbd{C-x 8 @key{RET} 221e @key{RET}} +@end example + + A numeric argument to either @kbd{C-q} or @kbd{C-x 8 @key{RET}} +specifies how many copies of the character to insert +(@pxref{Arguments}). @node Moving Point @section Changing the Location of Point @@ -123,85 +131,104 @@ To do more than insert characters, you have to know how to move point (@pxref{Point}). The keyboard commands @kbd{C-f}, @kbd{C-b}, @kbd{C-n}, and @kbd{C-p} move point to the right, left, up and down -respectively. These are equivalent to the commands @kbd{@key{right}}, -@kbd{@key{left}}, @kbd{@key{down}}, and @kbd{@key{up}}, entered using -the @dfn{arrow keys} present on many keyboards. Many Emacs users find -that it is slower to use the arrow keys than the equivalent control -keys. You can also click the left mouse button to move point to the +respectively. You can also move point using the @dfn{arrow keys} +present on most keyboards: @kbd{@key{right}}, @kbd{@key{left}}, +@kbd{@key{down}}, and @kbd{@key{up}}; however, many Emacs users find +that it is slower to use the arrow keys than the control keys. + + You can also click the left mouse button to move point to the position clicked. Emacs also provides a variety of additional keyboard commands that move point in more sophisticated ways. -@kindex C-a -@kindex C-e +@table @kbd + +@item C-f @kindex C-f +@findex forward-char +Move forward one character (@code{forward-char}). + +@item @key{right} +@kindex RIGHT +@findex right-char +This command (@code{right-char}) behaves like @kbd{C-f}, with one +exception: when editing right-to-left scripts such as Arabic, it +instead moves @emph{backward} if the current paragraph is a +right-to-left paragraph. @xref{Bidirectional Editing}. + +@item C-b @kindex C-b +@findex backward-char +Move backward one character (@code{backward-char}). + +@item @key{left} +@kindex LEFT +@findex left-char +This command (@code{left-char}) behaves like @kbd{C-b}, except it +moves @emph{forward} if the current paragraph is right-to-left. +@xref{Bidirectional Editing}. + +@item C-n +@itemx @key{down} @kindex C-n +@kindex DOWN +@findex next-line +Move down one screen line (@code{next-line}). This command attempts +to keep the horizontal position unchanged, so if you start in the +middle of one line, you move to the middle of the next. + +@item C-p +@itemx @key{up} @kindex C-p -@kindex M-> -@kindex M-< -@kindex M-r -@kindex LEFT -@kindex RIGHT @kindex UP -@kindex DOWN -@findex move-beginning-of-line -@findex move-end-of-line -@findex forward-char -@findex backward-char -@findex right-char -@findex left-char -@findex next-line @findex previous-line -@findex beginning-of-buffer -@findex end-of-buffer -@findex goto-char -@findex goto-line -@findex move-to-window-line -@table @kbd +Move up one screen line (@code{previous-line}). This command +preserves position within the line, like @kbd{C-n}. + @item C-a @itemx @key{Home} +@kindex C-a +@kindex HOME +@findex move-beginning-of-line Move to the beginning of the line (@code{move-beginning-of-line}). + @item C-e @itemx @key{End} +@kindex C-e +@kindex END +@findex move-end-of-line Move to the end of the line (@code{move-end-of-line}). -@item C-f -Move forward one character (@code{forward-char}). -@item @key{right} -Move one character to the right (@code{right-char}). This -moves one character forward in text that is read in the usual -left-to-right direction, but one character @emph{backward} if the text -is read right-to-left, as needed for right-to-left scripts such as -Arabic. @xref{Bidirectional Editing}. -@item C-b -Move backward one character (@code{backward-char}). -@item @key{left} -Move one character to the left (@code{left-char}). This -moves one character backward in left-to-right text and one character -forward in right-to-left text. + @item M-f -@itemx M-@key{right} +@kindex M-f +@findex forward-word Move forward one word (@code{forward-word}). + @item C-@key{right} -Move one word to the right (@code{right-word}). This moves one word -forward in left-to-right text and one word backward in right-to-left -text. +@itemx M-@key{right} +@kindex C-RIGHT +@kindex M-RIGHT +@findex right-word +This command (@code{right-word}) behaves like @kbd{M-f}, except it +moves @emph{backward} by one word if the current paragraph is +right-to-left. @xref{Bidirectional Editing}. + @item M-b -@itemx M-@key{left} +@kindex M-b +@findex backward-word Move backward one word (@code{backward-word}). + @item C-@key{left} -Move one word to the left (@code{left-word}). This moves one word -backward in left-to-right text and one word forward in right-to-left -text. -@item C-n -@itemx @key{down} -Move down one screen line (@code{next-line}). This command attempts -to keep the horizontal position unchanged, so if you start in the -middle of one line, you move to the middle of the next. -@item C-p -@itemx @key{up} -Move up one screen line (@code{previous-line}). This command -preserves position within the line, like @kbd{C-n}. +@itemx M-@key{left} +@kindex C-LEFT +@kindex M-LEFT +@findex left-word +This command (@code{left-word}) behaves like @kbd{M-f}, except it +moves @emph{forward} by one word if the current paragraph is +right-to-left. @xref{Bidirectional Editing}. + @item M-r +@kindex M-r +@findex move-to-window-line-top-bottom Without moving the text on the screen, reposition point on the left margin of the center-most text line of the window; on subsequent consecutive invocations, move point to the left margin of the top-most @@ -211,13 +238,18 @@ A numeric argument says which screen line to place point on, counting downward from the top of the window (zero means the top line). A negative argument counts lines up from the bottom (@minus{}1 means the -bottom line). +bottom line). @xref{Arguments}, for more information on numeric +arguments. @item M-< +@kindex M-< +@findex beginning-of-buffer Move to the top of the buffer (@code{beginning-of-buffer}). With numeric argument @var{n}, move to @var{n}/10 of the way from the top. -@xref{Arguments}, for more information on numeric arguments.@refill + @item M-> +@kindex M-> +@findex end-of-buffer Move to the end of the buffer (@code{end-of-buffer}). @item C-v @@ -233,10 +265,15 @@ (@code{scroll-down-command}). @xref{Scrolling}. @item M-x goto-char +@findex goto-char Read a number @var{n} and move point to buffer position @var{n}. Position 1 is the beginning of the buffer. + @item M-g M-g @itemx M-g g +@kindex M-g M-g +@kindex M-g g +@findex goto-line Read a number @var{n} and move point to the beginning of line number @var{n} (@code{goto-line}). Line 1 is the beginning of the buffer. If point is on or just after a number in the buffer, that is the default @@ -244,14 +281,16 @@ also specify @var{n} by giving @kbd{M-g M-g} a numeric prefix argument. @xref{Select Buffer}, for the behavior of @kbd{M-g M-g} when you give it a plain prefix argument. + @item C-x C-n +@kindex C-x C-n @findex set-goal-column -@kindex C-x C-n Use the current column of point as the @dfn{semipermanent goal column} for @kbd{C-n} and @kbd{C-p} (@code{set-goal-column}). When a semipermanent goal column is in effect, those commands always try to move to this column, or as close as possible to it, after moving vertically. The goal column remains in effect until canceled. + @item C-u C-x C-n Cancel the goal column. Henceforth, @kbd{C-n} and @kbd{C-p} try to preserve the horizontal position, as usual. @@ -266,9 +305,8 @@ (i.e., according to the text lines in the buffer) by setting the variable @code{line-move-visual} to @code{nil}; if a logical line occupies multiple screen lines, the cursor then skips over the -additional screen lines. Moving by logical lines was the default -behavior prior to Emacs 23.1. For details, see @ref{Continuation -Lines}. @xref{Variables}, for how to set variables such as +additional screen lines. For details, see @ref{Continuation Lines}. +@xref{Variables}, for how to set variables such as @code{line-move-visual}. Unlike @kbd{C-n} and @kbd{C-p}, most of the Emacs commands that work @@ -288,21 +326,30 @@ @vindex next-line-add-newlines @kbd{C-n} normally stops at the end of the buffer when you use it on -the last line of the buffer. However, if you set the variable +the last line in the buffer. However, if you set the variable @code{next-line-add-newlines} to a non-@code{nil} value, @kbd{C-n} on the last line of a buffer creates an additional line at the end and moves down into it. @node Erasing @section Erasing Text +@cindex killing characters and lines +@cindex deleting characters and lines +@cindex erasing characters and lines @table @kbd @item @key{DEL} @itemx @key{Backspace} -Delete the character before point (@code{delete-backward-char}). +Delete the character before point, or the region if it is active +(@code{delete-backward-char}). + +@itemx @key{Delete} +Delete the character after point, or the region if it is active +(@code{delete-forward-char}). + @item C-d -@itemx @key{Delete} Delete the character after point (@code{delete-char}). + @item C-k Kill to the end of the line (@code{kill-line}). @item M-d @@ -312,37 +359,40 @@ (@code{backward-kill-word}). @end table - The key @kbd{@key{DEL}} (@code{delete-backward-char}) removes the -character before point, moving the cursor and all the characters after -it backwards. On most keyboards, @key{DEL} is labelled -@key{Backspace}, but we refer to it as @key{DEL} in this manual. Do -not confuse @key{DEL} with another key, labelled @key{Delete}, that -exists on many keyboards; we will discuss @key{Delete} momentarily. - - Typing @key{DEL} when the cursor is at the beginning of a line -deletes the preceding newline character, joining the line with the one -before it. - - On some text-only terminals, Emacs may not recognize the @key{DEL} -key properly. If @key{DEL} does not do the right thing (e.g., if it -deletes characters forwards), see @ref{DEL Does Not Delete}. - -@cindex killing characters and lines -@cindex deleting characters and lines -@cindex erasing characters and lines - The key @kbd{C-d} (@code{delete-char}) deletes the character after -point, i.e., the character under the cursor. This shifts the rest of -the text on the line to the left. If you type @kbd{C-d} at the end of -a line, it joins that line with the following line. This command is -also bound to the key labelled @key{Delete} on many keyboards. - - To erase a larger amount of text, use the @kbd{C-k} key, which -erases (kills) a line at a time. If you type @kbd{C-k} at the -beginning or middle of a line, it kills all the text up to the end of -the line. If you type @kbd{C-k} at the end of a line, it joins that -line with the following line. - - To learn more about killing text, see @ref{Killing}. + The @kbd{@key{DEL}} (@code{delete-backward-char}) command removes +the character before point, moving the cursor and the characters after +it backwards. If point was at the beginning of a line, this deletes +the preceding newline, joining this line to the previous one. + + If, however, the region is active, @kbd{@key{DEL}} instead deletes +the text in the region. @xref{Mark}, for a description of the region. + + On most keyboards, @key{DEL} is labelled @key{Backspace}, but we +refer to it as @key{DEL} in this manual. (Do not confuse @key{DEL} +with the @key{Delete} key; we will discuss @key{Delete} momentarily.) +On some text-only terminals, Emacs may not recognize the @key{DEL} key +properly. @xref{DEL Does Not Delete}, if you encounter this problem. + + The @key{delete} (@code{delete-forward-char}) command deletes in the +``opposite direction'': it deletes the character after point, i.e. the +character under the cursor. If point was at the end of a line, this +joins the following line onto this one. Like @kbd{@key{DEL}}, it +deletes the text in the region if the region is active (@pxref{Mark}). + + @kbd{C-d} (@code{delete-char}) deletes the character after point, +similar to @key{delete}, but regardless of whether the region is +active. + + @xref{Deletion}, for more detailed information about the above +deletion commands. + + @kbd{C-k} (@code{kill-line}) erases (kills) a line at a time. If +you type @kbd{C-k} at the beginning or middle of a line, it kills all +the text up to the end of the line. If you type @kbd{C-k} at the end +of a line, it joins that line with the following line. + + @xref{Killing}, for more information about @kbd{C-k} and related +commands. @node Basic Undo @section Undoing Changes @@ -352,7 +402,7 @@ Undo one entry of the undo records---usually, one command worth (@code{undo}). @itemx C-x u -@item C-_ +@itemx C-_ The same. @end table @@ -379,10 +429,7 @@ Text that you insert in an Emacs buffer lasts only as long as the Emacs session. To keep any text permanently, you must put it in a -@dfn{file}. Files are named units of text which are stored by the -operating system for you to retrieve later by name. To use the -contents of a file in any way, including editing it with Emacs, you -must specify the file name. +@dfn{file}. Suppose there is a file named @file{test.emacs} in your home directory. To begin editing this file in Emacs, type @@ -417,14 +464,15 @@ @section Help @cindex getting help with keys - If you forget what a key does, you can find out with the Help -character, which is @kbd{C-h} (or @key{F1}, which is an alias for -@kbd{C-h}). Type @kbd{C-h k}, followed by the key of interest; for -example, @kbd{C-h k C-n} tells you what @kbd{C-n} does. @kbd{C-h} is -a prefix key; @kbd{C-h k} is just one of its subcommands (the command -@code{describe-key}). The other subcommands of @kbd{C-h} provide -different kinds of help. Type @kbd{C-h} twice to get a description of -all the help facilities. @xref{Help}. + If you forget what a key does, you can find out by typing @kbd{C-h +k} (@code{describe-key}), followed by the key of interest; for +example, @kbd{C-h k C-n} tells you what @kbd{C-n} does. + + The prefix key @kbd{C-h} stands for ``help''. The key @key{F1} +serves as an alias for @kbd{C-h}. Apart from @kbd{C-h k}, there are +many other help commands providing different kinds of help. + + @xref{Help}, for details. @node Blank Lines @section Blank Lines @@ -532,12 +580,17 @@ @itemx M-x column-number-mode Toggle automatic display of the current line number or column number. @xref{Optional Mode Line}. -@item M-x count-lines-region -Display the number of lines in the current region. Normally bound to -@kbd{M-=}, except in a few specialist modes. @xref{Mark}, for -information about the region. + +@item M-= +Display the number of lines in the region (@code{count-lines-region}). +@xref{Mark}, for information about the region. + +@item C-x l +Display the number of lines in the current page +(@code{count-lines-page}). @xref{Pages}. + @item M-x count-words-region -Display the number of words in the current region. +Display the number of words in the region. @item C-x = Display the character code of character after point, character position of point, and column of point (@code{what-cursor-position}). @@ -569,9 +622,10 @@ @kindex M-= @findex count-lines-region - Use @kbd{M-x count-lines-region} (normally bound to @kbd{M-=}) to -display the number of lines in the region (@pxref{Mark}). @xref{Pages}, -for the command @kbd{C-x l} which counts the lines in the current page. + @kbd{M-=} (@code{count-lines-region}) displays the number of lines +in the region (@pxref{Mark}), while @kbd{C-x l} +(@code{count-lines-page}) counts the lines in the current page +(@pxref{Pages}). @kindex C-x = @findex what-cursor-position === modified file 'doc/emacs/commands.texi' --- doc/emacs/commands.texi 2011-09-30 18:17:34 +0000 +++ doc/emacs/commands.texi 2011-10-07 16:22:04 +0000 @@ -23,25 +23,21 @@ @cindex @acronym{ASCII} @cindex C- @cindex Control -@cindex control characters GNU Emacs is primarily designed for use with the keyboard. While it is possible to use the mouse to issue editing commands through the menu bar and tool bar, that is not as efficient as using the keyboard. Therefore, this manual mainly documents how to edit with the keyboard. +@cindex control character Keyboard input into Emacs is based on a heavily-extended version of -@acronym{ASCII}. The simplest characters that you can input into -Emacs correspond to graphic symbols such as @samp{a}, @samp{B}, -@samp{3}, @samp{=}, the space character (conventionally denoted as -@key{SPC}), and so on. Entering these using the keyboard is -straightforward. Certain characters found on non-English keyboards -also fall into this category (@pxref{International}). - - In addition to these simple characters, Emacs recognizes -@dfn{control characters} such as @key{RET}, @key{TAB}, @key{DEL}, -@key{ESC}, @key{F1}, @key{Home}, @key{left}, etc. Most keyboards have -special keys for entering these. +@acronym{ASCII}. Simple characters, like @samp{a}, @samp{B}, +@samp{3}, @samp{=}, and the space character (denoted as @key{SPC}), +are entered by typing the corresponding key. @dfn{Control +characters}, such as @key{RET}, @key{TAB}, @key{DEL}, @key{ESC}, +@key{F1}, @key{Home}, and @key{left}, are also entered this way, as +are certain characters found on non-English keyboards +(@pxref{International}). @cindex modifier keys @cindex Control @@ -50,13 +46,14 @@ @cindex M- Emacs also recognizes control characters that are entered using @dfn{modifier keys}. Two commonly-used modifier keys are -@key{Control} (which is usually labelled as @key{Ctrl}), and -@key{Meta} (which is usually labeled as @key{Alt})@footnote{We refer -to @key{Alt} as @key{Meta} for historical reasons.}. For example, -@kbd{Control-a} is entered by holding down the @key{Ctrl} key while -pressing @kbd{a}; we will refer to this as @kbd{C-a} for short. -Similarly @kbd{Meta-a}, or @kbd{M-a} for short, is entered by holding -down the @key{Alt} key and pressing @kbd{a}. +@key{Control} (usually labelled @key{Ctrl}), and @key{Meta} (usually +labeled @key{Alt})@footnote{We refer to @key{Alt} as @key{Meta} for +historical reasons.}. For example, @kbd{Control-a} is entered by +holding down the @key{Ctrl} key while pressing @kbd{a}; we will refer +to this as @kbd{C-a} for short. Similarly @kbd{Meta-a}, or @kbd{M-a} +for short, is entered by holding down the @key{Alt} key and pressing +@kbd{a}. Modifier keys can also be applied to non-alphanumerical +characters, e.g. @kbd{C-@key{F1}} or @kbd{M-@key{left}}. @cindex @key{ESC} replacing @key{Meta} key You can also type Meta characters using two-character sequences @@ -68,33 +65,28 @@ next character. This feature is useful on certain text-only terminals where the @key{Meta} key does not function reliably. - Modifier keys can apply not only to alphanumerical characters, but -also to special input characters, such as the arrow keys and mouse -buttons. - -@cindex input event - @xref{Input Events,,, elisp, The Emacs Lisp Reference Manual}, for -the full Lisp-level details about keyboard and mouse input, which are -collectively referred to as @dfn{input events}. If you are not doing -Lisp programming, but simply want to redefine the meaning of some -characters or non-character events, see @ref{Customization}. - @cindex keys stolen by window manager @cindex window manager, keys stolen by - On graphical displays, the window manager is likely to block the -character @kbd{M-@key{TAB}} before Emacs can see it. It may also -block @kbd{M-@key{SPC}}, @kbd{C-M-d} and @kbd{C-M-l}. If you have -these problems, we recommend that you customize your window manager to -turn off those commands, or put them on key combinations that Emacs -does not use. + On graphical displays, the window manager might block some keyboard +inputs, including @kbd{M-@key{TAB}}, @kbd{M-@key{SPC}}, @kbd{C-M-d} +and @kbd{C-M-l}. If you have this problem, you can either customize +your window manager to not block those keys, or ``rebind'' the +affected Emacs commands (@pxref{Customization}). + +@cindex input event + Simple characters and control characters, as well as certain +non-keyboard inputs such as mouse clicks, are collectively referred to +as @dfn{input events}. For details about how Emacs internally handles +input events, see @ref{Input Events,,, elisp, The Emacs Lisp Reference +Manual}. @node Keys, Commands, User Input, Top @section Keys Some Emacs commands are invoked by just one input event; for -example, @kbd{C-f} moves forward one character in the buffer. But -Emacs also has commands that take two or more input events to invoke, -such as @kbd{C-x C-f} and @kbd{C-x 4 C-f}. +example, @kbd{C-f} moves forward one character in the buffer. Other +commands take two or more input events to invoke, such as @kbd{C-x +C-f} and @kbd{C-x 4 C-f}. @cindex key @cindex key sequence @@ -106,23 +98,23 @@ @kbd{C-f}, @kbd{C-x C-f} and @kbd{C-x 4 C-f} are all complete keys. If a key sequence isn't long enough to invoke a command, we call it a @dfn{prefix key}; from the preceding example, we see that @kbd{C-x} -and @kbd{C-x 4} are prefix keys. Every key is either a complete key -or a prefix key. +and @kbd{C-x 4} are prefix keys. Every key sequence is either a +complete key or a prefix key. A prefix key combines with the following input event to make a -longer key sequence, which may itself be complete or a prefix. For -example, @kbd{C-x} is a prefix key, so @kbd{C-x} and the next input -event combine to make a two-event key sequence. This two-event key -sequence could itself be a prefix key (such as @kbd{C-x 4}), or a -complete key (such as @kbd{C-x C-f}). There is no limit to the length -of a key sequence, but in practice people rarely use sequences longer -than three or four input events. +longer key sequence. For example, @kbd{C-x} is a prefix key, so +typing @kbd{C-x} alone does not invoke a command; instead, Emacs waits +for further input (if you pause for longer than a second, it echoes +the @kbd{C-x} key to prompt for that input; @pxref{Echo Area}). +@kbd{C-x} combines with the next input event to make a two-event key +sequence, which could itself be a prefix key (such as @kbd{C-x 4}), or +a complete key (such as @kbd{C-x C-f}). There is no limit to the +length of key sequences, but in practice they are seldom longer than +three or four input events. - You can't add input events onto a complete key. For example, the -two-event sequence @kbd{C-f C-k} is not a key, because the @kbd{C-f} -is a complete key in itself, so @kbd{C-f C-k} cannot have an -independent meaning as a command. @kbd{C-f C-k} is two key sequences, -not one.@refill + You can't add input events onto a complete key. For example, +because @kbd{C-f} is a complete key, the two-event sequence @kbd{C-f +C-k} is two key sequences, not one. By default, the prefix keys in Emacs are @kbd{C-c}, @kbd{C-h}, @kbd{C-x}, @kbd{C-x @key{RET}}, @kbd{C-x @@}, @kbd{C-x a}, @kbd{C-x @@ -132,22 +124,20 @@ stone; if you customize Emacs, you can make new prefix keys. You could even eliminate some of the standard ones, though this is not recommended for most users; for example, if you remove the prefix -definition of @kbd{C-x 4}, then @kbd{C-x 4 @var{anything}} would -become an invalid key sequence. @xref{Key Bindings}. +definition of @kbd{C-x 4}, then @kbd{C-x 4 C-f} becomes an invalid key +sequence. @xref{Key Bindings}. Typing the help character (@kbd{C-h} or @key{F1}) after a prefix key displays a list of the commands starting with that prefix. The sole exception to this rule is @key{ESC}: @kbd{@key{ESC} C-h} is equivalent to @kbd{C-M-h}, which does something else entirely. You can, however, -use @key{F1} to displays a list of the commands starting with -@key{ESC}. +use @key{F1} to display a list of commands starting with @key{ESC}. @node Commands, Entering Emacs, Keys, Top @section Keys and Commands @cindex binding @cindex command -@cindex function definition This manual is full of passages that tell you what particular keys do. But Emacs does not assign meanings to keys directly. Instead, Emacs assigns meanings to named @dfn{commands}, and then gives keys @@ -155,11 +145,9 @@ Every command has a name chosen by a programmer. The name is usually made of a few English words separated by dashes; for example, -@code{next-line} or @code{forward-word}. A command also has a -@dfn{function definition} which is a Lisp program; this is how the -command does its work. In Emacs Lisp, a command is a Lisp function -with special properties that make it suitable for interactive use. -For more information on commands and functions, see @ref{What Is a +@code{next-line} or @code{forward-word}. Internally, each command is +a special type of Lisp @dfn{function}, and the actions associated with +the command are performed by running the function. @xref{What Is a Function,, What Is a Function, elisp, The Emacs Lisp Reference Manual}. === modified file 'doc/emacs/entering.texi' --- doc/emacs/entering.texi 2011-01-25 04:08:28 +0000 +++ doc/emacs/entering.texi 2011-10-07 16:22:04 +0000 @@ -19,49 +19,45 @@ The usual way to invoke Emacs is with the shell command @command{emacs}. From a terminal window running in the X Window -System, you can also run Emacs in the background with -@command{emacs&}; this way, Emacs won't tie up the terminal window, so -you can use it to run other shell commands. +System, you can run Emacs in the background with @command{emacs &}; +this way, Emacs won't tie up the terminal window, so you can use it to +run other shell commands. @cindex startup screen When Emacs starts up, the initial frame displays a special buffer -named @samp{*GNU Emacs*}. This buffer contains some information about -Emacs, and includes @dfn{links} to common tasks that might be useful -to beginning users. For instance, activating the @samp{Emacs +named @samp{*GNU Emacs*}. This @dfn{startup screen} contains +information about Emacs and @dfn{links} to common tasks that are +useful for beginning users. For instance, activating the @samp{Emacs Tutorial} link opens the Emacs tutorial; this does the same thing as the command @kbd{C-h t} (@code{help-with-tutorial}). To activate a link, either move point onto it and type @kbd{@key{RET}}, or click on it with @kbd{mouse-1} (the left mouse button). Using a command line argument, you can tell Emacs to visit one or -more specific files as soon as it starts up. For example, -@command{emacs foo.txt} starts Emacs with a buffer displaying the -contents of the file @samp{foo.txt}. This feature exists mainly for -compatibility with other editors, which are designed to edit one file -at a time: once you are done with that file, you exit the editor, and -start it again the next time you need it. - - Using Emacs in this way---starting it afresh each time you want to -edit a file---is unnecessary and wasteful. Emacs can visit more than -one file in a single editing session, and exiting the Emacs session -loses valuable accumulated context, such as the kill ring, registers, -undo history, and mark ring. These features, described later in the -manual, are useful for performing edits across multiple files, or -continuing edits to a single file. - - The recommended way to use Emacs is to start it only once, just -after you log in, and do all your editing in the same Emacs session. -Each time you edit a file, visit it with the existing Emacs, which -eventually has many files in it ready for editing. @xref{Files}, for -more information on visiting more than one file. +more files as soon as it starts up. For example, @command{emacs +foo.txt} starts Emacs with a buffer displaying the contents of the +file @samp{foo.txt}. This feature exists mainly for compatibility +with other editors, which are designed to be launched from the shell +for short editing sessions. If you call Emacs this way, the initial +frame is split into two windows---one showing the specified file, and +the other showing the startup screen. @xref{Windows}. + + Generally, it is unnecessary and wasteful to start Emacs afresh each +time you want to edit a file. The recommended way to use Emacs is to +start it just once, just after you log in, and do all your editing in +the same Emacs session. @xref{Files}, for information on visiting +more than one file. If you use Emacs this way, the Emacs session +accumulates valuable context, such as the kill ring, registers, undo +history, and mark ring data, which together make editing more +convenient. These features are described later in the manual. To edit a file from another program while Emacs is running, you can use the @command{emacsclient} helper program to open a file in the -already running Emacs. @xref{Emacs Server}. +existing Emacs session. @xref{Emacs Server}. Emacs accepts other command line arguments that tell it to load -certain Lisp files, call certain functions, and so forth. These -features exist mainly for advanced users. @xref{Emacs Invocation}. +certain Lisp files, where to put the initial frame, and so forth. +@xref{Emacs Invocation}. @vindex inhibit-startup-screen If the variable @code{inhibit-startup-screen} is non-@code{nil}, @@ -72,11 +68,10 @@ @xref{Lisp Interaction}. You can set the variable @code{inhibit-startup-screen} using the Customize facility (@pxref{Easy Customization}), or by editing your initialization file -(@pxref{Init File}).@footnote{Note that setting -@code{inhibit-startup-screen} in @file{site-start.el} doesn't work, -because the startup screen is set up before reading -@file{site-start.el}. @xref{Init File}, for information about -@file{site-start.el}.} +(@pxref{Init File}).@footnote{Setting @code{inhibit-startup-screen} in +@file{site-start.el} doesn't work, because the startup screen is set +up before reading @file{site-start.el}. @xref{Init File}, for +information about @file{site-start.el}.} You can also force Emacs to display a file or directory at startup by setting the variable @code{initial-buffer-choice} to a @@ -105,13 +100,13 @@ @findex save-buffers-kill-terminal @dfn{Killing} Emacs means terminating the Emacs program. To do this, type @kbd{C-x C-c} (@code{save-buffers-kill-terminal}). A -two-character key is used to make it harder to type by accident. If -there are any modified file-visiting buffers when you type @kbd{C-x -C-c}, Emacs first offers to save these buffers. If you do not save -them all, it asks for confirmation again, since the unsaved changes -will be lost. Emacs also asks for confirmation if any subprocesses -are still running, since killing Emacs will also kill the subprocesses -(@pxref{Shell}). +two-character key sequence is used to make it harder to type by +accident. If there are any modified file-visiting buffers when you +type @kbd{C-x C-c}, Emacs first offers to save these buffers. If you +do not save them all, it asks for confirmation again, since the +unsaved changes will be lost. Emacs also asks for confirmation if any +subprocesses are still running, since killing Emacs will also kill the +subprocesses (@pxref{Shell}). @kbd{C-x C-c} behaves specially if you are using Emacs as a server. If you type it from a ``client frame'', it closes the client @@ -135,39 +130,19 @@ To kill Emacs without being prompted about saving, type @kbd{M-x kill-emacs}. -@cindex minimizing a frame +@kindex C-z +@findex suspend-frame +@cindex minimizing @cindex iconifying @cindex suspending - You can ``exit'' Emacs in two other ways. On a graphical display, -you can @dfn{minimize} (or @dfn{iconify}) an Emacs frame; depending on -the window system, this either replaces the Emacs frame with a tiny -``icon'' or conceals the frame entirely (@pxref{Frames}). On a -text-only terminal, you can @dfn{suspend} Emacs; this means stopping -the Emacs program temporarily, returning control to its parent process -(usually a shell). - -@kindex C-z -@findex suspend-frame @kbd{C-z} runs the command @code{suspend-frame}. On a graphical -display, this ``minimizes'' (or ``iconifies'') the selected Emacs -frame. On a text terminal, this suspends the Emacs process. - - After minimizing or suspending Emacs, you can return to it and -continue editing wherever you left off. The way to do this depends on -the window system or shell. In most common shells, you can resume -Emacs after suspending it with the shell command @command{%emacs}. - -@vindex cannot-suspend - On very old systems that don't support suspending programs, -@kbd{C-z} starts an inferior shell that communicates directly with the -terminal, and Emacs waits until you exit the subshell. (The way to -exit the subshell is usually @kbd{C-d} or @command{exit}.) On these -systems, you can only get back to the shell from which Emacs was run -(to log out, for example) when you kill Emacs. Suspending can also -fail if you run Emacs under a shell that doesn't support suspending -jobs, even if the system itself does support it. In this case, you -can set the variable @code{cannot-suspend} to a non-@code{nil} value -to force @kbd{C-z} to start an inferior shell. +display, this command @dfn{minimizes} (or @dfn{iconifies}) the +selected Emacs frame, hiding it in a way that lets you bring it back +later (exactly how this hiding occurs depends on the window system). +On a text terminal, the @kbd{C-z} command @dfn{suspends} Emacs, +stopping the program temporarily and returning control to the parent +process (usually a shell); in most shells, you can resume Emacs after +suspending it with the shell command @command{%emacs}. Text-only terminals usually listen for certain special characters whose meaning is to kill or suspend the program you are running. === modified file 'doc/emacs/frames.texi' --- doc/emacs/frames.texi 2011-09-24 18:19:20 +0000 +++ doc/emacs/frames.texi 2011-10-07 16:22:04 +0000 @@ -1229,8 +1229,7 @@ @node Non-Window Terminals @section Non-Window Terminals -@cindex non-window terminals -@cindex single-frame terminals +@cindex text-only terminal On a text-only terminal, Emacs can display only one Emacs frame at a time. However, you can still create multiple Emacs frames, and switch === modified file 'doc/emacs/screen.texi' --- doc/emacs/screen.texi 2011-07-12 22:37:20 +0000 +++ doc/emacs/screen.texi 2011-10-07 16:22:04 +0000 @@ -5,31 +5,35 @@ @node Screen, User Input, Acknowledgments, Top @chapter The Organization of the Screen @cindex screen -@cindex parts of the screen - - On a text-only terminal, the Emacs display occupies the entire -terminal screen. On a graphical display, such as on GNU/Linux using -the X Window System, Emacs creates its own windows to use. We use the -term @dfn{frame} to mean the entire terminal screen or graphical -window used by Emacs. Emacs uses both kinds of frames, in the same -way, to display your editing. Emacs normally starts out with just one -frame, but you can create additional frames if you wish -(@pxref{Frames}). - - The frame consists of several distinct regions. At the top of the +@cindex frame + + On a graphical display, such as on GNU/Linux using the X Window +System, Emacs occupies a ``graphical window''. On a text-only +terminal, Emacs occupies the entire terminal screen. We will use the +term @dfn{frame} to mean a graphical window or terminal screen +occupied by Emacs. Emacs behaves very similarly on both kinds of +frames. It normally starts out with just one frame, but you can +create additional frames if you wish (@pxref{Frames}). + + Each frame consists of several distinct regions. At the top of the frame is a @dfn{menu bar}, which allows you to access commands via a series of menus. On a graphical display, directly below the menu bar is a @dfn{tool bar}, a row of icons that perform editing commands if -you click on them. At the very bottom of the frame is a special -@dfn{echo area}, where short informative messages are displayed and -where you enter information when Emacs asks for it. +you click on them. At the very bottom of the frame is an @dfn{echo +area}, where informative messages are displayed and where you enter +information when Emacs asks for it. The main area of the frame, below the tool bar (if one exists) and -above the echo area, is called @dfn{the window}. This is where Emacs -displays the @dfn{buffer}: the text that you are editing. On a -graphical display, the window possesses a @dfn{scroll bar} on one -side, which you can use to display different parts of the buffer in -the window. The last line of the window is a @dfn{mode line}. This +above the echo area, is called @dfn{the window}. Henceforth in this +manual, we will use the word ``window'' in this sense. Graphical +display systems commonly use the word ``window'' with a different +meaning; but, as stated above, we refer to those ``graphical windows'' +as ``frames''. + + An Emacs window is where the @dfn{buffer}---the text you are +editing---is displayed. On a graphical display, the window possesses +a @dfn{scroll bar} on one side, which can be used to scroll through +the buffer. The last line of the window is a @dfn{mode line}. This displays various information about what is going on in the buffer, such as whether there are unsaved changes, the editing modes that are in use, the current line number, and so forth. @@ -37,20 +41,18 @@ When you start Emacs, there is normally only one window in the frame. However, you can subdivide this window horizontally or vertically to create multiple windows, each of which can independently -display a buffer (@pxref{Windows}). In this manual, the word -``window'' refers to the initial large window if not subdivided, or -any one of the multiple windows you have subdivided it into. +display a buffer (@pxref{Windows}). - At any time, one window is the @dfn{selected window}. On graphical -displays, the selected window normally shows a more prominent cursor -(usually solid and blinking) while other windows show a weaker cursor -(such as a hollow box). Text terminals have just one cursor, so it -always appears in the selected window. The buffer displayed in the -selected window is called the @dfn{current buffer}, and it is where -editing happens. Most Emacs commands implicitly apply to the current -buffer; the text displayed in unselected windows is mostly visible for -reference. If you use multiple frames on a graphical display, -selecting a particular frame selects a window in that frame. + At any time, one window is the @dfn{selected window}. On a +graphical display, the selected window shows a more prominent cursor +(usually solid and blinking); other windows show a less prominent +cursor (usually a hollow box). On a text terminal, there is only one +cursor, which is shown in the selected window. The buffer displayed +in the selected window is called the @dfn{current buffer}, and it is +where editing happens. Most Emacs commands implicitly apply to the +current buffer; the text displayed in unselected windows is mostly +visible for reference. If you use multiple frames on a graphical +display, selecting a particular frame selects a window in that frame. @menu * Point:: The place in the text where editing commands operate. @@ -64,42 +66,33 @@ @cindex point @cindex cursor - The active cursor shows the location at which editing commands will -take effect, which is called @dfn{point}@footnote{The term ``point'' -comes from the character @samp{.}, which was the command in TECO (the -language in which the original Emacs was written) for accessing the -value now called ``point.''}. Many Emacs commands move point to -different places in the buffer; for example, you can place point by + The cursor in the selected window shows the location where most +editing commands take effect, which is called @dfn{point}@footnote{The +term ``point'' comes from the character @samp{.}, which was the +command in TECO (the language in which the original Emacs was written) +for accessing the editing position.}. Many Emacs commands move point +to different places in the buffer; for example, you can place point by clicking mouse button 1 (normally the left button) at the desired location. - If you use a block cursor, the cursor appears to be @emph{on} a -character, but you should think of point as @emph{between} two -characters; it points @emph{before} the character that appears under -the cursor. For example, if your text looks like @samp{frob} with the -cursor over the @samp{b}, then point is between the @samp{o} and the -@samp{b}. If you insert the character @samp{!} at that position, the -result is @samp{fro!b}, with point between the @samp{!} and the -@samp{b}. Thus, the cursor remains over the @samp{b}, as before. - - Sometimes people speak of ``the cursor'' when they mean ``point,'' or -speak of commands that move point as ``cursor motion'' commands. + By default, the cursor in the selected window is drawn as a solid +block and appears to be @emph{on} a character, but you should think of +point as @emph{between} two characters; it is situated @emph{before} +the character under the cursor. For example, if your text looks like +@samp{frob} with the cursor over the @samp{b}, then point is between +the @samp{o} and the @samp{b}. If you insert the character @samp{!} +at that position, the result is @samp{fro!b}, with point between the +@samp{!} and the @samp{b}. Thus, the cursor remains over the +@samp{b}, as before. If you are editing several files in Emacs, each in its own buffer, -each buffer has its own point location. A buffer that is not -currently displayed remembers its point location in case you display -it again later. When Emacs displays multiple windows, each window has -its own point location. If the same buffer appears in more than one -window, each window has its own point position in that buffer. +each buffer has its own value of point. A buffer that is not +currently displayed remembers its value of point if you later display +it again. Furthermore, if a buffer is displayed in multiple windows, +each of those windows has its own value of point. - On a graphical display, Emacs shows a cursor in each window. The -selected window's cursor will be blinking. If you use the default, -@code{box} cursor type, the selected window's cursor will be solid, -and the other cursors are hollow. On a text-only terminal, there is -just one cursor, in the selected window; even though the unselected -windows have their own point positions, they do not display a cursor. -@xref{Cursor Display}, for customizable variables that control cursor -display. + @xref{Cursor Display}, for options that control how Emacs displays +the cursor. @node Echo Area @section The Echo Area @@ -108,40 +101,41 @@ The line at the very bottom of the frame is the @dfn{echo area}. It is used to display small amounts of text for various purposes. - @dfn{Echoing} means displaying the characters that you type. -Single-character commands, including most simple editing operations, -are not echoed. Multi-character commands are echoed if you pause -while typing them: if you pause for more than a second in the middle -of a command, Emacs echoes all the characters of the command so far, -to prompt you for the rest of the command. The echoed characters are -displayed in the echo area. Once echoing has started, the rest of the -command echoes immediately as you type it. This behavior is designed -to give confident users fast response, while giving hesitant users -maximum feedback. @xref{Display Custom}. - -@cindex error message in the echo area - If a command cannot do its job, it may display an @dfn{error -message}. Error messages are also displayed in the echo area. They -may be accompanied by beeping or by flashing the screen. - - Some commands display informative messages in the echo area. Unlike -error messages, these messages are not announced with a beep or flash. -Sometimes the message tells you what the command has done, when this -is not obvious from looking at the text being edited. Other times, -the sole purpose of a command is to show you a message giving you -specific information. For example, @kbd{C-x =} (hold down @key{CTRL} -and type @kbd{x}, then let go of @key{CTRL} and type @kbd{=}) displays -a message describing the character position of point in the text and -its current column in the window. Commands that take a long time -often display messages ending in @samp{...} while they are working, -and add @samp{done} at the end when they are finished. They may also -indicate progress with percentages. +@cindex echoing + The echo area is so-named because one of the things it is used for +is @dfn{echoing}, which means displaying the characters of a +multi-character command as you type. Single-character commands are +not echoed. Multi-character commands (@pxref{Keys}) are echoed if you +pause for more than a second in the middle of a command. Emacs then +echoes all the characters of the command so far, to prompt you for the +rest. Once echoing has started, the rest of the command echoes +immediately as you type it. This behavior is designed to give +confident users fast response, while giving hesitant users maximum +feedback. + +@cindex error message +@cindex echo area message + The echo area is also used to display an @dfn{error message} when a +command cannot do its job. Error messages may be accompanied by +beeping or by flashing the screen. + + Some commands display informative messages in the echo area to tell +you what the command has done, or to provide you with some specific +information. These @dfn{informative} messages, unlike error messages, +are not accompanied with a beep or flash. For example, @kbd{C-x =} +(hold down @key{CTRL} and type @kbd{x}, then let go of @key{CTRL} and +type @kbd{=}) displays a message describing the character at point, +its position in the buffer, and its current column in the window. +Commands that take a long time often display messages ending in +@samp{...} while they are working (sometimes also indicating how much +progress has been made, as a percentage), and add @samp{done} when +they are finished. @cindex @samp{*Messages*} buffer @cindex saved echo area messages @cindex messages saved from echo area @vindex message-log-max - Informative echo-area messages are saved in a special buffer named + Informative echo area messages are saved in a special buffer named @samp{*Messages*}. (We have not explained buffers yet; see @ref{Buffers}, for more information about them.) If you miss a message that appeared briefly on the screen, you can switch to the @@ -152,15 +146,17 @@ this limit, one line is deleted from the beginning whenever a new message line is added at the end. + @xref{Display Custom}, for options that control how Emacs uses the +echo area. + @cindex minibuffer The echo area is also used to display the @dfn{minibuffer}, a special window where you can input arguments to commands, such as the name of a file to be edited. When the minibuffer is in use, the text -displayed in the echo area begins with a @dfn{prompt string} (usually -ending with a colon); also, the active cursor appears within the -minibuffer, which is temporarily considered the selected window. You -can always get out of the minibuffer by typing @kbd{C-g}. -@xref{Minibuffer}. +displayed in the echo area begins with a @dfn{prompt string}, and the +active cursor appears within the minibuffer, which is temporarily +considered the selected window. You can always get out of the +minibuffer by typing @kbd{C-g}. @xref{Minibuffer}. @node Mode Line @section The Mode Line @@ -171,47 +167,51 @@ what is going on in the current buffer. When there is only one window, the mode line appears right above the echo area; it is the next-to-last line in the frame. On a graphical display, the mode line -is drawn with a 3D box appearance, and the mode line of the selected -window has a brighter color than that of unselected windows to make it -stand out. On a text-only terminal, the mode line is usually drawn in -inverse video. +is drawn with a 3D box appearance. Emacs also usually draws the mode +line of the selected window with a different color than that of +unselected windows, in order to make it stand out. The text displayed in the mode line has the following format: @example --@var{cs}:@var{ch}-@var{fr} @var{buf} @var{pos} @var{line} (@var{major} @var{minor})------ + @var{cs}:@var{ch}-@var{fr} @var{buf} @var{pos} @var{line} (@var{major} @var{minor}) @end example @noindent +On a text-only terminal, this text is followed by a series of dashes +extending to the right edge of the window. These dashes are omitted +on a graphical display. + The @var{cs} string and the colon character after it describe the character set and newline convention used for the current buffer. -Normally, Emacs handles these settings intelligently, but it is -sometimes useful to have this information. +Normally, Emacs automatically handles these settings for you, but it +is sometimes useful to have this information. - @var{cs} describes the character set of the buffer (@pxref{Coding -Systems}). If it is a dash (@samp{-}), that indicates the default -state of affairs: no special character set handling, except for the -end-of-line translations described in the next paragraph. @samp{=} -means no conversion whatsoever. Characters represent various nontrivial + @var{cs} describes the character set of the text in the buffer +(@pxref{Coding Systems}). If it is a dash (@samp{-}), that indicates +no special character set handling (with the possible expection of +end-of-line conventions, described in the next paragraph). @samp{=} +means no conversion whatsoever, and is usually used for files +containing non-textual data. Other characters represent various @dfn{coding systems}---for example, @samp{1} represents ISO Latin-1. -On a text-only terminal, @var{cs} is preceded by two additional -characters that describe the coding system for keyboard input and the -coding system for terminal output. Furthermore, if you are using an -input method, @var{cs} is preceded by a string that identifies the -input method, which takes the form @samp{@var{i}>}, @samp{@var{i}+}, -or @samp{@var{i}@@} (@pxref{Input Methods}). - -@cindex end-of-line conversion, mode-line indication - The character after @var{cs} is usually a colon. However, under -some circumstances a different string is displayed, which indicates a -nontrivial end-of-line convention. Usually, lines of text are -separated by @dfn{newline characters}, but two other conventions are -sometimes used. The MS-DOS convention is to use a ``carriage-return'' + + On a text-only terminal, @var{cs} is preceded by two additional +characters that describe the coding systems for keyboard input and +terminal output. Furthermore, if you are using an input method, +@var{cs} is preceded by a string that identifies the input method +(@pxref{Input Methods}). + +@cindex end-of-line convention, mode-line indication + The character after @var{cs} is usually a colon. If a different +string is displayed, that indicates a nontrivial end-of-line +convention for encoding a file. Usually, lines of text are separated +by @dfn{newline characters} in a file, but two other conventions are +sometimes used. The MS-DOS convention uses a ``carriage-return'' character followed by a ``linefeed'' character; when editing such files, the colon changes to either a backslash (@samp{\}) or -@samp{(DOS)}, depending on the operating system. The Macintosh -end-of-line convention is to use a ``carriage-return'' character -instead of a newline; when editing such files, the colon indicator +@samp{(DOS)}, depending on the operating system. Another convention, +employed by older Macintosh systems, uses a ``carriage-return'' +character instead of a newline; when editing such files, the colon changes to either a forward slash (@samp{/}) or @samp{(Mac)}. On some systems, Emacs displays @samp{(Unix)} instead of the colon for files that use newline as the line separator. @@ -234,14 +234,14 @@ Usually, this is the same as the name of a file you are editing. @xref{Buffers}. - @var{pos} tells you whether there is additional text above the top of -the window, or below the bottom. If your buffer is small and it is all -visible in the window, @var{pos} is @samp{All}. Otherwise, it is -@samp{Top} if you are looking at the beginning of the buffer, @samp{Bot} -if you are looking at the end of the buffer, or @samp{@var{nn}%}, where -@var{nn} is the percentage of the buffer above the top of the window. -With Size Indication mode, you can display the size of the buffer as -well. @xref{Optional Mode Line}. + @var{pos} tells you whether there is additional text above the top +of the window, or below the bottom. If your buffer is small and all +of it is visible in the window, @var{pos} is @samp{All}. Otherwise, +it is @samp{Top} if you are looking at the beginning of the buffer, +@samp{Bot} if you are looking at the end of the buffer, or +@samp{@var{nn}%}, where @var{nn} is the percentage of the buffer above +the top of the window. With Size Indication mode, you can display the +size of the buffer as well. @xref{Optional Mode Line}. @var{line} is the character @samp{L} followed by the line number at point. (You can display the current column number too, by turning on @@ -249,16 +249,14 @@ @var{major} is the name of the @dfn{major mode} used in the buffer. A major mode is a principal editing mode for the buffer, such as Text -mode, Lisp mode, C mode, and so forth. @xref{Major Modes}. - - Some major modes display additional information after the major mode -name. For example, Rmail buffers display the current message number and -the total number of messages. Compilation buffers and Shell buffers -display the status of the subprocess. - - @var{minor} is a list of some of the @dfn{minor modes} turned on in -the buffer. Minor modes are optional editing modes that provide -additional features on top of the major mode. @xref{Minor Modes}. +mode, Lisp mode, C mode, and so forth. @xref{Major Modes}. Some +major modes display additional information after the major mode name. +For example, Compilation buffers and Shell buffers display the status +of the subprocess. + + @var{minor} is a list of some of the enabled @dfn{minor modes}, +which are optional editing modes that provide additional features on +top of the major mode. @xref{Minor Modes}. Some features are listed together with the minor modes whenever they are turned on, even though they are not really minor modes. @@ -271,9 +269,8 @@ brackets (@samp{[@dots{}]}) appear around the parentheses that surround the modes. If Emacs is in one recursive editing level within another, double square brackets appear, and so on. Since recursive -editing levels affect Emacs globally, not just one buffer, the square -brackets appear in every window's mode line or not in any of them. -@xref{Recursive Edit}.@refill +editing levels affect Emacs globally, such square brackets appear in +the mode line of every window. @xref{Recursive Edit}. You can change the appearance of the mode line as well as the format of its contents. @xref{Optional Mode Line}. In addition, the mode @@ -293,10 +290,10 @@ @findex tmm-menubar @findex menu-bar-open On a graphical display, you can use the mouse to choose a command -from the menu bar. A right-arrow at the end of a menu item means it +from the menu bar. An arrow on the right edge of a menu item means it leads to a subsidiary menu, or @dfn{submenu}. A @samp{...} at the end -of a menu item means that the command invoked will prompt you for -further input before it actually does anything. +of a menu item means that the command will prompt you for further +input before it actually does anything. Some of the commands in the menu bar have ordinary key bindings as well; if so, a key binding is shown in parentheses after the item @@ -310,14 +307,13 @@ selected menu item, press @key{RET}; to cancel menu navigation, press @key{ESC}. - On text-only terminals with no mouse, you can use the menu bar by -typing @kbd{M-`} or @key{F10} (these run the command -@code{tmm-menubar}). This lets you select a menu item with the -keyboard. A provisional choice appears in the echo area. You can use -the up and down arrow keys to move through the menu to different -items, and then you can type @key{RET} to select the item. - - Each menu item also has an assigned letter or digit which designates -that item; it is usually the initial of some word in the item's name. -This letter or digit is separated from the item name by @samp{=>}. You -can type the item's letter or digit to select the item. + On a text-only terminal, you can use the menu bar by typing +@kbd{M-`} or @key{F10} (these run the command @code{tmm-menubar}). +This lets you select a menu item with the keyboard. A provisional +choice appears in the echo area. You can use the up and down arrow +keys to move through the menu to different items, and then you can +type @key{RET} to select the item. Each menu item is also designated +by a letter or digit (usually the initial of some word in the item's +name). This letter or digit is separated from the item name by +@samp{=>}. You can type the item's letter or digit to select the +item. === modified file 'etc/NEWS' --- etc/NEWS 2011-10-01 23:15:46 +0000 +++ etc/NEWS 2011-10-07 16:22:04 +0000 @@ -96,8 +96,10 @@ *** shell-mode uses pcomplete rules, with the standard completion UI. -*** Many packages have been changed to use completion-at-point rather than -their own completion code. +*** Many packages have been changed to use `completion-at-point' +rather than their own completion code. + +*** `completion-at-point' now handles tags and semantic completion. *** Completion in a non-minibuffer now tries to detect the end of completion and pops down the *Completions* buffer accordingly. @@ -455,8 +457,6 @@ +++ ** New command `count-words-region'. This does what you expect. -** completion-at-point now handles tags and semantic completion. - ** The default value of `backup-by-copying-when-mismatch' is now t. ** The command `just-one-space' (M-SPC), if given a negative argument, @@ -724,6 +724,8 @@ ** Shell mode +*** Shell mode uses pcomplete rules, with the standard completion UI. + *** The `shell' command prompts for the shell path name if the default directory is a remote file name and neither the environment variable $ESHELL nor the variable `explicit-shell-file-name' is set. ------------------------------------------------------------ revno: 106016 committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-10-07 12:05:10 -0400 message: * bindings.el ([M-left],[M-right]): Bind to left-word and right-word respectively. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-07 02:17:29 +0000 +++ lisp/ChangeLog 2011-10-07 16:05:10 +0000 @@ -1,3 +1,8 @@ +2011-10-07 Chong Yidong + + * bindings.el ([M-left],[M-right]): Bind to left-word and + right-word respectively. + 2011-10-07 Glenn Morris * cus-start.el (debug-on-quit): Fix custom type. === modified file 'lisp/bindings.el' --- lisp/bindings.el 2011-08-20 22:41:41 +0000 +++ lisp/bindings.el 2011-10-07 16:05:10 +0000 @@ -1103,9 +1103,9 @@ "Keymap for characters following C-c.") (define-key global-map "\C-c" 'mode-specific-command-prefix) -(global-set-key [M-right] 'forward-word) +(global-set-key [M-right] 'right-word) (define-key esc-map [right] 'forward-word) -(global-set-key [M-left] 'backward-word) +(global-set-key [M-left] 'left-word) (define-key esc-map [left] 'backward-word) ;; ilya@math.ohio-state.edu says these bindings are standard on PC editors. (global-set-key [C-right] 'right-word) ------------------------------------------------------------ revno: 106015 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-10-07 09:08:47 -0400 message: * src/buffer.c (syms_of_buffer) : Don't advertise functionality which we discourage or doesn't work. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-10-07 07:23:44 +0000 +++ src/ChangeLog 2011-10-07 13:08:47 +0000 @@ -1,3 +1,8 @@ +2011-10-07 Stefan Monnier + + * buffer.c (syms_of_buffer) : Don't + advertise functionality which we discourage or doesn't work. + 2011-10-07 Paul Eggert * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__ @@ -142,8 +147,8 @@ 2011-09-24 Eli Zaretskii - * dispnew.c (syms_of_display) : Default - value is now t. Doc fix. + * dispnew.c (syms_of_display) : + Default value is now t. Doc fix. * indent.c (Fvertical_motion): Compute and apply the overshoot logic when moving up, not only when moving down. Fix the @@ -159,8 +164,8 @@ * dbusbind.c (Fdbus_register_signal): Add match rule to Vdbus_registered_objects_table. (Bug#9581) - (Fdbus_register_method, Vdbus_registered_objects_table): Fix - docstring. + (Fdbus_register_method, Vdbus_registered_objects_table): + Fix docstring. 2011-09-24 Jim Meyering @@ -640,15 +645,15 @@ * term.c (tty_append_glyph): New function. (produce_stretch_glyph): Static function and its prototype deleted. - * dispextern.h (produce_stretch_glyph, tty_append_glyph): Add - prototypes. + * dispextern.h (produce_stretch_glyph, tty_append_glyph): + Add prototypes. 2011-08-29 Paul Eggert * image.c (parse_image_spec): Check for nonnegative, not for positive, when checking :margin (Bug#9390). (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR): - Renamed from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, + Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, so that the name doesn't mislead. All uses changed. 2011-08-28 Johan Bockgård @@ -850,8 +855,8 @@ (read_char_minibuf_menu_prompt, follow_key, read_key_sequence): Use ptrdiff_t, not int, to count maps. (read_char_minibuf_menu_prompt): Check for overflow in size - calculations. Don't update size until allocation succeeds. Redo - calculations to avoid overflow. + calculations. Don't update size until allocation succeeds. + Redo calculations to avoid overflow. * keyboard.h: Change prototypes to match the above. * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int, @@ -1020,7 +1025,7 @@ * indent.c (MULTIBYTE_BYTES_WIDTH): Use sanitize_char_width to avoid undefined and/or bad behavior with outlandish widths. - * character.h (sanitize_tab_width): Renamed from sanitize_width, + * character.h (sanitize_tab_width): Rename from sanitize_width, now that we have two such functions. All uses changed. (sanitize_char_width): New inline function. @@ -1086,8 +1091,8 @@ (png_load, gif_load, svg_load_image): Prefer int to unsigned where either will do. (tiff_handler): New function, combining the cores of the - old tiff_error_handler and tiff_warning_handler. This - function is rewritten to use vsnprintf and thereby avoid + old tiff_error_handler and tiff_warning_handler. + This function is rewritten to use vsnprintf and thereby avoid stack buffer overflows. It uses only the features of vsnprintf that are common to both POSIX and native Microsoft. (tiff_error_handler, tiff_warning_handler): Use it. @@ -1116,8 +1121,8 @@ `(space ...)', and specifies display in the text area, return 2 rather than 1. (try_cursor_movement): Check for the need to scroll more - accurately, and prefer exact match for point under bidi. Don't - advance `row' beyond the last row of the window. + accurately, and prefer exact match for point under bidi. + Don't advance `row' beyond the last row of the window. * dispextern.h (struct bidi_it): Rename the disp_prop_p member into disp_prop; all users changed. === modified file 'src/buffer.c' --- src/buffer.c 2011-09-30 20:22:01 +0000 +++ src/buffer.c 2011-10-07 13:08:47 +0000 @@ -5448,9 +5448,7 @@ This variable is buffer-local but you cannot set it directly; use the function `set-buffer-multibyte' to change a buffer's representation. -Changing its default value with `setq-default' is supported. -See also variable `default-enable-multibyte-characters' and Info node -`(elisp)Text Representations'. */); +See also Info node `(elisp)Text Representations'. */); XSYMBOL (intern_c_string ("enable-multibyte-characters"))->constant = 1; DEFVAR_PER_BUFFER ("buffer-file-coding-system", ------------------------------------------------------------ revno: 106014 committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-10-07 06:19:41 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2011-09-27 10:19:42 +0000 +++ autogen/config.in 2011-10-07 10:19:41 +0000 @@ -1473,9 +1473,6 @@ /* GC_SETJMP_WORKS is nearly always appropriate for GCC. */ # define GC_SETJMP_WORKS 1 # endif -# ifndef GC_LISP_OBJECT_ALIGNMENT -# define GC_LISP_OBJECT_ALIGNMENT (__alignof__ (Lisp_Object)) -# endif #endif #endif /* EMACS_CONFIG_H */ ------------------------------------------------------------ revno: 106013 committer: Paul Eggert branch nick: trunk timestamp: Fri 2011-10-07 00:23:44 -0700 message: Fix alignment-related core dump during GC. * configure.in (GC_LISP_OBJECT_ALIGNMENT): Remove. This is now done by src/alloc.c. * src/alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__ or sizeof. __alignof__ gives the wrong answer on Fedora x86-64 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int; this makes Emacs dump core during garbage collection on rare occasions. sizeof is obviously inferior to offsetof here, so stick with offsetof. (GC_POINTER_ALIGNMENT): New macro. (mark_memory): Omit 3rd (offset) arg; caller changed. Don't assume EMACS_INT alignment is the same as pointer alignment. diff: === modified file 'ChangeLog' --- ChangeLog 2011-10-02 22:43:52 +0000 +++ ChangeLog 2011-10-07 07:23:44 +0000 @@ -1,3 +1,8 @@ +2011-10-07 Paul Eggert + + * configure.in (GC_LISP_OBJECT_ALIGNMENT): Remove. + This is now done by src/alloc.c. + 2011-10-02 Richard Stallman * configure.in: Rename xlinux_first_failure to xgnu_linux_first_failure === modified file 'configure.in' --- configure.in 2011-10-02 22:43:52 +0000 +++ configure.in 2011-10-07 07:23:44 +0000 @@ -3663,9 +3663,6 @@ /* GC_SETJMP_WORKS is nearly always appropriate for GCC. */ # define GC_SETJMP_WORKS 1 # endif -# ifndef GC_LISP_OBJECT_ALIGNMENT -# define GC_LISP_OBJECT_ALIGNMENT (__alignof__ (Lisp_Object)) -# endif #endif #endif /* EMACS_CONFIG_H */ === modified file 'src/ChangeLog' --- src/ChangeLog 2011-10-03 20:50:54 +0000 +++ src/ChangeLog 2011-10-07 07:23:44 +0000 @@ -1,3 +1,15 @@ +2011-10-07 Paul Eggert + + * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__ + or sizeof. __alignof__ gives the wrong answer on Fedora x86-64 + with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int; + this makes Emacs dump core during garbage collection on rare + occasions. sizeof is obviously inferior to offsetof here, so + stick with offsetof. + (GC_POINTER_ALIGNMENT): New macro. + (mark_memory): Omit 3rd (offset) arg; caller changed. + Don't assume EMACS_INT alignment is the same as pointer alignment. + 2011-10-03 Stefan Monnier * keyboard.c (read_key_sequence_remapped): New var. === modified file 'src/alloc.c' --- src/alloc.c 2011-09-30 17:07:40 +0000 +++ src/alloc.c 2011-10-07 07:23:44 +0000 @@ -393,7 +393,7 @@ static int live_float_p (struct mem_node *, void *); static int live_misc_p (struct mem_node *, void *); static void mark_maybe_object (Lisp_Object); -static void mark_memory (void *, void *, int); +static void mark_memory (void *, void *); static void mem_init (void); static struct mem_node *mem_insert (void *, void *, enum mem_type); static void mem_insert_fixup (struct mem_node *); @@ -4235,14 +4235,20 @@ } +#ifndef GC_LISP_OBJECT_ALIGNMENT +# define GC_LISP_OBJECT_ALIGNMENT offsetof (struct {char a; Lisp_Object b;}, b) +#endif +#define GC_POINTER_ALIGNMENT offsetof (struct {char a; void *b;}, b) + /* Mark Lisp objects referenced from the address range START+OFFSET..END or END+OFFSET..START. */ static void -mark_memory (void *start, void *end, int offset) +mark_memory (void *start, void *end) { Lisp_Object *p; void **pp; + int i; #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES nzombies = 0; @@ -4258,8 +4264,9 @@ } /* Mark Lisp_Objects. */ - for (p = (Lisp_Object *) ((char *) start + offset); (void *) p < end; ++p) - mark_maybe_object (*p); + for (p = start; (void *) p < end; p++) + for (i = 0; i < sizeof *p; i += GC_LISP_OBJECT_ALIGNMENT) + mark_maybe_object (*(Lisp_Object *) ((char *) p + i)); /* Mark Lisp data pointed to. This is necessary because, in some situations, the C compiler optimizes Lisp objects away, so that @@ -4279,8 +4286,9 @@ away. The only reference to the life string is through the pointer `s'. */ - for (pp = (void **) ((char *) start + offset); (void *) pp < end; ++pp) - mark_maybe_pointer (*pp); + for (pp = start; (void *) pp < end; pp++) + for (i = 0; i < sizeof *pp; i += GC_POINTER_ALIGNMENT) + mark_maybe_pointer (*(void **) ((char *) pp + i)); } /* setjmp will work with GCC unless NON_SAVING_SETJMP is defined in @@ -4454,15 +4462,11 @@ pass starting at the start of the stack + 2. Likewise, if the minimal alignment of Lisp_Objects on the stack is 1, four passes would be necessary, each one starting with one byte more offset - from the stack start. - - The current code assumes by default that Lisp_Objects are aligned - equally on the stack. */ + from the stack start. */ static void mark_stack (void) { - int i; void *end; #ifdef HAVE___BUILTIN_UNWIND_INIT @@ -4520,15 +4524,8 @@ /* This assumes that the stack is a contiguous region in memory. If that's not the case, something has to be done here to iterate over the stack segments. */ -#ifndef GC_LISP_OBJECT_ALIGNMENT -#ifdef __GNUC__ -#define GC_LISP_OBJECT_ALIGNMENT __alignof__ (Lisp_Object) -#else -#define GC_LISP_OBJECT_ALIGNMENT sizeof (Lisp_Object) -#endif -#endif - for (i = 0; i < sizeof (Lisp_Object); i += GC_LISP_OBJECT_ALIGNMENT) - mark_memory (stack_base, end, i); + mark_memory (stack_base, end); + /* Allow for marking a secondary stack, like the register stack on the ia64. */ #ifdef GC_MARK_SECONDARY_STACK ------------------------------------------------------------ revno: 106012 committer: Glenn Morris branch nick: trunk timestamp: Thu 2011-10-06 22:17:29 -0400 message: * lisp/cus-start.el (debug-on-quit): Fix custom type. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-06 19:15:19 +0000 +++ lisp/ChangeLog 2011-10-07 02:17:29 +0000 @@ -1,3 +1,7 @@ +2011-10-07 Glenn Morris + + * cus-start.el (debug-on-quit): Fix custom type. + 2011-10-06 Lars Magne Ingebrigtsen * subr.el (define-key-after): Clarify that the function is not @@ -7,7 +11,7 @@ 2011-10-06 Thierry Volpiatto - * lisp/eshell/eshell.el (eshell-command): Enable `eshell-mode' only + * eshell/eshell.el (eshell-command): Enable `eshell-mode' only in current minibuffer (Fix bug with recursive minibuffers). 2011-10-06 Chong Yidong === modified file 'lisp/cus-start.el' --- lisp/cus-start.el 2011-08-23 15:53:46 +0000 +++ lisp/cus-start.el 2011-10-07 02:17:29 +0000 @@ -180,12 +180,7 @@ (symbol :format "%v")) (const :tag "always" t))) (debug-ignored-errors debug (repeat (choice symbol regexp))) - (debug-on-quit debug - (choice (const :tag "off") - (repeat :menu-tag "When" - :value (nil) - (symbol :format "%v")) - (const :tag "always" t))) + (debug-on-quit debug boolean) ;; fileio.c (delete-by-moving-to-trash auto-save boolean "23.1") (auto-save-visited-file-name auto-save boolean) ------------------------------------------------------------ revno: 106011 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2011-10-06 22:11:15 +0000 message: Merge changes made in Gnus trunk. gnus.texi (Gnus Utility Functions): Add more references and explanations (bug#9683). ecomplete.el (ecomplete-display-matches): Use a local keymap to handle bindings. gnus-win.el (gnus-configure-windows): Protect against reading ephemeral groups outside of Gnus. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-09-21 22:34:54 +0000 +++ doc/misc/ChangeLog 2011-10-06 22:11:15 +0000 @@ -1,3 +1,8 @@ +2011-10-06 Lars Magne Ingebrigtsen + + * gnus.texi (Gnus Utility Functions): Add more references and + explanations (bug#9683). + 2011-09-21 Lars Magne Ingebrigtsen * gnus.texi (Archived Messages): Note the default (bug#9552). === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2011-09-21 22:34:54 +0000 +++ doc/misc/gnus.texi 2011-10-06 22:11:15 +0000 @@ -29093,7 +29093,7 @@ @item gnus-get-info @findex gnus-get-info -Returns the group info list for @var{group}. +Returns the group info list for @var{group} (@pxref{Group Info}). @item gnus-group-unread @findex gnus-group-unread @@ -29102,7 +29102,8 @@ @item gnus-active @findex gnus-active -The active entry for @var{group}. +The active entry (i.e., a cons cell containing the lowest and highest +article numbers) for @var{group}. @item gnus-set-active @findex gnus-set-active @@ -29137,7 +29138,9 @@ @item gnus-server-equal @findex gnus-server-equal -Says whether two virtual servers are equal. +Says whether two virtual servers are essentially equal. For instance, +two virtual servers may have server parameters in different order, but +this function will consider them equal. @item gnus-group-native-p @findex gnus-group-native-p @@ -29153,8 +29156,9 @@ @item gnus-group-find-parameter @findex gnus-group-find-parameter -Returns the parameter list of @var{group}. If given a second parameter, -returns the value of that parameter for @var{group}. +Returns the parameter list of @var{group} (@pxref{Group Parameters}). +If given a second parameter, returns the value of that parameter for +@var{group}. @item gnus-group-set-parameter @findex gnus-group-set-parameter === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-10-06 09:25:26 +0000 +++ lisp/gnus/ChangeLog 2011-10-06 22:11:15 +0000 @@ -1,3 +1,13 @@ +2011-09-22 Kan-Ru Chen + + * ecomplete.el (ecomplete-display-matches): Use a local keymap to + handle bindings. + +2011-10-06 Lars Magne Ingebrigtsen + + * gnus-win.el (gnus-configure-windows): Protect against reading + ephemeral groups outside of Gnus. + 2011-10-06 Katsumi Yamaoka * shr.el (shr-tag-img): Don't get images displayed in tables. === modified file 'lisp/gnus/ecomplete.el' --- lisp/gnus/ecomplete.el 2011-09-21 22:34:54 +0000 +++ lisp/gnus/ecomplete.el 2011-10-06 22:11:15 +0000 @@ -27,6 +27,11 @@ (eval-when-compile (require 'cl)) +(eval-when-compile + (when (featurep 'xemacs) + ;; The `kbd' macro requires that the `read-kbd-macro' macro is available. + (require 'edmacro))) + (defgroup ecomplete nil "Electric completion of email addresses and the like." :group 'mail) @@ -123,15 +128,24 @@ (message "%s" matches) nil) (setq highlight (ecomplete-highlight-match-line matches line)) - (while (not (memq (setq command (read-event highlight)) '(? return))) - (cond - ((eq command ?\M-n) - (setq line (min (1+ line) max-lines))) - ((eq command ?\M-p) - (setq line (max (1- line) 0)))) - (setq highlight (ecomplete-highlight-match-line matches line))) - (when (eq command 'return) - (nth line (split-string matches "\n"))))))) + (let ((local-map (make-sparse-keymap)) + selected) + (define-key local-map (kbd "RET") + (lambda () (setq selected (nth line (split-string matches "\n"))))) + (define-key local-map (kbd "M-n") + (lambda () (setq line (min (1+ line) max-lines)))) + (define-key local-map (kbd "M-p") + (lambda () (setq line (max (1- line) 0)))) + (let ((overriding-local-map local-map)) + (while (and (null selected) + (setq command (read-key-sequence highlight)) + (lookup-key local-map command)) + (apply (key-binding command) nil) + (setq highlight (ecomplete-highlight-match-line matches line)))) + (if selected + (message selected) + (message "Abort")) + selected))))) (defun ecomplete-highlight-match-line (matches line) (with-temp-buffer === modified file 'lisp/gnus/gnus-win.el' --- lisp/gnus/gnus-win.el 2011-03-15 22:38:41 +0000 +++ lisp/gnus/gnus-win.el 2011-10-06 22:11:15 +0000 @@ -358,8 +358,13 @@ (defvar gnus-frame-split-p nil) (defun gnus-configure-windows (setting &optional force) - (if (window-configuration-p setting) - (set-window-configuration setting) + (cond + ((null setting) + ;; Do nothing. + ) + ((window-configuration-p setting) + (set-window-configuration setting)) + (t (setq gnus-current-window-configuration setting) (setq force (or force gnus-always-force-window-configuration)) (let ((split (if (symbolp setting) @@ -410,7 +415,7 @@ (run-hooks 'gnus-configure-windows-hook) (when gnus-window-frame-focus (gnus-select-frame-set-input-focus - (window-frame gnus-window-frame-focus)))))))) + (window-frame gnus-window-frame-focus))))))))) (defun gnus-delete-windows-in-gnusey-frames () "Do a `delete-other-windows' in all frames that have Gnus windows." ------------------------------------------------------------ revno: 106010 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Thu 2011-10-06 21:15:19 +0200 message: (define-key-after): Clarify that the function is not useful for non-menu keymaps. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-06 16:11:38 +0000 +++ lisp/ChangeLog 2011-10-06 19:15:19 +0000 @@ -1,5 +1,8 @@ 2011-10-06 Lars Magne Ingebrigtsen + * subr.el (define-key-after): Clarify that the function is not + useful for non-menu keymaps. + * progmodes/gdb-mi.el (gdb): Fix typo in doc string. 2011-10-06 Thierry Volpiatto === modified file 'lisp/subr.el' --- lisp/subr.el 2011-10-05 03:37:21 +0000 +++ lisp/subr.el 2011-10-06 19:15:19 +0000 @@ -552,7 +552,8 @@ Bindings are always added before any inherited map. -The order of bindings in a keymap matters when it is used as a menu." +The order of bindings in a keymap only matters when it is used as +a menu, so this function is not useful for non-menu keymaps." (unless after (setq after t)) (or (keymapp keymap) (signal 'wrong-type-argument (list 'keymapp keymap))) ------------------------------------------------------------ revno: 106009 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Thu 2011-10-06 18:11:38 +0200 message: * progmodes/gdb-mi.el (gdb): Fix typo in doc string. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-06 16:06:01 +0000 +++ lisp/ChangeLog 2011-10-06 16:11:38 +0000 @@ -1,6 +1,10 @@ +2011-10-06 Lars Magne Ingebrigtsen + + * progmodes/gdb-mi.el (gdb): Fix typo in doc string. + 2011-10-06 Thierry Volpiatto - * lisp/eshell/eshell.el (eshell-command): Enable `eshell-mode' only + * lisp/eshell/eshell.el (eshell-command): Enable `eshell-mode' only in current minibuffer (Fix bug with recursive minibuffers). 2011-10-06 Chong Yidong === modified file 'lisp/progmodes/gdb-mi.el' --- lisp/progmodes/gdb-mi.el 2011-10-06 14:55:10 +0000 +++ lisp/progmodes/gdb-mi.el 2011-10-06 16:11:38 +0000 @@ -609,7 +609,7 @@ It should be a string consisting of the name of the gdb executable followed by command-line options. The command-line options should include \"-i=mi\" to use gdb's MI text interface. -Note that the old \"--anotate\" option is no longer supported. +Note that the old \"--annotate\" option is no longer supported. If `gdb-many-windows' is nil (the default value) then gdb just pops up the GUD buffer unless `gdb-show-main' is t. In this case ------------------------------------------------------------ revno: 106008 committer: thierry volpiatto + + * lisp/eshell/eshell.el (eshell-command): Enable `eshell-mode' only + in current minibuffer (Fix bug with recursive minibuffers). + 2011-10-06 Chong Yidong * progmodes/gdb-mi.el (gdb): Doc fix. ------------------------------------------------------------ revno: 106007 [merge] committer: thierry volpiatto branch nick: trunk timestamp: Thu 2011-10-06 11:13:45 -0400 message: Document exactly how emacsclient's -a "" starts the daemon. * doc/emacs/misc.texi (emacsclient Options): Document how emacsclient runs the Emacs daemon. * doc/man/emacsclient.1: Document how -a "" starts the daemon. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-10-01 21:54:33 +0000 +++ doc/emacs/ChangeLog 2011-10-06 15:13:45 +0000 @@ -1,3 +1,8 @@ +2011-10-06 Chong Yidong + + * misc.texi (emacsclient Options): Document how emacsclient runs + the Emacs daemon (Bug#9674). + 2011-10-01 Chong Yidong * basic.texi (Moving Point): === modified file 'doc/emacs/misc.texi' --- doc/emacs/misc.texi 2011-08-28 18:49:59 +0000 +++ doc/emacs/misc.texi 2011-10-06 15:13:45 +0000 @@ -1531,8 +1531,8 @@ This is useful when running @code{emacsclient} in a script. As a special exception, if @var{command} is the empty string, then -@code{emacsclient} starts Emacs in daemon mode and then tries -connecting again. +@code{emacsclient} starts Emacs in daemon mode (as @command{emacs +--daemon}) and then tries connecting again. @cindex @env{ALTERNATE_EDITOR} environment variable The environment variable @env{ALTERNATE_EDITOR} has the same effect as === modified file 'doc/man/ChangeLog' --- doc/man/ChangeLog 2011-09-17 18:43:04 +0000 +++ doc/man/ChangeLog 2011-10-06 15:13:45 +0000 @@ -1,3 +1,7 @@ +2011-10-06 Chong Yidong + + * emacsclient.1: Document how -a "" starts the daemon. + 2011-09-17 Sven Joachim * emacs.1: Escape a dash. === modified file 'doc/man/emacsclient.1' --- doc/man/emacsclient.1 2011-07-12 01:38:28 +0000 +++ doc/man/emacsclient.1 2011-10-06 15:13:45 +0000 @@ -52,8 +52,8 @@ .B \-a, \-\-alternate-editor=EDITOR if the Emacs server is not running, run the specified editor instead. This can also be specified via the `ALTERNATE_EDITOR' environment variable. -If the value of EDITOR is the empty string, then Emacs is started in -daemon mode and emacsclient will try to connect to it. +If the value of EDITOR is the empty string, run `emacs --daemon' to +start Emacs in daemon mode, and try to connect to it. .TP .B -c, \-\-create-frame create a new frame instead of trying to use the current Emacs frame ------------------------------------------------------------ revno: 106005 committer: Chong Yidong branch nick: trunk timestamp: Thu 2011-10-06 10:55:10 -0400 message: * lisp/progmodes/gdb-mi.el (gdb): Doc fix. See http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00229.html diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-05 08:59:13 +0000 +++ lisp/ChangeLog 2011-10-06 14:55:10 +0000 @@ -1,3 +1,7 @@ +2011-10-06 Chong Yidong + + * progmodes/gdb-mi.el (gdb): Doc fix. + 2011-10-05 Martin Rudalics * window.el (frame-auto-hide-function): New option replacing === modified file 'lisp/progmodes/gdb-mi.el' --- lisp/progmodes/gdb-mi.el 2011-09-11 18:30:07 +0000 +++ lisp/progmodes/gdb-mi.el 2011-10-06 14:55:10 +0000 @@ -605,6 +605,12 @@ The directory containing FILE becomes the initial working directory and source-file directory for your debugger. +COMMAND-LINE is the shell command for starting the gdb session. +It should be a string consisting of the name of the gdb +executable followed by command-line options. The command-line +options should include \"-i=mi\" to use gdb's MI text interface. +Note that the old \"--anotate\" option is no longer supported. + If `gdb-many-windows' is nil (the default value) then gdb just pops up the GUD buffer unless `gdb-show-main' is t. In this case it starts with two windows: one displaying the GUD buffer and the ------------------------------------------------------------ revno: 106004 committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2011-10-06 09:25:26 +0000 message: shr.el (shr-tag-img): Don't get images displayed in tables. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-10-03 23:27:29 +0000 +++ lisp/gnus/ChangeLog 2011-10-06 09:25:26 +0000 @@ -1,3 +1,7 @@ +2011-10-06 Katsumi Yamaoka + + * shr.el (shr-tag-img): Don't get images displayed in tables. + 2011-10-03 Glenn Morris * gnus-group.el (gnus-bug-group-download-format-alist): Once again get === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2011-10-02 22:03:55 +0000 +++ lisp/gnus/shr.el 2011-10-06 09:25:26 +0000 @@ -914,12 +914,13 @@ (shr-encode-url url) 'shr-image-fetched (list (current-buffer) start (set-marker (make-marker) (1- (point)))) t))) - (put-text-property start (point) 'keymap shr-map) - (put-text-property start (point) 'shr-alt alt) - (put-text-property start (point) 'image-url url) - (put-text-property start (point) 'image-displayer - (shr-image-displayer shr-content-function)) - (put-text-property start (point) 'help-echo alt) + (when (zerop shr-table-depth) ;; We are not in a table. + (put-text-property start (point) 'keymap shr-map) + (put-text-property start (point) 'shr-alt alt) + (put-text-property start (point) 'image-url url) + (put-text-property start (point) 'image-displayer + (shr-image-displayer shr-content-function)) + (put-text-property start (point) 'help-echo alt)) (setq shr-state 'image))))) (defun shr-tag-pre (cont) ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.