aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2023-07-26 08:08:11 +0800
committerPo Lu2023-07-26 08:08:11 +0800
commitce63f592f579e8963a3e7f44b31c7df50fb0cdba (patch)
tree793f825ecee551a84dd4fce79ff8df9bd91e8d2a
parentb7de14b56fac658411baeaede56416ad322fecfd (diff)
parent65834b8f8d53402517da7fe2446f5bac0aa30c39 (diff)
downloademacs-ce63f592f579e8963a3e7f44b31c7df50fb0cdba.tar.gz
emacs-ce63f592f579e8963a3e7f44b31c7df50fb0cdba.zip
Merge remote-tracking branch 'origin/master' into feature/android
-rw-r--r--doc/emacs/trouble.texi2
-rw-r--r--lisp/files-x.el5
-rw-r--r--lisp/userlock.el17
-rw-r--r--src/character.c2
-rw-r--r--src/keyboard.c4
5 files changed, 20 insertions, 10 deletions
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 @@ produced by typing those commands.
706for the detailed raw data. Reporting the facts is straightforward, 706for the detailed raw data. Reporting the facts is straightforward,
707but many people strain to posit explanations and report them instead 707but many people strain to posit explanations and report them instead
708of the facts. If the explanations are based on guesses about how 708of the facts. If the explanations are based on guesses about how
709Emacs is implemented, they night not be useful; meanwhile, lacking the 709Emacs is implemented, they might not be useful; meanwhile, lacking the
710facts, we will have no real information about the bug. If you want to 710facts, we will have no real information about the bug. If you want to
711actually @emph{debug} the problem, and report explanations that are 711actually @emph{debug} the problem, and report explanations that are
712more than guesses, that is useful---but please include the raw facts 712more than guesses, that is useful---but please include the raw facts
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 @@ Intended to be used in the `interactive' spec of
136 (eq new-value not-value) 136 (eq new-value not-value)
137 (not (equal old-value new-value))) 137 (not (equal old-value new-value)))
138 (message "%s" (substitute-command-keys 138 (message "%s" (substitute-command-keys
139 "For this change to take effect revisit file using \\[revert-buffer]"))))) 139 (if (and (stringp buffer-file-name)
140 (file-exists-p buffer-file-name))
141 "For this change to take effect revisit file using \\[revert-buffer]"
142 "For this change to take effect use \\[normal-mode]"))))))
140 143
141(defun modify-file-local-variable (variable value op &optional interactive) 144(defun modify-file-local-variable (variable value op &optional interactive)
142 "Modify file-local VARIABLE in Local Variables depending on operation OP. 145 "Modify file-local VARIABLE in Local Variables depending on operation OP.
diff --git a/lisp/userlock.el b/lisp/userlock.el
index 562bc0a0a9f..96de17d54fd 100644
--- a/lisp/userlock.el
+++ b/lisp/userlock.el
@@ -110,10 +110,11 @@ You can <\\`q'>uit; don't modify this file."))
110 110
111(defun userlock--check-content-unchanged (filename) 111(defun userlock--check-content-unchanged (filename)
112 (with-demoted-errors "Unchanged content check: %S" 112 (with-demoted-errors "Unchanged content check: %S"
113 ;; Even tho we receive `filename', we know that `filename' refers to the current 113 ;; Even tho we receive `filename', we know that `filename' refers
114 ;; buffer's file. 114 ;; to the current buffer's file.
115 (cl-assert (equal (expand-file-name filename) 115 (cl-assert (or (null buffer-file-truename) ; temporary buffer
116 (expand-file-name buffer-file-truename))) 116 (equal (expand-file-name filename)
117 (expand-file-name buffer-file-truename))))
117 ;; Note: rather than read the file and compare to the buffer, we could save 118 ;; Note: rather than read the file and compare to the buffer, we could save
118 ;; the buffer and compare to the file, but for encrypted data this 119 ;; the buffer and compare to the file, but for encrypted data this
119 ;; wouldn't work well (and would risk exposing the data). 120 ;; wouldn't work well (and would risk exposing the data).
@@ -135,7 +136,13 @@ You can <\\`q'>uit; don't modify this file."))
135 (compare-buffer-substrings 136 (compare-buffer-substrings
136 buf start end 137 buf start end
137 (current-buffer) (point-min) (point-max)))))) 138 (current-buffer) (point-min) (point-max))))))
138 (set-visited-file-modtime) 139 ;; We know that some buffer visits FILENAME, because our
140 ;; caller (see lock_file) verified that. Thus, we set the
141 ;; modtime in that buffer, to cater to use case where the
142 ;; file is about to be written to from some buffer that
143 ;; doesn't visit any file, like a temporary buffer.
144 (with-current-buffer (get-file-buffer (file-truename filename))
145 (set-visited-file-modtime))
139 'unchanged))))) 146 'unchanged)))))
140 147
141;;;###autoload 148;;;###autoload
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 @@ used for non-Latin and other unusual characters (such as emoji) is
470ignored as well, as are display properties and invisible text. 470ignored as well, as are display properties and invisible text.
471For these reasons, the results are not generally reliable; 471For these reasons, the results are not generally reliable;
472for accurate dimensions of text as it will be displayed, 472for accurate dimensions of text as it will be displayed,
473use `window-text-pixel-size' instead. 473use `string-pixel-width' or `window-text-pixel-size' instead.
474usage: (string-width STRING &optional FROM TO) */) 474usage: (string-width STRING &optional FROM TO) */)
475 (Lisp_Object str, Lisp_Object from, Lisp_Object to) 475 (Lisp_Object str, Lisp_Object from, Lisp_Object to)
476{ 476{
diff --git a/src/keyboard.c b/src/keyboard.c
index f60b5c95654..ee42b821dfa 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11659,8 +11659,8 @@ the command loop or by `read-key-sequence'.
11659The value is always a vector. */) 11659The value is always a vector. */)
11660 (void) 11660 (void)
11661{ 11661{
11662 return Fvector (this_command_key_count 11662 ptrdiff_t nkeys = this_command_key_count - this_single_command_key_start;
11663 - this_single_command_key_start, 11663 return Fvector (nkeys < 0 ? 0 : nkeys,
11664 (XVECTOR (this_command_keys)->contents 11664 (XVECTOR (this_command_keys)->contents
11665 + this_single_command_key_start)); 11665 + this_single_command_key_start));
11666} 11666}