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

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

Re: Interactively edit a list of strings


From: Joe Riel
Subject: Re: Interactively edit a list of strings
Date: Sun, 22 Jul 2018 22:39:56 -0700

On Mon, 23 Jul 2018 06:21:05 +0200
Marcin Borkowski <mbork@mbork.pl> wrote:

> On 2018-07-23, at 04:39, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
> 
> > Joe Riel <joer@san.rr.com> writes:
> >  
> >> Am looking for a good way to interactively edit a list of strings,
> >> that is, to allow the user to selectively delete strings from the list.
> >> Any suggestions on how to implement this?  
> >
> > You could try using `tabulated-list-mode', display your list of strings.
> > Then you could write a short command to remove a string from the list
> > and redisplay, and bind that in the local keymap. It's tiny bit
> > overkill, but would make it possible to do a bunch of other stuff with
> > the strings.  
> 
> I would derive from special-mode.  You get read-only, scrolling and
> a few other things for free, and you only have to (re)implement C-k to
> delete lines (and creating the buffer/deriving the list from it again,
> of course).  And much simpler than tabulated-list-mode.

Will take a look, thanks.

> OTOH, TLM is not /that/ complicated, as I wrote here:
> http://mbork.pl/2015-07-18_TLM_vs_EWOC%2C_or_there_and_back_again
> a few years ago.
> 
> Out of curiosity: what is the use-case?

It's part of a syntax checker/corrector for the Maple language.  A
tool (mint, analogous to lint) generates a buffer of the variables
that are undeclared in the source.  I grab the list and allow the user
to either quote them in the source or declare them as locals or
globals.  Being able to delete selected items from the list allows
performing a common operation on the remaining.  The typical case is
that almost all the variables should be quoted, but a few should be
declared as locals.


-- 
Joe Riel




reply via email to

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