commit 21775a936bd3838adaae38bd5c5ec776434736c1 (HEAD, refs/remotes/origin/master) Author: Joseph Turner Date: Fri Apr 5 18:32:36 2024 -0700 Display Info buffer after ensuring it contains text * lisp/info.el (info-pop-to-buffer): Move display of Info buffer to a later stage after its text contents is ready to display. This helps to use fit-window-to-buffer in display-buffer-alist (bug#70213). diff --git a/lisp/info.el b/lisp/info.el index 901f0384c62..b459406959e 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -807,30 +807,28 @@ Select the window used, if it has been made." (get-buffer-create "*info*"))))) (with-current-buffer buffer (unless (derived-mode-p 'Info-mode) - (Info-mode))) + (Info-mode)) + + (if file-or-node + ;; If argument already contains parentheses, don't add another set + ;; since the argument will then be parsed improperly. This also + ;; has the added benefit of allowing node names to be included + ;; following the parenthesized filename. + (Info-goto-node + (if (and (stringp file-or-node) (string-match "(.*)" file-or-node)) + file-or-node + (concat "(" file-or-node ")"))) + (if (and (zerop (buffer-size)) + (null Info-history)) + ;; If we just created the Info buffer, go to the directory. + (Info-directory)))) + + (when-let ((window (display-buffer buffer + (if other-window + '(nil (inhibit-same-window . t)) + '(display-buffer-same-window))))) + (select-window window)))) - (let* ((window - (display-buffer buffer - (if other-window - '(nil (inhibit-same-window . t)) - '(display-buffer-same-window))))) - (with-current-buffer buffer - (if file-or-node - ;; If argument already contains parentheses, don't add another set - ;; since the argument will then be parsed improperly. This also - ;; has the added benefit of allowing node names to be included - ;; following the parenthesized filename. - (Info-goto-node - (if (and (stringp file-or-node) (string-match "(.*)" file-or-node)) - file-or-node - (concat "(" file-or-node ")"))) - (if (and (zerop (buffer-size)) - (null Info-history)) - ;; If we just created the Info buffer, go to the directory. - (Info-directory)))) - - (when window - (select-window window))))) ;;;###autoload (put 'info 'info-file (purecopy "emacs")) ;;;###autoload commit 0fab2649e288c7a350018293443e709eba6b0fe2 Author: Eli Zaretskii Date: Thu Apr 11 21:48:47 2024 +0300 ; Improve documentation of completion commands * doc/emacs/mini.texi (Completion Commands): Mention that '?' also shows a couple of commands. diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index aa7144610a6..4557f41c3f7 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi @@ -353,7 +353,8 @@ arguments that often include spaces, such as file names. Submit the text in the minibuffer as the argument, possibly completing first (@code{minibuffer-complete-and-exit}). @xref{Completion Exit}. @item ? -Display a list of completions (@code{minibuffer-completion-help}). +Display a list of completions and a few useful key bindings +(@code{minibuffer-completion-help}). @end table @kindex TAB @r{(completion)} @@ -375,11 +376,12 @@ all the way to @samp{auto-fill-mode}. @kindex ? @r{(completion)} @cindex completion list - If @key{TAB} or @key{SPC} is unable to complete, it displays a list -of matching completion alternatives (if there are any) in another -window. You can display the same list with @kbd{?} -(@code{minibuffer-completion-help}). The following commands can be -used with the completion list: + If @key{TAB} or @key{SPC} is unable to complete, it displays in +another window a list of matching completion alternatives (if there are +any) and a few useful commands to select a completion candidate. You +can display the same completion list and help with @kbd{?} +(@code{minibuffer-completion-help}). The following commands can be used +with the completion list: @table @kbd @vindex minibuffer-completion-auto-choose commit 0284b296f2ee469e0edeba8bd043b4a813cfd977 Author: Dmitry Gutov Date: Thu Apr 11 20:33:16 2024 +0300 minibuffer-completion-help: Fix regression when END < EOB Which can happen with in-buffer completion (though this scenario is preffed off by default). * lisp/minibuffer.el (minibuffer-completion-help): Include the buffer contents after END into BASE-SUFFIX (bug#48356). diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 3d0a6f9694f..ad6a0928cda 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2600,9 +2600,10 @@ The candidate will still be chosen by `choose-completion' unless (minibuffer-completion-base (substring string 0 base-size)) (base-prefix (buffer-substring (minibuffer--completion-prompt-end) (+ start base-size))) - (base-suffix (completion-base-suffix start end - minibuffer-completion-table - minibuffer-completion-predicate)) + (base-suffix (concat (completion-base-suffix start end + minibuffer-completion-table + minibuffer-completion-predicate) + (buffer-substring end (point-max)))) (all-md (completion--metadata (buffer-substring-no-properties start (point)) base-size md commit af57516ed8991ea6238f1ec4907f9ce751cadb27 Author: Eli Zaretskii Date: Thu Apr 11 20:09:49 2024 +0300 etags-regen--tags-generate: Handle spaces in project root name * lisp/progmodes/etags-regen.el (etags-regen--tags-generate): Quote the tags file name (bug#70329). diff --git a/lisp/progmodes/etags-regen.el b/lisp/progmodes/etags-regen.el index 6cd78d3577a..02d666ceff7 100644 --- a/lisp/progmodes/etags-regen.el +++ b/lisp/progmodes/etags-regen.el @@ -279,7 +279,7 @@ File extensions to generate the tags for." " ") ;; ctags's etags requires '-L' for stdin input. (if ctags-p "-L" "") - tags-file))) + (shell-quote-argument tags-file)))) (with-temp-buffer (mapc (lambda (f) (insert f "\n")) commit bbe98eddf70200228dc50b58f26f53351604cf83 Author: Eli Zaretskii Date: Thu Apr 11 19:14:56 2024 +0300 Fix file names with embedded whitespace in Ediff * lisp/vc/ediff-ptch.el (ediff-patch-file-internal): Quote file names that can include special characters. (Bug#70329) diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index f8d4c1c1c4b..2d5d4609890 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -721,10 +721,11 @@ optional argument, then use it." nil ; don't redisplay shell-command-switch ; usually -c (format "%s %s %s %s" - ediff-patch-program + (shell-quote-argument ediff-patch-program) ediff-patch-options ediff-backup-specs - (ediff--buffer-file-name buf-to-patch)) + (shell-quote-argument + (ediff--buffer-file-name buf-to-patch))) )) ;; restore environment for gnu patch commit c4a8976d59aa4c9a325a6331b52ce329cb5de248 Author: Eli Zaretskii Date: Thu Apr 11 19:04:25 2024 +0300 ; * lisp/bindings.el (mode-line-mode-menu): Add Completion Preview. diff --git a/lisp/bindings.el b/lisp/bindings.el index 4690897fed4..50af32076a3 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -803,6 +803,11 @@ meaningful if it refers to a lexically bound variable." '(menu-item "Flyspell (Fly)" flyspell-mode :help "Spell checking on the fly" :button (:toggle . (bound-and-true-p flyspell-mode)))) +(bindings--define-key mode-line-mode-menu [completion-preview-mode] + '(menu-item "Completion Preview (CP)" completion-preview-mode + :help "Show preview of completion suggestions as you type" + :enable completion-at-point-functions + :button (:toggle . (bound-and-true-p completion-preview-mode)))) (bindings--define-key mode-line-mode-menu [auto-revert-tail-mode] '(menu-item "Auto revert tail (Tail)" auto-revert-tail-mode :help "Revert the tail of the buffer when the file on disk grows" commit b436f430e3897e1aa6dcb5a39564a3553bbf631f Author: Mattias EngdegÄrd Date: Thu Apr 11 13:55:39 2024 +0200 Don't hide flymake diagnostics on empty first line (bug#70310) A diagnostic first in the buffer, typically the lexical cookie warning, got lost if that line was empty. * lisp/progmodes/elisp-mode.el (elisp-flymake--byte-compile-done): Make sure the location interval doesn't go beyond the buffer bounds. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 9b4c3f994cd..3383841391d 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -2151,8 +2151,13 @@ Calls REPORT-FN directly." (point-max))) collect (flymake-make-diagnostic (current-buffer) - (if (= beg end) (1- beg) beg) - end + (if (= beg end) + (max (1- beg) (point-min)) + beg) + (if (= beg end) + (min (max beg (1+ (point-min))) + (point-max)) + end) level string))))))) commit fba8f3a6f1a8a099d93e70400d477ca6fe96007b Author: Mattias EngdegÄrd Date: Thu Apr 11 11:48:40 2024 +0200 ; * etc/NEWS: Group JSON changes. diff --git a/etc/NEWS b/etc/NEWS index a2a3fe494cb..62dd2da6b8c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1775,19 +1775,6 @@ Use a float value for the first argument instead. Instead, use 'eshell-process-wait-time', which supports floating-point values. -** JSON - ---- -*** The parser keeps duplicated object keys in alist and plist output. -A JSON object such as '{"a":1,"a":2}' will now be translated into the -Lisp values '((a . 1) (a . 2))' or '(:a 1 :a 2)' if alist or plist -object types are requested. - ---- -*** The parser sometimes signals different types of errors. -It will now signal 'json-utf8-decode-error' for inputs that are not -correctly UTF-8 encoded. - * Lisp Changes in Emacs 30.1 @@ -2393,8 +2380,21 @@ this case, would mean repeating the object in the argument list.) When replacing an object with a different one, passing both the new and old objects is still necessary. +** JSON + +--- +*** The parser keeps duplicated object keys in alist and plist output. +A JSON object such as '{"a":1,"a":2}' will now be translated into the +Lisp values '((a . 1) (a . 2))' or '(:a 1 :a 2)' if alist or plist +object types are requested. + +--- +*** The parser sometimes signals different types of errors. +It will now signal 'json-utf8-decode-error' for inputs that are not +correctly UTF-8 encoded. + --- -** The JSON encoder and decoder now accept arbitarily large integers. +*** The parser and encoder now accept arbitarily large integers. Previously, they were limited to the range of signed 64-bit integers. ** New tree-sitter functions and variables for defining and using "things"