From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: run-hooks vs. run-mode-hooks. Date: Fri, 27 May 2005 09:45:40 -0700 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1117212534 8029 80.91.229.2 (27 May 2005 16:48:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 27 May 2005 16:48:54 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 27 18:48:51 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dbhyn-0005LM-5i for ged-emacs-devel@m.gmane.org; Fri, 27 May 2005 18:46:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dbi36-0005Vl-2w for ged-emacs-devel@m.gmane.org; Fri, 27 May 2005 12:51:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dbi2k-0005Sq-Hz for emacs-devel@gnu.org; Fri, 27 May 2005 12:50:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dbi2h-0005RL-QI for emacs-devel@gnu.org; Fri, 27 May 2005 12:50:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dbi2h-0005Ps-CG for emacs-devel@gnu.org; Fri, 27 May 2005 12:50:39 -0400 Original-Received: from [141.146.126.231] (helo=agminet04.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1Dbhyr-0004sR-TE for emacs-devel@gnu.org; Fri, 27 May 2005 12:46:42 -0400 Original-Received: from agminet04.oracle.com (localhost [127.0.0.1]) by agminet04.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j4RGjiVI029482 for ; Fri, 27 May 2005 11:45:45 -0500 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by agminet04.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j4RGji40029450 for ; Fri, 27 May 2005 11:45:44 -0500 Original-Received: from rgmsgw300.us.oracle.com (localhost [127.0.0.1]) by rgmsgw300.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id j4RGjhfr019601 for ; Fri, 27 May 2005 10:45:43 -0600 Original-Received: from dradamslap (dhcp-amer-csvpn-gw1-141-144-66-15.vpn.oracle.com [141.144.66.15]) by rgmsgw300.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with SMTP id j4RGjhP0019590 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 27 May 2005 10:45:43 -0600 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE 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 Xref: news.gmane.org gmane.emacs.devel:37790 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37790 > (if (fboundp 'function-in-doubt) > (defalias 'mymodule-function-in-doubt 'function-in-doubt) > (defun mymodule-function-in-doubt ...)) Actually this form has the disadvantage that the byte-compiler would have to check which functions are defnied in every branch. And snice it doesn't do that as of now, the byte-compiler won't noticve that this form does define `mymodule-function-in-doubt' and will hencforth issue warnings when you call that function. Better use: (defalias 'mymodule-function-in-doubt (if (fboundp 'function-in-doubt) 'function-in-doubt (lambda (..) ...))) which makes it trivially obvious that `mymodule-function-in-doubt' will indeed always be defined. Is the behavior of the byte-compiler for this kind of thing explained somewhere? That is, are there coding guidelines somewhere to guide Lisp users wrt the byte compiler?