From 2a41b6ba51457448b3937fbb1d9e06f62c3d5a9f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 7 Apr 2024 09:24:58 +0300 Subject: [PATCH 01/11] ; * src/filelock.c (Flock_file): Doc fix (bug#70216). --- src/filelock.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/filelock.c b/src/filelock.c index 7acee1f8ddd..3dc5f6d68d6 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -772,8 +772,11 @@ unlock_all_files (void) } DEFUN ("lock-file", Flock_file, Slock_file, 1, 1, 0, - doc: /* Lock FILE. -If the option `create-lockfiles' is nil, this does nothing. */) + doc: /* Check whether FILE was modified since it was visited, and lock it. +If user option `create-lockfiles' is nil, this does not create +a lock file for FILE, but it still checks whether FILE was modified +outside of the current Emacs session, and if so, asks the user +whether to modify FILE. */) (Lisp_Object file) { #ifndef MSDOS From 19cee16576ef09990ac14d1ec5f0ddcd4594f5ce Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 7 Apr 2024 09:15:42 +0200 Subject: [PATCH 02/11] ; * doc/emacs/misc.texi (emacsclient Options): Fix typo. (Bug#70238) --- doc/emacs/misc.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 48bc69456ad..488f6de04ed 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -2157,7 +2157,7 @@ running on a text terminal, it creates a new frame in the current text terminal. @item -T @var{tramp-prefix} -@itemx --tramp-prefix=@var{tramp-prefix} +@itemx --tramp=@var{tramp-prefix} Set the prefix to add to filenames for Emacs to locate files on remote machines (@pxref{Remote Files}) using TRAMP (@pxref{Top, The Tramp Manual,, tramp, The Tramp Manual}). This is mostly useful in From 55aab2d471024bda1878897e81e3b5695e242f09 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 7 Apr 2024 10:32:47 +0300 Subject: [PATCH 03/11] ; * etc/PROBLEMS: An entry about focus issues with XFCE (bug#70046). --- etc/PROBLEMS | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 16521e257dd..36fee69351e 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -1615,6 +1615,18 @@ underlying functionality in plasmashell gets fully disabled as well. At least a restart of plasmashell is required for the clipboard history to be cleared. +*** XFCE: Selected frame loses focus + +This can happen, e.g., in Ediff: when you move between the differences +by typing into the control frame, input focus unexpectedly switches to +the buffers where Emacs shows the differences, instead of being left +in the Ediff control frame. + +The reason is a bug in the window manager: it shifts input focus when +raising a frame. A workaround is to activate the "focus stealing +prevention" option of the window manager (in XFCE settings, under +"window manager tweaks", in the "focus" tab). + *** CDE: Frames may cover dialogs they created when using CDE. This can happen if you have "Allow Primary Windows On Top" enabled which From aca5064f128e20a495e9ddf254248ab77b613754 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 7 Apr 2024 10:33:14 +0300 Subject: [PATCH 04/11] ; Fix last change. --- etc/PROBLEMS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 36fee69351e..54dc23c0951 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -1618,9 +1618,9 @@ history to be cleared. *** XFCE: Selected frame loses focus This can happen, e.g., in Ediff: when you move between the differences -by typing into the control frame, input focus unexpectedly switches to -the buffers where Emacs shows the differences, instead of being left -in the Ediff control frame. +by typing 'n' or 'p' into the control frame, input focus unexpectedly +switches to the buffers where Emacs shows the differences, instead of +being left in the Ediff control frame. The reason is a bug in the window manager: it shifts input focus when raising a frame. A workaround is to activate the "focus stealing From 407e85ce139c2f0ab8bc7f9643ee7506a4e561a1 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Mon, 8 Apr 2024 21:07:11 -0700 Subject: [PATCH 05/11] Fix c++-ts-mode defun navigation (bug#65885) * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Add BOL and EOL marker in the regexp. --- lisp/progmodes/c-ts-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index e69856baecc..a7a416b94f4 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -1155,7 +1155,9 @@ BEG and END are described in `treesit-range-rules'." "struct_specifier" "enum_specifier" "union_specifier" - "class_specifier" + ;; Make sure this doesn't match + ;; storage_class_specifier. + "^class_specifier$" "namespace_definition") (and c-ts-mode-emacs-sources-support '(;; DEFUN. From 859b4227e3de9f8e7bc26367540aa315cefc37dc Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Mon, 8 Apr 2024 20:20:25 -0700 Subject: [PATCH 06/11] Update go-ts-mode to support latest tree-sitter-go grammar tree-sitter-go changed method_spec to method_elem in https://github.com/tree-sitter/tree-sitter-go/commit/b82ab803d887002a0af11f6ce63d72884580bf33 * lisp/progmodes/go-ts-mode.el: (go-ts-mode--method-elem-supported-p): New function. (go-ts-mode--font-lock-settings): Conditionally use method_elem or method_spec in the query. --- lisp/progmodes/go-ts-mode.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index e8a176e3d9d..a5b49bd8313 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -112,6 +112,13 @@ (ignore-errors (or (treesit-query-string "" '((iota) @font-lock-constant-face) 'go) t))) +;; tree-sitter-go changed method_spec to method_elem in +;; https://github.com/tree-sitter/tree-sitter-go/commit/b82ab803d887002a0af11f6ce63d72884580bf33 +(defun go-ts-mode--method-elem-supported-p () + "Return t if Go grammar uses `method_elem' instead of `method_spec'." + (ignore-errors + (or (treesit-query-string "" '((method_elem) @cap) 'go) t))) + (defvar go-ts-mode--font-lock-settings (treesit-font-lock-rules :language 'go @@ -136,11 +143,13 @@ :language 'go :feature 'definition - '((function_declaration + `((function_declaration name: (identifier) @font-lock-function-name-face) (method_declaration name: (field_identifier) @font-lock-function-name-face) - (method_spec + (,(if (go-ts-mode--method-elem-supported-p) + 'method_elem + 'method_spec) name: (field_identifier) @font-lock-function-name-face) (field_declaration name: (field_identifier) @font-lock-property-name-face) From 6a0bb7beae3ed4e3d2b420b73abcfaada38f53ee Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Wed, 10 Apr 2024 10:42:39 +0200 Subject: [PATCH 07/11] * doc/emacs/misc.texi (emacsclient Options): Suggest forwarding sockets. (Bug#66667) --- doc/emacs/misc.texi | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 488f6de04ed..41e37fd094e 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -2161,8 +2161,9 @@ terminal. Set the prefix to add to filenames for Emacs to locate files on remote machines (@pxref{Remote Files}) using TRAMP (@pxref{Top, The Tramp Manual,, tramp, The Tramp Manual}). This is mostly useful in -combination with using the Emacs server over TCP (@pxref{TCP Emacs -server}). By ssh-forwarding the listening port and making the +combination with using the Emacs server from a remote host. By +ssh-forwarding the listening socket, or ssh-forwarding the listening +port @pxref{TCP Emacs server} and making the @var{server-file} available on a remote machine, programs on the remote machine can use @command{emacsclient} as the value for the @env{EDITOR} and similar environment variables, but instead of talking @@ -2174,16 +2175,29 @@ Setting the environment variable @env{EMACSCLIENT_TRAMP} has the same effect as using the @samp{-T} option. If both are specified, the command-line option takes precedence. -For example, assume two hosts, @samp{local} and @samp{remote}, and -that the local Emacs listens on tcp port 12345. Assume further that +For example, assume two hosts, @samp{local} and @samp{remote}. + +@example +local$ ssh -R "/home/%r/.emacs.socket":"$@{XDG_RUNTIME_DIR:-$@{TMPDIR:-/tmp@}/emacs%i@}$@{XDG_RUNTIME_DIR:+/emacs@}/server" remote +remote$ export EMACS_SOCKET_NAME=$HOME/.emacs.socket +remote$ export EMACSCLIENT_TRAMP=/ssh:remote: +remote$ export EDITOR=emacsclient +remote$ $EDITOR /tmp/foo.txt #Should open in local emacs. +@end example + +If you are using a platform where @command{emacsclient} does not use +Unix domain sockets (i.e., MS-Windows), or your SSH implementation is +not able to forward them (e.g., OpenSSH before version 6.7), you can +forward a TCP port instead. In this example, assume that the local +Emacs listens on tcp port 12345. Assume further that @file{/home} is on a shared file system, so that the server file @file{~/.emacs.d/server/server} is readable on both hosts. @example local$ ssh -R12345:localhost:12345 remote -remote$ export EDITOR="emacsclient \ - --server-file=server \ - --tramp=/ssh:remote:" +remote$ export EMACS_SERVER_FILE=server +remote$ export EMACSCLIENT_TRAMP=/ssh:remote: +remote$ export EDITOR=emacsclient remote$ $EDITOR /tmp/foo.txt #Should open in local emacs. @end example From db7b571aaaf4aa16fc6a88a53a8740c3a102ce60 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 10 Apr 2024 16:52:21 +0300 Subject: [PATCH 08/11] ; Improve documentation of 'world-clock' * lisp/time.el (zoneinfo-style-world-list) (legacy-style-world-list): Doc fixes. --- lisp/time.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/time.el b/lisp/time.el index 6d95ae326c6..29c7f53ac1f 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -452,7 +452,11 @@ Each element has the form (TIMEZONE LABEL). TIMEZONE should be a string of the form AREA/LOCATION, where AREA is the name of a region -- a continent or ocean, and LOCATION is the name of a specific location, e.g., a city, within that region. -LABEL is a string to display as the label of that TIMEZONE's time." +LABEL is a string to display as the label of that TIMEZONE's time. + +This option has effect only on systems that support Posix-style +zoneinfo files specified as CONTINENT/CITY. In particular, +MS-Windows doesn't support that; use `legacy-style-world-list' instead." :type '(repeat (list string string)) :version "23.1") @@ -471,7 +475,10 @@ TIMEZONE should be a string of the form: See the documentation of the TZ environment variable on your system, for more details about the format of TIMEZONE. -LABEL is a string to display as the label of that TIMEZONE's time." +LABEL is a string to display as the label of that TIMEZONE's time + +This is the only option that has effect on MS-Windows, where you also +cannot specify the [offset][,date[/time],date[/time]] part." :type '(repeat (list string string)) :version "23.1") From 4cefa3c0b1f7270ca5317caa02101a0257595b9c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 10 Apr 2024 22:31:57 +0300 Subject: [PATCH 09/11] ; * doc/emacs/files.texi (Backup): Clarify "saving" (bug#70326). --- doc/emacs/files.texi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index d074a55b762..393c4728422 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -569,9 +569,10 @@ Emacs carefully copies the old contents to another file, called the @dfn{backup} file, before actually saving. Emacs makes a backup for a file only the first time the file is -saved from a buffer. No matter how many times you subsequently save -the file, its backup remains unchanged. However, if you kill the -buffer and then visit the file again, a new backup file will be made. +saved from the buffer that visits it. No matter how many times you +subsequently save the file, its backup remains unchanged. However, if +you kill the buffer and then visit the file again, a new backup file +will be made. For most files, the variable @code{make-backup-files} determines whether to make backup files. On most operating systems, its default From ea62a14ea3b7f3f6feb0c7c803eeabe3c8499276 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 11 Apr 2024 18:34:53 +0300 Subject: [PATCH 10/11] Fix display of vscrolled windows * src/xdisp.c (redisplay_window): Fix condition for resetting the window's vscroll. (Bug#70038) --- src/xdisp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 2d85a991e77..a9eb47720d0 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -19811,7 +19811,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) /* The vscroll should be preserved in this case, since `pixel-scroll-precision-mode' must continue working normally when a mini-window is resized. (bug#55312) */ - if (!w->preserve_vscroll_p || !window_frozen_p (w)) + if (!w->preserve_vscroll_p && !window_frozen_p (w)) w->vscroll = 0; w->preserve_vscroll_p = false; From f0300fb0597225762ac6e62eeec4e223a7ad1df9 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sat, 13 Apr 2024 10:36:50 +0200 Subject: [PATCH 11/11] ; Tweak "(emacs)Bug Reference" formatting/wording. --- doc/emacs/maintaining.texi | 51 ++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 14bdbc57f14..b22aa018292 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -3333,29 +3333,30 @@ merge requests resulting in different URLs. @vindex bug-reference-auto-setup-functions If @code{bug-reference-mode} is activated, -@code{bug-reference-mode-hook} has been run and still -@code{bug-reference-bug-regexp}, and @code{bug-reference-url-format} -aren't both set, it'll try to setup suitable values for these two -variables itself by calling the functions in -@code{bug-reference-auto-setup-functions} one after the other until -one is able to set the variables. +@code{bug-reference-mode-hook} has been run, and either +@code{bug-reference-bug-regexp} or @code{bug-reference-url-format} is +still @code{nil}, the mode will try to automatically find a suitable +value for these two variables by calling the functions in +@code{bug-reference-auto-setup-functions} one by one until one +succeeds. @vindex bug-reference-setup-from-vc-alist @vindex bug-reference-forge-alist @vindex bug-reference-setup-from-mail-alist @vindex bug-reference-setup-from-irc-alist - Right now, there are three types of setup functions. +Right now, there are three types of setup functions. + @enumerate @item Setup for version-controlled files configurable by the variables @code{bug-reference-forge-alist}, and @code{bug-reference-setup-from-vc-alist}. The defaults are able to -setup GNU projects where @url{https://debbugs.gnu.org} is used as +set up GNU projects where @url{https://debbugs.gnu.org} is used as issue tracker and issues are usually referenced as @code{bug#13} (but -many different notations are considered, too), and several kinds of -modern software forges such as GitLab, Gitea, SourceHut, or GitHub. -If you deploy a self-hosted instance of such a forge, the easiest way -to tell bug-reference about it is through +many different notations are considered, too), as well as several +other kinds of software forges such as GitLab, Gitea, SourceHut, and +GitHub. If you deploy a self-hosted instance of such a forge, the +easiest way to tell bug-reference about it is through @code{bug-reference-forge-alist}. @item @@ -3372,7 +3373,7 @@ Rcirc, @xref{Top, Rcirc,, rcirc, The Rcirc Manual}, and ERC, @end enumerate For almost all of those modes, it's enough to simply enable -@code{bug-reference-mode}, only Rmail requires a slightly different +@code{bug-reference-mode}; only Rmail requires a slightly different setup. @smallexample @@ -3403,33 +3404,35 @@ to be performed whenever another messages is displayed. @heading Adding support for third-party packages @vindex bug-reference-auto-setup-functions -Adding support for bug-reference' auto-setup is usually quite -straight-forward: write a setup function of zero arguments which +Adding support for bug-reference auto-setup is usually quite +straightforward: write a setup function of zero arguments which gathers the required information (e.g., List-Id/To/From/Cc mail header values in the case of a MUA), and then calls one of the following helper functions: + @itemize @bullet @item -@code{bug-reference-maybe-setup-from-vc} which does the setup -according to @code{bug-reference-setup-from-vc-alist}, +@code{bug-reference-maybe-setup-from-vc}, which does the setup +according to @code{bug-reference-setup-from-vc-alist}; @item -@code{bug-reference-maybe-setup-from-mail} which does the setup -according to @code{bug-reference-setup-from-mail-alist}, +@code{bug-reference-maybe-setup-from-mail}, which does the setup +according to @code{bug-reference-setup-from-mail-alist}; and @item -and @code{bug-reference-maybe-setup-from-irc} which does the setup +@code{bug-reference-maybe-setup-from-irc}, which does the setup according to @code{bug-reference-setup-from-irc-alist}. @end itemize -A setup function should return non-@code{nil} if it could setup bug-reference -mode which is the case if the last thing the function does is calling -one of the helper functions above. + +A setup function should return non-@code{nil} if it could set up +bug-reference mode, which is the case if the last thing the function +does is call one of the helper functions above. Finally, the setup function has to be added to @code{bug-reference-auto-setup-functions}. Note that these auto-setup functions should check as a first step if -they are applicable, e.g., by checking the @code{major-mode} value. +they are applicable, e.g., by checking the value of @code{major-mode}. @heading Integration with the debbugs package