# HG changeset patch # User Richard M. Stallman # Date 1007268354 0 # Node ID 878a3e2e7cfae9bf7e4a92d7ef3d81ab87801c9e # Parent c6cef79258415bb965414ddb0f86c00865940da3 (query-replace-read-args): Display message if FROM contains `\n' or `\t'. diff -r c6cef7925841 -r 878a3e2e7cfa lisp/replace.el --- 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))