unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Quote marked region [utilities]
@ 2021-03-28  9:59 Jean Louis
  2021-03-28 10:06 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Jean Louis @ 2021-03-28  9:59 UTC (permalink / raw)
  To: Help GNU Emacs

Few utilities I have made today for quoting marked region with quotes
or escaped quotes. Very simple and handy when editing quoted strings,
like function descriptions or similar. Who knows, maybe it already
exists in Emacs.

(defun quote-region-single (start end)
  "Quotes marked region with single quotes."
  (interactive "r")
  (goto-char end)
  (insert "'")
  (goto-char start)
  (insert "'"))

(defun quote-region-double (start end)
  "Quotes marked region with double quotes."
  (interactive "r")
  (goto-char end)
  (insert "\"")
  (goto-char start)
  (insert "\""))

(defun quote-region-double-escaped (start end)
  "Quotes marked region with escaped double quotes."
  (interactive "r")
  (goto-char end)
  (insert "\\\"")
  (goto-char start)
  (insert "\\\""))


Jean



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-28 10:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-28  9:59 Quote marked region [utilities] Jean Louis
2021-03-28 10:06 ` Eli Zaretskii
2021-03-28 10:09   ` Eli Zaretskii
2021-03-28 10:21   ` Jean Louis
2021-03-28 10:29     ` Eli Zaretskii
2021-03-28 10:38       ` Jean Louis
2021-03-28 10:23   ` Jean Louis
2021-03-28 10:30     ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).