From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Chong Yidong" Newsgroups: gmane.emacs.devel Subject: Re: Change in fill-nobreak-predicate Date: Fri, 4 Feb 2005 21:37:30 -0500 (EST) Message-ID: <1227.219.74.2.152.1107571050.squirrel@219.74.2.152> References: <1066.219.74.2.152.1107564235.squirrel@219.74.2.152> <87u0orkbr6.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1107571212 5963 80.91.229.2 (5 Feb 2005 02:40:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 5 Feb 2005 02:40:12 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 05 03:40:11 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1CxFrk-0006fe-30 for ged-emacs-devel@m.gmane.org; Sat, 05 Feb 2005 03:40:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CxG5N-0003lU-7x for ged-emacs-devel@m.gmane.org; Fri, 04 Feb 2005 21:54:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CxG4b-0003Xv-Jz for emacs-devel@gnu.org; Fri, 04 Feb 2005 21:53:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CxG4N-0003Q2-8R for emacs-devel@gnu.org; Fri, 04 Feb 2005 21:53:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CxG4N-0003Pj-5u for emacs-devel@gnu.org; Fri, 04 Feb 2005 21:53:11 -0500 Original-Received: from [64.21.80.18] (helo=shark.dnsvelocity.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CxFpT-0002zy-5U for emacs-devel@gnu.org; Fri, 04 Feb 2005 21:37:47 -0500 Original-Received: from stupidch by shark.dnsvelocity.com with local (Exim 4.43) id 1CxFpC-0006wX-Dt for emacs-devel@gnu.org; Fri, 04 Feb 2005 21:37:30 -0500 Original-Received: from 219.74.2.152 ([219.74.2.152]) (SquirrelMail authenticated user cyd@stupidchicken.com); by www.stupidchicken.com with HTTP; Fri, 4 Feb 2005 21:37:30 -0500 (EST) In-Reply-To: <87u0orkbr6.fsf-monnier+emacs@gnu.org> Original-To: emacs-devel@gnu.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a X-Priority: 3 (Normal) Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - shark.dnsvelocity.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [32675 33085] / [47 12] X-AntiAbuse: Sender Address Domain - shark.dnsvelocity.com X-Source: /usr/local/cpanel/3rdparty/bin/php X-Source-Args: /usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/base/3rdparty/squirrelmail/src/compose.php X-Source-Dir: stupidchicken.com:/base/3rdparty/squirrelmail/src X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:32895 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32895 >> This breaks third-party code that relies on fill-nobreak-predicate (such >> as longlines.el), but never mind; > > Actually, hooks (for some old historical backward compatibility reason) > can contain either a list of functions or a single function. > So fill-nobreak-predicate can still be set to a single function, as in > the past. > > I do not doubt that my change introduced some incompatibility, but most > normal uses should work just as well as before. > If not, please give us more information about the problem. I had code calling (funcall fill-nobreak-predicate), which failed because some modes, such as TeX mode, use the new hook mechanism and set fill-nobreak-predicate to a list. Changing my code to (run-hook-with-args-until-success fill-nobreak-predicate) fixed it. Another thing: maybe the doc-string of run-hook-with-args-* should reflect the fact that hook can be a function: run-hook-with-args-until-success is a built-in function in `C source code'. (run-hook-with-args-until-success hook &rest args) Run hook with the specified arguments args. hook should be a symbol, a hook variable. Its value should be a list of functions. We call those functions, one by one, passing arguments args to each of them, until one of them returns a non-nil value. Then we return that value. If all the functions return nil, we return nil. The docstring for run-hook-with-args is already correct: run-hook-with-args is a built-in function in `C source code'. (run-hook-with-args hook &rest args) Run hook with the specified arguments args. hook should be a symbol, a hook variable. If hook has a non-nil value, that value may be a function or a list of functions to be called to run the hook. If the value is a function, it is called with the given arguments and its return value is returned. If it is a list of functions, those functions are called, in order, with the given arguments args.