all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* mh-e/mh-acros.el advices `require' incorrectly
@ 2006-01-13  7:49 Kenichi Handa
  2006-01-13 18:56 ` Bill Wohler
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Kenichi Handa @ 2006-01-13  7:49 UTC (permalink / raw)


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.

---
Kenichi Handa
handa@m17n.org

^ permalink raw reply	[flat|nested] 24+ messages in thread
[parent not found: <87oe2gez38.fsf@olgas.newt.com>]

end of thread, other threads:[~2006-01-17 17:19 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-13  7:49 mh-e/mh-acros.el advices `require' incorrectly Kenichi Handa
2006-01-13 18:56 ` Bill Wohler
2006-01-13 21:45 ` Stefan Monnier
2006-01-14  2:52   ` Bill Wohler
2006-01-14 16:14   ` Richard M. Stallman
2006-01-14 17:47     ` Stefan Monnier
2006-01-14  5:49 ` Richard M. Stallman
2006-01-14  8:25   ` Bill Wohler
     [not found] <87oe2gez38.fsf@olgas.newt.com>
2006-01-13 21:04 ` Drew Adams
2006-01-13 22:11   ` Bill Wohler
2006-01-13 23:36     ` Satyaki Das
2006-01-14  1:39       ` Bill Wohler
2006-01-14  0:29     ` Kenichi Handa
2006-01-14 16:14     ` Richard M. Stallman
2006-01-14 23:00       ` Bill Wohler
2006-01-14 23:16         ` Andreas Schwab
2006-01-15  0:26           ` Bill Wohler
2006-01-15  2:22             ` Stefan Monnier
2006-01-15 23:07         ` Richard M. Stallman
2006-01-16  1:29           ` Bill Wohler
2006-01-17  3:24             ` Richard M. Stallman
2006-01-17  4:20               ` Bill Wohler
2006-01-17  9:18                 ` David Kastrup
2006-01-17 17:19                   ` Bill Wohler

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.