;;; Code:
(require 'custom)
-(require 'cl)
+(eval-when-compile (require 'cl))
(require 'nnheader)
(require 'timezone)
(require 'message)
+(eval-and-compile
+ (autoload 'nnmail-date-to-time "nnmail"))
+
(defun gnus-boundp (variable)
"Return non-nil if VARIABLE is bound and non-nil."
(and (boundp variable)
(defsubst gnus-functionp (form)
"Return non-nil if FORM is funcallable."
(or (and (symbolp form) (fboundp form))
- (and (listp form) (eq (car form) 'lambda))))
+ (and (listp form) (eq (car form) 'lambda))
+ (compiled-function-p form)))
(defsubst gnus-goto-char (point)
(and point (goto-char point)))
(defun gnus-byte-code (func)
"Return a form that can be `eval'ed based on FUNC."
(let ((fval (symbol-function func)))
- (if (byte-code-function-p fval)
+ (if (compiled-function-p fval)
(let ((flist (append fval nil)))
(setcar flist 'byte-code)
flist)
(date (mapcar (lambda (d) (and d (string-to-int d))) parse))
(time (mapcar 'string-to-int (timezone-parse-time (aref parse 3)))))
(encode-time (caddr time) (cadr time) (car time)
- (caddr date) (cadr date) (car date) (nth 4 date))))
+ (caddr date) (cadr date) (car date)
+ (* 60 (timezone-zone-to-minute (nth 4 date))))))
(defun gnus-time-minus (t1 t2)
"Subtract two internal times."
(defun gnus-completing-read (default prompt &rest args)
;; Like `completing-read', except that DEFAULT is the default argument.
- (let* ((prompt (if default
+ (let* ((prompt (if default
(concat prompt " (default " default ") ")
(concat prompt " ")))
(answer (apply 'completing-read prompt args)))
(defsubst gnus-time-iso8601 (time)
"Return a string of TIME in YYMMDDTHHMMSS format."
(format-time-string "%Y%m%dT%H%M%S" time))
-
+
(defun gnus-date-iso8601 (header)
"Convert the date field in HEADER to YYMMDDTHHMMSS"
(condition-case ()
- (gnus-time-iso8601 (gnus-date-get-time (mail-header-date header)))
+ (gnus-time-iso8601 (gnus-date-get-time header))
(error "")))
(defun gnus-mode-string-quote (string)
If N, return the Nth ancestor instead."
(when references
(let ((ids (inline (gnus-split-references references))))
- (car (last ids (or n 1))))))
+ (while (nthcdr (or n 1) ids)
+ (setq ids (cdr ids)))
+ (car ids))))
-(defun gnus-buffer-live-p (buffer)
+(defsubst gnus-buffer-live-p (buffer)
"Say whether BUFFER is alive or not."
(and buffer
(get-buffer buffer)
(goto-char orig)
;; Scroll horizontally to center (sort of) the point.
(if (> max (window-width))
- (set-window-hscroll
+ (set-window-hscroll
(get-buffer-window (current-buffer) t)
(min (- (current-column) (/ (window-width) 3))
(+ 2 (- max (window-width)))))
Timezone package is used."
(condition-case ()
(progn
- (setq date (inline (timezone-fix-time
- date nil
+ (setq date (inline (timezone-fix-time
+ date nil
(aref (inline (timezone-parse-date date)) 4))))
(inline
(timezone-make-sortable-date
(timezone-make-time-string
(aref date 3) (aref date 4) (aref date 5))))))
(error "")))
-
+
(defun gnus-copy-file (file &optional to)
"Copy FILE to TO."
(interactive
(defun gnus-kill-all-overlays ()
"Delete all overlays in the current buffer."
- (when (fboundp 'overlay-lists)
+ (unless gnus-xemacs
(let* ((overlayss (overlay-lists))
(buffer-read-only nil)
- (overlays (nconc (car overlayss) (cdr overlayss))))
+ (overlays (delq nil (nconc (car overlayss) (cdr overlayss)))))
(while overlays
(delete-overlay (pop overlays))))))
(defun gnus-make-sort-function (funs)
"Return a composite sort condition based on the functions in FUNC."
- (cond
+ (cond
((not (listp funs)) funs)
((null funs) funs)
((cdr funs)
;;; Functions for saving to babyl/mail files.
+(defvar rmail-default-rmail-file)
(defun gnus-output-to-rmail (filename &optional ask)
"Append the current article to an Rmail file named FILENAME."
(require 'rmail)