aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorRichard M. Stallman2001-12-02 04:45:54 +0000
committerRichard M. Stallman2001-12-02 04:45:54 +0000
commitd9291fa3dfb82cd4d2a6cb9128f16452a5f6f234 (patch)
treea9dc02dea7b0fb77ffee4d3e427a6da6616894e3 /lisp/replace.el
parent81106dbe80dda99e872670388ce3909c1e02cb38 (diff)
downloademacs-d9291fa3dfb82cd4d2a6cb9128f16452a5f6f234.tar.gz
emacs-d9291fa3dfb82cd4d2a6cb9128f16452a5f6f234.zip
(query-replace-read-args): Display message if FROM contains `\n' or `\t'.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index ee0c2ba7a85..71ec81ba44e 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -69,7 +69,17 @@ strings or patterns."
69 (setq from (read-from-minibuffer (format "%s: " string) 69 (setq from (read-from-minibuffer (format "%s: " string)
70 nil nil nil 70 nil nil nil
71 query-replace-from-history-variable 71 query-replace-from-history-variable
72 nil t))) 72 nil t))
73 ;; Warn if user types \n or \t, but don't reject the input.
74 (if (string-match "\\\\[nt]" from)
75 (let ((match (match-string 0 from)))
76 (cond
77 ((string= match "\\n")
78 (message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead"))
79 ((string= match "\\t")
80 (message "Note: `\\t' here doesn't match a tab; to do that, just type TAB")))
81 (sit-for 2))))
82
73 (setq to (read-from-minibuffer (format "%s %s with: " string from) 83 (setq to (read-from-minibuffer (format "%s %s with: " string from)
74 nil nil nil 84 nil nil nil
75 query-replace-to-history-variable from t)) 85 query-replace-to-history-variable from t))