+Wed Apr 24 04:04:54 1996 Lars Magne Ingebrigtsen <larsi@trym.ifi.uio.no>
+
+ * message.el (message-syntax-checks): Doc fix.
+
+Wed Apr 24 05:08:10 1996 Lars Magne Ingebrigtsen <larsi@hler.ifi.uio.no>
+
+ * gnus.el (gnus-group-process-prefix): Make sure `mark-active' is
+ bound.
+
+Wed Apr 24 05:06:42 1996 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+
+ * gnus-xmas.el (gnus-xmas-define): Would make compilation
+ difficult.
+
+Wed Apr 24 02:20:08 1996 Lars Magne Ingebrigtsen <larsi@trym.ifi.uio.no>
+
+ * message.el (message-unsent-separator): New variable.
+
+ * gnus.el (gnus-summary-edit-article-done): Nix out original
+ article.
+
+Wed Apr 24 01:31:17 1996 Lars Magne Ingebrigtsen <larsi@hler.ifi.uio.no>
+
+ * gnus-vis.el (gnus-summary-make-menu-bar): Used
+ `region-exists-p'.
+
+Wed Apr 24 00:11:28 1996 Lars Magne Ingebrigtsen <lars@eyesore.no>
+
+ * message.el (message-unix-mail-delimiter): New variable.
+
+ * nnbabyl.el (nnbabyl-check-mbox): New command.
+
+ * nnspool.el (nnspool-insert-nov-head): New function.
+ (nnspool-retrieve-headers-with-nov): Use it to protect against
+ unsynched NOV files.
+
+ * nnheader.el (nnheader-insert-nov): New function.
+ (nnheader-parse-head): New function.
+ (nnheader-insert-article-line): New function.
+
+Tue Apr 23 22:55:57 1996 Lars Magne Ingebrigtsen <lars@eyesore.no>
+
+ * message.el (message-cancel-news): Disable syntax checks.
+ (message-do-fcc): Didn't quote separator.
+
+ * gnus.el (gnus-update-summary-mark-positions): Use local format
+ spec when computing.
+
+ * gnus-msg.el (gnus-summary-cancel-article): Remove article from
+ cache after cancelling.
+ (gnus-summary-supersede-article): Ditto.
+
+Tue Apr 23 12:05:21 1996 Per Abrahamsen <abraham@dina.kvl.dk>
+
+ * gnus.el (gnus-group-history): New variable.
+ (gnus-completing-read): Handle null default arg.
+ (gnus-group-jump-to-group): Use them.
+ (gnus-group-unsubscribe-group): Ditto.
+ (gnus-read-move-group-name): Ditto.
+
+ * gnus-msg.el (gnus-group-post-news): Use `gnus-group-history' and
+ `gnus-completing-read'.
+
+Tue Apr 23 22:39:37 1996 Lars Magne Ingebrigtsen <lars@eyesore.no>
+
+ * nnml.el (nnml-active-number): Protect against corrupt active
+ files.
+
+ * nnvirtual.el (nnvirtual-open-server): Don't allow recursive
+ groups.
+
Tue Apr 23 00:13:22 1996 Lars Magne Ingebrigtsen <larsi@trym.ifi.uio.no>
+ * gnus.el: September Gnus v0.78 is released.
+
* gnus.el (gnus-get-newsgroup-headers): Run
`gnus-parse-headers-hook'.
(gnus-mime-decode-quoted-printable): Make interactive.
(not gnus-expert-user))
(setq gnus-newsgroup-name
(setq group
- (completing-read "Group: " gnus-active-hashtb nil nil
- (cons (or group "") 0)))))
+ (gnus-completing-read group "Group:"
+ gnus-active-hashtb nil nil nil
+ 'gnus-group-history))))
(gnus-post-news 'post group))))
(defun gnus-summary-post-news ()
(when (gnus-summary-select-article t nil nil article)
(when (gnus-eval-in-buffer-window
gnus-original-article-buffer (message-cancel-news))
- (gnus-summary-mark-as-read article gnus-canceled-mark))
+ (gnus-summary-mark-as-read article gnus-canceled-mark)
+ (gnus-cache-remove-article 1))
(gnus-article-hide-headers-if-wanted))
(gnus-summary-remove-process-mark article))))
header line with the old Message-ID."
(interactive)
(gnus-set-global-variables)
- (gnus-setup-message 'reply-yank
- (gnus-summary-select-article t)
- (set-buffer gnus-original-article-buffer)
- (message-supersede)))
+ (let ((article (gnus-summary-article-number)))
+ (gnus-setup-message 'reply-yank
+ (gnus-summary-select-article t)
+ (set-buffer gnus-original-article-buffer)
+ (message-supersede)
+ (push
+ `((lambda ()
+ (gnus-cache-possibly-remove-article ,article nil nil nil t)))
+ message-send-actions))))
\f
(memq (gnus-group-group-name) gnus-group-marked))]
["Unmark all" gnus-group-unmark-all-groups gnus-group-marked]
["Mark regexp..." gnus-group-mark-regexp t]
- ["Mark region" gnus-group-mark-region (region-exists-p)]
+ ["Mark region" gnus-group-mark-region t]
["Mark buffer" gnus-group-mark-buffer t]
["Execute command" gnus-group-universal-argument
(or gnus-group-marked (gnus-group-group-name))])
("Subscribe"
["Subscribe to random group" gnus-group-unsubscribe-group t]
- ["Kill all newsgroups in region" gnus-group-kill-region
- (region-exists-p)]
+ ["Kill all newsgroups in region" gnus-group-kill-region t]
["Kill all zombie groups" gnus-group-kill-all-zombies
gnus-zombie-list]
["Kill all groups on level..." gnus-group-kill-level t])
["Catchup" gnus-summary-catchup t]
["Catchup all" gnus-summary-catchup-all t]
["Catchup to here" gnus-summary-catchup-to-here t]
- ["Catchup region" gnus-summary-mark-region-as-read
- (region-exists-p)]
+ ["Catchup region" gnus-summary-mark-region-as-read t]
["Mark excluded" gnus-summary-limit-mark-excluded-as-read t])
("Various"
["Tick" gnus-summary-tick-article-forward t]
["Remove all marks" gnus-summary-unmark-all-processable t]
["Mark above" gnus-uu-mark-over t]
["Mark series" gnus-uu-mark-series t]
- ["Mark region" gnus-uu-mark-region (region-exists-p)]
+ ["Mark region" gnus-uu-mark-region t]
["Mark by regexp..." gnus-uu-mark-by-regexp t]
["Mark all" gnus-uu-mark-all t]
["Mark buffer" gnus-uu-mark-buffer t]
;;; Code:
(require 'sendmail)
+(require 'message)
(require 'gnus)
(require 'gnus-msg)
(defun gnus-mail-forward-using-vm (&optional buffer)
"Forward the current message to another user using vm."
(let* ((gnus-buffer (or buffer (current-buffer)))
- (subject (gnus-forward-make-subject gnus-buffer)))
+ (subject (message-make-forward-subject)))
(or (featurep 'win-vm)
(if gnus-use-full-window
(pop-to-buffer gnus-article-buffer)
(x-get-resource ".backgroundMode" "BackgroundMode" 'string)
(error nil)))
(params (frame-parameters))
- (color (or (assq 'background-color params)
- (color-instance-name
- (specifier-instance
- (face-background 'default))))))
+ (color (condition-case ()
+ (or (assq 'background-color params)
+ (color-instance-name
+ (specifier-instance
+ (face-background 'default))))
+ (error nil))))
(cond (bg-resource (intern (downcase bg-resource)))
((and color
(< (apply '+ (gnus-x-color-values color))
\f
;; Internal variables
+;; Dummy variable.
+(defvar gnus-use-generic-from nil)
+
(defvar gnus-thread-indent-array nil)
(defvar gnus-thread-indent-array-level gnus-thread-indent-level)
(defvar gnus-method-history nil)
;; Variable holding the user answers to all method prompts.
+(defvar gnus-group-history nil)
+;; Variable holding the user answers to all group prompts.
+
(defvar gnus-server-alist nil
"List of available servers.")
"gnus-bug@ifi.uio.no (The Gnus Bugfixing Girls + Boys)"
"The mail address of the Gnus maintainers.")
-(defconst gnus-version "September Gnus v0.78"
+(defconst gnus-version "September Gnus v0.79"
"Version number for this version of Gnus.")
(defvar gnus-info-nodes
(defun gnus-update-summary-mark-positions ()
"Compute where the summary marks are to go."
(save-excursion
+ (when (and gnus-summary-buffer
+ (get-buffer gnus-summary-buffer)
+ (buffer-name (get-buffer gnus-summary-buffer)))
+ (set-buffer gnus-summary-buffer))
(let ((gnus-replied-mark 129)
(gnus-score-below-mark 130)
(gnus-score-over-mark 130)
(thread nil)
(gnus-visual nil)
+ (spec gnus-summary-line-format-spec)
pos)
(gnus-set-work-buffer)
- (gnus-summary-insert-line
- [0 "" "" "" "" "" 0 0 ""] 0 nil 128 t nil "" nil 1)
- (goto-char (point-min))
- (setq pos (list (cons 'unread (and (search-forward "\200" nil t)
- (- (point) 2)))))
- (goto-char (point-min))
- (push (cons 'replied (and (search-forward "\201" nil t) (- (point) 2)))
- pos)
- (goto-char (point-min))
- (push (cons 'score (and (search-forward "\202" nil t) (- (point) 2)))
- pos)
- (setq gnus-summary-mark-positions pos))))
+ (let ((gnus-summary-line-format-spec spec))
+ (gnus-summary-insert-line
+ [0 "" "" "" "" "" 0 0 ""] 0 nil 128 t nil "" nil 1)
+ (goto-char (point-min))
+ (setq pos (list (cons 'unread (and (search-forward "\200" nil t)
+ (- (point) 2)))))
+ (goto-char (point-min))
+ (push (cons 'replied (and (search-forward "\201" nil t) (- (point) 2)))
+ pos)
+ (goto-char (point-min))
+ (push (cons 'score (and (search-forward "\202" nil t) (- (point) 2)))
+ pos)
+ (setq gnus-summary-mark-positions pos)))))
(defun gnus-update-group-mark-positions ()
(save-excursion
(defun gnus-completing-read (default prompt &rest args)
;; Like `completing-read', except that DEFAULT is the default argument.
- (let* ((prompt (concat prompt " (default " default ") "))
+ (let* ((prompt (if default
+ (concat prompt " (default " default ") ")
+ (concat prompt " ")))
(answer (apply 'completing-read prompt args)))
(if (or (null answer) (zerop (length answer)))
default
(nreverse groups)))
((and (boundp 'transient-mark-mode)
transient-mark-mode
+ (boundp 'mark-active)
mark-active)
;; Work on the region between point and mark.
(let ((max (max (point) (mark)))
(interactive
(list (completing-read
"Group: " gnus-active-hashtb nil
- (memq gnus-select-method gnus-have-read-active-file))))
+ (memq gnus-select-method gnus-have-read-active-file)
+ nil
+ 'gnus-group-history)))
(when (equal group "")
(error "Empty group name"))
(interactive
(list (completing-read
"Group: " gnus-active-hashtb nil
- (memq gnus-select-method gnus-have-read-active-file))))
+ (memq gnus-select-method gnus-have-read-active-file)
+ nil
+ 'gnus-group-history)))
(let ((newsrc (gnus-gethash group gnus-newsrc-hashtb)))
(cond
((string-match "^[ \t]$" group)
(when gnus-use-cache
(gnus-cache-update-article
(cdr gnus-article-current) (car gnus-article-current))))
+ (save-excursion
+ (when (get-buffer gnus-original-article-buffer)
+ (set-buffer gnus-original-article-buffer)
+ (setq gnus-original-article nil)))
+ (setq gnus-article-current nil
+ gnus-current-article nil)
(run-hooks 'gnus-article-display-hook)
(and (gnus-visual-p 'summary-highlight 'highlight)
(run-hooks 'gnus-visual-mark-article-hook)))))
"Read a group name."
(let* ((split-name (gnus-get-split-value gnus-move-split-methods))
(prom
- (format "Where do you want to %s %s? "
+ (format "Where do you want to %s %s?"
prompt
(if (> (length articles) 1)
(format "these %d articles" (length articles))
(to-newsgroup
(cond
((null split-name)
- (completing-read
- (concat prom
- (if default
- (format "(default %s) " default)
- ""))
- gnus-active-hashtb nil nil prefix))
+ (gnus-completing-read default prom
+ gnus-active-hashtb nil nil prefix
+ 'gnus-group-history))
((= 1 (length split-name))
- (completing-read prom gnus-active-hashtb
- nil nil (cons (car split-name) 0)))
+ (gnus-completing-read (car split-name) prom gnus-active-hashtb
+ nil nil nil
+ 'gnus-group-history))
(t
- (completing-read
- prom (mapcar (lambda (el) (list el)) (nreverse split-name)))))))
-
+ (gnus-completing-read nil prom
+ (mapcar (lambda (el) (list el))
+ (nreverse split-name))
+ nil nil nil
+ 'gnus-group-history)))))
(when to-newsgroup
(if (or (string= to-newsgroup "")
(string= to-newsgroup prefix))
(defvar message-syntax-checks nil
"Controls what syntax checks should not be performed on outgoing posts.
To disable checking of long signatures, for instance, add
- `(signature . disable)' to this list.
+ `(signature . disabled)' to this list.
Don't touch this variable unless you really know what you're doing.
;;; Internal variables.
+;;; Regexp matching the delimiter of messages in UNIX mail format
+;;; (UNIX From lines), minus the initial ^.
+(defvar message-unix-mail-delimiter
+ (let ((time-zone-regexp
+ (concat "\\([A-Z]?[A-Z]?[A-Z][A-Z]\\( DST\\)?"
+ "\\|[-+]?[0-9][0-9][0-9][0-9]"
+ "\\|"
+ "\\) *")))
+ (concat
+ "From "
+
+ ;; Username, perhaps with a quoted section that can contain spaces.
+ "\\("
+ "[^ \n]*"
+ "\\(\\|\".*\"[^ \n]*\\)"
+ "\\|<[^<>\n]+>"
+ "\\) ?"
+
+ ;; The time the message was sent.
+ "\\([^ \n]*\\) *" ; day of the week
+ "\\([^ ]*\\) *" ; month
+ "\\([0-9]*\\) *" ; day of month
+ "\\([0-9:]*\\) *" ; time of day
+
+ ;; Perhaps a time zone, specified by an abbreviation, or by a
+ ;; numeric offset.
+ time-zone-regexp
+
+ ;; The year.
+ " [0-9][0-9]\\([0-9]*\\) *"
+
+ ;; On some systems the time zone can appear after the year, too.
+ time-zone-regexp
+
+ ;; Old uucp cruft.
+ "\\(remote from .*\\)?"
+
+ "\n")))
+
+(defvar message-unsent-separator
+ (concat "^ *---+ +Unsent message follows +---+ *$\\|"
+ "^ *---+ +Returned message +---+ *$\\|"
+ "^Start of returned message$\\|"
+ "^ *---+ +Original message +---+ *$\\|"
+ "^ *--+ +begin message +--+ *$\\|"
+ "^ *---+ +Original message follows +---+ *$\\|"
+ "^|? *---+ +Message text follows: +---+ *|?$")
+ "A regexp that matches the separator before the text of a failed message.")
+
(defvar message-header-format-alist
`((Newsgroups)
(To . message-fill-header)
(defun message-check-element (type)
"Returns non-nil if this type is not to be checked."
- (let ((able (assq type message-syntax-checks)))
- (and (consp able)
- (eq (cdr able) 'disabled))))
+ (if (eq message-syntax-checks 'dont-check-for-anything-just-trust-me)
+ nil
+ (let ((able (assq type message-syntax-checks)))
+ (and (consp able)
+ (eq (cdr able) 'disabled)))))
(defun message-checksum ()
"Return a \"checksum\" for the current buffer."
(push file list)
(message-remove-header "fcc" nil t)))
(goto-char (point-min))
- (re-search-forward (concat "^" mail-header-separator "$"))
+ (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
(replace-match "" t t)
;; Process FCC operations.
(while list
;; Allow mail alias things.
(if (fboundp 'mail-abbrevs-setup)
(mail-abbrevs-setup)
- (mail-aliases-setup))
+ (funcall (intern "mail-aliases-setup")))
(set-buffer-modified-p nil)
(run-hooks 'message-setup-hook)
(message-position-point)
mail-header-separator "\n"
"This is a cancel message from " from ".\n")
(message "Canceling your article...")
- (let (message-syntax-checks)
+ (let ((message-syntax-checks 'dont-check-for-anything-just-trust-me))
(funcall message-send-news-function))
(message "Canceling your article...done")
(kill-buffer buf))))
(or (and boundary
(re-search-forward boundary nil t)
(forward-line 2))
- (and (re-search-forward mail-unsent-separator nil t)
+ (and (re-search-forward message-unsent-separator nil t)
(forward-line 1))
(and (search-forward "\n\n" nil t)
(re-search-forward "^Return-Path:.*\n" nil t)))
(while (search-forward "\^_" nil t)
(replace-match "?" t t)))
+(defun nnbabyl-check-mbox ()
+ "Go through the nnbabyl mbox and make sure that no article numbers are reused."
+ (interactive)
+ (let ((idents (make-vector 1000 0))
+ id)
+ (save-excursion
+ (when (or (not nnbabyl-mbox-buffer)
+ (not (buffer-name nnbabyl-mbox-buffer)))
+ (nnbabyl-read-mbox))
+ (set-buffer nnbabyl-mbox-buffer)
+ (goto-char (point-min))
+ (while (re-search-forward "^X-Gnus-Newsgroup: \\([^ ]+\\) " nil t)
+ (if (intern-soft (setq id (match-string 1)) idents)
+ (progn
+ (delete-region (progn (beginning-of-line) (point))
+ (progn (forward-line 1) (point)))
+ (nnheader-message 7 "Moving %s..." id)
+ (nnbabyl-save-mail))
+ (intern id idents)))
+ (when (buffer-modified-p (current-buffer))
+ (save-buffer))
+ (nnmail-save-active nnbabyl-group-alist nnbabyl-active-file)
+ (message ""))))
+
(provide 'nnbabyl)
;;; nnbabyl.el ends here
"Expires ARTICLES from GROUP on SERVER.
If FORCE, delete regardless of exiration date, otherwise use normal
expiry mechanism."
- (let (msg)
+ (let (msg art)
(nntp-possibly-change-server group server) ;;-
(while articles
(setq art (pop articles))
"Move ARTICLE (a number) from GROUP on SERVER.
Evals ACCEPT-FORM in current buffer, where the article is.
Optional LAST is ignored."
- (let ((artbuf (get-buffer-create " *nndb move*")))
+ (let ((artbuf (get-buffer-create " *nndb move*"))
+ result)
(and
(nndb-request-article article group server artbuf)
(save-excursion
;;; Code:
(require 'nnheader)
-(require 'rmail)
+(require 'message)
(require 'nnmail)
(require 'nnoo)
(eval-when-compile (require 'cl))
(body-end-function . nndoc-rnews-body-end))
(mbox
(article-begin .
- ,(let ((delim (concat "^" rmail-unix-mail-delimiter)))
+ ,(let ((delim (concat "^" message-unix-mail-delimiter)))
(if (string-match "\n\\'" delim)
(substring delim 0 (match-beginning 0))
delim)))
"Guess what document type is in the current buffer."
(goto-char (point-min))
(cond
- ((looking-at rmail-unix-mail-delimiter)
+ ((looking-at message-unix-mail-delimiter)
'mbox)
((looking-at "\^A\^A\^A\^A$")
'mmdf)
;;; Code:
(require 'nnheader)
-(require 'rmail)
+(require 'message)
(require 'nnmail)
(require 'nnoo)
(eval-when-compile (require 'cl))
(save-excursion
(set-buffer nntp-server-buffer)
(erase-buffer)
- (let ((delim-string (concat "^" rmail-unix-mail-delimiter))
+ (let ((delim-string (concat "^" message-unix-mail-delimiter))
article art-string start stop)
(nnfolder-possibly-change-group group server)
(set-buffer nnfolder-current-buffer)
(goto-char (point-min))
(if (search-forward (nnfolder-article-string article) nil t)
(let (start stop)
- (re-search-backward (concat "^" rmail-unix-mail-delimiter) nil t)
+ (re-search-backward (concat "^" message-unix-mail-delimiter) nil t)
(setq start (point))
(forward-line 1)
(or (and (re-search-forward
- (concat "^" rmail-unix-mail-delimiter) nil t)
+ (concat "^" message-unix-mail-delimiter) nil t)
(forward-line -1))
(goto-char (point-max)))
(setq stop (point))
(concat "\nMessage-ID: " article)))
(defun nnfolder-delete-mail (&optional force leave-delim)
- ;; Beginning of the article.
+ "Delete the message that point is in."
(save-excursion
- (save-restriction
- (narrow-to-region
- (save-excursion
- (re-search-backward (concat "^" rmail-unix-mail-delimiter) nil t)
- (if leave-delim (progn (forward-line 1) (point))
- (match-beginning 0)))
- (progn
- (forward-line 1)
- (or (and (re-search-forward (concat "^" rmail-unix-mail-delimiter)
- nil t)
- (if (and (not (bobp)) leave-delim)
- (progn (forward-line -2) (point))
- (match-beginning 0)))
- (point-max))))
- (delete-region (point-min) (point-max)))))
+ (delete-region
+ (save-excursion
+ (re-search-backward (concat "^" message-unix-mail-delimiter) nil t)
+ (if leave-delim (progn (forward-line 1) (point))
+ (match-beginning 0)))
+ (progn
+ (forward-line 1)
+ (if (re-search-forward (concat "^" message-unix-mail-delimiter) nil t)
+ (if (and (not (bobp)) leave-delim)
+ (progn (forward-line -2) (point))
+ (match-beginning 0))
+ (point-max))))))
(defun nnfolder-possibly-change-group (group &optional server)
(when (and server
(if group (list (list group "")) nnmail-split-methods))
(group-art-list
(nreverse (nnmail-article-group 'nnfolder-active-number)))
- (delim (concat "^" rmail-unix-mail-delimiter))
+ (delim (concat "^" message-unix-mail-delimiter))
save-list group-art)
(goto-char (point-min))
;; This might come from somewhere else.
(set-buffer (setq nnfolder-current-buffer
(nnheader-find-file-noselect file nil 'raw)))
(buffer-disable-undo (current-buffer))
- (let* ((delim (concat "^" rmail-unix-mail-delimiter))
+ (let* ((delim (concat "^" message-unix-mail-delimiter))
(marker (concat "\n" nnfolder-article-marker))
(number "[0-9]+")
(active (cadr (assoc nnfolder-current-group
(require 'mail-utils)
(require 'sendmail)
-(require 'rmail)
(eval-when-compile (require 'cl))
(defvar nnheader-max-head-length 4096
"Create a new mail header structure initialized with INIT."
(make-vector 9 init))
+;; Parsing headers and NOV lines.
+
+(defsubst nnheader-header-value ()
+ (buffer-substring (match-end 0) (gnus-point-at-eol)))
+
+(defvar nnheader-newsgroup-none-id 1)
+
+(defun nnheader-parse-head ()
+ (let ((case-fold-search t)
+ end ref in-reply-to lines p cur)
+ (goto-char (point-min))
+ ;; Search to the beginning of the next header. Error messages
+ ;; do not begin with 2 or 3.
+ (when (re-search-forward "^[23][0-9]+ " nil t)
+ ;; This implementation of this function, with nine
+ ;; search-forwards instead of the one re-search-forward and
+ ;; a case (which basically was the old function) is actually
+ ;; about twice as fast, even though it looks messier. You
+ ;; can't have everything, I guess. Speed and elegance
+ ;; doesn't always go hand in hand.
+ (vector
+ ;; Number.
+ (prog1
+ (read cur)
+ (end-of-line)
+ (setq p (point))
+ (narrow-to-region (point)
+ (or (and (search-forward "\n.\n" nil t)
+ (- (point) 2))
+ (point))))
+ ;; Subject.
+ (progn
+ (goto-char p)
+ (if (search-forward "\nsubject: " nil t)
+ (nnheader-header-value) "(none)"))
+ ;; From.
+ (progn
+ (goto-char p)
+ (if (search-forward "\nfrom: " nil t)
+ (nnheader-header-value) "(nobody)"))
+ ;; Date.
+ (progn
+ (goto-char p)
+ (if (search-forward "\ndate: " nil t)
+ (nnheader-header-value) ""))
+ ;; Message-ID.
+ (progn
+ (goto-char p)
+ (if (search-forward "\nmessage-id: " nil t)
+ (nnheader-header-value)
+ ;; If there was no message-id, we just fake one to make
+ ;; subsequent routines simpler.
+ (concat "none+"
+ (int-to-string
+ (incf nnheader-newsgroup-none-id)))))
+ ;; References.
+ (progn
+ (goto-char p)
+ (if (search-forward "\nreferences: " nil t)
+ (nnheader-header-value)
+ ;; Get the references from the in-reply-to header if there
+ ;; were no references and the in-reply-to header looks
+ ;; promising.
+ (if (and (search-forward "\nin-reply-to: " nil t)
+ (setq in-reply-to (nnheader-header-value))
+ (string-match "<[^>]+>" in-reply-to))
+ (substring in-reply-to (match-beginning 0)
+ (match-end 0))
+ "")))
+ ;; Chars.
+ 0
+ ;; Lines.
+ (progn
+ (goto-char p)
+ (if (search-forward "\nlines: " nil t)
+ (if (numberp (setq lines (read cur)))
+ lines 0)
+ 0))
+ ;; Xref.
+ (progn
+ (goto-char p)
+ (and (search-forward "\nxref: " nil t)
+ (nnheader-header-value)))))))
+
+(defun nnheader-insert-nov (header)
+ (princ (mail-header-number header) (current-buffer))
+ (insert
+ "\t"
+ (or (mail-header-subject header) "") "\t"
+ (or (mail-header-from header) "") "\t"
+ (or (mail-header-date header) "") "\t"
+ (or (mail-header-id header) "") "\t"
+ (or (mail-header-references header) "") "\t")
+ (princ (or (mail-header-chars header) 0) (current-buffer))
+ (insert "\t")
+ (princ (or (mail-header-lines header) 0) (current-buffer))
+ (insert "\t")
+ (when (mail-header-xref header)
+ (insert "Xref: " (mail-header-xref header) "\t"))
+ (insert "\n"))
+
+(defun nnheader-insert-article-line (article)
+ (goto-char (point-min))
+ (insert "220 ")
+ (princ article (current-buffer))
+ (insert " Article retrieved.\n")
+ (search-forward "\n\n" nil 'move)
+ (delete-region (point) (point-max))
+ (forward-char -1)
+ (insert "."))
+
;; Various cruft the backends and Gnus need to communicate.
(defvar nntp-server-buffer nil)
(defun nnheader-insert-head (file)
"Insert the head of the article."
- (if (eq nnheader-max-head-length t)
- ;; Just read the entire file.
- (insert-file-contents-literally file)
- ;; Read 1K blocks until we find a separator.
- (let ((beg 0)
- format-alist
- (chop 1024))
- (while (and (eq chop (nth 1 (insert-file-contents
- file nil beg (incf beg chop))))
- (prog1 (not (search-forward "\n\n" nil t))
- (goto-char (point-max)))
- (or (null nnheader-max-head-length)
- (< beg nnheader-max-head-length)))))))
+ (when (file-exists-p file)
+ (if (eq nnheader-max-head-length t)
+ ;; Just read the entire file.
+ (insert-file-contents-literally file)
+ ;; Read 1K blocks until we find a separator.
+ (let ((beg 0)
+ format-alist
+ (chop 1024))
+ (while (and (eq chop (nth 1 (insert-file-contents
+ file nil beg (incf beg chop))))
+ (prog1 (not (search-forward "\n\n" nil t))
+ (goto-char (point-max)))
+ (or (null nnheader-max-head-length)
+ (< beg nnheader-max-head-length))))))
+ t))
(defun nnheader-article-p ()
"Say whether the current buffer looks like an article."
(insert-file-contents-literally file)
(goto-char (point-min))
(prog1
- (looking-at rmail-unix-mail-delimiter)
+ (looking-at message-unix-mail-delimiter)
(kill-buffer (current-buffer))))))
(defun nnheader-replace-chars-in-string (string from to)
;;; Code:
(require 'nnheader)
-(require 'rmail)
(require 'timezone)
(require 'sendmail)
(require 'message)
(defun nnmail-search-unix-mail-delim ()
"Put point at the beginning of the next message."
(let ((case-fold-search t)
- (delim (concat "^" rmail-unix-mail-delimiter))
+ (delim (concat "^" message-unix-mail-delimiter))
found)
(while (not found)
(if (re-search-forward delim nil t)
(when (or (looking-at "[^\n :]+ *:")
(looking-at delim)
- (looking-at (concat ">" rmail-unix-mail-delimiter)))
+ (looking-at (concat ">" message-unix-mail-delimiter)))
(forward-line -1)
(setq found 'yes))
(setq found 'no)))
(defun nnmail-process-unix-mail-format (func)
(let ((case-fold-search t)
- (delim (concat "^" rmail-unix-mail-delimiter))
+ (delim (concat "^" message-unix-mail-delimiter))
start message-id content-length end skip head-end)
(goto-char (point-min))
(if (not (and (re-search-forward delim nil t)
;;; Code:
(require 'nnheader)
-(require 'rmail)
+(require 'message)
(require 'nnmail)
(require 'nnoo)
(eval-when-compile (require 'cl))
(setq start
(save-excursion
(re-search-backward
- (concat "^" rmail-unix-mail-delimiter) nil t)
+ (concat "^" message-unix-mail-delimiter) nil t)
(point)))
(search-forward "\n\n" nil t)
(setq stop (1- (point)))
(goto-char (point-min))
(if (search-forward (nnmbox-article-string article) nil t)
(let (start stop)
- (re-search-backward (concat "^" rmail-unix-mail-delimiter) nil t)
+ (re-search-backward (concat "^" message-unix-mail-delimiter) nil t)
(setq start (point))
(forward-line 1)
(or (and (re-search-forward
- (concat "^" rmail-unix-mail-delimiter) nil t)
+ (concat "^" message-unix-mail-delimiter) nil t)
(forward-line -1))
(goto-char (point-max)))
(setq stop (point))
(save-restriction
(narrow-to-region
(save-excursion
- (re-search-backward (concat "^" rmail-unix-mail-delimiter) nil t)
+ (re-search-backward (concat "^" message-unix-mail-delimiter) nil t)
(if leave-delim (progn (forward-line 1) (point))
(match-beginning 0)))
(progn
(forward-line 1)
- (or (and (re-search-forward (concat "^" rmail-unix-mail-delimiter)
+ (or (and (re-search-forward (concat "^" message-unix-mail-delimiter)
nil t)
(if (and (not (bobp)) leave-delim)
(progn (forward-line -2) (point))
(let* ((nnmail-split-methods
(if group (list (list group "")) nnmail-split-methods))
(group-art (nreverse (nnmail-article-group 'nnmbox-active-number)))
- (delim (concat "^" rmail-unix-mail-delimiter)))
+ (delim (concat "^" message-unix-mail-delimiter)))
(goto-char (point-min))
;; This might come from somewhere else.
(unless (looking-at delim)
(= (buffer-size) (nth 7 (file-attributes nnmbox-mbox-file)))))
()
(save-excursion
- (let ((delim (concat "^" rmail-unix-mail-delimiter))
+ (let ((delim (concat "^" message-unix-mail-delimiter))
(alist nnmbox-group-alist)
start end number)
(set-buffer (setq nnmbox-mbox-buffer
;;; Code:
(require 'nnheader)
-(require 'rmail)
(require 'nnmail)
(require 'gnus)
(require 'nnoo)
(let ((active (cadr (assoc group nnml-group-alist))))
;; The group wasn't known to nnml, so we just create an active
;; entry for it.
- (or active
- (progn
- (setq active (cons 1 0))
- (setq nnml-group-alist (cons (list group active) nnml-group-alist))))
+ (unless active
+ ;; Perhaps the active file was corrupt? See whether
+ ;; there are any articles in this group.
+ (unless nnml-article-file-alist
+ (setq nnml-article-file-alist
+ (sort
+ (nnheader-article-to-file-alist nnml-current-directory)
+ (lambda (a1 a2) (< (car a1) (car a2))))))
+ (setq active
+ (if nnml-article-file-alist
+ (cons (caar nnml-article-file-alist)
+ (car (last nnml-article-file-alist)))
+ (cons 1 0)))
+ (setq nnml-group-alist (cons (list group active) nnml-group-alist)))
(setcdr active (1+ (cdr active)))
(while (file-exists-p
(concat (nnmail-group-pathname group nnml-directory)
((= format ?n)
"^#! *rnews +[0-9]+ *$")
((= format ?m)
- (concat "^" rmail-unix-mail-delimiter))
+ (concat "^" message-unix-mail-delimiter))
((= format ?M)
"^\^A\^A\^A\^A\n")
(t
(if (or gnus-nov-is-evil nnspool-nov-is-evil)
nil
(let ((nov (nnheader-group-pathname
- nnspool-current-group nnspool-nov-directory ".overview")))
+ nnspool-current-group nnspool-nov-directory ".overview"))
+ (arts articles)
+ last)
(if (not (file-exists-p nov))
()
(save-excursion
(forward-line 1))
(delete-region (point) (point-max))
;; If the buffer is empty, this wasn't very successful.
- (not (zerop (buffer-size))))))))))
+ (unless (zerop (buffer-size))
+ ;; We check what the last article number was. The NOV file
+ ;; may be out of sync with the articles in the group.
+ (forward-line -1)
+ (setq last (read (current-buffer)))
+ (if (= last (car articles))
+ ;; Yup, it's all there.
+ t
+ ;; Perhaps not. We try to find the missing articles.
+ (while (and arts
+ (<= last (car arts)))
+ (pop arts))
+ ;; The articles in `arts' are missing from the buffer.
+ (while arts
+ (nnspool-insert-nov-head (pop arts)))
+ t)))))))))
+
+(defun nnspool-insert-nov-head (article)
+ "Read the head of ARTICLE, convert to NOV headers, and insert."
+ (save-excursion
+ (let ((cur (current-buffer))
+ buf)
+ (setq buf (nnheader-set-temp-buffer " *nnspool head*"))
+ (when (nnheader-insert-head
+ (nnspool-article-pathname nnspool-current-group article))
+ (nnheader-insert-article-line article)
+ (let ((headers (nnheader-parse-head)))
+ (set-buffer cur)
+ (goto-char (point-max))
+ (nnheader-insert-nov headers)))
+ (kill-buffer buf))))
(defun nnspool-find-nov-line (article)
(let ((max (point-max))
;; Add this group to the list of component groups.
(setq nnvirtual-component-groups
(cons group
- (delete group nnvirtual-component-groups))))))
+ (delete group nnvirtual-component-groups)))))
+ (setq nnvirtual-component-groups
+ (delete (nnvirtual-current-group)
+ nnvirtual-component-groups)))
(if (not nnvirtual-component-groups)
(nnheader-report 'nnvirtual "No component groups: %s" server)
t)))
header)
(erase-buffer)
(while (setq header (pop headers))
- (insert (int-to-string (mail-header-number header)) "\t"
- (or (mail-header-subject header) "") "\t"
- (or (mail-header-from header) "") "\t"
- (or (mail-header-date header) "") "\t"
- (or (mail-header-id header) "") "\t"
- (or (mail-header-references header) "") "\t"
- (int-to-string (or (mail-header-chars header) 0)) "\t"
- (int-to-string (or (mail-header-lines header) 0)) "\t"
- (if (mail-header-xref header)
- (concat "Xref: " (mail-header-xref header) "\t")
- "") "\n")))))
+))))
(defun nnvirtual-possibly-change-server (server)
(or (not server)
g n (and (memq n unreads) t)
(inline (nnvirtual-marks n marks))))
(gnus-uncompress-range active))))
- (setq nnvirtual-component-groups
- (delete (nnvirtual-current-group)
- nnvirtual-component-groups))))
+ nnvirtual-component-groups))
(lambda (m1 m2)
(< (car m1) (car m2)))))
- (i 0))
+ (i 0))
(setq nnvirtual-mapping map)
;; Set the virtual article numbers.
(while (setq m (pop map))
called with the same of the file to store the article in. The default
function is @code{rmail-output} which saves in the Unix mailbox format.
-@item gnus-mail-self-blind
-@vindex gnus-mail-self-blind
-Non-@code{nil} means insert a BCC header in all outgoing articles
-pointing to yourself. This will result you receiving a copy of the
-article mailed to yourself. The BCC header is inserted when the post
-buffer is initialized, so you can remove or alter the BCC header to
-override the default.
-
@item gnus-outgoing-message-group
@vindex gnus-outgoing-message-group
All outgoing messages will be put in this group. If you want to store