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 22:17:32 -0700 (PDT) Message-ID: <6cd1402c-d034-4d6f-a7e7-ef09677a680e@default> References: <87k2gozusa.fsf@ram.bvr.dp.lan> <87twfohd2e.fsf@ram.bvr.dp.lan> <9d12723a-07a8-47e4-9f8a-451da7bccb63@default> <871t2rzlsl.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 1468819109 6783 80.91.229.3 (18 Jul 2016 05:18:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2016 05:18:29 +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 Mon Jul 18 07:18:08 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 1bP0wS-0003nm-JI for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Jul 2016 07:18:08 +0200 Original-Received: from localhost ([::1]:44422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP0wQ-0006IA-RO for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Jul 2016 01:18:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP0w1-0006Hq-Eb for help-gnu-emacs@gnu.org; Mon, 18 Jul 2016 01:17:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bP0vy-0003or-8Z for help-gnu-emacs@gnu.org; Mon, 18 Jul 2016 01:17:41 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:19117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP0vy-0003of-0R for help-gnu-emacs@gnu.org; Mon, 18 Jul 2016 01:17:38 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u6I5HYEj021622 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Jul 2016 05:17:34 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u6I5HYrf012163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Jul 2016 05:17:34 GMT Original-Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u6I5HWx6006609; Mon, 18 Jul 2016 05:17:33 GMT In-Reply-To: <871t2rzlsl.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: 141.146.126.69 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:110881 Archived-At: I can't comment on most of what you wrote - I have no special competence about the use case etc. But I can at least speak to the use of Icicles etc. > b. send this as completion string to match against. e.g. using > argument initial for the `completing-read' function. But > Info document for Elisp > Minibuffers > Initial Input, says: >=20 > " This is a mostly-deprecated feature for specifying that the > minibuffer should start out with certain text, instead of empty > as usual. > AND > " *We discourage use of a non-'nil' value for INITIAL* Vanilla Emacs considers parameter INITIAL-INPUT to be deprecated. Icicles does not. But even vanilla Emacs still respects it. IMO, it is up to _you_ to decide whether, for your context, it is more useful to use INITIAL-INPUT or DEF (or both). (`C-h f completing-read' in Icicle mode mentions this.) In Icicle mode you can also choose to insert the default value (DEF) if INITIAL-INPUT is nil. You use var `icicle-default-value' to control such behavior. This is a user option, but you can also bind it in code if you want. > > By "persistent completions" I guess you mean a persistent list > > of completions such as those you gather, as in > > https://www.emacswiki.org/emacs/Icicles_-_Persistent_Completions. >=20 > Yes very much so. I will open another thread, to understand why > Icicles-PersistentCompletions does not like me! OK. You can also take it off the mailing list, if you think others might not be too interested. It's up to you. If you think you've found a bug, that's best reported directly using `icicle-send-bug-report'. > > Or maybe you would even add a defcustom that has, as its default > > value, a list of such completions. > > > Does it mean that the variable will be initialized once using 'customize > variable' interface, and then subsequent automatic edits will be lost > between different emacs sessions. Automatic changes to a user option can also be saved persistently (not lost), if that's what you want, using `customize-save-variable'. The behavior depends on what you want. But if you use a user option then unless the user has explicitly chosen automatic updating you generally don't want to change the value. IMO it is OK for code to change an option value outside the Customize UI (e.g. using `customize-save-variable'), but only if the user is aware of this behavior and has chosen it. I.e., you don't want to do something behind the user's back. > > 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. > > > I am just a novice with lisp... Flattered with the suggestion. I will > definitely try to package this, put it up on melpa, and discuss it on > Emacs Wiki. It can't hurt. ;-) If something is useful for you it is likely it will be useful for someone else. Even code that doesn't do something that someone else finds directly useful can serve as food for thought for other uses.