summaryrefslogtreecommitdiff
path: root/lisp/mh-e/mh-acros.el
diff options
context:
space:
mode:
authorBill Wohler <wohler@newt.com>2006-01-16 21:34:50 +0000
committerBill Wohler <wohler@newt.com>2006-01-16 21:34:50 +0000
commit1e4db53b60d7c9326c98200e80de167527a9fe06 (patch)
tree32962cd419323f226567e9fdad15a3d773148529 /lisp/mh-e/mh-acros.el
parent8d2aa2377562f6c8f77e4cfe65a1fb8f1ac78cb6 (diff)
downloademacs-1e4db53b60d7c9326c98200e80de167527a9fe06.tar.gz
* mh-acros.el (require): Remove defadvice of require as defadvice is
verboten within Emacs and our implementation was returning the wrong value from require. Upcoming restructuring should make this unnecessary. (mh-assoc-ignore-case): Replace with defsubst assoc-string. * mh-alias.el (mh-alias-local-users, mh-alias-reload, mh-alias-expand, mh-alias-minibuffer-confirm-address): Use it. * mh-identity.el (mh-identity-field-handler): Use it.
Diffstat (limited to 'lisp/mh-e/mh-acros.el')
-rw-r--r--lisp/mh-e/mh-acros.el36
1 files changed, 14 insertions, 22 deletions
diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el
index e37705ea54f..de2a714fc77 100644
--- a/lisp/mh-e/mh-acros.el
+++ b/lisp/mh-e/mh-acros.el
@@ -26,14 +26,14 @@
;;; Commentary:
-;; This file contains macros that would normally be in mh-utils.el except that
-;; their presence there would cause a dependency loop with mh-customize.el.
+;; This file contains most, if not all, macros. It is so named with a
+;; silent "m" so that it is compiled first. Otherwise, "make
+;; recompile" in CVS Emacs may use compiled files with stale macro
+;; definitions.
+
;; This file must always be included like this:
;;
;; (eval-when-compile (require 'mh-acros))
-;;
-;; It is so named with a silent "m" so that it is compiled first. Otherwise,
-;; "make recompile" in Emacs 21.4 fails.
;;; Change Log:
@@ -150,23 +150,15 @@ more details."
(list 'nth ,x z)))
(quote ,struct-name))))
-;; A better solution would be to use Stefan's change in bytecomp.el.
-;; If it were checked in, we can drop the advice to require and it
-;; will make things nicer elsewhere too.
-(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.
-Compatibility macro for Emacs versions that lack `assoc-string',
-introduced in Emacs 22."
- (if (fboundp 'assoc-string)
- `(assoc-string ,key ,alist t)
- `(assoc-ignore-case ,key ,alist)))
+(unless (fboundp 'assoc-string)
+ (defsubst assoc-string (key list case-fold)
+ "Like `assoc' but specifically for strings.
+Case is ignored if CASE-FOLD is non-nil.
+This function added by MH-E for Emacs versions that lack
+`assoc-string', introduced in Emacs 22."
+ (if case-fold
+ (assoc-ignore-case key alist)
+ (assoc key alist))))
(provide 'mh-acros)