From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nic Ferrier Newsgroups: gmane.emacs.devel Subject: Re: why do some programming modes have customize hooks and others do not? Date: Mon, 20 Oct 2014 19:29:04 +0100 Message-ID: <87mw8q61e7.fsf@ferrier.me.uk> References: <87bnp9eir3.fsf@ferrier.me.uk> <2128728.y75FreRA9t@descartes> <871tq36tpl.fsf@ferrier.me.uk> <87y4sb57uk.fsf@ferrier.me.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1413829778 32583 80.91.229.3 (20 Oct 2014 18:29:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Oct 2014 18:29:38 +0000 (UTC) Cc: emacs-devel To: bruce.connor.am@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 20 20:29:31 2014 Return-path: Envelope-to: ged-emacs-devel@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 1XgHhy-0007cc-Ur for ged-emacs-devel@m.gmane.org; Mon, 20 Oct 2014 20:29:31 +0200 Original-Received: from localhost ([::1]:46283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgHhy-0008BQ-IL for ged-emacs-devel@m.gmane.org; Mon, 20 Oct 2014 14:29:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgHhn-0008BI-4P for emacs-devel@gnu.org; Mon, 20 Oct 2014 14:29:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgHhf-0005E3-I1 for emacs-devel@gnu.org; Mon, 20 Oct 2014 14:29:18 -0400 Original-Received: from static.17.66.46.78.clients.your-server.de ([78.46.66.17]:44092 helo=po1.ferrier.me.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgHhf-0005Dw-BG for emacs-devel@gnu.org; Mon, 20 Oct 2014 14:29:11 -0400 Original-Received: from nicferrier-dell-xps (140.35.155.90.in-addr.arpa [90.155.35.140]) by po1.ferrier.me.uk (Postfix) with ESMTPA id 8A40DAC06E2; Mon, 20 Oct 2014 20:46:09 +0200 (CEST) Original-Received: from nicferrier-XPS13-9333 (localhost [127.0.0.1]) by nicferrier-dell-xps (Postfix) with ESMTPS id 7F7AB6023A; Mon, 20 Oct 2014 19:29:04 +0100 (BST) In-Reply-To: (Artur Malabarba's message of "Mon, 20 Oct 2014 13:07:55 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 78.46.66.17 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:175604 Archived-At: Artur Malabarba writes: >> If I use a hooked function to autoload my package, then using the >> non-customize hook won't work. The user ends up having to require my >> package in their .emacs. > > I don't understand. Why would the hooked function not load your > package? The scenario I'm thinking of is where a package adds itself to a hook to get itself auto-initialized. If the hook isn't saved (eg: by customize) then of course the contents will be lost. That's all I meant. Customizable hooks are good for packages to hook into (with enough user consent) because they are persistent. > Yes. > Another possible solution to this conundrum would be for the customize > interface itself to provide special treatment on hook variables. > > Customize can keep track of which functions were added through > the interface. That is a *really* good idea. > Whenever the hook is customized, only those items are displayed > on the interface (or maybe the other items are displayed but not editable= ). > When the user makes some change and performs a save, Customize then > saves only the user-added functions. The other ones are left in the > hook, but they are not saved to =E2=80=9Ccustom-file=E2=80=9D. > > This would have almost no effect on the user and the authors, but > would prevent packages from leaving garbage behind. It might be a > little cumbersome to code, but I don't forsee any fundamental problems > with it. > > Anyone? It's a brilliant solution I think. I'd be happy to implement it (when we have git). Nic