[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: why alias man to woman doesn't work?
From: |
Sebastien Vauban |
Subject: |
Re: why alias man to woman doesn't work? |
Date: |
Thu, 05 Apr 2012 09:38:51 +0200 |
User-agent: |
Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.0.94 (windows-nt) |
Hi Stefan,
Stefan Monnier wrote:
>> why doesn't alias man to woman work?
>> i have this alias:
>
>> (defalias 'man 'woman)
>
>> but it still calls man when M-x on man.
>
> Good question. The technical reason is that woman.el begins with
> (require 'man), so when you do M-x man, it autoloads `woman', which
> loads `man', which redefines `man' thus overwriting your defalias.
>
> So you have to do
>
> (defalias 'man 'woman)
> (eval-after-load 'woman '(defalias 'man 'woman))
>
> to get what you want,
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?
If yes, for performance reasons, one should prefer the latter writing, in
order to have a quicker startup time of Emacs, right?
Just wanna be sure I correctly understood (or not!) this part...
Best regards,
Seb
--
Sebastien Vauban