Let's say I'm editing my config file and there is a very long string like this:

(setq my-string "very\nlong\nstring [...] \"hello world\"")

How do edit the string without the escape characters (and maybe in a different mode) and than save the result back in the config file with the escape characters?


You can use the package string-edit for that purpose.

Essentially, it does exactly what you want: simply call string-edit-at-point to edit the string at point, then C-c C-c to return to the original buffer.

The documentation on github includes a demonstration (if the link appears to be dead, please see the github page directly).

  • Your demonstration link goes to a parked domain. – Geremia Nov 8 '15 at 6:32
  • Apparently the link on the github page was changed, I updated the answer. – T. Verron Nov 8 '15 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.