Mercurial > emacs
diff lisp/mh-e/mh-acros.el @ 68137:ec4727559827
* mh-acros.el (mh-defun-compat, mh-defmacro-compat): Move here from
mh-gnus.el.
* mh-gnus.el: Require mh-acros.
(mh-defmacro-compat, mh-defun-compat): Move to mh-acros.el.
* mh-utils.el (url-unreserved-chars, url-hexify-string): Define if not
defined. Copied from url-util.el in Emacs22 for Emacs 21.
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Wed, 11 Jan 2006 21:02:35 +0000 |
parents | 9c3504ae6060 |
children | bb73cb6860d2 |
line wrap: on
line diff
--- a/lisp/mh-e/mh-acros.el Wed Jan 11 20:15:38 2006 +0000 +++ b/lisp/mh-e/mh-acros.el Wed Jan 11 21:02:35 2006 +0000 @@ -1,6 +1,6 @@ ;;; mh-acros.el --- Macros used in MH-E -;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2006 Free Software Foundation, Inc. ;; Author: Satyaki Das <satyaki@theforce.stanford.edu> ;; Maintainer: Bill Wohler <wohler@newt.com> @@ -74,6 +74,26 @@ `(when (fboundp ',function) (funcall ',function ,@args)))) +(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." + (let ((defined-p (fboundp function))) + (unless defined-p + `(defun ,function ,arg-list ,@body)))) +(put 'mh-defun-compat 'lisp-indent-function 'defun) + +(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)))) +(put 'mh-defmacro-compat 'lisp-indent-function 'defun) + (defmacro mh-make-local-hook (hook) "Make HOOK local if needed. XEmacs and versions of GNU Emacs before 21.1 require