Skip to content

Instantly share code, notes, and snippets.

@gugod
Created February 25, 2025 08:06
Show Gist options
  • Save gugod/33ee8434d883c7ed08dee6c4c37ce9c9 to your computer and use it in GitHub Desktop.
Save gugod/33ee8434d883c7ed08dee6c4c37ce9c9 to your computer and use it in GitHub Desktop.
(defun my/requote-with (c)
"Replace the quoting delemiter of the current quoted string"
(save-mark-and-excursion
(progn
(forward-sexp)
(insert-char c)
(backward-char)
(backward-sexp)
(insert-char c)
(delete-pair))))
(defun my/requote-with-single-quote ()
"Replace the quoting delemiter of the current quoted string"
(interactive)
(my/requote-with (string-to-char "'")))
(defun my/requote-with-double-quote ()
"Replace the quoting delemiter of the current quoted string"
(interactive)
(my/requote-with (string-to-char "\"")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment