all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.