+Sat Jan 23 14:23:27 1999 Lars Magne Ingebrigtsen <larsi@menja.ifi.uio.no>
+
+ * gnus.el: Pterodactyl Gnus v0.73 is released.
+
+1999-01-23 11:38:36 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * nnmail.el (nnmail-spool-file): Changed to use mail-source.
+ (nnmail-crash-box, nnmail-use-procmail, nnmail-procmail-directory,
+ nnmail-procmail-suffix, nnmail-resplit-incoming): Removed.
+ (nnmail-movemail-program): Removed.
+ (nnmail-movemail-args): Removed.
+ (nnmail-pop-password-required): Ditto.
+ (nnmail-tmp-directory): Ditto.
+ (nnmail-delete-incoming): Removed.
+ (nnmail-pop-password, nnmail-moved-inboxes,
+ nnmail-internal-password, nnmail-move-inbox): Removed.
+ (nnmail-read-passwd): Ditto.
+ (nnmail-get-spool-files): Removed.
+ (nnmail-resplit-incoming): Reinstated.
+
+ * mail-source.el: New file.
+
+1999-01-23 09:08:31 James H. Cloos, Jr. <cloos@jhcloos.com>
+
+ * gnus-art.el (gnus-article-mode-map): Bind backspace.
+
+1999-01-23 09:05:04 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-art.el (article-make-date-line): Fix iso8601 display.
+
+1999-01-20 02:53:52 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-art.el (gnus-treat-display-smileys): Check xpm.
+
+ * gnus-picon.el (gnus-group-display-picons): Goto body.
+
+ * gnus.el: Indented all functions; broke long lines; changed all
+ instances of illegal/legal to invalid/valid. Yes, I'm bored.
+
Wed Jan 20 00:50:53 1999 Lars Magne Ingebrigtsen <larsi@menja.ifi.uio.no>
* gnus.el: Pterodactyl Gnus v0.72 is released.
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
;; Create Date: Oct 1, 1998
-;; $Revision: 1.1.1.7 $
+;; $Revision: 1.1.1.8 $
;; Time-stamp: <Tue Oct 6 23:48:38 EDT 1998 zsh>
;; Keywords: binhex
:group 'gnus-article-treat
:type gnus-article-treat-custom)
-(defcustom gnus-treat-display-smileys (if gnus-xemacs t nil)
+(defcustom gnus-treat-display-smileys (if (and gnus-xemacs
+ (featurep 'xpm))
+ t nil)
"Display smileys."
:group 'gnus-article-treat
:type gnus-article-treat-custom)
((eq type 'iso8601)
(concat
"Date: "
- (format-time-string "%Y%M%DT%h%m%s" time)))
+ (format-time-string "%Y%m%dT%H%M%S" time)))
;; Do an X-Sent lapsed format.
((eq type 'lapsed)
;; If the date is seriously mangled, the timezone functions are
" " gnus-article-goto-next-page
"\177" gnus-article-goto-prev-page
[delete] gnus-article-goto-prev-page
+ [backspace] gnus-article-goto-prev-page
"\C-c^" gnus-article-refer-article
"h" gnus-article-show-summary
"s" gnus-article-show-summary
integer))
(defcustom gnus-cite-prefix-regexp
- "^[]>|:}+ ]*[]>|:}+]\\(.*>\\)?\\|^.*>"
+ "^[]>»|:}+ ]*[]>»|:}+]\\(.*>»\\)?\\|^.*>"
"*Regexp matching the longest possible citation prefix on a line."
:group 'gnus-cite
:type 'regexp)
gnus-level-default-subscribed))
s)))))
(unless (and (>= level 1) (<= level gnus-level-killed))
- (error "Illegal level: %d" level))
+ (error "Invalid level: %d" level))
(let ((groups (gnus-group-process-prefix n))
group)
(while (setq group (pop groups))
(gnus-make-hashtable-from-newsrc-alist)
(gnus-group-list-groups)))
(t
- (error "Can't kill; illegal level: %d" level))))
+ (error "Can't kill; invalid level: %d" level))))
(defun gnus-group-list-all-groups (&optional arg)
"List all newsgroups with level ARG or lower.
(setq beg (point))
(setq form (ignore-errors (read (current-buffer)))))
(unless (listp form)
- (error "Illegal kill entry (possibly rn kill file?): %s" form))
+ (error "Invalid kill entry (possibly rn kill file?): %s" form))
(if (or (eq (car form) 'gnus-kill)
(eq (car form) 'gnus-raise)
(eq (car form) 'gnus-lower))
((memq type '(s S string String))
'search-forward)
(t
- (error "Illegal match type: %s" type)))))
+ (error "Invalid match type: %s" type)))))
(goto-char (point-min))
(prog1
(funcall search-func match nil t)
(defcustom gnus-picons-display-where 'picons
"Where to display the group and article icons.
-Legal values are `article' and `picons'."
+Valid values are `article' and `picons'."
:type '(choice symbol string)
:group 'picons)
(gnus-put-text-property
(match-beginning 0) (match-end 0)
'invisible t)
- (goto-char (point-min))
- (search-forward "\n\n")
+ (article-goto-body)
(backward-char 1))))
(if (null gnus-picons-piconsearch-url)
(gnus-picons-display-pairs
;; dbs
"^\\(" (mapconcat 'identity dbs "\\|") "\\)/"
;; host
- "\\(\\(" (replace-in-string host "\\." "/\\|" t) "/\\|MISC/\\)*\\)"
+ "\\(\\(" (replace-in-string host "\\." "/\\|" t)
+ "/\\|MISC/\\)*\\)"
;; user
"\\(" (regexp-quote user) "\\|unknown\\)/"
"face\\."))
;; only do the job if it has not been preempted.
(if (equal gnus-picons-job-already-running
(list sym-ann 'picon url part right-p marker))
- (gnus-picons-network-display-internal sym-ann glyph part right-p marker)
+ (gnus-picons-network-display-internal
+ sym-ann glyph part right-p marker)
(gnus-picons-next-job-internal))))
(defun gnus-picons-network-display (url part sym-ann right-p marker)
(gnus-score-kill-help-buffer)
(unless (setq entry (assq (downcase hchar) char-to-header))
(if mimic (error "%c %c" prefix hchar)
- (error "Illegal header type")))
+ (error "Invalid header type")))
(when (/= (downcase hchar) hchar)
;; This was a majuscule, so we end reading and set the defaults.
(gnus-score-kill-help-buffer)
(unless (setq type (nth 1 (assq (downcase tchar) legal-types)))
(if mimic (error "%c %c" prefix hchar)
- (error "Illegal match type"))))
+ (error "Invalid match type"))))
(when (/= (downcase tchar) tchar)
;; It was a majuscule, so we end reading and use the default.
(error "You rang?"))
(if mimic
(error "%c %c %c %c" prefix hchar tchar pchar)
- (error "Illegal match duration"))))
+ (error "Invalid match duration"))))
;; Always kill the score help buffer.
(gnus-score-kill-help-buffer))
err
(cond
((not (listp (car a)))
- (format "Illegal score element %s in %s" (car a) file))
+ (format "Invalid score element %s in %s" (car a) file))
((stringp (caar a))
(cond
((not (listp (setq sr (cdar a))))
- (format "Illegal header match %s in %s" (nth 1 (car a)) file))
+ (format "Invalid header match %s in %s" (nth 1 (car a)) file))
(t
(setq type (caar a))
(while (and sr (not err))
((if (member (downcase type) '("lines" "chars"))
(not (numberp (car s)))
(not (stringp (car s))))
- (format "Illegal match %s in %s" (car s) file))
+ (format "Invalid match %s in %s" (car s) file))
((and (cadr s) (not (integerp (cadr s))))
(format "Non-integer score %s in %s" (cadr s) file))
((and (caddr s) (not (integerp (caddr s))))
(match-func (if (or (eq type '>) (eq type '<) (eq type '<=)
(eq type '>=) (eq type '=))
type
- (error "Illegal match type: %s" type)))
+ (error "Invalid match type: %s" type)))
(articles gnus-scores-articles))
;; Instead of doing all the clever stuff that
;; `gnus-score-string' does to minimize searches and stuff,
((eq type 'regexp)
(setq match-func 'string-match
match (nth 0 kill)))
- (t (error "Illegal match type: %s" type)))
+ (t (error "Invalid match type: %s" type)))
;; Instead of doing all the clever stuff that
;; `gnus-score-string' does to minimize searches and stuff,
;; I will assume that people generally will put so few
(eq type 'string) (eq type 'String))
'search-forward)
(t
- (error "Illegal match type: %s" type)))))
+ (error "Invalid match type: %s" type)))))
(goto-char (point-min))
(when (funcall search-func match nil t)
;; Found a match, update scores.
(search-func
(cond ((= dmt ?r) 're-search-forward)
((or (= dmt ?e) (= dmt ?s) (= dmt ?f)) 'search-forward)
- (t (error "Illegal match type: %s" type))))
+ (t (error "Invalid match type: %s" type))))
arts art)
(goto-char (point-min))
(if (= dmt ?e)
(mt (aref (symbol-name type) 0))
(case-fold-search (not (memq mt '(?R ?S ?E ?F))))
(dmt (downcase mt))
- ; Assume user already simplified regexp and fuzzies
+ ;; Assume user already simplified regexp and fuzzies
(match (if (and simplify (not (memq dmt '(?f ?r))))
(gnus-map-function
gnus-simplify-subject-functions
(cond ((= dmt ?r) 're-search-forward)
((or (= dmt ?e) (= dmt ?s) (= dmt ?f)) 'search-forward)
((= dmt ?w) nil)
- (t (error "Illegal match type: %s" type)))))
+ (t (error "Invalid match type: %s" type)))))
;; Evil hackery to make match usable in non-standard headers.
(when extra
- (setq match (concat "[ (](" extra " \\. \"[^)]*" match "[^(]*\")[ )]")
+ (setq match (concat "[ (](" extra " \\. \"[^)]*"
+ match "[^(]*\")[ )]")
search-func 're-search-forward)) ; XXX danger?!?
(cond
;; Then we want to peel off any elements that are higher
;; than the upper active limit.
(let ((srange range))
- ;; Go past all legal elements.
+ ;; Go past all valid elements.
(while (and (cdr srange)
(<= (or (and (atom (cadr srange))
(cadr srange))
(cdr active)))
(setq srange (cdr srange)))
(when (cdr srange)
- ;; Nuke all remaining illegal elements.
+ ;; Nuke all remaining invalid elements.
(setcdr srange nil))
;; Adjust the final element.
(symbolp group)
(set group nil))
(unless ignore-errors
- (gnus-message 3 "Warning - illegal active: %s"
+ (gnus-message 3 "Warning - invalid active: %s"
(buffer-substring
(gnus-point-at-bol) (gnus-point-at-eol))))))
(widen)
(buffer-substring (gnus-point-at-bol)
(gnus-point-at-eol))))
nil))
- ;; Skip past ", ". Spaces are illegal in these ranges, but
+ ;; Skip past ", ". Spaces are invalid in these ranges, but
;; we allow them, because it's a common mistake to put a
;; space after the comma.
(skip-chars-forward ", "))
(defun gnus-summary-last-article-p (&optional article)
"Return whether ARTICLE is the last article in the buffer."
(if (not (setq article (or article (gnus-summary-article-number))))
- t ; All non-existent numbers are the last article. :-)
+ ;; All non-existent numbers are the last article. :-)
+ t
(not (cdr (gnus-data-find-list article)))))
(defun gnus-make-thread-indent-array ()
out))
(defun gnus-adjust-marked-articles (info)
- "Set all article lists and remove all marks that are no longer legal."
+ "Set all article lists and remove all marks that are no longer valid."
(let* ((marked-lists (gnus-info-marks info))
(active (gnus-active (gnus-info-group info)))
(min (car active))
(active (gnus-active group))
ninfo)
(when entry
- ;; First peel off all illegal article numbers.
+ ;; First peel off all invalid article numbers.
(when active
(let ((ids articles)
id first)
The difference between N and the actual number of articles marked is
returned."
(interactive "p")
- (gnus-summary-mark-forward (- n) gnus-del-mark gnus-inhibit-user-auto-expire))
+ (gnus-summary-mark-forward
+ (- n) gnus-del-mark gnus-inhibit-user-auto-expire))
(defun gnus-summary-mark-as-read (&optional article mark)
"Mark current article as read.
;;; Generating group buffers
-(defun gnus-group-prepare-topics (level &optional all lowest regexp list-topic topic-level)
+(defun gnus-group-prepare-topics (level &optional all lowest
+ regexp list-topic topic-level)
"List all newsgroups with unread articles of level LEVEL or lower.
Use the `gnus-group-topics' to sort the groups.
If ALL is non-nil, list groups that have no unread articles.
;;; Various
-(defvar gnus-group-buffer) ; Compiler directive
+(defvar gnus-group-buffer) ; Compiler directive
(defun gnus-alive-p ()
"Say whether Gnus is running or not."
(and (boundp 'gnus-group-buffer)
(defvar gnus-uu-shar-begin-string "^#! */bin/sh")
(defvar gnus-uu-shar-file-name nil)
-(defvar gnus-uu-shar-name-marker "begin [0-7][0-7][0-7][ \t]+\\(\\(\\w\\|\\.\\)*\\b\\)")
+(defvar gnus-uu-shar-name-marker
+ "begin [0-7][0-7][0-7][ \t]+\\(\\(\\w\\|\\.\\)*\\b\\)")
(defvar gnus-uu-postscript-begin-string "^%!PS-")
(defvar gnus-uu-postscript-end-string "^%%EOF$")
(let ((buffer (cond ((stringp type) type)
(t (cdr (assq type gnus-window-to-buffer))))))
(unless buffer
- (error "Illegal buffer type: %s" type))
+ (error "Invalid buffer type: %s" type))
(switch-to-buffer (gnus-get-buffer-create
(gnus-window-to-buffer-helper buffer)))
(when (memq 'frame-focus split)
((integerp size)
(setq s size))
(t
- (error "Illegal size: %s" size)))
+ (error "Invalid size: %s" size)))
;; Try to make sure that we are inside the safe limits.
(cond ((zerop s))
((eq type 'horizontal)
(setq buffer (cond ((stringp type) type)
(t (cdr (assq type gnus-window-to-buffer)))))
(unless buffer
- (error "Illegal buffer type: %s" type))
+ (error "Invalid buffer type: %s" type))
(if (and (setq buf (get-buffer (gnus-window-to-buffer-helper buffer)))
(setq win (get-buffer-window buf t)))
(if (memq 'point split)
'default-toolbar
nil)
"*If nil, do not use a toolbar.
-If it is non-nil, it must be a toolbar. The five legal values are
+If it is non-nil, it must be a toolbar. The five valid values are
`default-toolbar', `top-toolbar', `bottom-toolbar',
`right-toolbar', and `left-toolbar'."
:type '(choice (const default-toolbar)
;;; gnus.el --- a newsreader for GNU Emacs
-;; Copyright (C) 1987,88,89,90,93,94,95,96,97,98,99 Free Software Foundation, Inc.
+;; Copyright (C) 1987-1990,1993-1999 Free Software Foundation, Inc.
;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
;; Lars Magne Ingebrigtsen <larsi@gnus.org>
:link '(custom-manual "(gnus)Exiting Gnus")
:group 'gnus)
-(defconst gnus-version-number "0.72"
+(defconst gnus-version-number "0.73"
"Version number for this version of Gnus.")
(defconst gnus-version (format "Pterodactyl Gnus v%s" gnus-version-number)
,(nnheader-concat gnus-cache-directory "active"))))
"List of predefined (convenience) servers.")
-(defvar gnus-topic-indentation "") ;; Obsolete variable.
+(defvar gnus-topic-indentation "");; Obsolete variable.
(defconst gnus-article-mark-lists
'((marked . tick) (replied . reply)
The %U (status), %R (replied) and %z (zcore) specs have to be handled
with care. For reasons of efficiency, Gnus will compute what column
these characters will end up in, and \"hard-code\" that. This means that
-it is illegal to have these specs after a variable-length spec. Well,
+it is invalid to have these specs after a variable-length spec. Well,
you might not be arrested, but your summary buffer will look strange,
which is bad enough.
(defun gnus-read-group (prompt &optional default)
"Prompt the user for a group name.
-Disallow illegal group names."
+Disallow invalid group names."
(let ((prefix "")
group)
(while (not group)
(setq group (read-string (concat prefix prompt)
(cons (or default "") 0)
'gnus-group-history)))
- (setq prefix (format "Illegal group name: \"%s\". " group)
+ (setq prefix (format "Invalid group name: \"%s\". " group)
group nil)))
group))
--- /dev/null
+;;; mail-source.el --- functions for fetching mail
+;; Copyright (C) 1999 Free Software Foundation, Inc.
+
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Keywords: news, mail
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+(eval-and-compile
+ (autoload 'pop3-movemail "pop3"))
+
+(defgroup mail-source nil
+ "The mail-fetching library."
+ :group 'gnus)
+
+(defcustom mail-source-movemail-program "movemail"
+ "*A command to be executed to move mail from the inbox.
+The default is \"movemail\".
+
+This can also be a function. In that case, the function will be
+called with two parameters -- the name of the INBOX file, and the file
+to be moved to."
+ :group 'mail-source
+ :type '(choice string
+ function))
+
+(defcustom mail-source-movemail-args nil
+ "*Extra arguments to give to `mail-source-movemail-program' to move mail from the inbox.
+The default is nil."
+ :group 'mail-source
+ :type '(choice string
+ (constant nil)))
+
+(defcustom mail-source-crash-box "~/.emacs-mail-crash-box"
+ "File where mail will be stored while processing it."
+ :group 'mail-source
+ :type 'file)
+
+(defcustom mail-source-directory "~/Mail/"
+ "Directory where files (if any) will be stored."
+ :group 'mail-source
+ :type 'directory)
+
+(defcustom mail-source-default-file-modes 384
+ "Set the mode bits of all new mail files to this integer."
+ :group 'mail-source
+ :type 'integer)
+
+(defcustom mail-source-delete-incoming nil
+ "*If non-nil, delete incoming files after handling."
+ :group 'mail-source
+ :type 'boolean)
+
+;;; Internal variables.
+
+(eval-and-compile
+ (defvar mail-source-keyword-map
+ '((file
+ (:path (or (getenv "MAIL")
+ (concat "/usr/spool/mail/" (user-login-name)))))
+ (directory
+ (:path)
+ (:suffix ".spool")
+ (:match))
+ (pop
+ (:server (getenv "MAILHOST"))
+ (:port "pop3")
+ (:user (or (user-login-name) (getenv "LOGNAME") (getenv "USER")))
+ (:password))
+ (maildir
+ (:path)))
+ "Mapping from keywords to default values.
+All keywords that can be used must be listed here."))
+
+(defvar mail-source-fetcher-alist
+ '((file mail-source-fetch-file)
+ (directory mail-source-fetch-directory)
+ (pop mail-source-fetch-pop)
+ (qmail mail-source-fetch-qmail))
+ "A mapping from source type to fetcher function.")
+
+(defvar mail-source-password-cache nil)
+
+;;; Functions
+
+(eval-and-compile
+ (defun mail-source-strip-keyword (keyword)
+ "Strip the leading colon off the KEYWORD."
+ (intern (substring (symbol-name keyword) 1))))
+
+(eval-when-compile
+ (defun mail-source-bind-1 (type)
+ (let* ((defaults (cdr (assq type mail-source-keyword-map)))
+ default bind)
+ (while (setq default (pop defaults))
+ (push (list (mail-source-strip-keyword (car default))
+ nil)
+ bind))
+ bind)))
+
+(defmacro mail-source-bind (type source &rest body)
+ "Bind all variables in SOURCE."
+ `(let ,(mail-source-bind-1 type)
+ (mail-source-set-1 source)
+ ,@body))
+
+(put 'mail-source-bind 'lisp-indent-function 2)
+(put 'mail-source-bind 'edebug-form-spec '(form form body))
+
+(defun mail-source-set-1 (source)
+ (let* ((type (pop source))
+ (defaults (cdr (assq type mail-source-keyword-map)))
+ default value keyword)
+ (while (setq default (pop defaults))
+ (set (mail-source-strip-keyword (setq keyword (car default)))
+ (if (setq value (plist-get source keyword))
+ (mail-source-value value)
+ (mail-source-value (cadr default)))))))
+
+(defun mail-source-value (value)
+ "Return the value of VALUE."
+ (cond
+ ;; String
+ ((stringp value)
+ value)
+ ;; Function
+ ((and (listp value)
+ (functionp (car value)))
+ (eval value))
+ ;; Variable
+ ((and (symbolp value)
+ (boundp value))
+ (symbol-value value))
+ ;; Just return the value.
+ (t
+ value)))
+
+(defun mail-source-fetch (source callback)
+ "Fetch mail from SOURCE and call CALLBACK zero or more times.
+CALLBACK will be called with the name of the file where (some of)
+the mail from SOURCE is put.
+Return the number of files that were found."
+ (let ((function (cadr (assq (car source) mail-source-fetcher-alist)))
+ (found 0))
+ (unless function
+ (error "%S is an invalid mail source specification" source))
+ ;; If there's anything in the crash box, we do it first.
+ (when (file-exists-p mail-source-crash-box)
+ (message "Processing mail from %s..." mail-source-crash-box)
+ (setq found (mail-source-callback
+ callback mail-source-crash-box)))
+ (+ found (funcall function source callback))))
+
+(defun mail-source-make-complex-temp-name (prefix)
+ (let ((newname (make-temp-name prefix))
+ (newprefix prefix))
+ (while (file-exists-p newname)
+ (setq newprefix (concat newprefix "x"))
+ (setq newname (make-temp-name newprefix)))
+ newname))
+
+(defun mail-source-callback (callback info)
+ "Call CALLBACK on the mail file, and then remove the mail file.
+Pass INFO on to CALLBACK."
+ (if (or (not (file-exists-p mail-source-crash-box))
+ (zerop (nth 7 (file-attributes mail-source-crash-box))))
+ (progn
+ (delete-file mail-source-crash-box)
+ 0)
+ (funcall callback mail-source-crash-box info)
+ (if mail-source-delete-incoming
+ (delete-file mail-source-crash-box)
+ (let ((incoming
+ (mail-source-make-complex-temp-name
+ (expand-file-name
+ "Incoming" mail-source-directory))))
+ (unless (file-exists-p (file-name-directory incoming))
+ (make-directory (file-name-directory incoming) t))
+ (rename-file mail-source-crash-box incoming t)))
+ 1))
+
+(defun mail-source-movemail (from to)
+ "Move FROM to TO using movemail."
+ (if (not (file-writable-p to))
+ (error "Can't write to crash box %s. Not moving mail" to)
+ (let ((to (file-truename (expand-file-name to)))
+ errors result)
+ (setq to (file-truename to)
+ from (file-truename from))
+ ;; Set TO if have not already done so, and rename or copy
+ ;; the file FROM to TO if and as appropriate.
+ (cond
+ ((file-exists-p to)
+ ;; The crash box exists already.
+ t)
+ ((not (file-exists-p from))
+ ;; There is no inbox.
+ (setq to nil))
+ (t
+ ;; If getting from mail spool directory, use movemail to move
+ ;; rather than just renaming, so as to interlock with the
+ ;; mailer.
+ (unwind-protect
+ (save-excursion
+ (setq errors (generate-new-buffer " *mail source loss*"))
+ (buffer-disable-undo errors)
+ (if (functionp mail-source-movemail-program)
+ (condition-case err
+ (progn
+ (funcall mail-source-movemail-program from to)
+ (setq result 0))
+ (error
+ (save-excursion
+ (set-buffer errors)
+ (insert (prin1-to-string err))
+ (setq result 255))))
+ (let ((default-directory "/"))
+ (setq result
+ (apply
+ 'call-process
+ (append
+ (list
+ (expand-file-name
+ mail-source-movemail-program exec-directory)
+ nil errors nil from to)
+ (when mail-source-movemail-args
+ mail-source-movemail-args))))))
+ (when (file-exists-p to)
+ (set-file-modes to mail-source-default-file-modes))
+ (if (and (not (buffer-modified-p errors))
+ (zerop result))
+ ;; No output => movemail won.
+ t
+ (set-buffer errors)
+ ;; There may be a warning about older revisions. We
+ ;; ignore that.
+ (goto-char (point-min))
+ (if (search-forward "older revision" nil t)
+ t
+ ;; Probably a real error.
+ (subst-char-in-region (point-min) (point-max) ?\n ?\ )
+ (goto-char (point-max))
+ (skip-chars-backward " \t")
+ (delete-region (point) (point-max))
+ (goto-char (point-min))
+ (when (looking-at "movemail: ")
+ (delete-region (point-min) (match-end 0)))
+ (unless (yes-or-no-p
+ (format "movemail: %s (%d return). Continue? "
+ (buffer-string) result))
+ (error "%s" (buffer-string)))
+ (setq to nil)))))))
+ (when (buffer-name errors)
+ (kill-buffer errors))
+ ;; Return whether we moved successfully or not.
+ to)))
+
+(defvar mail-source-read-passwd nil)
+(defun mail-source-read-passwd (prompt &rest args)
+ "Read a password using PROMPT.
+If ARGS, PROMPT is used as an argument to `format'."
+ (let ((prompt
+ (if args
+ (apply 'format prompt args)
+ prompt)))
+ (unless mail-source-read-passwd
+ (if (load "passwd" t)
+ (setq mail-source-read-passwd 'read-passwd)
+ (unless (fboundp 'ange-ftp-read-passwd)
+ (autoload 'ange-ftp-read-passwd "ange-ftp"))
+ (setq mail-source-read-passwd 'ange-ftp-read-passwd)))
+ (funcall mail-source-read-passwd prompt)))
+
+(defun mail-source-fetch-file (source callback)
+ "Fetcher for single-file sources."
+ (mail-source-bind file source
+ (if (mail-source-movemail path mail-source-crash-box)
+ (mail-source-callback callback path)
+ 0)))
+
+(defun mail-source-fetch-directory (source callback)
+ "Fetcher for directory sources."
+ (mail-source-bind directory source
+ (let ((files (directory-files
+ path t
+ (or match (concat (regexp-quote suffix) "$"))))
+ (found 0)
+ file)
+ (while (setq file (pop files))
+ (when (mail-source-movemail file mail-source-crash-box)
+ (incf found (mail-source-callback callback file))))
+ found)))
+
+(defun mail-source-fetch-pop (source callback)
+ "Fetcher for single-file sources."
+ (mail-source-bind pop source
+ (let ((from (format "%s:%s:%s" server user port)))
+ (setq password
+ (or password
+ (cdr (assoc from mail-source-password-cache))
+ (mail-source-read-passwd
+ (format "Password for %s at %s: " user server))))
+ (unless (assoc from mail-source-password-cache)
+ (push (cons from password) mail-source-password-cache))
+ (let ((pop3-password password)
+ (pop3-maildrop user)
+ (pop3-mailhost server))
+ (if (pop3-movemail mail-source-crash-box)
+ (mail-source-callback callback server)
+ ;; We nix out the password in case the error
+ ;; was because of a wrong password being given.
+ (setq mail-source-password-cache
+ (delq (assoc from mail-source-password-cache)
+ mail-source-password-cache))
+ 0)))))
+
+(provide 'mail-source)
+
+;;; mail-source.el ends here
The headers should be delimited by a line whose contents match the
variable `mail-header-separator'.
-Legal values include `message-send-mail-with-sendmail' (the default),
+Valid values include `message-send-mail-with-sendmail' (the default),
`message-send-mail-with-mh', `message-send-mail-with-qmail' and
`smtpmail-send-it'."
:type '(radio (function-item message-send-mail-with-sendmail)
(insert "\n"))
(funcall message-citation-line-function))))
-(defvar mail-citation-hook) ;Compiler directive
+(defvar mail-citation-hook) ;Compiler directive
(defun message-cite-original ()
"Cite function in the standard Message manner."
(if (and (boundp 'mail-citation-hook)
(message-check 'invisible-text
(when (text-property-any (point-min) (point-max) 'invisible t)
(put-text-property (point-min) (point-max) 'invisible nil)
- (unless (yes-or-no-p "Invisible text found and made visible; continue posting? ")
+ (unless (yes-or-no-p
+ "Invisible text found and made visible; continue posting? ")
(error "Invisible text found and made visible")))))
(defun message-add-action (action &rest types)
(replace-match "\n")
(backward-char 1))
(run-hooks 'message-send-news-hook)
- ;;(require (car method))
- ;;(funcall (intern (format "%s-open-server" (car method)))
- ;;(cadr method) (cddr method))
- ;;(setq result
- ;; (funcall (intern (format "%s-request-post" (car method)))
- ;; (cadr method)))
(gnus-open-server method)
(setq result (let ((mail-header-separator ""))
(gnus-request-post method))))
(let ((cur (current-buffer))
(subject (message-make-forward-subject))
art-beg)
- (if news (message-news nil subject) (message-mail nil subject))
+ (if news
+ (message-news nil subject)
+ (message-mail nil subject))
;; Put point where we want it before inserting the forwarded
;; message.
(if message-signature-before-forwarded-message
'default-toolbar
nil)
"*If nil, do not use a toolbar.
-If it is non-nil, it must be a toolbar. The five legal values are
+If it is non-nil, it must be a toolbar. The five valid values are
`default-toolbar', `top-toolbar', `bottom-toolbar',
`right-toolbar', and `left-toolbar'.")
;; Copyright (c) 1998 by Shenghuo Zhu <zsh@cs.rochester.edu>
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
-;; $Revision: 1.1.1.10 $
+;; $Revision: 1.1.1.11 $
;; Keywords: news postscript uudecode binhex shar
;; This file is not part of GNU Emacs, but the same permissions
"application/octet-stream"))
'x-uuencode nil
(if (and file-name (not (equal file-name "")))
- (list mm-dissect-disposition (cons 'filename file-name)))))
+ (list mm-dissect-disposition
+ (cons 'filename file-name)))))
((eq type 'binhex)
(mm-make-handle (mm-uu-copy-to-buffer start-char end-char)
(list (or (and file-name
"application/octet-stream"))
'x-binhex nil
(if (and file-name (not (equal file-name "")))
- (list mm-dissect-disposition (cons 'filename file-name)))))
+ (list mm-dissect-disposition
+ (cons 'filename file-name)))))
((eq type 'shar)
(mm-make-handle (mm-uu-copy-to-buffer start-char end-char)
'("application/x-shar"))))
(require 'nnheader)
(condition-case nil
(require 'rmail)
- (t (nnheader-message 5 "Ignore rmail errors from this file, you don't have rmail")))
+ (t (nnheader-message
+ 5 "Ignore rmail errors from this file, you don't have rmail")))
(require 'nnmail)
(require 'nnoo)
(eval-when-compile (require 'cl))
(goto-char head-begin)
(setq content-type (message-fetch-field "Content-Type"))
(when content-type
- (when (string-match "^ *\\([^ \t\n/;]+\\)/\\([^ \t\n/;]+\\)" content-type)
+ (when (string-match
+ "^ *\\([^ \t\n/;]+\\)/\\([^ \t\n/;]+\\)" content-type)
(setq type (downcase (match-string 1 content-type))
subtype (downcase (match-string 2 content-type))
message-rfc822 (and (string= type "message")
(nnmail-find-file file) ; Insert the file in the nntp buf.
(unless (nnheader-article-p) ; Either it's a real article...
(goto-char (point-min))
- (nneething-make-head file (current-buffer)) ; ... or we fake some headers.
+ (nneething-make-head
+ file (current-buffer)) ; ... or we fake some headers.
(insert "\n"))
t))))
(substring file
(match-beginning 1)
(match-end 1))
- (when (string-match "/\\(users\\|home\\)/\\([^/]+\\)/" file)
+ (when (string-match
+ "/\\(users\\|home\\)/\\([^/]+\\)/" file)
(setq login (substring file
(match-beginning 2)
(match-end 2))
(save-restriction
(narrow-to-region
(save-excursion
- (forward-line 1) ; in case point is at beginning of message already
+ ;; In case point is at the beginning of the message already.
+ (forward-line 1)
(nnmail-search-unix-mail-delim-backward)
(if leave-delim (progn (forward-line 1) (point))
(point)))
;;; nnheader.el --- header access macros for Gnus and its backends
-;; Copyright (C) 198,997,88,89,90,93,94,95,96,97,98 Free Software Foundation, Inc.
+;; Copyright (C) 1987-1990,1993-1999 Free Software Foundation, Inc.
;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
;; Lars Magne Ingebrigtsen <larsi@gnus.org>
(defvar nnheader-file-name-translation-alist nil
"*Alist that says how to translate characters in file names.
-For instance, if \":\" is illegal as a file character in file names
+For instance, if \":\" is invalid as a file character in file names
on your system, you could say something like:
\(setq nnheader-file-name-translation-alist '((?: . ?_)))")
(defun nnheader-insert-references (references message-id)
"Insert a References header based on REFERENCES and MESSAGE-ID."
(if (and (not references) (not message-id))
- () ; This is illegal, but not all articles have Message-IDs.
+ ;; This is invalid, but not all articles have Message-IDs.
+ ()
(mail-position-on-field "References")
(let ((begin (save-excursion (beginning-of-line) (point)))
(fill-column 78)
(require 'message)
(require 'custom)
(require 'gnus-util)
+(require 'mail-source)
(eval-and-compile
(autoload 'gnus-error "gnus-util")
:group 'nnmail
:type 'boolean)
-(defcustom nnmail-spool-file
- (or (getenv "MAIL")
- (concat "/usr/spool/mail/" (user-login-name)))
+(defcustom nnmail-spool-file '((file))
"*Where the mail backends will look for incoming mail.
-This variable is \"/usr/spool/mail/$user\" by default.
-If this variable is nil, no mail backends will read incoming mail.
-If this variable is a list, all files mentioned in this list will be
-used as incoming mailboxes.
-If this variable is a directory (i. e., it's name ends with a \"/\"),
-treat all files in that directory as incoming spool files."
+This variable is a list of mail source specifiers.
+If this variable is nil, no mail backends will read incoming mail."
:group 'nnmail-files
- :type '(choice (file :tag "File")
- (repeat :tag "Files" file)))
-
-(defcustom nnmail-crash-box "~/.gnus-crash-box"
- "File where Gnus will store mail while processing it."
- :group 'nnmail-files
- :type 'file)
-
-(defcustom nnmail-use-procmail nil
- "*If non-nil, the mail backends will look in `nnmail-procmail-directory' for spool files.
-The file(s) in `nnmail-spool-file' will also be read."
- :group 'nnmail-procmail
- :type 'boolean)
-
-(defcustom nnmail-procmail-directory "~/incoming/"
- "*When using procmail (and the like), incoming mail is put in this directory.
-The Gnus mail backends will read the mail from this directory."
- :group 'nnmail-procmail
- :type 'directory)
-
-(defcustom nnmail-procmail-suffix "\\.spool"
- "*Suffix of files created by procmail (and the like).
-This variable might be a suffix-regexp to match the suffixes of
-several files - eg. \".spool[0-9]*\"."
- :group 'nnmail-procmail
- :type 'regexp)
+ :type 'sexp)
(defcustom nnmail-resplit-incoming nil
"*If non-nil, re-split incoming procmail sorted mail."
(function-item copy-file)
(function :tag "Other")))
-(defcustom nnmail-movemail-program "movemail"
- "*A command to be executed to move mail from the inbox.
-The default is \"movemail\".
-
-This can also be a function. In that case, the function will be
-called with two parameters -- the name of the INBOX file, and the file
-to be moved to."
- :group 'nnmail-files
- :group 'nnmail-retrieve
- :type 'string)
-
-(defcustom nnmail-movemail-args nil
- "*Extra arguments to give to `nnmail-movemail-program' to move mail from the inbox.
-The default is nil"
- :group 'nnmail-files
- :group 'nnmail-retrieve
- :type 'string)
-
-(defcustom nnmail-pop-password-required nil
- "*Non-nil if a password is required when reading mail using POP."
- :group 'nnmail-retrieve
- :type 'boolean)
-
(defcustom nnmail-read-incoming-hook
(if (eq system-type 'windows-nt)
'(nnheader-ms-strip-cr)
:group 'nnmail-prepare
:type 'hook)
-;; Suggested by Erik Selberg <speed@cs.washington.edu>.
(defcustom nnmail-prepare-incoming-hook nil
"Hook called before treating incoming mail.
The hook is run in a buffer with all the new, incoming mail."
:group 'nnmail-split
:type 'hook)
-;; Suggested by Mejia Pablo J <pjm9806@usl.edu>.
-(defcustom nnmail-tmp-directory nil
- "*If non-nil, use this directory for temporary storage.
-Used when reading incoming mail."
- :group 'nnmail-files
- :group 'nnmail-retrieve
- :type '(choice (const :tag "default" nil)
- (directory :format "%v")))
-
(defcustom nnmail-large-newsgroup 50
"*The number of the articles which indicates a large newsgroup.
If the number of the articles is greater than the value, verbose
:group 'nnmail-split
:type '(repeat (cons :format "%v" symbol regexp)))
-(defcustom nnmail-delete-incoming nil
- "*If non-nil, the mail backends will delete incoming files after
-splitting."
- :group 'nnmail-retrieve
- :type 'boolean)
-
(defcustom nnmail-message-id-cache-length 1000
"*The approximate number of Message-IDs nnmail will keep in its cache.
If this variable is nil, no checking on duplicate messages will be
(defcustom nnmail-treat-duplicates 'warn
"*If non-nil, nnmail keep a cache of Message-IDs to discover mail duplicates.
-Three values are legal: nil, which means that nnmail is not to keep a
+Three values are valid: nil, which means that nnmail is not to keep a
Message-ID cache; `warn', which means that nnmail should insert extra
headers to warn the user about the duplication (this is the default);
and `delete', which means that nnmail will delete duplicated mails.
(defvar nnmail-current-spool nil)
-(defvar nnmail-pop-password nil
- "*Password to use when reading mail from a POP server, if required.")
-
(defvar nnmail-split-fancy-syntax-table nil
"Syntax table used by `nnmail-split-fancy'.")
(unless (syntax-table-p nnmail-split-fancy-syntax-table)
(defvar nnmail-prepare-save-mail-hook nil
"Hook called before saving mail.")
-(defvar nnmail-moved-inboxes nil
- "List of inboxes that have been moved.")
-
-(defvar nnmail-internal-password nil)
-
(defvar nnmail-split-tracing nil)
(defvar nnmail-split-trace nil)
"/")))
(or file "")))
-;; Function rewritten from rmail.el.
-(defun nnmail-move-inbox (inbox)
- "Move INBOX to `nnmail-crash-box'."
- (if (not (file-writable-p nnmail-crash-box))
- (gnus-error 1 "Can't write to crash box %s. Not moving mail"
- nnmail-crash-box)
- ;; If the crash box exists and is empty, we delete it.
- (when (and (file-exists-p nnmail-crash-box)
- (zerop (nnheader-file-size (file-truename nnmail-crash-box))))
- (delete-file nnmail-crash-box))
- (let ((tofile (file-truename (expand-file-name nnmail-crash-box)))
- (popmail (string-match "^po:" inbox))
- movemail errors result)
- (unless popmail
- (setq inbox (file-truename (expand-file-name inbox)))
- (setq movemail t)
- ;; On some systems, /usr/spool/mail/foo is a directory
- ;; and the actual inbox is /usr/spool/mail/foo/foo.
- (when (file-directory-p inbox)
- (setq inbox (expand-file-name (user-login-name) inbox))))
- (if (member inbox nnmail-moved-inboxes)
- ;; We don't try to move an already moved inbox.
- nil
- (if popmail
- (progn
- (when (and nnmail-pop-password
- (not nnmail-internal-password))
- (setq nnmail-internal-password nnmail-pop-password))
- (when (and nnmail-pop-password-required
- (not nnmail-internal-password))
- (setq nnmail-internal-password
- (nnmail-read-passwd
- (format "Password for %s: "
- (substring inbox (+ popmail 3))))))
- (nnheader-message 5 "Getting mail from the post office..."))
- (when (or (and (file-exists-p tofile)
- (/= 0 (nnheader-file-size tofile)))
- (and (file-exists-p inbox)
- (/= 0 (nnheader-file-size inbox))))
- (nnheader-message 5 "Getting mail from %s..." inbox)))
- ;; Set TOFILE if have not already done so, and
- ;; rename or copy the file INBOX to TOFILE if and as appropriate.
- (cond
- ((file-exists-p tofile)
- ;; The crash box exists already.
- t)
- ((and (not popmail)
- (not (file-exists-p inbox)))
- ;; There is no inbox.
- (setq tofile nil))
- (t
- ;; If getting from mail spool directory, use movemail to move
- ;; rather than just renaming, so as to interlock with the
- ;; mailer.
- (unwind-protect
- (save-excursion
- (setq errors (generate-new-buffer " *nnmail loss*"))
- (buffer-disable-undo errors)
- (if (nnheader-functionp nnmail-movemail-program)
- (condition-case err
- (progn
- (funcall nnmail-movemail-program inbox tofile)
- (setq result 0))
- (error
- (save-excursion
- (set-buffer errors)
- (insert (prin1-to-string err))
- (setq result 255))))
- (let ((default-directory "/"))
- (setq result
- (apply
- 'call-process
- (append
- (list
- (expand-file-name
- nnmail-movemail-program exec-directory)
- nil errors nil inbox tofile)
- (when nnmail-internal-password
- (list nnmail-internal-password))
- (when nnmail-movemail-args
- nnmail-movemail-args))))))
- (push inbox nnmail-moved-inboxes)
- (if (and (not (buffer-modified-p errors))
- (zerop result))
- ;; No output => movemail won
- (progn
- (unless popmail
- (when (file-exists-p tofile)
- (set-file-modes tofile nnmail-default-file-modes))))
- (set-buffer errors)
- ;; There may be a warning about older revisions. We
- ;; ignore those.
- (goto-char (point-min))
- (if (search-forward "older revision" nil t)
- (progn
- (unless popmail
- (when (file-exists-p tofile)
- (set-file-modes
- tofile nnmail-default-file-modes))))
- ;; Probably a real error.
- ;; We nix out the password in case the error
- ;; was because of a wrong password being given.
- (setq nnmail-internal-password nil)
- (subst-char-in-region (point-min) (point-max) ?\n ?\ )
- (goto-char (point-max))
- (skip-chars-backward " \t")
- (delete-region (point) (point-max))
- (goto-char (point-min))
- (when (looking-at "movemail: ")
- (delete-region (point-min) (match-end 0)))
- (unless (yes-or-no-p
- (format "movemail: %s (%d return). Continue? "
- (buffer-string) result))
- (error "%s" (buffer-string)))
- (setq tofile nil)))))))
- (nnheader-message 5 "Getting mail from %s...done" inbox)
- (and errors
- (buffer-name errors)
- (kill-buffer errors))
- tofile))))
-
(defun nnmail-get-active ()
"Returns an assoc of group names and active ranges.
nn*-request-list should have been called before calling this function."
(insert (format "%s %d %d y\n" (car group) (cdadr group)
(caadr group))))))
-(defun nnmail-get-split-group (file group)
+(defun nnmail-get-split-group (file source)
"Find out whether this FILE is to be split into GROUP only.
-If GROUP is non-nil and we are using procmail, return the group name
-only when the file is the correct procmail file. When GROUP is nil,
-return nil if FILE is a spool file or the procmail group for which it
-is a spool. If not using procmail, return GROUP."
- (if (or (eq nnmail-spool-file 'procmail)
- nnmail-use-procmail)
- (if (string-match (concat "^" (regexp-quote
- (expand-file-name
- (file-name-as-directory
- nnmail-procmail-directory)))
- "\\([^/]*\\)"
- nnmail-procmail-suffix "$")
- (expand-file-name file))
- (let ((procmail-group (substring (expand-file-name file)
- (match-beginning 1)
- (match-end 1))))
- (if group
- (if (string-equal group procmail-group)
- group
- nil)
- procmail-group))
- nil)
- group))
+If SOURCE is a directory spec, try to return the group name component."
+ (if (eq (car source) 'directory)
+ (let ((file (file-name-nondirectory file)))
+ (mail-source-bind directory source
+ (if (string-match (concat (regexp-quote suffix "$") file))
+ (substring file 0 (match-beginning 0))
+ nil)))
+ nil))
(defun nnmail-process-babyl-mail-format (func artnum-func)
(let ((case-fold-search t)
(let (;; If this is a group-specific split, we bind the split
;; methods to just this group.
(nnmail-split-methods (if (and group
- (or (eq nnmail-spool-file 'procmail)
- nnmail-use-procmail)
(not nnmail-resplit-incoming))
(list (list group ""))
nnmail-split-methods)))
;;; Utility functions
-(defun nnmail-make-complex-temp-name (prefix)
- (let ((newname (make-temp-name prefix))
- (newprefix prefix))
- (while (file-exists-p newname)
- (setq newprefix (concat newprefix "x"))
- (setq newname (make-temp-name newprefix)))
- newname))
-
-;; Written by Per Abrahamsen <amanda@iesd.auc.dk>.
-
(defun nnmail-split-fancy ()
"Fancy splitting method.
See the documentation for the variable `nnmail-split-fancy' for documentation."
(apply 'concat (nreverse expanded))
newtext)))
-;; Get a list of spool files to read.
-(defun nnmail-get-spool-files (&optional group)
- (if (null nnmail-spool-file)
- ;; No spool file whatsoever.
- nil
- (let* ((procmails
- ;; If procmail is used to get incoming mail, the files
- ;; are stored in this directory.
- (and (file-exists-p nnmail-procmail-directory)
- (or (eq nnmail-spool-file 'procmail)
- nnmail-use-procmail)
- (directory-files
- nnmail-procmail-directory
- t (concat (if group (concat "^" (regexp-quote group)) "")
- nnmail-procmail-suffix "$"))))
- (p procmails)
- (crash (when (and (file-exists-p nnmail-crash-box)
- (> (nnheader-file-size
- (file-truename nnmail-crash-box))
- 0))
- (list nnmail-crash-box))))
- ;; Remove any directories that inadvertently match the procmail
- ;; suffix, which might happen if the suffix is "".
- (while p
- (when (file-directory-p (car p))
- (setq procmails (delete (car p) procmails)))
- (setq p (cdr p)))
- ;; Return the list of spools.
- (append
- crash
- (cond ((and group
- (or (eq nnmail-spool-file 'procmail)
- nnmail-use-procmail)
- procmails)
- procmails)
- ((and group
- (eq nnmail-spool-file 'procmail))
- nil)
- ((listp nnmail-spool-file)
- (nconc
- (apply
- 'nconc
- (mapcar
- (lambda (file)
- (if (and (not (string-match "^po:" file))
- (file-directory-p file))
- (nnheader-directory-regular-files file)
- (list file)))
- nnmail-spool-file))
- procmails))
- ((stringp nnmail-spool-file)
- (if (and (not (string-match "^po:" nnmail-spool-file))
- (file-directory-p nnmail-spool-file))
- (nconc
- (nnheader-directory-regular-files nnmail-spool-file)
- procmails)
- (cons nnmail-spool-file procmails)))
- ((eq nnmail-spool-file 'pop)
- (cons (format "po:%s" (user-login-name)) procmails))
- (t
- procmails))))))
-
;; Activate a backend only if it isn't already activated.
;; If FORCE, re-read the active file even if the backend is
;; already activated.
(defun nnmail-get-new-mail (method exit-func temp
&optional group spool-func)
"Read new incoming mail."
- (let* ((spools (nnmail-get-spool-files group))
+ (let* ((sources (if (listp nnmail-spool-file) nnmail-spool-file
+ (list nnmail-spool-file)))
(group-in group)
- nnmail-current-spool incoming incomings spool)
+ (i 0)
+ nnmail-current-spool incoming incomings source)
(when (and (nnmail-get-value "%s-get-new-mail" method)
nnmail-spool-file)
;; We first activate all the groups.
(run-hooks 'nnmail-pre-get-new-mail-hook)
;; Open the message-id cache.
(nnmail-cache-open)
- ;; The we go through all the existing spool files and split the
- ;; mail from each.
- (while spools
- (setq spool (pop spools))
- ;; We read each spool file if either the spool is a POP-mail
- ;; spool, or the file exists. We can't check for the
- ;; existence of POPped mail.
- (when (or (string-match "^po:" spool)
- (and (file-exists-p (file-truename spool))
- (> (nnheader-file-size (file-truename spool)) 0)))
- (nnheader-message 3 "%s: Reading incoming mail..." method)
- (when (and (nnmail-move-inbox spool)
- (file-exists-p nnmail-crash-box))
- (setq nnmail-current-spool spool)
- ;; There is new mail. We first find out if all this mail
- ;; is supposed to go to some specific group.
- (setq group (nnmail-get-split-group spool group-in))
- ;; We split the mail
- (nnmail-split-incoming
- nnmail-crash-box (intern (format "%s-save-mail" method))
- spool-func group (intern (format "%s-active-number" method)))
- ;; Check whether the inbox is to be moved to the special tmp dir.
- (setq incoming
- (nnmail-make-complex-temp-name
- (expand-file-name
- (if nnmail-tmp-directory
- (concat
- (file-name-as-directory nnmail-tmp-directory)
- (file-name-nondirectory
- (concat (file-name-as-directory temp) "Incoming")))
- (concat (file-name-as-directory temp) "Incoming")))))
- (unless (file-exists-p (file-name-directory incoming))
- (make-directory (file-name-directory incoming) t))
- (rename-file nnmail-crash-box incoming t)
- (push incoming incomings))))
+ ;; The we go through all the existing mail source specification
+ ;; and fetch the mail from each.
+ (while (setq source (pop sources))
+ ;; Be compatible with old values.
+ (when (stringp source)
+ (setq source
+ (cond
+ ((string-match "^po:" source)
+ (list 'pop :user (substring source (match-end 0))))
+ ((file-directory-p source)
+ (list 'directory :path source))
+ (t
+ (list 'file :path source)))))
+ (nnheader-message 3 "%s: Reading incoming mail %S..." method source)
+ (when (mail-source-fetch
+ source
+ `(lambda (file orig-file)
+ (nnmail-split-incoming
+ file ',(intern (format "%s-save-mail" method))
+ ',spool-func (nnmail-get-split-group orig-file source)
+ ',(intern (format "%s-active-number" method)))))
+ (incf i)))
;; If we did indeed read any incoming spools, we save all info.
- (when incomings
+ (unless (zerop i)
(nnmail-save-active
(nnmail-get-value "%s-group-alist" method)
(nnmail-get-value "%s-active-file" method))
;; Close the message-id cache.
(nnmail-cache-close)
;; Allow the user to hook.
- (run-hooks 'nnmail-post-get-new-mail-hook)
- ;; Delete all the temporary files.
- (while incomings
- (setq incoming (pop incomings))
- (and nnmail-delete-incoming
- (file-exists-p incoming)
- (file-writable-p incoming)
- (delete-file incoming))))))
+ (run-hooks 'nnmail-post-get-new-mail-hook))))
(defun nnmail-expired-article-p (group time force &optional inhibit)
"Say whether an article that is TIME old in GROUP should be expired."
(time-less-p days (time-since time))
(error nil)))))))
-(defvar nnmail-read-passwd nil)
-(defun nnmail-read-passwd (prompt &rest args)
- "Read a password using PROMPT.
-If ARGS, PROMPT is used as an argument to `format'."
- (let ((prompt
- (if args
- (apply 'format prompt args)
- prompt)))
- (unless nnmail-read-passwd
- (if (load "passwd" t)
- (setq nnmail-read-passwd 'read-passwd)
- (unless (fboundp 'ange-ftp-read-passwd)
- (autoload 'ange-ftp-read-passwd "ange-ftp"))
- (setq nnmail-read-passwd 'ange-ftp-read-passwd)))
- (funcall nnmail-read-passwd prompt)))
-
(defun nnmail-check-syntax ()
"Check (and modify) the syntax of the message in the current buffer."
(save-restriction
his nil)))
found))
-(eval-and-compile
- (autoload 'pop3-movemail "pop3"))
-
-(defun nnmail-pop3-movemail (inbox crashbox)
- "Function to move mail from INBOX on a pop3 server to file CRASHBOX."
- (let ((pop3-maildrop
- (substring inbox (match-end (string-match "^po:" inbox))))
- (pop3-password
- (or nnmail-pop-password
- (nnmail-read-passwd
- (format "Password for %s: " inbox)))))
- (pop3-movemail crashbox)))
-
(defun nnmail-within-headers-p ()
"Check to see if point is within the headers of a unix mail message.
Doesn't change point."
(defvoo nntp-rlogin-user-name nil
"*User name on remote system when using the rlogin connect method.")
-(defvoo nntp-telnet-parameters '("exec" "telnet" "-8" "${NNTPSERVER:=news}" "nntp")
+(defvoo nntp-telnet-parameters
+ '("exec" "telnet" "-8" "${NNTPSERVER:=news}" "nntp")
"*Parameters to `nntp-open-telnet'.
That function may be used as `nntp-open-connection-function'. In that
case, this list will be executed as a command after logging in
;; hits C-g, you won't leave the component groups in a half-way state.
(progn
;; move (un)read
- (let ((gnus-newsgroup-active nil)) ;workaround guns-update-read-articles
+ ;; bind for workaround guns-update-read-articles
+ (let ((gnus-newsgroup-active nil))
(while (setq entry (pop unreads))
(gnus-update-read-articles (car entry) (cdr entry))))
;;; Code:
-(eval-when-compile (require 'cl)) ;and ah ain't kiddin' 'bout it
+(eval-when-compile (require 'cl)) ;and ah ain't kiddin' 'bout it
(defvar parse-time-syntax (make-vector 256 nil))
(defvar parse-time-digits (make-vector 256 nil))
;; Copyright (c) 1998 by Shenghuo Zhu <zsh@cs.rochester.edu>
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
-;; $Revision: 1.1.1.2 $
+;; $Revision: 1.1.1.3 $
;; Keywords: news HZ
;; Time-stamp: <Tue Oct 6 23:48:49 EDT 1998 zsh>
(set-extent-property ant 'smiley-extent ext)
(set-extent-property ext 'smiley-annotation ant)
;; Help
- (set-extent-property ext 'help-echo
- "button2 toggles smiley, button3 pops up menu")
- (set-extent-property ant 'help-echo
- "button2 toggles smiley, button3 pops up menu")
+ (set-extent-property
+ ext 'help-echo
+ "button2 toggles smiley, button3 pops up menu")
+ (set-extent-property
+ ant 'help-echo
+ "button2 toggles smiley, button3 pops up menu")
(set-extent-property ext 'balloon-help
"Mouse button2 - toggle smiley
Mouse button3 - menu")
;; Copyright (c) 1998 by Shenghuo Zhu <zsh@cs.rochester.edu>
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
-;; $Revision: 5.4 $
+;; $Revision: 5.5 $
;; Keywords: uudecode
;; This file is not part of GNU Emacs, but the same permissions
+1999-01-23 09:47:16 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus.texi (Article Washing): Removed.
+
1999-01-16 20:36:48 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Customizing Articles): Rewrite.
1998-12-03 Didier Verna <verna@inf.enst.fr>
- * gnus.texi (Group Parameters): update for the posting-style group
+ * gnus.texi (Group Parameters): update for the posting-style group
parameter.
1998-12-02 01:04:22 Lars Magne Ingebrigtsen <larsi@gnus.org>
1998-08-27 07:29:17 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Mail Folders): Addition.
-
\input texinfo @c -*-texinfo-*-
@setfilename gnus
-@settitle Pterodactyl Gnus 0.72 Manual
+@settitle Pterodactyl Gnus 0.73 Manual
@synindex fn cp
@synindex vr cp
@synindex pg cp
@tex
@titlepage
-@title Pterodactyl Gnus 0.72 Manual
+@title Pterodactyl Gnus 0.73 Manual
@author by Lars Magne Ingebrigtsen
@page
spool or your mbox file. All at the same time, if you want to push your
luck.
-This manual corresponds to Pterodactyl Gnus 0.72.
+This manual corresponds to Pterodactyl Gnus 0.73.
@end ifinfo
This might take quite a while, especially if you subscribe to lots of
groups from different @sc{nntp} servers. Also @pxref{Group Levels};
@code{gnus-activate-level} also affects activation of foreign
-newsgroups.
+newsgroups.
@node Group Parameters
@item charset
Elements that look like @code{(charset . iso-8859-1)} will make
-@code{iso-8859-1} the default charset; that is, the charset that will be
+@code{iso-8859-1} the default charset; that is, the charset that will be
used for all articles that do not specify a charset.
@item @var{(variable form)}
like this in the group parameters:
@example
-(posting-style
- (name "Funky Name")
+(posting-style
+ (name "Funky Name")
(signature "Funky Signature"))
@end example
(@pxref{Process/Prefix}).
When given a symbolic prefix (@pxref{Symbolic Prefixes}), all these
-commands will sort in reverse order.
+commands will sort in reverse order.
You can also sort a subset of the groups:
remove a group from all topics, but in that case, Gnus will add it to
the root topic the next time you start Gnus. In fact, all new groups
(which, naturally, don't belong to any topic) will show up in the root
-topic.
+topic.
This command uses the process/prefix convention
(@pxref{Process/Prefix}).
@kindex M-TAB (Topic)
@findex gnus-topic-unindent
``Un-indent'' the current topic so that it becomes a sub-topic of the
-parent of its current parent (@code{gnus-topic-unindent}).
+parent of its current parent (@code{gnus-topic-unindent}).
@item RET
@kindex RET (Topic)
@item R
This misleadingly named specifier is the @dfn{secondary mark}. This
mark will say whether the article has been replied to, has been cached,
-or has been saved.
+or has been saved.
@item i
Score as a number (@pxref{Scoring}).
It is likely that you do not want caching on all groups. For instance,
if your @code{nnml} mail is located under your home directory, it makes no
sense to cache it somewhere else under your home directory. Unless you
-feel that it's neat to use twice as much space.
+feel that it's neat to use twice as much space.
To limit the caching, you could set @code{gnus-cacheable-groups} to a
regexp of groups to cache, @samp{^nntp} for instance, or set the
@cindex highlighting
Not only do you want your article buffer to look like fruit salad, but
-you want it to look like technicolor fruit salad.
+you want it to look like technicolor fruit salad.
@table @kbd
@findex gnus-article-hide
Do quite a lot of hiding on the article buffer
(@kbd{gnus-article-hide}). In particular, this function will hide
-headers, PGP, cited text and the signature.
+headers, PGP, cited text and the signature.
@item W W h
@kindex W W h (Summary)
@findex gnus-summary-stop-page-breaking
Remove page breaks from the current article
(@code{gnus-summary-stop-page-breaking}). @xref{Misc Article} for page
-delimiters.
+delimiters.
@item W r
@kindex W r (Summary)
Toggle whether to display all headers in the article buffer permanently
(@code{gnus-summary-verbose-header}).
-@item W m
-@kindex W m (Summary)
-@findex gnus-summary-toggle-mime
-Toggle whether to run the article through @sc{mime} before displaying
-(@code{gnus-summary-toggle-mime}).
-
@item W o
@kindex W o (Summary)
@findex gnus-article-treat-overstrike
@item W w
@kindex W w (Summary)
@findex gnus-article-fill-cited-article
-Do word wrap (@code{gnus-article-fill-cited-article}).
+Do word wrap (@code{gnus-article-fill-cited-article}).
You can give the command a numerical prefix to specify the width to use
when filling.
Quoted-Printable is one common @sc{mime} encoding employed when sending
non-ASCII (i. e., 8-bit) articles. It typically makes strings like
@samp{déjà vu} look like @samp{d=E9j=E0 vu}, which doesn't look very
-readable to me.
+readable to me. Note that the this is usually done automatically by
+Gnus if the message in question has a @code{Content-Transfer-Encoding}
+header that says that this encoding has been done.
@item W f
@kindex W f (Summary)
@item W M v
@kindex W M v (Summary)
View all the @sc{mime} parts in the current article
-(@code{gnus-mime-view-all-parts}).
+(@code{gnus-mime-view-all-parts}).
@end table
@item gnus-article-mime-part-function
@vindex gnus-article-mime-part-function
-For each @sc{mime} part, this function will be called with the @sc{mime}
+For each @sc{mime} part, this function will be called with the @sc{mime}
handle as the parameter. The function is meant to be used to allow
users to gather information from the article (e. g., add Vcard info to
-the bbdb database) or to do actions based on parts (e. g., automatically
+the bbdb database) or to do actions based on parts (e. g., automatically
save all jpegs into some directory).
Here's an example function the does the latter:
Unpick the thread or article
(@code{gnus-pick-unmark-article-or-thread}). If the variable
@code{gnus-thread-hide-subtree} is true, then this key unpicks the
-thread if used at the first article of the thread. Otherwise it unpicks
+thread if used at the first article of the thread. Otherwise it unpicks
just the article. You can give this key a numerical prefix to unpick
the thread or article at that line.
@vindex gnus-display-mime-function
@findex gnus-display-mime
-Gnus pushes @sc{mime} articles through @code{gnus-display-mime-function}
+Gnus pushes @sc{mime} articles through @code{gnus-display-mime-function}
to display the @sc{mime} parts. This is @code{gnus-display-mime} by
-default, which creates a bundle of clickable buttons that can be used to
-display, save and manipulate the @sc{mime} objects.
+default, which creates a bundle of clickable buttons that can be used to
+display, save and manipulate the @sc{mime} objects.
The following commands are available when you have placed point over a
@sc{mime} button:
Gnus will display some @sc{mime} objects automatically. The way Gnus
determines which parts to do this with is described in the Emacs MIME
-manual.
+manual.
It might be best to just use the toggling functions from the article
buffer to avoid getting nasty surprises. (For instance, you enter the
@cindex article customization
A slew of functions for customizing how the articles are to look like
-exist. You can call these functions interactively, or you can have them
+exist. You can call these functions interactively, or you can have them
called automatically when you select the articles.
To have them called automatically, you should set the corresponding
-``treatment'' variable. For instance, to have headers hidden, you'd set
+``treatment'' variable. For instance, to have headers hidden, you'd set
@code{gnus-treat-hide-headers}. Below is a list of variables that can
be set, but first we discuss the values these variables can have.
considered to contain just a single part.
@vindex gnus-article-treat-types
-Are the treatments applied to all sorts of multipart parts? Yes, if you
+Are the treatments applied to all sorts of multipart parts? Yes, if you
want to, but by default, only @samp{text/plain} parts are given the
treatment. This is controlled by the @code{gnus-article-treat-types}
-variable, which is a list of regular expressions that are matched to the
+variable, which is a list of regular expressions that are matched to the
type of the part.
The following treatment options are available. The easiest way to
-customize this is to examine the @code{gnus-article-treat} customization
+customize this is to examine the @code{gnus-article-treat} customization
group.
@table @code
@item gnus-treat-strip-pem
@item gnus-treat-highlight-headers
@item gnus-treat-highlight-citation
-@item gnus-treat-highlight-signature
-@item gnus-treat-date-ut
-@item gnus-treat-date-local
-@item gnus-treat-date-lapsed
-@item gnus-treat-date-original
+@item gnus-treat-highlight-signature
+@item gnus-treat-date-ut
+@item gnus-treat-date-local
+@item gnus-treat-date-lapsed
+@item gnus-treat-date-original
@item gnus-treat-strip-trailing-blank-lines
@item gnus-treat-strip-leading-blank-lines
@item gnus-treat-strip-multiple-blank-lines
-@item gnus-treat-strip-blank-lines
-@item gnus-treat-overstrike
-@item gnus-treat-display-xface
-@item gnus-treat-display-smileys
+@item gnus-treat-strip-blank-lines
+@item gnus-treat-overstrike
+@item gnus-treat-display-xface
+@item gnus-treat-display-smileys
@item gnus-treat-display-picons
@end table
Finally, if you want to always post using the same select method as
you're reading from (which might be convenient if you're reading lots of
groups from different private servers), you can set this variable to
-@code{current}.
+@code{current}.
@node Mail and Post
@findex nnmail-split-header-length-limit
Header lines may be arbitrarily long. However, the longer a line is,
the longer it takes to match them. Very long lines may lead to Gnus
-taking forever to split the mail, so Gnus excludes lines that are longer
+taking forever to split the mail, so Gnus excludes lines that are longer
than @code{nnmail-split-header-length-limit} (which defaults to 1024).
@kindex M-x nnmail-split-history
@item
@samp{group}: If the split is a string, that will be taken as a group
name. Normal regexp match expansion will be done. See below for
-examples.
+examples.
@item
@var{(FIELD VALUE SPLIT)}: If the split is a list, the first element of
@vindex nnfolder-delete-mail-hook
Hook run in a buffer narrowed to the message that is to be deleted.
This function can be used to copy the message to somewhere else, or to
-extract some information from it before removing it.
+extract some information from it before removing it.
@end table
or you could append your predicate to the predefined
@code{gnus-category-predicate-alist} in your @file{~/.gnus.el} or
wherever. (Note: this would have to be at a point *after*
-@code{gnus-agent} has been loaded via @code{(gnus-agentize)})
+@code{gnus-agent} has been loaded via @code{(gnus-agentize)})
@lisp
(defvar gnus-category-predicate-alist
The above predicates apply to *all* the groups which belong to the
category. However, if you wish to have a specific predicate for an
individual group within a category, or you're just too lazy to set up a
-new category, you can enter a group's individual predicate in it's group
+new category, you can enter a group's individual predicate in it's group
parameters like so:
@lisp
The outer parenthesis required in the category specification are not
entered here as, not being in dotted pair notation, the value of the
-predicate is assumed to be a list.
-
+predicate is assumed to be a list.
+
Now, the syntax of the download score is the same as the syntax of
normal score files, except that all elements that require actually
three forms:
@enumerate
-@item
+@item
Score rule
This has the same syntax as a normal gnus score file except only a
example:
@itemize @bullet
-@item
+@item
Category specification
@lisp
-(("from"
+(("from"
("Lars Ingebrigtsen" 1000000 nil s))
("lines"
(500 -100 nil <)))
@end lisp
-@item
+@item
Group Parameter specification
@lisp
-(agent-score ("from"
+(agent-score ("from"
("Lars Ingebrigtsen" 1000000 nil s))
("lines"
(500 -100 nil <)))
Again, note the omission of the outermost parenthesis here.
@end itemize
-@item
+@item
Agent score file
These score files must *only* contain the permitted scoring keywords
example:
@itemize @bullet
-@item
+@item
Category specification
@lisp
("~/News/agent.SCORE" "~/News/agent.group.SCORE")
@end lisp
-@item
+@item
Group Parameter specification
@lisp
about parenthesis.
@end itemize
-@item
+@item
Use @code{normal} score files
If you dont want to maintain two sets of scoring rules for a group, and
relate to one of the permitted subset of scoring keywords.
@itemize @bullet
-@item
+@item
Category Specification
@lisp
file
@end lisp
-@item
+@item
Group Parameter specification
@lisp
@end lisp
@end itemize
@end enumerate
-
+
@node The Category Buffer
@subsubsection The Category Buffer
@kindex J s (Agent Group)
@findex gnus-agent-fetch-session
Fetch all eligible articles in all groups
-(@code{gnus-agent-fetch-session}).
+(@code{gnus-agent-fetch-session}).
@item J S
@kindex J S (Agent Group)
Remove the downloading mark from the article
(@code{gnus-agent-unmark-article}).
-@item @@
+@item @@
@kindex @@ (Agent Summary)
@findex gnus-agent-toggle-mark
Toggle whether to download the article (@code{gnus-agent-toggle-mark}).
@samp{%1<}, you'll get @code{gnus-balloon-face-1} and so on. The
@code{gnus-balloon-face-*} variables should be either strings or
symbols naming functions that return a string. Under @code{balloon-help-mode},
-when the mouse passes over text with this property set, a balloon window
+when the mouse passes over text with this property set, a balloon window
will appear and display the string. Please refer to the doc string of
@code{balloon-help-mode} for more information on this.
(group 1.0)))))
@end lisp
-One common desire for a multiple frame split is to have a separate frame
-for composing mail and news while leaving the original frame intact. To
+One common desire for a multiple frame split is to have a separate frame
+for composing mail and news while leaving the original frame intact. To
accomplish that, something like the following can be done:
@lisp
@item gnus-article-display-picons
@findex gnus-article-display-picons
Looks up and displays the picons for the author and the author's domain
-in the @code{gnus-picons-display-where} buffer.
+in the @code{gnus-picons-display-where} buffer.
@item gnus-picons-article-display-x-face
@findex gnus-article-display-picons
-Decodes and displays the X-Face header if present.
+Decodes and displays the X-Face header if present.
@end table
@table @emph
-@item MIME
-Gnus does not yet fully handle MIME, and this standard-to-be seems to
-think that MIME is the bees' knees, so we have major breakage here.
-
@item X-Newsreader
This is considered to be a ``vanity header'', while I consider it to be
consumer information. After seeing so many badly formatted articles
@end itemize
This Gnus version will absolutely not work on any Emacsen older than
-that. Not reliably, at least. Older versions of Gnus may work on older
+that. Not reliably, at least. Older versions of Gnus may work on older
Emacs versions.
There are some vague differences between Gnus on the various
@itemize @bullet
@item
-Native @sc{mime} support is something that should be done.
-
-@item
-Really do unbinhexing.
-
-@item
I would like the zombie-page to contain an URL to the source of the
latest version of gnus or some explanation on where to find it.
@item
warn user about `=' redirection of a group in the active file?
@item
- really unbinhex binhex files.
-@item
take over the XEmacs menubar and offer a toggle between the XEmacs
bar and the Gnus bar.
@item
@item
Group parameters and summary commands for un/subscribing to mailing
-lists.
+lists.
@item
Introduce nnmail-home-directory.
@end iftex
@c End:
-
\input texinfo @c -*-texinfo-*-
@setfilename message
-@settitle Pterodactyl Message 0.72 Manual
+@settitle Pterodactyl Message 0.73 Manual
@synindex fn cp
@synindex vr cp
@synindex pg cp
@tex
@titlepage
-@title Pterodactyl Message 0.72 Manual
+@title Pterodactyl Message 0.73 Manual
@author by Lars Magne Ingebrigtsen
@page
* Key Index:: List of Message mode keys.
@end menu
-This manual corresponds to Pterodactyl Message 0.72. Message is
+This manual corresponds to Pterodactyl Message 0.73. Message is
distributed with the Gnus distribution bearing the same version number
as this manual.