commit 81fc95bf22cadc09178e7ccfc13eba531660ddcd (HEAD, refs/remotes/origin/master) Author: Steve Purcell Date: Mon May 3 09:41:44 2021 +0200 ruby-mode.el: puts and printf do not require args * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): puts and printf can be called without arguments, so the font locking of "bare" calls to either is incorrect. The fix is to font-lock them as for other kernel methods which accepts zero or more arguments (bug#48180). diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 35772827ce..0c54a1d27a 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2127,11 +2127,9 @@ It will be properly highlighted even when the call omits parens.") "loop" "open" "p" - "print" "printf" "proc" "putc" - "puts" "require" "require_relative" "spawn" @@ -2180,9 +2178,11 @@ It will be properly highlighted even when the call omits parens.") "fork" "global_variables" "local_variables" + "print" "private" "protected" "public" + "puts" "raise" "rand" "readline" commit 73513c36a93d19d802e9adf01f1383fc23dd49f5 Author: Lele Gaifax Date: Mon May 3 09:37:38 2021 +0200 Align TUTORIAL.it to the English version * etc/tutorials/TUTORIAL.it: Reference 'describe-command' to replicate recent change. Add also a space before '' in several places, mimicking the usage of in the English version (bug#48183). diff --git a/etc/tutorials/TUTORIAL.it b/etc/tutorials/TUTORIAL.it index ac5937930b..68bf40332e 100644 --- a/etc/tutorials/TUTORIAL.it +++ b/etc/tutorials/TUTORIAL.it @@ -578,7 +578,7 @@ originale in modo da conservarlo. Il nuovo nome è ottenuto aggiungendo un carattere "~" alla fine del nome originale. Quando il salvataggio termina, Emacs mostra il nome del file scritto. ->> Premi C-x C-s TUTORIAL. +>> Premi C-x C-s TUTORIAL . Questo dovrebbe salvare questa esercitazione in un file chiamato “TUTORIAL” e mostrare “Wrote ...TUTORIAL nella parte bassa dello schermo. @@ -623,8 +623,8 @@ file, puoi farlo visitando di nuovo quel file usando C-x C-f. Ma c'è un modo più semplice: usa il comando C-x b. Questo comando richiede il nome del buffer. ->> Crea un file chiamato “pippo” con C-x C-f pippo. - Torna poi a questa esercitazione con C-x b TUTORIAL. +>> Crea un file chiamato “pippo” con C-x C-f pippo . + Torna poi a questa esercitazione con C-x b TUTORIAL . La maggior parte delle volte, il nome del buffer corrisponde al nome del file (senza la parte relativa alla directory). Questo non è @@ -641,8 +641,8 @@ Anche il buffer chiamato “*Messages* non è associato ad alcun file. Quel buffer contiene tutti i messaggi che sono apparsi nella parte bassa dello schermo durante la sessione di Emacs. ->> Passa al buffer con i messaggi con C-x b *Messages*. - Torna poi a questa esercitazione con C-x b TUTORIAL. +>> Passa al buffer con i messaggi con C-x b *Messages* . + Torna poi a questa esercitazione con C-x b TUTORIAL . Se si modifica in qualche modo il testo di un file e poi si visita un altro file questo non comporta il salvataggio del primo. Le modifiche @@ -752,7 +752,7 @@ salvataggio automatico. Se il computer si blocca si può recuperare il file salvato automaticamente aprendo il file in modo normale (il file che si stava scrivendo, non quello di salvataggio automatico) e usando poi M-x -recover-this-file. Quando viene chiesta la conferma si risponda +recover-this-file . Quando viene chiesta la conferma si risponda con yes per procedere con il recupero dei dati salvati automaticamente. @@ -818,7 +818,7 @@ fundamental-mode è il comando per attivare la modalità primaria Se si vuole inserire del testo in italiano, come questo file, probabilmente è più adeguata la modalità testo. ->> Inserisci M-x text-mode. +>> Inserisci M-x text-mode . Non preoccuparti, nessuno dei comandi che hai imparato verrà modificato in modo sostanziale. Tuttavia adesso puoi osservare come @@ -853,14 +853,14 @@ testo, è la modalità “Auto Fill” (riempimento automatico). Quando questa modalità è attiva, Emacs interrompe la riga tra due parole ogni volta che, nel corso dell'inserimento, essa diventa troppo lunga. -Si può attivare il modo “Auto Fill” con M-x auto-fill-mode. +Si può attivare il modo “Auto Fill” con M-x auto-fill-mode . Quando la modalità suddetta è attiva può essere disattivata eseguendo -di nuovo M-x auto-fill-mode. Se la modalità è disattivata +di nuovo M-x auto-fill-mode . Se la modalità è disattivata questo comando la attiva, viceversa se è già attiva. Un comando che funziona così si comporta come un interruttore, attiva o disattiva qualcosa ogni volta che viene premuto. ->> Usa M-x auto fill mode adesso. Inserisci una riga di “asdf ” +>> Usa M-x auto fill mode adesso. Inserisci una riga di “asdf ” ripetuti fino a quando non la vedi dividersi in due righe. Devi interporre degli spazi perché la modalità Auto Fill spezza le righe solo in corrispondenza di uno spazio. @@ -1021,13 +1021,13 @@ chiamano “finestra”, ed è possibile mostrarne più di uno contemporaneamente. Su un terminale testuale, è possibile mostrare un solo frame alla volta. ->> Usa M-x make-frame. +>> Usa M-x make-frame . Un nuovo frame dovrebbe apparire sullo schermo. In questo nuovo frame puoi svolgere qualsiasi cosa come nel frame originale. Non c'è nulla di speciale nel primo frame. ->> Usa M-x delete-frame. +>> Usa M-x delete-frame . Questo rimuove il frame selezionato. Puoi anche eliminare un frame usando i metodi offerti dal sistema @@ -1076,7 +1076,7 @@ aiuto che può fornire. Se si è attivato l'aiuto con C-h e si decide che non serve più si può annullare la richiesta con C-g. (Se C-h non mostra un messaggio relativo all'aiuto nella parte bassa -dello schermo, prova ad usare il tasto F1 oppure con M-x help.) +dello schermo, prova ad usare il tasto F1 oppure con M-x help .) La forma base di aiuto è data da C-h c. Si inserisce C-h, il carattere c e poi un carattere o una sequenza di caratteri; Emacs @@ -1110,9 +1110,9 @@ mentre fai riferimento al testo di aiuto e poi usare un C-x 1. Ecco altre utili opzioni di C-h: - C-h f Descrive una funzione. Inserisci il nome della funzione. + C-h x Descrive un comando. Inserisci il nome della comando. ->> Prova con C-h f previous-line. +>> Prova con C-h x previous-line . Questo mostrerà tutte le informazioni che Emacs possiede sulla funzione che implementa il comando C-p. @@ -1128,7 +1128,7 @@ variabile quando Emacs lo richiede. una sequenza di uno o due caratteri che serve a far partire il comando senza doverlo inserire per esteso. ->> Prova C-h a file +>> Prova C-h a file Questo mostrerà in un'altra finestra una lista di tutti i comandi che contengono la parola “file” nel nome. Nella lista si vedranno @@ -1143,7 +1143,7 @@ esteso come find-file. C-h i Leggi la documentazione. Questo comando apre un buffer speciale chiamato “*info*” in cui puoi leggere i manuali on-line dei pacchetti installati sul tuo - sistema. Batti m emacs per leggere il manuale + sistema. Batti m emacs per leggere il manuale di Emacs. Se non hai mai usato il sistema Info prima d'ora premi ? ed Emacs ti guiderà nell'uso delle opzioni del modo Info. Una volta terminata questa commit 30d974bf5c02a1367291fbb6fa17a182bb7974b7 Author: Martin Rudalics Date: Sun May 2 17:44:01 2021 +0200 Add two changes announced but not included in previous commit * src/frame.c (adjust_frame_size): Remove extra inhibit_horizontal/_vertical checks. Improve the implied resize check when INHIBIT equals 2. diff --git a/src/frame.c b/src/frame.c index 32110512e9..d884a6d8b9 100644 --- a/src/frame.c +++ b/src/frame.c @@ -722,29 +722,25 @@ adjust_frame_size (struct frame *f, int new_text_width, int new_text_height, && (new_native_height != old_native_height || inhibit == 0 || inhibit == 2)))) { - /* Make sure we respect fullheight and fullwidth. */ - if (inhibit_horizontal) - new_native_width = old_native_width; - else if (inhibit_vertical) - new_native_height = old_native_height; - - if (inhibit == 2 && f->new_width > 0 && f->new_height > 0) + if (inhibit == 2 +#ifdef USE_MOTIF + && !EQ (parameter, Qmenu_bar_lines) +#endif + && (f->new_width >= 0 || f->new_height >= 0)) /* For implied resizes with inhibit 2 (external menu and tool bar) pick up any new sizes the display engine has not processed yet. Otherwsie, we would request the old sizes which will make this request appear as a request to set new - sizes and have the WM react accordingly which is not TRT. */ + sizes and have the WM react accordingly which is not TRT. + + We don't that for the external menu bar on Motif. + Otherwise, switching off the menu bar will shrink the frame + and switching it on will not enlarge it. */ { - /* But don't that for the external menu bar on Motif. - Otherwise, switching off the menu bar will shrink the frame - and switching it on will not enlarge it. */ -#ifdef USE_MOTIF - if (!EQ (parameter, Qmenu_bar_lines)) -#endif - { - new_native_width = f->new_width; - new_native_height = f->new_height; - } + if (f->new_width >= 0) + new_native_width = f->new_width; + if (f->new_height >= 0) + new_native_height = f->new_height; } if (CONSP (frame_size_history)) commit 21f2fbb648a3af543d4cb23d6e7573588cc7ecb2 Author: Stefan Kangas Date: Sun May 2 17:35:55 2021 +0200 * etc/tutorials/TUTORIAL.sv: Adjust to latest change in TUTORIAL. diff --git a/etc/tutorials/TUTORIAL.sv b/etc/tutorials/TUTORIAL.sv index 1eab267079..cbe9cfcd30 100644 --- a/etc/tutorials/TUTORIAL.sv +++ b/etc/tutorials/TUTORIAL.sv @@ -1056,10 +1056,10 @@ att först senare ta bort fönstret med C-x 1. Här är fler varianter på C-h: - C-h f Beskriv en funktion. Du skriver in funktionsnamnet. + C-h f Beskriv ett kommando. Du skriver in kommandots namn. ->> Prova att skriva C-h f previous-line. - Detta ger den information Emacs har om funktionen +>> Prova att skriva C-h x previous-line . + Detta visar den information Emacs har om den funktion som implementerar kommandot C-p. Ett liknande kommando, C-h v, visar dokumentationen för de variabler commit 10a7d44f1946207198fdd8f6c376c3baf1154aa3 Author: Stefan Kangas Date: Sun May 2 17:35:31 2021 +0200 * etc/tutorials/TUTORIAL.es: Adjust to latest change in TUTORIAL. diff --git a/etc/tutorials/TUTORIAL.es b/etc/tutorials/TUTORIAL.es index 786a9f4130..0bd061488c 100644 --- a/etc/tutorials/TUTORIAL.es +++ b/etc/tutorials/TUTORIAL.es @@ -1091,10 +1091,10 @@ ayuda, y entonces teclear C-x 1. Aquí hay algunas otras opciones útiles de C-h: - C-h f Describe una función. Usted teclea el nombre de la - función. + C-h x Describe un comando. Usted teclea el nombre de la + comando. ->> Intente teclear C-h f previous-line . +>> Intente teclear C-h x previous-line . Esto muestra toda la información que Emacs tiene sobre la función que implementa el comando C-p commit 84a2a4715b98e05ee37382d817ebe2ba9f2e03ce Author: Alan Mackenzie Date: Sun May 2 15:22:36 2021 +0000 * lisp/progmodes/cc-defs (c-save-buffer-state): Amend debug spec, t to let* This should solve part of bug #48100. diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 4f79fa9b33..0229232758 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -615,7 +615,7 @@ must not be within a `c-save-buffer-state', since the user then wouldn't be able to undo them. The return value is the value of the last form in BODY." - (declare (debug t) (indent 1)) + (declare (debug let*) (indent 1)) (if (fboundp 'with-silent-modifications) `(with-silent-modifications (let* ,varlist ,@body)) `(let* ((modified (buffer-modified-p)) (buffer-undo-list t) commit 013aee1ad30f3392203ca03ed996a27b934a31bf Author: Eli Zaretskii Date: Sun May 2 18:17:16 2021 +0300 * etc/tutorials/TUTORIAL.he: Adjust to latest change in TUTORIAL. diff --git a/etc/tutorials/TUTORIAL.he b/etc/tutorials/TUTORIAL.he index 5cd1cac8fd..2ee4f74c32 100644 --- a/etc/tutorials/TUTORIAL.he +++ b/etc/tutorials/TUTORIAL.he @@ -931,9 +931,9 @@ M-x help ‎ כתחליף.) הנה עוד כמה פקודות עזרה שימושיות: - ‏C-h f תן הסבר על פונקציה. יש להקיש את שם הפונקציה. + ‏C-h x תן הסבר על פקודה. יש להקיש את שם הפקודה. ->> נסו להקיש C-h f previous-line ‎. +>> נסו להקיש C-h x previous-line ‎. כתוצאה, יוצג תיעוד מלא של הפונקציה המממשת את הפקודה C-p כפי שהוא ידוע ל־Emacs. commit 6c1c3204e4761fd0d8bdbf22c6519d2328f60450 Author: Stefan Kangas Date: Sun May 2 15:04:00 2021 +0200 Add new help command 'describe-command' * lisp/help-fns.el (describe-command): New command. (help-fns--describe-function-or-command-prompt): New helper function to prompt for a function or function. (Bug#46627) (describe-function): Use above new helper function. * lisp/help.el (help-map): Bind above new command to `C-h x'. (help-for-help): Add this new command to the help summary. * lisp/menu-bar.el (menu-bar-describe-menu): Add the new command to the help menu. * doc/emacs/help.texi (Help Summary, Name Help): Document 'describe-command', and update documentation on 'describe-function'. * etc/tutorials/TUTORIAL: Change reference from 'describe-function' to 'describe-command'. diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index 81cdeb4be5..90a2ddc809 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -107,8 +107,8 @@ Display the @file{*Messages*} buffer (@code{view-echo-area-messages}). @xref{Misc Help}. @item C-h f @var{function} @key{RET} Display documentation on the Lisp function named @var{function} -(@code{describe-function}). Since commands are Lisp functions, -this works for commands too. @xref{Name Help}. +(@code{describe-function}). Since commands are Lisp functions, this +works for commands too, but you can also use @code{C-h x}. @xref{Name Help}. @item C-h h Display the @file{HELLO} file, which shows examples of various character sets. @@ -154,6 +154,9 @@ Display the documentation of the Lisp variable @var{var} @item C-h w @var{command} @key{RET} Show which keys run the command named @var{command} (@code{where-is}). @xref{Key Help}. +@item C-h x @var{command} @key{RET} +Display documentation on the named @var{command} +(@code{describe-command}). @xref{Name Help}. @item C-h C @var{coding} @key{RET} Describe the coding system @var{coding} (@code{describe-coding-system}). @xref{Coding Systems}. @@ -233,31 +236,31 @@ the button. @node Name Help @section Help by Command or Variable Name -@kindex C-h f -@findex describe-function - @kbd{C-h f @var{function} @key{RET}} (@code{describe-function}) -displays the documentation of Lisp function @var{function}, in a -window. Since commands are Lisp functions, you can use this method to -view the documentation of any command whose name you know. For -example, +@kindex C-h x +@findex describe-command + @kbd{C-h x @var{command} @key{RET}} (@code{describe-command}) +displays the documentation of the named @var{command}, in a +window. For example, @example -C-h f auto-fill-mode @key{RET} +C-h x auto-fill-mode @key{RET} @end example @noindent -displays the documentation of @code{auto-fill-mode}. This is the only -way to get the documentation of a command that is not bound to any key +displays the documentation of @code{auto-fill-mode}. This is how you +would get the documentation of a command that is not bound to any key (one which you would normally run using @kbd{M-x}). - @kbd{C-h f} is also useful for Lisp functions that you use in a Lisp -program. For example, if you have just written the expression +@kindex C-h f +@findex describe-function + @kbd{C-h f @var{function} @key{RET}} (@code{describe-function}) +displays the documentation of Lisp @var{function}. This command is +intended for Lisp functions that you use in a Lisp program. For +example, if you have just written the expression @code{(make-vector len)} and want to check that you are using -@code{make-vector} properly, type @kbd{C-h f make-vector @key{RET}}. -Because @kbd{C-h f} allows all function names, not just command names, -you may find that some of your favorite completion abbreviations that -work in @kbd{M-x} don't work in @kbd{C-h f}. An abbreviation that is -unique among command names may not be unique among all function names. +@code{make-vector} properly, type @w{@kbd{C-h f make-vector @key{RET}}}. +Additionally, since all commands are Lisp functions, you can also use +this command to view the documentation of any command. If you type @kbd{C-h f @key{RET}}, it describes the function called by the innermost Lisp expression in the buffer around point, @@ -265,7 +268,7 @@ by the innermost Lisp expression in the buffer around point, (That name appears as the default while you enter the argument.) For example, if point is located following the text @samp{(make-vector (car x)}, the innermost list containing point is the one that starts -with @samp{(make-vector}, so @kbd{C-h f @key{RET}} describes the +with @samp{(make-vector}, so @w{@kbd{C-h f @key{RET}}} describes the function @code{make-vector}. @kbd{C-h f} is also useful just to verify that you spelled a diff --git a/etc/NEWS b/etc/NEWS index 4b5f20db58..c2db98ae45 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1007,6 +1007,11 @@ GTK toolkit, this is only true if 'x-gtk-use-system-tooltips' is t. --- *** 'g' ('revert-buffer') in 'help-mode' no longer requires confirmation. ++++ +*** New command 'describe-command' shows help for a command. +This can be used instead of 'describe-function' for interactive +commands and is globally bound to `C-h x'. + +++ *** New command 'describe-keymap' describes keybindings in a keymap. diff --git a/etc/tutorials/TUTORIAL b/etc/tutorials/TUTORIAL index 6194e55ea3..dcdb61f23e 100644 --- a/etc/tutorials/TUTORIAL +++ b/etc/tutorials/TUTORIAL @@ -1038,10 +1038,10 @@ then type C-x 1. Here are some other useful C-h options: - C-h f Describe a function. You type in the name of the - function. + C-h x Describe a command. You type in the name of the + command. ->> Try typing C-h f previous-line . +>> Try typing C-h x previous-line . This displays all the information Emacs has about the function which implements the C-p command. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index e20a1a5e6f..0b0ae4364c 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -174,26 +174,47 @@ with the current prefix. The files are chosen according to Functions on `help-fns-describe-function-functions' can use this to get buffer-local values.") +(defun help-fns--describe-function-or-command-prompt (&optional want-command) + "Prompt for a function from `describe-function' or `describe-command'. +If optional argument WANT-COMMAND is non-nil, prompt for an +interactive command." + (let* ((fn (if want-command + (caar command-history) + (function-called-at-point))) + (prompt (format-prompt (if want-command + "Describe command" + "Describe function") + fn)) + (enable-recursive-minibuffers t) + (val (completing-read + prompt + #'help--symbol-completion-table + (lambda (f) (if want-command + (commandp f) + (or (fboundp f) (get f 'function-documentation)))) + t nil nil + (and fn (symbol-name fn))))) + (unless (equal val "") + (setq fn (intern val))) + ;; These error messages are intended to be less technical for the + ;; `describe-command' case, as they are directed at users that are + ;; not necessarily ELisp programmers. + (unless (and fn (symbolp fn)) + (user-error (if want-command + "You didn't specify a command's symbol" + "You didn't specify a function symbol"))) + (unless (or (fboundp fn) (get fn 'function-documentation)) + (user-error (if want-command + "Symbol is not a command: %s" + "Symbol's function definition is void: %s") + fn)) + (list fn))) + ;;;###autoload (defun describe-function (function) "Display the full documentation of FUNCTION (a symbol). When called from lisp, FUNCTION may also be a function object." - (interactive - (let* ((fn (function-called-at-point)) - (enable-recursive-minibuffers t) - (val (completing-read - (format-prompt "Describe function" fn) - #'help--symbol-completion-table - (lambda (f) (or (fboundp f) (get f 'function-documentation))) - t nil nil - (and fn (symbol-name fn))))) - (unless (equal val "") - (setq fn (intern val))) - (unless (and fn (symbolp fn)) - (user-error "You didn't specify a function symbol")) - (unless (or (fboundp fn) (get fn 'function-documentation)) - (user-error "Symbol's function definition is void: %s" fn)) - (list fn))) + (interactive (help-fns--describe-function-or-command-prompt)) ;; We save describe-function-orig-buffer on the help xref stack, so ;; it is restored by the back/forward buttons. 'help-buffer' @@ -223,9 +244,14 @@ When called from lisp, FUNCTION may also be a function object." (describe-function-1 function) (with-current-buffer standard-output ;; Return the text we displayed. - (buffer-string)))) - )) + (buffer-string)))))) +;;;###autoload +(defun describe-command (command) + "Display the full documentation of COMMAND (a symbol). +When called from lisp, COMMAND may also be a function object." + (interactive (help-fns--describe-function-or-command-prompt 'is-command)) + (describe-function command)) ;; Could be this, if we make symbol-file do the work below. ;; (defun help-C-file-name (subr-or-var kind) diff --git a/lisp/help.el b/lisp/help.el index bd671c3d16..6ba59ae852 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -106,6 +106,7 @@ (define-key map "t" 'help-with-tutorial) (define-key map "v" 'describe-variable) (define-key map "w" 'where-is) + (define-key map "x" 'describe-command) (define-key map "q" 'help-quit) map) "Keymap for characters following the Help key.") @@ -252,6 +253,7 @@ Do not call this in the scope of `with-help-window'." "Search for commands (see also \\[apropos])") ("apropos-documentation" "Search documentation of functions, variables, and other items") + ("describe-command" "Show help for command") ("describe-function" "Show help for function") ("describe-variable" "Show help for variable") ("describe-symbol" "Show help for function or variable")) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index e6cce59343..1ba4690aac 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1882,6 +1882,9 @@ they ran")) (bindings--define-key menu [describe-function] '(menu-item "Describe Function..." describe-function :help "Display documentation of function/command")) + (bindings--define-key menu [describe-command] + '(menu-item "Describe Command..." describe-command + :help "Display documentation of command")) (bindings--define-key menu [shortdoc-display-group] '(menu-item "Function Group Overview..." shortdoc-display-group :help "Display a function overview for a specific topic")) commit c842399ef01adf3f984e4c503411a9c5f025738f Author: Stefan Monnier Date: Sun May 2 08:40:28 2021 -0400 * lisp/apropos.el (apropos-value, apropos-local-value): Tweak for lexbind Don't skip symbols for the nowadays lexically scoped local vars. diff --git a/lisp/apropos.el b/lisp/apropos.el index 823d6ec7f9..17665a725a 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -145,11 +145,11 @@ If value is `verbose', the computed score is shown for each match." ;; Use `apropos-follow' instead of just using the button ;; definition of RET, so that users can use it anywhere in an ;; apropos item, not just on top of a button. - (define-key map "\C-m" 'apropos-follow) + (define-key map "\C-m" #'apropos-follow) ;; Movement keys - (define-key map "n" 'apropos-next-symbol) - (define-key map "p" 'apropos-previous-symbol) + (define-key map "n" #'apropos-next-symbol) + (define-key map "p" #'apropos-previous-symbol) map) "Keymap used in Apropos mode.") @@ -347,7 +347,7 @@ WILD should be a subexpression matching wildcards between matches." (lambda (w) (concat "\\(?:" w "\\)" ;; parens for synonyms wild "\\(?:" - (mapconcat 'identity + (mapconcat #'identity (delq w (copy-sequence words)) "\\|") "\\)")) @@ -389,14 +389,14 @@ This updates variables `apropos-pattern', `apropos-pattern-quoted', ;; use a trick that would find a match even if the words are ;; on different lines. (let ((words pattern)) - (setq apropos-pattern (mapconcat 'identity pattern " ") + (setq apropos-pattern (mapconcat #'identity pattern " ") apropos-pattern-quoted (regexp-quote apropos-pattern)) (dolist (word words) (let ((syn apropos-synonyms) (s word) (a word)) (while syn (if (member word (car syn)) (progn - (setq a (mapconcat 'identity (car syn) "\\|")) + (setq a (mapconcat #'identity (car syn) "\\|")) (if (member word (cdr (car syn))) (setq s a)) (setq syn nil)) @@ -513,7 +513,7 @@ variables, not just user options." #'(lambda (symbol) (and (boundp symbol) (get symbol 'variable-documentation))) - 'custom-variable-p))) + #'custom-variable-p))) ;;;###autoload (defun apropos-variable (pattern &optional do-not-all) @@ -556,7 +556,7 @@ or a non-nil `apropos-do-all' argument." ;; For auld lang syne: ;;;###autoload -(defalias 'command-apropos 'apropos-command) +(defalias 'command-apropos #'apropos-command) ;;;###autoload (defun apropos-command (pattern &optional do-all var-predicate) "Show commands (interactively callable functions) that match PATTERN. @@ -685,7 +685,7 @@ FILE should be one of the libraries currently loaded and should thus be found in `load-history'. If `apropos-do-all' is non-nil, the output includes key-bindings of commands." (interactive - (let* ((libs (delq nil (mapcar 'car load-history))) + (let* ((libs (delq nil (mapcar #'car load-history))) (libs (nconc (delq nil (mapcar @@ -731,9 +731,9 @@ the output includes key-bindings of commands." (format-message "Library `%s' provides: %s\nand requires: %s" file - (mapconcat 'apropos-library-button + (mapconcat #'apropos-library-button (or provides '(nil)) " and ") - (mapconcat 'apropos-library-button + (mapconcat #'apropos-library-button (or requires '(nil)) " and "))))))) (defun apropos-symbols-internal (symbols keys &optional text) @@ -817,11 +817,10 @@ Returns list of symbols and values found." apropos--current apropos-pattern-quoted pattern apropos-pattern apropos-all-words-regexp apropos-words apropos-all-words - do-all apropos-accumulator - symbol f v p)) - (setq v (apropos-value-internal 'boundp symbol 'symbol-value))) + apropos-accumulator)) + (setq v (apropos-value-internal #'boundp symbol #'symbol-value))) (if do-all - (setq f (apropos-value-internal 'fboundp symbol 'symbol-function) + (setq f (apropos-value-internal #'fboundp symbol #'symbol-function) p (apropos-format-plist symbol "\n " t))) (if (apropos-false-hit-str v) (setq v nil)) @@ -852,9 +851,11 @@ Optional arg BUFFER (default: current buffer) is the buffer to check." (let ((var nil)) (mapatoms (lambda (symb) - (unless (memq symb '(apropos-regexp apropos-pattern apropos-all-words-regexp - apropos-words apropos-all-words apropos-accumulator symb var)) - (setq var (apropos-value-internal 'local-variable-if-set-p symb 'symbol-value))) + (unless (memq symb '(apropos-regexp apropos-pattern + apropos-all-words-regexp apropos-words + apropos-all-words apropos-accumulator)) + (setq var (apropos-value-internal #'local-variable-if-set-p symb + #'symbol-value))) (when (and (fboundp 'apropos-false-hit-str) (apropos-false-hit-str var)) (setq var nil)) (when var commit 4e17c5e8c3d68624075bb34805d32a576865b038 Author: Basil L. Contovounesios Date: Sun May 2 12:59:19 2021 +0100 ; Fix last change in lisp/replace.el. diff --git a/lisp/replace.el b/lisp/replace.el index f427bb30b4..fe2cbc447a 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -432,8 +432,8 @@ In Transient Mark mode, if the mark is active, operate on the contents of the region. Otherwise, operate from point to the end of the buffer's accessible portion. -When invoked interactively, matching a newline with `\n' will not work; -use `C-q C-j' instead. To match a tab character (`\t'), just press `TAB'. +When invoked interactively, matching a newline with `\\n' will not work; +use `C-q C-j' instead. To match a tab character (`\\t'), just press `TAB'. Use \\\\[next-history-element] \ to pull the last incremental search regexp to the minibuffer commit 609d814fdf1e7ab76ec45017bc04087ae41d9bc8 Author: Alan Third Date: Sun May 2 11:25:40 2021 +0100 Fix crash when resizing GNUstep builds The toolkit can send far too many resize notifications, so be more careful when we take action after receiving one. * src/nsfns.m (ns_set_tool_bar_lines): Remove unneeded NSTRACE. * src/nsterm.m ([EmacsView viewDidResize:]): Don't report resizes to Emacs when the same change has already been reported and delayed. diff --git a/src/nsfns.m b/src/nsfns.m index 3f05128d36..1f281f75fd 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -668,11 +668,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side. } } - { - NSTRACE_MSG ("inhibit:%d", inhibit); - - adjust_frame_size (f, -1, -1, 2, false, Qtool_bar_lines); - } + adjust_frame_size (f, -1, -1, 2, false, Qtool_bar_lines); } static void diff --git a/src/nsterm.m b/src/nsterm.m index f2d03967f9..6e7ab1266b 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7308,16 +7308,19 @@ - (void)viewDidResize:(NSNotification *)notification oldw = FRAME_PIXEL_WIDTH (emacsframe); oldh = FRAME_PIXEL_HEIGHT (emacsframe); - NSTRACE_SIZE ("New size", NSMakeSize (neww, newh)); - NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh)); - /* Don't want to do anything when the view size hasn't changed. */ - if (oldh == newh && oldw == neww) + if ((oldh == newh && oldw == neww) + || (emacsframe->new_size_p + && newh == emacsframe->new_height + && neww == emacsframe->new_width)) { NSTRACE_MSG ("No change"); return; } + NSTRACE_SIZE ("New size", NSMakeSize (neww, newh)); + NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh)); + #ifdef NS_DRAW_TO_BUFFER if ([self wantsUpdateLayer]) { commit d0d95d161495585c73f881941beda77352517d34 Author: Stefan Kangas Date: Sun May 2 12:19:59 2021 +0200 * lisp/help-macro.el: Doc fix. diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 3b653c31e4..1fa9d82afd 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -25,11 +25,12 @@ ;;; Commentary: -;; This file supplies the macro make-help-screen which constructs -;; single character dispatching with browsable help such as that provided -;; by help-for-help. This can be used to make many modes easier to use; for -;; example, the GNU Emacs Empire Tool uses this for every "nested" mode map -;; called from the main mode map. +;; This file supplies the macro `make-help-screen' which constructs +;; single character dispatching with browsable help such as that +;; provided by `help-for-help'. This can be used to make many modes +;; easier to use; for example, the (long-since defunct) GNU Emacs +;; Empire Tool used this for every "nested" mode map called from the +;; main mode map. ;; The name of this package was changed from help-screen.el to ;; help-macro.el in order to fit in a 14-character limit. commit fb44f897d9d6b1cf31961781e70af72eb328b701 Author: Stefan Kangas Date: Sun May 2 12:10:54 2021 +0200 Bind S-SPC to scroll-down in help-for-help * lisp/help-macro.el (make-help-screen): Bind S-SPC to scroll-down. Thanks to Dmitry Gutov . diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 132530deb3..3b653c31e4 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el @@ -142,7 +142,8 @@ and then returns." (setq new-minor-mode-map-alist minor-mode-map-alist)) (goto-char (point-min)) (while (or (memq char (append help-event-list - (cons help-char '( ?? ?\C-v ?\s ?\177 deletechar backspace vertical-scroll-bar ?\M-v + (cons help-char '( ?? ?\C-v ?\s ?\177 ?\M-v ?\S-\s + deletechar backspace vertical-scroll-bar next prior up down)))) (eq (car-safe char) 'switch-frame) (equal key "\M-v")) @@ -152,7 +153,7 @@ and then returns." (handle-switch-frame char)) ((memq char '(?\C-v ?\s next)) (scroll-up)) - ((or (memq char '(?\177 ?\M-v deletechar backspace prior)) + ((or (memq char '(?\177 ?\M-v ?\S-\s deletechar backspace prior)) (equal key "\M-v")) (scroll-down)) ((memq char '(down)) commit 0fe250c6374837f3ed49cfbc1bbeca1916a06c2a Author: Stefan Kangas Date: Sat May 1 09:55:59 2021 +0200 Minor doc fixes in simple.el * lisp/simple.el (next-error-move-function) (next-error-found-function, next-error-found) (previous-error-no-select, eval-expression-get-print-arguments) (undo-adjust-elt, undo-adjust-beg-end): Minor doc fixes. diff --git a/lisp/simple.el b/lisp/simple.el index c26975caad..b4e34f1e4c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -190,7 +190,7 @@ to navigate in it.") It takes two arguments, a buffer position in the error buffer and a buffer position in the error locus buffer. The buffer for the error locus should already be current. -nil means use goto-char using the second argument position.") +nil means use `goto-char' using the second argument position.") (defsubst next-error-buffer-p (buffer &optional avoid-current @@ -389,7 +389,7 @@ Intended to be used in `next-error-found-function'." (defcustom next-error-found-function #'ignore "Function called when a next locus is found and displayed. Function is called with two arguments: a FROM-BUFFER buffer -from which next-error navigated, and a target buffer TO-BUFFER." +from which `next-error' navigated, and a target buffer TO-BUFFER." :type '(choice (const :tag "No default" ignore) (const :tag "Quit previous window with M-0" next-error-quit-window) @@ -399,7 +399,7 @@ from which next-error navigated, and a target buffer TO-BUFFER." (defun next-error-found (&optional from-buffer to-buffer) "Function to call when the next locus is found and displayed. -FROM-BUFFER is a buffer from which next-error navigated, +FROM-BUFFER is a buffer from which `next-error' navigated, and TO-BUFFER is a target buffer." (setq next-error-last-buffer (or from-buffer (current-buffer))) (when to-buffer @@ -1803,8 +1803,8 @@ moving point." (defun eval-expression-get-print-arguments (prefix-argument) "Get arguments for commands that print an expression result. -Returns a list (INSERT-VALUE NO-TRUNCATE CHAR-PRINT-LIMIT) -based on PREFIX-ARG. This function determines the interpretation +Returns a list (INSERT-VALUE NO-TRUNCATE CHAR-PRINT-LIMIT) based +on PREFIX-ARGUMENT. This function determines the interpretation of the prefix argument for `eval-expression' and `eval-last-sexp'." (let ((num (prefix-numeric-value prefix-argument))) @@ -3380,8 +3380,7 @@ is not *inside* the region START...END." (> (cdr undo-elt) start))))) (defun undo-adjust-elt (elt deltas) - "Return adjustment of undo element ELT by the undo DELTAS -list." + "Return adjustment of undo element ELT by the undo DELTAS list." (pcase elt ;; POSITION ((pred integerp) @@ -3425,8 +3424,7 @@ list." ;; There was no strong reason to prefer one or the other, except that ;; the first is more consistent with prior undo in region behavior. (defun undo-adjust-beg-end (beg end deltas) - "Return cons of adjustments to BEG and END by the undo DELTAS -list." + "Return cons of adjustments to BEG and END by the undo DELTAS list." (let ((adj-beg (undo-adjust-pos beg deltas))) ;; Note: option 2 above would be like (cons (min ...) adj-end) (cons adj-beg commit 65fe1777e6e27869e8216ec944df2821f417c3e4 Author: Nikolay Kudryavtsev Date: Sat May 1 15:27:21 2021 +0300 Don't use pdumper-stats with unexec * lisp/emacs-lisp/bytecomp.el (byte-compile-refresh-preloaded): Check if pdumper-stats is bound before using it. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 9be54ca4f5..e93cee9924 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -5311,7 +5311,8 @@ already up-to-date." "Reload any Lisp file that was changed since Emacs was dumped. Use with caution." (let* ((argv0 (car command-line-args)) - (emacs-file (or (cdr (nth 2 (pdumper-stats))) + (emacs-file (or (and (fboundp 'pdumper-stats) + (cdr (nth 2 (pdumper-stats)))) (executable-find argv0)))) (if (not (and emacs-file (file-exists-p emacs-file))) (message "Can't find %s to refresh preloaded Lisp files" argv0) commit e5b93f6c1487d5ff3dbc03cb6feb4bdaef47990a Author: Lars Ingebrigtsen Date: Sun May 2 11:28:30 2021 +0200 Inhibit lines in doc-view-mode * lisp/doc-view.el (doc-view-mode): Inhibit line number modes (bug#47974). Change suggested by Gregory Heytings. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 0ae22934b2..a0ffcac9f8 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1913,6 +1913,11 @@ toggle between displaying the document or editing it as text. (unless (memq doc-view-doc-type '(ps)) (setq-local require-final-newline nil)) + ;; These modes will just display "1", so they're not very useful + ;; in this mode. + (setq-local global-linum-mode nil + display-line-numbers-mode nil) + (doc-view-make-safe-dir doc-view-cache-directory) ;; Handle compressed files, remote files, files inside archives (setq-local doc-view--buffer-file-name commit ede24f8f97661983392900f86110e492d940ce24 Author: Eric Skoglund Date: Sun May 2 11:13:45 2021 +0200 Add newline and tab matching documentation to query-replace-regexp * lisp/replace.el: Add \n and \t matching information to query-replace-regexp docstring (bug#47981). diff --git a/lisp/replace.el b/lisp/replace.el index b5dea61924..f427bb30b4 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -432,6 +432,9 @@ In Transient Mark mode, if the mark is active, operate on the contents of the region. Otherwise, operate from point to the end of the buffer's accessible portion. +When invoked interactively, matching a newline with `\n' will not work; +use `C-q C-j' instead. To match a tab character (`\t'), just press `TAB'. + Use \\\\[next-history-element] \ to pull the last incremental search regexp to the minibuffer that reads REGEXP, or invoke replacements from commit 51a9ed843f122e66bb14997837088af905933f1b Author: Lars Ingebrigtsen Date: Sun May 2 10:41:49 2021 +0200 Tweak filtering some more This should get the ./temacs continuation lines right. diff --git a/admin/emake b/admin/emake index 834a1849d5..29dc15186f 100755 --- a/admin/emake +++ b/admin/emake @@ -27,8 +27,7 @@ s#^Configuring local git # Configuring local git # s#^Installing git hooks...# Installing git hooks...# s#^Running # Running # s#^Configured for # Configured for # -s#^./temacs # ./temacs # -s#^Dumping under the name# Dumping under the name# +s#^./temacs.*# \\& # ' | \ egrep --line-buffered -v "^make|\ ^Loading|\ @@ -40,6 +39,7 @@ INFO.*Scraping.*[.]\$|\ ^Adding name|\ ^Dump mode|\ ^Dumping finger|\ +^Dumping under the name|\ ^Byte counts|\ ^Reloc counts|\ ^Pure-hashed|\