unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: Ben Bacarisse <ben.lists@bsb.me.uk>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Interactively edit a list of strings
Date: Mon, 23 Jul 2018 06:22:52 +0200	[thread overview]
Message-ID: <871sbueg2r.fsf@mbork.pl> (raw)
In-Reply-To: <87y3e27ocq.fsf@bsb.me.uk>


On 2018-07-23, at 03:05, Ben Bacarisse <ben.lists@bsb.me.uk> 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?
>>
>> My first thought is to write each string on a separate line in a
>> temporary buffer, allow the user to edit that, then reassemble the
>> buffer into a list, however, that isn't ideal, it allows too much
>> freedom to modify the content.  I could restrict the allowable
>> commands to deleting lines, but am wondering if there is a better way.
>
> You might consider using widgets:
>
> https://www.gnu.org/software/emacs/manual/html_mono/widget.html
>
> You could write the strings as an "editable-list" widget without the
> [INS] buttons so only a [DEL] button available.

Nice idea, though a bit of work.  But widget.el is very powerful!  (I
wrote about it also in 2015:
http://mbork.pl/2015-11-21_The_Emacs_widget_library_and_automatic_modification_of_editing_fields)

Best,

--
Marcin Borkowski
http://mbork.pl



  reply	other threads:[~2018-07-23  4:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4060.1532303750.1292.help-gnu-emacs@gnu.org>
2018-07-23  1:05 ` Interactively edit a list of strings Ben Bacarisse
2018-07-23  4:22   ` Marcin Borkowski [this message]
2018-07-24  8:51   ` Stephen Berman
2018-07-22 23:55 Joe Riel
2018-07-23  2:39 ` Eric Abrahamsen
2018-07-23  4:21   ` Marcin Borkowski
2018-07-23  5:39     ` Joe Riel
2018-07-23 11:33       ` Yuri Khan

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=871sbueg2r.fsf@mbork.pl \
    --to=mbork@mbork.pl \
    --cc=ben.lists@bsb.me.uk \
    --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.
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).