GNU bug report logs - #55828
Add command to edit a rectangle arbitrarily in a separate buffer

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Tue, 7 Jun 2022 09:25:01 UTC

Severity: wishlist

Full log


Message #11 received at 55828 <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Juri Linkov <juri <at> linkov.net>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, 55828 <at> debbugs.gnu.org
Subject: Re: bug#55828: Add command to edit a rectangle arbitrarily in a
 separate buffer
Date: Wed, 08 Jun 2022 21:57:52 +1200
On 2022-06-08 18:58, Juri Linkov wrote:
> As Michael pointed out, it could be based on string-edit,

Perhaps.  I just compiled from master to have a look at this,
and I don't know whether that's an obvious way to go.  I'm not
seeing a particularly nice way to pass the information about the
source of the rectangle through to the success callback, unless
that function was a closure generated at call time, or the data
was passed as text properties, both of which seem a bit ugly to
me in this scenario (the latter more so than the former, but
neither feels ideal).

Perhaps `string-edit' is missing a `data' argument to be passed
along to the callback functions?

There's also no obvious facility for preparing the edit buffer.
In my command I'm setting the syntax-table to match the original
buffer, and setting fill-column to the rectangle width, both of
which seem like sensible things for the purpose at hand; but
there's no way of doing such things with `string-edit' other
than `string-edit-mode-hook' which I think is going to be
awkward to deal with for such a purpose.  I guess you can
let-bind the hook variable around the `string-edit' call to add
a set-up function, but it again feels like there should be a
nicer option.

It does provide some boilerplate, but I'm not sure it makes
sense to shoe-horn the rectangle command into that framework
in its current form.  Maybe with some enhancements it makes
sense, though.


-Phil





This bug report was last modified 2 years and 361 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.