From: Glenn Morris Date: Tue, 11 Dec 2007 05:39:36 +0000 (+0000) Subject: Add declare-function compatibility definition. X-Git-Tag: emacs-pretest-23.0.90~8960 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b50005900277517eb4c6bb7d177c11252fa731d0;p=emacs.git Add declare-function compatibility definition. (gmm-write-region): Autoload. (mm-delete-duplicates, mm-detect-coding-region): Declare as functions. --- diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index 69dd40d2044..8a2e34498cb 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -26,6 +26,10 @@ ;;; Code: +;; For Emacs < 22.2. +(eval-and-compile + (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) + (eval-when-compile (require 'cl)) (require 'mail-prsvr) @@ -960,6 +964,8 @@ But this is very much a corner case, so don't worry about it." (when (featurep 'xemacs) `(and (featurep 'mule) (mm-xemacs-find-mime-charset-1 ,begin ,end)))) +(declare-function mm-delete-duplicates "mm-util" (list)) + (defun mm-find-mime-charset-region (b e &optional hack-charsets) "Return the MIME charsets needed to encode the region between B and E. nil means ASCII, a single-element list represents an appropriate MIME @@ -1210,6 +1216,8 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'." inhibit-file-name-handlers))) (write-region start end filename append visit lockname))) +(autoload 'gmm-write-region "gmm-utils") + ;; It is not a MIME function, but some MIME functions use it. (if (and (fboundp 'make-temp-file) (ignore-errors @@ -1301,6 +1309,8 @@ If SUFFIX is non-nil, add that at the end of the file name." (if (eq (point) end) 'ascii (mm-guess-charset)) (goto-char point))))) +(declare-function mm-detect-coding-region "mm-util" (start end)) + (if (fboundp 'coding-system-get) (defun mm-detect-mime-charset-region (start end) "Detect MIME charset of the text in the region between START and END."