]> git.eshelyaron.com Git - emacs.git/commitdiff
(query-replace-read-args): Display message if FROM contains `\n' or `\t'.
authorRichard M. Stallman <rms@gnu.org>
Sun, 2 Dec 2001 04:45:54 +0000 (04:45 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 2 Dec 2001 04:45:54 +0000 (04:45 +0000)
lisp/replace.el

index ee0c2ba7a85a3625aaa7aeb0ed0ca28eaeac7f2f..71ec81ba44ec450c73a3aff9b0faf306e7ca9328 100644 (file)
@@ -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))