commit 65834b8f8d53402517da7fe2446f5bac0aa30c39 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Tue Jul 25 20:38:01 2023 +0300 Avoid crashes under 'which-key-mode' * src/keyboard.c (Fthis_single_command_keys): Don't allow calls to Fvector with negative first argument. (Bug#64857) diff --git a/src/keyboard.c b/src/keyboard.c index 41cda2e65de..2e850b74b9b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -11138,8 +11138,8 @@ DEFUN ("this-single-command-keys", Fthis_single_command_keys, The value is always a vector. */) (void) { - return Fvector (this_command_key_count - - this_single_command_key_start, + ptrdiff_t nkeys = this_command_key_count - this_single_command_key_start; + return Fvector (nkeys < 0 ? 0 : nkeys, (XVECTOR (this_command_keys)->contents + this_single_command_key_start)); } commit 142007b747eacf81b609f98852053bc0f6e18bdf Author: Eli Zaretskii Date: Tue Jul 25 17:51:58 2023 +0300 Don't suggest to revert buffer from non-existing file * lisp/files-x.el (modify-file-local-variable-message): Suggest to revert from the buffer's file only if that file exists; otherwise suggest 'normal-mode'. (Bug#64844) diff --git a/lisp/files-x.el b/lisp/files-x.el index 9b1a7a17902..3ba7632d253 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -136,7 +136,10 @@ modify-file-local-variable-message (eq new-value not-value) (not (equal old-value new-value))) (message "%s" (substitute-command-keys - "For this change to take effect revisit file using \\[revert-buffer]"))))) + (if (and (stringp buffer-file-name) + (file-exists-p buffer-file-name)) + "For this change to take effect revisit file using \\[revert-buffer]" + "For this change to take effect use \\[normal-mode]")))))) (defun modify-file-local-variable (variable value op &optional interactive) "Modify file-local VARIABLE in Local Variables depending on operation OP. commit f6e4e77d23d0be79be83ef41c3ea9acd5c983af2 Author: Eli Zaretskii Date: Tue Jul 25 16:49:18 2023 +0300 ; Minor documentation fixes * src/character.c (Fstring_width): Doc fix. * doc/emacs/trouble.texi (Understanding Bug Reporting): Fix typo (bug#64854). diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index bccdea72b19..d2e8ac3452a 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi @@ -706,7 +706,7 @@ Understanding Bug Reporting for the detailed raw data. Reporting the facts is straightforward, but many people strain to posit explanations and report them instead of the facts. If the explanations are based on guesses about how -Emacs is implemented, they night not be useful; meanwhile, lacking the +Emacs is implemented, they might not be useful; meanwhile, lacking the facts, we will have no real information about the bug. If you want to actually @emph{debug} the problem, and report explanations that are more than guesses, that is useful---but please include the raw facts diff --git a/src/character.c b/src/character.c index ae153a579d6..9389e1c0098 100644 --- a/src/character.c +++ b/src/character.c @@ -470,7 +470,7 @@ DEFUN ("string-width", Fstring_width, Sstring_width, 1, 3, 0, ignored as well, as are display properties and invisible text. For these reasons, the results are not generally reliable; for accurate dimensions of text as it will be displayed, -use `window-text-pixel-size' instead. +use `string-pixel-width' or `window-text-pixel-size' instead. usage: (string-width STRING &optional FROM TO) */) (Lisp_Object str, Lisp_Object from, Lisp_Object to) {