From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Joe Riel Newsgroups: gmane.emacs.help Subject: Re: Interactively edit a list of strings Date: Sun, 22 Jul 2018 22:39:56 -0700 Message-ID: <20180722223956.4d8001cd@gauss> References: <20180722165540.209abe10@gauss> <87d0vepte4.fsf@ericabrahamsen.net> <8736waeg5q.fsf@mbork.pl> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1532324305 13580 195.159.176.226 (23 Jul 2018 05:38:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 23 Jul 2018 05:38:25 +0000 (UTC) Cc: Eric Abrahamsen , help-gnu-emacs@gnu.org To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 23 07:38:20 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhTY4-0003Ro-78 for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Jul 2018 07:38:20 +0200 Original-Received: from localhost ([::1]:32875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhTaA-0006Fk-VU for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Jul 2018 01:40:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhTZl-0006FU-87 for help-gnu-emacs@gnu.org; Mon, 23 Jul 2018 01:40:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhTZi-0000kU-4W for help-gnu-emacs@gnu.org; Mon, 23 Jul 2018 01:40:05 -0400 Original-Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.231]:13832 helo=cdptpa-cmomta03.email.rr.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fhTZh-0000jB-U2 for help-gnu-emacs@gnu.org; Mon, 23 Jul 2018 01:40:02 -0400 Original-Received: from gauss ([75.80.191.41]) by cmsmtp with SMTP id hTdxf8fGhngdlhTdzfSvhb; Mon, 23 Jul 2018 05:44:28 +0000 In-Reply-To: <8736waeg5q.fsf@mbork.pl> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) X-CMAE-Envelope: MS4wfNvfk0eUIyt6cPQTtFTdXWNA2mbywEkY3aqp4lxXWs2c+xnz+G/DRkRQfKFCNY1WEeknO7W8ohXDuATqEp0bCbrJFobBmBqYb3Is2f5me4I0zkJxVFCo TaJjbbkRg0UPtUtc5eE7xUuLwmUKdy4ikrI3jSDZsJfUOBFhJgotkwmHbmzSfKt19y9o3OY+dq8D5w/cBNMVjIjBsb8zEH8k8I5+zlScydQL3p43ZRw+10g7 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 107.14.166.231 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117568 Archived-At: On Mon, 23 Jul 2018 06:21:05 +0200 Marcin Borkowski wrote: > On 2018-07-23, at 04:39, Eric Abrahamsen wrote: > > > Joe Riel 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