From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: C Headers completion candidates Date: Sun, 17 Jul 2016 08:02:30 -0700 (PDT) Message-ID: <9d12723a-07a8-47e4-9f8a-451da7bccb63@default> References: <87k2gozusa.fsf@ram.bvr.dp.lan> <87twfohd2e.fsf@ram.bvr.dp.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1468767824 24373 80.91.229.3 (17 Jul 2016 15:03:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Jul 2016 15:03:44 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: bvraghav@iitk.ac.in Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 17 17:03:31 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bOnbN-0007CD-Pd for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jul 2016 17:03:29 +0200 Original-Received: from localhost ([::1]:41881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOnbN-0003j2-2n for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jul 2016 11:03:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOnaa-0002ap-LT for help-gnu-emacs@gnu.org; Sun, 17 Jul 2016 11:02:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOnaW-0000n0-GR for help-gnu-emacs@gnu.org; Sun, 17 Jul 2016 11:02:39 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:24317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOnaW-0000mt-7r for help-gnu-emacs@gnu.org; Sun, 17 Jul 2016 11:02:36 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u6HF2Xdi032402 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 17 Jul 2016 15:02:33 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u6HF2WFh010990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 17 Jul 2016 15:02:33 GMT Original-Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u6HF2UnE015495; Sun, 17 Jul 2016 15:02:31 GMT In-Reply-To: <87twfohd2e.fsf@ram.bvr.dp.lan> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6744.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 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:110874 Archived-At: .. Lots of fantastic stuff, and explanation of the code... > Way forward, I want to implement this: > 1. Implement a list of completions, at the user level; quite like > persistent completions; >=20 > a. Any completion, after being pruned for prefix (before being > returned), goes as into the list of completions, without > duplicacy. >=20 > b. This list is read, and appened to the lib-name-list; before the > first completion is invoked. (There was no #2, right? Not that one was needed - this is already quite a lot. ;-)) By "persistent completions" I guess you mean a persistent list of completions such as those you gather, as in=20 https://www.emacswiki.org/emacs/Icicles_-_Persistent_Completions. Or maybe you would even add a defcustom that has, as its default value, a list of such completions. It all sounds good to me. And I expect it could be useful to others too. And this is so whether or not people use Icicles. That's the beauty of using just `completing-read': it works whether or not one uses Icicles. And the code creating the persistent completions could also be used by other completion libraries besides Icicles - they too could no doubt make use of such a persistent list, even if they do their thing otherwise than by `completing-read'. Please consider, if you haven't already, posting your code as a library somewhere (e.g. Emacs Wiki, MELPA). Others will not only use it but also offer suggestions etc. [There might be better (in some sense) ways to code some of what you have. For example, it might be that using dolist instead of the more functional-style nested mapcars, etc. would be faster. And maybe just use `string-match-p' with a regexp such as "[.~_]$", instead of bothering with testing multiple suffixes separately using `string-suffix-p'. But such considerations, even assuming they make sense, are not important.]