From: Nicholas Vollmer <nv@parenthetic.dev>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 71404@debbugs.gnu.org
Subject: bug#71404: 30.0.50; [WISHLIST] string-edit-mode should allow changing major mode
Date: Fri, 07 Jun 2024 19:37:24 -0400 [thread overview]
Message-ID: <87plsspbnl.fsf@parenthetic.dev> (raw)
In-Reply-To: <86o78dfefp.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 07 Jun 2024 09:35:22 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Nicholas Vollmer <nv@parenthetic.dev>
>> Date: Thu, 06 Jun 2024 11:50:16 -0400
>>
>>
>> string-edit-mode is a nice feature to have built in.
>
> It already is? Or what do you mean by "built in" here?
Correct. It is. I was just commenting that I'm glad to see it part
of Emacs, rather than re-implemented over and over in third-party
packages.
That is all.
>> It would be nice if one could change the major mode of the
>> editing
>> buffer while preserving the edit/abort functionality and any
>> buffer state necessary to make those function.
>> Any reason it couldn't be implemented as a minor mode?
>
> In what major modes will this make sense as a minor mode?
Many. For example. If the string to edit is an elisp form, why
shouldn't the editing buffer be emacs-lisp-mode?
If the string to edit is a message which can be formatted with
markdown, why not markdown-mode?
(I ran into this yesterday when implementing a command for
personal use).
I can imagine many scenarios where the major mode could be
something other than text-mode.
It seems to me that it would make more sense for the
"abort/finish" key bindings to be bound to a minor mode map so
the editing buffer can be much more flexible.
> IOW, I don't think I understand what you mean by "preserving the
> edit/abort functionality and buffer state", so please elaborate.
The buffer has some local state (e.g. the abort callback function,
header-line) stored in a buffer-local variables which are not
preserved when the major mode is changed.
next prev parent reply other threads:[~2024-06-07 23:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 15:50 bug#71404: 30.0.50; [WISHLIST] string-edit-mode should allow changing major mode Nicholas Vollmer
2024-06-07 6:35 ` Eli Zaretskii
2024-06-07 23:37 ` Nicholas Vollmer [this message]
2024-06-08 2:24 ` Nicholas Vollmer
2024-06-08 2:27 ` Nicholas Vollmer
2024-06-10 20:53 ` Nicholas Vollmer
2024-06-11 6:21 ` Eli Zaretskii
2024-07-11 15:01 ` No Wayman
2024-07-23 21:04 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87plsspbnl.fsf@parenthetic.dev \
--to=nv@parenthetic.dev \
--cc=71404@debbugs.gnu.org \
--cc=eliz@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).