Mercurial > emacs
diff lisp/replace.el @ 41761:878a3e2e7cfa
(query-replace-read-args): Display message if FROM contains `\n' or `\t'.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Sun, 02 Dec 2001 04:45:54 +0000 |
| parents | 040cb763bd64 |
| children | d1c81a1250f2 |
line wrap: on
line diff
--- a/lisp/replace.el Sun Dec 02 04:19:32 2001 +0000 +++ b/lisp/replace.el Sun Dec 02 04:45:54 2001 +0000 @@ -69,7 +69,17 @@ (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))
