From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jorgen Schaefer Newsgroups: gmane.emacs.devel Subject: Re: Multiple next-error sources Date: Fri, 7 Nov 2014 16:41:36 +0100 Message-ID: <20141107164136.5827f061@forcix> References: <20141102151524.0d9c665c@forcix> <20141102172944.0f7944e3@forcix> <20141103084433.12117c03@forcix> <86fvdwgxqs.fsf@yandex.ru> <20141106180815.207bf7ad@forcix> <20141107104914.17f04967@forcix> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1415374955 10655 80.91.229.3 (7 Nov 2014 15:42:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Nov 2014 15:42:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 07 16:42:28 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 1Xmlg8-0001RM-Mf for ged-emacs-devel@m.gmane.org; Fri, 07 Nov 2014 16:42:24 +0100 Original-Received: from localhost ([::1]:60752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmlg8-00062Q-Bn for ged-emacs-devel@m.gmane.org; Fri, 07 Nov 2014 10:42:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmlfz-00061O-PN for emacs-devel@gnu.org; Fri, 07 Nov 2014 10:42:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xmlft-0004Bb-TK for emacs-devel@gnu.org; Fri, 07 Nov 2014 10:42:15 -0500 Original-Received: from loki.jorgenschaefer.de ([87.230.15.51]:51041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmlft-0004BU-Mg for emacs-devel@gnu.org; Fri, 07 Nov 2014 10:42:09 -0500 Original-Received: by loki.jorgenschaefer.de (Postfix, from userid 998) id C2A8E2045D3; Fri, 7 Nov 2014 16:41:38 +0100 (CET) Original-Received: from forcix (port-14814.pppoe.wtnet.de [84.46.58.24]) by loki.jorgenschaefer.de (Postfix) with ESMTPSA id 0F3752045D0; Fri, 7 Nov 2014 16:41:38 +0100 (CET) In-Reply-To: X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; i586-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 87.230.15.51 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:176532 Archived-At: On Fri, 07 Nov 2014 09:59:12 -0500 Stefan Monnier wrote: > > Is add-function intended to replace hooks like this in general? > > Somewhat, yes. I have no intention to go around and replace existing > hooks in the forseeable future (except for those rare hooks that used > with-wrapper-hook), but I'll favor new foo-function over new > foo-functions. Thanks for the clarification. If this is the intended default for Emacs in the future, I would like to use this in my packages, too. Therefore, I have a few questions. First, how can I see the sequence of functions being run after add-function? In the example for next-error, what I was looking at would have been a list with a few functions from different packages, such as: - next-error-if-compile-buffer-is-visible - next-error-from-flymake - next-error-from-other-source - next-error-if-compile-buffer-is-not-visible With a hook variable, I can C-h v the variable and clearly see what is happening in which order. I can also easily use setq or delq to change the order if I find it problematic. Is there a way to see and change the order of application when using add-function? Second, also from this example, there would be two functions there by default: - next-error-if-compile-buffer-is-visible - next-error-if-compile-buffer-is-not-visible New functions likely want to be added in the middle, so visible compilation buffers take precedence, but non-visible ones are chosen last. Is there a way using add-function to add a new function in between two existing functions? Finally, hook variables can be added to customize to make them more easily accessible to users. Is there some sort of customize support for add-function, like there is for hooks/lists of functions? Regards, Jorgen