commit 445e2499baa1b8ef21e8edcc13692b5d78912922 (HEAD, refs/remotes/origin/master) Author: Stefan Monnier Date: Sat Mar 16 23:10:48 2024 -0400 debug.el: Prevent re-entering the debugger for the same error We can have several active `handler-bind`s that all want to invoke the debugger, in which case we can have the following sequence: - The more deeply nested handler calls the debugger. - After a while the user invokes `debugger-continue`. - `signal_or_quit` propagates the error up the stack to the second handler, which calls the debugger again. - The user thus ends up right back at the same place, as if `debugger-continue` had not be processed. Fix this by remembering the last processed error and skipping the debugger if we bump into it again. * lisp/emacs-lisp/debug.el (debugger--last-error): New var. (debugger--duplicate-p): New function. (debug): Use them. diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 60d14d11970..ec947c1215d 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -153,6 +153,12 @@ where CAUSE can be: (insert (debugger--buffer-state-content state))) (goto-char (debugger--buffer-state-pos state))) +(defvar debugger--last-error nil) + +(defun debugger--duplicate-p (args) + (pcase args + (`(error ,err . ,_) (and (consp err) (eq err debugger--last-error))))) + ;;;###autoload (setq debugger 'debug) ;;;###autoload @@ -175,9 +181,14 @@ first will be printed into the backtrace buffer. If `inhibit-redisplay' is non-nil when this function is called, the debugger will not be entered." (interactive) - (if inhibit-redisplay - ;; Don't really try to enter debugger within an eval from redisplay. + (if (or inhibit-redisplay + (debugger--duplicate-p args)) + ;; Don't really try to enter debugger within an eval from redisplay + ;; or if we already popper into the debugger for this error, + ;; which can happen when we have several nested `handler-bind's that + ;; want to invoke the debugger. debugger-value + (setq debugger--last-error nil) (let ((non-interactive-frame (or noninteractive ;FIXME: Presumably redundant. ;; If we're in the initial-frame (where `message' just @@ -318,6 +329,12 @@ the debugger will not be entered." (backtrace-mode)))) (with-timeout-unsuspend debugger-with-timeout-suspend) (set-match-data debugger-outer-match-data))) + (when (eq 'error (car-safe debugger-args)) + ;; Remember the error we just debugged, to avoid re-entering + ;; the debugger if some higher-up `handler-bind' invokes us + ;; again, oblivious that the error was already debugged from + ;; a more deeply nested `handler-bind'. + (setq debugger--last-error (nth 1 debugger-args))) (setq debug-on-next-call debugger-step-after-exit) debugger-value)))) commit ad3a3ad6e616a53ec5ae28aed02e8d3461a5ce5c Author: Basil L. Contovounesios Date: Sat Mar 16 14:15:25 2024 +0100 ; Pacify -Wmaybe-uninitialized in coding.c. Warning seen with GCC 13 -Og. diff --git a/src/coding.c b/src/coding.c index 5f3ceab718b..ff7cf56c297 100644 --- a/src/coding.c +++ b/src/coding.c @@ -5488,7 +5488,7 @@ decode_coding_charset (struct coding_system *coding) { int c; Lisp_Object val; - struct charset *charset; + struct charset *charset UNINIT; int dim; int len = 1; unsigned code; commit 685f4295f9810b4aab8ec3ba7146b17904a1c37f Author: Eli Zaretskii Date: Sat Mar 16 12:58:33 2024 +0200 ; Document more DND functions with limited support * lisp/dnd.el (dnd-begin-text-drag, dnd-begin-file-drag) (dnd-begin-drag-files): Document platforms that support these functions. (Bug#69662) diff --git a/lisp/dnd.el b/lisp/dnd.el index 22cb18359a3..1fc1ab45b84 100644 --- a/lisp/dnd.el +++ b/lisp/dnd.el @@ -453,7 +453,10 @@ on FRAME itself. This function might return immediately if no mouse buttons are currently being held down. It should only be called upon a -`down-mouse-1' (or similar) event." +`down-mouse-1' (or similar) event. + +This function is only supported on X Windows, macOS/GNUstep, and Haiku; +on all other platforms it will signal an error." (unless (fboundp 'x-begin-drag) (error "Dragging text from Emacs is not supported by this window system")) (gui-set-selection 'XdndSelection text) @@ -513,7 +516,10 @@ nil, any drops on FRAME itself will be ignored. This function might return immediately if no mouse buttons are currently being held down. It should only be called upon a -`down-mouse-1' (or similar) event." +`down-mouse-1' (or similar) event. + +This function is only supported on X Windows, macOS/GNUstep, and Haiku; +on all other platforms it will signal an error." (unless (fboundp 'x-begin-drag) (error "Dragging files from Emacs is not supported by this window system")) (dnd-remove-last-dragged-remote-file) @@ -580,7 +586,10 @@ FRAME, ACTION and ALLOW-SAME-FRAME mean the same as in FILES is a list of files that will be dragged. If the drop target doesn't support dropping multiple files, the first file in -FILES will be dragged." +FILES will be dragged. + +This function is only supported on X Windows, macOS/GNUstep, and Haiku; +on all other platforms it will signal an error." (unless (fboundp 'x-begin-drag) (error "Dragging files from Emacs is not supported by this window system")) (dnd-remove-last-dragged-remote-file) commit d855f1c3f9c488f48694fe63bbc49d66d775c16c Author: Eli Zaretskii Date: Sat Mar 16 11:58:56 2024 +0200 ; Fix recent changes in documentation * doc/lispref/markers.texi (Information from Markers): * etc/NEWS: Improve description of 'marker-last-position'. diff --git a/doc/lispref/markers.texi b/doc/lispref/markers.texi index 28ad0ff73c0..a13edb02ae6 100644 --- a/doc/lispref/markers.texi +++ b/doc/lispref/markers.texi @@ -285,9 +285,10 @@ This function returns the position that @var{marker} points to, or @defun marker-last-position marker This function returns the last known position of @var{marker} in its -buffer. It behaves like @code{marker-position} with one exception: If +buffer. It behaves like @code{marker-position} with one exception: if the buffer of @var{marker} has been killed, it returns the last position -of @var{marker} in that buffer before it was killed. +of @var{marker} in that buffer before the buffer was killed, instead of +returning @code{nil}. @end defun @defun marker-buffer marker diff --git a/etc/NEWS b/etc/NEWS index 8cad9412def..50f0ee4a1aa 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1817,8 +1817,9 @@ It returns the name of a buffer before the last time it was renamed or killed. ** New primitive 'marker-last-position'. -It returns the last position of MARKER in its buffer even if that buffer -has been killed. +It returns the last position of a marker in its buffer even if that +buffer has been killed. ('marker-position' would return nil in that +case.) ** Functions and variables to transpose sexps commit d60d625f6e76781bc4f3640ec269a051b3ecb1ae Merge: cc8a2c57b5e c12852bbf61 Author: Eli Zaretskii Date: Sat Mar 16 05:52:31 2024 -0400 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit cc8a2c57b5eed4045035dfeaf129ce33d7f74733 Merge: 899ea79310d 3b791ebbe17 Author: Eli Zaretskii Date: Sat Mar 16 05:47:41 2024 -0400 Merge from origin/emacs-29 3b791ebbe17 ; Fix 'usage:' keyword in Ffile_name_concat doc. ed48b0d657c ; * CONTRIBUTE: Ask not to use non-ASCII unless necessary. b708e639d63 ; * src/lread.c (maybe_swap_for_eln): Clarify warning mes... db027a06976 ; Fix bibtex-biblatex-field-alist docstring typo. a9be5c7ea92 ; * doc/lispref/control.texi (Conditionals): Add missing ... db5915f30ba Fix 'with-sqlite-transaction' fe491173e8f ; * doc/emacs/files.texi (Image Mode): Fix typo (bug#69671). commit c12852bbf61ebb9ae124033deb427b15ce1a2ffb Author: Martin Rudalics Date: Sat Mar 16 10:46:02 2024 +0100 Document and announce 'marker-last-position' * doc/lispref/markers.texi (Information from Markers): Document 'marker-last-position'. * etc/NEWS: Announce 'marker-last-position'. * src/window.c (window_restore_killed_buffer_windows): Minor doc-string fix. * doc/lispref/windows.texi (Window Configurations): Minor fix. diff --git a/doc/lispref/markers.texi b/doc/lispref/markers.texi index 3037790692c..28ad0ff73c0 100644 --- a/doc/lispref/markers.texi +++ b/doc/lispref/markers.texi @@ -283,6 +283,13 @@ This function returns the position that @var{marker} points to, or @code{nil} if it points nowhere. @end defun +@defun marker-last-position marker +This function returns the last known position of @var{marker} in its +buffer. It behaves like @code{marker-position} with one exception: If +the buffer of @var{marker} has been killed, it returns the last position +of @var{marker} in that buffer before it was killed. +@end defun + @defun marker-buffer marker This function returns the buffer that @var{marker} points into, or @code{nil} if it points nowhere. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 2e2fdee422b..eef05d94fdb 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -6424,8 +6424,8 @@ windows are restored by @code{window-state-put}. The second argument specifies a list of entries for @emph{all} windows whose previous buffers have been found dead at the time @code{set-window-configuration} or @code{window-state-put} tried to -restore it in that window (minibuffer windows are excluded). This means -that the function may also delete windows which were found live by +restore them (minibuffer windows are excluded). This means that the +function may also delete windows which were found live by @code{set-window-configuration}. Each entry in the list that is passed as the second argument to the diff --git a/etc/NEWS b/etc/NEWS index a654d2d8d79..8cad9412def 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1816,6 +1816,11 @@ improves performance. Such a Lisp program can then use the It returns the name of a buffer before the last time it was renamed or killed. +** New primitive 'marker-last-position'. +It returns the last position of MARKER in its buffer even if that buffer +has been killed. + + ** Functions and variables to transpose sexps +++ diff --git a/src/window.c b/src/window.c index b69f4719d93..748ad9e77d4 100644 --- a/src/window.c +++ b/src/window.c @@ -8711,12 +8711,12 @@ third argument is the symbol `configuration' if the windows are restored by `set-window-configuration' and the symbol `state' if the windows are restored by `window-state-put'. -The second argument specifies a list of entries for all windows -whose previous buffers have been found dead at the time -`set-window-configuration' or `window-state-put' tried to restore it in -that window (minibuffer windows are excluded). This means that the -function specified by this variable may also delete windows which were -found to be alive by `set-window-configuration'. +The second argument specifies a list of entries for all windows whose +previous buffers have been found dead at the time +`set-window-configuration' or `window-state-put' tried to restore them +(minibuffer windows are excluded). This means that the function +specified by this variable may also delete windows which were found to +be alive by `set-window-configuration'. Each entry is a list of six values: the window whose buffer was found dead, the dead buffer or its name, the positions of window-start and commit 899ea79310d1b8ed78c3fd8ac1784043dd732dbf Author: Martin Rudalics Date: Sat Mar 16 10:10:29 2024 +0100 In window-related documentation write 'symbol' instead of 'constant' Suggested by Michael Heerdegen . * src/window.c (window_restore_killed_buffer_windows): In doc-string write 'symbol' instead of 'constant'. * lisp/window.el (display-buffer--lru-window) (display-buffer-use-least-recent-window): In doc-strings write 'symbol' instead of 'constant'. * doc/lispref/windows.texi (Window Configurations): Write 'symbol' instead of 'constant'. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 8fa4e57b153..2e2fdee422b 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -6416,9 +6416,9 @@ on its frame), @code{set-window-configuration} and If the value of this variable is a function, that function should take three arguments. The first argument specifies the frame whose windows -have been restored. The third argument is either the constant +have been restored. The third argument is either the symbol @code{configuration} if the windows are restored by -@code{set-window-configuration}, or the constant @code{state} if the +@code{set-window-configuration}, or the symbol @code{state} if the windows are restored by @code{window-state-put}. The second argument specifies a list of entries for @emph{all} windows diff --git a/lisp/window.el b/lisp/window.el index 246708dbd56..df55a7ca673 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8668,11 +8668,11 @@ buffer. ALIST is a buffer display action alist as compiled by use time is higher than this. - `window-min-width' specifies a preferred minimum width in - canonical frame columns. If it is the constant `full-width', + canonical frame columns. If it is the symbol `full-width', prefer a full-width window. - `window-min-height' specifies a preferred minimum height in - canonical frame lines. If it is the constant `full-height', + canonical frame lines. If it is the symbol `full-height', prefer a full-height window. If ALIST contains a non-nil `inhibit-same-window' entry, do not @@ -8799,11 +8799,11 @@ Distinctive features are: call. `window-min-width' specifies a preferred minimum width in - canonical frame columns. If it is the constant `full-width', + canonical frame columns. If it is the symbol `full-width', prefer a full-width window. `window-min-height' specifies a preferred minimum height in - canonical frame lines. If it is the constant `full-height', + canonical frame lines. If it is the symbol `full-height', prefer a full-height window. - If the preceding steps fail, try to pop up a new window on the diff --git a/src/window.c b/src/window.c index 2c002418605..b69f4719d93 100644 --- a/src/window.c +++ b/src/window.c @@ -8707,8 +8707,8 @@ on its frame), show another buffer in it. If the value is a function, it should take three arguments. The first argument specifies the frame whose windows have been restored. The -third argument is the constant `configuration' if the windows are -restored by `set-window-configuration' and the constant `state' if the +third argument is the symbol `configuration' if the windows are +restored by `set-window-configuration' and the symbol `state' if the windows are restored by `window-state-put'. The second argument specifies a list of entries for all windows commit deebf74b0e178f841c8f504b002b139d13889344 Author: Po Lu Date: Sat Mar 16 15:18:07 2024 +0800 ; * src/xterm.c (syms_of_xterm): Fix typo. diff --git a/src/xterm.c b/src/xterm.c index bebc30c9103..c30015ec8f0 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -32538,14 +32538,14 @@ Android does not support scroll bars at all. */); DEFVAR_LISP ("x-ctrl-keysym", Vx_ctrl_keysym, doc: /* Which modifer value Emacs reports when Ctrl is depressed. This should be one of the symbols `ctrl', `alt', `hyper', `meta', or -`super', representing a modifier to be reported in key events with the +`super', representing a modifier to be reported for key events with the Ctrl modifier (i.e. the keysym Ctrl_L or Ctrl_R) depressed. */); Vx_ctrl_keysym = Qnil; DEFVAR_LISP ("x-alt-keysym", Vx_alt_keysym, doc: /* Which modifer value Emacs reports when Alt is depressed. This should be one of the symbols `ctrl', `alt', `hyper', `meta', or -`super', representing a modifier to be reported in key events with the +`super', representing a modifier to be reported for key events with the Alt modifier (e.g. the keysym Alt_L or Alt_R, if the keyboard features a dedicated key for Meta) depressed. */); Vx_alt_keysym = Qnil; @@ -32553,14 +32553,14 @@ dedicated key for Meta) depressed. */); DEFVAR_LISP ("x-hyper-keysym", Vx_hyper_keysym, doc: /* Which modifer value Emacs reports when Hyper is depressed. This should be one of the symbols `ctrl', `alt', `hyper', `meta', or -`super', representing a modifier to be reported in key events with the +`super', representing a modifier to be reported for key events with the Hyper modifier (i.e. the keysym Hyper_L or Hyper_R) depressed. */); Vx_hyper_keysym = Qnil; DEFVAR_LISP ("x-meta-keysym", Vx_meta_keysym, doc: /* Which modifer value Emacs reports when Meta is depressed. This should be one of the symbols `ctrl', `alt', `hyper', `meta', or -`super', representing a modifier to be reported in key events with the +`super', representing a modifier to be reported for key events with the Meta modifier (e.g. the keysym Alt_L or Alt_R, when the keyboard does not feature a dedicated key for Meta) depressed. */); Vx_meta_keysym = Qnil; @@ -32568,7 +32568,7 @@ not feature a dedicated key for Meta) depressed. */); DEFVAR_LISP ("x-super-keysym", Vx_super_keysym, doc: /* Which modifer value Emacs reports when Super is depressed. This should be one of the symbols `ctrl', `alt', `hyper', `meta', or -`super', representing a modifier to be reported in key events with the +`super', representing a modifier to be reported for key events with the Super modifier (i.e. the keysym Super_L or Super_R) depressed. */); Vx_super_keysym = Qnil; commit 28e481bf7af873cdaf016e25855a8e0ebc424fe7 Author: Po Lu Date: Sat Mar 16 15:15:10 2024 +0800 Respond to default action from Gnus notifications * lisp/gnus/gnus-notifications.el (gnus-notifications-action): Consider default equivalent to read. diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el index 35f90ebfe40..e4c3d2c0381 100644 --- a/lisp/gnus/gnus-notifications.el +++ b/lisp/gnus/gnus-notifications.el @@ -75,10 +75,11 @@ not get notifications." (when group-article (let ((group (cadr group-article)) (article (nth 2 group-article))) - (cond ((string= key "read") + (cond ((or (equal key "read") + (equal key "default")) (gnus-fetch-group group (list article)) (select-frame-set-input-focus (selected-frame))) - ((string= key "mark-read") + ((equal key "mark-read") (gnus-update-read-articles group (delq article (gnus-list-of-unread-articles group))) diff --git a/src/androidterm.c b/src/androidterm.c index 9948a2919d8..ba9b6d3b8a9 100644 --- a/src/androidterm.c +++ b/src/androidterm.c @@ -376,11 +376,11 @@ android_android_to_emacs_modifiers (struct android_display_info *dpyinfo, tem = Fget (Vx_super_keysym, Qmodifier_value); if (FIXNUMP (tem)) mod_super = XFIXNUM (tem) & INT_MAX; - return (((state & ANDROID_CONTROL_MASK) ? mod_ctrl : 0) - | ((state & ANDROID_SHIFT_MASK) ? mod_shift : 0) - | ((state & ANDROID_ALT_MASK) ? mod_meta : 0) - | ((state & ANDROID_SUPER_MASK) ? mod_super : 0) - | ((state & ANDROID_META_MASK) ? mod_alt : 0)); + return (((state & ANDROID_CONTROL_MASK) ? mod_ctrl : 0) + | ((state & ANDROID_SHIFT_MASK) ? shift_modifier : 0) + | ((state & ANDROID_ALT_MASK) ? mod_meta : 0) + | ((state & ANDROID_SUPER_MASK) ? mod_super : 0) + | ((state & ANDROID_META_MASK) ? mod_alt : 0)); } static int @@ -402,11 +402,11 @@ android_emacs_to_android_modifiers (struct android_display_info *dpyinfo, tem = Fget (Vx_super_keysym, Qmodifier_value); if (FIXNUMP (tem)) mod_super = XFIXNUM (tem); - return (((state & mod_ctrl) ? ANDROID_CONTROL_MASK : 0) - | ((state & mod_shift) ? ANDROID_SHIFT_MASK : 0) - | ((state & mod_meta) ? ANDROID_ALT_MASK : 0) - | ((state & mod_super) ? ANDROID_SUPER_MASK : 0) - | ((state & mod_alt) ? ANDROID_META_MASK : 0)); + return (((state & mod_ctrl) ? ANDROID_CONTROL_MASK : 0) + | ((state & shift_modifier) ? ANDROID_SHIFT_MASK : 0) + | ((state & mod_meta) ? ANDROID_ALT_MASK : 0) + | ((state & mod_super) ? ANDROID_SUPER_MASK : 0) + | ((state & mod_alt) ? ANDROID_META_MASK : 0)); } static void android_frame_rehighlight (struct android_display_info *); commit 658529921614b8d5498c267a7ffc786c25d2d26f Author: Po Lu Date: Sat Mar 16 15:13:09 2024 +0800 Support x-*-keysym on Android * src/androidterm.c (android_android_to_emacs_modifiers) (android_emacs_to_android_modifiers, syms_of_androidterm): Port x-*-keysym from xterm.c. diff --git a/src/androidterm.c b/src/androidterm.c index f68f8a9ef62..9948a2919d8 100644 --- a/src/androidterm.c +++ b/src/androidterm.c @@ -361,22 +361,52 @@ static int android_android_to_emacs_modifiers (struct android_display_info *dpyinfo, int state) { - return (((state & ANDROID_CONTROL_MASK) ? ctrl_modifier : 0) - | ((state & ANDROID_SHIFT_MASK) ? shift_modifier : 0) - | ((state & ANDROID_ALT_MASK) ? meta_modifier : 0) - | ((state & ANDROID_SUPER_MASK) ? super_modifier : 0) - | ((state & ANDROID_META_MASK) ? alt_modifier : 0)); + int mod_ctrl = ctrl_modifier; + int mod_meta = meta_modifier; + int mod_alt = alt_modifier; + int mod_super = super_modifier; + Lisp_Object tem; + + tem = Fget (Vx_ctrl_keysym, Qmodifier_value); + if (FIXNUMP (tem)) mod_ctrl = XFIXNUM (tem) & INT_MAX; + tem = Fget (Vx_alt_keysym, Qmodifier_value); + if (FIXNUMP (tem)) mod_alt = XFIXNUM (tem) & INT_MAX; + tem = Fget (Vx_meta_keysym, Qmodifier_value); + if (FIXNUMP (tem)) mod_meta = XFIXNUM (tem) & INT_MAX; + tem = Fget (Vx_super_keysym, Qmodifier_value); + if (FIXNUMP (tem)) mod_super = XFIXNUM (tem) & INT_MAX; + + return (((state & ANDROID_CONTROL_MASK) ? mod_ctrl : 0) + | ((state & ANDROID_SHIFT_MASK) ? mod_shift : 0) + | ((state & ANDROID_ALT_MASK) ? mod_meta : 0) + | ((state & ANDROID_SUPER_MASK) ? mod_super : 0) + | ((state & ANDROID_META_MASK) ? mod_alt : 0)); } static int android_emacs_to_android_modifiers (struct android_display_info *dpyinfo, intmax_t state) { - return (((state & ctrl_modifier) ? ANDROID_CONTROL_MASK : 0) - | ((state & shift_modifier) ? ANDROID_SHIFT_MASK : 0) - | ((state & meta_modifier) ? ANDROID_ALT_MASK : 0) - | ((state & super_modifier) ? ANDROID_SUPER_MASK : 0) - | ((state & alt_modifier) ? ANDROID_META_MASK : 0)); + EMACS_INT mod_ctrl = ctrl_modifier; + EMACS_INT mod_meta = meta_modifier; + EMACS_INT mod_alt = alt_modifier; + EMACS_INT mod_super = super_modifier; + Lisp_Object tem; + + tem = Fget (Vx_ctrl_keysym, Qmodifier_value); + if (FIXNUMP (tem)) mod_ctrl = XFIXNUM (tem); + tem = Fget (Vx_alt_keysym, Qmodifier_value); + if (FIXNUMP (tem)) mod_alt = XFIXNUM (tem); + tem = Fget (Vx_meta_keysym, Qmodifier_value); + if (FIXNUMP (tem)) mod_meta = XFIXNUM (tem); + tem = Fget (Vx_super_keysym, Qmodifier_value); + if (FIXNUMP (tem)) mod_super = XFIXNUM (tem); + + return (((state & mod_ctrl) ? ANDROID_CONTROL_MASK : 0) + | ((state & mod_shift) ? ANDROID_SHIFT_MASK : 0) + | ((state & mod_meta) ? ANDROID_ALT_MASK : 0) + | ((state & mod_super) ? ANDROID_SUPER_MASK : 0) + | ((state & mod_alt) ? ANDROID_META_MASK : 0)); } static void android_frame_rehighlight (struct android_display_info *); @@ -6670,6 +6700,26 @@ Emacs is running on. */); doc: /* Name of the developer of the running version of Android. */); Vandroid_build_manufacturer = Qnil; + DEFVAR_LISP ("x-ctrl-keysym", Vx_ctrl_keysym, + doc: /* SKIP: real doc in xterm.c. */); + Vx_ctrl_keysym = Qnil; + + DEFVAR_LISP ("x-alt-keysym", Vx_alt_keysym, + doc: /* SKIP: real doc in xterm.c. */); + Vx_alt_keysym = Qnil; + + DEFVAR_LISP ("x-hyper-keysym", Vx_hyper_keysym, + doc: /* SKIP: real doc in xterm.c. */); + Vx_hyper_keysym = Qnil; + + DEFVAR_LISP ("x-meta-keysym", Vx_meta_keysym, + doc: /* SKIP: real doc in xterm.c. */); + Vx_meta_keysym = Qnil; + + DEFVAR_LISP ("x-super-keysym", Vx_super_keysym, + doc: /* SKIP: real doc in xterm.c. */); + Vx_super_keysym = Qnil; + /* Only defined so loadup.el loads scroll-bar.el. */ DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars, doc: /* SKIP: real doc in xterm.c. */); @@ -6683,6 +6733,17 @@ Emacs is running on. */); /* Symbols defined for DND events. */ DEFSYM (Quri, "uri"); DEFSYM (Qtext, "text"); + + /* Symbols defined for modifier value reassignment. */ + DEFSYM (Qmodifier_value, "modifier-value"); + DEFSYM (Qctrl, "ctrl"); + Fput (Qctrl, Qmodifier_value, make_fixnum (ctrl_modifier)); + DEFSYM (Qalt, "alt"); + Fput (Qalt, Qmodifier_value, make_fixnum (alt_modifier)); + DEFSYM (Qmeta, "meta"); + Fput (Qmeta, Qmodifier_value, make_fixnum (meta_modifier)); + DEFSYM (Qsuper, "super"); + Fput (Qsuper, Qmodifier_value, make_fixnum (super_modifier)); } void commit 4d03f70b7f01477a8d72f827ba8b0dabba8c0a61 Author: Po Lu Date: Sat Mar 16 15:12:33 2024 +0800 Correct doc strings for x-*-keysym * src/xterm.c (syms_of_xterm): Clarify whether x-*-keysym affects the modifier key reported for a keysym or the other way around. diff --git a/src/xterm.c b/src/xterm.c index c8a43785564..bebc30c9103 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -32536,38 +32536,40 @@ Android does not support scroll bars at all. */); DEFSYM (Qreally_fast, "really-fast"); DEFVAR_LISP ("x-ctrl-keysym", Vx_ctrl_keysym, - doc: /* Which keys Emacs uses for the ctrl modifier. -This should be one of the symbols `ctrl', `alt', `hyper', `meta', -`super'. For example, `ctrl' means use the Ctrl_L and Ctrl_R keysyms. -The default is nil, which is the same as `ctrl'. */); + doc: /* Which modifer value Emacs reports when Ctrl is depressed. +This should be one of the symbols `ctrl', `alt', `hyper', `meta', or +`super', representing a modifier to be reported in key events with the +Ctrl modifier (i.e. the keysym Ctrl_L or Ctrl_R) depressed. */); Vx_ctrl_keysym = Qnil; DEFVAR_LISP ("x-alt-keysym", Vx_alt_keysym, - doc: /* Which keys Emacs uses for the alt modifier. -This should be one of the symbols `ctrl', `alt', `hyper', `meta', -`super'. For example, `alt' means use the Alt_L and Alt_R keysyms. -The default is nil, which is the same as `alt'. */); + doc: /* Which modifer value Emacs reports when Alt is depressed. +This should be one of the symbols `ctrl', `alt', `hyper', `meta', or +`super', representing a modifier to be reported in key events with the +Alt modifier (e.g. the keysym Alt_L or Alt_R, if the keyboard features a +dedicated key for Meta) depressed. */); Vx_alt_keysym = Qnil; DEFVAR_LISP ("x-hyper-keysym", Vx_hyper_keysym, - doc: /* Which keys Emacs uses for the hyper modifier. -This should be one of the symbols `ctrl', `alt', `hyper', `meta', -`super'. For example, `hyper' means use the Hyper_L and Hyper_R -keysyms. The default is nil, which is the same as `hyper'. */); + doc: /* Which modifer value Emacs reports when Hyper is depressed. +This should be one of the symbols `ctrl', `alt', `hyper', `meta', or +`super', representing a modifier to be reported in key events with the +Hyper modifier (i.e. the keysym Hyper_L or Hyper_R) depressed. */); Vx_hyper_keysym = Qnil; DEFVAR_LISP ("x-meta-keysym", Vx_meta_keysym, - doc: /* Which keys Emacs uses for the meta modifier. -This should be one of the symbols `ctrl', `alt', `hyper', `meta', -`super'. For example, `meta' means use the Meta_L and Meta_R keysyms. -The default is nil, which is the same as `meta'. */); + doc: /* Which modifer value Emacs reports when Meta is depressed. +This should be one of the symbols `ctrl', `alt', `hyper', `meta', or +`super', representing a modifier to be reported in key events with the +Meta modifier (e.g. the keysym Alt_L or Alt_R, when the keyboard does +not feature a dedicated key for Meta) depressed. */); Vx_meta_keysym = Qnil; DEFVAR_LISP ("x-super-keysym", Vx_super_keysym, - doc: /* Which keys Emacs uses for the super modifier. -This should be one of the symbols `ctrl', `alt', `hyper', `meta', -`super'. For example, `super' means use the Super_L and Super_R -keysyms. The default is nil, which is the same as `super'. */); + doc: /* Which modifer value Emacs reports when Super is depressed. +This should be one of the symbols `ctrl', `alt', `hyper', `meta', or +`super', representing a modifier to be reported in key events with the +Super modifier (i.e. the keysym Super_L or Super_R) depressed. */); Vx_super_keysym = Qnil; DEFVAR_LISP ("x-wait-for-event-timeout", Vx_wait_for_event_timeout, commit 3b791ebbe173fa18515558acaafbef1f88c51791 Author: Basil L. Contovounesios Date: Sat Mar 16 00:19:43 2024 +0100 ; Fix 'usage:' keyword in Ffile_name_concat doc. diff --git a/src/fileio.c b/src/fileio.c index a2e230879c3..a5d29d81fb7 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -759,7 +759,7 @@ Elements in COMPONENTS must be a string or nil. DIRECTORY or the non-final elements in COMPONENTS may or may not end with a slash -- if they don't end with a slash, a slash will be inserted before concatenating. -usage: (record DIRECTORY &rest COMPONENTS) */) +usage: (file-name-concat DIRECTORY &rest COMPONENTS) */) (ptrdiff_t nargs, Lisp_Object *args) { ptrdiff_t chars = 0, bytes = 0, multibytes = 0, eargs = 0; commit ed48b0d657cbf183a3e391a95672f921688e6ba8 Author: Eli Zaretskii Date: Fri Mar 15 13:29:31 2024 +0200 ; * CONTRIBUTE: Ask not to use non-ASCII unless necessary. diff --git a/CONTRIBUTE b/CONTRIBUTE index cdb47911d76..af5519c1bb3 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -237,6 +237,8 @@ formatting them: particular, gnu.org and fsf.org URLs should start with "https:". - Commit messages should contain only printable UTF-8 characters. + However, we ask that non-ASCII characters be used only if strictly + necessary, not just for aesthetic purposes. - Commit messages should not contain the "Signed-off-by:" lines that are used in some other projects. commit b708e639d63f488a98c7416866665c16730b9e8f Author: Eli Zaretskii Date: Thu Mar 14 21:08:36 2024 +0200 ; * src/lread.c (maybe_swap_for_eln): Clarify warning message. diff --git a/src/lread.c b/src/lread.c index 451f699e27d..7574e45f3dd 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1745,9 +1745,9 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd, = Fcons (list2 (Qcomp, CALLN (Fformat, - build_string ("Cannot look up eln " - "file as no source file " - "was found for %s"), + build_string ("Cannot look up .eln file " + "for %s because no source " + "file was found for it"), *filename)), Vdelayed_warnings_list); return; commit db027a06976ee1bcbe6294e281bd5954dd1052ef Author: Basil L. Contovounesios Date: Tue Mar 12 22:47:45 2024 +0100 ; Fix bibtex-biblatex-field-alist docstring typo. diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 3d155ac87b5..d78dac53516 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -1012,7 +1012,7 @@ if `bibtex-BibTeX-entry-alist' does not define a comment for FIELD." ("volumes" "Total number of volumes of a multi-volume work") ("year" "Year of publication")) "Alist of biblatex fields. -It has the same format as `bibtex-BibTeX-entry-alist'." +It has the same format as `bibtex-BibTeX-field-alist'." :group 'bibtex :version "28.1" :type 'bibtex-field-alist) commit a9be5c7ea92e7868873d6d3c721d5a0be62ee3ad Author: Arash Esbati Date: Tue Mar 12 12:53:32 2024 +0100 ; * doc/lispref/control.texi (Conditionals): Add missing paren (bug#69742). diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index eb1640ede52..292086ee4e0 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -322,7 +322,7 @@ described below. @defmac if-let spec then-form else-forms... Evaluate each binding in @var{spec} in turn, like in @code{let*} -(@pxref{Local Variables}, stopping if a binding value is @code{nil}. +(@pxref{Local Variables}), stopping if a binding value is @code{nil}. If all are non-@code{nil}, return the value of @var{then-form}, otherwise the last form in @var{else-forms}. @end defmac commit db5915f30ba063b72b007d243fbd832e8a4e8961 Author: F. Jason Park Date: Sun Mar 10 20:13:42 2024 -0700 Fix 'with-sqlite-transaction' * lisp/sqlite.el (with-sqlite-transaction): Tuck misplaced body of else form back into feature-test control structure whence it escaped. (Bug#67142) * test/lisp/sqlite-tests.el: New file to accompany test/src/sqlite-tests.el. diff --git a/lisp/sqlite.el b/lisp/sqlite.el index 46e35ac18d8..efc5997fb5c 100644 --- a/lisp/sqlite.el +++ b/lisp/sqlite.el @@ -32,7 +32,8 @@ If BODY completes normally, commit the changes and return the value of BODY. If BODY signals an error, or transaction commit fails, roll -back the transaction changes." +back the transaction changes before allowing the signal to +propagate." (declare (indent 1) (debug (form body))) (let ((db-var (gensym)) (func-var (gensym)) @@ -48,8 +49,8 @@ back the transaction changes." (setq ,res-var (funcall ,func-var)) (setq ,commit-var (sqlite-commit ,db-var)) ,res-var) - (or ,commit-var (sqlite-rollback ,db-var)))) - (funcall ,func-var)))) + (or ,commit-var (sqlite-rollback ,db-var))) + (funcall ,func-var))))) (provide 'sqlite) diff --git a/test/lisp/sqlite-tests.el b/test/lisp/sqlite-tests.el new file mode 100644 index 00000000000..d4892a27efc --- /dev/null +++ b/test/lisp/sqlite-tests.el @@ -0,0 +1,51 @@ +;;; sqlite-tests.el --- Tests for sqlite.el -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: +(require 'sqlite) + +(ert-deftest with-sqlite-transaction () + (skip-unless (sqlite-available-p)) + (let ((db (sqlite-open))) + (sqlite-execute db "create table test (a)") + (should + (eql 42 (with-sqlite-transaction db + (sqlite-execute db "insert into test values (1)") + (should (equal '((1)) (sqlite-select db "select * from test"))) + 42))) + ;; Body runs exactly once. + (should (equal '((1)) (sqlite-select db "select * from test"))))) + +(ert-deftest with-sqlite-transaction/rollback () + (skip-unless (sqlite-available-p)) + (let ((db (sqlite-open))) + (sqlite-execute db "create table test (a)") + (should (equal '(sqlite-error + ("SQL logic error" "no such function: fake" 1 1)) + (should-error + (with-sqlite-transaction db + (sqlite-execute db "insert into test values (1)") + (sqlite-execute db "insert into test values (fake(2))") + 42)))) + ;; First insertion (a=1) rolled back. + (should-not (sqlite-select db "select * from test")))) + +;;; sqlite-tests.el ends here commit fe491173e8f839653cb22eea63a7261f4aa1dca9 Author: Eli Zaretskii Date: Sat Mar 9 11:40:27 2024 +0200 ; * doc/emacs/files.texi (Image Mode): Fix typo (bug#69671). diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 36f72d42ba2..971483a6e4c 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -2373,7 +2373,7 @@ multiply the size by the factor of @w{@code{1 + @var{n} / 10}}, so @findex image-decrease-size @kindex i - (Image mode) @item i - -Decrease the image size (@code{image-increase-size}) by 20%. Prefix +Decrease the image size (@code{image-decrease-size}) by 20%. Prefix numeric argument controls the decrement; the value of @var{n} means to multiply the size by the factor of @w{@code{1 - @var{n} / 10}}, so @w{@kbd{C-u 3 i -}} means to decrease the size by 30%.