help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFE: Editing string literals like org-mode?


From: Stefan Monnier
Subject: Re: RFE: Editing string literals like org-mode?
Date: Sat, 27 Mar 2021 13:09:53 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> That is the existing solution for Emacs Lisp.  I'm looking
> for a universal one.

Sounds good.  You basically need to add some standard way for major
modes to tell how to quote/unquote strings and then to go around add
change the major modes to set that properly.

E.g. major modes would have to do something like:

    (setq-local string-quote-function #'foo-mode-string-quote)

And then add some globally-defined commands that make use of this new
information, such as `string-quote-edit` which gets the "string at
point" and lets you edit it without the quoting, and commands
`string-quote-yank` and `string-quote-kill`.

To get started, you'll probably want to provide a useful default value
for `string-quote-function` (presumably relying on the syntax tables,
maybe with some heuristics to handle some \t and friends) so that the
feature works out of the box (to some extent) in many major modes.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]