unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Subject: mh-e/mh-acros.el advices `require' incorrectly
Date: Fri, 13 Jan 2006 16:49:48 +0900	[thread overview]
Message-ID: <E1ExJgy-0004Oo-00@etlken> (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

             reply	other threads:[~2006-01-13  7:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-13  7:49 Kenichi Handa [this message]
2006-01-13 18:56 ` mh-e/mh-acros.el advices `require' incorrectly 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1ExJgy-0004Oo-00@etlken \
    --to=handa@m17n.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).