From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nicholas Vollmer Newsgroups: gmane.emacs.bugs Subject: bug#71404: 30.0.50; [WISHLIST] string-edit-mode should allow changing major mode Date: Fri, 07 Jun 2024 19:37:24 -0400 Message-ID: <87plsspbnl.fsf@parenthetic.dev> References: <87msnyax53.fsf@parenthetic.dev> <86o78dfefp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28832"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71404@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 08 01:39:08 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sFjAp-0007IE-S5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Jun 2024 01:39:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sFjAe-0006qK-EM; Fri, 07 Jun 2024 19:38:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFjAY-0006pB-AF for bug-gnu-emacs@gnu.org; Fri, 07 Jun 2024 19:38:50 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sFjAV-000466-D3 for bug-gnu-emacs@gnu.org; Fri, 07 Jun 2024 19:38:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sFjAk-0004Uk-GM for bug-gnu-emacs@gnu.org; Fri, 07 Jun 2024 19:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicholas Vollmer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Jun 2024 23:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71404 X-GNU-PR-Package: emacs Original-Received: via spool by 71404-submit@debbugs.gnu.org id=B71404.171780348717141 (code B ref 71404); Fri, 07 Jun 2024 23:39:02 +0000 Original-Received: (at 71404) by debbugs.gnu.org; 7 Jun 2024 23:38:07 +0000 Original-Received: from localhost ([127.0.0.1]:45413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFj9r-0004SN-AS for submit@debbugs.gnu.org; Fri, 07 Jun 2024 19:38:07 -0400 Original-Received: from mta-12-4.privateemail.com ([198.54.127.107]:33645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFj9o-0004Rh-Iz for 71404@debbugs.gnu.org; Fri, 07 Jun 2024 19:38:05 -0400 Original-Received: from mta-12.privateemail.com (localhost [127.0.0.1]) by mta-12.privateemail.com (Postfix) with ESMTP id F25461800041; Fri, 7 Jun 2024 19:37:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=parenthetic.dev; s=default; t=1717803463; bh=nij9V82IMxOqFUvKFw36xwon2I7SwVA6azX6rLt+DDM=; h=From:To:Cc:Subject:In-Reply-To:Date:References:From; b=cc8yytq1QCb8l8PHtN53sI+u/FpzPN88x3HQyf38I7HibYoEjFXzcpnjgzm1q4c2E xsok6mxUoKatGafIuPX1AUNXoxmRzq1XM901NHZfKDOHK1nhdHHfhtqZjv7jLxCU8Z /k+M1RNq64RrxOlTwLoR2I03F2o0tem+gYxJBIkXU8gnaxs6hIz6so8HiFSoaUzFnc G/bFRPiQ1vDsY1uqb+EvMzC1xkhDAwQ8K6KXEO6hWoJKZ+f2+c14GFBf/yv/qzHGcJ VqksWM1RabCMjozaSzu8e39F6vBh2Xz3pri1KsBkObkYnmQRqLZcHvtcAep5GLYh89 NH2Hy0BLKmd9w== Original-Received: from laptop (c-174-166-84-198.hsd1.nj.comcast.net [174.166.84.198]) by mta-12.privateemail.com (Postfix) with ESMTPA; Fri, 7 Jun 2024 19:37:41 -0400 (EDT) In-Reply-To: <86o78dfefp.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 07 Jun 2024 09:35:22 +0300") X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286788 Archived-At: Eli Zaretskii writes: >> From: Nicholas Vollmer >> 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.