commit 479f51a63bb0de72453881d72a1b3ff5f30b4658 (HEAD, refs/remotes/origin/master) Author: Martin Rudalics Date: Sat Feb 10 10:18:38 2018 +0100 Make tooltip code handle scenarios from Bug#30182 and Bug#30399 Move calculation of the mode line default help echo from note_mode_line_or_margin_highlight to display_mode_lines (Bug#30182). Fix cursor type for dragging the mode line. Normalize FRAME argument of Fx_show_tip before assigning it to tip_last_frame and handle the transition from GTK+ to Emacs tooltips and vice-versa in x_hide_tip (Bug#30399). * src/window.h (struct window): New Lisp member mode_line_help_echo. (wset_mode_line_help_echo): New function. * src/w32fns.c (Fx_show_tip): Normalize the FRAME argument bevore storing it in tip_last_frame (Bug#30399). * src/xdisp.c (display_mode_lines): Calculate mode line default help echo string here and store it in the window's mode_line_help_echo slot (Bug#30182). (note_mode_line_or_margin_highlight): Use value in window's mode_line_help_echo slot as mode line default help echo. When the window is resizable show a vertical drag cursor instead of the vertical scroll bar cursor. * src/xfns.c (x_hide_tip): Rewrite the GTK+ part to correctly handle the transition from GTK+ system to Emacs tooltips and vice-versa (Bug#30399). (Fx_show_tip): Normalize the FRAME argument bevore storing it in tip_last_frame (Bug#30399). diff --git a/src/w32fns.c b/src/w32fns.c index 27c765ed92..2b8c34a5ab 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -6930,7 +6930,7 @@ Lisp_Object tip_timer; /* STRING argument of last `x-show-tip' call. */ Lisp_Object tip_last_string; -/* FRAME argument of last `x-show-tip' call. */ +/* Normalized FRAME argument of last `x-show-tip' call. */ Lisp_Object tip_last_frame; /* PARMS argument of last `x-show-tip' call. */ @@ -7373,7 +7373,11 @@ Text larger than the specified size is clipped. */) specbind (Qinhibit_redisplay, Qt); CHECK_STRING (string); + + if (NILP (frame)) + frame = selected_frame; decode_window_system_frame (frame); + if (NILP (timeout)) timeout = make_number (5); else @@ -7508,7 +7512,7 @@ Text larger than the specified size is clipped. */) parms = Fcons (Fcons (Qbackground_color, build_string ("lightyellow")), parms); - /* Create a frame for the tooltip, and record it in the global + /* Create a frame for the tooltip and record it in the global variable tip_frame. */ struct frame *f; /* The value is unused. */ if (NILP (tip_frame = x_create_tip_frame (FRAME_DISPLAY_INFO (f), parms))) diff --git a/src/window.h b/src/window.h index 629283ac40..91ef7d9027 100644 --- a/src/window.h +++ b/src/window.h @@ -178,6 +178,9 @@ struct window /* An alist with parameters. */ Lisp_Object window_parameters; + /* The help echo text for this window. Qnil if there's none. */ + Lisp_Object mode_line_help_echo; + /* No Lisp data may follow below this point without changing mark_object in alloc.c. The member current_matrix must be the first non-Lisp member. */ @@ -444,6 +447,12 @@ wset_redisplay_end_trigger (struct window *w, Lisp_Object val) w->redisplay_end_trigger = val; } +INLINE void +wset_mode_line_help_echo (struct window *w, Lisp_Object val) +{ + w->mode_line_help_echo = val; +} + INLINE void wset_new_pixel (struct window *w, Lisp_Object val) { diff --git a/src/xdisp.c b/src/xdisp.c index 55f3151b4f..9a5bd2eb96 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -23209,6 +23209,23 @@ display_mode_lines (struct window *w) Lisp_Object old_frame_selected_window = XFRAME (new_frame)->selected_window; int n = 0; + if (window_wants_mode_line (w)) + { + Lisp_Object window; + Lisp_Object default_help + = buffer_local_value (Qmode_line_default_help_echo, w->contents); + + /* Set up mode line help echo. Do this before selecting w so it + can reasonably tell whether a mouse click will select w. */ + XSETWINDOW (window, w); + if (FUNCTIONP (default_help)) + wset_mode_line_help_echo (w, safe_call1 (default_help, window)); + else if (STRINGP (default_help)) + wset_mode_line_help_echo (w, default_help); + else + wset_mode_line_help_echo (w, Qnil); + } + selected_frame = new_frame; /* FIXME: If we were to allow the mode-line's computation changing the buffer or window's point, then we'd need select_window_1 here as well. */ @@ -23223,7 +23240,6 @@ display_mode_lines (struct window *w) { Lisp_Object window_mode_line_format = window_parameter (w, Qmode_line_format); - struct window *sel_w = XWINDOW (old_selected_window); /* Select mode line face based on the real selected window. */ @@ -30733,9 +30749,6 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, struct window *w = XWINDOW (window); struct frame *f = XFRAME (w->frame); Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); -#ifdef HAVE_WINDOW_SYSTEM - Display_Info *dpyinfo; -#endif Cursor cursor = No_Cursor; Lisp_Object pointer = Qnil; int dx, dy, width, height; @@ -30829,7 +30842,8 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, /* Set the help text and mouse pointer. If the mouse is on a part of the mode line without any text (e.g. past the right edge of - the mode line text), use the default help text and pointer. */ + the mode line text), use that windows's mode line help echo if it + has been set. */ if (STRINGP (string) || area == ON_MODE_LINE) { /* Arrange to display the help by setting the global variables @@ -30846,21 +30860,13 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, help_echo_object = string; help_echo_pos = charpos; } - else if (area == ON_MODE_LINE) + else if (area == ON_MODE_LINE + && !NILP (w->mode_line_help_echo)) { - Lisp_Object default_help - = buffer_local_value (Qmode_line_default_help_echo, - w->contents); - - if (FUNCTIONP (default_help) || STRINGP (default_help)) - { - help_echo_string = (FUNCTIONP (default_help) - ? safe_call1 (default_help, window) - : default_help); - XSETWINDOW (help_echo_window, w); - help_echo_object = Qnil; - help_echo_pos = -1; - } + help_echo_string = w->mode_line_help_echo; + XSETWINDOW (help_echo_window, w); + help_echo_object = Qnil; + help_echo_pos = -1; } } @@ -30872,7 +30878,6 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, || minibuf_level || NILP (Vresize_mini_windows)); - dpyinfo = FRAME_DISPLAY_INFO (f); if (STRINGP (string)) { cursor = FRAME_X_OUTPUT (f)->nontext_cursor; @@ -30882,25 +30887,28 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, /* Change the mouse pointer according to what is under X/Y. */ if (NILP (pointer) - && ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE))) + && (area == ON_MODE_LINE || area == ON_HEADER_LINE)) { Lisp_Object map; + map = Fget_text_property (pos, Qlocal_map, string); if (!KEYMAPP (map)) map = Fget_text_property (pos, Qkeymap, string); - if (!KEYMAPP (map) && draggable) - cursor = dpyinfo->vertical_scroll_bar_cursor; + if (!KEYMAPP (map) && draggable && area == ON_MODE_LINE) + cursor = FRAME_X_OUTPUT (f)->vertical_drag_cursor; } } - else if (draggable) - /* Default mode-line pointer. */ - cursor = FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor; + else if (draggable && area == ON_MODE_LINE) + cursor = FRAME_X_OUTPUT (f)->vertical_drag_cursor; + else + cursor = FRAME_X_OUTPUT (f)->nontext_cursor; } #endif } /* Change the mouse face according to what is under X/Y. */ bool mouse_face_shown = false; + if (STRINGP (string)) { mouse_face = Fget_text_property (pos, Qmouse_face, string); diff --git a/src/xfns.c b/src/xfns.c index db1ce31102..9f0d9468c1 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -6077,7 +6077,7 @@ static Lisp_Object tip_timer; /* STRING argument of last `x-show-tip' call. */ static Lisp_Object tip_last_string; -/* FRAME argument of last `x-show-tip' call. */ +/* Normalized FRAME argument of last `x-show-tip' call. */ static Lisp_Object tip_last_frame; /* PARMS argument of last `x-show-tip' call. */ @@ -6542,16 +6542,20 @@ x_hide_tip (bool delete) } #ifdef USE_GTK - /* The GTK+ system tooltip window can be found via the x_output - structure of tip_last_frame, if it still exists. */ - if (x_gtk_use_system_tooltips && NILP (tip_last_frame)) - return Qnil; - else if (!x_gtk_use_system_tooltips - && (NILP (tip_frame) - || (!delete - && FRAMEP (tip_frame) - && FRAME_LIVE_P (XFRAME (tip_frame)) - && !FRAME_VISIBLE_P (XFRAME (tip_frame))))) + /* Any GTK+ system tooltip can be found via the x_output structure of + tip_last_frame, provided that frame is still live. Any Emacs + tooltip is found via the tip_frame variable. Note that the current + value of x_gtk_use_system_tooltips might not be the same as used + for the tooltip we have to hide, see Bug#30399. */ + if ((NILP (tip_last_frame) && NILP (tip_frame)) + || (!x_gtk_use_system_tooltips + && !delete + && FRAMEP (tip_frame) + && FRAME_LIVE_P (XFRAME (tip_frame)) + && !FRAME_VISIBLE_P (XFRAME (tip_frame)))) + /* Either there's no tooltip to hide or it's an already invisible + Emacs tooltip and we don't want to change its type. Return + quickly. */ return Qnil; else { @@ -6562,10 +6566,9 @@ x_hide_tip (bool delete) specbind (Qinhibit_redisplay, Qt); specbind (Qinhibit_quit, Qt); - if (x_gtk_use_system_tooltips) + /* Try to hide the GTK+ system tip first. */ + if (FRAMEP (tip_last_frame)) { - /* The GTK+ system tooltip window is stored in the x_output - structure of tip_last_frame. */ struct frame *f = XFRAME (tip_last_frame); if (FRAME_LIVE_P (f)) @@ -6573,33 +6576,37 @@ x_hide_tip (bool delete) if (xg_hide_tooltip (f)) was_open = Qt; } - else - tip_last_frame = Qnil; } - else + + /* Reset tip_last_frame, it will be reassigned when showing the + next GTK+ system tooltip. */ + tip_last_frame = Qnil; + + /* Now look whether there's an Emacs tip around. */ + if (FRAMEP (tip_frame)) { - if (FRAMEP (tip_frame)) - { - struct frame *f = XFRAME (tip_frame); + struct frame *f = XFRAME (tip_frame); - if (FRAME_LIVE_P (f)) + if (FRAME_LIVE_P (f)) + { + if (delete || x_gtk_use_system_tooltips) { - if (delete) - { - delete_frame (tip_frame, Qnil); - tip_frame = Qnil; - } - else - x_make_frame_invisible (f); - - was_open = Qt; + /* Delete the Emacs tooltip frame when DELETE is true + or we change the tooltip type from an Emacs one to + a GTK+ system one. */ + delete_frame (tip_frame, Qnil); + tip_frame = Qnil; } else - tip_frame = Qnil; + x_make_frame_invisible (f); + + was_open = Qt; } else tip_frame = Qnil; } + else + tip_frame = Qnil; return unbind_to (count, was_open); } @@ -6721,7 +6728,10 @@ Text larger than the specified size is clipped. */) if (SCHARS (string) == 0) string = make_unibyte_string (" ", 1); + if (NILP (frame)) + frame = selected_frame; f = decode_window_system_frame (frame); + if (NILP (timeout)) timeout = make_number (5); else commit 2c980ea613115f5c2858e172f3bf9be103439a46 Author: Michael Albinus Date: Sat Feb 10 09:41:04 2018 +0100 Handle "gio monitor" in tramp-sh.el * lisp/net/tramp-sh.el (tramp-gio-events): New defconst. (tramp-sh-handle-file-notify-add-watch): Handle "gio monitor" extra. (tramp-sh-gio-monitor-process-filter) (tramp-get-remote-gio-monitor): New defuns. (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-get-remote-gvfs-monitor-dir): Do not check for gio anymore. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 5204ec725a..25c00d180b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3556,6 +3556,11 @@ Fall back to normal file name handler if no Tramp handler exists." ;; Default file name handlers, we don't care. (t (tramp-run-real-handler operation args))))))) +(defconst tramp-gio-events + '("attribute-changed" "changed" "changes-done-hint" + "created" "deleted" "moved" "pre-unmount" "unmounted") + "List of events \"gio monitor\" could send.") + (defun tramp-sh-handle-file-notify-add-watch (file-name flags _callback) "Like `file-notify-add-watch' for Tramp files." (setq file-name (expand-file-name file-name)) @@ -3581,7 +3586,19 @@ Fall back to normal file name handler if no Tramp handler exists." (mapcar (lambda (x) (intern-soft (replace-regexp-in-string "_" "-" x))) (split-string events "," 'omit)))) - ;; "gvfs-monitor-dir" or "gio monitor". + ;; "gio monitor". + ((setq command (tramp-get-remote-gio-monitor v)) + (setq filter 'tramp-sh-gio-monitor-process-filter + events + (cond + ((and (memq 'change flags) (memq 'attribute-change flags)) + '(created changed changes-done-hint moved deleted + attribute-changed)) + ((memq 'change flags) + '(created changed changes-done-hint moved deleted)) + ((memq 'attribute-change flags) '(attribute-changed))) + sequence `(,command "monitor" ,localname))) + ;; "gvfs-monitor-dir". ((setq command (tramp-get-remote-gvfs-monitor-dir v)) (setq filter 'tramp-sh-gvfs-monitor-dir-process-filter events @@ -3592,9 +3609,7 @@ Fall back to normal file name handler if no Tramp handler exists." ((memq 'change flags) '(created changed changes-done-hint moved deleted)) ((memq 'attribute-change flags) '(attribute-changed))) - sequence (if (string-match "/gio$" command) - `(,command "monitor" ,localname) - `(,command ,localname)))) + sequence `(,command ,localname))) ;; None. (t (tramp-error v 'file-notify-error @@ -3628,6 +3643,65 @@ Fall back to normal file name handler if no Tramp handler exists." p 'file-notify-error "Monitoring not supported for `%s'" file-name)) p)))) +(defun tramp-sh-gio-monitor-process-filter (proc string) + "Read output from \"gio monitor\" and add corresponding file-notify events." + (let ((events (process-get proc 'events)) + (remote-prefix + (with-current-buffer (process-buffer proc) + (file-remote-p default-directory))) + (rest-string (process-get proc 'rest-string))) + (when rest-string + (tramp-message proc 10 "Previous string:\n%s" rest-string)) + (tramp-message proc 6 "%S\n%s" proc string) + (setq string (concat rest-string string) + ;; Fix action names. + string (replace-regexp-in-string + "attributes changed" "attribute-changed" string) + string (replace-regexp-in-string + "changes done" "changes-done-hint" string) + string (replace-regexp-in-string + "renamed to" "moved" string)) + ;; https://bugs.launchpad.net/bugs/1742946 + (when (string-match "Monitoring not supported\\|No locations given" string) + (delete-process proc)) + + (while + (string-match + (concat "^[^:]+:" + "[[:space:]]\\([^:]+\\):" + "[[:space:]]" (regexp-opt tramp-gio-events t) + "\\([[:space:]]\\([^:]+\\)\\)?$") + string) + + (let* ((file (match-string 1 string)) + (file1 (match-string 4 string)) + (object + (list + proc + (list + (intern-soft (match-string 2 string))) + ;; File names are returned as absolute paths. We must + ;; add the remote prefix. + (concat remote-prefix file) + (when file1 (concat remote-prefix file1))))) + (setq string (replace-match "" nil nil string)) + ;; Remove watch when file or directory to be watched is deleted. + (when (and (member (cl-caadr object) '(moved deleted)) + (string-equal file (process-get proc 'watch-name))) + (delete-process proc)) + ;; Usually, we would add an Emacs event now. Unfortunately, + ;; `unread-command-events' does not accept several events at + ;; once. Therefore, we apply the handler directly. + (when (member (cl-caadr object) events) + (tramp-compat-funcall + 'file-notify-handle-event + `(file-notify ,object file-notify-callback))))) + + ;; Save rest of the string. + (when (zerop (length string)) (setq string nil)) + (when string (tramp-message proc 10 "Rest string:\n%s" string)) + (process-put proc 'rest-string string))) + (defun tramp-sh-gvfs-monitor-dir-process-filter (proc string) "Read output from \"gvfs-monitor-dir\" and add corresponding \ file-notify events." @@ -3643,9 +3717,6 @@ file-notify events." ;; Attribute change is returned in unused wording. string (replace-regexp-in-string "ATTRIB CHANGED" "ATTRIBUTE_CHANGED" string)) - ;; https://bugs.launchpad.net/bugs/1742946 - (when (string-match "Monitoring not supported\\|No locations given" string) - (delete-process proc)) (while (string-match (concat "^[\n\r]*" @@ -5459,6 +5530,12 @@ This command is returned only if `delete-by-moving-to-trash' is non-nil." vec (format "%s --block-size=1 --output=size,used,avail /" result)) result)))) +(defun tramp-get-remote-gio-monitor (vec) + "Determine remote `gio-monitor' command." + (with-tramp-connection-property vec "gio-monitor" + (tramp-message vec 5 "Finding a suitable `gio-monitor' command") + (tramp-find-executable vec "gio" (tramp-get-remote-path vec) t t))) + (defun tramp-get-remote-gvfs-monitor-dir (vec) "Determine remote `gvfs-monitor-dir' command." (with-tramp-connection-property vec "gvfs-monitor-dir" @@ -5466,8 +5543,7 @@ This command is returned only if `delete-by-moving-to-trash' is non-nil." ;; We distinguish "gvfs-monitor-dir.exe" from cygwin in order to ;; establish better timeouts in filenotify-tests.el. Any better ;; distinction approach would be welcome! - (or (tramp-find-executable vec "gio" (tramp-get-remote-path vec) t t) - (tramp-find-executable + (or (tramp-find-executable vec "gvfs-monitor-dir.exe" (tramp-get-remote-path vec) t t) (tramp-find-executable vec "gvfs-monitor-dir" (tramp-get-remote-path vec) t t)))) commit 875cb835f00260d58c536b3a3f7c0343fd5f28dc Merge: 05e8b4392b 0276743672 Author: Glenn Morris Date: Fri Feb 9 11:12:48 2018 -0800 Merge from origin/emacs-26 0276743 (origin/emacs-26) Doc string fix in latin-alt.el c9269af Minor improvements in package.texi 898a3e4 Minor improvement in Emacs user manual 8f7d718 * doc/lispref/anti.texi (Antinews): Replace 25.2 with 25.3. 989d0af Improve documentation of mini-window resizing 923e415 More changes in the Emacs manual 565adf2 Clarify that text-quoting-style doesn't affect *Info* (Bug#24... 2dd273b Mention that shell quoting of % on w32 may fail (Bug#19350) 19fa6d5 Fix --no-build-details for w32 and macOS 979944c * doc/lispref/anti.texi (Antinews): Add some more antinews. c2727e3 Fix crashes when run with --no-build-details dc08490 More changes for the manual 04c5bd5 Doc fixes for process functions (Bug#30349) e209034 Fix shr and CSS 4 color maps 5fe8192 Yet another round of improvements in the manual Conflicts: doc/emacs/files.texi test/lisp/subr-tests.el commit 0276743672672ce0caec7861741293a4ae11cb52 Author: Eli Zaretskii Date: Fri Feb 9 18:22:07 2018 +0200 Doc string fix in latin-alt.el * lisp/leim/quail/latin-alt.el ("dutch"): Doc fix. Reported by Robert Pluim . diff --git a/lisp/leim/quail/latin-alt.el b/lisp/leim/quail/latin-alt.el index a7d39ec839..5044fb2d29 100644 --- a/lisp/leim/quail/latin-alt.el +++ b/lisp/leim/quail/latin-alt.el @@ -1156,7 +1156,7 @@ Caters for French and Dutch. | | examples ------------+---------+---------- - others | | fl. -> ƒ eur. -> € ij -> ij IJ -> IJ + others | | fl. -> ƒ eur. -> € ------------+---------+---------- | postfix | ------------+---------+---------- commit c9269af2e36b203f30566255de8ab3ba2d9f8c35 Author: Eli Zaretskii Date: Fri Feb 9 18:18:04 2018 +0200 Minor improvements in package.texi * doc/emacs/package.texi (Package Menu): Minor wording change. (Package Installation): Use HTTPS. A better @xref to GnuPG manual. Suggested by Michael Albinus in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index 5f05bc0f9e..bc6afb7966 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi @@ -77,7 +77,7 @@ A short description of the package. @noindent The @code{list-packages} command accesses the network, to retrieve the -list of available packages from the package archive server. If the +list of available packages from package archive servers. If the network is unavailable, it falls back on the most recently retrieved list. @@ -199,7 +199,7 @@ A valid signature is not a cast-iron guarantee that a package is not malicious, so you should still exercise caution. Package archives should provide instructions on how you can obtain their public key. One way is to download the -key from a server such as @url{http://pgp.mit.edu/}. +key from a server such as @url{https://pgp.mit.edu/}. Use @kbd{M-x package-import-keyring} to import the key into Emacs. Emacs stores package keys in the directory specified by the variable @code{package-gnupghome-dir}, by default in the @file{gnupg} @@ -219,7 +219,7 @@ package that is not signed. If you use some archives that do not sign their packages, you can add them to the list @code{package-unsigned-archives}. For more information on cryptographic keys and signing, -@pxref{Top,, Top, gnupg, The GNU Privacy Guard Manual}. +@pxref{Top,, GnuPG, gnupg, The GNU Privacy Guard Manual}. Emacs comes with an interface to GNU Privacy Guard, @pxref{Top,, EasyPG, epa, Emacs EasyPG Assistant Manual}. commit 898a3e47846e78453e89f9f46673297e962dbd70 Author: Eli Zaretskii Date: Fri Feb 9 15:32:48 2018 +0200 Minor improvement in Emacs user manual * doc/emacs/files.texi (Directories): Document that 'directory-free-space-program' and 'directory-free-space-args' are only for local filesystems. Suggested by Michael Albinus in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 0b7a6bcb52..45db6d88b4 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1302,10 +1302,14 @@ default). @vindex directory-free-space-program @vindex directory-free-space-args In verbose directory listings, Emacs adds information about the -amount of free space on the disk that contains the directory. To do -this, it runs the program specified by -@code{directory-free-space-program} with arguments -@code{directory-free-space-args}. +amount of free space on the disk that contains the directory. You can +customize how this is done for local filesystems via the variables +@code{directory-free-space-program} and +@code{directory-free-space-args}: the former specifies what program to +run (default: @command{df}), the latter which arguments to pass to +that program (default is system-dependent). (On MS-Windows and +MS-DOS, these two variables are ignored, and an internal Emacs +implementation of the same functionality is used instead.) The command @kbd{M-x delete-directory} prompts for a directory's name using the minibuffer, and deletes the directory if it is empty. If commit 8f7d7184996afcf91e9119bcc297448fcd740f3d Author: Michael Albinus Date: Fri Feb 9 13:04:12 2018 +0100 * doc/lispref/anti.texi (Antinews): Replace 25.2 with 25.3. diff --git a/doc/lispref/anti.texi b/doc/lispref/anti.texi index ac0e70a501..ef28415d59 100644 --- a/doc/lispref/anti.texi +++ b/doc/lispref/anti.texi @@ -10,7 +10,7 @@ @c Update the elisp.texi Antinews menu entry with the above version number. For those users who live backwards in time, here is information about -downgrading to Emacs version 25.2. We hope you will enjoy the greater +downgrading to Emacs version 25.3. We hope you will enjoy the greater simplicity that results from the absence of many @w{Emacs @value{EMACSVER}} features. commit 989d0afce9701fb3409f5d53f0e47460be709e0e Author: Eli Zaretskii Date: Fri Feb 9 12:28:59 2018 +0200 Improve documentation of mini-window resizing * doc/lispref/minibuf.texi (Minibuffer Windows): Mention 'message-truncate-lines' for preventing resizing of minibuffer windows. (Bug#19045) (Minibuffer Misc): Remove redundant description of 'max-mini-window-height'. * doc/lispref/display.texi (Echo Area Customization): Adjust cross-reference. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index fbf943a08c..7bf03b8558 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -581,7 +581,7 @@ truncated to fit it. The variable @code{max-mini-window-height}, which specifies the maximum height for resizing minibuffer windows, also applies to the echo area (which is really a special use of the minibuffer window; -@pxref{Minibuffer Misc}). +@pxref{Minibuffer Windows}). @node Warnings @section Reporting Warnings diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 332e72f640..c7f8ba96e2 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -2323,6 +2323,12 @@ frame's height; an integer specifies the maximum number of lines. The default value is 0.25. @end defopt +Note that the values of the above two variables take effect at display +time, so let-binding them around code which produces echo-area messages +will not work. If you want to prevent resizing of minibuffer windows +when displaying long messages, bind the @code{message-truncate-lines} +variable instead (@pxref{Echo Area Customization}). + @node Minibuffer Contents @section Minibuffer Contents @@ -2450,12 +2456,6 @@ minibuffer window was selected. If the selected window is not a minibuffer window, it returns @code{nil}. @end defun -@defopt max-mini-window-height -This variable specifies the maximum height for resizing minibuffer -windows. If a float, it specifies a fraction of the height of the -frame. If an integer, it specifies a number of lines. -@end defopt - @vindex minibuffer-message-timeout @defun minibuffer-message string &rest args This function displays @var{string} temporarily at the end of the commit 923e4157baebf026910bd37b3cb5099b6aff7b3f Author: Eli Zaretskii Date: Fri Feb 9 12:08:19 2018 +0200 More changes in the Emacs manual * doc/emacs/fixit.texi (Undo): Mention 'revert-buffer'. (Fixing Case): Fix punctuation. (Spelling): Fix a typo. Suggested by Toon Claes in emacs-manual-bugs@gnu.org. * doc/emacs/modes.texi (Major Modes): Break a long sentence into 2. Reported by Stefan Kamphausen in emacs-manual-bugs@gnu.org. * doc/emacs/indent.texi (Just Spaces): Yet another minor rewording. * doc/emacs/building.texi (Watch Expressions): Improve wording. (Multithreaded Debugging): Spell "tool bar" as 2 words. Reported by Alberto Sartori in emacs-manual-bugs@gnu.org. (Grep Searching): Mention the effect of 'compilation-mode-line-errors'. (Bug#30397) * doc/emacs/basic.texi (Moving Point): Minor reformatting and rewording of what and do. diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index 11be78de68..8a8298bc2c 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi @@ -189,8 +189,9 @@ Move forward one character (@code{forward-char}). This command (@code{right-char}) behaves like @kbd{C-f}, with one exception: when editing right-to-left scripts such as Arabic, it instead moves @emph{backward} if the current paragraph is a -right-to-left paragraph. @xref{Bidirectional Editing}. If -@code{visual-order-cursor-movement} is non-@code{nil}, this command +right-to-left paragraph. @xref{Bidirectional Editing}. + +If @code{visual-order-cursor-movement} is non-@code{nil}, this command moves to the character that is to the right of the current screen position, moving to the next or previous screen line as appropriate. Note that this might potentially move point many buffer positions @@ -206,10 +207,10 @@ Move backward one character (@code{backward-char}). @findex left-char This command (@code{left-char}) behaves like @kbd{C-b}, except it moves @emph{forward} if the current paragraph is right-to-left. -@xref{Bidirectional Editing}. If @code{visual-order-cursor-movement} -is non-@code{nil}, this command moves to the character that is to the -left of the current screen position, moving to the previous or next -screen line as appropriate. +@xref{Bidirectional Editing}. + +The variable @code{visual-order-cursor-movement} affects this like +@key{RIGHT}, but moving left instead of right on the screen. @item C-n @itemx @key{DOWN} diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 7e4b68e6f7..f61e333577 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -384,6 +384,10 @@ grep -nH -e foo *.el | grep bar | grep toto can find the corresponding lines in the original files using @w{@kbd{C-x `}}, @key{RET}, and so forth, just like compilation errors. + As with compilation commands (@pxref{Compilation}), while the grep +command runs, the mode line is updated to show the number of matches +that have been seen so far. + Some grep programs accept a @samp{--color} option to output special markers around matches for the purpose of highlighting. You can make use of this feature by setting @code{grep-highlight-matches} to @@ -1218,9 +1222,9 @@ edit its value. @vindex gdb-delete-out-of-scope If the variable @code{gdb-delete-out-of-scope} is non-@code{nil} (the default value), Emacs automatically deletes watch expressions -which go out of scope. Sometimes, when re-entering the same function, -it may be useful to set this value to @code{nil} so that you don't -need to recreate the watch expression. +which go out of scope. Sometimes, when your program re-enters the +same function many times, it may be useful to set this value to +@code{nil} so that you don't need to recreate the watch expression. @vindex gdb-use-colon-colon-notation If the variable @code{gdb-use-colon-colon-notation} is @@ -1285,7 +1289,7 @@ execution control commands. value), interruption and continuation commands apply to all threads, so you can halt or continue all your threads with one command using @code{gud-stop-subjob} and @code{gud-cont}, respectively. The -@samp{Go} button is shown on the toolbar when at least one thread is +@samp{Go} button is shown on the tool bar when at least one thread is stopped, whereas @samp{Stop} button is shown when at least one thread is running. @@ -1293,8 +1297,8 @@ is running. When @code{gdb-gud-control-all-threads} is @code{nil}, only the current thread is stopped/continued. @samp{Go} and @samp{Stop} -buttons on the GUD toolbar are shown depending on the state of current -thread. +buttons on the GUD tool bar are shown depending on the state of +current thread. @end table You can change the current value of @code{gdb-gud-control-all-threads} diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index aca85f3de0..c872e9bb3a 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi @@ -78,7 +78,6 @@ the undo command. previous undo commands, use @kbd{M-x undo-only}. This is like @code{undo}, but will not redo changes you have just undone. -@c What about @kbd{M-x revert-buffer}? --xfq If you notice that a buffer has been modified accidentally, the easiest way to recover is to type @kbd{C-/} repeatedly until the stars disappear from the front of the mode line (@pxref{Mode Line}). @@ -90,6 +89,10 @@ the last change you made undone, you will see whether it was an intentional change. If it was an accident, leave it undone. If it was deliberate, redo the change as described above. +Alternatively, you can discard all the changes since the buffer was +last visited or saved with @kbd{M-x revert-buffer} +(@pxref{Reverting}). + @cindex selective undo @kindex C-u C-/ When there is an active region, any use of @code{undo} performs @@ -216,7 +219,7 @@ Convert last word to lower case with capital initial. @kindex M-@t{-} M-u @kindex M-@t{-} M-c A very common error is to type words in the wrong case. Because of this, -the word case-conversion commands @kbd{M-l}, @kbd{M-u} and @kbd{M-c} have a +the word case-conversion commands @kbd{M-l}, @kbd{M-u}, and @kbd{M-c} have a special feature when used with a negative argument: they do not move the cursor. As soon as you see you have mistyped the last word, you can simply case-convert it and go on typing. @xref{Case}. @@ -231,7 +234,7 @@ case-convert it and go on typing. @xref{Case}. single word or of a portion of a buffer. These commands only work if a spelling checker program, one of Hunspell, Aspell, Ispell or Enchant, is installed. These programs are not part of Emacs, but one -of them is usually installed in GNU/Linux and other free operating +of them is usually installed on GNU/Linux and other free operating systems. @ifnottex @xref{Top, Aspell,, aspell, The Aspell Manual}. diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi index 73f0f37515..b38e85819c 100644 --- a/doc/emacs/indent.texi +++ b/doc/emacs/indent.texi @@ -201,12 +201,12 @@ are always displayed as empty spaces extending to the next @node Just Spaces @section Tabs vs.@: Spaces - Normally, indentation commands insert (or remove) a mix of space -characters and tab characters so as to align to the desired column. -Tab characters are displayed as a stretch of empty space extending to -the next @dfn{display tab stop}. By default, there is one display tab -stop every @code{tab-width} columns (the default is 8). @xref{Text -Display}. + Normally, indentation commands insert (or remove) the shortest +possible series of tab and space characters so as to align to the +desired column. Tab characters are displayed as a stretch of empty +space extending to the next @dfn{display tab stop}. By default, there +is one display tab stop every @code{tab-width} columns (the default is +8). @xref{Text Display}. @vindex indent-tabs-mode If you prefer, all indentation can be made from spaces only. To diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi index 1312a24d98..2bbc17b26d 100644 --- a/doc/emacs/modes.texi +++ b/doc/emacs/modes.texi @@ -57,10 +57,10 @@ for specific programming languages. These include Lisp mode (which has several variants), C mode, Fortran mode, and others. The third group consists of major modes that are not associated directly with files; they are used in buffers created for specific purposes by -Emacs, such as Dired mode for buffers made by Dired (@pxref{Dired}), -Message mode for buffers made by @kbd{C-x m} (@pxref{Sending Mail}), -and Shell mode for buffers used to communicate with an inferior shell -process (@pxref{Interactive Shell}). +Emacs. Examples include Dired mode for buffers made by Dired +(@pxref{Dired}), Message mode for buffers made by @kbd{C-x m} +(@pxref{Sending Mail}), and Shell mode for buffers used to communicate +with an inferior shell process (@pxref{Interactive Shell}). Usually, the major mode is automatically set by Emacs, when you first visit a file or create a buffer (@pxref{Choosing Modes}). You commit 565adf2e90d67de2107343aaf265ec6c3e8fd165 Author: Noam Postavsky Date: Thu Feb 8 20:18:44 2018 -0500 Clarify that text-quoting-style doesn't affect *Info* (Bug#24519) * src/doc.c (syms_of_doc) : Clarify that info manual display is unaffected. diff --git a/src/doc.c b/src/doc.c index 2b36c786a6..3424bffdf9 100644 --- a/src/doc.c +++ b/src/doc.c @@ -1023,8 +1023,8 @@ syms_of_doc (void) doc: /* Style to use for single quotes in help and messages. Its value should be a symbol. It works by substituting certain single quotes for grave accent and apostrophe. This is done in help output -and in functions like `message' and `format-message'. It is not done -in `format'. +\(but not for display of Info manuals) and in functions like `message' +and `format-message'. It is not done in `format'. `curve' means quote with curved single quotes ‘like this’. `straight' means quote with straight apostrophes \\='like this\\='. commit 2dd273b9853189f2105426cffa723ced7f329fb4 Author: Noam Postavsky Date: Tue Feb 6 13:17:07 2018 -0500 Mention that shell quoting of % on w32 may fail (Bug#19350) * doc/lispref/os.texi (Security Considerations): Mention that quoting of '%' assumes no '^' in variable names. * test/lisp/subr-tests.el (shell-quote-argument-%-on-w32): New test, demonstrating what doesn't work. diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 9352a929a7..42be60449d 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -3042,7 +3042,9 @@ with @samp{-}, or might contain shell metacharacters like @samp{;}. Although functions like @code{shell-quote-argument} can help avoid this sort of problem, they are not panaceas; for example, on a POSIX platform @code{shell-quote-argument} quotes shell metacharacters but -not leading @samp{-}. @xref{Shell Arguments}. Typically it is safer +not leading @samp{-}. On MS-Windows, quoting for @samp{%} assumes +none of the environment variables have @samp{^} in their name. +@xref{Shell Arguments}. Typically it is safer to use @code{call-process} than a subshell. @xref{Synchronous Processes}. And it is safer yet to use builtin Emacs functions; for example, use @code{(rename-file "@var{a}" "@var{b}" t)} instead of diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index efafdcf832..430d719037 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -307,5 +307,22 @@ cf. Bug#25477." (should (eq (string-to-char (symbol-name (gensym))) ?g)) (should (eq (string-to-char (symbol-name (gensym "X"))) ?X))) +(ert-deftest shell-quote-argument-%-on-w32 () + "Quoting of `%' in w32 shells isn't perfect. +See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350." + :expected-result :failed + (skip-unless (and (fboundp 'w32-shell-dos-semantics) + (w32-shell-dos-semantics))) + (let ((process-environment (append '("ca^=with-caret" + "ca=without-caret") + process-environment))) + ;; It actually results in + ;; without-caret with-caret + (should (equal (shell-command-to-string + (format "echo %s %s" + "%ca%" + (shell-quote-argument "%ca%"))) + "without-caret %ca%")))) + (provide 'subr-tests) ;;; subr-tests.el ends here commit 19fa6d561abd91e9ad71a6799c5ed4f582c9f351 Author: Noam Postavsky Date: Tue Feb 6 12:20:37 2018 -0500 Fix --no-build-details for w32 and macOS * src/w32term.c (w32_initialize_display_info): Handle nil system-name. * lisp/term/ns-win.el (window-system-initialization): Don't pass nil to `x-open-connection'. diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index 618041dbe2..76b1a41456 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -834,7 +834,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (format "Creation of the standard fontset failed: %s" err) :error))) - (x-open-connection (system-name) x-command-line-resources t) + (x-open-connection (or (system-name) "") x-command-line-resources t) ;; Add GNUstep menu items Services, Hide and Quit. Rename Help to Info ;; and put it first (i.e. omit from menu-bar-final-items. diff --git a/src/w32term.c b/src/w32term.c index db4ccf5813..ac29bbbbd4 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -6922,10 +6922,15 @@ w32_initialize_display_info (Lisp_Object display_name) memset (dpyinfo, 0, sizeof (*dpyinfo)); dpyinfo->name_list_element = Fcons (display_name, Qnil); - dpyinfo->w32_id_name = xmalloc (SCHARS (Vinvocation_name) - + SCHARS (Vsystem_name) + 2); - sprintf (dpyinfo->w32_id_name, "%s@%s", - SDATA (Vinvocation_name), SDATA (Vsystem_name)); + if (STRINGP (Vsystem_name)) + { + dpyinfo->w32_id_name = xmalloc (SCHARS (Vinvocation_name) + + SCHARS (Vsystem_name) + 2); + sprintf (dpyinfo->w32_id_name, "%s@%s", + SDATA (Vinvocation_name), SDATA (Vsystem_name)); + } + else + dpyinfo->w32_id_name = xlispstrdup (Vinvocation_name); /* Default Console mode values - overridden when running in GUI mode with values obtained from system metrics. */ commit 979944c9b03ed168c85b65f880937adac0a2bf16 Author: Paul Eggert Date: Thu Feb 8 15:58:05 2018 -0800 * doc/lispref/anti.texi (Antinews): Add some more antinews. diff --git a/doc/lispref/anti.texi b/doc/lispref/anti.texi index b6df9fe2e3..ac0e70a501 100644 --- a/doc/lispref/anti.texi +++ b/doc/lispref/anti.texi @@ -47,6 +47,15 @@ sites become more and more rare as you move back in time, so having a specialized library for their support was deemed an unnecessary maintenance burden. +@item +The time conversion functions @code{current-time-string}, +@code{current-time-zone}, @code{decode-time}, +@code{format-time-string}, and @code{set-time-zone-rule} no longer +accept integer offsets as time zone rules, to make it more of a +challenge to convert foreign timestamps. Also, +@code{format-time-string} no longer converts @samp{%q} to the calendar +quarter, as that is something you can easily do for yourself. + @item Field numbers like @samp{%2$} in format specifiers are no longer available. We decided that their use makes code reading and @@ -83,12 +92,38 @@ symlink targets as you'd expect: to mean your home directory. The confusing differences between the operation of these functions in interactive and non-interactive invocations has been removed. +@item +Several functions that create or rename their files now treat their +destination specially if it happens to be a directory, even when its +name does not appear to be that of a directory. For example, +@code{(rename-file "A" "B")} no longer renames @file{A} to @file{B} if +@file{B} happens to be a directory. This is so that dealing with +files becomes more of an adventure. + +@item +The @code{format} function now returns new strings in more cases, to +place more stress on the Emacs memory manager and thereby test Emacs +better. + @item The function @file{assoc} has been simplified by removing its third optional argument. It now always uses @code{equal} for comparison. Likewise, @code{alist-get} always uses @code{assq}, and @code{map-get} and @code{map-put} always use @code{eql} for their comparisons. +@item +Numeric comparisons and the functions @code{format}, +@code{make-hash-table}, @code{min}, @code{max} and @code{logb} now +occasionally round values internally to make their results less +predictable. + +@item +The functions @code{ffloor}, @code{fceiling}l, @code{ftruncate} and +@code{fround} now accept integer arguments. Conversely, functions +like @code{decode-char} that accept floating-point integers now accept +arguments that are not integers. In both cases the results are +amusingly nonsensical sometimes. + @item GnuTLS cryptographic functions are no longer available in Emacs. We have decided that the needs for such functionality are deteriorating, @@ -104,15 +139,24 @@ broken by records. You can again use @code{string-as-unibyte}, @code{string-make-multibyte}, and other similar functions, without being annoyed by messages about their deprecation. This is in -preparation for removal of multibyte text from Emacs in the distance +preparation for removal of multibyte text from Emacs in the distant past. +@item +The @code{string-version-lessp} function has been removed, to +encourage programmers to use their own idiosyncratic methods to +determine whether one version string precedes another. + @item The function @code{read-color} no longer displays color names using each color as the background. We have determined that this surprises users and produces funny inconsistent results on color-challenged terminals. +@item +Support for 24-bit color on text terminals has been dropped, since +it wasn't needed long ago. + @item We removed the function @code{file-name-case-insensitive-p}, as testing for the OS symbol should be enough for the observable past to @@ -135,12 +179,57 @@ cases. Let simplicity rule! The function @code{mapcan} is gone; use @code{mapcar} instead, and process the resulting list as you see fit. +@item +Low-level list functions like @code{length} and @code{member} can now +loop indefinitely when given cyclic lists, causing Emacs to freeze. +This can help these functions run a tiny bit faster in the usual case +where the input is not cyclic. + +@item +The @code{write-region} function no longer propagates its +@var{lockname} argument to file name handlers. + @item You can once again write a Lisp program that returns funny random values from @code{file-attributes} by having another process alter the filesystem while Emacs is accessing the file. This can give rise to some interesting applications in the near past. +@item +The functions @code{file-attributes}, @code{file-symlink-p}, and +@code{make-symbolic-link} now quietly mutate the target of a local +symbolic link in some cases, to make it more of a challenge to deal +with arbitrary symlinks in Emacs code. + +@item +The error @code{file-missing} has been removed; operations now lump +such errors into the @code{file-error} category instead. + +@item +The function @code{delete-directory} now signals an error if operating +recursively and some other process deletes the directory before this +function gets to it. + +@item +The @code{dutch} input method now attempts to support Turkish too, +albeit incorrectly. Also, it converts @samp{IJ} and @samp{ij} to +special characters instead of leaving them alone. + +@item +Non-breaking hyphens and approximations to quotes are now displayed +just with the @code{escape-glyph} face instead of having faces of +their own. This is simpler and gives the user amusing puzzles to +solve when viewing text containing these characters. + +@item +The user option @code{electric-quote-context-sensitive} and the +variable @code{electric-quote-inhibit-functions}, so that electric +quoting is simpler and more likely to do the wrong thing. + +@item +The user option @code{text-quoting-style} has been removed, and is now +just a variable. + @item We have removed the functions @code{file-name-quote}, @code{file-name-unquote}, and @code{file-name-quoted-p}. Writing code @@ -159,6 +248,34 @@ We decided that the format of mode line and header line should be customizable only based on buffers; the @code{mode-line-format} and @code{header-line-format} window parameters have been removed. +@item +Emacs now normally builds a limited @command{movemail} substitute that +retrieves POP3 email only via insecure channels, and the +configure-time option @option{--with-mailutils} has been removed. +This simplifies Emacs setup when security is not important. + +@item +The configure-time option @option{--enable-gcc-warnings=warn-only} +has been removed, so that build-time warnings are always fatal now. + +@item +The configure-time option @option{--disable-build-details} has been +removed. This way, Emacs builds are unique and irreproducible. + +@item +The variable @code{emacs-version} now includes the build number +instead of storing it separately in @code{emacs-build-number}. + +@item +Emacs has been ported to IRIX. + +@item +Several options and variables have been removed to simplify Emacs and +potentially make it less reliable. These include the +@option{--module-assertions} option, the +@code{attempt-stack-overflow-recovery} variable, and the +@code{attempt-orderly-shutdown-on-fatal-signal} variable. + @item As part of the ongoing quest for simplicity, many other functions and variables have been eliminated. commit c2727e3c40bcafdc7c32b3f02b78e6cbe87e1647 Author: Paul Eggert Date: Tue Feb 6 15:25:45 2018 -0800 Fix crashes when run with --no-build-details * src/xrdb.c (get_environ_db): * src/xterm.c (same_x_server, x_term_init): Don’t assume Fsystem_name returns a string. diff --git a/src/xrdb.c b/src/xrdb.c index b55c0f9011..836c147947 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -376,15 +376,18 @@ get_environ_db (void) if (!p) { - /* Use ~/.Xdefaults-HOSTNAME. */ - char *home = gethomedir (); - ptrdiff_t homelen = strlen (home); Lisp_Object system_name = Fsystem_name (); - ptrdiff_t filenamesize = (homelen + sizeof xdefaults - + 1 + SBYTES (system_name)); - p = filename = xrealloc (home, filenamesize); - lispstpcpy (stpcpy (stpcpy (filename + homelen, xdefaults), "-"), - system_name); + if (STRINGP (system_name)) + { + /* Use ~/.Xdefaults-HOSTNAME. */ + char *home = gethomedir (); + ptrdiff_t homelen = strlen (home); + ptrdiff_t filenamesize = (homelen + sizeof xdefaults + + 1 + SBYTES (system_name)); + p = filename = xrealloc (home, filenamesize); + lispstpcpy (stpcpy (stpcpy (filename + homelen, xdefaults), "-"), + system_name); + } } db = XrmGetFileDatabase (p); diff --git a/src/xterm.c b/src/xterm.c index 364a8a8db0..b10664dda9 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -12150,6 +12150,8 @@ same_x_server (const char *name1, const char *name2) { bool seen_colon = false; Lisp_Object sysname = Fsystem_name (); + if (! STRINGP (sysname)) + sysname = empty_unibyte_string; const char *system_name = SSDATA (sysname); ptrdiff_t system_name_length = SBYTES (sysname); ptrdiff_t length_until_period = 0; @@ -12572,15 +12574,19 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) #endif Lisp_Object system_name = Fsystem_name (); - ptrdiff_t nbytes; - if (INT_ADD_WRAPV (SBYTES (Vinvocation_name), SBYTES (system_name) + 2, - &nbytes)) + + ptrdiff_t nbytes = SBYTES (Vinvocation_name) + 1; + if (STRINGP (system_name) + && INT_ADD_WRAPV (nbytes, SBYTES (system_name) + 1, &nbytes)) memory_full (SIZE_MAX); dpyinfo->x_id = ++x_display_id; dpyinfo->x_id_name = xmalloc (nbytes); char *nametail = lispstpcpy (dpyinfo->x_id_name, Vinvocation_name); - *nametail++ = '@'; - lispstpcpy (nametail, system_name); + if (STRINGP (system_name)) + { + *nametail++ = '@'; + lispstpcpy (nametail, system_name); + } /* Figure out which modifier bits mean what. */ x_find_modifier_meanings (dpyinfo); commit dc08490ac7547403e306b1ba2c00a158933854ff Author: Eli Zaretskii Date: Thu Feb 8 18:24:16 2018 +0200 More changes for the manual * doc/emacs/anti.texi (Antinews): Replace 25.2 with 25.3. Reported by Michael Albinus in emacs-manual-bugs@gnu.org. * doc/emacs/custom.texi (Function Keys): Improve wording. Suggested by clemens.radermacher@posteo.de in emacs-manual-bugs@gnu.org. * doc/emacs/misc.texi (History References): Improve punctuation. (Terminal emulator): Fix a typo. (Term Mode): Remove redundant repeated text. (Invoking emacsclient): Improve wording. Suggested by Alberto Sartori in emacs-manual-bugs@gnu.org. * doc/emacs/files.texi (Visiting): Fix last change. diff --git a/doc/emacs/anti.texi b/doc/emacs/anti.texi index 0ae8159574..b91516315a 100644 --- a/doc/emacs/anti.texi +++ b/doc/emacs/anti.texi @@ -8,7 +8,7 @@ @c Update the emacs.texi Antinews menu entry with the above version number. For those users who live backwards in time, here is information -about downgrading to Emacs version 25.2. We hope you will enjoy the +about downgrading to Emacs version 25.3. We hope you will enjoy the greater simplicity that results from the absence of many @w{Emacs @value{EMACSVER}} features. @@ -59,7 +59,7 @@ should be monochrome, but you will have to keep downgrading to older Emacs versions to have that feature back.) @item -Emacs 25.2 no longer supports magic signatures of the form +Emacs 25.3 no longer supports magic signatures of the form @samp{#!/usr/bin/env @var{interpreter}} in scripts. Moving back in time means you are getting closer to the ideal of the original Unix design where all the interpreters lived in a single directory @@ -70,7 +70,7 @@ ballast. The double-buffering feature of Emacs display on X has been removed. We decided that its complexity and a few random surprising side-effects aren't justified by the gains, even though those gains -were hailed in some quarters. Yes, Emacs 25.2 will flicker in some +were hailed in some quarters. Yes, Emacs 25.3 will flicker in some use cases, but we are sure Emacs users will be able to suck it, as they have been doing for years. Since this feature is gone, we've also removed the @code{inhibit-double-buffering} frame parameter, @@ -137,7 +137,7 @@ all those fancy options! @item The complication known as ``single-line horizontal scrolling'' is no -longer with you in Emacs 25.2. This feature was a bow to ``other +longer with you in Emacs 25.3. This feature was a bow to ``other editors''; instead, let those other editors bow to Emacs by hscrolling the entire window at all times. Repeat after me: ``The Emacs way is the Only Way!'' @@ -166,5 +166,5 @@ removed. Examples include @code{replace-buffer-contents} and @item To keep up with decreasing computer memory capacity and disk space, many -other functions and files have been eliminated in Emacs 25.2. +other functions and files have been eliminated in Emacs 25.3. @end itemize diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 5b2ab8280d..e27760b379 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1859,7 +1859,7 @@ key. Many keyboards have a numeric keypad on the right hand side. The numeric keys in the keypad double up as cursor motion keys, toggled by a key labeled @samp{Num Lock}. By default, Emacs -translates these keys to the corresponding keys in the main keyboard. +translates these keys to the corresponding keys on the main keyboard. For example, when @samp{Num Lock} is on, the key labeled @samp{8} on the numeric keypad produces @code{kp-8}, which is translated to @kbd{8}; when @samp{Num Lock} is off, the same key produces diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 44d19d5bd7..0b7a6bcb52 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -293,8 +293,8 @@ see @ref{Drag and Drop}, and @ref{Misc Dired Features}. On text-mode terminals and on graphical displays when Emacs was built without a GUI toolkit, you can visit files via the menu-bar -@samp{File} menu, which has a @samp{Visit New File} and @samp{Open -File} items. +@samp{File} menu, which has the @samp{Visit New File} and the +@samp{Open File} items. Each time you visit a file, Emacs automatically scans its contents to detect what character encoding and end-of-line convention it uses, diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index ccb213f81b..5babd5081a 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -1212,7 +1212,7 @@ buffer after it has been sent. @subsubsection Shell History References @cindex history reference - Various shells including csh and bash support @dfn{history + Various shells, including csh and bash, support @dfn{history references} that begin with @samp{!} and @samp{^}. Shell mode recognizes these constructs, and can perform the history substitution for you. @@ -1406,8 +1406,8 @@ by the faces @code{term-color-black}, @code{term-color-red}, @code{term-color-underline}, and @code{term-color-bold}. @xref{Faces}. - You can also Term mode to communicate with a device connected to a -serial port. @xref{Serial Terminal}. + You can also use Term mode to communicate with a device connected to +a serial port. @xref{Serial Terminal}. The file name used to load the subshell is determined the same way as for Shell mode. To make multiple terminal emulators, rename the @@ -1427,12 +1427,8 @@ and later. @cindex Term mode @cindex mode, Term - The terminal emulator uses Term mode, which has two input modes. In -line mode, Term basically acts like Shell mode (@pxref{Shell Mode}). -In char mode, each character is sent directly to the subshell, except -for the Term escape character, normally @kbd{C-c}. - - To switch between line and char mode, use these commands: + To switch between line and char mode in Term mode, use these +commands: @table @kbd @kindex C-c C-j @r{(Term mode)} @@ -1720,8 +1716,8 @@ Server})---then Emacs opens a frame on the terminal in which you called @command{emacsclient}. You can also force @command{emacsclient} to open a new frame on a -graphical display, or on a text terminal, using the @samp{-c} and -@samp{-t} options. @xref{emacsclient Options}. +graphical display using the @samp{-c} option, or on a text terminal +using the @samp{-t} option. @xref{emacsclient Options}. If you are running on a single text terminal, you can switch between @command{emacsclient}'s shell and the Emacs server using one of two commit 04c5bd5b1f1dc07994d70caa640a07da6b5a54b5 Author: Noam Postavsky Date: Mon Feb 5 19:36:27 2018 -0500 Doc fixes for process functions (Bug#30349) * doc/lispref/processes.texi (Asynchronous Processes): Explain what the 'stopped' state means for a pipe process. * src/process.c (Fmake_process, Fmake_pipe_process) (Fmake_serial_process, Fmake_network_process): * lisp/subr.el (start-process): * lisp/net/tls.el (open-tls-stream): * lisp/net/starttls.el (starttls-open-stream): * lisp/net/gnutls.el (open-gnutls-stream): Remove meaningless phrase "specify an output stream" phrase from docstring. diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index 8a8425cb84..34426f339c 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -728,8 +728,11 @@ Initialize the process query flag to @var{query-flag}. @xref{Query Before Exit}. @item :stop @var{stopped} -If @var{stopped} is non-@code{nil}, start the process in the -stopped state. +If @var{stopped} is non-@code{nil}, start the process in the stopped +state. In the stopped state, a pipe process does not accept incoming +data, but you can send outgoing data. The stopped state is set by +@code{stop-process} and cleared by @code{continue-process} +(@pxref{Signals to Processes}). @item :filter @var{filter} Initialize the process filter to @var{filter}. If not specified, a diff --git a/lisp/net/gnutls.el b/lisp/net/gnutls.el index 5afd5c5804..ea17fb518e 100644 --- a/lisp/net/gnutls.el +++ b/lisp/net/gnutls.el @@ -124,7 +124,7 @@ Args are NAME BUFFER HOST SERVICE. NAME is name for process. It is modified if necessary to make it unique. BUFFER is the buffer (or `buffer-name') to associate with the process. Process output goes at end of that buffer, unless you specify - an output stream or filter function to handle the output. + a filter function to handle the output. BUFFER may be also nil, meaning that this process is not associated with any buffer Third arg is name of the host to connect to, or its IP address. diff --git a/lisp/net/starttls.el b/lisp/net/starttls.el index 2069843e3b..e2dff2d53d 100644 --- a/lisp/net/starttls.el +++ b/lisp/net/starttls.el @@ -270,7 +270,7 @@ Args are NAME BUFFER HOST PORT. NAME is name for process. It is modified if necessary to make it unique. BUFFER is the buffer (or `buffer-name') to associate with the process. Process output goes at end of that buffer, unless you specify - an output stream or filter function to handle the output. + a filter function to handle the output. BUFFER may be also nil, meaning that this process is not associated with any buffer Third arg is name of the host to connect to, or its IP address. diff --git a/lisp/net/tls.el b/lisp/net/tls.el index ae49edcb1d..b02a2654d4 100644 --- a/lisp/net/tls.el +++ b/lisp/net/tls.el @@ -204,7 +204,7 @@ Args are NAME BUFFER HOST PORT. NAME is name for process. It is modified if necessary to make it unique. BUFFER is the buffer (or buffer name) to associate with the process. Process output goes at end of that buffer, unless you specify - an output stream or filter function to handle the output. + a filter function to handle the output. BUFFER may be also nil, meaning that this process is not associated with any buffer Third arg is name of the host to connect to, or its IP address. diff --git a/lisp/subr.el b/lisp/subr.el index 64cbbd52ab..2de5b3766c 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2110,10 +2110,10 @@ and the file name is displayed in the echo area." NAME is name for process. It is modified if necessary to make it unique. BUFFER is the buffer (or buffer name) to associate with the process. -Process output (both standard output and standard error streams) goes -at end of BUFFER, unless you specify an output stream or filter -function to handle the output. BUFFER may also be nil, meaning that -this process is not associated with any buffer. +Process output (both standard output and standard error streams) +goes at end of BUFFER, unless you specify a filter function to +handle the output. BUFFER may also be nil, meaning that this +process is not associated with any buffer. PROGRAM is the program file name. It is searched for in `exec-path' \(which see). If nil, just associate a pty with the buffer. Remaining diff --git a/src/process.c b/src/process.c index 8a438cfeb8..c561d01060 100644 --- a/src/process.c +++ b/src/process.c @@ -1618,9 +1618,8 @@ to make it unique. :buffer BUFFER -- BUFFER is the buffer (or buffer-name) to associate with the process. Process output goes at end of that buffer, unless -you specify an output stream or filter function to handle the output. -BUFFER may be also nil, meaning that this process is not associated -with any buffer. +you specify a filter function to handle the output. BUFFER may be +also nil, meaning that this process is not associated with any buffer. :command COMMAND -- COMMAND is a list starting with the program file name, followed by strings to give to the program as arguments. @@ -2310,8 +2309,8 @@ arguments are defined: :buffer BUFFER -- BUFFER is the buffer (or buffer-name) to associate with the process. Process output goes at the end of that buffer, -unless you specify an output stream or filter function to handle the -output. If BUFFER is not given, the value of NAME is used. +unless you specify a filter function to handle the output. If BUFFER +is not given, the value of NAME is used. :coding CODING -- If CODING is a symbol, it specifies the coding system used for both reading and writing for this process. If CODING @@ -3025,8 +3024,8 @@ the value of PORT is used. :buffer BUFFER -- BUFFER is the buffer (or buffer-name) to associate with the process. Process output goes at the end of that buffer, -unless you specify an output stream or filter function to handle the -output. If BUFFER is not given, the value of NAME is used. +unless you specify a filter function to handle the output. If BUFFER +is not given, the value of NAME is used. :coding CODING -- If CODING is a symbol, it specifies the coding system used for both reading and writing for this process. If CODING @@ -3688,9 +3687,8 @@ to make it unique. :buffer BUFFER -- BUFFER is the buffer (or buffer-name) to associate with the process. Process output goes at end of that buffer, unless -you specify an output stream or filter function to handle the output. -BUFFER may be also nil, meaning that this process is not associated -with any buffer. +you specify a filter function to handle the output. BUFFER may be +also nil, meaning that this process is not associated with any buffer. :host HOST -- HOST is name of the host to connect to, or its IP address. The symbol `local' specifies the local host. If specified commit e209034536b11fbbba19f46a45f6afc316890a5d Author: Basil L. Contovounesios Date: Wed Feb 7 02:49:08 2018 +0000 Fix shr and CSS 4 color maps * lisp/net/shr-color.el (shr-color-html-colors-alist): Fix typos. Add RebeccaPurple. * lisp/textmodes/css-mode.el (css--color-map): Add fuchsia-magenta and aqua-cyan aliases. * test/lisp/textmodes/css-mode-tests.el (css-test-property-values): Bump color count. diff --git a/lisp/net/shr-color.el b/lisp/net/shr-color.el index 60d44b3cd6..ca7d1ce55a 100644 --- a/lisp/net/shr-color.el +++ b/lisp/net/shr-color.el @@ -137,7 +137,7 @@ absolute value without any unit." ("MediumAquaMarine" . "#66CDAA") ("MediumBlue" . "#0000CD") ("MediumOrchid" . "#BA55D3") - ("MediumPurple" . "#9370D8") + ("MediumPurple" . "#9370DB") ("MediumSeaGreen" . "#3CB371") ("MediumSlateBlue" . "#7B68EE") ("MediumSpringGreen" . "#00FA9A") @@ -158,7 +158,7 @@ absolute value without any unit." ("PaleGoldenRod" . "#EEE8AA") ("PaleGreen" . "#98FB98") ("PaleTurquoise" . "#AFEEEE") - ("PaleVioletRed" . "#D87093") + ("PaleVioletRed" . "#DB7093") ("PapayaWhip" . "#FFEFD5") ("PeachPuff" . "#FFDAB9") ("Peru" . "#CD853F") @@ -166,6 +166,7 @@ absolute value without any unit." ("Plum" . "#DDA0DD") ("PowderBlue" . "#B0E0E6") ("Purple" . "#800080") + ("RebeccaPurple" . "#663399") ("Red" . "#FF0000") ("RosyBrown" . "#BC8F8F") ("RoyalBlue" . "#4169E1") diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 922c1bfe13..febf7c6613 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -498,6 +498,7 @@ further value candidates, since that list would be infinite.") ("red" . "#ff0000") ("purple" . "#800080") ("fuchsia" . "#ff00ff") + ("magenta" . "#ff00ff") ("green" . "#008000") ("lime" . "#00ff00") ("olive" . "#808000") @@ -506,6 +507,7 @@ further value candidates, since that list would be infinite.") ("blue" . "#0000ff") ("teal" . "#008080") ("aqua" . "#00ffff") + ("cyan" . "#00ffff") ("orange" . "#ffa500") ("aliceblue" . "#f0f8ff") ("antiquewhite" . "#faebd7") diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el index 04a13e3824..d4fb348326 100644 --- a/test/lisp/textmodes/css-mode-tests.el +++ b/test/lisp/textmodes/css-mode-tests.el @@ -58,7 +58,7 @@ ;; Check that the `color' property doesn't cause infinite recursion ;; because it refers to the value class of the same name. - (should (= (length (css--property-values "color")) 152))) + (should (= (length (css--property-values "color")) 154))) (ert-deftest css-test-property-value-cache () "Test that `css--property-value-cache' is in use." commit 5fe81923e5b6dbbfb623befa12a3317a7e934a63 Author: Eli Zaretskii Date: Wed Feb 7 22:24:13 2018 +0200 Yet another round of improvements in the manual * doc/emacs/misc.texi (Document View): Improve wording. Reported by lyr3 in emacs-manual-bugs@gnu.org. * doc/emacs/files.texi (Recover): Fix a typo. Reported by Jorge in emacs-manual-bugs@gnu.org. * doc/emacs/anti.texi (Antinews): Fix typos. Reported by Justin Heyes-Jones in emacs-manual-bugs@gnu.org. * doc/emacs/mini.texi (Basic Minibuffer): Clarify wording. Reported by Vivishek Sudhir in emacs-manual-bugs@gnu.org. * doc/emacs/cmdargs.texi (MS-Windows Registry): Improve wording regarding registry keys. * doc/emacs/macos.texi (Mac OS / GNUstep): Sayu "NeXT Inc." Reported by Cena Mayo in emacs-manual-bugs@gnu.org. * doc/emacs/screen.texi (Screen): More accurate wording. Suggested by Miloš Polakovič in emacs-manual-bugs@gnu.org. * doc/emacs/indent.texi (Just Spaces): Minor wording change. Suggested by David Bonnafous in emacs-manual-bugs@gnu.org. * doc/emacs/text.texi (TeX Mode, TeX Editing): Improve and simplify wording. Suggested by root@vxid.pw in emacs-manual-bugs@gnu.org. * doc/emacs/cmdargs.texi (Window Size X): Minor wording change. * doc/emacs/display.texi (Highlight Interactively): Fill text. (Optional Mode Line): Fix typos. Suggested by Alberto Sartori in emacs-manual-bugs@gnu.org. * doc/emacs/building.texi (Debugger Operation): Clarify wording. * doc/emacs/files.texi (Directories, Comparing Files, Diff Mode) (Remote Files, File Names, Visiting, Backup Deletion) (Customize Save, Interlocking): Improve wording and accuracy of the text. * doc/emacs/maintaining.texi (VC With A Merging VCS): Don't say "his". * doc/emacs/arevert-xtra.texi (Auto Reverting Dired): Minor wording changes. (Supporting additional buffers): Moved to ... * doc/lispref/backups.texi (Reverting): ... here. * doc/emacs/emacs.texi (Top): Remove "Supporting additional buffers" from master menu. * doc/emacs/files.texi (Reverting): Mention use of file notifications. Suggested by Michael Albinus in emacs-manual-bugs@gnu.org. * doc/emacs/rmail.texi (Rmail Motion): Clarify what '-' does to 'M-s'. Suggested by Arthur Milchior in emacs-manual-bugs@gnu.org. * doc/emacs/cmdargs.texi (Initial Options): Capitalize "Emacs". (Action Arguments): Fix a typo. (Emacs Invocation): Replace em-dash with a comma. Suggested by Justin Heyes-Jones in emacs-manual-bugs@gnu.org. * doc/emacs/m-x.texi (M-x): Add an example. Suggested by Alberto Sartori in emacs-manual-bugs@gnu.org. * doc/emacs/calendar.texi (Calendar/Diary, Calendar Unit Motion): Minor wording changes. diff --git a/doc/emacs/anti.texi b/doc/emacs/anti.texi index d4b68a2fac..0ae8159574 100644 --- a/doc/emacs/anti.texi +++ b/doc/emacs/anti.texi @@ -47,7 +47,7 @@ development will make that unnecessary. @item The @option{--fg-daemon} is gone, leaving only @option{--daemon}. No -need to procrastinate on the dilemma whether you do or don't want the +need to procrastinate on the dilemma whether you do or do not want the new shiny ``headless Emacs'' thingy. Hail, simplicity! @item @@ -71,10 +71,10 @@ The double-buffering feature of Emacs display on X has been removed. We decided that its complexity and a few random surprising side-effects aren't justified by the gains, even though those gains were hailed in some quarters. Yes, Emacs 25.2 will flicker in some -use cases, but we are sure Emacs users will be able to suck it, a they -have been doing for years. Since this feature is gone, we've also -removed the @code{inhibit-double-buffering} frame parameter, which is -now unnecessary. +use cases, but we are sure Emacs users will be able to suck it, as +they have been doing for years. Since this feature is gone, we've +also removed the @code{inhibit-double-buffering} frame parameter, +which is now unnecessary. @item Non-breaking hyphens and ASCII characters displayed instead of diff --git a/doc/emacs/arevert-xtra.texi b/doc/emacs/arevert-xtra.texi index a619fed4b8..45fca1f508 100644 --- a/doc/emacs/arevert-xtra.texi +++ b/doc/emacs/arevert-xtra.texi @@ -40,7 +40,6 @@ explained in the corresponding sections. @menu * Auto Reverting the Buffer Menu:: Auto Revert of the Buffer Menu. * Auto Reverting Dired:: Auto Revert of Dired buffers. -* Supporting additional buffers:: How to add more Auto Revert support. @end menu @node Auto Reverting the Buffer Menu @@ -68,13 +67,9 @@ automatically erasing the marks. @node Auto Reverting Dired @subsection Auto Reverting Dired buffers -Auto-reverting Dired buffers currently works on GNU or Unix style -operating systems. It may not work satisfactorily on some other -systems. - Dired buffers only auto-revert when the file list of the buffer's main -directory changes (e.g., when a new file is added). They do not -auto-revert when information about a particular file changes +directory changes (e.g., when a new file is added or deleted). They +do not auto-revert when information about a particular file changes (e.g., when the size changes) or when inserted subdirectories change. To be sure that @emph{all} listed information is up to date, you have to manually revert using @kbd{g}, @emph{even} if auto-reverting is @@ -98,99 +93,10 @@ If you want auto-reverting to resume in the presence of marks and flags, mark the buffer non-modified using @kbd{M-~}. However, adding, deleting or changing marks or flags will mark it modified again. -Remote Dired buffers are not auto-reverted (because it may be slow). -Neither are Dired buffers for which you used shell wildcards or file -arguments to list only some of the files. @file{*Find*} and -@file{*Locate*} buffers do not auto-revert either. - -@c FIXME? This should be in the elisp manual? -@node Supporting additional buffers -@subsection Adding Support for Auto-Reverting additional Buffers. - -This section is intended for Elisp programmers who would like to add -support for auto-reverting new types of buffers. - -To support auto-reverting the buffer must first of all have a suitable -@code{revert-buffer-function}. @xref{Definition of -revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}. - -In addition, it must have a suitable @code{buffer-stale-function}. - -@c FIXME only defvar in all of doc/emacs! -@defvar buffer-stale-function -The value of this variable is a function to check whether a -buffer needs reverting. This should be a function with one optional -argument @var{noconfirm}. The function should return non-@code{nil} -if the buffer should be reverted. The buffer is current when this -function is called. - -While this function is mainly intended for use in auto-reverting, it -could be used for other purposes as well. For instance, if -auto-reverting is not enabled, it could be used to warn the user that -the buffer needs reverting. The idea behind the @var{noconfirm} -argument is that it should be @code{t} if the buffer is going to be -reverted without asking the user and @code{nil} if the function is -just going to be used to warn the user that the buffer is out of date. -In particular, for use in auto-reverting, @var{noconfirm} is @code{t}. -If the function is only going to be used for auto-reverting, you can -ignore the @var{noconfirm} argument. - -If you just want to automatically auto-revert every -@code{auto-revert-interval} seconds (like the Buffer Menu), use: - -@example -(setq-local buffer-stale-function - #'(lambda (&optional noconfirm) 'fast)) -@end example - -@noindent -in the buffer's mode function. - -The special return value @samp{fast} tells the caller that the need -for reverting was not checked, but that reverting the buffer is fast. -It also tells Auto Revert not to print any revert messages, even if -@code{auto-revert-verbose} is non-@code{nil}. This is important, as -getting revert messages every @code{auto-revert-interval} seconds can -be very annoying. The information provided by this return value could -also be useful if the function is consulted for purposes other than -auto-reverting. -@end defvar - -Once the buffer has a suitable @code{revert-buffer-function} and -@code{buffer-stale-function}, several problems usually remain. - -The buffer will only auto-revert if it is marked unmodified. Hence, -you will have to make sure that various functions mark the buffer -modified if and only if either the buffer contains information that -might be lost by reverting, or there is reason to believe that the user -might be inconvenienced by auto-reverting, because he is actively -working on the buffer. The user can always override this by manually -adjusting the modified status of the buffer. To support this, calling -the @code{revert-buffer-function} on a buffer that is marked -unmodified should always keep the buffer marked unmodified. - -It is important to assure that point does not continuously jump around -as a consequence of auto-reverting. Of course, moving point might be -inevitable if the buffer radically changes. - -You should make sure that the @code{revert-buffer-function} does not -print messages that unnecessarily duplicate Auto Revert's own messages, -displayed if @code{auto-revert-verbose} is @code{t}, and effectively -override a @code{nil} value for @code{auto-revert-verbose}. Hence, -adapting a mode for auto-reverting often involves getting rid of such -messages. This is especially important for buffers that automatically -revert every @code{auto-revert-interval} seconds. - -If the new auto-reverting is part of Emacs, you should mention it -in the documentation string of @code{global-auto-revert-non-file-buffers}. +Remote Dired buffers are currently not auto-reverted. Neither are +Dired buffers for which you used shell wildcards or file arguments to +list only some of the files. @file{*Find*} and @file{*Locate*} +buffers do not auto-revert either. -@ifinfo -Similarly, you should add a node to this chapter's menu. This node -@end ifinfo -@ifnotinfo -Similarly, you should add a section to this chapter. This section -@end ifnotinfo -should at the very least make clear whether enabling auto-reverting -for the buffer reliably assures that all information in the buffer is -completely up to date (or will be after @code{auto-revert-interval} -seconds). +Note that auto-reverting Dired buffers may not work satisfactorily on +some systems. diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 3b645d5e65..7e4b68e6f7 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -607,15 +607,16 @@ to recompile and restart the program. @vindex gud-tooltip-echo-area GUD Tooltip mode is a global minor mode that adds tooltip support to GUD@. To toggle this mode, type @kbd{M-x gud-tooltip-mode}. It is -disabled by default. If enabled, you can move the mouse cursor over a +disabled by default. If enabled, you can move the mouse pointer over a variable, a function, or a macro (collectively called @dfn{identifiers}) to show their values in tooltips -(@pxref{Tooltips}). Alternatively, mark an identifier or an -expression by dragging the mouse over it, then leave the mouse in the -marked area to have the value of the expression displayed in a -tooltip. The GUD Tooltip mode takes effect in the GUD interaction -buffer, and in all source buffers with major modes listed in the -variable @code{gud-tooltip-modes}. If the variable +(@pxref{Tooltips}). If just placing the mouse pointer over an +expression doesn't show the value of the expression you had in mind, +you can tell Emacs more explicitly what expression to evaluate by +dragging the mouse over the expression, then leaving the mouse inside +the marked area. The GUD Tooltip mode takes effect in the GUD +interaction buffer, and in all source buffers with major modes listed +in the variable @code{gud-tooltip-modes}. If the variable @code{gud-tooltip-echo-area} is non-@code{nil}, or if you turned off the tooltip mode, values are shown in the echo area instead of a tooltip. diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi index ed1f53fa70..be5af998e7 100644 --- a/doc/emacs/calendar.texi +++ b/doc/emacs/calendar.texi @@ -12,7 +12,7 @@ planned or past events. It also has facilities for managing your appointments, and keeping track of how much time you spend working on certain projects. - To enter the calendar, type @kbd{M-x calendar}; this displays a + To enter the calendar, type @kbd{M-x calendar}. This displays a three-month calendar centered on the current month, with point on the current date. With a numeric argument, as in @kbd{C-u M-x calendar}, it prompts you for the month and year to be the center of the three-month @@ -126,10 +126,11 @@ whole year. The easiest way to remember these commands is to consider months and years analogous to paragraphs and pages of text, respectively. But -the commands themselves are not quite analogous. The ordinary Emacs -paragraph commands move to the beginning or end of a paragraph, -whereas these month and year commands move by an entire month or an -entire year, keeping the same date within the month or year. +the calendar movement commands themselves do not quite parallel those +for movement through text: the ordinary Emacs paragraph commands move +to the beginning or end of a paragraph, whereas these month and year +commands move by an entire month or an entire year, keeping the same +date within the month or year. All these commands accept a numeric argument as a repeat count. For convenience, the digit keys and the minus sign specify numeric diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 63db2ac765..e463e7c819 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -41,10 +41,11 @@ corresponding long form. type. However, you don't have to spell out the whole option name; any unambiguous abbreviation is enough. When a long option takes an argument, you can use either a space or an equal sign to separate the -option name and the argument. Thus, you can write either -@samp{--display sugar-bombs:0.0} or @samp{--display=sugar-bombs:0.0}. -We recommend an equal sign because it makes the relationship clearer, -and the tables below always show an equal sign. +option name and the argument. Thus, for the option @samp{--display}, +you can write either @samp{--display sugar-bombs:0.0} or +@samp{--display=sugar-bombs:0.0}. We recommend an equal sign because +it makes the relationship clearer, and the tables below always show an +equal sign. @cindex initial options (command line) @cindex action options (command line) @@ -104,7 +105,7 @@ If the startup buffer is disabled (@pxref{Entering Emacs}), then starting Emacs with one file argument displays the buffer visiting @var{file} in a single window. With two file arguments, Emacs displays the files in two different windows. With more than two file -argument, Emacs displays the last file specified in one window, plus +arguments, Emacs displays the last file specified in one window, plus another window with a Buffer Menu showing all the other files (@pxref{Several Buffers}). To inhibit using the Buffer Menu for this, change the variable @code{inhibit-startup-buffer-menu} to @code{t}. @@ -326,7 +327,7 @@ in your initialization file (@pxref{Entering Emacs}). @opindex -Q @itemx --quick @opindex --quick -Start emacs with minimum customizations. This is similar to using @samp{-q}, +Start Emacs with minimum customizations. This is similar to using @samp{-q}, @samp{--no-site-file}, @samp{--no-site-lisp}, and @samp{--no-splash} together. This also stops Emacs from processing X resources by setting @code{inhibit-x-resources} to @code{t} (@pxref{Resources}). @@ -337,7 +338,7 @@ setting @code{inhibit-x-resources} to @code{t} (@pxref{Resources}). @opindex --daemon @itemx --bg-daemon[=@var{name}] @itemx --fg-daemon[=@var{name}] -Start Emacs as a daemon---after Emacs starts up, it starts the Emacs +Start Emacs as a daemon: after Emacs starts up, it starts the Emacs server without opening any frames. (Optionally, you can specify an explicit @var{name} for the server.) You can then use the @command{emacsclient} command to connect to Emacs @@ -753,9 +754,10 @@ name under @file{/Software/GNU/Emacs}; first in the there, in the @file{HKEY_LOCAL_MACHINE} section. Finally, if Emacs still cannot determine the values, compiled-in defaults are used. -In addition to the environment variables above, you can also add many -of the settings which on X belong in the @file{.Xdefaults} file -(@pxref{X Resources}) to the @file{/Software/GNU/Emacs} registry key. +In addition to the environment variables above, you can also add +settings to the @file{/Software/GNU/Emacs} registry key to specify X +resources (@pxref{X Resources}). Most of the settings you can specify +in your @file{.Xdefaults} file can be set from that registry key. @node Display X @appendixsec Specifying the Display Name @@ -886,7 +888,7 @@ Specify the color for the mouse cursor when the mouse is in the Emacs window. @itemx --reverse-video @opindex --reverse-video @cindex reverse video, command-line argument -Reverse video---swap the foreground and background colors. +Reverse video: swap the foreground and background colors. @item --color=@var{mode} @opindex --color @cindex standard colors on a character terminal @@ -1023,11 +1025,12 @@ width. If you start with an @samp{x} followed by an integer, Emacs interprets it as the height. Thus, @samp{81} specifies just the width; @samp{x45} specifies just the height. - If you start with @samp{+} or @samp{-}, that introduces an offset, -which means both sizes are omitted. Thus, @samp{-3} specifies the -@var{xoffset} only. (If you give just one offset, it is always -@var{xoffset}.) @samp{+3-3} specifies both the @var{xoffset} and the -@var{yoffset}, placing the frame near the bottom left of the screen. + If you start the geometry with @samp{+} or @samp{-}, that introduces +an offset, which means both sizes are omitted. Thus, @samp{-3} +specifies the @var{xoffset} only. (If you give just one offset, it is +always @var{xoffset}.) @samp{+3-3} specifies both the @var{xoffset} +and the @var{yoffset}, placing the frame near the bottom left of the +screen. You can specify a default for any or all of the fields in your X resource file (@pxref{Resources}), and then override selected fields diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index e22d7f30af..205ca54728 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -991,16 +991,15 @@ expressions to highlight in different ways. @kindex M-s h u @kindex C-x w r @findex unhighlight-regexp -Unhighlight @var{regexp} (@code{unhighlight-regexp}). - -If you invoke this from the menu, you select the expression to -unhighlight from a list. If you invoke this from the keyboard, you -use the minibuffer. It will show the most recently added regular -expression; use @kbd{M-n} to show the next older expression and -@kbd{M-p} to select the next newer expression. (You can also type the -expression by hand, with completion.) When the expression you want to -unhighlight appears in the minibuffer, press @kbd{@key{RET}} to exit -the minibuffer and unhighlight it. +Unhighlight @var{regexp} (@code{unhighlight-regexp}). If you invoke +this from the menu, you select the expression to unhighlight from a +list. If you invoke this from the keyboard, you use the minibuffer. +It will show the most recently added regular expression; use @kbd{M-n} +to show the next older expression and @kbd{M-p} to select the next +newer expression. (You can also type the expression by hand, with +completion.) When the expression you want to unhighlight appears in +the minibuffer, press @kbd{@key{RET}} to exit the minibuffer and +unhighlight it. @item M-s h l @var{regexp} @key{RET} @var{face} @key{RET} @itemx C-x w l @var{regexp} @key{RET} @var{face} @key{RET} @@ -1393,13 +1392,13 @@ the option @code{display-time-mode}. The information added to the mode line looks like this: @example -@var{hh}:@var{mm}pm @var{l.ll} +@var{hh}:@var{mm}PM @var{l.ll} @end example @noindent @vindex display-time-24hr-format Here @var{hh} and @var{mm} are the hour and minute, followed always by -@samp{am} or @samp{pm}. @var{l.ll} is the average number, collected +@samp{AM} or @samp{PM}. @var{l.ll} is the average number, collected for the last few minutes, of processes in the whole system that were either running or ready to run (i.e., were waiting for an available processor). (Some fields may be missing if your operating system diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 474c4e96e2..163b6f23d8 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -482,7 +482,6 @@ Auto Reverting Non-File Buffers * Auto Reverting the Buffer Menu:: Auto Revert of the Buffer Menu. * Auto Reverting Dired:: Auto Revert of Dired buffers. -* Supporting additional buffers:: How to add more Auto Revert support. @end ifnottex Auto-Saving: Protection Against Disasters diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 1418a639fb..44d19d5bd7 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -116,8 +116,8 @@ the @samp{$}; alternatively, it can be enclosed in braces after the @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 set outside Emacs 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 @@ -167,7 +167,9 @@ 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, +read it, an error message is displayed in the echo area (on GNU and +Unix systems you might be able to visit such a file using the +@samp{su} or @samp{sudo} methods; @pxref{Remote Files}). 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 @@ -291,7 +293,8 @@ see @ref{Drag and Drop}, and @ref{Misc Dired Features}. On text-mode terminals and on graphical displays when Emacs was built without a GUI toolkit, you can visit files via the menu-bar -@samp{File} menu, which has a @samp{Visit New File} item. +@samp{File} menu, which has a @samp{Visit New File} and @samp{Open +File} items. Each time you visit a file, Emacs automatically scans its contents to detect what character encoding and end-of-line convention it uses, @@ -638,7 +641,7 @@ you whether it should delete the excess backup versions. If it has any other value, then Emacs never automatically deletes backups. Dired's @kbd{.} (Period) command can also be used to delete old versions. -@xref{Dired Deletion}. +@xref{Flagging Many Files}. @node Backup Copying @subsubsection Copying vs.@: Renaming @@ -738,7 +741,7 @@ survive a crash even if @code{fsync} works properly. The @code{write-region-inhibit-fsync} variable controls whether Emacs invokes @code{fsync} after saving a file. The variable's default value is @code{nil} when Emacs is interactive, and @code{t} -when Emacs runs in batch mode (@pxref{Initial Options, batch mode}). +when Emacs runs in batch mode (@pxref{Initial Options, Batch Mode}). Emacs never uses @code{fsync} when writing auto-save files, as these files might lose data anyway. @@ -751,7 +754,7 @@ files might lose data anyway. Simultaneous editing occurs when two users visit the same file, both 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. +their 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, @@ -952,12 +955,25 @@ discard your changes.) 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. This behavior can be changed -by setting the variable @code{auto-revert-remote-files} to non-@code{nil}. +current buffer when its visited file changes on disk. 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. This behavior can be +changed by setting the variable @code{auto-revert-remote-files} to +non-@code{nil}. + +@cindex file notifications +@vindex auto-revert-use-notify + By default, Auto-Revert mode works using @dfn{file notifications}, +whereby changes in the filesystem are reported to Emacs by the OS. +You can disable use of file notifications by customizing the variable +@code{auto-revert-use-notify} to a @code{nil} value, then Emacs will +check for file changes by polling every five seconds. You can change +the polling interval through the variable @code{auto-revert-interval}. + + Not all systems support file notifications; where they are not +supported, @code{auto-revert-use-notify} will be @code{nil} by +default. 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 @@ -1159,7 +1175,7 @@ this---saving them---updates the files themselves. @vindex auto-save-list-file-prefix Emacs records information about interrupted sessions in files named -@file{.saves-@var{pid}-@var{hostname}} in the directory +@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 @@ -1233,8 +1249,9 @@ named @file{/fsf}: listing} is a list of all the files in a directory. Emacs provides commands to create and delete directories, and to make directory listings in brief format (file names only) and verbose format (sizes, -dates, and authors included). Emacs also includes a directory browser -feature called Dired; see @ref{Dired}. +dates, and other attributes included). Emacs also includes a +directory browser feature called Dired, which you can invoke with +@kbd{C-x d}; see @ref{Dired}. @table @kbd @item C-x C-d @var{dir-or-pattern} @key{RET} @@ -1320,6 +1337,9 @@ 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}. + A (much more sophisticated) alternative is @kbd{M-x ediff} +(@pxref{Top, Ediff, Ediff, ediff, The Ediff Manual}). + @findex diff-backup The command @kbd{M-x diff-backup} compares a specified file with its most recent backup. If you specify the name of a backup file, @@ -1336,10 +1356,10 @@ would make to the file if you save the buffer. current window with that in the window that was the selected window before you selected the current one. (For more information about windows in Emacs, @ref{Windows}.) Comparison starts at point in each -window, after pushing each initial point value on the mark ring in its -respective buffer. Then it moves point forward in each window, one -character at a time, until it reaches characters that don't match. -Then the command exits. +window, after pushing each initial point value on the mark ring +(@pxref{Mark Ring}) in its respective buffer. Then it moves point +forward in each window, one character at a time, until it reaches +characters that don't match. Then the command exits. If point in the two windows is followed by non-matching text when the command starts, @kbd{M-x compare-windows} tries heuristically to @@ -1353,8 +1373,9 @@ skips one matching range or finds the start of another. whitespace. If the variable @code{compare-ignore-case} is non-@code{nil}, the comparison ignores differences in case as well. If the variable @code{compare-ignore-whitespace} is non-@code{nil}, -@code{compare-windows} normally ignores changes in whitespace, and a -prefix argument turns that off. +@code{compare-windows} by default ignores changes in whitespace, but a +prefix argument turns that off for that single invocation of the +command. @cindex Smerge mode @findex smerge-mode @@ -1424,7 +1445,7 @@ Move to the next hunk-start (@code{diff-hunk-next}). This command has a side effect: it @dfn{refines} the hunk you move to, highlighting its changes with better granularity. To disable this feature, type @kbd{M-x diff-auto-refine-mode} to toggle off the minor -mode Diff Auto-Refine mode. To disable Diff Auto Refine mode by +mode Diff Auto-Refine mode. To disable Diff Auto-Refine mode by default, add this to your init file (@pxref{Hooks}): @example @@ -1553,17 +1574,17 @@ modify the original source files rather than the patched source files. @section Copying, Naming and Renaming Files Emacs has several commands for copying, naming, and renaming files. -All of them read two file names @var{old} and @var{new} using the -minibuffer, and then copy or adjust a file's name accordingly; they do -not accept wildcard file names. +All of them read two file names, @var{old} (or @var{target}) and +@var{new}, using the minibuffer, and then copy or adjust a file's name +accordingly; they do not accept wildcard file names. In all these commands, if the argument @var{new} is just a directory -name, the real new name is in that directory, with the same +name (@pxref{Directory Names,,, elisp, the Emacs Lisp Reference +Manual}), the real new name is in that directory, with the same non-directory component as @var{old}. For example, the command @w{@kbd{M-x rename-file @key{RET} ~/foo @key{RET} /tmp/ @key{RET}}} renames @file{~/foo} to @file{/tmp/foo}. On GNU and other POSIX-like -systems, directory names end in @samp{/}. @xref{Directory Names,,, -elisp, the Emacs Lisp Reference Manual}. +systems, directory names end in @samp{/}. All these commands ask for confirmation when the new file name already exists. @@ -1816,8 +1837,8 @@ To carry out this request, Emacs uses a remote-login program such as @command{ssh}. You must always specify in the file name which method to use---for example, @file{/ssh:@var{user}@@@var{host}:@var{filename}} uses -@command{ssh}. When you specify the pseudo method @var{-} in the file -name, Emacs chooses the method as follows: +@command{ssh}. When you specify the pseudo method @samp{-} in the +file name, Emacs chooses the method as follows: @enumerate @item diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi index 19e1be729f..73f0f37515 100644 --- a/doc/emacs/indent.texi +++ b/doc/emacs/indent.texi @@ -201,8 +201,8 @@ are always displayed as empty spaces extending to the next @node Just Spaces @section Tabs vs.@: Spaces - Normally, indentation commands insert (or remove) an optimal mix of -space characters and tab characters to align to the desired column. + Normally, indentation commands insert (or remove) a mix of space +characters and tab characters so as to align to the desired column. Tab characters are displayed as a stretch of empty space extending to the next @dfn{display tab stop}. By default, there is one display tab stop every @code{tab-width} columns (the default is 8). @xref{Text diff --git a/doc/emacs/m-x.texi b/doc/emacs/m-x.texi index a283ca8fd0..a9b80d1add 100644 --- a/doc/emacs/m-x.texi +++ b/doc/emacs/m-x.texi @@ -56,7 +56,10 @@ of entering the command name. This takes you back to command level. To pass a numeric argument to the command you are invoking with @kbd{M-x}, specify the numeric argument before @kbd{M-x}. The argument value appears in the prompt while the command name is being -read, and finally @kbd{M-x} passes the argument to that command. +read, and finally @kbd{M-x} passes the argument to that command. For +example, to pass the numeric argument of 42 to the command +@code{forward-char} you can type @kbd{C-u 42 M-x forward-char +@key{RET}}. @vindex suggest-key-bindings When the command you run with @kbd{M-x} has a key binding, Emacs diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi index dbde2c8f82..28a5f9041a 100644 --- a/doc/emacs/macos.texi +++ b/doc/emacs/macos.texi @@ -18,8 +18,8 @@ does not support versions before macOS 10.6. @samp{Nextstep} internally, instead of ``Cocoa'' or ``macOS''; for instance, most of the commands and variables described in this section begin with @samp{ns-}, which is short for @samp{Nextstep}. NeXTstep -was an application interface released by NeXT Inc during the 1980s, of -which Cocoa is a direct descendant. Apart from Cocoa, there is +was an application interface released by NeXT Inc.@: during the 1980s, +of which Cocoa is a direct descendant. Apart from Cocoa, there is another NeXTstep-style system: GNUstep, which is free software. As of this writing, Emacs GNUstep support is alpha status (@pxref{GNUstep Support}), but we hope to improve it in the future. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 8acbb5317e..127c27c037 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -542,13 +542,13 @@ been changed in the repository, offer to update it. These rules also apply when you use RCS in its non-locking mode, except that changes are not automatically merged from the repository. Nothing informs you if another user has committed changes in the same -file since you began editing it; when you commit your revision, his -changes are removed (however, they remain in the repository and are -thus not irrevocably lost). Therefore, you must verify that the -current revision is unchanged before committing your changes. In -addition, locking is possible with RCS even in this mode: @kbd{C-x v -v} with an unmodified file locks the file, just as it does with RCS in -its normal locking mode (@pxref{VC With A Locking VCS}). +file since you began editing it; when you commit your revision, that +other user's changes are removed (however, they remain in the +repository and are thus not irrevocably lost). Therefore, you must +verify that the current revision is unchanged before committing your +changes. In addition, locking is possible with RCS even in this mode: +@kbd{C-x v v} with an unmodified file locks the file, just as it does +with RCS in its normal locking mode (@pxref{VC With A Locking VCS}). @node VC With A Locking VCS @subsubsection Basic Version Control with Locking diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index de16c44720..332602dcf2 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi @@ -66,8 +66,8 @@ minibuffer-electric-default-mode}. other uses of the echo area. If an error message or an informative message is emitted while the minibuffer is active, the message hides the minibuffer for a few seconds, or until you type something; then -the minibuffer comes back. While the minibuffer is in use, keystrokes -do not echo. +the minibuffer comes back. While the minibuffer is in use, Emacs does +not echo keystrokes. @node Minibuffer File @section Minibuffers for File Names diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 1fb47c3c68..ccb213f81b 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -413,8 +413,8 @@ is needed. For OpenDocument and Microsoft Office documents, the When you visit a document file that can be displayed with DocView mode, Emacs automatically uses DocView mode @footnote{The needed external tools for the document type must be available, and Emacs must -be running in a graphical frame and have PNG image support. If any of -these requirements is not fulfilled, Emacs falls back to another major +be running in a graphical frame and have PNG image support. If these +requirements is not fulfilled, Emacs falls back to another major mode.}. As an exception, when you visit a PostScript file, Emacs switches to PS mode, a major mode for editing PostScript files as text; however, it also enables DocView minor mode, so you can type diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi index ebfa57c09a..09cb034e37 100644 --- a/doc/emacs/rmail.texi +++ b/doc/emacs/rmail.texi @@ -175,6 +175,7 @@ Move to the next message containing a match for @var{regexp} @item - M-s @var{regexp} @key{RET} Move to the previous message containing a match for @var{regexp}. +(This is @kbd{M-s} with a negative argument.) @end table @kindex n @r{(Rmail)} diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi index 37c082e7ca..19a4a9e4b6 100644 --- a/doc/emacs/screen.texi +++ b/doc/emacs/screen.texi @@ -30,13 +30,13 @@ display systems commonly use the word ``window'' with a different meaning; but, as stated above, we refer to those graphical windows as ``frames''. - An Emacs window is where the @dfn{buffer}---the text you are -editing---is displayed. On a graphical display, the window possesses -a @dfn{scroll bar} on one side, which can be used to scroll through -the buffer. The last line of the window is a @dfn{mode line}. This -displays various information about what is going on in the buffer, -such as whether there are unsaved changes, the editing modes that are -in use, the current line number, and so forth. + An Emacs window is where the @dfn{buffer}---the text or other +graphics you are editing or viewing---is displayed. On a graphical +display, the window possesses a @dfn{scroll bar} on one side, which +can be used to scroll through the buffer. The last line of the window +is a @dfn{mode line}. This displays various information about what is +going on in the buffer, such as whether there are unsaved changes, the +editing modes that are in use, the current line number, and so forth. When you start Emacs, there is normally only one window in the frame. However, you can subdivide this window horizontally or diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index dd08cd1513..45407b2109 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -1498,29 +1498,27 @@ This is an example. @findex doctex-mode @findex bibtex-mode - Emacs provides special major modes for editing files written in -@TeX{} and its related formats. @TeX{} is a powerful text formatter -written by Donald Knuth; like GNU Emacs, it is free software. -@LaTeX{} is a simplified input format for @TeX{}, implemented using -@TeX{} macros. Doc@TeX{} is a special file format in which the -@LaTeX{} sources are written, combining sources with documentation. -Sli@TeX{} is an obsolete special form of @LaTeX{}.@footnote{It has -been replaced by the @samp{slides} document class, which comes with -@LaTeX{}.} + @TeX{} is a powerful text formatter written by Donald Knuth; like +GNU Emacs, it is free software. The @TeX{} format has several +variants, including @LaTeX{}, a simplified input format for @TeX{}; +Doc@TeX{}, a special file format in which the @LaTeX{} sources are +written, combining sources with documentation; and Sli@TeX{}, an +obsolete special form of @LaTeX{}@footnote{ +It has been replaced by the @samp{slides} document class, which comes +with @LaTeX{}.}. @vindex tex-default-mode - @TeX{} mode has four variants: Plain @TeX{} mode, @LaTeX{} mode, -Doc@TeX{} mode, and Sli@TeX{} mode. These distinct major modes differ -only slightly, and are designed for editing the four different -formats. Emacs selects the appropriate mode by looking at the -contents of the buffer. (This is done by the @code{tex-mode} command, -which is normally called automatically when you visit a @TeX{}-like -file. @xref{Choosing Modes}.) If the contents are insufficient to -determine this, Emacs chooses the mode specified by the variable -@code{tex-default-mode}; its default value is @code{latex-mode}. If -Emacs does not guess right, you can select the correct variant of -@TeX{} mode using the command @kbd{M-x plain-tex-mode}, @kbd{M-x -latex-mode}, @kbd{M-x slitex-mode}, or @kbd{doctex-mode}. + Emacs provides a @TeX{} major mode for each of these variants: Plain +@TeX{} mode, @LaTeX{} mode, Doc@TeX{} mode, and Sli@TeX{} mode. Emacs +selects the appropriate mode by looking at the contents of the buffer. +(This is done by the @code{tex-mode} command, which is normally called +automatically when you visit a @TeX{}-like file. @xref{Choosing +Modes}.) If the contents are insufficient to determine this, Emacs +chooses the mode specified by the variable @code{tex-default-mode}; +its default value is @code{latex-mode}. If Emacs does not guess +right, you can select the correct variant of @TeX{} mode using the +command @kbd{M-x plain-tex-mode}, @kbd{M-x latex-mode}, @kbd{M-x +slitex-mode}, or @kbd{doctex-mode}. The following sections document the features of @TeX{} mode and its variants. There are several other @TeX{}-related Emacs packages, @@ -1618,7 +1616,9 @@ to keep braces balanced at all times, rather than inserting them singly. Use @kbd{C-c @{} (@code{tex-insert-braces}) to insert a pair of braces. It leaves point between the two braces so you can insert the text that belongs inside. Afterward, use the command @kbd{C-c @}} -(@code{up-list}) to move forward past the close brace. +(@code{up-list}) to move forward past the close brace. You can also +invoke @kbd{C-c @{} after marking some text: then the command encloses +the marked text in braces. @findex tex-validate-region @findex tex-terminate-paragraph diff --git a/doc/lispref/backups.texi b/doc/lispref/backups.texi index 8ca10d7905..8ce8f6180d 100644 --- a/doc/lispref/backups.texi +++ b/doc/lispref/backups.texi @@ -775,16 +775,80 @@ after inserting the modified contents. A custom @code{revert-buffer-function} may or may not run this hook. @end defvar -@c FIXME? Move this section from arevert-xtra to here? +Emacs can revert buffers automatically. It does that by default for +buffers visiting files. The following describes how to add support +for auto-reverting new types of buffers. + +First, such buffers must have a suitable @code{revert-buffer-function} +and @code{buffer-stale-function} defined. + @defvar buffer-stale-function The value of this variable specifies a function to call to check whether a buffer needs reverting. The default value only handles buffers that are visiting files, by checking their modification time. -Buffers that are not visiting files require a custom function -@iftex -(@pxref{Supporting additional buffers,,, emacs-xtra, Specialized Emacs Features}). -@end iftex -@ifnottex -(@pxref{Supporting additional buffers,,, emacs}). -@end ifnottex +Buffers that are not visiting files require a custom function of one +optional argument @var{noconfirm}. The function should return +non-@code{nil} if the buffer should be reverted. The buffer is +current when this function is called. + +While this function is mainly intended for use in auto-reverting, it +could be used for other purposes as well. For instance, if +auto-reverting is not enabled, it could be used to warn the user that +the buffer needs reverting. The idea behind the @var{noconfirm} +argument is that it should be @code{t} if the buffer is going to be +reverted without asking the user and @code{nil} if the function is +just going to be used to warn the user that the buffer is out of date. +In particular, for use in auto-reverting, @var{noconfirm} is @code{t}. +If the function is only going to be used for auto-reverting, you can +ignore the @var{noconfirm} argument. + +If you just want to automatically auto-revert every +@code{auto-revert-interval} seconds (like the Buffer Menu), use: + +@example +(setq-local buffer-stale-function + #'(lambda (&optional noconfirm) 'fast)) +@end example + +@noindent +in the buffer's mode function. + +The special return value @samp{fast} tells the caller that the need +for reverting was not checked, but that reverting the buffer is fast. +It also tells Auto Revert not to print any revert messages, even if +@code{auto-revert-verbose} is non-@code{nil}. This is important, as +getting revert messages every @code{auto-revert-interval} seconds can +be very annoying. The information provided by this return value could +also be useful if the function is consulted for purposes other than +auto-reverting. @end defvar + +Once the buffer has a suitable @code{revert-buffer-function} and +@code{buffer-stale-function}, several problems usually remain. + +The buffer will only auto-revert if it is marked unmodified. Hence, +you will have to make sure that various functions mark the buffer +modified if and only if either the buffer contains information that +might be lost by reverting, or there is reason to believe that the user +might be inconvenienced by auto-reverting, because he is actively +working on the buffer. The user can always override this by manually +adjusting the modified status of the buffer. To support this, calling +the @code{revert-buffer-function} on a buffer that is marked +unmodified should always keep the buffer marked unmodified. + +It is important to assure that point does not continuously jump around +as a consequence of auto-reverting. Of course, moving point might be +inevitable if the buffer radically changes. + +You should make sure that the @code{revert-buffer-function} does not +print messages that unnecessarily duplicate Auto Revert's own messages, +displayed if @code{auto-revert-verbose} is @code{t}, and effectively +override a @code{nil} value for @code{auto-revert-verbose}. Hence, +adapting a mode for auto-reverting often involves getting rid of such +messages. This is especially important for buffers that automatically +revert every @code{auto-revert-interval} seconds. + +If the new auto-reverting is part of Emacs, you should mention it +in the documentation string of @code{global-auto-revert-non-file-buffers}. + +Similarly, you should document the additions in the Emacs manual.