From b4b9ecdfe366c64a7b95c4fd295b583c3f3c7aa9 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 13 Feb 2021 05:18:55 +0100 Subject: Remove redundant :group args in progmodes/*.el * lisp/progmodes/bug-reference.el: * lisp/progmodes/cfengine.el: * lisp/progmodes/cmacexp.el: * lisp/progmodes/cpp.el: * lisp/progmodes/cwarn.el: * lisp/progmodes/dcl-mode.el: * lisp/progmodes/executable.el: * lisp/progmodes/flymake.el: * lisp/progmodes/gud.el: * lisp/progmodes/hideshow.el: * lisp/progmodes/icon.el: * lisp/progmodes/inf-lisp.el: * lisp/progmodes/js.el: * lisp/progmodes/ld-script.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/pascal.el: * lisp/progmodes/perl-mode.el: * lisp/progmodes/prog-mode.el: * lisp/progmodes/simula.el: * lisp/progmodes/xscheme.el: Remove redundant :group args. --- lisp/progmodes/inf-lisp.el | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'lisp/progmodes/inf-lisp.el') diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index ac230596240..146ed4dca4a 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -76,8 +76,7 @@ Input matching this regexp is not saved on the input history in Inferior Lisp mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword \(as in :a, :c, etc.)" - :type 'regexp - :group 'inferior-lisp) + :type 'regexp) (defvar inferior-lisp-mode-map (let ((map (copy-keymap comint-mode-map))) @@ -155,8 +154,7 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword (defcustom inferior-lisp-program "lisp" "Program name for invoking an inferior Lisp in Inferior Lisp mode." - :type 'string - :group 'inferior-lisp) + :type 'string) (defcustom inferior-lisp-load-command "(load \"%s\")\n" "Format-string for building a Lisp expression to load a file. @@ -166,8 +164,7 @@ to load that file. The default works acceptably on most Lisps. The string \"(progn (load \\\"%s\\\" :verbose nil :print t) (values))\\n\" produces cosmetically superior output for this application, but it works only in Common Lisp." - :type 'string - :group 'inferior-lisp) + :type 'string) (defcustom inferior-lisp-prompt "^[^> \n]*>+:? *" "Regexp to recognize prompts in the Inferior Lisp mode. @@ -182,8 +179,7 @@ More precise choices: Lucid Common Lisp: \"^\\\\(>\\\\|\\\\(->\\\\)+\\\\) *\" franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\" kcl: \"^>+ *\"" - :type 'regexp - :group 'inferior-lisp) + :type 'regexp) (defvar inferior-lisp-buffer nil "*The current inferior-lisp process buffer. @@ -487,8 +483,7 @@ describing the last `lisp-load-file' or `lisp-compile-file' command.") If it's loaded into a buffer that is in one of these major modes, it's considered a Lisp source file by `lisp-load-file' and `lisp-compile-file'. Used by these commands to determine defaults." - :type '(repeat symbol) - :group 'inferior-lisp) + :type '(repeat symbol)) (defun lisp-load-file (file-name) "Load a Lisp file into the inferior Lisp process." -- cgit v1.2.3 From 50512e36c72a0b6867743ad6b1db0298a2a124f4 Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Wed, 24 Mar 2021 10:31:31 +0100 Subject: Replace "(default %s)" with 'format-prompt' * lisp/cmuscheme.el (scheme-load-file, scheme-compile-file): * lisp/comint.el (comint-get-source): * lisp/emulation/viper-cmd.el (viper-quote-region, viper-kill-buffer) (viper-query-replace, viper-read-string-with-history): * lisp/eshell/esh-mode.el (eshell-find-tag): * lisp/gnus/gnus-sum.el (gnus-articles-to-read) (gnus-summary-search-article-forward) (gnus-summary-search-article-backward): * lisp/international/mule-cmds.el (set-input-method, toggle-input-method) (describe-input-method, set-language-environment) (describe-language-environment): * lisp/mh-e/mh-gnus.el (mh-mml-minibuffer-read-disposition): * lisp/mh-e/mh-letter.el (mh-insert-letter): * lisp/mh-e/mh-mime.el (mh-display-with-external-viewer) (mh-mime-save-parts, mh-mh-forward-message) (mh-mml-query-cryptographic-method, mh-minibuffer-read-type): * lisp/mh-e/mh-seq.el (mh-read-seq, mh-read-range): * lisp/mh-e/mh-utils.el (mh-prompt-for-folder): * lisp/progmodes/etags.el (find-tag-tag): (find-tag-noselect, find-tag, find-tag-other-window) (find-tag-other-frame, find-tag-regexp): * lisp/progmodes/idlwave.el (idlwave-find-module): * lisp/progmodes/inf-lisp.el (lisp-load-file, lisp-compile-file): * lisp/progmodes/tcl.el (tcl-load-file, tcl-restart-with-file): * lisp/progmodes/xref.el (xref--read-identifier): (xref-find-definitions, xref-find-definitions-other-window) (xref-find-definitions-other-frame, xref-find-references): * lisp/ses.el (ses-read-printer): (ses-read-cell-printer, ses-read-column-printer) (ses-read-default-printer, ses-define-local-printer): * lisp/subr.el (read-number): * lisp/term.el (term-get-source): * src/minibuf.c (read-buffer): Remove prompt suffix and use 'format-prompt'. * lisp/minibuffer.el (format-prompt): Ignore DEFAULT empty strings (bug#47286). --- lisp/cmuscheme.el | 4 ++-- lisp/comint.el | 6 ++---- lisp/emulation/viper-cmd.el | 31 ++++++++++++------------------- lisp/eshell/esh-mode.el | 2 +- lisp/gnus/gnus-sum.el | 31 ++++++++++++++----------------- lisp/international/mule-cmds.el | 10 +++++----- lisp/mh-e/mh-gnus.el | 2 +- lisp/mh-e/mh-letter.el | 5 +---- lisp/mh-e/mh-mime.el | 20 +++++++------------- lisp/mh-e/mh-seq.el | 16 +++++----------- lisp/mh-e/mh-utils.el | 7 +++---- lisp/minibuffer.el | 5 +++-- lisp/progmodes/etags.el | 16 ++++++---------- lisp/progmodes/idlwave.el | 2 +- lisp/progmodes/inf-lisp.el | 4 ++-- lisp/progmodes/tcl.el | 4 ++-- lisp/progmodes/xref.el | 15 +++++---------- lisp/ses.el | 12 +++++------- lisp/subr.el | 4 ++-- lisp/term.el | 6 ++---- src/minibuf.c | 4 ++-- 21 files changed, 83 insertions(+), 123 deletions(-) (limited to 'lisp/progmodes/inf-lisp.el') diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el index 772891d5d31..d43cdb15c0d 100644 --- a/lisp/cmuscheme.el +++ b/lisp/cmuscheme.el @@ -421,7 +421,7 @@ in the next one.") (defun scheme-load-file (file-name) "Load a Scheme file FILE-NAME into the inferior Scheme process." - (interactive (comint-get-source "Load Scheme file: " scheme-prev-l/c-dir/file + (interactive (comint-get-source "Load Scheme file" scheme-prev-l/c-dir/file scheme-source-modes t)) ; t because `load' ; needs an exact name (comint-check-source file-name) ; Check to see if buffer needs saved. @@ -433,7 +433,7 @@ in the next one.") (defun scheme-compile-file (file-name) "Compile a Scheme file FILE-NAME in the inferior Scheme process." - (interactive (comint-get-source "Compile Scheme file: " + (interactive (comint-get-source "Compile Scheme file" scheme-prev-l/c-dir/file scheme-source-modes nil)) ; nil because COMPILE doesn't diff --git a/lisp/comint.el b/lisp/comint.el index 65072b01376..b04d404676d 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -2946,7 +2946,7 @@ two arguments are used for determining defaults.) If MUSTMATCH-P is true, then the filename reader will only accept a file that exists. A typical use: - (interactive (comint-get-source \"Compile file: \" prev-lisp-dir/file + (interactive (comint-get-source \"Compile file\" prev-lisp-dir/file \\='(lisp-mode) t))" (let* ((def (comint-source-default prev-dir/file source-modes)) (stringfile (comint-extract-string)) @@ -2959,9 +2959,7 @@ A typical use: (car def))) (deffile (if sfile-p (file-name-nondirectory stringfile) (cdr def))) - (ans (read-file-name (if deffile (format "%s(default %s) " - prompt deffile) - prompt) + (ans (read-file-name (format-prompt prompt deffile) defdir (concat defdir deffile) mustmatch-p))) diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 42d6c1eb198..728f790a962 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -1786,7 +1786,7 @@ Undo previous insertion and inserts new." (do-not-change-default t)) (setq quote-str (viper-read-string-with-history - "Quote string: " + "Quote string" nil 'viper-quote-region-history ;; FIXME: Use comment-region. @@ -1995,24 +1995,17 @@ problems." #'viper-minibuffer-standard-hook (if (or (not (listp old)) (eq (car old) 'lambda)) (list old) old)))) - (val "") - (padding "") - temp-msg) + (val "")) (setq keymap (or keymap minibuffer-local-map) initial (or initial "") - viper-initial initial - temp-msg (if default - (format "(default %s) " default) - "")) + viper-initial initial) (setq viper-incomplete-ex-cmd nil) - (setq val (read-from-minibuffer prompt - (concat temp-msg initial val padding) - keymap nil history-var)) - (setq minibuffer-setup-hook nil - padding (viper-array-to-string (this-command-keys)) - temp-msg "") + (setq val (read-from-minibuffer (format-prompt prompt default) + nil + keymap nil history-var default)) + (setq minibuffer-setup-hook nil) ;; the following tries to be smart about what to put in history (if (not (string= val (car (symbol-value history-var)))) (push val (symbol-value history-var))) @@ -3825,7 +3818,7 @@ Null string will repeat previous search." (let (buffer buffer-name) (setq buffer-name (funcall viper-read-buffer-function - (format "Kill buffer (%s): " + (format-prompt "Kill buffer" (buffer-name (current-buffer))))) (setq buffer (if (null buffer-name) @@ -4171,8 +4164,8 @@ and regexp replace." (interactive) (let (str) (setq str (viper-read-string-with-history - (if viper-re-query-replace "Query replace regexp: " - "Query replace: ") + (if viper-re-query-replace "Query replace regexp" + "Query replace") nil ; no initial 'viper-replace1-history (car viper-replace1-history) ; default @@ -4187,7 +4180,7 @@ and regexp replace." (query-replace-regexp str (viper-read-string-with-history - (format-message "Query replace regexp `%s' with: " str) + (format-message "Query replace regexp `%s' with" str) nil ; no initial 'viper-replace1-history (car viper-replace1-history) ; default @@ -4195,7 +4188,7 @@ and regexp replace." (query-replace str (viper-read-string-with-history - (format-message "Query replace `%s' with: " str) + (format-message "Query replace `%s' with" str) nil ; no initial 'viper-replace1-history (car viper-replace1-history) ; default diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index d29b010ea09..f9dbce9770d 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -458,7 +458,7 @@ and the hook `eshell-exit-hook'." (let ((inhibit-read-only t) (no-default (eobp)) (find-tag-default-function 'ignore)) - (setq tagname (car (find-tag-interactive "Find tag: " no-default))) + (setq tagname (car (find-tag-interactive "Find tag" no-default))) (with-suppressed-warnings ((obsolete find-tag)) (find-tag tagname next-p regexp-p)))) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 97da5503539..c30f9a5f350 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -5977,14 +5977,15 @@ If SELECT-ARTICLES, only select those articles from GROUP." (input (read-string (if only-read-p - (format - "How many articles from %s (available %d, default %d): " - (gnus-group-real-name gnus-newsgroup-name) - number default) - (format - "How many articles from %s (%d default): " - (gnus-group-real-name gnus-newsgroup-name) - default)) + (format-prompt + "How many articles from %s (available %d)" + default + (gnus-group-real-name gnus-newsgroup-name) + number) + (format-prompt + "How many articles from %s" + default + (gnus-group-real-name gnus-newsgroup-name))) nil nil (number-to-string default)))) @@ -9514,11 +9515,9 @@ If BACKWARD, search backward instead." (interactive (list (read-string - (format "Search article %s (regexp%s): " - (if current-prefix-arg "backward" "forward") - (if gnus-last-search-regexp - (concat ", default " gnus-last-search-regexp) - ""))) + (format-prompt "Search article %s (regexp)" + gnus-last-search-regexp + (if current-prefix-arg "backward" "forward"))) current-prefix-arg) gnus-summary-mode) (if (string-equal regexp "") @@ -9537,10 +9536,8 @@ If BACKWARD, search backward instead." (interactive (list (read-string - (format "Search article backward (regexp%s): " - (if gnus-last-search-regexp - (concat ", default " gnus-last-search-regexp) - "")))) + (format-prompt "Search article backward (regexp)" + gnus-last-search-regexp))) gnus-summary-mode) (gnus-summary-search-article-forward regexp 'backward)) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 57958b87278..bf0df6f971d 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -1524,7 +1524,7 @@ To deactivate it programmatically, use `deactivate-input-method'." (interactive (let* ((default (or (car input-method-history) default-input-method))) (list (read-input-method-name - (if default "Select input method (default %s): " "Select input method: ") + (format-prompt "Select input method" default) default t) t))) (activate-input-method input-method) @@ -1569,7 +1569,7 @@ which marks the variable `default-input-method' as set for Custom buffers." (if (or arg (not default)) (progn (read-input-method-name - (if default "Input method (default %s): " "Input method: " ) + (format-prompt "Input method" default) default t)) default)) (unless default-input-method @@ -1620,7 +1620,7 @@ If `default-transient-input-method' was not yet defined, prompt for it." "Describe input method INPUT-METHOD." (interactive (list (read-input-method-name - "Describe input method (default current choice): "))) + (format-prompt "Describe input method" current-input-method)))) (if (and input-method (symbolp input-method)) (setq input-method (symbol-name input-method))) (help-setup-xref (list #'describe-input-method @@ -1929,7 +1929,7 @@ runs the hook `exit-language-environment-hook'. After setting up the new language environment, it runs `set-language-environment-hook'." (interactive (list (read-language-name nil - "Set language environment (default English): "))) + (format-prompt "Set language environment" "English")))) (if language-name (if (symbolp language-name) (setq language-name (symbol-name language-name))) @@ -2144,7 +2144,7 @@ See `set-language-info-alist' for use in programs." (interactive (list (read-language-name 'documentation - "Describe language environment (default current choice): "))) + (format-prompt "Describe language environment" current-language-environment)))) (if (null language-name) (setq language-name current-language-environment)) (if (or (null language-name) diff --git a/lisp/mh-e/mh-gnus.el b/lisp/mh-e/mh-gnus.el index ab65637157a..ac46cc63fcc 100644 --- a/lisp/mh-e/mh-gnus.el +++ b/lisp/mh-e/mh-gnus.el @@ -129,7 +129,7 @@ (unless default (setq default (mml-content-disposition type filename))) (let ((disposition (completing-read - (format "Disposition (default %s): " default) + (format-prompt "Disposition" default) '(("attachment") ("inline") ("")) nil t nil nil default))) (if (not (equal disposition "")) diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el index c44b78ad128..59790181c4d 100644 --- a/lisp/mh-e/mh-letter.el +++ b/lisp/mh-e/mh-letter.el @@ -390,10 +390,7 @@ This command leaves the mark before the letter and point after it." (or mh-sent-from-msg (nth 0 (mh-translate-range folder "cur"))) (nth 0 (mh-translate-range folder "cur")))) (message - (read-string (concat "Message number" - (or (and default - (format " (default %d): " default)) - ": ")) + (read-string (format-prompt "Message number" default) nil nil (if (numberp default) (int-to-string default) diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index bf63ac36cf3..8af7bcdf8f4 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -259,9 +259,7 @@ usually reads the file \"/etc/mailcap\"." (methods (mapcar (lambda (x) (list (cdr (assoc 'viewer x)))) (mailcap-mime-info type 'all))) (def (caar methods)) - (prompt (format "Viewer%s: " (if def - (format " (default %s)" def) - ""))) + (prompt (format-prompt "Viewer" def)) (method (completing-read prompt methods nil nil nil nil def)) (folder mh-show-folder-buffer) (buffer-read-only nil)) @@ -395,9 +393,9 @@ do the work." ((and (or prompt (equal t mh-mime-save-parts-default-directory)) mh-mime-save-parts-directory) - (read-directory-name (format - "Store in directory (default %s): " - mh-mime-save-parts-directory) + (read-directory-name (format-prompt + "Store in directory" + mh-mime-save-parts-directory) "" mh-mime-save-parts-directory t "")) ((stringp mh-mime-save-parts-default-directory) mh-mime-save-parts-default-directory) @@ -1258,11 +1256,7 @@ See also \\[mh-mh-to-mime]." (interactive (list (mml-minibuffer-read-description) (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) - (read-string (concat "Messages" - (if (numberp mh-sent-from-msg) - (format " (default %d): " - mh-sent-from-msg) - ": "))))) + (read-string (format-prompt "Messages" mh-sent-from-msg)))) (beginning-of-line) (insert "#forw [") (and description @@ -1596,7 +1590,7 @@ the possible security methods (see `mh-mml-method-default')." (if current-prefix-arg (let ((def (or (car mh-mml-cryptographic-method-history) mh-mml-method-default))) - (completing-read (format "Method (default %s): " def) + (completing-read (format-prompt "Method" def) '(("pgp") ("pgpmime") ("smime")) nil t nil 'mh-mml-cryptographic-method-history def)) mh-mml-method-default)) @@ -1731,7 +1725,7 @@ Optional argument DEFAULT is returned if a type isn't entered." (type (or (and (not (equal probed-type "application/octet-stream")) probed-type) (completing-read - (format "Content type (default %s): " default) + (format-prompt "Content type" default) (mapcar #'list (mailcap-mime-types)))))) (if (not (equal type "")) type diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el index f4b02c19742..9b9675c78e1 100644 --- a/lisp/mh-e/mh-seq.el +++ b/lisp/mh-e/mh-seq.el @@ -390,10 +390,7 @@ Prompt with PROMPT, raise an error if the sequence is empty and the NOT-EMPTY flag is non-nil, and supply an optional DEFAULT sequence. A reply of `%' defaults to the first sequence containing the current message." - (let* ((input (completing-read (format "%s sequence%s: " prompt - (if default - (format " (default %s)" default) - "")) + (let* ((input (completing-read (format-prompt "%s sequence" default prompt) (mh-seq-names mh-seq-list) nil nil nil 'mh-sequence-history)) (seq (cond ((equal input "%") @@ -646,13 +643,10 @@ should be replaced with: ((stringp default) default) ((symbolp default) (symbol-name default)))) (prompt (cond ((and guess large default) - (format "%s (folder has %s messages, default %s)" - prompt (car counts) default)) - ((and guess large) - (format "%s (folder has %s messages)" - prompt (car counts))) + (format-prompt "%s (folder has %s messages)" + default prompt (car counts))) (default - (format "%s (default %s)" prompt default)))) + (format-prompt prompt default)))) (minibuffer-local-completion-map mh-range-completion-map) (seq-list (if (eq folder mh-current-folder) mh-seq-list @@ -662,7 +656,7 @@ should be replaced with: (mh-seq-names seq-list))) (input (cond ((and (not ask-flag) unseen) (symbol-name mh-unseen-seq)) ((and (not ask-flag) (not large)) "all") - (t (completing-read (format "%s: " prompt) + (t (completing-read prompt 'mh-range-completion-function nil nil nil 'mh-range-history default)))) msg-list) diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index 9497ba0d112..be66e62a1d7 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el @@ -757,10 +757,9 @@ function will accept the folder +, which means all folders when used in searching." (if (null default) (setq default "")) - (let* ((default-string (cond (default-string (format " (default %s)" default-string)) - ((equal "" default) "") - (t (format " (default %s)" default)))) - (prompt (format "%s folder%s: " prompt default-string)) + (let* ((default-string (or default-string + (if (equal default "") nil default))) + (prompt (format-prompt "%s folder" default-string prompt)) (mh-current-folder-name mh-current-folder) read-name folder-name) (while (and (setq read-name (mh-folder-completing-read diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 55825e32fcd..1c9b2689425 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3941,13 +3941,14 @@ it. See `format' for details. If DEFAULT is a list, the first element is used as the default. If not, the element is used as is. -If DEFAULT is nil, no \"default value\" string is included in the -return value." +If DEFAULT is nil or an empty string, no \"default value\" string +is included in the return value." (concat (if (null format-args) prompt (apply #'format prompt format-args)) (and default + (length> default 0) (format minibuffer-default-prompt-format (if (consp default) (car default) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 023c90cca5b..13717b1b894 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -836,11 +836,7 @@ If no tags table is loaded, do nothing and return nil." "Read a tag name, with defaulting and completion." (let* ((completion-ignore-case (find-tag--completion-ignore-case)) (default (find-tag--default)) - (spec (completing-read (if default - (format "%s (default %s): " - (substring string 0 (string-match "[ :]+\\'" string)) - default) - string) + (spec (completing-read (format-prompt string default) (tags-lazy-completion-table) nil nil nil nil default))) (if (equal spec "") @@ -899,7 +895,7 @@ onto a ring and may be popped back to with \\[pop-tag-mark]. Contrast this with the ring of marks gone to by the command. See documentation of variable `tags-file-name'." - (interactive (find-tag-interactive "Find tag: ")) + (interactive (find-tag-interactive "Find tag")) (setq find-tag-history (cons tagname find-tag-history)) ;; Save the current buffer's value of `find-tag-hook' before @@ -971,7 +967,7 @@ Contrast this with the ring of marks gone to by the command. See documentation of variable `tags-file-name'." (declare (obsolete xref-find-definitions "25.1")) - (interactive (find-tag-interactive "Find tag: ")) + (interactive (find-tag-interactive "Find tag")) (let* ((buf (find-tag-noselect tagname next-p regexp-p)) (pos (with-current-buffer buf (point)))) (condition-case nil @@ -1000,7 +996,7 @@ Contrast this with the ring of marks gone to by the command. See documentation of variable `tags-file-name'." (declare (obsolete xref-find-definitions-other-window "25.1")) - (interactive (find-tag-interactive "Find tag other window: ")) + (interactive (find-tag-interactive "Find tag other window")) ;; This hair is to deal with the case where the tag is found in the ;; selected window's buffer; without the hair, point is moved in both @@ -1041,7 +1037,7 @@ Contrast this with the ring of marks gone to by the command. See documentation of variable `tags-file-name'." (declare (obsolete xref-find-definitions-other-frame "25.1")) - (interactive (find-tag-interactive "Find tag other frame: ")) + (interactive (find-tag-interactive "Find tag other frame")) (let ((pop-up-frames t)) (with-suppressed-warnings ((obsolete find-tag-other-window)) (find-tag-other-window tagname next-p)))) @@ -1065,7 +1061,7 @@ Contrast this with the ring of marks gone to by the command. See documentation of variable `tags-file-name'." (declare (obsolete xref-find-apropos "25.1")) - (interactive (find-tag-interactive "Find tag regexp: " t)) + (interactive (find-tag-interactive "Find tag regexp" t)) ;; We go through find-tag-other-window to do all the display hair there. (funcall (if other-window 'find-tag-other-window 'find-tag) regexp next-p t)) diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index e8e55ae96d1..b72d9da7488 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -7820,7 +7820,7 @@ force class query for object methods." (name (idlwave-completing-read (if (or (not this-buffer) (assoc default list)) - (format "Module (Default %s): " default) + (format-prompt "Module" default) (format "Module in this file: ")) list)) type class) diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index 146ed4dca4a..af6ccce3d62 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -487,7 +487,7 @@ Used by these commands to determine defaults." (defun lisp-load-file (file-name) "Load a Lisp file into the inferior Lisp process." - (interactive (comint-get-source "Load Lisp file: " lisp-prev-l/c-dir/file + (interactive (comint-get-source "Load Lisp file" lisp-prev-l/c-dir/file lisp-source-modes nil)) ; nil because LOAD ; doesn't need an exact name (comint-check-source file-name) ; Check to see if buffer needs saved. @@ -500,7 +500,7 @@ Used by these commands to determine defaults." (defun lisp-compile-file (file-name) "Compile a Lisp file in the inferior Lisp process." - (interactive (comint-get-source "Compile Lisp file: " lisp-prev-l/c-dir/file + (interactive (comint-get-source "Compile Lisp file" lisp-prev-l/c-dir/file lisp-source-modes nil)) ; nil = don't need ; suffix .lisp (comint-check-source file-name) ; Check to see if buffer needs saved. diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index 82e1343e057..f6a50bf1a88 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -1413,7 +1413,7 @@ Prefix argument means switch to the Tcl buffer afterwards." (list ;; car because comint-get-source returns a list holding the ;; filename. - (car (comint-get-source "Load Tcl file: " + (car (comint-get-source "Load Tcl file" (or (and (derived-mode-p 'tcl-mode) (buffer-file-name)) @@ -1433,7 +1433,7 @@ If an inferior Tcl process exists, it is killed first. Prefix argument means switch to the Tcl buffer afterwards." (interactive (list - (car (comint-get-source "Restart with Tcl file: " + (car (comint-get-source "Restart with Tcl file" (or (and (derived-mode-p 'tcl-mode) (buffer-file-name)) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index ea52befec57..3cb4247b4bf 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1192,12 +1192,7 @@ definitions." (xref--prompt-p this-command)) (let ((id (completing-read - (if def - (format "%s (default %s): " - (substring prompt 0 (string-match - "[ :]+\\'" prompt)) - def) - prompt) + (format-prompt prompt def) (xref-backend-identifier-completion-table backend) nil nil nil 'xref--read-identifier-history def))) @@ -1257,19 +1252,19 @@ If sufficient information is available to determine a unique definition for IDENTIFIER, display it in the selected window. Otherwise, display the list of the possible definitions in a buffer where the user can select from the list." - (interactive (list (xref--read-identifier "Find definitions of: "))) + (interactive (list (xref--read-identifier "Find definitions of"))) (xref--find-definitions identifier nil)) ;;;###autoload (defun xref-find-definitions-other-window (identifier) "Like `xref-find-definitions' but switch to the other window." - (interactive (list (xref--read-identifier "Find definitions of: "))) + (interactive (list (xref--read-identifier "Find definitions of"))) (xref--find-definitions identifier 'window)) ;;;###autoload (defun xref-find-definitions-other-frame (identifier) "Like `xref-find-definitions' but switch to the other frame." - (interactive (list (xref--read-identifier "Find definitions of: "))) + (interactive (list (xref--read-identifier "Find definitions of"))) (xref--find-definitions identifier 'frame)) ;;;###autoload @@ -1280,7 +1275,7 @@ offering the symbol at point as the default. With prefix argument, or if `xref-prompt-for-identifier' is t, always prompt for the identifier. If `xref-prompt-for-identifier' is nil, prompt only if there's no usable symbol at point." - (interactive (list (xref--read-identifier "Find references of: "))) + (interactive (list (xref--read-identifier "Find references of"))) (xref--find-xrefs identifier 'references identifier nil)) ;;;###autoload diff --git a/lisp/ses.el b/lisp/ses.el index a11c754abc3..6058d48ed19 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -2653,9 +2653,7 @@ canceled." (barf-if-buffer-read-only) (if (eq default t) (setq default "") - (setq prompt (format "%s (default %S): " - (substring prompt 0 -2) - default))) + (setq prompt (format-prompt prompt default))) (dolist (key ses-completion-keys) (define-key ses-mode-edit-map key 'ses-read-printer-complete-symbol)) ;; make it globally visible, so that it can be visible from the minibuffer. @@ -2702,7 +2700,7 @@ right-justified) or a list of one string (will be left-justified)." ;;Range contains differing printer functions (setq default t) (throw 'ses-read-cell-printer t)))))) - (list (ses-read-printer (format "Cell %S printer: " ses--curcell) + (list (ses-read-printer (format "Cell %S printer" ses--curcell) default)))) (unless (eq newval t) (ses-begin-change) @@ -2716,7 +2714,7 @@ See `ses-read-cell-printer' for input forms." (interactive (let ((col (cdr (ses-sym-rowcol ses--curcell)))) (ses-check-curcell) - (list col (ses-read-printer (format "Column %s printer: " + (list col (ses-read-printer (format "Column %s printer" (ses-column-letter col)) (ses-col-printer col))))) @@ -2731,7 +2729,7 @@ See `ses-read-cell-printer' for input forms." "Set the default printer function for cells that have no other. See `ses-read-cell-printer' for input forms." (interactive - (list (ses-read-printer "Default printer: " ses--default-printer))) + (list (ses-read-printer "Default printer" ses--default-printer))) (unless (eq newval t) (ses-begin-change) (ses-set-parameter 'ses--default-printer newval) @@ -3773,7 +3771,7 @@ function is redefined." (setq name (intern name)) (let* ((cur-printer (gethash name ses--local-printer-hashmap)) (default (and cur-printer (ses--locprn-def cur-printer)))) - (setq def (ses-read-printer (format "Enter definition of printer %S: " name) + (setq def (ses-read-printer (format "Enter definition of printer %S" name) default))) (list name def))) diff --git a/lisp/subr.el b/lisp/subr.el index 1b93fcf4100..c2be26a15f5 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2806,9 +2806,9 @@ This function is used by the `interactive' code letter `n'." (when default1 (setq prompt (if (string-match "\\(\\):[ \t]*\\'" prompt) - (replace-match (format " (default %s)" default1) t t prompt 1) + (replace-match (format minibuffer-default-prompt-format default1) t t prompt 1) (replace-regexp-in-string "[ \t]*\\'" - (format " (default %s) " default1) + (format minibuffer-default-prompt-format default1) prompt t t)))) (while (progn diff --git a/lisp/term.el b/lisp/term.el index 6beb17fb66f..d41895ad3d9 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -2535,7 +2535,7 @@ See `term-prompt-regexp'." ;; then the filename reader will only accept a file that exists. ;; ;; A typical use: -;; (interactive (term-get-source "Compile file: " prev-lisp-dir/file +;; (interactive (term-get-source "Compile file" prev-lisp-dir/file ;; '(lisp-mode) t)) ;; This is pretty stupid about strings. It decides we're in a string @@ -2566,9 +2566,7 @@ See `term-prompt-regexp'." (car def))) (deffile (if sfile-p (file-name-nondirectory stringfile) (cdr def))) - (ans (read-file-name (if deffile (format "%s(default %s) " - prompt deffile) - prompt) + (ans (read-file-name (format-prompt prompt deffile) defdir (concat defdir deffile) mustmatch-p))) diff --git a/src/minibuf.c b/src/minibuf.c index d58924ae520..c9831fd50f4 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1490,8 +1490,8 @@ function, instead of the usual behavior. */) STRING_MULTIBYTE (prompt)); } - AUTO_STRING (format, "%s (default %s): "); - prompt = CALLN (Fformat, format, prompt, + prompt = CALLN (Ffuncall, intern("format-prompt"), + prompt, CONSP (def) ? XCAR (def) : def); } -- cgit v1.2.3 From f236b516b6041384ccb439aa8674c412cb785f42 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 31 Mar 2021 12:59:11 +0200 Subject: Use lexical-binding in progmodes/inf-lisp.el * lisp/progmodes/inf-lisp.el: Use lexical-binding. Doc fixes. (inferior-lisp-mode-map, lisp-mode-map) (inferior-lisp-install-letter-bindings): Quote function symbols as such. (inferior-lisp-menu, lisp-compile-string, lisp-eval-string) (lisp-show-variable-documentation): Doc fixes. --- lisp/progmodes/inf-lisp.el | 112 ++++++++++++++++++++++----------------------- 1 file changed, 55 insertions(+), 57 deletions(-) (limited to 'lisp/progmodes/inf-lisp.el') diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index af6ccce3d62..1ee54673d74 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -1,7 +1,6 @@ -;;; inf-lisp.el --- an inferior-lisp mode +;;; inf-lisp.el --- an inferior-lisp mode -*- lexical-binding: t -*- -;; Copyright (C) 1988, 1993-1994, 2001-2021 Free Software Foundation, -;; Inc. +;; Copyright (C) 1988-2021 Free Software Foundation, Inc. ;; Author: Olin Shivers ;; Keywords: processes, lisp @@ -23,13 +22,13 @@ ;;; Commentary: -;; Hacked from tea.el by Olin Shivers (shivers@cs.cmu.edu). 8/88 +;; Hacked from tea.el by Olin Shivers (shivers@cs.cmu.edu). 8/88 ;; This file defines a lisp-in-a-buffer package (inferior-lisp mode) ;; built on top of comint mode. This version is more featureful, ;; robust, and uniform than the Emacs 18 version. The key bindings are ;; also more compatible with the bindings of Hemlock and Zwei (the -;; Lisp Machine emacs). +;; Lisp Machine Emacs). ;; Since this mode is built on top of the general command-interpreter-in- ;; a-buffer mode (comint mode), it shares a common base functionality, @@ -40,19 +39,19 @@ ;; the hooks available for customizing it, see the file comint.el. ;; For further information on inferior-lisp mode, see the comments below. -;; Needs fixin: +;; Needs fixing: ;; The load-file/compile-file default mechanism could be smarter -- it ;; doesn't know about the relationship between filename extensions and -;; whether the file is source or executable. If you compile foo.lisp +;; whether the file is source or executable. If you compile foo.lisp ;; with compile-file, then the next load-file should use foo.bin for -;; the default, not foo.lisp. This is tricky to do right, particularly +;; the default, not foo.lisp. This is tricky to do right, particularly ;; because the extension for executable files varies so much (.o, .bin, ;; .lbin, .mo, .vo, .ao, ...). ;; ;; It would be nice if inferior-lisp (and inferior scheme, T, ...) modes ;; had a verbose minor mode wherein sending or compiling defuns, etc. ;; would be reflected in the transcript with suitable comments, e.g. -;; ";;; redefining fact". Several ways to do this. Which is right? +;; ";;; redefining fact". Several ways to do this. Which is right? ;; ;; When sending text from a source file to a subprocess, the process-mark can ;; move off the window, so you can lose sight of the process interactions. @@ -81,19 +80,19 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword (defvar inferior-lisp-mode-map (let ((map (copy-keymap comint-mode-map))) (set-keymap-parent map lisp-mode-shared-map) - (define-key map "\C-x\C-e" 'lisp-eval-last-sexp) - (define-key map "\C-c\C-l" 'lisp-load-file) - (define-key map "\C-c\C-k" 'lisp-compile-file) - (define-key map "\C-c\C-a" 'lisp-show-arglist) - (define-key map "\C-c\C-d" 'lisp-describe-sym) - (define-key map "\C-c\C-f" 'lisp-show-function-documentation) - (define-key map "\C-c\C-v" 'lisp-show-variable-documentation) + (define-key map "\C-x\C-e" #'lisp-eval-last-sexp) + (define-key map "\C-c\C-l" #'lisp-load-file) + (define-key map "\C-c\C-k" #'lisp-compile-file) + (define-key map "\C-c\C-a" #'lisp-show-arglist) + (define-key map "\C-c\C-d" #'lisp-describe-sym) + (define-key map "\C-c\C-f" #'lisp-show-function-documentation) + (define-key map "\C-c\C-v" #'lisp-show-variable-documentation) map)) (easy-menu-define inferior-lisp-menu inferior-lisp-mode-map - "Inferior Lisp Menu" + "Inferior Lisp Menu." '("Inf-Lisp" ["Eval Last Sexp" lisp-eval-last-sexp t] "--" @@ -107,20 +106,20 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword ;;; These commands augment Lisp mode, so you can process Lisp code in ;;; the source files. -(define-key lisp-mode-map "\M-\C-x" 'lisp-eval-defun) ; GNU convention -(define-key lisp-mode-map "\C-x\C-e" 'lisp-eval-last-sexp) ; GNU convention -(define-key lisp-mode-map "\C-c\C-e" 'lisp-eval-defun) -(define-key lisp-mode-map "\C-c\C-r" 'lisp-eval-region) -(define-key lisp-mode-map "\C-c\C-n" 'lisp-eval-form-and-next) -(define-key lisp-mode-map "\C-c\C-p" 'lisp-eval-paragraph) -(define-key lisp-mode-map "\C-c\C-c" 'lisp-compile-defun) -(define-key lisp-mode-map "\C-c\C-z" 'switch-to-lisp) -(define-key lisp-mode-map "\C-c\C-l" 'lisp-load-file) -(define-key lisp-mode-map "\C-c\C-k" 'lisp-compile-file) ; "kompile" file -(define-key lisp-mode-map "\C-c\C-a" 'lisp-show-arglist) -(define-key lisp-mode-map "\C-c\C-d" 'lisp-describe-sym) -(define-key lisp-mode-map "\C-c\C-f" 'lisp-show-function-documentation) -(define-key lisp-mode-map "\C-c\C-v" 'lisp-show-variable-documentation) +(define-key lisp-mode-map "\M-\C-x" #'lisp-eval-defun) ; GNU convention +(define-key lisp-mode-map "\C-x\C-e" #'lisp-eval-last-sexp) ; GNU convention +(define-key lisp-mode-map "\C-c\C-e" #'lisp-eval-defun) +(define-key lisp-mode-map "\C-c\C-r" #'lisp-eval-region) +(define-key lisp-mode-map "\C-c\C-n" #'lisp-eval-form-and-next) +(define-key lisp-mode-map "\C-c\C-p" #'lisp-eval-paragraph) +(define-key lisp-mode-map "\C-c\C-c" #'lisp-compile-defun) +(define-key lisp-mode-map "\C-c\C-z" #'switch-to-lisp) +(define-key lisp-mode-map "\C-c\C-l" #'lisp-load-file) +(define-key lisp-mode-map "\C-c\C-k" #'lisp-compile-file) ; "kompile" file +(define-key lisp-mode-map "\C-c\C-a" #'lisp-show-arglist) +(define-key lisp-mode-map "\C-c\C-d" #'lisp-describe-sym) +(define-key lisp-mode-map "\C-c\C-f" #'lisp-show-function-documentation) +(define-key lisp-mode-map "\C-c\C-v" #'lisp-show-variable-documentation) ;; This function exists for backwards compatibility. @@ -133,24 +132,23 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword ;;; (with-eval-after-load 'inf-lisp 'inferior-lisp-install-letter-bindings) ;;;You can modify this function to install just the bindings you want." (defun inferior-lisp-install-letter-bindings () - (define-key lisp-mode-map "\C-ce" 'lisp-eval-defun-and-go) - (define-key lisp-mode-map "\C-cr" 'lisp-eval-region-and-go) - (define-key lisp-mode-map "\C-cc" 'lisp-compile-defun-and-go) - (define-key lisp-mode-map "\C-cz" 'switch-to-lisp) - (define-key lisp-mode-map "\C-cl" 'lisp-load-file) - (define-key lisp-mode-map "\C-ck" 'lisp-compile-file) - (define-key lisp-mode-map "\C-ca" 'lisp-show-arglist) - (define-key lisp-mode-map "\C-cd" 'lisp-describe-sym) - (define-key lisp-mode-map "\C-cf" 'lisp-show-function-documentation) - (define-key lisp-mode-map "\C-cv" 'lisp-show-variable-documentation) - - (define-key inferior-lisp-mode-map "\C-cl" 'lisp-load-file) - (define-key inferior-lisp-mode-map "\C-ck" 'lisp-compile-file) - (define-key inferior-lisp-mode-map "\C-ca" 'lisp-show-arglist) - (define-key inferior-lisp-mode-map "\C-cd" 'lisp-describe-sym) - (define-key inferior-lisp-mode-map "\C-cf" 'lisp-show-function-documentation) - (define-key inferior-lisp-mode-map "\C-cv" - 'lisp-show-variable-documentation)) + (define-key lisp-mode-map "\C-ce" #'lisp-eval-defun-and-go) + (define-key lisp-mode-map "\C-cr" #'lisp-eval-region-and-go) + (define-key lisp-mode-map "\C-cc" #'lisp-compile-defun-and-go) + (define-key lisp-mode-map "\C-cz" #'switch-to-lisp) + (define-key lisp-mode-map "\C-cl" #'lisp-load-file) + (define-key lisp-mode-map "\C-ck" #'lisp-compile-file) + (define-key lisp-mode-map "\C-ca" #'lisp-show-arglist) + (define-key lisp-mode-map "\C-cd" #'lisp-describe-sym) + (define-key lisp-mode-map "\C-cf" #'lisp-show-function-documentation) + (define-key lisp-mode-map "\C-cv" #'lisp-show-variable-documentation) + + (define-key inferior-lisp-mode-map "\C-cl" #'lisp-load-file) + (define-key inferior-lisp-mode-map "\C-ck" #'lisp-compile-file) + (define-key inferior-lisp-mode-map "\C-ca" #'lisp-show-arglist) + (define-key inferior-lisp-mode-map "\C-cd" #'lisp-describe-sym) + (define-key inferior-lisp-mode-map "\C-cf" #'lisp-show-function-documentation) + (define-key inferior-lisp-mode-map "\C-cv" #'lisp-show-variable-documentation)) (defcustom inferior-lisp-program "lisp" "Program name for invoking an inferior Lisp in Inferior Lisp mode." @@ -181,7 +179,7 @@ franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\" kcl: \"^>+ *\"" :type 'regexp) -(defvar inferior-lisp-buffer nil "*The current inferior-lisp process buffer. +(defvar inferior-lisp-buffer nil "*The current `inferior-lisp' process buffer. MULTIPLE PROCESS SUPPORT =========================================================================== @@ -326,18 +324,18 @@ Prefix argument means switch to the Lisp buffer afterwards." (if and-go (switch-to-lisp t))) (defun lisp-compile-string (string) - "Send the string to the inferior Lisp process to be compiled and executed." + "Send STRING to the inferior Lisp process to be compiled and executed." (comint-send-string (inferior-lisp-proc) (format "(funcall (compile nil (lambda () %s)))\n" string))) (defun lisp-eval-string (string) - "Send the string to the inferior Lisp process to be executed." + "Send STRING to the inferior Lisp process to be executed." (comint-send-string (inferior-lisp-proc) (concat string "\n"))) (defun lisp-do-defun (do-string do-region) "Send the current defun to the inferior Lisp process. -The actually processing is done by `do-string' and `do-region' +The actually processing is done by DO-STRING and DO-REGION which determine whether the code is compiled before evaluation. DEFVAR forms reset the variables to the init values." (save-excursion @@ -460,7 +458,7 @@ With argument, positions cursor at end of buffer." ;;; (interactive "r") ;;; (save-excursion ;;; (goto-char start) (end-of-defun) (beginning-of-defun) ; error check -;;; (if (< (point) start) (error "region begins in middle of defun")) +;;; (if (< (point) start) (error "Region begins in middle of defun")) ;;; (goto-char start) ;;; (let ((s start)) ;;; (end-of-defun) @@ -591,7 +589,7 @@ See variable `lisp-function-doc-command'." (format lisp-function-doc-command fn))) (defun lisp-show-variable-documentation (var) - "Send a command to the inferior Lisp to give documentation for function FN. + "Send a command to the inferior Lisp to give documentation for variable VAR. See variable `lisp-var-doc-command'." (interactive (lisp-symprompt "Variable doc" (lisp-var-at-pt))) (comint-proc-query (inferior-lisp-proc) (format lisp-var-doc-command var))) @@ -620,8 +618,8 @@ See variable `lisp-describe-sym-command'." (error "No Lisp subprocess; see variable `inferior-lisp-buffer'")))) -;;; Do the user's customization... -;;;=============================== +;; Obsolete. + (defvar inferior-lisp-load-hook nil "This hook is run when the library `inf-lisp' is loaded.") (make-obsolete-variable 'inferior-lisp-load-hook -- cgit v1.2.3 From 4a538c4861370d629920b66a7cdcbb78ecb13830 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 1 Apr 2021 16:24:12 +0200 Subject: Remove redundant #' before lambda in progmodes/*.el * lisp/progmodes/cc-styles.el (c-set-offset): * lisp/progmodes/ebnf-yac.el (ebnf-yac-token-table): * lisp/progmodes/ebnf2ps.el (ebnf-format-float, ebnf-map-name): * lisp/progmodes/grep.el (lgrep, rgrep-default-command): * lisp/progmodes/inf-lisp.el: * lisp/progmodes/octave.el (octave-lookfor): * lisp/progmodes/python.el (python-pdbtrack-tracking-finish): Remove redundant #' before lambda. --- lisp/progmodes/cc-styles.el | 4 ++-- lisp/progmodes/ebnf-yac.el | 8 ++++---- lisp/progmodes/ebnf2ps.el | 8 ++++---- lisp/progmodes/grep.el | 28 ++++++++++++++-------------- lisp/progmodes/inf-lisp.el | 2 +- lisp/progmodes/octave.el | 4 ++-- lisp/progmodes/python.el | 8 ++++---- 7 files changed, 31 insertions(+), 31 deletions(-) (limited to 'lisp/progmodes/inf-lisp.el') diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index aec259f1b38..29cbe54c3bd 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -476,8 +476,8 @@ and exists only for compatibility reasons." (if current-prefix-arg " or add" "") ": ") (mapcar - #'(lambda (langelem) - (cons (format "%s" (car langelem)) nil)) + (lambda (langelem) + (cons (format "%s" (car langelem)) nil)) (get 'c-offsets-alist 'c-stylevar-fallback)) nil (not current-prefix-arg) ;; initial contents tries to be the last element diff --git a/lisp/progmodes/ebnf-yac.el b/lisp/progmodes/ebnf-yac.el index 5abf1debb15..816cc432d1b 100644 --- a/lisp/progmodes/ebnf-yac.el +++ b/lisp/progmodes/ebnf-yac.el @@ -271,13 +271,13 @@ (let ((table (make-vector 256 'error))) ;; upper & lower case letters: (mapc - #'(lambda (char) - (aset table char 'non-terminal)) + (lambda (char) + (aset table char 'non-terminal)) "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") ;; printable characters: (mapc - #'(lambda (char) - (aset table char 'character)) + (lambda (char) + (aset table char 'character)) "!#$&()*+-.0123456789=?@[\\]^_`~") ;; Override space characters: (aset table ?\n 'space) ; [NL] linefeed diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index 7092d2c1d1f..a00440d898c 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el @@ -4398,8 +4398,8 @@ end (defun ebnf-format-float (&rest floats) (mapconcat - #'(lambda (float) - (format ebnf-format-float float)) + (lambda (float) + (format ebnf-format-float float)) floats " ")) @@ -4959,8 +4959,8 @@ killed after process termination." (defvar ebnf-map-name (let ((map (make-vector 256 ?\_))) - (mapc #'(lambda (char) - (aset map char char)) + (mapc (lambda (char) + (aset map char char)) (concat "#$%&+-.0123456789=?@~" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz")) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 8c9a1b53b1b..e9fbcbbfcd0 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -1134,13 +1134,13 @@ command before it's run." (and grep-find-ignored-files (concat " --exclude=" (mapconcat - #'(lambda (ignore) - (cond ((stringp ignore) - (shell-quote-argument ignore)) - ((consp ignore) - (and (funcall (car ignore) dir) - (shell-quote-argument - (cdr ignore)))))) + (lambda (ignore) + (cond ((stringp ignore) + (shell-quote-argument ignore)) + ((consp ignore) + (and (funcall (car ignore) dir) + (shell-quote-argument + (cdr ignore)))))) grep-find-ignored-files " --exclude="))) (and (eq grep-use-directories-skip t) @@ -1274,13 +1274,13 @@ command before it's run." ;; we should use shell-quote-argument here " -name " (mapconcat - #'(lambda (ignore) - (cond ((stringp ignore) - (shell-quote-argument ignore)) - ((consp ignore) - (and (funcall (car ignore) dir) - (shell-quote-argument - (cdr ignore)))))) + (lambda (ignore) + (cond ((stringp ignore) + (shell-quote-argument ignore)) + ((consp ignore) + (and (funcall (car ignore) dir) + (shell-quote-argument + (cdr ignore)))))) grep-find-ignored-files " -o -name ") " " diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index 1ee54673d74..0a72ae96bba 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -442,7 +442,7 @@ With argument, positions cursor at end of buffer." ;;; (let ((name-start (point))) ;;; (forward-sexp 1) ;;; (process-send-string "inferior-lisp" -;;; (format "(compile '%s #'(lambda " +;;; (format "(compile '%s (lambda " ;;; (buffer-substring name-start ;;; (point))))) ;;; (let ((body-start (point))) diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 196f2de3440..a1a5192ee1f 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -1769,8 +1769,8 @@ sentence." (insert "\nRetry with ") (insert-text-button "'-all'" 'follow-link t - 'action #'(lambda (_b) - (octave-lookfor str '-all))) + 'action (lambda (_b) + (octave-lookfor str '-all))) (insert ".\n")) (octave-help-mode))))) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index afb96974b17..e5c15d148f8 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -241,8 +241,8 @@ ;; 2) Add the following hook in your .emacs: ;; (add-hook 'python-mode-hook -;; #'(lambda () -;; (define-key python-mode-map "\C-m" 'newline-and-indent))) +;; (lambda () +;; (define-key python-mode-map "\C-m" 'newline-and-indent))) ;; I'd recommend the first one since you'll get the same behavior for ;; all modes out-of-the-box. @@ -3976,8 +3976,8 @@ Returns the tracked buffer." "Finish tracking." (python-pdbtrack-unset-tracked-buffer) (when python-pdbtrack-kill-buffers - (mapc #'(lambda (buffer) - (ignore-errors (kill-buffer buffer))) + (mapc (lambda (buffer) + (ignore-errors (kill-buffer buffer))) python-pdbtrack-buffers-to-kill)) (setq python-pdbtrack-buffers-to-kill nil)) -- cgit v1.2.3 From eb4a120ea580bf628f65ff7e571016d5efa2293e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 15 Jul 2021 10:33:22 +0200 Subject: Allow using spaces in `inferior-lisp' command names * lisp/progmodes/inf-lisp.el (inferior-lisp): Allow using spaces in the command names (by splitting using shell syntax) (bug#16005). --- lisp/progmodes/inf-lisp.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lisp/progmodes/inf-lisp.el') diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index 0a72ae96bba..e69a9ff394e 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -62,6 +62,7 @@ (require 'comint) (require 'lisp-mode) +(require 'shell) (defgroup inferior-lisp nil @@ -289,15 +290,20 @@ to continue it." "Run an inferior Lisp process, input and output via buffer `*inferior-lisp*'. If there is a process already running in `*inferior-lisp*', just switch to that buffer. + With argument, allows you to edit the command line (default is value of `inferior-lisp-program'). Runs the hooks from `inferior-lisp-mode-hook' (after the `comint-mode-hook' is run). + +If any parts of the command name contains spaces, they should be +quoted using shell quote syntax. + \(Type \\[describe-mode] in the process buffer for a list of commands.)" (interactive (list (if current-prefix-arg (read-string "Run lisp: " inferior-lisp-program) inferior-lisp-program))) (if (not (comint-check-proc "*inferior-lisp*")) - (let ((cmdlist (split-string cmd))) + (let ((cmdlist (split-string-shell-command cmd))) (set-buffer (apply (function make-comint) "inferior-lisp" (car cmdlist) nil (cdr cmdlist))) (inferior-lisp-mode))) -- cgit v1.2.3