Now on revision 106165. Conflicting tags: mh-e-doc-8.3 mh-e-8.3 ------------------------------------------------------------ revno: 106165 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-10-22 18:57:50 +0800 message: * doc/emacs/windows.texi (Displaying Buffers): Fix broken lispref link. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-10-22 01:17:33 +0000 +++ doc/emacs/ChangeLog 2011-10-22 10:57:50 +0000 @@ -1,5 +1,9 @@ 2011-10-22 Chong Yidong + * windows.texi (Displaying Buffers): Fix broken lispref link. + +2011-10-22 Chong Yidong + * mini.texi (Minibuffer Exit): Rename from Strict Completion. Move confirm-nonexistent-file-or-buffer discussion here. === modified file 'doc/emacs/windows.texi' --- doc/emacs/windows.texi 2011-09-24 18:19:20 +0000 +++ doc/emacs/windows.texi 2011-10-22 10:57:50 +0000 @@ -343,8 +343,8 @@ additionally select the displaying window so that you can begin editing its buffer. The command @kbd{C-x `} (@code{next-error}) is one example (@pxref{Compilation Mode}). Such commands work by calling -@code{pop-to-buffer} internally. @xref{Displaying Buffers,,Displaying -Buffers in Windows, elisp, The Emacs Lisp Reference Manual}. +@code{pop-to-buffer} internally. @xref{Switching Buffers,,Switching +to a Buffer in a Window, elisp, The Emacs Lisp Reference Manual}. Commands with names ending in @code{-other-window} behave like @code{display-buffer}, except that they never display in the selected ------------------------------------------------------------ revno: 106164 committer: Alan Mackenzie branch nick: trunk timestamp: Sat 2011-10-22 10:17:25 +0000 message: Fix bug #9560, sporadic wrong indentation; improve instrumentation of c-parse-state. cc-engine.el (c-append-lower-brace-pair-to-state-cache): correct faulty logical expression. (c-parse-state-state, c-record-parse-state-state): (c-replay-parse-state-state): New defvar/defuns. (c-debug-parse-state): Use new functions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-22 09:43:09 +0000 +++ lisp/ChangeLog 2011-10-22 10:17:25 +0000 @@ -1,3 +1,14 @@ +2011-10-22 Alan Mackenzie + + Fix bug #9560, sporadic wrong indentation; improve instrumentation + of c-parse-state. + + * cc-engine.el (c-append-lower-brace-pair-to-state-cache): correct + faulty logical expression. + (c-parse-state-state, c-record-parse-state-state): + (c-replay-parse-state-state): New defvar/defuns. + (c-debug-parse-state): Use new functions. + 2011-10-22 Martin Rudalics * mouse.el (mouse-drag-line): Fix minibuffer resizing broken by === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2011-08-20 22:02:25 +0000 +++ lisp/progmodes/cc-engine.el 2011-10-22 10:17:25 +0000 @@ -2456,7 +2456,7 @@ (<= from (cdr c-state-brace-pair-desert))) ;; Only search what we absolutely need to: (if (and c-state-brace-pair-desert - (> from (cdr c-state-brace-pair-desert))) + (eq cache-pos (car c-state-brace-pair-desert))) (narrow-to-region (cdr c-state-brace-pair-desert) (point-max))) ;; In the next pair of nested loops, the inner one moves back past a @@ -3127,6 +3127,33 @@ (unless (fboundp 'c-real-parse-state) (fset 'c-real-parse-state (symbol-function 'c-parse-state))) (cc-bytecomp-defun c-real-parse-state) + +(defvar c-parse-state-state nil) +(defun c-record-parse-state-state () + (setq c-parse-state-state + (mapcar + (lambda (arg) + (cons arg (symbol-value arg))) + '(c-state-cache + c-state-cache-good-pos + c-state-nonlit-pos-cache + c-state-nonlit-pos-cache-limit + c-state-brace-pair-desert + c-state-point-min + c-state-point-min-lit-type + c-state-point-min-lit-start + c-state-min-scan-pos + c-state-old-cpp-beg + c-state-old-cpp-end)))) +(defun c-replay-parse-state-state () + (message + (concat "(setq " + (mapconcat + (lambda (arg) + (format "%s %s%s" (car arg) (if (atom (cdr arg)) "" "'") (cdr arg))) + c-parse-state-state " ") + ")"))) + (defun c-debug-parse-state () (let ((here (point)) (res1 (c-real-parse-state)) res2) (let ((c-state-cache nil) @@ -3145,15 +3172,21 @@ ;; The cache can actually go further back due to the ad-hoc way ;; the first paren is found, so try to whack off a bit of its ;; start before complaining. - (save-excursion - (goto-char (or (c-least-enclosing-brace res2) (point))) - (c-beginning-of-defun-1) - (while (not (or (bobp) (eq (char-after) ?{))) - (c-beginning-of-defun-1)) - (unless (equal (c-whack-state-before (point) res1) res2) - (message (concat "c-parse-state inconsistency at %s: " - "using cache: %s, from scratch: %s") - here res1 res2)))) + ;; (save-excursion + ;; (goto-char (or (c-least-enclosing-brace res2) (point))) + ;; (c-beginning-of-defun-1) + ;; (while (not (or (bobp) (eq (char-after) ?{))) + ;; (c-beginning-of-defun-1)) + ;; (unless (equal (c-whack-state-before (point) res1) res2) + ;; (message (concat "c-parse-state inconsistency at %s: " + ;; "using cache: %s, from scratch: %s") + ;; here res1 res2))) + (message (concat "c-parse-state inconsistency at %s: " + "using cache: %s, from scratch: %s") + here res1 res2) + (message "Old state:") + (c-replay-parse-state-state)) + (c-record-parse-state-state) res1)) (defun c-toggle-parse-state-debug (&optional arg) ------------------------------------------------------------ revno: 106163 committer: martin rudalics branch nick: trunk timestamp: Sat 2011-10-22 11:43:09 +0200 message: Fix minibuffer resizing. * mouse.el (mouse-drag-line): Fix minibuffer resizing broken by last change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-21 14:48:39 +0000 +++ lisp/ChangeLog 2011-10-22 09:43:09 +0000 @@ -1,3 +1,8 @@ +2011-10-22 Martin Rudalics + + * mouse.el (mouse-drag-line): Fix minibuffer resizing broken by + last fix. + 2011-10-21 Chong Yidong * progmodes/idlwave.el (idlwave-mode): === modified file 'lisp/mouse.el' --- lisp/mouse.el 2011-10-21 09:15:32 +0000 +++ lisp/mouse.el 2011-10-22 09:43:09 +0000 @@ -406,6 +406,7 @@ (mouse-on-link-p start))) (enlarge-minibuffer (and (eq line 'mode) + (not resize-mini-windows) (eq (window-frame minibuffer-window) frame) (not (one-window-p t frame)) (= (nth 1 (window-edges minibuffer-window)) @@ -422,7 +423,8 @@ (setq done t))) ((eq line 'mode) ;; Check whether mode-line can be dragged at all. - (when (window-at-side-p window 'bottom) + (when (and (window-at-side-p window 'bottom) + (not enlarge-minibuffer)) (setq done t))) ((eq line 'vertical) ;; Get the window to adjust for the vertical case. ------------------------------------------------------------ revno: 106162 fixes bug(s): http://debbugs.gnu.org/641 http://debbugs.gnu.org/9794 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-10-22 11:17:01 +0200 message: Fix bugs #641 and #9794 with %Z and current-time-zone on w32. nt/config.nt (HAVE_TZNAME, HAVE_DECL_TZNAME): Define. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2011-09-04 21:52:59 +0000 +++ nt/ChangeLog 2011-10-22 09:17:01 +0000 @@ -1,3 +1,8 @@ +2011-10-19 Eli Zaretskii + + * config.nt (HAVE_TZNAME, HAVE_DECL_TZNAME): Define. + (Bug#9794) (Bug#641) + 2011-09-04 Paul Eggert * config.nt (HAVE_SNPRINTF): New macro. === modified file 'nt/config.nt' --- nt/config.nt 2011-09-26 03:20:03 +0000 +++ nt/config.nt 2011-10-22 09:17:01 +0000 @@ -187,7 +187,14 @@ #undef TM_IN_SYS_TIME #undef HAVE_TM_ZONE -#undef HAVE_TZNAME + +/* Define to 1 if you don't have `tm_zone' but do have the external array + `tzname'. */ +#define HAVE_TZNAME 1 + +/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. + */ +#define HAVE_DECL_TZNAME 1 #undef const ------------------------------------------------------------ revno: 106161 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-10-22 09:17:33 +0800 message: Reorganize confirm-nonexistent-file-or-buffer documentation in Emacs manual. * doc/emacs/buffers.texi (Buffers): Tweak mention of mail buffer name. (Select Buffer): Move confirmation discussion to Minibuffer Exit. * doc/emacs/files.texi (File Names, Visiting): Move detailed discussion of minibuffer confirmation to Minibuffer Exit. * doc/emacs/mini.texi (Minibuffer Exit): Rename from Strict Completion. Move confirm-nonexistent-file-or-buffer discussion here. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-10-21 14:45:34 +0000 +++ doc/emacs/ChangeLog 2011-10-22 01:17:33 +0000 @@ -1,3 +1,14 @@ +2011-10-22 Chong Yidong + + * mini.texi (Minibuffer Exit): Rename from Strict Completion. + Move confirm-nonexistent-file-or-buffer discussion here. + + * files.texi (File Names, Visiting): Move detailed discussion of + minibuffer confirmation to Minibuffer Exit. + + * buffers.texi (Buffers): Tweak mention of mail buffer name. + (Select Buffer): Move confirmation discussion to Minibuffer Exit. + 2011-10-21 Chong Yidong * files.texi (File Names, Visiting, Interlocking): Copyedits. === modified file 'doc/emacs/buffers.texi' --- doc/emacs/buffers.texi 2011-10-21 14:45:34 +0000 +++ doc/emacs/buffers.texi 2011-10-22 01:17:33 +0000 @@ -7,11 +7,11 @@ @cindex buffers The text you are editing in Emacs resides in an object called a -@dfn{buffer}. Each time you visit a file, a buffer is created to hold the -file's text. Each time you invoke Dired, a buffer is created to hold the -directory listing. If you send a message with @kbd{C-x m}, a buffer named -@samp{*mail*} is used to hold the text of the message. When you ask for a -command's documentation, that appears in a buffer called @samp{*Help*}. +@dfn{buffer}. Each time you visit a file, a buffer is used to hold +the file's text. Each time you invoke Dired, a buffer is used to hold +the directory listing. If you send a message with @kbd{C-x m}, a +buffer is used to hold the text of the message. When you ask for a +command's documentation, that appears in a buffer named @samp{*Help*}. Each buffer has a unique name, which can be of any length. When a buffer is displayed in a window, its name is shown in the mode line @@ -19,35 +19,34 @@ matters in buffer names. Most buffers are made by visiting files, and their names are derived from the files' names; however, you can also create an empty buffer with any name you want. A newly started Emacs -has a buffer named @samp{*scratch*}, which is not associated with any -file and can be used for evaluating Lisp expressions in Emacs -(@pxref{Lisp Interaction}). +has several buffers, including one named @samp{*scratch*}, which can +be used for evaluating Lisp expressions and is not associated with any +file (@pxref{Lisp Interaction}). @cindex selected buffer @cindex current buffer - At any time, one and only one buffer is @dfn{current}. This is also -called the @dfn{selected buffer}. We often say that a command -operates on ``the buffer''; this really means that the command -operates on the current buffer (most commands do). When there is only -one Emacs window, the buffer displayed in that window is current. -When there are multiple windows present, the buffer displayed in the -@dfn{selected window} is current. @xref{Windows}. + At any time, one and only one buffer is @dfn{selected}; we call it +the @dfn{current buffer}. We sometimes say that a command operates on +``the buffer''; this really means that it operates on the current +buffer. When there is only one Emacs window, the buffer displayed in +that window is current. When there are multiple windows, the buffer +displayed in the @dfn{selected window} is current. @xref{Windows}. - Each buffer records individually what file it is visiting (if any), -whether it is modified, and what major mode and minor modes are in -effect (@pxref{Major Modes}). Any Emacs variable can be made -@dfn{local to} a particular buffer, meaning its value in that buffer -can be different from the value in other buffers. @xref{Locals}. + Aside from its textual contents, each buffer records several pieces +of information, such as what file it is visiting (if any), whether it +is modified, and what major mode and minor modes are in effect +(@pxref{Modes}). These are stored in @dfn{buffer-local +variables}---variables that can have a different value in each buffer. +@xref{Locals}. @cindex buffer size, maximum A buffer's size cannot be larger than some maximum, which is defined -by the largest buffer position representable by the @dfn{Emacs -integer} data type. This is because Emacs tracks buffer positions -using that data type. For typical 64-bit machines, the maximum buffer size -enforced by the data types is @math{2^61 - 2} bytes, or about 2 EiB. -For typical 32-bit machines, the maximum is @math{2^29 - 2} bytes, or -about 512 MiB. Buffer sizes are also limited by the size of Emacs's -virtual memory. +by the largest buffer position representable by @dfn{Emacs integers}. +This is because Emacs tracks buffer positions using that data type. +For typical 64-bit machines, this maximum buffer size is @math{2^61 - +2} bytes, or about 2 EiB. For typical 32-bit machines, the maximum is +usually @math{2^29 - 2} bytes, or about 512 MiB. Buffer sizes are +also limited by the amount of memory present in the system. @menu * Select Buffer:: Creating a new buffer or reselecting an old one. @@ -76,9 +75,9 @@ Similar, but select @var{buffer} in a separate frame (@code{switch-to-buffer-other-frame}). @item C-x @key{LEFT} -Select the previous buffer in the list of existing buffers. +Select the previous buffer in the buffer list (@code{previous-buffer}). @item C-x @key{RIGHT} -Select the next buffer in the list of existing buffers. +Select the next buffer in the buffer list (@code{next-buffer}). @item C-u M-g M-g @itemx C-u M-g g Read a number @var{n} and move to line @var{n} in the most recently @@ -87,28 +86,21 @@ @kindex C-x b @findex switch-to-buffer - To select the buffer named @var{bufname}, type @kbd{C-x b -@var{bufname} @key{RET}}. This runs the command -@code{switch-to-buffer} with argument @var{bufname}. While entering -the buffer name, you can use the usual minibuffer completion and -history commands (@pxref{Minibuffer}). An empty input specifies the -buffer that was current most recently among those not now displayed in -any window. + The @kbd{C-x b} (@code{switch-to-buffer}) command reads a buffer +name using the minibuffer. Then it makes that buffer current, and +displays it in the currently-selected window. An empty input +specifies the buffer that was current most recently among those not +now displayed in any window. If you specify a buffer that does not +exist, @kbd{C-x b} creates a new, empty buffer that is not visiting +any file, and selects it for editing. -@cindex minibuffer confirmation -@cindex confirming in the minibuffer - If you specify a buffer that does not exist, @kbd{C-x b} creates a -new, empty buffer that is not visiting any file, and selects it for -editing. First, however, Emacs might prompt you for confirmation, in -case you entered the wrong buffer name. Emacs asks for confirmation -only if the last key you typed, before submitting the minibuffer input -with @key{RET}, was @key{TAB} (@code{minibuffer-complete}). This -catches a common mistake, in which one types @key{RET} before -realizing that @key{TAB} did not complete far enough to yield the -desired buffer name (@pxref{Completion}). Emacs asks for confirmation -by putting the message @samp{[Confirm]} in the minibuffer; type -@key{RET} again to confirm and visit the buffer. @xref{Visiting}, for -information about modifying this behavior. + While entering the buffer name, you can use the usual completion and +history commands (@pxref{Minibuffer}). Note that @kbd{C-x b}, and +related commands, use ``permissive completion with confirmation'' for +minibuffer completion: if you type @key{RET} immediately after +completing up to a nonexistent buffer name, Emacs prints +@samp{[Confirm]} and you must type a second @key{RET} to submit that +buffer name. @xref{Completion Exit}, for details. One reason to create a new buffer is to use it for making temporary notes. If you try to save it, Emacs asks for the file name to use. === modified file 'doc/emacs/calendar.texi' --- doc/emacs/calendar.texi 2011-08-25 16:30:46 +0000 +++ doc/emacs/calendar.texi 2011-10-22 01:17:33 +0000 @@ -893,11 +893,12 @@ (@code{calendar-ethiopic-goto-date}). @end table - These commands ask you for a date on the other calendar, move point to -the Gregorian calendar date equivalent to that date, and display the -other calendar's date in the echo area. Emacs uses strict completion -(@pxref{Strict Completion}) whenever it asks you to type a month name, so you -don't have to worry about the spelling of Hebrew, Islamic, or French names. + These commands ask you for a date on the other calendar, move point +to the Gregorian calendar date equivalent to that date, and display +the other calendar's date in the echo area. Emacs uses strict +completion (@pxref{Completion Exit}) whenever it asks you to type a +month name, so you don't have to worry about the spelling of Hebrew, +Islamic, or French names. @c FIXME move? @findex calendar-hebrew-list-yahrzeits @@ -993,7 +994,7 @@ next occurrence of a combination. These commands signal an error if the haab/tzolkin date combination you have typed is impossible. - Emacs uses strict completion (@pxref{Strict Completion}) whenever it + Emacs uses strict completion (@pxref{Completion Exit}) whenever it asks you to type a Mayan name, so you don't have to worry about spelling. === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2011-10-18 21:11:17 +0000 +++ doc/emacs/emacs.texi 2011-10-22 01:17:33 +0000 @@ -281,7 +281,7 @@ * Completion Example:: Examples of using completion. * Completion Commands:: A list of completion commands. -* Strict Completion:: Different types of completion. +* Completion Exit:: Completion and minibuffer text submission. * Completion Styles:: How completion matches are chosen. * Completion Options:: Options for completion. === modified file 'doc/emacs/files.texi' --- doc/emacs/files.texi 2011-10-21 14:45:34 +0000 +++ doc/emacs/files.texi 2011-10-22 01:17:33 +0000 @@ -49,11 +49,18 @@ @cindex default file name Many Emacs commands that operate on a file require you to specify -the file name, using the minibuffer (@pxref{Minibuffer File}). You -can use @dfn{completion} to specify long file names -(@pxref{Completion}); note that file name completion ignores file -names whose extensions appear in the variable +the file name, using the minibuffer (@pxref{Minibuffer File}). + + While in the minibuffer, you can use the usual completion and +history commands (@pxref{Minibuffer}). Note that file name completion +ignores file names whose extensions appear in the variable @code{completion-ignored-extensions} (@pxref{Completion Options}). +Note also that most commands use ``permissive completion with +confirmation'' for reading file names: you are allowed to submit a +nonexistent file name, but if you type @key{RET} immediately after +completing up to a nonexistent file name, Emacs prints +@samp{[Confirm]} and you must type a second @key{RET} to confirm. +@xref{Completion Exit}, for details. @cindex default directory @vindex default-directory @@ -152,9 +159,9 @@ @kindex C-x C-f @findex find-file To visit a file, type @kbd{C-x C-f} (@code{find-file}) and use the -minibuffer to enter the name of the desired file (@pxref{File Names}). -While in the minibuffer, you can abort the command by typing -@kbd{C-g}. +minibuffer to enter the name of the desired file. While in the +minibuffer, you can abort the command by typing @kbd{C-g}. @xref{File +Names}, for details about entering file names into minibuffers. If the specified file exists but the system does not allow you to read it, an error message is displayed in the echo area. Otherwise, @@ -213,25 +220,6 @@ actually contains wildcard characters. You can disable the wildcard feature by customizing @code{find-file-wildcards}. -@cindex minibuffer confirmation -@cindex confirming in the minibuffer -@vindex confirm-nonexistent-file-or-buffer - When @key{TAB} completion results in a nonexistent file name and you -type @key{RET} immediately to visit it, Emacs asks for confirmation; -this is because it's possible that you expected completion to go -further and give you an existing file's name. The string -@samp{[Confirm]} appears for a short time after the file name to -indicate the need to confirm in this way. Type @key{RET} to confirm -and visit the nonexistent file. The variable -@code{confirm-nonexistent-file-or-buffer} controls whether Emacs asks -for confirmation before visiting a new file. The default value, -@code{after-completion}, gives the behavior we have just described. -If the value is @code{nil}, Emacs never asks for confirmation; for any -other non-@code{nil} value, Emacs always asks for confirmation. This -variable also affects the @code{switch-to-buffer} command -(@pxref{Select Buffer}). @xref{Completion}, for more information -about completion. - @kindex C-x C-v @findex find-alternate-file If you visit the wrong file unintentionally by typing its name @@ -382,10 +370,10 @@ @end example @noindent -If the selected buffer is not modified (no changes have been made in it -since the buffer was created or last saved), saving is not really done, -because it would have no effect. Instead, @kbd{C-x C-s} displays a message -like this in the echo area: +If the current buffer is not modified (no changes have been made in it +since the buffer was created or last saved), saving is not really +done, because it would have no effect. Instead, @kbd{C-x C-s} +displays a message like this in the echo area: @example (No changes need to be saved) === modified file 'doc/emacs/mini.texi' --- doc/emacs/mini.texi 2011-10-09 21:00:42 +0000 +++ doc/emacs/mini.texi 2011-10-22 01:17:33 +0000 @@ -219,11 +219,11 @@ 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. +* Completion Example:: Examples of using completion. +* Completion Commands:: A list of completion commands. +* Completion Exit:: Completion and minibuffer text submission. +* Completion Styles:: How completion matches are chosen. +* Completion Options:: Options for completion. @end menu @node Completion Example @@ -274,7 +274,7 @@ arguments that often include spaces, such as file names. @item @key{RET} Submit the text in the minibuffer as the argument, possibly completing -first (@code{minibuffer-complete-and-exit}). @xref{Strict Completion}. +first (@code{minibuffer-complete-and-exit}). @xref{Completion Exit}. @item ? Display a list of completions (@code{minibuffer-completion-help}). @end table @@ -337,43 +337,69 @@ completion alternative (@code{previous-completion}). @end table -@node Strict Completion -@subsection Strict Completion +@node Completion Exit +@subsection Completion Exit - 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. +@kindex RET @r{(completion in minibuffer)} +@findex minibuffer-complete-and-exit + When a command reads an argument using the minibuffer with +completion, it also controls what happens when you type @key{RET} +(@code{minibuffer-complete-and-exit}) to submit the argument. There +are four types of behavior: @itemize @bullet @item -@dfn{Strict} completion accepts only known completion candidates. For -example, when @kbd{C-x k} reads the name of a buffer to kill, only the -name of an existing buffer makes sense. In strict completion, -@key{RET} refuses to exit if the text in the minibuffer does not -complete to an exact match. +@dfn{Strict completion} accepts only exact completion matches. Typing +@key{RET} exits the minibuffer only if the minibuffer text is an exact +match, or completes to one. Otherwise, Emacs refuses to exit the +minibuffer; instead it tries to complete, and if no completion can be +done it momentarily displays @samp{[No match]} after the minibuffer +text. (You can still leave the minibuffer by typing @kbd{C-g} to +cancel the command.) + +An example of a command that uses this behavior is @kbd{M-x}, since it +is meaningless for it to accept a non-existent command name. @item -@dfn{Cautious} completion is similar to strict completion, except that -@key{RET} exits only if the text is an already exact match. -Otherwise, @key{RET} does not exit, but it does complete the text. If -that completes to an exact match, a second @key{RET} will exit. +@dfn{Cautious completion} is like strict completion, except @key{RET} +exits only if the text is already an exact match. If the text +completes to an exact match, @key{RET} performs that completion but +does not exit yet; you must type a second @key{RET} to exit. Cautious completion is used for reading file names for files that must already exist, for example. @item -@dfn{Permissive} completion allows any input; the completion -candidates are just suggestions. For example, when @kbd{C-x C-f} -reads the name of a file to visit, any file name is allowed, including -nonexistent file (in case you want to create a file). In permissive -completion, @key{RET} does not complete, it just submits the argument -as you have entered it. +@dfn{Permissive completion} allows any input; the completion +candidates are just suggestions. Typing @key{RET} does not complete, +it just submits the argument as you have entered it. + +@cindex minibuffer confirmation +@cindex confirming in the minibuffer +@item +@dfn{Permissive completion with confirmation} is like permissive +completion, with an exception: if you typed @key{TAB} and this +completed the text up to some intermediate state (i.e. one that is not +yet an exact completion match), typing @key{RET} right afterward does +not submit the argument. Instead, Emacs asks for confirmation by +momentarily displaying @samp{[Confirm]} after the text; type @key{RET} +again to confirm and submit the text. This catches a common mistake, +in which one types @key{RET} before realizing that @key{TAB} did not +complete as far as desired. + +@vindex confirm-nonexistent-file-or-buffer +You can tweak the confirmation behavior by customizing the variable +@code{confirm-nonexistent-file-or-buffer}. The default value, +@code{after-completion}, gives the behavior we have just described. +If you change it to @code{nil}, Emacs does not ask for confirmation, +falling back on permissive completion. If you change it to any other +non-@code{nil} value, Emacs asks for confirmation whether or not the +preceding command was @key{TAB}. + +This behavior is used by most commands that read file names, like +@kbd{C-x C-f}, and commands that read buffer names, like @kbd{C-x b}. @end itemize - 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 ------------------------------------------------------------ revno: 106160 committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-10-21 22:48:39 +0800 message: Fix for revision 106155. * lisp/progmodes/idlwave.el (idlwave-mode): * lisp/progmodes/vera-mode.el (vera-mode): No need to set require-final-newline; that's done in prog-mode. Suggested by Stefan Monnier. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-21 09:15:32 +0000 +++ lisp/ChangeLog 2011-10-21 14:48:39 +0000 @@ -1,3 +1,10 @@ +2011-10-21 Chong Yidong + + * progmodes/idlwave.el (idlwave-mode): + * progmodes/vera-mode.el (vera-mode): No need to set + require-final-newline; that's done in prog-mode. Suggested by + Stefan Monnier. + 2011-10-21 Martin Rudalics * mouse.el (mouse-drag-window-above) === modified file 'lisp/progmodes/idlwave.el' --- lisp/progmodes/idlwave.el 2011-10-21 02:23:59 +0000 +++ lisp/progmodes/idlwave.el 2011-10-21 14:48:39 +0000 @@ -1907,8 +1907,6 @@ (set (make-local-variable 'comment-start-skip) ";+[ \t]*") (set (make-local-variable 'comment-start) ";") (set (make-local-variable 'comment-add) 1) ; ";;" for new and regions - (set (make-local-variable 'require-final-newline) - mode-require-final-newline) (set (make-local-variable 'abbrev-all-caps) t) (set (make-local-variable 'indent-tabs-mode) nil) (set (make-local-variable 'completion-ignore-case) t) === modified file 'lisp/progmodes/vera-mode.el' --- lisp/progmodes/vera-mode.el 2011-10-21 02:23:59 +0000 +++ lisp/progmodes/vera-mode.el 2011-10-21 14:48:39 +0000 @@ -310,8 +310,6 @@ (set (make-local-variable 'comment-indent-function) 'c-comment-indent) (set (make-local-variable 'paragraph-start) "^$") (set (make-local-variable 'paragraph-separate) paragraph-start) - (set (make-local-variable 'require-final-newline) - mode-require-final-newline) (set (make-local-variable 'indent-tabs-mode) nil) (set (make-local-variable 'indent-line-function) 'vera-indent-line) (set (make-local-variable 'parse-sexp-ignore-comments) t) ------------------------------------------------------------ revno: 106159 committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-10-21 22:45:34 +0800 message: Update Files chapter of Emacs manual. Plus miscellaneous minor speling fixes in other manual files. * doc/emacs/files.texi (File Names, Visiting, Interlocking): Copyedits. (Backup Copying): backup-by-copying-when-mismatch is now t. (Customize Save): Fix description of require-final-newline. (Reverting): Note that revert-buffer can't be undone. Mention VC. (Auto Save Control): Clarify. (File Archives): Add 7z. (Remote Files): ange-ftp-make-backup-files defaults to nil. * doc/emacs/arevert-xtra.texi (Autorevert): Copyedits. diff: === modified file 'admin/FOR-RELEASE' --- admin/FOR-RELEASE 2011-10-19 04:21:52 +0000 +++ admin/FOR-RELEASE 2011-10-21 14:45:34 +0000 @@ -151,7 +151,7 @@ abbrevs.texi ack.texi anti.texi -arevert-xtra.texi +arevert-xtra.texi cyd basic.texi cyd buffers.texi building.texi @@ -167,7 +167,7 @@ emacs-xtra.texi emerge-xtra.texi entering.texi cyd -files.texi +files.texi cyd fixit.texi fortran-xtra.texi frames.texi @@ -175,7 +175,7 @@ help.texi cyd indent.texi killing.texi cyd -kmacro.texi +kmacro.texi cyd macos.texi maintaining.texi major.texi === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-10-20 00:41:15 +0000 +++ doc/emacs/ChangeLog 2011-10-21 14:45:34 +0000 @@ -1,3 +1,15 @@ +2011-10-21 Chong Yidong + + * files.texi (File Names, Visiting, Interlocking): Copyedits. + (Backup Copying): backup-by-copying-when-mismatch is now t. + (Customize Save): Fix description of require-final-newline. + (Reverting): Note that revert-buffer can't be undone. Mention VC. + (Auto Save Control): Clarify. + (File Archives): Add 7z. + (Remote Files): ange-ftp-make-backup-files defaults to nil. + + * arevert-xtra.texi (Autorevert): Copyedits. + 2011-10-20 Chong Yidong * custom.texi (Hooks, Init Examples): === modified file 'doc/emacs/arevert-xtra.texi' --- doc/emacs/arevert-xtra.texi 2011-01-26 08:36:39 +0000 +++ doc/emacs/arevert-xtra.texi 2011-10-21 14:45:34 +0000 @@ -8,11 +8,11 @@ @section Auto Reverting Non-File Buffers Global Auto Revert Mode normally only reverts file buffers. There are -two ways to auto-revert certain non-file buffers: enabling Auto Revert -Mode in those buffers (using @kbd{M-x auto-revert-mode}); and setting -@code{global-auto-revert-non-file-buffers} non-@code{nil}. The latter -enables Auto Reverting for all types of buffers for which it is -implemented (listed in the menu below). +two ways to auto-revert certain non-file buffers: by enabling Auto +Revert Mode in those buffers (using @kbd{M-x auto-revert-mode}); and +by setting @code{global-auto-revert-non-file-buffers} to a +non-@code{nil} value. The latter enables Auto Reverting for all types +of buffers for which it is implemented (listed in the menu below). Like file buffers, non-file buffers should normally not revert while you are working on them, or while they contain information that might === modified file 'doc/emacs/basic.texi' --- doc/emacs/basic.texi 2011-10-18 01:42:28 +0000 +++ doc/emacs/basic.texi 2011-10-21 14:45:34 +0000 @@ -367,7 +367,7 @@ 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 + On most keyboards, @key{DEL} is labeled @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 === modified file 'doc/emacs/buffers.texi' --- doc/emacs/buffers.texi 2011-09-24 18:19:20 +0000 +++ doc/emacs/buffers.texi 2011-10-21 14:45:34 +0000 @@ -245,7 +245,7 @@ non-@code{nil}. If you have files under version control, you may find it convenient to bind @kbd{C-x C-q} to @code{vc-toggle-read-only} instead. This will guard you against an operation that will confuse -most modern version-conmtrol systems. @xref{Version Control}. +most modern version-control systems. @xref{Version Control}. @findex rename-buffer @kbd{M-x rename-buffer} changes the name of the current buffer. You === modified file 'doc/emacs/commands.texi' --- doc/emacs/commands.texi 2011-10-07 16:22:04 +0000 +++ doc/emacs/commands.texi 2011-10-21 14:45:34 +0000 @@ -46,7 +46,7 @@ @cindex M- Emacs also recognizes control characters that are entered using @dfn{modifier keys}. Two commonly-used modifier keys are -@key{Control} (usually labelled @key{Ctrl}), and @key{Meta} (usually +@key{Control} (usually labeled @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 === modified file 'doc/emacs/display.texi' --- doc/emacs/display.texi 2011-10-20 00:41:15 +0000 +++ doc/emacs/display.texi 2011-10-21 14:45:34 +0000 @@ -1415,7 +1415,7 @@ The variable @code{echo-keystrokes} controls the echoing of multi-character keys; its value is the number of seconds of pause required to cause echoing to start, or zero, meaning don't echo at all. The value takes effect when -there is someting to echo. @xref{Echo Area}. +there is something to echo. @xref{Echo Area}. @cindex mouse pointer @cindex hourglass pointer display === modified file 'doc/emacs/files.texi' --- doc/emacs/files.texi 2011-10-08 15:08:50 +0000 +++ doc/emacs/files.texi 2011-10-21 14:45:34 +0000 @@ -47,58 +47,51 @@ @section File Names @cindex file names +@cindex default file name Many Emacs commands that operate on a file require you to specify -the file name, using the minibuffer (@pxref{Minibuffer}). You can use -@dfn{completion} to specify long file names (@pxref{Completion}). -Note that file name completion ignores file names whose extensions -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. +the file name, using the minibuffer (@pxref{Minibuffer File}). You +can use @dfn{completion} to specify long file names +(@pxref{Completion}); note that file name completion ignores file +names whose extensions appear in the variable +@code{completion-ignored-extensions} (@pxref{Completion Options}). @cindex default directory @vindex default-directory @vindex insert-default-directory - Each buffer has a @dfn{default directory} which is normally the same -as the directory of the file visited in that buffer. For example, if -the default file name is @file{/u/rms/gnu/gnu.tasks}, the default -directory is normally @file{/u/rms/gnu/}. The default directory is -kept in the variable @code{default-directory}, which has a separate -value in every buffer. When a command reads a file name using the -minibuffer, the default directory usually serves as the initial -contents of the minibuffer. To inhibit the insertion of the default -directory, set the variable @code{insert-default-directory} to -@code{nil}. - - If you enter a file name without a directory, that specifies a file -in the default directory. If you specify a directory in a relative -fashion, with a name that does not start with a slash, it is -interpreted with respect to the default directory. For example, -suppose the default directory is @file{/u/rms/gnu/}. Entering just -@samp{foo} in the minibuffer, with a directory omitted, specifies the -file @file{/u/rms/gnu/foo}; entering @samp{../.login} specifies + Each buffer has a @dfn{default directory}, stored in the +buffer-local variable @code{default-directory}. Whenever Emacs reads +a file name using the minibuffer, it usually inserts the default +directory into the minibuffer as the initial contents. You can +inhibit this insertion by changing the variable +@code{insert-default-directory} to @code{nil} (@pxref{Minibuffer +File}). Regardless, Emacs always assumes that any relative file name +is relative to the default directory, e.g. entering a file name +without a directory specifies a file in the default directory. + +@findex cd +@findex pwd + When you visit a file, Emacs sets @code{default-directory} in the +visiting buffer to the directory of its file. When you create a new +buffer that is not visiting a file, via a command like @kbd{C-x b}, +its default directory is usually copied from the buffer that was +current at the time (@pxref{Select Buffer}). You can use the command +@kbd{M-x pwd} to see the value of @code{default-directory} in the +current buffer. The command @kbd{M-x cd} prompts for a directory +name, and sets the buffer's @code{default-directory} to that directory +(doing this does not change the buffer's file name, if any). + + As an example, when you visit the file @file{/u/rms/gnu/gnu.tasks}, +the default directory is set to @file{/u/rms/gnu/}. If you invoke a +command that reads a file name, entering just @samp{foo} in the +minibuffer, with a directory omitted, specifies the file +@file{/u/rms/gnu/foo}; entering @samp{../.login} specifies @file{/u/rms/.login}; and entering @samp{new/foo} specifies @file{/u/rms/gnu/new/foo}. When typing a file name into the minibuffer, you can make use of a couple of shortcuts: a double slash is interpreted as ``ignore everything before the second slash in the pair,'' and @samp{~/} is -interpreted as your home directory. @xref{Minibuffer File}, for more -information about these shortcuts. - -@findex cd -@findex pwd - The command @kbd{M-x pwd} displays the default directory, and the -command @kbd{M-x cd} sets it to a value read using the minibuffer. A -buffer's default directory changes only when the @code{cd} command is -used. A file-visiting buffer's default directory is initialized to -the directory of the file it visits. If you create a buffer with -@kbd{C-x b}, its default directory is copied from that of the buffer -that was current at the time (@pxref{Select Buffer}). +interpreted as your home directory. @xref{Minibuffer File}. @cindex environment variables in file names @cindex expansion of environment variables @@ -113,10 +106,8 @@ @file{/u/$@{FOO@}/test.c} are abbreviations for @file{/u/rms/hacks/test.c}. If the environment variable is not defined, no substitution occurs, so that the character @samp{$} stands -for itself. - - Note that environment variables affect Emacs only if they are -applied before Emacs is started. +for itself. Note that environment variables affect Emacs only if they +are applied before Emacs is started. To access a file with @samp{$} in its name, if the @samp{$} causes expansion, type @samp{$$}. This pair is converted to a single @@ -125,8 +116,7 @@ @samp{/:} (@pxref{Quoted File Names}). File names which begin with a literal @samp{~} should also be quoted with @samp{/:}. - You can include non-@acronym{ASCII} characters in file names if you set the -variable @code{file-name-coding-system} to a non-@code{nil} value. + You can include non-@acronym{ASCII} characters in file names. @xref{File Name Coding}. @node Visiting @@ -159,48 +149,43 @@ buffer so you can edit them. Emacs makes a new buffer for each file that you visit. - Emacs normally constructs the buffer name from the file name, -omitting the directory name. For example, a file named -@file{/usr/rms/emacs.tex} is visited in a buffer named -@samp{emacs.tex}. If there is already a buffer with that name, Emacs -constructs a unique name; the normal method is to append @samp{<2>}, -@samp{<3>}, and so on, but you can select other methods. -@xref{Uniquify}. - - Each window's mode line shows the name of the buffer that is being -displayed in that window, so you can always tell what buffer you are -editing. @pxref{Mode Line}. - - The changes you make with editing commands are made in the Emacs -buffer. They do not take effect in the file that you visited, or any -permanent place, until you @dfn{save} the buffer (@pxref{Saving}). - -@cindex modified (buffer) - If a buffer contains changes that have not been saved, we say the -buffer is @dfn{modified}. This implies that some changes will be lost -if the buffer is not saved. The mode line displays two stars near the -left margin to indicate that the buffer is modified. - @kindex C-x C-f @findex find-file To visit a file, type @kbd{C-x C-f} (@code{find-file}) and use the -minibuffer to enter the name of the desired file. The usual -defaulting and completion behavior is available in this minibuffer -(@pxref{Minibuffer File}). Note, also, that completion ignores -certain file names (@pxref{Completion Options}). While in the -minibuffer, you can abort @kbd{C-x C-f} by typing @kbd{C-g}. - - Your can tell that @kbd{C-x C-f} has completed successfully by the -appearance of new text on the screen and a new buffer name in the mode -line. If the specified file does not exist and you could not create -it, or exists but you can't read it, an error message is displayed in -the echo area. - - If you visit a file that is already in Emacs, @kbd{C-x C-f} does not make -another copy. It selects the existing buffer containing that file. -However, before doing so, it checks whether the file itself has changed -since you visited or saved it last. If the file has changed, Emacs offers -to reread it. +minibuffer to enter the name of the desired file (@pxref{File Names}). +While in the minibuffer, you can abort the command by typing +@kbd{C-g}. + + If the specified file exists but the system does not allow you to +read it, an error message is displayed in the echo area. Otherwise, +you can tell that @kbd{C-x C-f} has completed successfully by the +appearance of new text on the screen, and by the buffer name shown in +the mode line (@pxref{Mode Line}). Emacs normally constructs the +buffer name from the file name, omitting the directory name. For +example, a file named @file{/usr/rms/emacs.tex} is visited in a buffer +named @samp{emacs.tex}. If there is already a buffer with that name, +Emacs constructs a unique name; the normal method is to append +@samp{<2>}, @samp{<3>}, and so on, but you can select other methods. +@xref{Uniquify}. + +@cindex creating files + To create a new file, just visit it using the same command, @kbd{C-x +C-f}. Emacs displays @samp{(New file)} in the echo area, but in other +respects behaves as if you had visited an existing empty file. + +@cindex modified (buffer) + After visiting a file, the changes you make with editing commands are +made in the Emacs buffer. They do not take effect in the visited +file, until you @dfn{save} the buffer (@pxref{Saving}). If a buffer +contains changes that have not been saved, we say the buffer is +@dfn{modified}. This implies that some changes will be lost if the +buffer is not saved. The mode line displays two stars near the left +margin to indicate that the buffer is modified. + + If you visit a file that is already in Emacs, @kbd{C-x C-f} switches +to the existing buffer instead of making another copy. Before doing +so, it checks whether the file has changed since you last visited or +saved it. If the file has changed, Emacs offers to reread it. @vindex large-file-warning-threshold @cindex file, warning when size is large @@ -211,10 +196,10 @@ about 10 megabytes), Emacs asks you for confirmation first. You can answer @kbd{y} to proceed with visiting the file. Note, however, that Emacs cannot visit files that are larger than the maximum Emacs buffer -size, which is limited by the amount of memory Emacs can allocate -and by the integers that Emacs can represent -(@pxref{Buffers}). If you try, Emacs will display an error message -saying that the maximum buffer size has been exceeded. +size, which is limited by the amount of memory Emacs can allocate and +by the integers that Emacs can represent (@pxref{Buffers}). If you +try, Emacs displays an error message saying that the maximum buffer +size has been exceeded. @cindex wildcard characters in file names @vindex find-file-wildcards @@ -228,28 +213,6 @@ actually contains wildcard characters. You can disable the wildcard feature by customizing @code{find-file-wildcards}. -@cindex file selection dialog - On graphical displays, there are two additional methods for visiting -files. Firstly, when Emacs is built with a suitable GUI toolkit, -commands invoked with the mouse (by clicking on the menu bar or tool -bar) use the toolkit's standard ``File Selection'' dialog instead of -prompting for the file name in the minibuffer. On GNU/Linux and Unix -platforms, Emacs does this when built with GTK, LessTif, and Motif -toolkits; on MS-Windows and Mac, the GUI version does that by default. -For information on how to customize this, see @ref{Dialog Boxes}. - - Secondly, Emacs supports ``drag and drop'': dropping a file into an -ordinary Emacs window visits the file using that window. As an -exception, dropping a file into a window displaying a Dired buffer -moves or copies the file into the displayed directory. For details, -see @ref{Drag and Drop}, and @ref{Misc Dired Features}. - -@cindex creating files - What if you want to create a new file? Just visit it. Emacs -displays @samp{(New file)} in the echo area, but in other respects -behaves as if you had visited an existing empty file. If you make -changes and save them, the file is created. - @cindex minibuffer confirmation @cindex confirming in the minibuffer @vindex confirm-nonexistent-file-or-buffer @@ -271,20 +234,19 @@ @kindex C-x C-v @findex find-alternate-file - If you visit a nonexistent file unintentionally (because you typed -the wrong file name), type @kbd{C-x C-v} (@code{find-alternate-file}) -to visit the file you really wanted. @kbd{C-x C-v} is similar to -@kbd{C-x C-f}, but it kills the current buffer (after first offering -to save it if it is modified). When @kbd{C-x C-v} reads the file name -to visit, it inserts the entire default file name in the buffer, with -point just after the directory part; this is convenient if you made a -slight error in typing the name. + If you visit the wrong file unintentionally by typing its name +incorrectly, type @kbd{C-x C-v} (@code{find-alternate-file}) to visit +the file you really wanted. @kbd{C-x C-v} is similar to @kbd{C-x +C-f}, but it kills the current buffer (after first offering to save it +if it is modified). When @kbd{C-x C-v} reads the file name to visit, +it inserts the entire default file name in the buffer, with point just +after the directory part; this is convenient if you made a slight +error in typing the name. @vindex find-file-run-dired If you ``visit'' a file that is actually a directory, Emacs invokes -Dired, the Emacs directory browser; this lets you ``edit'' the -contents of the directory. @xref{Dired}. You can disable this -behavior by setting the variable @code{find-file-run-dired} to +Dired, the Emacs directory browser. @xref{Dired}. You can disable +this behavior by setting the variable @code{find-file-run-dired} to @code{nil}; in that case, it is an error to try to visit a directory. Files which are actually collections of other files, or @dfn{file @@ -321,17 +283,28 @@ seek. This feature is available only when you are using a window system. @xref{Frames}. - Emacs recognizes from the contents of a file which end-of-line -convention it uses to separate lines---newline (used on GNU/Linux and -on Unix), carriage-return linefeed (used on Microsoft systems), or -just carriage-return (used on the Macintosh)---and automatically -converts the contents to the normal Emacs convention, which is that -the newline character separates lines. This is a part of the general -feature of coding system conversion (@pxref{Coding Systems}), and -makes it possible to edit files imported from different operating -systems with equal convenience. If you change the text and save the -file, Emacs performs the inverse conversion, changing newlines back -into carriage-return linefeed or just carriage-return if appropriate. +@cindex file selection dialog + On graphical displays, there are two additional methods for visiting +files. Firstly, when Emacs is built with a suitable GUI toolkit, +commands invoked with the mouse (by clicking on the menu bar or tool +bar) use the toolkit's standard ``File Selection'' dialog instead of +prompting for the file name in the minibuffer. On GNU/Linux and Unix +platforms, Emacs does this when built with GTK, LessTif, and Motif +toolkits; on MS-Windows and Mac, the GUI version does that by default. +For information on how to customize this, see @ref{Dialog Boxes}. + + Secondly, Emacs supports ``drag and drop'': dropping a file into an +ordinary Emacs window visits the file using that window. As an +exception, dropping a file into a window displaying a Dired buffer +moves or copies the file into the displayed directory. For details, +see @ref{Drag and Drop}, and @ref{Misc Dired Features}. + + Each time you visit a file, Emacs automatically scans its contents +to detect what character encoding and end-of-line convention it uses, +and converts these to Emacs' internal encoding and end-of-line +convention within the buffer. When you save the buffer, Emacs +performs the inverse conversion, writing the file to disk with its +original encoding and end-of-line convention. @xref{Coding Systems}. @findex find-file-literally If you wish to edit a file as a sequence of @acronym{ASCII} @@ -346,17 +319,17 @@ @vindex find-file-hook @vindex find-file-not-found-functions - Two special hook variables allow extensions to modify the operation of -visiting files. Visiting a file that does not exist runs the functions -in the list @code{find-file-not-found-functions}; this variable holds a list -of functions, and the functions are called one by one (with no -arguments) until one of them returns non-@code{nil}. This is not a -normal hook, and the name ends in @samp{-functions} rather than @samp{-hook} -to indicate that fact. + Two special hook variables allow extensions to modify the operation +of visiting files. Visiting a file that does not exist runs the +functions in @code{find-file-not-found-functions}; this variable holds +a list of functions, which are called one by one (with no arguments) +until one of them returns non-@code{nil}. This is not a normal hook, +and the name ends in @samp{-functions} rather than @samp{-hook} to +indicate that fact. Successful visiting of any file, whether existing or not, calls the -functions in the list @code{find-file-hook}, with no arguments. -This variable is a normal hook. In the case of a nonexistent file, the +functions in @code{find-file-hook}, with no arguments. This variable +is a normal hook. In the case of a nonexistent file, the @code{find-file-not-found-functions} are run first. @xref{Hooks}. There are several ways to specify automatically the major mode for @@ -386,9 +359,9 @@ @table @kbd @item C-x C-s -Save the current buffer in its visited file on disk (@code{save-buffer}). +Save the current buffer to its file (@code{save-buffer}). @item C-x s -Save any or all buffers in their visited files (@code{save-some-buffers}). +Save any or all buffers to their files (@code{save-some-buffers}). @item M-~ Forget that the current buffer has been changed (@code{not-modified}). With prefix argument (@kbd{C-u}), mark the current buffer as changed. @@ -597,8 +570,8 @@ @end table @noindent -The usual way to set this variable is globally, through your -@file{.emacs} file or the customization buffer. However, you can set +The usual way to set this variable is globally, through your init file +or the customization buffer. However, you can set @code{version-control} locally in an individual buffer to control the making of backups for that buffer's file (@pxref{Locals}). You can have Emacs set @code{version-control} locally whenever you visit a @@ -679,34 +652,38 @@ you become the file's owner, and the file's group becomes the default (different operating systems have different defaults for the group). - Having the owner change is usually a good idea, because then the owner -always shows who last edited the file. Also, the owners of the backups -show who produced those versions. Occasionally there is a file whose -owner should not change; it is a good idea for such files to contain -local variable lists to set @code{backup-by-copying-when-mismatch} -locally (@pxref{File Variables}). - @vindex backup-by-copying @vindex backup-by-copying-when-linked @vindex backup-by-copying-when-mismatch @vindex backup-by-copying-when-privileged-mismatch @cindex file ownership, and backup @cindex backup, and user-id - The choice of renaming or copying is controlled by four variables. -Renaming is the default choice. If the variable -@code{backup-by-copying} is non-@code{nil}, copying is used. Otherwise, -if the variable @code{backup-by-copying-when-linked} is non-@code{nil}, -then copying is used for files that have multiple names, but renaming -may still be used when the file being edited has only one name. If the -variable @code{backup-by-copying-when-mismatch} is non-@code{nil}, then -copying is used if renaming would cause the file's owner or group to -change. @code{backup-by-copying-when-mismatch} is @code{t} by default -if you start Emacs as the superuser. The fourth variable, -@code{backup-by-copying-when-privileged-mismatch}, gives the highest -numeric user-id for which @code{backup-by-copying-when-mismatch} will be -forced on. This is useful when low-numbered user-ids are assigned to -special system users, such as @code{root}, @code{bin}, @code{daemon}, -etc., which must maintain ownership of files. + The choice of renaming or copying is made as follows: + +@itemize +@item +If the variable @code{backup-by-copying} is non-@code{nil} (the +default is @code{nil}), use copying. + +@item +Otherwise, if the variable @code{backup-by-copying-when-linked} is +non-@code{nil} (the default is @code{nil}), and the file has multiple +names, use copying. + +@item +Otherwise, if the variable @code{backup-by-copying-when-mismatch} is +non-@code{nil} (the default is @code{t}), and renaming would change +the file's owner or group, use copying. + +If you change @code{backup-by-copying-when-mismatch} to @code{nil}, +Emacs checks the numeric user-id of the file's owner. If this is +higher than @code{backup-by-copying-when-privileged-mismatch}, then it +behaves as though @code{backup-by-copying-when-mismatch} is +non-@code{nil} anyway. + +@item +Otherwise, renaming is the default choice. +@end itemize When a file is managed with a version control system (@pxref{Version Control}), Emacs does not normally make backups in the usual way for @@ -725,28 +702,28 @@ if there isn't already one there. If the value is @code{visit}, Emacs adds a newline at the end of any file that doesn't have one, just after it visits the file. (This marks the buffer as modified, and you -can undo it.) If the value is @code{visit-save}, that means to add +can undo it.) If the value is @code{visit-save}, Emacs adds such newlines both on visiting and on saving. If the value is @code{nil}, -Emacs leaves the end of the file unchanged; if it's neither @code{nil} -nor @code{t}, Emacs asks you whether to add a newline. The default is +Emacs leaves the end of the file unchanged; any other non-@code{nil} +value means to asks you whether to add a newline. The default is @code{nil}. @vindex mode-require-final-newline - Many major modes are designed for specific kinds of files that are -always supposed to end in newlines. These major modes set the -variable @code{require-final-newline} according to -@code{mode-require-final-newline}. By setting the latter variable, -you can control how these modes handle final newlines. + Some major modes are designed for specific kinds of files that are +always supposed to end in newlines. Such major modes set the variable +@code{require-final-newline} to the value of +@code{mode-require-final-newline}, which defaults to @code{t}. By +setting the latter variable, you can control how these modes handle +final newlines. @vindex write-region-inhibit-fsync When Emacs saves a file, it invokes the @code{fsync} system call to force the data immediately out to disk. This is important for safety if the system crashes or in case of power outage. However, it can be -disruptive on laptops using power saving, because it requires the disk -to spin up each time you save a file. Setting -@code{write-region-inhibit-fsync} to a non-@code{nil} value disables -this synchronization. Be careful---this means increased risk of data -loss. +disruptive on laptops using power saving, as it may force a disk +spin-up each time you save a file. If you accept an increased risk of +data loss, you can set @code{write-region-inhibit-fsync} to a +non-@code{nil} value to disable the synchronization. @node Interlocking @subsection Protection against Simultaneous Editing @@ -754,9 +731,9 @@ @cindex file dates @cindex simultaneous editing Simultaneous editing occurs when two users visit the same file, both -make changes, and then both save them. If nobody were informed that -this was happening, whichever user saved first would later find that his -changes were lost. +make changes, and then both save them. If nobody is informed that +this is happening, whichever user saves first would later find that +his changes were lost. On some systems, Emacs notices immediately when the second user starts to change the file, and issues an immediate warning. On all systems, @@ -794,38 +771,28 @@ does not actually take place. @end table - Note that locking works on the basis of a file name; if a file has -multiple names, Emacs does not realize that the two names are the same file -and cannot prevent two users from editing it simultaneously under different -names. However, basing locking on names means that Emacs can interlock the -editing of new files that will not really exist until they are saved. - - Some systems are not configured to allow Emacs to make locks, and -there are cases where lock files cannot be written. In these cases, -Emacs cannot detect trouble in advance, but it still can detect the -collision when you try to save a file and overwrite someone else's -changes. Every time Emacs saves a buffer, it first checks the -last-modification date of the existing file on disk to verify that it -has not changed since the file was last visited or saved. If the date -does not match, it implies that changes were made in the file in some -other way, and these changes are about to be lost if Emacs actually -does save. To prevent this, Emacs displays a warning message and asks -for confirmation before saving. Occasionally you will know why the -file was changed and know that it does not matter; then you can answer -@kbd{yes} and proceed. Otherwise, you should cancel the save with -@kbd{C-g} and investigate the situation. - If Emacs or the operating system crashes, this may leave behind lock files which are stale, so you may occasionally get warnings about -spurious collisions. When you determine that the collision is spurious, -just use @kbd{p} to tell Emacs to go ahead anyway. - - The first thing you should do when notified that simultaneous editing -has already taken place is to list the directory with @kbd{C-u C-x C-d} -(@pxref{Directories}). This shows the file's current author. You -should attempt to contact him to warn him not to continue editing. -Often the next step is to save the contents of your Emacs buffer under a -different name, and use @code{diff} to compare the two files.@refill +spurious collisions. When you determine that the collision is +spurious, just use @kbd{p} to tell Emacs to go ahead anyway. + + Note that locking works on the basis of a file name; if a file has +multiple names, Emacs does not prevent two users from editing it +simultaneously under different names. + + A lock file cannot be written in some circumstances, e.g. if Emacs +lacks the system permissions or the system does not support symbolic +links. In these cases, Emacs can still detect the collision when you +try to save a file, by checking the file's last-modification date. If +the file has changed since the last time Emacs visited or saved it, +that implies that changes have been made in some other way, and will +be lost if Emacs proceeds with saving. Emacs then displays a warning +message and asks for confirmation before saving; answer @kbd{yes} to +save, and @kbd{no} or @kbd{C-g} cancel the save. + + If you are notified that simultaneous editing has already taken +place, one way to compare the buffer to its file is the @kbd{M-x +diff-buffer-with-file} command. @xref{Comparing Files}. @node File Shadowing @subsection Shadowing Files @@ -881,10 +848,10 @@ @cindex modification dates @cindex locale, date format -You can arrange to put a time stamp in a file, so that it will be updated +You can arrange to put a time stamp in a file, so that it is updated automatically each time you edit and save the file. The time stamp -has to be in the first eight lines of the file, and you should -insert it like this: +must be in the first eight lines of the file, and you should insert it +like this: @example Time-stamp: <> @@ -898,13 +865,13 @@ @end example @findex time-stamp - Then add the hook function @code{time-stamp} to the hook -@code{before-save-hook}; that hook function will automatically update -the time stamp, inserting the current date and time when you save the -file. You can also use the command @kbd{M-x time-stamp} to update the -time stamp manually. For other customizations, see the Custom group -@code{time-stamp}. Note that non-numeric fields in the time stamp are -formatted according to your locale setting (@pxref{Environment}). + Then add the function @code{time-stamp} to the hook +@code{before-save-hook} (@pxref{Hooks}). When you save the file, this +function then automatically updates the time stamp with the current +date and time. You can also use the command @kbd{M-x time-stamp} to +update the time stamp manually. For other customizations, see the +Custom group @code{time-stamp}. Note that the time stamp is formatted +according to your locale setting (@pxref{Environment}). @node Reverting @section Reverting a Buffer @@ -912,18 +879,21 @@ @cindex drastic changes @cindex reread a file - If you have made extensive changes to a file and then change your mind -about them, you can get rid of them by reading in the previous version -of the file. To do this, use @kbd{M-x revert-buffer}, which operates on -the current buffer. Since reverting a buffer unintentionally could lose -a lot of work, you must confirm this command with @kbd{yes}. - - @code{revert-buffer} tries to position point in such a way that, if -the file was edited only slightly, you will be at approximately the -same piece of text after reverting as before. However, if you have made -drastic changes, point may wind up in a totally different piece of text. - - Reverting marks the buffer as ``not modified''. + If you have made extensive changes to a file-visiting buffer and +then change your mind, you can @dfn{revert} the changes and go back to +the saved version of the file. To do this, type @kbd{M-x +revert-buffer}. Since reverting unintentionally could lose a lot of +work, Emacs asks for confirmation first. + + The @code{revert-buffer} command tries to position point in such a +way that, if the file was edited only slightly, you will be at +approximately the same part of the text as before. But if you have +made major changes, point may end up in a totally different location. + + Reverting marks the buffer as ``not modified''. It also clears the +buffer's undo history (@pxref{Undo}). Thus, the reversion cannot be +undone---if you change your mind yet again, you can't use the undo +commands to bring the reverted changes back. Some kinds of buffers that are not associated with files, such as Dired buffers, can also be reverted. For them, reverting means @@ -950,15 +920,14 @@ @findex auto-revert-mode @findex auto-revert-tail-mode @vindex auto-revert-interval - - In addition, you can tell Emacs to periodically revert a buffer by -typing @kbd{M-x auto-revert-mode}. This turns on Auto-Revert mode, a -minor mode that makes Emacs automatically revert the current buffer -every five seconds. You can change this interval through the variable -@code{auto-revert-interval}. Typing @kbd{M-x global-auto-revert-mode} -enables Global Auto-Revert mode, which does the same for all file -buffers. Auto-Revert mode and Global Auto-Revert modes do not check -or revert remote files, because that is usually too slow. + You can also tell Emacs to revert buffers periodically. To do this +for a specific buffer, enable the minor mode Auto-Revert mode by +typing @kbd{M-x auto-revert-mode}. This automatically reverts the +current buffer every five seconds; you can change the interval through +the variable @code{auto-revert-interval}. To do the same for all file +buffers, type @kbd{M-x global-auto-revert-mode} to enable Global +Auto-Revert mode. These minor modes do not check or revert remote +files, because that is usually too slow. One use of Auto-Revert mode is to ``tail'' a file such as a system log, so that changes made to that file by other programs are @@ -969,8 +938,9 @@ (@code{auto-revert-tail-mode}). It is more efficient for this. Auto-Revert Tail mode works also for remote files. - @xref{VC Mode Line}, for Auto Revert peculiarities in buffers that -visit files under version control. + @xref{VC Undo}, for commands to revert to earlier versions of files +under version control. @xref{VC Mode Line}, for Auto Revert +peculiarities when visiting files under version control. @ifnottex @include arevert-xtra.texi @@ -1061,40 +1031,41 @@ @vindex auto-save-default @findex auto-save-mode Each time you visit a file, auto-saving is turned on for that file's -buffer if the variable @code{auto-save-default} is non-@code{nil} (but not -in batch mode; @pxref{Entering Emacs}). The default for this variable is -@code{t}, so auto-saving is the usual practice for file-visiting buffers. -Auto-saving can be turned on or off for any existing buffer with the -command @kbd{M-x auto-save-mode}. Like other minor mode commands, @kbd{M-x -auto-save-mode} turns auto-saving on with a positive argument, off with a -zero or negative argument; with no argument, it toggles. +buffer if the variable @code{auto-save-default} is non-@code{nil} (but +not in batch mode; @pxref{Initial Options}). The default for this +variable is @code{t}, so auto-saving is the usual practice for +file-visiting buffers. To toggle auto-saving in the current buffer, +type @kbd{M-x auto-save-mode}. Auto Save mode acts as a buffer-local +minor mode (@pxref{Minor Modes}). @vindex auto-save-interval - Emacs does auto-saving periodically based on counting how many characters -you have typed since the last time auto-saving was done. The variable -@code{auto-save-interval} specifies how many characters there are between -auto-saves. By default, it is 300. Emacs doesn't accept values that are -too small: if you customize @code{auto-save-interval} to a value less -than 20, Emacs will behave as if the value is 20. + Emacs auto-saves periodically based on how many characters you have +typed since the last auto-save. The variable +@code{auto-save-interval} specifies how many characters there are +between auto-saves. By default, it is 300. Emacs doesn't accept +values that are too small: if you customize @code{auto-save-interval} +to a value less than 20, Emacs will behave as if the value is 20. @vindex auto-save-timeout - Auto-saving also takes place when you stop typing for a while. The -variable @code{auto-save-timeout} says how many seconds Emacs should -wait before it does an auto save (and perhaps also a garbage -collection). (The actual time period is longer if the current buffer is -long; this is a heuristic which aims to keep out of your way when you -are editing long buffers, in which auto-save takes an appreciable amount -of time.) Auto-saving during idle periods accomplishes two things: -first, it makes sure all your work is saved if you go away from the -terminal for a while; second, it may avoid some auto-saving while you -are actually typing. + Auto-saving also takes place when you stop typing for a while. By +default, it does this after 30 seconds of idleness (at this time, +Emacs may also perform garbage collection; @pxref{Garbage +Collection,,, elisp, The Emacs Lisp Reference Manual}). To change +this interval, customize the variable @code{auto-save-timeout}. The +actual time period is longer if the current buffer is long; this is a +heuristic which aims to keep out of your way when you are editing long +buffers, in which auto-save takes an appreciable amount of time. +Auto-saving during idle periods accomplishes two things: first, it +makes sure all your work is saved if you go away from the terminal for +a while; second, it may avoid some auto-saving while you are actually +typing. Emacs also does auto-saving whenever it gets a fatal error. This includes killing the Emacs job with a shell command such as @samp{kill %emacs}, or disconnecting a phone line or network connection. @findex do-auto-save - You can request an auto-save explicitly with the command @kbd{M-x + You can perform an auto-save explicitly with the command @kbd{M-x do-auto-save}. @node Recover @@ -1138,13 +1109,11 @@ @vindex auto-save-list-file-prefix Emacs records information about interrupted sessions for later -recovery in files named -@file{~/.emacs.d/auto-save-list/.saves-@var{pid}-@var{hostname}}. The -directory used, @file{~/.emacs.d/auto-save-list/}, is determined by -the variable @code{auto-save-list-file-prefix}. You can record -sessions in a different place by customizing that variable. If you -set @code{auto-save-list-file-prefix} to @code{nil} in your -@file{.emacs} file, sessions are not recorded for recovery. +recovery in files named @file{.saves-@var{pid}-@var{hostname}} in the +directory @file{~/.emacs.d/auto-save-list/}. This directory is +determined by the variable @code{auto-save-list-file-prefix}. If you +set @code{auto-save-list-file-prefix} to @code{nil}, sessions are not +recorded for recovery. @node File Aliases @section File Name Aliases @@ -1292,8 +1261,8 @@ program, using options taken from the variable @code{diff-switches}. The value of @code{diff-switches} should be a string; the default is @code{"-c"} to specify a context diff. @xref{Top,, Diff, diff, -Comparing and Merging Files}, for more information about -@command{diff} output formats. +Comparing and Merging Files}, for more information about the +@command{diff} program. The output of the @code{diff} command is shown using a major mode called Diff mode. @xref{Diff Mode}. @@ -1361,11 +1330,10 @@ @cindex patches, editing Diff mode is a major mode used for the output of @kbd{M-x diff} and -other similar commands, as well as the output of the @command{diff} -program. This kind of output is called a @dfn{patch}, because it can -be passed to the @command{patch} command to automatically apply the -specified changes. To select Diff mode manually, type @kbd{M-x -diff-mode}. +other similar commands. This kind of output is called a @dfn{patch}, +because it can be passed to the @command{patch} command to +automatically apply the specified changes. To select Diff mode +manually, type @kbd{M-x diff-mode}. @cindex hunk, diff The changes specified in a patch are grouped into @dfn{hunks}, which @@ -1659,21 +1627,18 @@ The keys @kbd{e}, @kbd{f} and @key{RET} all extract a component file into its own buffer. You can edit it there, and if you save the buffer, the edited version will replace the version in the Tar buffer. -@kbd{v} extracts a file into a buffer in View mode (@pxref{View -Mode}). @kbd{o} extracts the file and displays it in another window, -so you could edit the file and operate on the archive simultaneously. -@kbd{d} marks a file for deletion when you later use @kbd{x}, and +Clicking with the mouse on the file name in the Tar buffer does +likewise. @kbd{v} extracts a file into a buffer in View mode +(@pxref{View Mode}). @kbd{o} extracts the file and displays it in +another window, so you could edit the file and operate on the archive +simultaneously. + + @kbd{d} marks a file for deletion when you later use @kbd{x}, and @kbd{u} unmarks a file, as in Dired. @kbd{C} copies a file from the archive to disk and @kbd{R} renames a file within the archive. -@kbd{g} reverts the buffer from the archive on disk. - - The keys @kbd{M}, @kbd{G}, and @kbd{O} change the file's permission -bits, group, and owner, respectively. - - If your display supports colors and the mouse, moving the mouse -pointer across a file name highlights that file name, indicating that -you can click on it. Clicking @kbd{Mouse-2} on the highlighted file -name extracts the file into a buffer and displays that buffer. +@kbd{g} reverts the buffer from the archive on disk. The keys +@kbd{M}, @kbd{G}, and @kbd{O} change the file's permission bits, +group, and owner, respectively. Saving the Tar buffer writes a new version of the archive to disk with the changes you made to the components. @@ -1690,19 +1655,20 @@ @cindex @code{zip} @cindex @code{lzh} @cindex @code{zoo} +@cindex @code{7z} @pindex arc @pindex jar @pindex zip @pindex rar @pindex lzh @pindex zoo +@pindex 7z @cindex Java class archives @cindex unzip archives - A separate but similar Archive mode is used for archives produced by -the programs @code{arc}, @code{jar}, @code{lzh}, @code{zip}, -@code{rar}, and @code{zoo}, which have extensions corresponding to the -program names. Archive mode also works for those @code{exe} files -that are self-extracting executables. + A separate but similar Archive mode is used for @code{arc}, +@code{jar}, @code{lzh}, @code{zip}, @code{rar}, @code{7z}, and +@code{zoo} archives, as well as @code{exe} files that are +self-extracting executables. The key bindings of Archive mode are similar to those in Tar mode, with the addition of the @kbd{m} key which marks a file for subsequent @@ -1712,11 +1678,11 @@ line. Operations such as renaming a subfile, or changing its mode or owner, are supported only for some of the archive formats. - Unlike Tar mode, Archive mode runs the archiving program to unpack -and repack archives. Details of the program names and their options -can be set in the @samp{Archive} Customize group. However, you don't -need these programs to look at the archive table of contents, only to -extract or manipulate the subfiles in the archive. + Unlike Tar mode, Archive mode runs the archiving programs to unpack +and repack archives. However, you don't need these programs to look +at the archive table of contents, only to extract or manipulate the +subfiles in the archive. Details of the program names and their +options can be set in the @samp{Archive} Customize group. @node Remote Files @section Remote Files @@ -1748,16 +1714,14 @@ @enumerate @item -If the host name starts with @samp{ftp.} (with dot), then Emacs uses -FTP. +If the host name starts with @samp{ftp.} (with dot), Emacs uses FTP. @item -If the user name is @samp{ftp} or @samp{anonymous}, then Emacs uses -FTP. +If the user name is @samp{ftp} or @samp{anonymous}, Emacs uses FTP. @item If the variable @code{tramp-default-method} is set to @samp{ftp}, -then Emacs uses FTP. +Emacs uses FTP. @item -If @command{ssh-agent} is running, then Emacs uses @command{scp}. +If @command{ssh-agent} is running, Emacs uses @command{scp}. @item Otherwise, Emacs uses @command{ssh}. @end enumerate @@ -1769,32 +1733,31 @@ feature in individual cases by quoting the file name with @samp{/:} (@pxref{Quoted File Names}). +@cindex ange-ftp Remote file access through FTP is handled by the Ange-FTP package, which is documented in the following. Remote file access through the other methods is handled by the Tramp package, which has its own manual. @xref{Top, The Tramp Manual,, tramp, The Tramp Manual}. -When the Ange-FTP package is used, Emacs logs in through FTP using -your user name or the name @var{user}. It may ask you for a password -from time to time (@pxref{Passwords}); this is used for logging in on -@var{host}. The form using @var{port} allows you to access servers -running on a non-default TCP port. +@vindex ange-ftp-default-user +@cindex user name for remote file access + When the Ange-FTP package is used, Emacs logs in through FTP using +the name @var{user}, if that is specified in the remote file name. If +@var{user} is unspecified, Emacs logs in using your user name on the +local system; but if you set the variable @code{ange-ftp-default-user} +to a string, that string is used instead. When logging in, Emacs may +also ask for a password. @cindex backups for remote files @vindex ange-ftp-make-backup-files - If you want to disable backups for remote files, set the variable -@code{ange-ftp-make-backup-files} to @code{nil}. - - By default, the auto-save files (@pxref{Auto Save Files}) for remote -files are made in the temporary file directory on the local machine. -This is achieved using the variable @code{auto-save-file-name-transforms}. - -@cindex ange-ftp -@vindex ange-ftp-default-user -@cindex user name for remote file access - Normally, if you do not specify a user name in a remote file name, -that means to use your own user name. But if you set the variable -@code{ange-ftp-default-user} to a string, that string is used instead. + For performance reasons, Emacs does not make backup files for files +accessed via FTP by default. To make it do so, change the variable +@code{ange-ftp-make-backup-files} to a non-@code{nil} value. + + By default, auto-save files for remote files are made in the +temporary file directory on the local machine, as specified by the +variable @code{auto-save-file-name-transforms}. @xref{Auto Save +Files}. @cindex anonymous FTP @vindex ange-ftp-generate-anonymous-password @@ -1950,10 +1913,10 @@ @findex filesets-init If you regularly edit a certain group of files, you can define them as a @dfn{fileset}. This lets you perform certain operations, such as -visiting, @code{query-replace}, and shell commands on all the files -at once. To make use of filesets, you must first add the expression -@code{(filesets-init)} to your @file{.emacs} file (@pxref{Init File}). -This adds a @samp{Filesets} menu to the menu bar. +visiting, @code{query-replace}, and shell commands on all the files at +once. To make use of filesets, you must first add the expression +@code{(filesets-init)} to your init file (@pxref{Init File}). This +adds a @samp{Filesets} menu to the menu bar. @findex filesets-add-buffer @findex filesets-remove-buffer @@ -1980,7 +1943,7 @@ a fileset. These commands are also available from the @samp{Filesets} menu, where each existing fileset is represented by a submenu. - Emacs uses the concept of a fileset elsewhere @pxref{Version -Control} to describe sets of files to be treated as a group for -purposes of version control operations. Those filesets are unnamed -and do not persist across Emacs sessions. + @xref{Version Control}, for a different concept of ``filesets'': +groups of files bundled together for version control operations. +Filesets of that type are unnamed, and do not persist across Emacs +sessions. === modified file 'doc/emacs/help.texi' --- doc/emacs/help.texi 2011-10-09 21:00:42 +0000 +++ doc/emacs/help.texi 2011-10-21 14:45:34 +0000 @@ -70,7 +70,7 @@ * Package Keywords:: Finding Lisp libraries by keywords (topics). * Language Help:: Help relating to international language support. * Misc Help:: Other help commands. -* Help Files:: Commands to display auxilliary help files. +* Help Files:: Commands to display auxiliary help files. * Help Echo:: Help on active text and tooltips (`balloon help'). @end menu === modified file 'doc/emacs/killing.texi' --- doc/emacs/killing.texi 2011-10-15 16:37:45 +0000 +++ doc/emacs/killing.texi 2011-10-21 14:45:34 +0000 @@ -736,7 +736,7 @@ k} (@code{kill-rectangle}) to remove the text and and save it as the @dfn{last killed rectangle}. In both cases, erasing the region-rectangle is like erasing the specified text on each line of -the rectange; if there is any following text on the line, it moves +the rectangle; if there is any following text on the line, it moves backwards to fill the gap. ``Killing'' a rectangle is not killing in the usual sense; the === modified file 'doc/emacs/screen.texi' --- doc/emacs/screen.texi 2011-10-07 16:22:04 +0000 +++ doc/emacs/screen.texi 2011-10-21 14:45:34 +0000 @@ -189,7 +189,7 @@ @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 +no special character set handling (with the possible exception 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 === modified file 'doc/emacs/search.texi' --- doc/emacs/search.texi 2011-10-19 04:21:52 +0000 +++ doc/emacs/search.texi 2011-10-21 14:45:34 +0000 @@ -371,7 +371,7 @@ When the current match is on a history element, that history element is pulled into the minibuffer. If you exit the incremental search normally (e.g. by typing @key{RET}), it remains in the minibuffer -afterwards. Cancelling the search, with @kbd{C-g}, restores the +afterwards. Canceling the search, with @kbd{C-g}, restores the contents of the minibuffer when you began the search. @node Nonincremental Search === modified file 'etc/NEWS' --- etc/NEWS 2011-10-19 04:21:52 +0000 +++ etc/NEWS 2011-10-21 14:45:34 +0000 @@ -272,7 +272,7 @@ *** The new functions file-selinux-context and set-file-selinux-context get and set the SELinux context of a file. - +--- *** Tramp offers handlers for file-selinux-context and set-file-selinux-context for remote machines which support SELinux. @@ -460,6 +460,7 @@ *** `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. +++ @@ -560,6 +561,7 @@ * Changes in Specialized Modes and Packages in Emacs 24.1 ++++ ** Archive Mode has basic support for browsing and updating 7z archives. ** browse-url has a new variable `browse-url-mailto-function' @@ -804,12 +806,12 @@ *** latex-electric-env-pair-mode keeps \begin..\end matched on the fly. ** Tramp - +--- *** There exists a new inline access method "ksu" (kerberized su). - +--- *** The following access methods are discontinued: "ssh1_old", "ssh2_old", "scp1_old", "scp2_old", "imap", "imaps" and "fish". - +--- *** The option `ange-ftp-binary-file-name-regexp' has changed its default value to "". ------------------------------------------------------------ revno: 106158 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2011-10-21 14:29:07 +0200 message: etc/PROBLEMS: Mention crashes on MS-Windows when compiled with GCC 4.6.1. diff: === modified file 'etc/PROBLEMS' --- etc/PROBLEMS 2011-09-24 18:27:18 +0000 +++ etc/PROBLEMS 2011-10-21 12:29:07 +0000 @@ -171,6 +171,14 @@ CFLAGS="-g -O2 -fno-optimize-sibling-calls" ./configure +** Emacs compiled with GCC 4.6.1 crashes on MS-Windows when C-g is pressed + +This is known to happen when Emacs is compiled with MinGW GCC 4.6.1 +with the -O2 option (which is the default in the Windows build). The +reason is a bug in MinGW GCC 4.6.1; to work around, either add the +`-fno-omit-frame-pointer' switch to GCC or compile without +optimizations (`--no-opt' switch to the configure.bat script). + ** Emacs crashes in x-popup-dialog. This can happen if the dialog widget cannot find the font it wants to ------------------------------------------------------------ revno: 106157 committer: martin rudalics branch nick: trunk timestamp: Fri 2011-10-21 11:15:32 +0200 message: Fix and improve mouse-dragging of horizontal/vertical lines. * mouse.el (mouse-drag-window-above) (mouse-drag-move-window-bottom, mouse-drag-move-window-top) (mouse-drag-mode-line-1, mouse-drag-header-line) (mouse-drag-vertical-line-rightward-window): Remove. (mouse-drag-line): New function. (mouse-drag-mode-line, mouse-drag-header-line) (mouse-drag-vertical-line): Call mouse-drag-line. * window.el (window-at-side-p, windows-at-side): New functions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-21 06:44:20 +0000 +++ lisp/ChangeLog 2011-10-21 09:15:32 +0000 @@ -1,3 +1,14 @@ +2011-10-21 Martin Rudalics + + * mouse.el (mouse-drag-window-above) + (mouse-drag-move-window-bottom, mouse-drag-move-window-top) + (mouse-drag-mode-line-1, mouse-drag-header-line) + (mouse-drag-vertical-line-rightward-window): Remove. + (mouse-drag-line): New function. + (mouse-drag-mode-line, mouse-drag-header-line) + (mouse-drag-vertical-line): Call mouse-drag-line. + * window.el (window-at-side-p, windows-at-side): New functions. + 2011-10-21 Ulrich Mueller * tar-mode.el (tar-grind-file-mode): === modified file 'lisp/mouse.el' --- lisp/mouse.el 2011-10-14 18:36:33 +0000 +++ lisp/mouse.el 2011-10-21 09:15:32 +0000 @@ -372,300 +372,164 @@ (split-window-horizontally (min (max new-width first-col) last-col)))))) -(defun mouse-drag-window-above (window) - "Return the (or a) window directly above WINDOW. -That means one whose bottom edge is at the same height as WINDOW's top edge." - (let ((start-top (nth 1 (window-edges window))) - (start-left (nth 0 (window-edges window))) - (start-right (nth 2 (window-edges window))) - (start-window window) - above-window) - (setq window (previous-window window 0)) - (while (and (not above-window) (not (eq window start-window))) - (let ((left (nth 0 (window-edges window))) - (right (nth 2 (window-edges window)))) - (when (and (= (+ (window-height window) (nth 1 (window-edges window))) - start-top) - (or (and (<= left start-left) (<= start-right right)) - (and (<= start-left left) (<= left start-right)) - (and (<= start-left right) (<= right start-right)))) - (setq above-window window))) - (setq window (previous-window window))) - above-window)) - -(defun mouse-drag-move-window-bottom (window growth) - "Move the bottom of WINDOW up or down by GROWTH lines. -Move it down if GROWTH is positive, or up if GROWTH is negative. -If this would make WINDOW too short, -shrink the window or windows above it to make room." - (condition-case nil - (adjust-window-trailing-edge window growth nil) - (error nil))) - -(defsubst mouse-drag-move-window-top (window growth) - "Move the top of WINDOW up or down by GROWTH lines. -Move it down if GROWTH is positive, or up if GROWTH is negative. -If this would make WINDOW too short, shrink the window or windows -above it to make room." - ;; Moving the top of WINDOW is actually moving the bottom of the - ;; window above. - (let ((window-above (mouse-drag-window-above window))) - (and window-above - (mouse-drag-move-window-bottom window-above (- growth))))) - -(defun mouse-drag-mode-line-1 (start-event mode-line-p) - "Change the height of a window by dragging on the mode or header line. -START-EVENT is the starting mouse-event of the drag action. -MODE-LINE-P non-nil means dragging a mode line; nil means a header line." +;; `mouse-drag-line' is now the common routine for handling all line +;; dragging events combining the earlier `mouse-drag-mode-line-1' and +;; `mouse-drag-vertical-line'. It should improve the behavior of line +;; dragging wrt Emacs 23 as follows: + +;; (1) Gratuitous error messages and restrictions have been (hopefully) +;; removed. (The help-echo that dragging the mode-line can resize a +;; one-window-frame's window will still show through via bindings.el.) + +;; (2) No gratuitous selection of other windows should happen. (This +;; has not been completely fixed for mouse-autoselected windows yet.) + +;; (3) Mouse clicks below a scroll-bar should pass through via unread +;; command events. + +;; Note that `window-in-direction' replaces `mouse-drag-window-above' +;; and `mouse-drag-vertical-line-rightward-window' with Emacs 24.1. +(defun mouse-drag-line (start-event line) + "Drag some line with the mouse. +START-EVENT is the starting mouse-event of the drag action. LINE +must be one of the symbols header, mode, or vertical." ;; Give temporary modes such as isearch a chance to turn off. (run-hooks 'mouse-leave-buffer-hook) - (let* ((done nil) - (echo-keystrokes 0) + (let* ((echo-keystrokes 0) (start (event-start start-event)) - (start-event-window (posn-window start)) - (start-event-frame (window-frame start-event-window)) - (start-nwindows (count-windows t)) + (window (posn-window start)) + (frame (window-frame window)) + (minibuffer-window (minibuffer-window frame)) (on-link (and mouse-1-click-follows-link (or mouse-1-click-in-non-selected-windows - (eq (posn-window start) (selected-window))) - (mouse-on-link-p start))) - (minibuffer (frame-parameter nil 'minibuffer)) - should-enlarge-minibuffer event mouse y top bot edges wconfig growth) + (eq window (selected-window))) + (mouse-on-link-p start))) + (enlarge-minibuffer + (and (eq line 'mode) + (eq (window-frame minibuffer-window) frame) + (not (one-window-p t frame)) + (= (nth 1 (window-edges minibuffer-window)) + (nth 3 (window-edges window))))) + (which-side + (and (eq line 'vertical) + (or (cdr (assq 'vertical-scroll-bars (frame-parameters frame))) + 'right))) + done event mouse growth dragged) + (cond + ((eq line 'header) + ;; Check whether header-line can be dragged at all. + (when (window-at-side-p window 'top) + (setq done t))) + ((eq line 'mode) + ;; Check whether mode-line can be dragged at all. + (when (window-at-side-p window 'bottom) + (setq done t))) + ((eq line 'vertical) + ;; Get the window to adjust for the vertical case. + (setq window + (if (eq which-side 'right) + ;; If the scroll bar is on the window's right or there's + ;; no scroll bar at all, adjust the window where the + ;; start-event occurred. + window + ;; If the scroll bar is on the start-event window's left, + ;; adjust the window on the left of it. + (window-in-direction 'left window))))) + + ;; Start tracking. (track-mouse - (progn - ;; if this is the bottommost ordinary window, then to - ;; move its modeline the minibuffer must be enlarged. - (setq should-enlarge-minibuffer - (and minibuffer - mode-line-p - (not (one-window-p t)) - (= (nth 1 (window-edges minibuffer)) - (nth 3 (window-edges start-event-window))))) - - ;; loop reading events and sampling the position of - ;; the mouse. - (while (not done) - (setq event (read-event) - mouse (mouse-position)) - - ;; do nothing if - ;; - there is a switch-frame event. - ;; - the mouse isn't in the frame that we started in - ;; - the mouse isn't in any Emacs frame - ;; drag if - ;; - there is a mouse-movement event - ;; - there is a scroll-bar-movement event - ;; (same as mouse movement for our purposes) - ;; quit if - ;; - there is a keyboard event or some other unknown event. - (cond ((not (consp event)) - (setq done t)) - - ((memq (car event) '(switch-frame select-window)) - nil) - - ((not (memq (car event) '(mouse-movement scroll-bar-movement))) - (when (consp event) - ;; Do not unread a drag-mouse-1 event since it will cause the - ;; selection of the window above when dragging the modeline - ;; above the selected window. - (unless (eq (car event) 'drag-mouse-1) - (push event unread-command-events))) - (setq done t)) - - ((not (eq (car mouse) start-event-frame)) - nil) - - ((null (car (cdr mouse))) - nil) - - (t - (setq y (cdr (cdr mouse)) - edges (window-edges start-event-window) - top (nth 1 edges) - bot (nth 3 edges)) - - ;; compute size change needed - (cond (mode-line-p - (setq growth (- y bot -1))) - (t ; header line - (when (< (- bot y) window-min-height) - (setq y (- bot window-min-height))) - ;; The window's top includes the header line! - (setq growth (- top y)))) - (setq wconfig (current-window-configuration)) - - ;; Check for an error case. - (when (and (/= growth 0) - (not minibuffer) - (one-window-p t)) - (error "Attempt to resize sole window")) - - ;; If we ever move, make sure we don't mistakenly treat - ;; some unexpected `mouse-1' final event as a sign that - ;; this whole drag was nothing more than a click. - (if (/= growth 0) (setq on-link nil)) - - ;; grow/shrink minibuffer? - (if should-enlarge-minibuffer - (unless resize-mini-windows - (mouse-drag-move-window-bottom start-event-window growth)) - ;; no. grow/shrink the selected window - ;(message "growth = %d" growth) - (if mode-line-p - (mouse-drag-move-window-bottom start-event-window growth) - (mouse-drag-move-window-top start-event-window growth))) - - ;; if this window's growth caused another - ;; window to be deleted because it was too - ;; short, rescind the change. - ;; - ;; if size change caused space to be stolen - ;; from a window above this one, rescind the - ;; change, but only if we didn't grow/shrink - ;; the minibuffer. minibuffer size changes - ;; can cause all windows to shrink... no way - ;; around it. - (when (or (/= start-nwindows (count-windows t)) - (and (not should-enlarge-minibuffer) - (> growth 0) - mode-line-p - (/= top - (nth 1 (window-edges - ;; Choose right window. - start-event-window))))) - (set-window-configuration wconfig))))) - - ;; Presumably if this was just a click, the last event should - ;; be `mouse-1', whereas if this did move the mouse, it should be - ;; a `drag-mouse-1'. In any case `on-link' would have been nulled - ;; above if there had been any significant mouse movement. - (when (and on-link - (eq 'mouse-1 (car-safe (car unread-command-events)))) - ;; If mouse-2 has never been done by the user, it doesn't - ;; have the necessary property to be interpreted correctly. - (put 'mouse-2 'event-kind 'mouse-click) - (setcar unread-command-events - (cons 'mouse-2 (cdar unread-command-events)))))))) + ;; Loop reading events and sampling the position of the mouse. + (while (not done) + (setq event (read-event)) + (setq mouse (mouse-position)) + ;; Do nothing if + ;; - there is a switch-frame event. + ;; - the mouse isn't in the frame that we started in + ;; - the mouse isn't in any Emacs frame + ;; Drag if + ;; - there is a mouse-movement event + ;; - there is a scroll-bar-movement event (??) + ;; (same as mouse movement for our purposes) + ;; Quit if + ;; - there is a keyboard event or some other unknown event. + (cond + ((not (consp event)) + (setq done t)) + ((memq (car event) '(switch-frame select-window)) + nil) + ((not (memq (car event) '(mouse-movement scroll-bar-movement))) + (when (consp event) + ;; Do not unread a drag-mouse-1 event to avoid selecting + ;; some other window. For vertical line dragging do not + ;; unread mouse-1 events either (but only if we dragged at + ;; least once to allow mouse-1 clicks get through. + (unless (and dragged + (if (eq line 'vertical) + (memq (car event) '(drag-mouse-1 mouse-1)) + (eq (car event) 'drag-mouse-1))) + (push event unread-command-events))) + (setq done t)) + ((or (not (eq (car mouse) frame)) (null (car (cdr mouse)))) + nil) + ((eq line 'vertical) + ;; Drag vertical divider (the calculations below are those + ;; from Emacs 23). + (setq growth + (- (- (cadr mouse) + (if (eq which-side 'right) 0 2)) + (nth 2 (window-edges window)) + -1)) + (unless (zerop growth) + ;; Remember that we dragged. + (setq dragged t)) + (adjust-window-trailing-edge window growth t)) + (t + ;; Drag horizontal divider (the calculations below are those + ;; from Emacs 23). + (setq growth + (if (eq line 'mode) + (- (cddr mouse) (nth 3 (window-edges window)) -1) + ;; The window's top includes the header line! + (- (nth 3 (window-edges window)) (cddr mouse)))) + + (unless (zerop growth) + ;; Remember that we dragged. + (setq dragged t)) + + (cond + (enlarge-minibuffer + (adjust-window-trailing-edge window growth)) + ((eq line 'mode) + (adjust-window-trailing-edge window growth)) + (t + (adjust-window-trailing-edge window (- growth))))))) + + ;; Presumably, if this was just a click, the last event should be + ;; `mouse-1', whereas if this did move the mouse, it should be a + ;; `drag-mouse-1'. `dragged' nil tells us that we never dragged + ;; and `on-link' tells us that there is a link to follow. + (when (and on-link (not dragged) + (eq 'mouse-1 (car-safe (car unread-command-events)))) + ;; If mouse-2 has never been done by the user, it doesn't + ;; have the necessary property to be interpreted correctly. + (put 'mouse-2 'event-kind 'mouse-click) + (setcar unread-command-events + (cons 'mouse-2 (cdar unread-command-events))))))) (defun mouse-drag-mode-line (start-event) "Change the height of a window by dragging on the mode line." (interactive "e") - (mouse-drag-mode-line-1 start-event t)) + (mouse-drag-line start-event 'mode)) (defun mouse-drag-header-line (start-event) - "Change the height of a window by dragging on the header line. -Windows whose header-lines are at the top of the frame cannot be -resized by dragging their header-line." + "Change the height of a window by dragging on the header line." (interactive "e") - ;; Changing the window's size by dragging its header-line when the - ;; header-line is at the top of the frame is somewhat strange, - ;; because the header-line doesn't move, so don't do it. - (let* ((start (event-start start-event)) - (window (posn-window start)) - (frame (window-frame window)) - (first-window (frame-first-window frame))) - (unless (or (eq window first-window) - (= (nth 1 (window-edges window)) - (nth 1 (window-edges first-window)))) - (mouse-drag-mode-line-1 start-event nil)))) - - -(defun mouse-drag-vertical-line-rightward-window (window) - "Return a window that is immediately to the right of WINDOW, or nil." - (let ((bottom (nth 3 (window-inside-edges window))) - (left (nth 0 (window-inside-edges window))) - best best-right - (try (previous-window window))) - (while (not (eq try window)) - (let ((try-top (nth 1 (window-inside-edges try))) - (try-bottom (nth 3 (window-inside-edges try))) - (try-right (nth 2 (window-inside-edges try)))) - (if (and (< try-top bottom) - (>= try-bottom bottom) - (< try-right left) - (or (null best-right) (> try-right best-right))) - (setq best-right try-right best try))) - (setq try (previous-window try))) - best)) + (mouse-drag-line start-event 'header)) (defun mouse-drag-vertical-line (start-event) "Change the width of a window by dragging on the vertical line." (interactive "e") - ;; Give temporary modes such as isearch a chance to turn off. - (run-hooks 'mouse-leave-buffer-hook) - (let* ((done nil) - (echo-keystrokes 0) - (start-event-frame (window-frame (car (car (cdr start-event))))) - (start-event-window (car (car (cdr start-event)))) - event mouse x left right edges growth - (which-side - (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame))) - 'right))) - (cond - ((one-window-p t) - (error "Attempt to resize sole ordinary window")) - ((and (eq which-side 'right) - (>= (nth 2 (window-inside-edges start-event-window)) - (frame-width start-event-frame))) - (error "Attempt to drag rightmost scrollbar")) - ((and (eq which-side 'left) - (= (nth 0 (window-inside-edges start-event-window)) 0)) - (error "Attempt to drag leftmost scrollbar"))) - (track-mouse - (progn - ;; loop reading events and sampling the position of - ;; the mouse. - (while (not done) - (setq event (read-event) - mouse (mouse-position)) - ;; do nothing if - ;; - there is a switch-frame event. - ;; - the mouse isn't in the frame that we started in - ;; - the mouse isn't in any Emacs frame - ;; drag if - ;; - there is a mouse-movement event - ;; - there is a scroll-bar-movement event - ;; (same as mouse movement for our purposes) - ;; quit if - ;; - there is a keyboard event or some other unknown event - ;; unknown event. - (cond ((integerp event) - (setq done t)) - ((memq (car event) '(switch-frame select-window)) - nil) - ((not (memq (car event) - '(mouse-movement scroll-bar-movement))) - (if (consp event) - (setq unread-command-events - (cons event unread-command-events))) - (setq done t)) - ((not (eq (car mouse) start-event-frame)) - nil) - ((null (car (cdr mouse))) - nil) - (t - (let ((window - ;; If the scroll bar is on the window's left, - ;; adjust the window on the left. - (if (eq which-side 'right) - start-event-window - (mouse-drag-vertical-line-rightward-window - start-event-window)))) - (setq x (- (car (cdr mouse)) - (if (eq which-side 'right) 0 2)) - edges (window-edges window) - left (nth 0 edges) - right (nth 2 edges)) - ;; scale back a move that would make the - ;; window too thin. - (if (< (- x left -1) window-min-width) - (setq x (+ left window-min-width -1))) - ;; compute size change needed - (setq growth (- x right -1)) - (condition-case nil - (adjust-window-trailing-edge window growth t) - (error nil)))))))))) + (mouse-drag-line start-event 'vertical)) (defun mouse-set-point (event) "Move point to the position clicked on with the mouse. === modified file 'lisp/window.el' --- lisp/window.el 2011-10-10 17:52:03 +0000 +++ lisp/window.el 2011-10-21 09:15:32 +0000 @@ -1084,6 +1084,35 @@ (goto-char pos)) (set-window-point window pos))) +(defun window-at-side-p (&optional window side) + "Return t if WINDOW is at SIDE of its containing frame. +WINDOW can be any window and defaults to the selected one. SIDE +can be any of the symbols `left', `top', `right' or `bottom'. +The default value nil is handled like `bottom'." + (setq window (window-normalize-any-window window)) + (let ((edge + (cond + ((eq side 'left) 0) + ((eq side 'top) 1) + ((eq side 'right) 2) + ((memq side '(bottom nil)) 3)))) + (= (nth edge (window-edges window)) + (nth edge (window-edges (frame-root-window window)))))) + +(defun windows-at-side (&optional frame side) + "Return list of all windows on SIDE of FRAME. +FRAME must be a live frame and defaults to the selected frame. +SIDE can be any of the symbols `left', `top', `right' or +`bottom'. The default value nil is handled like `bottom'." + (setq frame (window-normalize-frame frame)) + (let (windows) + (walk-window-tree + (lambda (window) + (when (window-at-side-p window side) + (setq windows (cons window windows)))) + frame) + (nreverse windows))) + (defun window-in-direction-2 (window posn &optional horizontal) "Support function for `window-in-direction'." (if horizontal ------------------------------------------------------------ revno: 106156 fixes bug(s): http://debbugs.gnu.org/9817 author: Ulrich Mueller committer: Glenn Morris branch nick: trunk timestamp: Thu 2011-10-20 23:44:20 -0700 message: tar-grind-file-mode fix. * lisp/tar-mode.el (tar-grind-file-mode): Fix handling of setuid/setgid, handle sticky bit. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-21 02:23:59 +0000 +++ lisp/ChangeLog 2011-10-21 06:44:20 +0000 @@ -1,3 +1,8 @@ +2011-10-21 Ulrich Mueller + + * tar-mode.el (tar-grind-file-mode): + Fix handling of setuid/setgid, handle sticky bit. (Bug#9817) + 2011-10-21 Chong Yidong * progmodes/idlwave.el (idlwave-mode): === modified file 'lisp/tar-mode.el' --- lisp/tar-mode.el 2011-07-06 02:42:10 +0000 +++ lisp/tar-mode.el 2011-10-21 06:44:20 +0000 @@ -404,13 +404,19 @@ (string (if (zerop (logand 256 mode)) ?- ?r) (if (zerop (logand 128 mode)) ?- ?w) - (if (zerop (logand 1024 mode)) (if (zerop (logand 64 mode)) ?- ?x) ?s) + (if (zerop (logand 2048 mode)) + (if (zerop (logand 64 mode)) ?- ?x) + (if (zerop (logand 64 mode)) ?S ?s)) (if (zerop (logand 32 mode)) ?- ?r) (if (zerop (logand 16 mode)) ?- ?w) - (if (zerop (logand 2048 mode)) (if (zerop (logand 8 mode)) ?- ?x) ?s) + (if (zerop (logand 1024 mode)) + (if (zerop (logand 8 mode)) ?- ?x) + (if (zerop (logand 8 mode)) ?S ?s)) (if (zerop (logand 4 mode)) ?- ?r) (if (zerop (logand 2 mode)) ?- ?w) - (if (zerop (logand 1 mode)) ?- ?x))) + (if (zerop (logand 512 mode)) + (if (zerop (logand 1 mode)) ?- ?x) + (if (zerop (logand 1 mode)) ?T ?t)))) (defun tar-header-block-summarize (tar-hblock &optional mod-p) "Return a line similar to the output of `tar -vtf'." ------------------------------------------------------------ revno: 106155 committer: Chong Yidong branch nick: trunk timestamp: Thu 2011-10-20 22:23:59 -0400 message: Use mode-require-final-newline for idlwave.el and vera-mode.el. * progmodes/idlwave.el (idlwave-mode): * progmodes/vera-mode.el (vera-mode): Use mode-require-final-newline. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-20 21:01:45 +0000 +++ lisp/ChangeLog 2011-10-21 02:23:59 +0000 @@ -1,3 +1,9 @@ +2011-10-21 Chong Yidong + + * progmodes/idlwave.el (idlwave-mode): + * progmodes/vera-mode.el (vera-mode): Use + mode-require-final-newline. + 2011-10-20 Glenn Morris * vc/vc.el (vc-next-action): Handle removed directories. (Bug#9781) === modified file 'lisp/progmodes/idlwave.el' --- lisp/progmodes/idlwave.el 2011-04-01 22:33:37 +0000 +++ lisp/progmodes/idlwave.el 2011-10-21 02:23:59 +0000 @@ -1907,7 +1907,8 @@ (set (make-local-variable 'comment-start-skip) ";+[ \t]*") (set (make-local-variable 'comment-start) ";") (set (make-local-variable 'comment-add) 1) ; ";;" for new and regions - (set (make-local-variable 'require-final-newline) t) + (set (make-local-variable 'require-final-newline) + mode-require-final-newline) (set (make-local-variable 'abbrev-all-caps) t) (set (make-local-variable 'indent-tabs-mode) nil) (set (make-local-variable 'completion-ignore-case) t) === modified file 'lisp/progmodes/vera-mode.el' --- lisp/progmodes/vera-mode.el 2011-04-22 18:44:26 +0000 +++ lisp/progmodes/vera-mode.el 2011-10-21 02:23:59 +0000 @@ -310,7 +310,8 @@ (set (make-local-variable 'comment-indent-function) 'c-comment-indent) (set (make-local-variable 'paragraph-start) "^$") (set (make-local-variable 'paragraph-separate) paragraph-start) - (set (make-local-variable 'require-final-newline) t) + (set (make-local-variable 'require-final-newline) + mode-require-final-newline) (set (make-local-variable 'indent-tabs-mode) nil) (set (make-local-variable 'indent-line-function) 'vera-indent-line) (set (make-local-variable 'parse-sexp-ignore-comments) t) ------------------------------------------------------------ revno: 106154 committer: Glenn Morris branch nick: trunk timestamp: Thu 2011-10-20 18:23:54 -0400 message: * test/automated/vc-bzr.el (vc-bzr-test-bug9781): New test. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2011-10-20 03:39:45 +0000 +++ test/ChangeLog 2011-10-20 22:23:54 +0000 @@ -1,5 +1,7 @@ 2011-10-20 Glenn Morris + * automated/vc-bzr.el (vc-bzr-test-bug9781): New test. + * automated/vc-bzr.el: New file. 2011-10-15 Glenn Morris === modified file 'test/automated/vc-bzr.el' --- test/automated/vc-bzr.el 2011-10-20 03:39:45 +0000 +++ test/automated/vc-bzr.el 2011-10-20 22:23:54 +0000 @@ -61,4 +61,41 @@ (should (search-forward "unregistered" nil t)))) (delete-directory tempdir t)))) +;; Not specific to bzr. +(ert-deftest vc-bzr-test-bug9781 () + "Test for http://debbugs.gnu.org/9781 ." + :expected-result (if (executable-find vc-bzr-program) :passed :failed) + (should (executable-find vc-bzr-program)) + (let* ((tempdir (make-temp-file "vc-bzr-test" t)) + (subdir (expand-file-name "subdir" tempdir)) + (file (expand-file-name "file" tempdir)) + (default-directory (file-name-as-directory tempdir))) + (unwind-protect + (progn + (call-process vc-bzr-program nil nil nil "init") + (make-directory subdir) + (with-temp-buffer + (insert "text") + (write-region nil nil file nil 'silent) + (write-region nil nil (expand-file-name "subfile" subdir) + nil 'silent)) + (call-process vc-bzr-program nil nil nil "add") + (call-process vc-bzr-program nil nil nil "commit" "-m" "Commit 1") + (call-process vc-bzr-program nil nil nil "remove" subdir) + (with-temp-buffer + (insert "different text") + (write-region nil nil file nil 'silent)) + (vc-dir tempdir) + (while (vc-dir-busy) + (sit-for 0.1)) + (vc-dir-mark-all-files t) + (let ((f (symbol-function 'y-or-n-p))) + (unwind-protect + (progn + (fset 'y-or-n-p (lambda (prompt) t)) + (vc-next-action nil)) + (fset 'y-or-n-p f))) + (should (get-buffer "*vc-log*"))) + (delete-directory tempdir t)))) + ;;; vc-bzr.el ends here ------------------------------------------------------------ revno: 106153 committer: Glenn Morris branch nick: trunk timestamp: Thu 2011-10-20 17:01:45 -0400 message: * lisp/vc/vc.el (vc-next-action): Handle removed directories. (Bug#9781) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-20 01:40:32 +0000 +++ lisp/ChangeLog 2011-10-20 21:01:45 +0000 @@ -1,3 +1,7 @@ +2011-10-20 Glenn Morris + + * vc/vc.el (vc-next-action): Handle removed directories. (Bug#9781) + 2011-10-20 Christoph Scholtes * emulation/cua-base.el (cua-set-mark): Fix case of string. === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2011-10-18 06:52:32 +0000 +++ lisp/vc/vc.el 2011-10-20 21:01:45 +0000 @@ -1120,9 +1120,13 @@ ;; Files have local changes ((vc-compatible-state state 'edited) (let ((ready-for-commit files)) - ;; If files are edited but read-only, give user a chance to correct + ;; If files are edited but read-only, give user a chance to correct. (dolist (file files) - (unless (file-writable-p file) + ;; If committing a mix of removed and edited files, the + ;; fileset has state = 'edited. Rather than checking the + ;; state of each individual file in the fileset, it seems + ;; simplest to just check if the file exists. Bug#9781. + (when (and (file-exists-p file) (not (file-writable-p file))) ;; Make the file+buffer read-write. (unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue? " file)) (error "Aborted")) ------------------------------------------------------------ revno: 106152 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2011-10-20 18:37:10 +0200 message: src/bidi.c: Fix a typo in a comment. diff: === modified file 'src/bidi.c' --- src/bidi.c 2011-10-20 12:39:52 +0000 +++ src/bidi.c 2011-10-20 16:37:10 +0000 @@ -2193,7 +2193,7 @@ } /* Resolve implicit levels, with a twist: PDFs get the embedding - level of the enbedding they terminate. See below for the + level of the embedding they terminate. See below for the reason. */ if (bidi_it->orig_type == PDF /* Don't do this if this formatting code didn't change the ------------------------------------------------------------ revno: 106151 fixes bug(s): http://debbugs.gnu.org/9771 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2011-10-20 14:39:52 +0200 message: Improve the speedup of bidi display introduced in revision 106124 for bug#9771. src/dispextern.h (struct bidi_it): New member next_en_type. src/bidi.c (bidi_line_init): Initialize the next_en_type member. (bidi_resolve_explicit_1): When next_en_pos is valid for the current character, check also for next_en_type being WEAK_EN. (bidi_resolve_weak): Don't enter the expensive loop if the current position is before next_en_pos. Record the bidi type of the first non-ET, non-BN character we find, in addition to its position. (bidi_level_of_next_char): Invalidate next_en_type when next_en_pos is over-stepped. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-10-20 06:52:55 +0000 +++ src/ChangeLog 2011-10-20 12:39:52 +0000 @@ -1,3 +1,16 @@ +2011-10-20 Eli Zaretskii + + * dispextern.h (struct bidi_it): New member next_en_type. + + * bidi.c (bidi_line_init): Initialize the next_en_type member. + (bidi_resolve_explicit_1): When next_en_pos is valid for the + current character, check also for next_en_type being WEAK_EN. + (bidi_resolve_weak): Don't enter the expensive loop if the current + position is before next_en_pos. Record the bidi type of the first + non-ET, non-BN character we find, in addition to its position. + (bidi_level_of_next_char): Invalidate next_en_type when + next_en_pos is over-stepped. + 2011-10-20 Paul Eggert Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794) === modified file 'src/bidi.c' --- src/bidi.c 2011-10-18 16:56:09 +0000 +++ src/bidi.c 2011-10-20 12:39:52 +0000 @@ -849,6 +849,7 @@ /* Setting this to zero will force its recomputation the first time we need it for W5. */ bidi_it->next_en_pos = 0; + bidi_it->next_en_type = UNKNOWN_BT; bidi_it->next_for_ws.type = UNKNOWN_BT; bidi_set_sor_type (bidi_it, (bidi_it->paragraph_dir == R2L ? 1 : 0), @@ -1437,7 +1438,8 @@ } } else if (bidi_it->prev.type_after_w1 == WEAK_EN /* W5/Retaining */ - || bidi_it->next_en_pos > bidi_it->charpos) + || (bidi_it->next_en_pos > bidi_it->charpos + && bidi_it->next_en_type == WEAK_EN)) type = WEAK_EN; break; case LRE: /* X3 */ @@ -1473,7 +1475,8 @@ } } else if (bidi_it->prev.type_after_w1 == WEAK_EN /* W5/Retaining */ - || bidi_it->next_en_pos > bidi_it->charpos) + || (bidi_it->next_en_pos > bidi_it->charpos + && bidi_it->next_en_type == WEAK_EN)) type = WEAK_EN; break; case PDF: /* X7 */ @@ -1499,7 +1502,8 @@ } } else if (bidi_it->prev.type_after_w1 == WEAK_EN /* W5/Retaining */ - || bidi_it->next_en_pos > bidi_it->charpos) + || (bidi_it->next_en_pos > bidi_it->charpos + && bidi_it->next_en_type == WEAK_EN)) type = WEAK_EN; break; default: @@ -1731,10 +1735,15 @@ else if (type == WEAK_ET /* W5: ET with EN before or after it */ || type == WEAK_BN) /* W5/Retaining */ { - if (bidi_it->prev.type_after_w1 == WEAK_EN /* ET/BN w/EN before it */ - || bidi_it->next_en_pos > bidi_it->charpos) + if (bidi_it->prev.type_after_w1 == WEAK_EN) /* ET/BN w/EN before it */ type = WEAK_EN; - else if (bidi_it->next_en_pos >=0) /* W5: ET/BN with EN after it. */ + else if (bidi_it->next_en_pos > bidi_it->charpos + && bidi_it->next_en_type != WEAK_BN) + { + if (bidi_it->next_en_type == WEAK_EN) /* ET/BN with EN after it */ + type = WEAK_EN; + } + else if (bidi_it->next_en_pos >=0) { EMACS_INT en_pos = bidi_it->charpos + bidi_it->nchars; const unsigned char *s = (STRINGP (bidi_it->string.lstring) @@ -1763,25 +1772,27 @@ en_pos = bidi_it->charpos; bidi_copy_it (bidi_it, &saved_it); } + /* Remember this position, to speed up processing of the + next ETs. */ + bidi_it->next_en_pos = en_pos; if (type_of_next == WEAK_EN) { /* If the last strong character is AL, the EN we've found will become AN when we get to it (W2). */ - if (bidi_it->last_strong.type_after_w1 != STRONG_AL) - { - type = WEAK_EN; - /* Remember this EN position, to speed up processing - of the next ETs. */ - bidi_it->next_en_pos = en_pos; - } + if (bidi_it->last_strong.type_after_w1 == STRONG_AL) + type_of_next = WEAK_AN; else if (type == WEAK_BN) type = NEUTRAL_ON; /* W6/Retaining */ + else + type = WEAK_EN; } else if (type_of_next == NEUTRAL_B) /* Record the fact that there are no more ENs from here to the end of paragraph, to avoid entering the loop above ever again in this paragraph. */ bidi_it->next_en_pos = -1; + /* Record the type of the character where we ended our search. */ + bidi_it->next_en_type = type_of_next; } } } @@ -2053,7 +2064,10 @@ bidi_it->next_for_neutral.type = UNKNOWN_BT; if (bidi_it->next_en_pos >= 0 && bidi_it->charpos >= bidi_it->next_en_pos) - bidi_it->next_en_pos = 0; + { + bidi_it->next_en_pos = 0; + bidi_it->next_en_type = UNKNOWN_BT; + } if (bidi_it->next_for_ws.type != UNKNOWN_BT && bidi_it->charpos >= bidi_it->next_for_ws.charpos) bidi_it->next_for_ws.type = UNKNOWN_BT; === modified file 'src/dispextern.h' --- src/dispextern.h 2011-09-21 08:13:18 +0000 +++ src/dispextern.h 2011-10-20 12:39:52 +0000 @@ -1856,7 +1856,8 @@ struct bidi_saved_info next_for_neutral; /* surrounding characters for... */ struct bidi_saved_info prev_for_neutral; /* ...resolving neutrals */ struct bidi_saved_info next_for_ws; /* character after sequence of ws */ - EMACS_INT next_en_pos; /* position of next EN char for ET */ + EMACS_INT next_en_pos; /* pos. of next char for determining ET type */ + bidi_type_t next_en_type; /* type of char at next_en_pos */ EMACS_INT ignore_bn_limit; /* position until which to ignore BNs */ bidi_dir_t sor; /* direction of start-of-run in effect */ int scan_dir; /* direction of text scan, 1: forw, -1: back */