From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 5811404: Replace eldoc-documentation-function with a hook Date: Sat, 09 Jul 2016 20:27:52 -0400 Message-ID: References: <20160707032857.31916.95107@vcs.savannah.gnu.org> <20160707032857.E4A1422015C@vcs.savannah.gnu.org> <20160707235954.GA6381@holos.localdomain> 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 1468110496 15376 80.91.229.3 (10 Jul 2016 00:28:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jul 2016 00:28:16 +0000 (UTC) Cc: John Wiegley , emacs-devel@gnu.org To: Mark Oteiza Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 10 02:28:07 2016 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 1bM2bO-0000de-Bx for ged-emacs-devel@m.gmane.org; Sun, 10 Jul 2016 02:28:06 +0200 Original-Received: from localhost ([::1]:52862 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bM2bN-0005ts-DO for ged-emacs-devel@m.gmane.org; Sat, 09 Jul 2016 20:28:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bM2bH-0005tl-Gz for emacs-devel@gnu.org; Sat, 09 Jul 2016 20:28:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bM2bD-00018J-7Y for emacs-devel@gnu.org; Sat, 09 Jul 2016 20:27:58 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:2731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bM2bD-00018D-3J for emacs-devel@gnu.org; Sat, 09 Jul 2016 20:27:55 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A4FgA731xV/wfHSC1cDoMChAJOhQe7QIdLBAICgTw7EgEBAQEBAQGBCkEFg10BAQQjMyMQCw4MAhgOAgIUGA0kiD+rDKQXAQEBBwIBH4EhihmEUjMHgmiBRQW1BCOCO39aIoJ4AQEB X-IPAS-Result: A0A4FgA731xV/wfHSC1cDoMChAJOhQe7QIdLBAICgTw7EgEBAQEBAQGBCkEFg10BAQQjMyMQCw4MAhgOAgIUGA0kiD+rDKQXAQEBBwIBH4EhihmEUjMHgmiBRQW1BCOCO39aIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="247172269" Original-Received: from 45-72-199-7.cpe.teksavvy.com (HELO pastel.home) ([45.72.199.7]) by ironport2-out.teksavvy.com with ESMTP; 09 Jul 2016 20:27:53 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0790F6150B; Sat, 9 Jul 2016 20:27:53 -0400 (EDT) In-Reply-To: <20160707235954.GA6381@holos.localdomain> (Mark Oteiza's message of "Thu, 7 Jul 2016 19:59:54 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:205480 Archived-At: > [=E2=80=A6] advice should be reserved for the cases where you cannot= modify > a function=E2=80=99s behavior in any other way. If it is possible t= o do > the same thing via a hook, that is preferable (see Hooks). [=E2=80= =A6] In > particular, Emacs=E2=80=99s own source files should not put advice on > functions in Emacs. (There are currently a few exceptions to this > convention, but we aim to correct them.) A *-function variable is not an advice, but a hook. It's a different kind of hook than those manipulated by add-hook (which have names ending in -hook or -functions), but it's still a hook and those have been used for many years in various parts of Emacs. It just so happens that the operations that can manipulate those hooks conveniently (add-function/remove-function) are provided in the same file as the new advice-add, but that's only because it was convenient and natural to implement advice-add on top of those new operations. Stefan