From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Tennant Newsgroups: gmane.emacs.help Subject: Re: Evaluation of hooks Date: Mon, 26 Dec 2005 22:41:40 +0000 Message-ID: <87mzin4h23.fsf@smolny.plus.com> References: <87zmmoreyj.fsf@smolny.plus.com> <87slsf4inf.fsf@smolny.plus.com> <20051226223235.GI9520@setzer.hsd1.tx.comcast.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1135636938 21000 80.91.229.2 (26 Dec 2005 22:42:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Dec 2005 22:42:18 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 26 23:42:16 2005 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Er12f-00051s-6l for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Dec 2005 23:42:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Er13s-0005vR-QM for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Dec 2005 17:43:24 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Er13g-0005v9-Dp for help-gnu-emacs@gnu.org; Mon, 26 Dec 2005 17:43:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Er13f-0005ux-O3 for help-gnu-emacs@gnu.org; Mon, 26 Dec 2005 17:43:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Er13f-0005uu-Jv for help-gnu-emacs@gnu.org; Mon, 26 Dec 2005 17:43:11 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Er13Y-0004Jd-Ow for help-gnu-emacs@gnu.org; Mon, 26 Dec 2005 17:43:05 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Er12H-0004vu-97 for help-gnu-emacs@gnu.org; Mon, 26 Dec 2005 23:41:45 +0100 Original-Received: from bl6-147-48.dsl.telepac.pt ([82.155.147.48]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 26 Dec 2005 23:41:45 +0100 Original-Received: from sebyte by bl6-147-48.dsl.telepac.pt with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 26 Dec 2005 23:41:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 21 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bl6-147-48.dsl.telepac.pt User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:j516gPXS5UZebwdN9jBN8vf0g5M= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:32244 Archived-At: Cameron Desautels wrote: > On Mon, Dec 26, 2005 at 10:07:16PM +0000, Sebastian Tennant wrote: >> Adding the following line before the (when ...) condition fixes this and the >> hook is now functioning perfectly. >> >> (unless (not (buffer-file-name)) >> ...) > > I suppose this is a bit nit-picky, but you may as well make it > > (if (buffer-file-name) > ...) > > instead of using both ``unless'' and ``not''. I suppose so, but should code be compact or human readable? In this context, where the hook is written with file visiting buffers in mind, I think it is clearer to say "unless the buffer is not visiting a file..." sdt