From 12654b74236b914f571f173689b0ac87247d0f24 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 15 Oct 2021 09:58:29 +0300 Subject: [PATCH 01/11] * lisp/menu-bar.el (yank-menu-length): Fix docstring (bug#51138). --- lisp/help-fns.el | 2 +- lisp/menu-bar.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 03bbc979a9c..2b759a5a5c5 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -823,7 +823,7 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." ;; Advised & aliased function. (and advised (symbolp real-function) (not (eq 'autoload (car-safe def)))) - (and (subrp def) + (and (subrp def) (symbolp function) (not (string= (subr-name def) (symbol-name function))))))) (real-def (cond diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index b2577c085fc..1cc126b5017 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2159,7 +2159,7 @@ otherwise it could decide to silently do nothing." (> count 1))) (defcustom yank-menu-length 20 - "Maximum length to display in the `yank-menu'." + "Text of items in `yank-menu' longer than this will be truncated." :type 'integer :group 'menu) From 1af45ad04ef1755ada0483957018889dcf0f9207 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 15 Oct 2021 09:18:54 +0200 Subject: [PATCH 02/11] ; * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Fix comment. --- lisp/emacs-lisp/comp.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 0052fd0f8db..0e4e54b76bb 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3781,8 +3781,8 @@ Return the trampoline if found or nil otherwise." for arg in lambda-list unless (memq arg '(&optional &rest)) collect arg))))) - ;; Use speed 0 to maximize compilation speed and not to - ;; optimize away funcall calls! + ;; Use speed 1 for compilation speed and not to optimize away + ;; funcall calls! (byte-optimize nil) (native-comp-speed 1) (lexical-binding t)) From 502788bc3d9cd2f95427114dbb243c62a27edb2b Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Fri, 15 Oct 2021 08:20:40 +0200 Subject: [PATCH 03/11] Add missing single quotes in the Emacs manual * lisp/mwheel.el (mouse-wheel-scroll-amount): Add missing single quotes. (Bug#51223) Copyright-paperwork-exempt: yes. --- lisp/mwheel.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/mwheel.el b/lisp/mwheel.el index def77587747..51410e3ef4c 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -103,7 +103,7 @@ less than a full screen. If AMOUNT is the symbol 'hscroll', this means that with MODIFIER, the mouse wheel will scroll horizontally instead of vertically. -If AMOUNT is the symbol text-scale, this means that with +If AMOUNT is the symbol 'text-scale', this means that with MODIFIER, the mouse wheel will change the face height instead of scrolling." :group 'mouse From ced72b6e4c03c75e99e828410c363eefd80fbf54 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 15 Oct 2021 09:26:24 +0200 Subject: [PATCH 04/11] * Fix `native-compile-target-directory' effectiveness on trampolines * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Fix `native-compile-target-directory' effectiveness on trampoline compilation. --- lisp/emacs-lisp/comp.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 0e4e54b76bb..7b5c5ad44f7 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3789,7 +3789,9 @@ Return the trampoline if found or nil otherwise." (comp--native-compile form nil (cl-loop - for dir in (comp-eln-load-path-eff) + for dir in (if native-compile-target-directory + (list native-compile-target-directory) + (comp-eln-load-path-eff)) for f = (expand-file-name (comp-trampoline-filename subr-name) dir) From f5b8df14c6d9c906eed548c694f23e5abcf6e403 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 15 Oct 2021 10:21:05 +0200 Subject: [PATCH 05/11] Fixes to account for windows' tab lines * doc/lispref/display.texi (Size of Displayed Text): Fix entry on 'window-text-pixel-size'. * lisp/window.el (window--dump-window): Dump tab-line-height and scroll-bar-height too. (window--min-size-1): Take 'window-tab-line-height' into account. * src/xdisp.c (Fwindow_text_pixel_size): Fix doc-string of 'window-text-pixel-size'. Rename last argument to 'MODE-LINES'. --- doc/lispref/display.texi | 12 ++++++------ lisp/window.el | 8 ++++++-- src/xdisp.c | 19 ++++++++----------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 2ae04a85218..4500795e45b 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2050,7 +2050,7 @@ displayed in a given window. This function is used by (@pxref{Resizing Windows}) to make a window exactly as large as the text it contains. -@defun window-text-pixel-size &optional window from to x-limit y-limit mode-and-header-line +@defun window-text-pixel-size &optional window from to x-limit y-limit mode-lines This function returns the size of the text of @var{window}'s buffer in pixels. @var{window} must be a live window and defaults to the selected one. The return value is a cons of the maximum pixel-width @@ -2092,12 +2092,12 @@ calculating the pixel-height of a large buffer can take some time, it makes sense to specify this argument; in particular, if the caller does not know the size of the buffer. -The optional argument @var{mode-and-header-line} @code{nil} or omitted -means to not include the height of the mode- or header-line of -@var{window} in the return value. If it is either the symbol -@code{mode-line} or @code{header-line}, include only the height of that +The optional argument @var{mode-lines} @code{nil} or omitted means to +not include the height of the mode-, tab- or header-line of @var{window} +in the return value. If it is either the symbol @code{mode-line}, +@code{tab-line} or @code{header-line}, include only the height of that line, if present, in the return value. If it is @code{t}, include the -height of both, if present, in the return value. +height of all of these lines, if present, in the return value. @end defun @code{window-text-pixel-size} treats the text displayed in a window as a diff --git a/lisp/window.el b/lisp/window.el index 971264b6344..d12232641e3 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -1407,9 +1407,12 @@ before writing to it." (cadr fringes) (window-scroll-bar-width window) (window-right-divider-width window)) - (format "height header-line: %s mode-line: %s divider: %s\n" + (format "height tab-line: %s header-line: %s mode-line: %s\n" + (window-tab-line-height window) (window-header-line-height window) - (window-mode-line-height window) + (window-mode-line-height window)) + (format "height scroll-bar: %s divider: %s" + (window-scroll-bar-height window) (window-bottom-divider-width window))))) (insert "\n"))) @@ -1691,6 +1694,7 @@ return the minimum pixel-size of WINDOW." ((let ((char-size (frame-char-size window)) (pixel-height (+ (window-safe-min-size window nil t) + (window-tab-line-height window) (window-header-line-height window) (window-scroll-bar-height window) (window-mode-line-height window) diff --git a/src/xdisp.c b/src/xdisp.c index d8aff5084c4..40d578ae9aa 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10661,13 +10661,13 @@ position specified by TO. Since calculating the text height of a large buffer can take some time, it makes sense to specify this argument if the size of the buffer is large or unknown. -Optional argument MODE-AND-HEADER-LINE nil or omitted means do not -include the height of the mode- or header-line of WINDOW in the return -value. If it is either the symbol `mode-line' or `header-line', include +Optional argument MODE-LINES nil or omitted means do not include the +height of the mode-, tab- or header-line of WINDOW in the return value. +If it is the symbol `mode-line', 'tab-line' or `header-line', include only the height of that line, if present, in the return value. If t, -include the height of both, if present, in the return value. */) +include the height of any of these, if present, in the return value. */) (Lisp_Object window, Lisp_Object from, Lisp_Object to, Lisp_Object x_limit, - Lisp_Object y_limit, Lisp_Object mode_and_header_line) + Lisp_Object y_limit, Lisp_Object mode_lines) { struct window *w = decode_live_window (window); Lisp_Object buffer = w->contents; @@ -10841,18 +10841,15 @@ include the height of both, if present, in the return value. */) if (y > max_y) y = max_y; - if (EQ (mode_and_header_line, Qtab_line) - || EQ (mode_and_header_line, Qt)) + if (EQ (mode_lines, Qtab_line) || EQ (mode_lines, Qt)) /* Re-add height of tab-line as requested. */ y = y + WINDOW_TAB_LINE_HEIGHT (w); - if (EQ (mode_and_header_line, Qheader_line) - || EQ (mode_and_header_line, Qt)) + if (EQ (mode_lines, Qheader_line) || EQ (mode_lines, Qt)) /* Re-add height of header-line as requested. */ y = y + WINDOW_HEADER_LINE_HEIGHT (w); - if (EQ (mode_and_header_line, Qmode_line) - || EQ (mode_and_header_line, Qt)) + if (EQ (mode_lines, Qmode_line) || EQ (mode_lines, Qt)) /* Add height of mode-line as requested. */ y = y + WINDOW_MODE_LINE_HEIGHT (w); From 4ad0fc0dd08d65978ed8a1637bc1a14c26b41bee Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 15 Oct 2021 16:29:11 +0200 Subject: [PATCH 06/11] Precise documentation of file-notify-add-watch * doc/lispref/os.texi (File Notifications): * lisp/filenotify.el (file-notify-add-watch): Precise, that watching a directory includes reports on file changes for some backends. (Bug#51146) --- doc/lispref/os.texi | 5 +++-- lisp/filenotify.el | 4 +++- test/lisp/filenotify-tests.el | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index e3297b1be7c..db986178dd8 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -3124,8 +3124,9 @@ watch for file attribute changes, like permissions or modification time @end table -If @var{file} is a directory, changes for all files in that directory -will be notified. This does not work recursively. +If @var{file} is a directory, @code{change} watches for file creation +or deletion in that directory. Some of the file notification backends +report also file changes. This does not work recursively. When any event happens, Emacs will call the @var{callback} function passing it a single argument @var{event}, which is of the form diff --git a/lisp/filenotify.el b/lisp/filenotify.el index e0dceb704d5..271fa270836 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -390,7 +390,9 @@ include the following symbols: permissions or modification time If FILE is a directory, `change' watches for file creation or -deletion in that directory. This does not work recursively. +deletion in that directory. Some of the file notification +backends report also file changes. This does not work +recursively. When any event happens, Emacs will call the CALLBACK function passing it a single argument EVENT, which is of the form diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 6125069c6b3..9be515ab176 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -743,7 +743,7 @@ delivered." ;; the directory. Except for ;; GFam{File,Directory}Monitor, GPollFileMonitor and ;; kqueue. And GFam{File,Directory}Monitor and - ;; GPollFileMonitordo not raise a `changed' event. + ;; GPollFileMonitor do not raise a `changed' event. ((memq (file-notify--test-monitor) '(GFamFileMonitor GFamDirectoryMonitor GPollFileMonitor)) '(created deleted stopped)) From b5a0eda978738467eed16b9a530d175c33418362 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 15 Oct 2021 20:22:11 +0200 Subject: [PATCH 07/11] Prefer "graphical displays" to "X terminals" in documentation * doc/lispref/objects.texi (Ctl-Char Syntax): Fix incorrect remark; some text terminals can generate ASCII control characters. (Other Char Bits): * lisp/bindings.el: * lisp/gnus/gnus-undo.el (gnus-undo-mode-map): Say "graphical display" and "GUI display" instead of "X terminal"; the latter term is archaic. (Bug#51217) --- doc/lispref/objects.texi | 10 +++++----- lisp/bindings.el | 2 +- lisp/gnus/gnus-undo.el | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi index 365d5ac8d61..a20343f4c7a 100644 --- a/doc/lispref/objects.texi +++ b/doc/lispref/objects.texi @@ -516,9 +516,9 @@ codes for these non-@acronym{ASCII} control characters include the 2**26 @end ifnottex bit as well as the code for the corresponding non-control character. -Ordinary text terminals have no way of generating non-@acronym{ASCII} -control characters, but you can generate them straightforwardly using -X and other window systems. +Not all text terminals can generate non-@acronym{ASCII} control +characters, but it is straightforward to generate them using X and +other window systems. For historical reasons, Emacs treats the @key{DEL} character as the control equivalent of @kbd{?}: @@ -588,8 +588,8 @@ character is upper case or lower case. Emacs uses the 2**25 @end ifnottex bit to indicate that the shift key was used in typing a control -character. This distinction is possible only when you use X terminals -or other special terminals; ordinary text terminals do not report the +character. This distinction is possible only on a graphical display +such as a GUI display on X; text terminals do not report the distinction. The Lisp syntax for the shift bit is @samp{\S-}; thus, @samp{?\C-\S-o} or @samp{?\C-\S-O} represents the shifted-control-o character. diff --git a/lisp/bindings.el b/lisp/bindings.el index 2c45710a580..121e484a0ee 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -981,7 +981,7 @@ if `inhibit-field-text-motion' is non-nil." (define-key ctl-x-map "\M-:" 'repeat-complex-command) (define-key ctl-x-map "u" 'undo) (put 'undo :advertised-binding [?\C-x ?u]) -;; Many people are used to typing C-/ on X terminals and getting C-_. +;; Many people are used to typing C-/ on GUI frames and getting C-_. (define-key global-map [?\C-/] 'undo) (define-key global-map "\C-_" 'undo) ;; Richard said that we should not use C-x and I have diff --git a/lisp/gnus/gnus-undo.el b/lisp/gnus/gnus-undo.el index 64ed2bbad6b..07cf5d495a6 100644 --- a/lisp/gnus/gnus-undo.el +++ b/lisp/gnus/gnus-undo.el @@ -81,7 +81,7 @@ "\M-\C-_" gnus-undo "\C-_" gnus-undo "\C-xu" gnus-undo - ;; many people are used to type `C-/' on X terminals and get `C-_'. + ;; Many people are used to type `C-/' on GUI frames and get `C-_'. [(control /)] gnus-undo) map)) From e842d7f29ac6a42e44065a94623b36b2dcbb81eb Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 16 Oct 2021 10:10:06 +0300 Subject: [PATCH 08/11] Fix removal of fringe indication of bookmarks * lisp/bookmark.el (bookmark--remove-fringe-mark): Fix off-by-one error in looking for bookmark-related overlays. (Bug#51233) --- lisp/bookmark.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index d64966df5af..fb90f01456e 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -479,7 +479,7 @@ See user option `bookmark-set-fringe'." (dolist (buf (buffer-list)) (with-current-buffer buf (when (equal filename buffer-file-name) - (setq overlays (overlays-in pos pos)) + (setq overlays (overlays-in pos (1+ pos))) (while (and (not found) (setq temp (pop overlays))) (when (eq 'bookmark (overlay-get temp 'category)) (delete-overlay (setq found temp)))))))))) From 2971a6890f562dccc2182dd1f802fa47333d496c Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sat, 16 Oct 2021 10:55:43 +0200 Subject: [PATCH 09/11] * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Fix target dir. --- lisp/emacs-lisp/comp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 7b5c5ad44f7..0a105052570 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3790,7 +3790,8 @@ Return the trampoline if found or nil otherwise." form nil (cl-loop for dir in (if native-compile-target-directory - (list native-compile-target-directory) + (list (expand-file-name comp-native-version-dir + native-compile-target-directory)) (comp-eln-load-path-eff)) for f = (expand-file-name (comp-trampoline-filename subr-name) From 21397cce51dc3f9b6e9b0e7a5cc877b63efa8dd4 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sat, 16 Oct 2021 11:46:49 +0200 Subject: [PATCH 10/11] Improve documentation string for 'compilation-error-regexp-alist'. * lisp/progmodes/compile.el (compilation-error-regexp-alist): Clarify behavior when TYPE is a cons cell. --- lisp/progmodes/compile.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 73f98068110..ac26f5e9341 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -662,7 +662,8 @@ has just been matched, and should correspondingly preserve this match data. TYPE is 2 or nil for a real error or 1 for warning or 0 for info. TYPE can also be of the form (WARNING . INFO). In that case this will be equivalent to 1 if the WARNING'th subexpression matched -or else equivalent to 0 if the INFO'th subexpression matched. +or else equivalent to 0 if the INFO'th subexpression matched, +or else equivalent to 2 if neither of them matched. See `compilation-error-face', `compilation-warning-face', `compilation-info-face' and `compilation-skip-threshold'. From e8488808dfe1460ce07042a1a523097ab90cf079 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 16 Oct 2021 14:47:32 +0300 Subject: [PATCH 11/11] Avoid aborts when a thread is signaled while "waiting for input". * src/process.c (kbd_is_ours): New function. (wait_reading_process_output): Set 'waiting_for_input' only if the current thread is monitoring the keyboard descriptor. See also https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01180.html. (Bug#51229) --- src/process.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/process.c b/src/process.c index 746cdc0428a..6731f8808f5 100644 --- a/src/process.c +++ b/src/process.c @@ -683,6 +683,22 @@ clear_waiting_thread_info (void) } } +/* Return TRUE if the keyboard descriptor is being monitored by the + current thread, FALSE otherwise. */ +static bool +kbd_is_ours (void) +{ + for (int fd = 0; fd <= max_desc; ++fd) + { + if (fd_callback_info[fd].waiting_thread != current_thread) + continue; + if ((fd_callback_info[fd].flags & (FOR_READ | KEYBOARD_FD)) + == (FOR_READ | KEYBOARD_FD)) + return true; + } + return false; +} + /* Compute the Lisp form of the process status, p->status, from the numeric status that was returned by `wait'. */ @@ -5312,13 +5328,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, wait_reading_process_output_1 (); } - /* Cause C-g and alarm signals to take immediate action, + /* Cause C-g signals to take immediate action, and cause input available signals to zero out timeout. It is important that we do this before checking for process activity. If we get a SIGCHLD after the explicit checks for process activity, timeout is the only way we will know. */ - if (read_kbd < 0) + if (read_kbd < 0 && kbd_is_ours ()) set_waiting_for_input (&timeout); /* If status of something has changed, and no input is @@ -5448,7 +5464,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, { clear_waiting_for_input (); redisplay_preserve_echo_area (11); - if (read_kbd < 0) + if (read_kbd < 0 && kbd_is_ours ()) set_waiting_for_input (&timeout); }