comparison lisp/mail/rmailout.el @ 13054:b2df0396fae2

(rmail-file-p): Function moved to mail-utils.el and renamed to mail-file-babyl-p. (rmail-output, rmail-output-to-rmail-file): Use new name.
author Richard M. Stallman <rms@gnu.org>
date Thu, 21 Sep 1995 20:20:11 +0000
parents c0afdaf34c6f
children 83f275dcd93a
comparison
equal deleted inserted replaced
13053:621d48117fde 13054:b2df0396fae2
82 (prefix-numeric-value current-prefix-arg)))) 82 (prefix-numeric-value current-prefix-arg))))
83 (or count (setq count 1)) 83 (or count (setq count 1))
84 (setq file-name 84 (setq file-name
85 (expand-file-name file-name 85 (expand-file-name file-name
86 (file-name-directory rmail-default-rmail-file))) 86 (file-name-directory rmail-default-rmail-file)))
87 (if (and (file-readable-p file-name) (not (rmail-file-p file-name))) 87 (if (and (file-readable-p file-name) (not (mail-file-babyl-p file-name)))
88 (rmail-output file-name count) 88 (rmail-output file-name count)
89 (rmail-maybe-set-message-counters) 89 (rmail-maybe-set-message-counters)
90 (setq file-name (abbreviate-file-name file-name)) 90 (setq file-name (abbreviate-file-name file-name))
91 (or (get-file-buffer file-name) 91 (or (get-file-buffer file-name)
92 (file-exists-p file-name) 92 (file-exists-p file-name)
190 (while (re-search-forward rmail-fields-not-to-output end t) 190 (while (re-search-forward rmail-fields-not-to-output end t)
191 (beginning-of-line) 191 (beginning-of-line)
192 (delete-region (point) 192 (delete-region (point)
193 (progn (forward-line 1) (point))))))))) 193 (progn (forward-line 1) (point)))))))))
194 194
195 ;; Returns t if file FILE is an Rmail file.
196 ;;;###autoload
197 (defun rmail-file-p (file)
198 (let ((buf (generate-new-buffer " *rmail-file-p*")))
199 (unwind-protect
200 (save-excursion
201 (set-buffer buf)
202 (insert-file-contents file nil 0 100)
203 (looking-at "BABYL OPTIONS:"))
204 (kill-buffer buf))))
205
206 ;;; There are functions elsewhere in Emacs that use this function; check 195 ;;; There are functions elsewhere in Emacs that use this function; check
207 ;;; them out before you change the calling method. 196 ;;; them out before you change the calling method.
208 (defun rmail-output (file-name &optional count noattribute from-gnus) 197 (defun rmail-output (file-name &optional count noattribute from-gnus)
209 "Append this message to system-inbox-format mail file named FILE-NAME. 198 "Append this message to system-inbox-format mail file named FILE-NAME.
210 A prefix argument N says to output N consecutive messages 199 A prefix argument N says to output N consecutive messages
253 (or count (setq count 1)) 242 (or count (setq count 1))
254 (setq file-name 243 (setq file-name
255 (expand-file-name file-name 244 (expand-file-name file-name
256 (and rmail-default-file 245 (and rmail-default-file
257 (file-name-directory rmail-default-file)))) 246 (file-name-directory rmail-default-file))))
258 (if (and (file-readable-p file-name) (rmail-file-p file-name)) 247 (if (and (file-readable-p file-name) (mail-file-babyl-p file-name))
259 (rmail-output-to-rmail-file file-name count) 248 (rmail-output-to-rmail-file file-name count)
260 (let ((orig-count count) 249 (let ((orig-count count)
261 (rmailbuf (current-buffer)) 250 (rmailbuf (current-buffer))
262 (case-fold-search t) 251 (case-fold-search t)
263 (tembuf (get-buffer-create " rmail-output")) 252 (tembuf (get-buffer-create " rmail-output"))