all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: RFE: Editing string literals like org-mode?
Date: Sat, 27 Mar 2021 13:09:53 -0400	[thread overview]
Message-ID: <jwvlfa8wmvu.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: 875z1co8v0.fsf@passepartout.tim-landscheidt.de

> 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	other threads:[~2021-03-27 17:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-27 14:05 RFE: Editing string literals like org-mode? Tim Landscheidt
2021-03-27 14:25 ` Jean Louis
2021-03-27 16:32   ` Tim Landscheidt
2021-03-27 17:09     ` Stefan Monnier [this message]
2021-03-28 11:42       ` Tim Landscheidt
2021-03-27 18:08     ` Jean Louis
2021-03-28 12:31       ` Tim Landscheidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvlfa8wmvu.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.