diff options
| author | Po Lu | 2023-07-26 08:08:11 +0800 |
|---|---|---|
| committer | Po Lu | 2023-07-26 08:08:11 +0800 |
| commit | ce63f592f579e8963a3e7f44b31c7df50fb0cdba (patch) | |
| tree | 793f825ecee551a84dd4fce79ff8df9bd91e8d2a | |
| parent | b7de14b56fac658411baeaede56416ad322fecfd (diff) | |
| parent | 65834b8f8d53402517da7fe2446f5bac0aa30c39 (diff) | |
| download | emacs-ce63f592f579e8963a3e7f44b31c7df50fb0cdba.tar.gz emacs-ce63f592f579e8963a3e7f44b31c7df50fb0cdba.zip | |
Merge remote-tracking branch 'origin/master' into feature/android
| -rw-r--r-- | doc/emacs/trouble.texi | 2 | ||||
| -rw-r--r-- | lisp/files-x.el | 5 | ||||
| -rw-r--r-- | lisp/userlock.el | 17 | ||||
| -rw-r--r-- | src/character.c | 2 | ||||
| -rw-r--r-- | src/keyboard.c | 4 |
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. | |||
| 706 | for the detailed raw data. Reporting the facts is straightforward, | 706 | for the detailed raw data. Reporting the facts is straightforward, |
| 707 | but many people strain to posit explanations and report them instead | 707 | but many people strain to posit explanations and report them instead |
| 708 | of the facts. If the explanations are based on guesses about how | 708 | of the facts. If the explanations are based on guesses about how |
| 709 | Emacs is implemented, they night not be useful; meanwhile, lacking the | 709 | Emacs is implemented, they might not be useful; meanwhile, lacking the |
| 710 | facts, we will have no real information about the bug. If you want to | 710 | facts, we will have no real information about the bug. If you want to |
| 711 | actually @emph{debug} the problem, and report explanations that are | 711 | actually @emph{debug} the problem, and report explanations that are |
| 712 | more than guesses, that is useful---but please include the raw facts | 712 | more 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 | |||
| 470 | ignored as well, as are display properties and invisible text. | 470 | ignored as well, as are display properties and invisible text. |
| 471 | For these reasons, the results are not generally reliable; | 471 | For these reasons, the results are not generally reliable; |
| 472 | for accurate dimensions of text as it will be displayed, | 472 | for accurate dimensions of text as it will be displayed, |
| 473 | use `window-text-pixel-size' instead. | 473 | use `string-pixel-width' or `window-text-pixel-size' instead. |
| 474 | usage: (string-width STRING &optional FROM TO) */) | 474 | usage: (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'. | |||
| 11659 | The value is always a vector. */) | 11659 | The 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 | } |