From 1e4db53b60d7c9326c98200e80de167527a9fe06 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Mon, 16 Jan 2006 21:34:50 +0000 Subject: * 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. --- lisp/mh-e/mh-acros.el | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'lisp/mh-e/mh-acros.el') 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) -- cgit v1.2.1