From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: why alias man to woman doesn't work? Date: Thu, 05 Apr 2012 12:52:14 +0200 Message-ID: <8762deqwm9.fsf@thinkpad.tsdh.de> References: <4fcd7e17-e3a4-4b35-80ca-ad71da1df9d5@pg2g2000pbb.googlegroups.com> <80k41u4ohg.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1333650967 31367 80.91.229.3 (5 Apr 2012 18:36:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Apr 2012 18:36:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 05 20:36:02 2012 Return-path: Envelope-to: geh-help-gnu-emacs@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 1SFrXK-0000EB-H0 for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Apr 2012 20:35:58 +0200 Original-Received: from localhost ([::1]:47330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFrI9-00066h-GP for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Apr 2012 14:20:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFkKV-0006Rm-TT for help-gnu-emacs@gnu.org; Thu, 05 Apr 2012 06:54:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SFkKN-0005cd-5X for help-gnu-emacs@gnu.org; Thu, 05 Apr 2012 06:54:15 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:55002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFkKM-0005c3-Um for help-gnu-emacs@gnu.org; Thu, 05 Apr 2012 06:54:07 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SFkIm-00055m-Df for help-gnu-emacs@gnu.org; Thu, 05 Apr 2012 12:52:28 +0200 Original-Received: from tsdh.uni-koblenz.de ([141.26.67.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Apr 2012 12:52:28 +0200 Original-Received: from tassilo by tsdh.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Apr 2012 12:52:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 53 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: tsdh.uni-koblenz.de User-Agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.0.95 (gnu/linux) Cancel-Lock: sha1:7J4XB2eJRswjXkdsBYY2Gq8YjoA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84349 Archived-At: "Sebastien Vauban" writes: Hi Sebastien, > Do I understand correctly that the above code will load `woman' when > being parsed, while: > > (eval-after-load "woman" '(defalias 'man 'woman)) > > would wait until woman was invoked by some other command? Not until woman was invoked, but until woman.el is loaded. You can also write (eval-after-load 'woman '(...)) which would evaluate the quoted form after the feature woman has been provided. Usually, (provide 'foo) is the last form in a file foo.el, so in most cases both are equivalent. > If yes, for performance reasons, one should prefer the latter writing, > in order to have a quicker startup time of Emacs, right? Nobody *should*, but it's a possibly way to speed up emacs startup time. For example, all customizations for programming modes need not be done until you visit a file of that language. I have a small macro for that, because I always forget that the form given to eval-after-load has to be quoted and to have an implicit progn. --8<---------------cut here---------------start------------->8--- (defmacro th-defer-eval (feature &rest forms) "Defer evaluation of FORMS after FEATURE has been provided. A shorthand for (eval-after-load 'FEATURE '(progn FORMS)) used like (th-defer-eval foobar (do-this-after-loading-foobar) (do-that-after-loading-foobar))" (declare (indent defun)) `(eval-after-load (quote ,feature) '(progn ,@forms))) --8<---------------cut here---------------end--------------->8--- Bye, Tassilo