emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mh-e/mh-acros.el advices `require' incorrectly


From: Bill Wohler
Subject: Re: mh-e/mh-acros.el advices `require' incorrectly
Date: Fri, 13 Jan 2006 10:56:27 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Kenichi Handa <address@hidden> writes:

> This is in the latest CVS.
>
> The origianl `require' returns FEATURE even if it is already
> provided, but the adviced `require' returns nil in such a
> case.  So, once mh-acros.el is loaded, a code depending on
> the return value of `require' stops working.
>
> Ex:
> (require 'mh-e)
> (require 'enriched) => enriched
> (require 'enriched) => nil
>
> How about this change?
>
> *** mh-acros.el       13 Jan 2006 10:27:43 +0900      1.13
> --- mh-acros.el       13 Jan 2006 16:45:04 +0900      
> ***************
> *** 152,161 ****
>   
>   (defadvice require (around mh-prefer-el activate)
>     "Modify `require' to load uncompiled MH-E files."
> !   (or (featurep (ad-get-arg 0))
> !       (and (string-match "^mh-" (symbol-name (ad-get-arg 0)))
> !            (load (format "%s.el" (ad-get-arg 0)) t t))
> !       ad-do-it))
>   
>   (defmacro mh-assoc-ignore-case (key alist)
>     "Check if KEY is present in ALIST while ignoring case to do the 
> comparison.
> --- 152,162 ----
>   
>   (defadvice require (around mh-prefer-el activate)
>     "Modify `require' to load uncompiled MH-E files."
> !   (if (or (featurep (ad-get-arg 0))
> !       (and (string-match "^mh-" (symbol-name (ad-get-arg 0)))
> !            (load (format "%s.el" (ad-get-arg 0)) t t))
> !       ad-do-it)
> !       (setq ad-return-value (ad-get-arg 0))))
>   
>   (defmacro mh-assoc-ignore-case (key alist)
>     "Check if KEY is present in ALIST while ignoring case to do the 
> comparison.

Satyaki,

What do you (and others) think about this?

-- 
Bill Wohler <address@hidden>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]