Emacs: Comment on usefulness of 'escape-region'

master
Pierre Neidhardt 2017-05-08 15:27:40 +05:30
parent 644d13ff92
commit 013111d11d
1 changed files with 3 additions and 2 deletions

View File

@ -68,8 +68,9 @@ Also returns nil if pid is nil."
(defun escape-region (&optional regex to-string) (defun escape-region (&optional regex to-string)
"Escape double-quotes and backslashes. "Escape double-quotes and backslashes.
You can control the regex replacement with the two optional This is useful for writing Elisp strings containing those
parameters." characters. You can control the regex replacement with the two
optional parameters."
(interactive) (interactive)
(unless regex (setq regex "\\([\"\\\\]\\)")) (unless regex (setq regex "\\([\"\\\\]\\)"))
(unless to-string (setq to-string "\\\\\\1")) (unless to-string (setq to-string "\\\\\\1"))