From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: replacement of find-file-not-found-hooks Date: Sun, 21 Jul 2024 18:52:53 +0300 Message-ID: <86jzhebv3e.fsf@gnu.org> References: <87a5icjeua.fsf@mat.ucm.es> <87o76sarrq.fsf@igel.home> <87plr6g57s.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10283"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Uwe Brauer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 21 17:53:10 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sVYs0-0002W6-NW for ged-emacs-devel@m.gmane-mx.org; Sun, 21 Jul 2024 17:53:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sVYro-0001Ni-Sx; Sun, 21 Jul 2024 11:52:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVYrn-0001NT-Cm for emacs-devel@gnu.org; Sun, 21 Jul 2024 11:52:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVYrn-0004Zl-2u; Sun, 21 Jul 2024 11:52:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=VzXyMli+aMfjOhTCO7OcAI6Iy+0eMhy8vy1akq+Sv4M=; b=BoFfI0ciNmm6EREy5Y02 Mm86OJWQHDQSlS+9dZXgyyxkyyAz4bH7LswS8BLBoJuwVr+R4IZztreWAqflduSE8inloMk4iEnPQ c4F2+nB5vD3inzCixi58MMu5jGjxPXOVbm2Egv/rb770t0K6uPS3Wxo4qK9JVZnWIVsTxTW7B2wzg xdOu2aknuOiPQUIxVsPILLiC9B3wlH6q2h8iuQhYHzMt6MHENdDqG6fYFGG2tGzDlGm0XZEXPl6ix 3fu1VemrqIUCnRqFzM3NjOX4xUuemIhH4NNcrPGbCvLtY9/dxvcjfVW4Li6rVmEJGM2WMI5ICZ/Kt uifNazKRZjdeVQ==; In-Reply-To: <87plr6g57s.fsf@mat.ucm.es> (emacs-devel@gnu.org) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321900 Archived-At: > Date: Sun, 21 Jul 2024 17:00:39 +0200 > From: Uwe Brauer via "Emacs development discussions." > > >>> "AS" == Andreas Schwab writes: > > > According to the news: > > > *** A number of hooks have been renamed to better follow the conventions: > > > 'find-file-not-found-hooks' to 'find-file-not-found-functions', > > Thanks but then a hook is no longer called a hook? Confusing, isn't it? Not if you read the ELisp manual, which says: Most of the hooks in Emacs are “normal hooks”. These variables contain lists of functions to be called with no arguments. By convention, whenever the hook name ends in ‘-hook’, that tells you it is normal. We try to make all hooks normal, as much as possible, so that you can use them in a uniform way. Every major mode command is supposed to run a normal hook called the “mode hook” as one of the last steps of initialization. This makes it easy for a user to customize the behavior of the mode, by overriding the buffer-local variable assignments already made by the mode. Most minor mode functions also run a mode hook at the end. But hooks are used in other contexts too. For example, the hook ‘suspend-hook’ runs just before Emacs suspends itself (*note Suspending Emacs::). If the hook variable's name does not end with ‘-hook’, that indicates it is probably an “abnormal hook”. These differ from normal hooks in two ways: they can be called with one or more arguments, and their return values can be used in some way. The hook's documentation says how the functions are called and how their return values are used. Any functions added to an abnormal hook must follow the hook's calling convention. By convention, abnormal hook names end in ‘-functions’. If the name of the variable ends in ‘-predicate’ or ‘-function’ (singular) then its value must be a function, not a list of functions. As with abnormal hooks, the expected arguments and meaning of the return value vary across such _single function hooks_. The details are explained in each variable's docstring. the old name was unconventional in that it ended in "-hooks", so we renamed it.