summaryrefslogtreecommitdiff
path: root/lisp/emulation/viper-cmd.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-04-19 13:48:06 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-04-19 13:48:06 +0200
commit4478f915374a497ec20b51f873ed1b65f22c27dc (patch)
treefe1280d97a9fc3ae539e8398bf85452e8506ef27 /lisp/emulation/viper-cmd.el
parent843dc435f797e6804663ae074d3d88993c4cd8a4 (diff)
downloademacs-4478f915374a497ec20b51f873ed1b65f22c27dc.tar.gz
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).
Diffstat (limited to 'lisp/emulation/viper-cmd.el')
-rw-r--r--lisp/emulation/viper-cmd.el31
1 files changed, 19 insertions, 12 deletions
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 83944285e91..54838638d6c 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -1783,7 +1783,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.
@@ -1992,17 +1992,24 @@ problems."
#'viper-minibuffer-standard-hook
(if (or (not (listp old)) (eq (car old) 'lambda))
(list old) old))))
- (val ""))
+ (val "")
+ (padding "")
+ temp-msg)
(setq keymap (or keymap minibuffer-local-map)
initial (or initial "")
- viper-initial initial)
+ viper-initial initial
+ temp-msg (if default
+ (format "(default %s) " default)
+ ""))
(setq viper-incomplete-ex-cmd nil)
- (setq val (read-from-minibuffer (format-prompt prompt default)
- nil
- keymap nil history-var default))
- (setq minibuffer-setup-hook 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 "")
;; 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)))
@@ -3815,7 +3822,7 @@ Null string will repeat previous search."
(let (buffer buffer-name)
(setq buffer-name
(funcall viper-read-buffer-function
- (format-prompt "Kill buffer"
+ (format "Kill buffer (%s): "
(buffer-name (current-buffer)))))
(setq buffer
(if (null buffer-name)
@@ -4161,8 +4168,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
@@ -4177,7 +4184,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
@@ -4185,7 +4192,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