1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-17 19:30:38 -08:00

Revert prompting changes in viper-cmd

* lisp/emulation/viper-cmd.el (viper-quote-region)
(viper-read-string-with-history, viper-query-replace): Revert
prompting changes done in 50512e3 -- the way viper prompts in
command mode is special (bug#55007).

Do not merge to master.
This commit is contained in:
Lars Ingebrigtsen 2022-04-19 13:48:06 +02:00
parent 1030cc1897
commit 91d4898d5c

View file

@ -1786,7 +1786,7 @@ Undo previous insertion and inserts new."
(do-not-change-default t)) (do-not-change-default t))
(setq quote-str (setq quote-str
(viper-read-string-with-history (viper-read-string-with-history
"Quote string" "Quote string: "
nil nil
'viper-quote-region-history 'viper-quote-region-history
;; FIXME: Use comment-region. ;; FIXME: Use comment-region.
@ -1995,17 +1995,24 @@ problems."
#'viper-minibuffer-standard-hook #'viper-minibuffer-standard-hook
(if (or (not (listp old)) (eq (car old) 'lambda)) (if (or (not (listp old)) (eq (car old) 'lambda))
(list old) old)))) (list old) old))))
(val "")) (val "")
(padding "")
temp-msg)
(setq keymap (or keymap minibuffer-local-map) (setq keymap (or keymap minibuffer-local-map)
initial (or initial "") initial (or initial "")
viper-initial initial) viper-initial initial
temp-msg (if default
(format "(default %s) " default)
""))
(setq viper-incomplete-ex-cmd nil) (setq viper-incomplete-ex-cmd nil)
(setq val (read-from-minibuffer (format-prompt prompt default) (setq val (read-from-minibuffer prompt
nil (concat temp-msg initial val padding)
keymap nil history-var default)) keymap nil history-var))
(setq minibuffer-setup-hook nil) (setq minibuffer-setup-hook nil
padding (viper-array-to-string (this-command-keys))
temp-msg "")
;; the following tries to be smart about what to put in history ;; the following tries to be smart about what to put in history
(if (not (string= val (car (symbol-value history-var)))) (if (not (string= val (car (symbol-value history-var))))
(push val (symbol-value history-var))) (push val (symbol-value history-var)))
@ -3819,7 +3826,7 @@ Null string will repeat previous search."
(let (buffer buffer-name) (let (buffer buffer-name)
(setq buffer-name (setq buffer-name
(funcall viper-read-buffer-function (funcall viper-read-buffer-function
(format-prompt "Kill buffer" (format "Kill buffer (%s): "
(buffer-name (current-buffer))))) (buffer-name (current-buffer)))))
(setq buffer (setq buffer
(if (null buffer-name) (if (null buffer-name)
@ -4165,8 +4172,8 @@ and regexp replace."
(interactive) (interactive)
(let (str) (let (str)
(setq str (viper-read-string-with-history (setq str (viper-read-string-with-history
(if viper-re-query-replace "Query replace regexp" (if viper-re-query-replace "Query replace regexp: "
"Query replace") "Query replace: ")
nil ; no initial nil ; no initial
'viper-replace1-history 'viper-replace1-history
(car viper-replace1-history) ; default (car viper-replace1-history) ; default
@ -4181,7 +4188,7 @@ and regexp replace."
(query-replace-regexp (query-replace-regexp
str str
(viper-read-string-with-history (viper-read-string-with-history
(format-message "Query replace regexp `%s' with" str) (format-message "Query replace regexp `%s' with: " str)
nil ; no initial nil ; no initial
'viper-replace1-history 'viper-replace1-history
(car viper-replace1-history) ; default (car viper-replace1-history) ; default
@ -4189,7 +4196,7 @@ and regexp replace."
(query-replace (query-replace
str str
(viper-read-string-with-history (viper-read-string-with-history
(format-message "Query replace `%s' with" str) (format-message "Query replace `%s' with: " str)
nil ; no initial nil ; no initial
'viper-replace1-history 'viper-replace1-history
(car viper-replace1-history) ; default (car viper-replace1-history) ; default