From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bill Wohler Newsgroups: gmane.emacs.devel Subject: Re: mh-e/mh-acros.el advices `require' incorrectly Date: Fri, 13 Jan 2006 10:56:27 -0800 Organization: Newt Software Message-ID: <87oe2gez38.fsf__42426.071331329$1137184786$gmane$org@olgas.newt.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1137184786 8296 80.91.229.2 (13 Jan 2006 20:39:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 13 Jan 2006 20:39:46 +0000 (UTC) Cc: mh-e-devel@lists.sourceforge.net Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 13 21:39:43 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ExVhu-0005b8-TS for ged-emacs-devel@m.gmane.org; Fri, 13 Jan 2006 21:39:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ExVk4-0005gq-7u for ged-emacs-devel@m.gmane.org; Fri, 13 Jan 2006 15:41:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ExU8r-0001RV-R4 for emacs-devel@gnu.org; Fri, 13 Jan 2006 13:59:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ExU8p-0001QY-IA for emacs-devel@gnu.org; Fri, 13 Jan 2006 13:59:17 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ExU8o-0001Q9-HZ for emacs-devel@gnu.org; Fri, 13 Jan 2006 13:59:14 -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 1ExUBp-0006c3-TV for emacs-devel@gnu.org; Fri, 13 Jan 2006 14:02:22 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ExU6R-0006Ik-MH for emacs-devel@gnu.org; Fri, 13 Jan 2006 19:56:48 +0100 Original-Received: from m190e36d0.tmodns.net ([208.54.14.25]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Jan 2006 19:56:47 +0100 Original-Received: from wohler by m190e36d0.tmodns.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Jan 2006 19:56:47 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 51 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: m190e36d0.tmodns.net User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:YAn/xT0Lx4MbGHdsoxhteQpIWKc= 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:49013 Archived-At: Kenichi Handa 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 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.