summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-util.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-12-16 05:08:49 +0000
committerMiles Bader <miles@gnu.org>2007-12-16 05:08:49 +0000
commitd29ee6b1a110cf5d170a10317a96acbbd4a1c68b (patch)
tree58f3c40766d8d56de7d2b026c29e198764d910aa /lisp/gnus/gnus-util.el
parent7e095e45a3f790e4608c88db9648d248e24901dc (diff)
parent47854a55680b5809811caf72f66ecbe8289c2855 (diff)
downloademacs-d29ee6b1a110cf5d170a10317a96acbbd4a1c68b.tar.gz
emacs-d29ee6b1a110cf5d170a10317a96acbbd4a1c68b.tar.bz2
emacs-d29ee6b1a110cf5d170a10317a96acbbd4a1c68b.zip
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-300
Diffstat (limited to 'lisp/gnus/gnus-util.el')
-rw-r--r--lisp/gnus/gnus-util.el58
1 files changed, 49 insertions, 9 deletions
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index de01fb2db11..56aacf0d5a6 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -35,6 +35,9 @@
;;; Code:
+;; For Emacs < 22.2.
+(eval-and-compile
+ (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
(eval-when-compile
(require 'cl))
;; Fixme: this should be a gnus variable, not nnmail-.
@@ -214,6 +217,13 @@ is slower."
(search-forward ":" eol t)
(point)))))
+(declare-function gnus-find-method-for-group "gnus" (group &optional info))
+(autoload 'gnus-group-name-decode "gnus-group")
+(declare-function gnus-group-name-charset "gnus-group" (method group))
+;; gnus-group requires gnus-int which requires message.
+(declare-function message-tokenize-header "message"
+ (header &optional separator))
+
(defun gnus-decode-newsgroups (newsgroups group &optional method)
(let ((method (or method (gnus-find-method-for-group group))))
(mapconcat (lambda (group)
@@ -327,15 +337,23 @@ Symbols are also allowed; their print names are used instead."
;; Two silly functions to ensure that all `y-or-n-p' questions clear
;; the echo area.
-(defun gnus-y-or-n-p (prompt)
- (prog1
- (y-or-n-p prompt)
- (message "")))
-
-(defun gnus-yes-or-no-p (prompt)
- (prog1
- (yes-or-no-p prompt)
- (message "")))
+;;
+;; Do we really need these aliases? Workarounds for bugs in the corresponding
+;; Emacs functions? Maybe these bug are no longer present in any supported
+;; (X)Emacs version? Alias them to the original functions and see if anyone
+;; reports a problem. If not, replace with original functions. --rsteib
+;;
+;; (defun gnus-y-or-n-p (prompt)
+;; (prog1
+;; (y-or-n-p prompt)
+;; (message "")))
+;; (defun gnus-yes-or-no-p (prompt)
+;; (prog1
+;; (yes-or-no-p prompt)
+;; (message "")))
+
+(defalias 'gnus-y-or-n-p 'y-or-n-p)
+(defalias 'gnus-yes-or-no-p 'yes-or-no-p)
;; By Frank Schmitt <ich@Frank-Schmitt.net>. Allows to have
;; age-depending date representations. (e.g. just the time if it's
@@ -654,6 +672,10 @@ If N, return the Nth ancestor instead."
(defvar gnus-work-buffer " *gnus work*")
+(declare-function gnus-get-buffer-create "gnus" (name))
+;; gnus.el requires mm-util.
+(declare-function mm-enable-multibyte "mm-util")
+
(defun gnus-set-work-buffer ()
"Put point in the empty Gnus work buffer."
(if (get-buffer gnus-work-buffer)
@@ -838,6 +860,9 @@ If there's no subdirectory, delete DIRECTORY as well."
(setq string (replace-match "" t t string)))
string)
+(declare-function gnus-put-text-property "gnus"
+ (start end property value &optional object))
+
(defsubst gnus-put-text-property-excluding-newlines (beg end prop val)
"The same as `put-text-property', but don't put this prop on any newlines in the region."
(save-match-data
@@ -849,6 +874,10 @@ If there's no subdirectory, delete DIRECTORY as well."
(setq beg (point)))
(gnus-put-text-property beg (point) prop val)))))
+(declare-function gnus-overlay-put "gnus" (overlay prop value))
+(declare-function gnus-make-overlay "gnus"
+ (beg end &optional buffer front-advance rear-advance))
+
(defsubst gnus-put-overlay-excluding-newlines (beg end prop val)
"The same as `put-text-property', but don't put this prop on any newlines in the region."
(save-match-data
@@ -987,6 +1016,9 @@ with potentially long computations."
(defvar rmail-default-rmail-file)
(defvar mm-text-coding-system)
+(declare-function mm-append-to-file "mm-util"
+ (start end filename &optional codesys inhibit))
+
(defun gnus-output-to-rmail (filename &optional ask)
"Append the current article to an Rmail file named FILENAME."
(require 'rmail)
@@ -1199,6 +1231,9 @@ Return the modified alist."
(throw 'found nil)))
t))
+;; gnus.el requires mm-util.
+(declare-function mm-disable-multibyte "mm-util")
+
(defun gnus-write-active-file (file hashtb &optional full-names)
;; `coding-system-for-write' should be `raw-text' or equivalent.
(let ((coding-system-for-write nnmail-active-file-coding-system))
@@ -1266,6 +1301,9 @@ Return the modified alist."
(pop l2))
l1))))
+(declare-function gnus-add-text-properties "gnus"
+ (start end properties &optional object))
+
(defun gnus-add-text-properties-when
(property value start end properties &optional object)
"Like `gnus-add-text-properties', only applied on where PROPERTY is VALUE."
@@ -1515,6 +1553,8 @@ CHOICE is a list of the choice char and help message at IDX."
(kill-buffer buf))
tchar))
+(declare-function w32-focus-frame "../term/w32-win" (frame))
+
(defun gnus-select-frame-set-input-focus (frame)
"Select FRAME, raise it, and set input focus, if possible."
(cond ((featurep 'xemacs)