diff options
author | Richard M. Stallman <rms@gnu.org> | 2001-12-02 04:45:54 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2001-12-02 04:45:54 +0000 |
commit | d9291fa3dfb82cd4d2a6cb9128f16452a5f6f234 (patch) | |
tree | a9dc02dea7b0fb77ffee4d3e427a6da6616894e3 /lisp | |
parent | 81106dbe80dda99e872670388ce3909c1e02cb38 (diff) | |
download | emacs-d9291fa3dfb82cd4d2a6cb9128f16452a5f6f234.tar.gz |
(query-replace-read-args): Display message if FROM contains `\n' or `\t'.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/replace.el | 12 |
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." (setq from (read-from-minibuffer (format "%s: " string) nil nil nil query-replace-from-history-variable - nil t))) + nil t)) + ;; Warn if user types \n or \t, but don't reject the input. + (if (string-match "\\\\[nt]" from) + (let ((match (match-string 0 from))) + (cond + ((string= match "\\n") + (message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead")) + ((string= match "\\t") + (message "Note: `\\t' here doesn't match a tab; to do that, just type TAB"))) + (sit-for 2)))) + (setq to (read-from-minibuffer (format "%s %s with: " string from) nil nil nil query-replace-to-history-variable from t)) |