summaryrefslogtreecommitdiff
path: root/lisp/mh-e/mh-acros.el
diff options
context:
space:
mode:
authorBill Wohler <wohler@newt.com>2006-01-31 20:46:15 +0000
committerBill Wohler <wohler@newt.com>2006-01-31 20:46:15 +0000
commit06e7028b76c83c5fba3b1e581ae5b68cd7bcc177 (patch)
tree85d2c8a2da0f47a4b45456cfc87467f0aaae1c7d /lisp/mh-e/mh-acros.el
parent08166ee946ae1c8c6c86b003c464857d507a42da (diff)
downloademacs-06e7028b76c83c5fba3b1e581ae5b68cd7bcc177.tar.gz
* mh-acros.el (mh-defun-compat, mh-defmacro-compat): Add name argument
since compatibility functions should have our package prefix (mh-) by Emacs convention and to avoid messing up checks for the same functions in other packages. Use explicit argument instead of forming name by adding mh-e prefix so that one can grep and find the definition. * mh-alias.el (mh-alias-local-users, mh-alias-reload) (mh-alias-expand, mh-alias-minibuffer-confirm-address): Use mh-assoc-string instead of assoc-string. * mh-compat.el (assoc-string): Rename to mh-assoc-string. (mh-mail-abbrev-make-syntax-table, mh-url-hexify-string): Move here from mh-utils.el. (mh-display-completion-list): Move here from mh-comp.el. (mh-face-foreground, mh-face-background): Move here from mh-xface.el. (mh-write-file-functions): Move here from mh-folder.el * mh-folder.el (mh-write-file-functions-compat): Move to mh-compat.el and rename to mh-write-file-functions. (mh-folder-mode): Use the new name. * mh-gnus.el (gnus-local-map-property): Rename to mh-gnus-local-map-property. (mm-merge-handles): Rename to mh-mm-merge-handles. (mm-set-handle-multipart-parameter): Rename to mh-mm-set-handle-multipart-parameter. (mm-inline-text-vcard): Rename to mh-mm-inline-text-vcard. (mm-possibly-verify-or-decrypt): Rename to mh-mm-possibly-verify-or-decrypt. (mm-handle-multipart-ctl-parameter): Rename to mh-mm-handle-multipart-ctl-parameter. (mm-readable-p): Rename to mh-mm-readable-p. (mm-long-lines-p): Rename to mh-mm-long-lines-p. (mm-keep-viewer-alive-p): Rename to mh-mm-keep-viewer-alive-p. (mm-destroy-parts): Rename to mh-mm-destroy-parts. (mm-uu-dissect-text-parts): Rename to mh-mm-uu-dissect-text-parts. (mml-minibuffer-read-disposition): Rename to mh-mml-minibuffer-read-disposition. * mh-identity.el (mh-identity-field-handler): Use mh-assoc-string instead of assoc-string. * mh-mime.el (mh-mm-inline-media-tests, mh-mm-inline-message) (mh-mime-display, mh-mime-display-security) (mh-insert-mime-button, mh-insert-mime-security-button) (mh-handle-set-external-undisplayer) (mh-mime-security-press-button, mh-mime-security-show-details) (mh-mml-attach-file, mh-mime-cleanup) (mh-destroy-postponed-handles): Use new mh-* names for compatibility functions. * mh-utils.el (mail-abbrev-make-syntax-table): Move to mh-compat.el and rename to mh-mail-abbrev-make-syntax-table. (mh-beginning-of-word): Use the new name. (mh-get-field): Delete ancient alias. * mh-xface.el (mh-face-foreground-compat): Move to mh-compat.el and rename to mh-face-foreground (mh-face-background-compat): Move to mh-compat.el and rename to mh-face-background. (mh-face-display-function): Use the new names. (mh-x-image-url-cache-canonicalize): Use mh-url-hexify-string instead of url-hexify-string. (url-unreserved-chars): Move to mh-compat.el and rename to mh-url-unreserved-chars. (url-hexify-string): Move to mh-compat.el and rename to mh-url-hexify-string.
Diffstat (limited to 'lisp/mh-e/mh-acros.el')
-rw-r--r--lisp/mh-e/mh-acros.el30
1 files changed, 15 insertions, 15 deletions
diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el
index 313d3f19a2d..8f38abc56ee 100644
--- a/lisp/mh-e/mh-acros.el
+++ b/lisp/mh-e/mh-acros.el
@@ -82,25 +82,25 @@ loads \"cl\" appropriately."
(funcall ',function ,@args))))
;;;###mh-autoload
-(defmacro mh-defun-compat (function arg-list &rest body)
- "This is a macro to define functions which are not defined.
-It is used for functions which were added to Emacs recently.
-If FUNCTION is not defined then it is defined to have argument
-list, ARG-LIST and body, BODY."
+(defmacro mh-defun-compat (name function arg-list &rest body)
+ "Create function NAME.
+If FUNCTION exists, then NAME becomes an alias for FUNCTION.
+Otherwise, create function NAME with ARG-LIST and BODY."
(let ((defined-p (fboundp function)))
- (unless defined-p
- `(defun ,function ,arg-list ,@body))))
+ (if defined-p
+ `(defalias ',name ',function)
+ `(defun ,name ,arg-list ,@body))))
(put 'mh-defun-compat 'lisp-indent-function 'defun)
;;;###mh-autoload
-(defmacro mh-defmacro-compat (function arg-list &rest body)
- "This is a macro to define functions which are not defined.
-It is used for macros which were added to Emacs recently.
-If FUNCTION is not defined then it is defined to have argument
-list, ARG-LIST and body, BODY."
- (let ((defined-p (fboundp function)))
- (unless defined-p
- `(defmacro ,function ,arg-list ,@body))))
+(defmacro mh-defmacro-compat (name macro arg-list &rest body)
+ "Create macro NAME.
+If MACRO exists, then NAME becomes an alias for MACRO.
+Otherwise, create macro NAME with ARG-LIST and BODY."
+ (let ((defined-p (fboundp macro)))
+ (if defined-p
+ `(defalias ',name ',macro)
+ `(defmacro ,name ,arg-list ,@body))))
(put 'mh-defmacro-compat 'lisp-indent-function 'defun)