+Thu May 25 05:34:16 1995 Lars Magne Ingebrigtsen <larsi@bera.ifi.uio.no>
+
+ * gnus.el (gnus-article-date-ut): Ignore missing dates.
+ (gnus-group-enter-directory): New command and keystroke.
+
+ * nnspool.el (nnspool-retrieve-headers-with-nov): Don't be picky
+ on dirs.
+
+ * gnus-mh.el (gnus-mail-forward-using-mhe): Make better Subject.
+
+ * gnus.el (gnus-score-find-alist): New function.
+ (gnus-score-score-files): ADAPT files would nix out all other
+ files.
+ (gnus-score-score-files): Would not find any when short names were
+ used.
+
+Sat May 20 06:45:04 1995 Sudish Joseph <joseph@cis.ohio-state.edu>
+
+ * gnus-score.el (gnus-score-find-alist): New function.
+ (gnus-possibly-score-headers): Use it.
+
+ * gnus.el (gnus-score-file-(single|multiple)-match-alist): New
+ variables.
+
+Thu May 25 03:44:53 1995 Lars Magne Ingebrigtsen <larsi@bera.ifi.uio.no>
+
+ * gnus-kill.el (gnus-expunge): Would infloop.
+
+ * nnspool.el (nnspool-inews-sentinel): Did not kill the error
+ buffer.
+
+ * nnmail.el (nnmail-article-group): Would but out on function in
+ the split method.
+
+ * nnmh.el (nnmh-get-new-mail): Don't rescan if already scanned.
+
+ * nnml.el (nnml-get-new-mail): Ditto.
+
+ * gnus.el (gnus-start-news-server): Don't let the nnmh backend
+ fetch new mail.
+
+Wed May 24 07:59:39 1995 Lars Ingebrigtsen <lars@eyesore.no>
+
+ * nneething.el: New backend.
+
Wed May 24 02:35:49 1995 Lars Magne Ingebrigtsen <larsi@gymir.ifi.uio.no>
+ * gnus.el: 0.76 is released.
+
* nnfolder.el (nnfolder-close-group): New version. Don't close if
already closed.
DGNUS.el =gnus-cache.el gnus-cite.el gnus-ems.el \
gnus-kill.el gnus-mh.el gnus-msg.el gnus-score.el gnus-uu.el \
- gnus-vis.el gnus-vm.el gnus.el nnbabyl.el nndigest.el nndir.el \
- nndoc.el nnfolder.el nnheader.el nnkiboze.el nnmail.el nnmbox.el \
- nnmh.el nnml.el nnspool.el nntp.el nnvirtual.el
+ gnus-vis.el gnus-vm.el gnus.el nnbabyl.el nndigest.el \
+ nndir.el nndoc.el nnfolder.el nnheader.el nnkiboze.el \
+ nnmail.el nnmbox.el nnmh.el nnml.el nnspool.el nntp.el \
+ nnvirtual.el nneething.el
DGNUS.elc =$(DGNUS.el:.el=.elc)
gnus-score.elc: gnus.el
gnus-uu.elc: gnus-msg.el
gnus-uu.elc: gnus.el
-#gnus-vis.elc: gnus-easymenu.el
gnus-vis.elc: gnus.el
gnus-vm.elc: gnus-msg.el
gnus-vm.elc: gnus.el
nndir.elc: nnheader.el
nndir.elc: nnmh.el
nndir.elc: nnml.el
+nneething.elc: nnheader.el
+nneething.elc: nnmail.el
nndoc.elc: nnheader.el
nndoc.elc: nnmail.el
nnfolder.elc: gnus.el
(while funcs
(or (fboundp (car funcs))
(fset (car funcs) 'gnus-dummy-func))
- (setq funcs (cdr funcs)))))
- ))
+ (setq funcs (cdr funcs))))))
+ (or (fboundp 'file-regular-p)
+ (defun file-regular-p (file)
+ (and (not (file-directory-p file))
+ (not (file-symlink-p file))
+ (file-exists-p file))))
+ )
(defun gnus-ems-redefine ()
(cond
"/" gnus-kill-file-name)
(or gnus-kill-files-directory "~/News")))))
-(defalias 'gnus-expunge 'gnus-summary-remove-lines-marked-with)
+(defun gnus-expunge (marks)
+ "Remove lines marked with MARKS."
+ (save-excursion
+ (set-buffer gnus-summary-buffer)
+ (gnus-summary-remove-lines-marked-with marks)))
(defun gnus-apply-kill-file-internal ()
"Apply a kill file to the current newsgroup.
(defun gnus-mail-forward-using-mhe (&optional buffer)
"Forward the current message to another user using mh-e."
;; First of all, prepare mhe mail buffer.
- (let ((to (read-string "To: "))
- (cc (read-string "Cc: "))
- (buffer (or buffer gnus-article-buffer))
- subject
- (config (current-window-configuration))) ;; need to add this - erik
- ;;(gnus-article-show-all-headers)
- (setq subject
- (concat "[" gnus-newsgroup-name "] "
- ;;(mail-strip-quoted-names (gnus-fetch-field "From")) ": "
- (or (gnus-fetch-field "subject") "")))
+ (let* ((to (read-string "To: "))
+ (cc (read-string "Cc: "))
+ (buffer (or buffer gnus-article-buffer))
+ (config (current-window-configuration)) ;; need to add this - erik
+ (subject (gnus-forward-make-subject buffer)))
(setq mh-show-buffer buffer)
(mh-find-path)
(mh-send-sub to (or cc "") (or subject "(None)") config) ;; Erik Selberg 1/23/94
newsgroup name. (In that case, `gnus-signature-file' and
`mail-signature' should both be set to nil).")
+(defvar gnus-post-prepare-hook nil
+ "*Hook that is run after a post buffer has been prepared.
+If you want to insert the signature, you might put
+`gnus-inews-insert-signature' in this hook.")
+
(defvar gnus-use-followup-to 'use
"*Specifies what to do with Followup-To header.
If nil, ignore the header. If it is t, use its value, but ignore
(gnus-summary-remove-process-mark (car yank)))
(let ((mail-reply-buffer gnus-article-copy))
(news-reply-yank-original nil))
- (setq yank (cdr yank))))))
- (if gnus-post-prepare-function
- (funcall gnus-post-prepare-function group)))
+ (setq yank (cdr yank)))))))
+ (if gnus-post-prepare-function
+ (funcall gnus-post-prepare-function group))
+ (run-hooks 'gnus-post-prepare-hook)
(make-local-variable 'gnus-prev-winconf)
(setq gnus-prev-winconf winconf))))
(setq gnus-article-check-size (cons (buffer-size) (gnus-article-checksum)))
(replace-match "" t t))
(funcall gnus-mail-send-method))
- (gnus-message 5 "Sending via mail... done")
+ (gnus-message 5 "Sending via mail...done")
(goto-char (point-min))
(narrow-to-region
(gnus-message 5 "Posting to USENET...")
(if (gnus-inews-article use-group-method)
(progn
- (gnus-message 5 "Posting to USENET... done")
+ (gnus-message 5 "Posting to USENET...done")
(if (gnus-buffer-exists-p (car-safe reply))
(progn
(save-excursion
;; Send the control article to NNTP server.
(gnus-message 5 "Canceling your article...")
(if (gnus-inews-article)
- (gnus-message 5 "Canceling your article... done")
+ (gnus-message 5 "Canceling your article...done")
(ding)
(gnus-message 1 "Cancel failed; %s"
(gnus-status-message gnus-newsgroup-name)))
["Make a kiboze group" gnus-group-make-kiboze-group t]
["Make a virtual group" gnus-group-make-empty-virtual t]
["Add a group to a virtual" gnus-group-add-to-virtual t])
+ ["Read a directory as a group" gnus-group-enter-directory t]
["Jump to group" gnus-group-jump-to-group t]
["Best unread group" gnus-group-best-unread-group t]
))
("cancel" . gnus-summary-cancel-article)
"misc"
("exit" . gnus-summary-exit)
- ("fed up" . gnus-summary-catchup-and-goto-next)))
+ ("fed up" . gnus-summary-catchup-and-goto-next-group)))
(defvar gnus-carpal-server-buffer-buttons
'(("add" . gnus-server-add-server)
(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 (concat "[" gnus-newsgroup-name "] "
- (or (gnus-fetch-field "Subject") ""))))
+ (let* ((gnus-buffer (or buffer (current-buffer)))
+ (subject (gnus-forward-make-subject gnus-buffer)))
(or (featurep 'win-vm)
(if gnus-use-full-window
(pop-to-buffer gnus-article-buffer)
(defvar gnus-asynchronous-article-function nil
"*Function for picking articles to pre-fetch, possibly.")
+(defvar gnus-score-file-single-match-alist nil
+ "*Alist mapping regexps to lists of score files.
+Each element of this alist should be of the form
+ (\"REGEXP\" [ \"SCORE-FILE-1\" ] [ \"SCORE-FILE-2\" ] ... )
+
+If the name of a group is matched by REGEXP, the corresponding scorefiles
+will be used for that group.
+The first match found is used, subsequent matching entries are ignored (to
+use mutliple matches, see gnus-score-file-multiple-match-alist).
+
+These score files are loaded in addition to any files returned by
+gnus-score-find-score-files-function (which see).")
+
+(defvar gnus-score-file-multiple-match-alist nil
+ "*Alist mapping regexps to lists of score files.
+Each element of this alist should be of the form
+ (\"REGEXP\" [ \"SCORE-FILE-1\" ] [ \"SCORE-FILE-2\" ] ... )
+
+If the name of a group is matched by REGEXP, the corresponding scorefiles
+will be used for that group.
+If multiple REGEXPs match a group, the score files corresponding to each
+match will be used (for only one match to be used, see
+gnus-score-file-single-match-alist).
+
+These score files are loaded in addition to any files returned by
+gnus-score-find-score-files-function (which see).")
+
+
(defvar gnus-score-file-suffix "SCORE"
"*Suffix of the score files.")
("nnml" mail respool)
("nnmh" mail respool)
("nndir" none prompt-address address)
+ ("nneething" none prompt-address)
("nndigest" none)
("nndoc" none prompt-address)
("nnbabyl" mail respool)
(define-key gnus-group-group-map "p" 'gnus-group-edit-group-parameters)
(define-key gnus-group-group-map "v" 'gnus-group-add-to-virtual)
(define-key gnus-group-group-map "V" 'gnus-group-make-empty-virtual)
+ (define-key gnus-group-group-map "D" 'gnus-group-enter-directory)
(define-prefix-command 'gnus-group-list-map)
(define-key gnus-group-mode-map "A" 'gnus-group-list-map)
(interactive "P")
(gnus-group-read-group all t))
+;; Enter a group that is not in the group buffer. Non-nil is returned
+;; if selection was successful.
+(defun gnus-group-read-ephemeral-group
+ (group method &optional activate quit-config)
+ (let ((group (if (gnus-group-foreign-p group) group
+ (gnus-group-prefixed-name group method))))
+ (gnus-sethash
+ group
+ (list t nil (list group gnus-level-default-subscribed nil nil
+ (append method
+ (list
+ (list 'quit-config
+ (if quit-config quit-config
+ (cons (current-buffer) 'summary)))))))
+ gnus-newsrc-hashtb)
+ (set-buffer gnus-group-buffer)
+ (if activate (gnus-request-group group (nth 1 method)))
+ (condition-case ()
+ (gnus-group-read-group t t group)
+ (error nil)
+ (quit nil))
+ (not (equal major-mode 'gnus-group-mode))))
+
(defun gnus-group-jump-to-group (group)
"Jump to newsgroup GROUP."
(interactive (list (completing-read "Group: " gnus-active-hashtb nil
(forward-line -1)
(gnus-group-position-cursor)))
+(defun gnus-group-enter-directory (dir)
+ "Enter an ephemeral nneething group."
+ (interactive "DDirectory to read: ")
+ (let* ((method (list 'nneething dir))
+ (leaf (gnus-group-prefixed-name
+ (file-name-nondirectory (directory-file-name dir))
+ method))
+ (name leaf)
+ (num 0))
+ (while (gnus-gethash name gnus-newsrc-hashtb)
+ (setq name (concat leaf "<" (int-to-string (setq num (1+ num))) ">")))
+ (let ((nneething-read-only t))
+ (or (gnus-group-read-ephemeral-group
+ name method t
+ (cons (current-buffer) (if (eq major-mode 'gnus-summary-mode)
+ 'summary 'group)))
+ (error "Couldn't enter %s" dir)))))
+
;; Group sorting commands
;; Suggested by Joe Hildebrand <hildjj@idaho.fuentez.com>.
(defun gnus-browse-read-group (&optional no-article)
"Enter the group at the current line."
(interactive)
- (let ((group (gnus-browse-group-name))
- (buf (current-buffer)))
- (set-buffer gnus-group-buffer)
- (gnus-sethash
- group
- (list t nil
- (list group gnus-level-default-subscribed nil nil
- (cons (cons 'quit-config (current-window-configuration))
- gnus-browse-current-method)))
- gnus-newsrc-hashtb)
- (condition-case ()
- (gnus-group-read-group t no-article group)
- (error nil)
- (quit nil))
- (if (not (equal major-mode 'gnus-group-mode))
- ()
- (switch-to-buffer buf)
- (gnus-configure-windows 'browse)
- (gnus-message 3 "Article not a digest?"))))
+ (let ((group (gnus-browse-group-name)))
+ (or (gnus-group-read-ephemeral-group
+ group gnus-browse-current-method nil
+ (cons (current-buffer) 'browse))
+ (error "Couldn't enter %s" group))))
(defun gnus-browse-select-group ()
"Select the current group."
(funcall 'gnus-score-save))
;; Do not switch windows but change the buffer to work.
(set-buffer gnus-group-buffer)
- (or (eq 'nndigest method)
+ (or (assoc 'quit-config (gnus-find-method-for-group gnus-newsgroup-name))
(gnus-group-update-group group)))))
(defun gnus-summary-exit (&optional temporary)
(gnus-set-global-variables)
(gnus-kill-save-kill-buffer)
(let* ((group gnus-newsgroup-name)
- (quit-config (cdr (assoc 'quit-config (gnus-find-method-for-group
- gnus-newsgroup-name))))
+ (quit-config (nth 1 (assoc 'quit-config (gnus-find-method-for-group
+ gnus-newsgroup-name))))
(mode major-mode)
(method (car (gnus-find-method-for-group group)))
(buf (current-buffer)))
(gnus-summary-update-info) ; Make all changes in this group permanent.
;; Make sure where I was, and go to next newsgroup.
- (if (eq method 'nndigest)
- ()
- (gnus-group-jump-to-group group)
- (gnus-group-next-unread-group 1))
+ (or quit-config
+ (progn
+ (gnus-group-jump-to-group group)
+ (gnus-group-next-unread-group 1)))
(if temporary
nil ;Nothing to do.
;; We set all buffer-local variables to nil. It is unclear why
(bury-buffer gnus-article-buffer))
(setq gnus-current-select-method gnus-select-method)
(pop-to-buffer gnus-group-buffer)
- (if (eq method 'nndigest)
- ()
- (gnus-group-jump-to-group group)
- (gnus-group-next-unread-group 1))
- (if (gnus-buffer-exists-p quit-config)
+ (if (not quit-config)
(progn
- (set-window-configuration quit-config)
- (and (eq major-mode 'gnus-summary-mode)
- (gnus-set-global-variables)))))))
+ (gnus-group-jump-to-group group)
+ (gnus-group-next-unread-group 1))
+ (if (not (buffer-name (car quit-config)))
+ (gnus-configure-windows 'group)
+ (set-buffer (car quit-config))
+ (and (eq major-mode 'gnus-summary-mode)
+ (gnus-set-global-variables))
+ (gnus-configure-windows (cdr quit-config)))))))
(defalias 'gnus-summary-quit 'gnus-summary-exit-no-update)
(defun gnus-summary-exit-no-update (&optional no-questions)
"Quit reading current newsgroup without updating read article info."
(interactive)
(let* ((group gnus-newsgroup-name)
- (quit-config (cdr (assoc 'quit-config
- (gnus-find-method-for-group group)))))
+ (quit-config (nth 1 (assoc 'quit-config
+ (gnus-find-method-for-group group)))))
(if (or no-questions
gnus-expert-user
(gnus-y-or-n-p "Do you really wanna quit reading this group? "))
(bury-buffer gnus-article-buffer))
(if (equal (gnus-group-group-name) group)
(gnus-group-next-unread-group 1))
- (if (gnus-buffer-exists-p quit-config)
+ (if quit-config
(progn
- (set-window-configuration quit-config)
- (and (eq major-mode 'gnus-summary-mode)
- (gnus-set-global-variables))))))))
+ (if (not (buffer-name (car quit-config)))
+ (gnus-configure-windows 'group)
+ (set-buffer (car quit-config))
+ (and (eq major-mode 'gnus-summary-mode)
+ (gnus-set-global-variables))
+ (gnus-configure-windows (cdr quit-config)))))))))
;; Suggested by Andrew Eskilsson <pi92ae@pt.hk-r.se>.
(defun gnus-summary-fetch-faq (group)
;; The requested article is different from the current article.
(progn
(gnus-summary-display-article article all-headers)
- (gnus-configure-windows 'article)
(setq did article))
(if all-headers (gnus-article-show-all-headers))
- (gnus-configure-windows 'article)
nil))
- (if did (gnus-article-set-window-start
- (cdr (assq article gnus-newsgroup-bookmarks)))))))
+ (if did
+ (gnus-article-set-window-start
+ (cdr (assq article gnus-newsgroup-bookmarks)))))))
(defun gnus-summary-set-current-mark (&optional current-mark)
"Obsolete function."
gnus-newsgroup-end)))
;; Go to next/previous group.
(t
- (or (eq method 'nndigest)
+ (or (assoc 'quit-config (gnus-find-method-for-group gnus-newsgroup-name))
(gnus-summary-jump-to-group gnus-newsgroup-name))
(let ((cmd (aref (this-command-keys) 0))
(group
(gnus-message 7 "No more%s articles" (if unread " unread" "")))
((eq gnus-auto-select-next 'quietly)
;; Select quietly.
- (if (eq method 'nndigest)
+ (if (assoc 'quit-config (gnus-find-method-for-group
+ gnus-newsgroup-name))
(gnus-summary-exit)
(gnus-message 7 "No more%s articles (%s)..."
(if unread " unread" "")
(while (or (null key) (memq key keystrokes))
(gnus-message
7 "No more%s articles%s" (if unread " unread" "")
- (if (and group (not (eq method 'nndigest)))
+ (if (and group (not (assoc 'quit-config
+ (gnus-find-method-for-group
+ gnus-newsgroup-name))))
(format " (Type %s for %s [%s])"
(single-key-description cmd) group
(car (gnus-gethash group gnus-newsrc-hashtb)))
(setq group (gnus-group-group-name))
(switch-to-buffer obuf)))))
(if (eq key cmd)
- (if (or (not group) (eq method 'nndigest))
+ (if (or (not group) (assoc 'quit-config
+ (gnus-find-method-for-group
+ gnus-newsgroup-name)))
(gnus-summary-exit)
(gnus-summary-next-group nil group backward))
(setq unread-command-events (list key)))))))))))
(not (equal (car gnus-article-current) gnus-newsgroup-name)))
;; Selected subject is different from current article's.
(gnus-summary-display-article article)
- (gnus-configure-windows 'article)
(gnus-eval-in-buffer-window
gnus-article-buffer
(setq endp (gnus-article-next-page lines)))
(not (equal (car gnus-article-current) gnus-newsgroup-name)))
;; Selected subject is different from current article's.
(gnus-summary-display-article article)
- (gnus-configure-windows 'article)
(gnus-summary-recenter)
(gnus-eval-in-buffer-window gnus-article-buffer
(gnus-article-prev-page lines))))
gnus-newsgroup-name (list 'nndigest ""))
gnus-current-article))
(buf (current-buffer)))
- (set-buffer gnus-group-buffer)
- (gnus-sethash
- name
- (list t nil (list name gnus-level-default-subscribed nil nil
- (list 'nndigest gnus-article-buffer
- (cons 'quit-config
- (current-window-configuration)))))
- gnus-newsrc-hashtb)
- (condition-case ()
- (gnus-group-read-group t nil name)
- (error nil)
- (quit nil))
- (if (not (equal major-mode 'gnus-group-mode))
+ (if (gnus-group-read-ephemeral-group
+ name (list 'nndigest gnus-article-buffer))
()
(switch-to-buffer buf)
(gnus-set-global-variables)
(gnus-configure-windows 'summary)
(gnus-message 3 "Article not a digest?"))))
-
+
(defun gnus-summary-isearch-article ()
"Do incremental search forward on current article."
(interactive)
(interactive "sMarks: ")
;; Fix by Sudish Joseph <joseph@cis.ohio-state.edu>.
(gnus-set-global-variables)
- (save-excursion
- (set-buffer gnus-summary-buffer)
- (let ((buffer-read-only nil)
- (marks (concat "^[" marks "]")))
+ (let ((buffer-read-only nil)
+ (marks (concat "^[" marks "]")))
+ (goto-char (point-min))
+ (if gnus-newsgroup-adaptive
+ (gnus-score-remove-lines-adaptive marks)
+ (while (re-search-forward marks nil t)
+ (gnus-delete-line)))
+ ;; If we use dummy roots, we have to do an additional sweep over
+ ;; the buffer.
+ (if (not (eq gnus-summary-make-false-root 'dummy))
+ ()
(goto-char (point-min))
- (if gnus-newsgroup-adaptive
- (gnus-score-remove-lines-adaptive marks)
- (while (re-search-forward marks nil t)
- (gnus-delete-line)))
- ;; If we use dummy roots, we have to do an additional sweep over
- ;; the buffer.
- (if (not (eq gnus-summary-make-false-root 'dummy))
- ()
- (goto-char (point-min))
- (setq marks (concat "^[" (char-to-string gnus-dummy-mark) "]"))
- (while (re-search-forward marks nil t)
- (if (gnus-subject-equal
- (gnus-summary-subject-string)
- (progn
- (forward-line 1)
- (gnus-summary-subject-string)))
- ()
- (forward-line -1)
- (gnus-delete-line))))))
+ (setq marks (concat "^[" (char-to-string gnus-dummy-mark) "]"))
+ (while (re-search-forward marks nil t)
+ (if (gnus-subject-equal
+ (gnus-summary-subject-string)
+ (progn
+ (forward-line 1)
+ (gnus-summary-subject-string)))
+ ()
+ (forward-line -1)
+ (gnus-delete-line))))))
(or (zerop (buffer-size))
(if (eobp)
(gnus-summary-prev-subject 1)
- (gnus-summary-position-cursor))))
+ (gnus-summary-position-cursor)))
(defun gnus-summary-expunge-below (score)
"Remove articles with score less than SCORE."
;; If the article number is negative, that means that this article
;; doesn't belong in this newsgroup (possibly), so we find its
;; message-id and request it by id instead of number.
- (if (and (numberp article) (< article 0))
- (save-excursion
- (set-buffer gnus-summary-buffer)
- (let ((header (gnus-gethash (int-to-string article)
- gnus-newsgroup-headers-hashtb-by-number)))
- (if (vectorp header)
- ;; It's a real article.
- (setq article (header-id header))
- ;; It is an extracted pseudo-article.
- (setq article nil)
- (gnus-request-pseudo-article header)))))
+ (if (not (numberp article))
+ ()
+ (save-excursion
+ (set-buffer gnus-summary-buffer)
+ (let ((header (gnus-get-header-by-number article)))
+ (if (< article 0)
+ (if (vectorp header)
+ ;; It's a real article.
+ (setq article (header-id header))
+ ;; It is an extracted pseudo-article.
+ (setq article 'pseudo)
+ (gnus-request-pseudo-article header)))
+
+ (let ((method (gnus-find-method-for-group gnus-newsgroup-name)))
+ (if (not (eq (car method) 'nneething))
+ ()
+ (let ((dir (concat (file-name-as-directory (nth 1 method))
+ (header-subject header))))
+ (if (file-directory-p dir)
+ (progn
+ (setq article 'nneething)
+ (gnus-group-enter-directory dir)))))))))
;; Check the cache.
(if (and gnus-use-cache
(gnus-cache-request-article article group))
'article
;; Get the article and into the article buffer.
- (if article
+ (if (or (stringp article) (numberp article))
(progn
(erase-buffer)
(let ((gnus-override-method
(and (stringp article) gnus-refer-article-method)))
(and (gnus-request-article article group (current-buffer))
'article)))
- 'pseudo)))
+ article)))
(defun gnus-read-header (id)
"Read the headers of article ID and enter them into the Gnus system."
(setq gnus-article-current
(cons gnus-newsgroup-name article)))
nil)
- (if (not (eq result 'article))
+ (if (or (eq result 'pseudo) (eq result 'nneething))
(progn
(save-excursion
(set-buffer summary-buffer)
gnus-current-article 0
gnus-current-headers nil
gnus-article-current nil)
- (gnus-configure-windows 'article)
+ (if (eq result 'nneething)
+ (gnus-configure-windows 'summary)
+ (gnus-configure-windows 'article))
(gnus-set-global-variables))
(gnus-set-mode-line 'article))
;; The result from the `request' was an actual article -
(interactive (list 'ut))
(let ((date (header-date (or gnus-current-headers
(gnus-get-header-by-number
- (gnus-summary-article-number)))))
+ (gnus-summary-article-number))"")))
(date-regexp "^Date: \\|^X-Sent: "))
- (save-excursion
- (set-buffer gnus-article-buffer)
- (let ((buffer-read-only nil))
- (goto-char (point-min))
- (if (and (re-search-forward date-regexp nil t)
- (progn
- (beginning-of-line)
- (looking-at date-regexp)))
- (delete-region (gnus-point-at-bol)
- (progn (end-of-line) (1+ (point))))
+ (if (not date)
+ ()
+ (save-excursion
+ (set-buffer gnus-article-buffer)
+ (let ((buffer-read-only nil))
(goto-char (point-min))
- (goto-char (- (search-forward "\n\n") 2)))
- (insert
- (cond
- ((eq type 'local)
- (concat "Date: " (timezone-make-date-arpa-standard date) "\n"))
- ((eq type 'ut)
- (concat "Date: " (timezone-make-date-arpa-standard date nil "UT")
- "\n"))
- ((eq type 'lapsed)
- (let* ((sec (- (gnus-seconds-since-epoch
- (timezone-make-date-arpa-standard
- (current-time-string) (current-time-zone) "UT"))
- (gnus-seconds-since-epoch
- (timezone-make-date-arpa-standard date nil "UT"))))
- (units (list (cons 'year (* 365.25 24 60 60))
- (cons 'week (* 7 24 60 60))
- (cons 'day (* 24 60 60))
- (cons 'hour (* 60 60))
- (cons 'minute 60)
- (cons 'second 1)))
- num prev)
- (concat
- "X-Sent: "
- (mapconcat
- (lambda (unit)
- (if (zerop (setq num (ffloor (/ sec (cdr unit)))))
- ""
- (setq sec (- sec (* num (cdr unit))))
- (prog1
- (concat (if prev ", " "") (int-to-string (floor num))
- " " (symbol-name (car unit))
- (if (> num 1) "s" ""))
- (setq prev t))))
- units "")
- " ago\n")))
- (t
- (error "Unknown conversion type: %s" type))))))))
+ (if (and (re-search-forward date-regexp nil t)
+ (progn
+ (beginning-of-line)
+ (looking-at date-regexp)))
+ (delete-region (gnus-point-at-bol)
+ (progn (end-of-line) (1+ (point))))
+ (goto-char (point-min))
+ (goto-char (- (search-forward "\n\n") 2)))
+ (insert
+ (cond
+ ((eq type 'local)
+ (concat "Date: " (timezone-make-date-arpa-standard date) "\n"))
+ ((eq type 'ut)
+ (concat "Date: " (timezone-make-date-arpa-standard date nil "UT")
+ "\n"))
+ ((eq type 'lapsed)
+ (let* ((sec (- (gnus-seconds-since-epoch
+ (timezone-make-date-arpa-standard
+ (current-time-string) (current-time-zone) "UT"))
+ (gnus-seconds-since-epoch
+ (timezone-make-date-arpa-standard date nil "UT"))))
+ (units (list (cons 'year (* 365.25 24 60 60))
+ (cons 'week (* 7 24 60 60))
+ (cons 'day (* 24 60 60))
+ (cons 'hour (* 60 60))
+ (cons 'minute 60)
+ (cons 'second 1)))
+ num prev)
+ (concat
+ "X-Sent: "
+ (mapconcat
+ (lambda (unit)
+ (if (zerop (setq num (ffloor (/ sec (cdr unit)))))
+ ""
+ (setq sec (- sec (* num (cdr unit))))
+ (prog1
+ (concat (if prev ", " "") (int-to-string (floor num))
+ " " (symbol-name (car unit))
+ (if (> num 1) "s" ""))
+ (setq prev t))))
+ units "")
+ " ago\n")))
+ (t
+ (error "Unknown conversion type: %s" type)))))))))
(defun gnus-article-date-local ()
"Convert the current article date to the local timezone."
(file-name-as-directory
(expand-file-name
(concat "~/" (substring
- gnus-nntp-server 1)))))))
+ gnus-nntp-server 1)))))
+ (list 'nnmh-get-new-mail nil)))
(t
(list 'nntp gnus-nntp-server)))))
(setq suffix (car suffixes)
suffixes (cdr suffixes))
(if (file-exists-p (concat dir "/" suffix))
- (setq files (list (concat dir "/" suffix))))
+ (setq files (cons (concat dir "/" suffix) files)))
(while (>= (1+ (length dir)) mdir)
(and (file-exists-p (concat dir "/all/" suffix))
(setq files (cons (concat dir "/all/" suffix) files)))
(goto-char (point-max))
(search-backward "/")
(delete-region (1+ (point)) (point-min)))
+ ;; If short file names were used, we have to translate slashes.
+ (goto-char (point-min))
+ (while (search-forward "/" nil t)
+ (replace-match "." t t))
;; Translate "all" to ".*".
(while (search-forward "all" nil t)
(replace-match ".*" t t))
(setq all (cons group all))
(mapcar 'gnus-score-file-name (nreverse all))))
+(defvar gnus-score-file-alist-cache nil)
+
+(defun gnus-score-find-alist (group)
+ "Return list of score files for GROUP.
+The list is determined from the variable gnus-score-file-alist."
+ (let ((alist gnus-score-file-multiple-match-alist)
+ score-files)
+ ;; if this group has been seen before, return the cached entry
+ (if (setq score-files (assoc group gnus-score-file-alist-cache))
+ (cdr score-files) ; ensures caching of groups with no matches
+ ;; handle the multiple match alist
+ (while alist
+ (and (string-match (car (car alist)) group)
+ (setq score-files
+ (nconc score-files (cdr (car alist)))))
+ (setq alist (cdr alist)))
+ (setq alist gnus-score-file-single-match-alist)
+ ;; handle the single match alist
+ (catch 'done
+ (while alist
+ (and (string-match (car (car alist)) group)
+ ;; progn used just in case ("regexp") has no files
+ ;; and score-files is still nil. -sj
+ ;; this can be construed as a "stop searching here" feature :>
+ ;; and used to simplify regexps in the single-alist
+ (progn
+ (setq score-files
+ (nconc score-files (cdr (car alist))))
+ (throw 'done nil)))
+ (setq alist (cdr alist))))
+ ;; cache the score files
+ (setq gnus-score-file-alist-cache
+ (cons (cons group score-files) gnus-score-file-alist-cache))
+ score-files)))
+
+
(defun gnus-possibly-score-headers (&optional trace)
(let ((func gnus-score-find-score-files-function)
score-files scores)
(setq func (list func)))
;; Go through all the functions for finding score files (or actual
;; scores) and add them to a list.
+ (setq score-files (gnus-score-find-alist gnus-newsgroup-name))
(while func
(and (symbolp (car func))
(fboundp (car func))
;;; Interface functions
-(defun nnbabyl-retrieve-headers (sequence &optional newsgroup server)
+(defun nnbabyl-retrieqve-headers (sequence &optional newsgroup server)
(save-excursion
(set-buffer nntp-server-buffer)
(erase-buffer)
(count 0)
article art-string start stop)
(nnbabyl-possibly-change-newsgroup newsgroup)
- (while sequence
- (setq article (car sequence))
- (setq art-string (nnbabyl-article-string article))
- (set-buffer nnbabyl-mbox-buffer)
- (if (or (search-forward art-string nil t)
- (search-backward art-string nil t))
- (progn
- (re-search-backward (concat "^" nnbabyl-mail-delimiter) nil t)
- (while (and (not (looking-at ".+:"))
- (zerop (forward-line 1))))
- (setq start (point))
- (search-forward "\n\n" nil t)
- (setq stop (1- (point)))
- (set-buffer nntp-server-buffer)
- (insert "221 " (int-to-string article) " Article retrieved.\n")
- (insert-buffer-substring nnbabyl-mbox-buffer start stop)
- (goto-char (point-max))
- (insert ".\n")))
- (setq sequence (cdr sequence))
- (setq count (1+ count))
+ (if (stringp (car sequence))
+ 'headers
+ (while sequence
+ (setq article (car sequence))
+ (setq art-string (nnbabyl-article-string article))
+ (set-buffer nnbabyl-mbox-buffer)
+ (if (or (search-forward art-string nil t)
+ (search-backward art-string nil t))
+ (progn
+ (re-search-backward (concat "^" nnbabyl-mail-delimiter) nil t)
+ (while (and (not (looking-at ".+:"))
+ (zerop (forward-line 1))))
+ (setq start (point))
+ (search-forward "\n\n" nil t)
+ (setq stop (1- (point)))
+ (set-buffer nntp-server-buffer)
+ (insert "221 " (int-to-string article) " Article retrieved.\n")
+ (insert-buffer-substring nnbabyl-mbox-buffer start stop)
+ (goto-char (point-max))
+ (insert ".\n")))
+ (setq sequence (cdr sequence))
+ (setq count (1+ count))
+ (and (numberp nnmail-large-newsgroup)
+ (> number nnmail-large-newsgroup)
+ (zerop (% count 20))
+ gnus-verbose-backends
+ (message "nnbabyl: Receiving headers... %d%%"
+ (/ (* count 100) number))))
+
(and (numberp nnmail-large-newsgroup)
(> number nnmail-large-newsgroup)
- (zerop (% count 20))
gnus-verbose-backends
- (message "nnbabyl: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (message "nnbabyl: Receiving headers...done"))
- (and (numberp nnmail-large-newsgroup)
- (> number nnmail-large-newsgroup)
- gnus-verbose-backends
- (message "nnbabyl: Receiving headers... done"))
-
- ;; Fold continuation lines.
- (goto-char (point-min))
- (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
- (replace-match " " t t))
- 'headers)))
+ ;; Fold continuation lines.
+ (goto-char (point-min))
+ (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+ (replace-match " " t t))
+ 'headers))))
(defun nnbabyl-open-server (server &optional defs)
(nnheader-init-server-buffer)
(defun nnbabyl-request-post (&optional server)
(mail-send-and-exit nil))
-(fset 'nnbabyl-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nnbabyl-request-post-buffer 'nnmail-request-post-buffer)
(defun nnbabyl-request-expire-articles (articles newsgroup &optional server force)
(nnbabyl-possibly-change-newsgroup newsgroup)
range
beg article)
(nndigest-possibly-change-buffer newsgroup)
- (while sequence
- (setq article (car sequence))
- (if (setq range (nndigest-narrow-to-article article))
- (progn
- (insert (format "221 %d Article retrieved.\n" article))
- (setq beg (point))
- (insert-buffer-substring nndigest-current-buffer
- (car range) (cdr range))
- (goto-char beg)
- (if (search-forward "\n\n" nil t)
- (forward-char -1)
- (goto-char (point-max))
- (insert "\n\n"))
- (insert (format "Lines: %d\n" (count-lines (point) (point-max))))
- (insert ".\n")
- (delete-region (point) (point-max))))
- (setq sequence (cdr sequence)))
-
- ;; Fold continuation lines.
- (goto-char (point-min))
- (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
- (replace-match " " t t))
- 'headers)))
+ (if (stringp (car sequence))
+ 'headers
+ (while sequence
+ (setq article (car sequence))
+ (if (setq range (nndigest-narrow-to-article article))
+ (progn
+ (insert (format "221 %d Article retrieved.\n" article))
+ (setq beg (point))
+ (insert-buffer-substring nndigest-current-buffer
+ (car range) (cdr range))
+ (goto-char beg)
+ (if (search-forward "\n\n" nil t)
+ (forward-char -1)
+ (goto-char (point-max))
+ (insert "\n\n"))
+ (insert (format "Lines: %d\n" (count-lines (point) (point-max))))
+ (insert ".\n")
+ (delete-region (point) (point-max))))
+ (setq sequence (cdr sequence)))
+
+ ;; Fold continuation lines.
+ (goto-char (point-min))
+ (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+ (replace-match " " t t))
+ 'headers))))
(defun nndigest-open-server (host &optional service)
(setq nndigest-status-string "")
(defun nndigest-request-post (&optional server)
(mail-send-and-exit nil))
-(fset 'nndigest-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nndigest-request-post-buffer 'nnmail-request-post-buffer)
\f
"Post a new news in current buffer."
(mail-send-and-exit nil))
-(fset 'nndir-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nndir-request-post-buffer 'nnmail-request-post-buffer)
(defun nndir-request-expire-articles (articles newsgroup &optional server force)
"Expire all articles in the ARTICLES list in group GROUP."
(count 0)
beg article art-string start stop lines)
(nndoc-possibly-change-buffer newsgroup server)
- (while sequence
- (setq article (car sequence))
- (set-buffer nndoc-current-buffer)
- (if (nndoc-search-for-article article)
- (progn
- (setq start
- (save-excursion
- (or
- (re-search-backward
- (concat "^" rmail-unix-mail-delimiter) nil t)
- (point-min))))
- (search-forward "\n\n" nil t)
- (setq lines (count-lines
- (point)
- (or
- (save-excursion
- (re-search-forward
- (concat "^" rmail-unix-mail-delimiter) nil t))
- (point-max))))
- (setq stop (1- (point)))
- (set-buffer nntp-server-buffer)
- (insert (format "221 %d Article retrieved.\n" article))
- (setq beg (point))
- (insert-buffer-substring nndoc-current-buffer start stop)
- (goto-char (point-max))
- (insert (format "Lines: %d\n" lines))
- (insert ".\n")))
- (setq sequence (cdr sequence)))
-
- ;; Fold continuation lines.
- (goto-char (point-min))
- (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
- (replace-match " " t t))
- 'headers)))
+ (if (stringp (car sequence))
+ 'headers
+ (while sequence
+ (setq article (car sequence))
+ (set-buffer nndoc-current-buffer)
+ (if (nndoc-search-for-article article)
+ (progn
+ (setq start
+ (save-excursion
+ (or
+ (re-search-backward
+ (concat "^" rmail-unix-mail-delimiter) nil t)
+ (point-min))))
+ (search-forward "\n\n" nil t)
+ (setq lines (count-lines
+ (point)
+ (or
+ (save-excursion
+ (re-search-forward
+ (concat "^" rmail-unix-mail-delimiter) nil t))
+ (point-max))))
+ (setq stop (1- (point)))
+ (set-buffer nntp-server-buffer)
+ (insert (format "221 %d Article retrieved.\n" article))
+ (setq beg (point))
+ (insert-buffer-substring nndoc-current-buffer start stop)
+ (goto-char (point-max))
+ (insert (format "Lines: %d\n" lines))
+ (insert ".\n")))
+ (setq sequence (cdr sequence)))
+
+ ;; Fold continuation lines.
+ (goto-char (point-min))
+ (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+ (replace-match " " t t))
+ 'headers))))
(defun nndoc-open-server (host &optional service)
"Open mbox backend."
(defun nndoc-request-post (&optional server)
(mail-send-and-exit nil))
-(fset 'nndoc-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nndoc-request-post-buffer 'nnmail-request-post-buffer)
\f
;;; Internal functions.
(nnfolder-possibly-change-group newsgroup)
(set-buffer nnfolder-current-buffer)
(goto-char (point-min))
- (while sequence
- (setq article (car sequence))
- (setq art-string (nnfolder-article-string article))
- (set-buffer nnfolder-current-buffer)
- (if (or (search-forward art-string nil t)
- ;; Don't search the whole file twice! Also, articles
- ;; probably have some locality by number, so searching
- ;; backwards will be faster. Especially if we're at the
- ;; beginning of the buffer :-). -SLB
- (search-backward art-string nil t))
- (progn
- (setq start (or (re-search-backward delim-string nil t)
- (point)))
- (search-forward "\n\n" nil t)
- (setq stop (1- (point)))
- (set-buffer nntp-server-buffer)
- (insert (format "221 %d Article retrieved.\n" article))
- (setq beg (point))
- (insert-buffer-substring nnfolder-current-buffer start stop)
- (goto-char (point-max))
- (insert ".\n")))
- (setq sequence (cdr sequence)))
-
- ;; Fold continuation lines.
- (set-buffer nntp-server-buffer)
- (goto-char (point-min))
- (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
- (replace-match " " t t))
- 'headers)))
+ (if (stringp (car sequence))
+ 'headers
+ (while sequence
+ (setq article (car sequence))
+ (setq art-string (nnfolder-article-string article))
+ (set-buffer nnfolder-current-buffer)
+ (if (or (search-forward art-string nil t)
+ ;; Don't search the whole file twice! Also, articles
+ ;; probably have some locality by number, so searching
+ ;; backwards will be faster. Especially if we're at the
+ ;; beginning of the buffer :-). -SLB
+ (search-backward art-string nil t))
+ (progn
+ (setq start (or (re-search-backward delim-string nil t)
+ (point)))
+ (search-forward "\n\n" nil t)
+ (setq stop (1- (point)))
+ (set-buffer nntp-server-buffer)
+ (insert (format "221 %d Article retrieved.\n" article))
+ (setq beg (point))
+ (insert-buffer-substring nnfolder-current-buffer start stop)
+ (goto-char (point-max))
+ (insert ".\n")))
+ (setq sequence (cdr sequence)))
+
+ ;; Fold continuation lines.
+ (set-buffer nntp-server-buffer)
+ (goto-char (point-min))
+ (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+ (replace-match " " t t))
+ 'headers))))
(defun nnfolder-open-server (server &optional defs)
(nnheader-init-server-buffer)
(defun nnfolder-request-post (&optional server)
(mail-send-and-exit nil))
-(fset 'nnfolder-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nnfolder-request-post-buffer 'nnmail-request-post-buffer)
(defun nnfolder-request-expire-articles (articles newsgroup &optional server force)
(nnfolder-possibly-change-group newsgroup)
(nnkiboze-possibly-change-newsgroups group)
(if (or gnus-nov-is-evil)
nil
- (let ((first (car articles))
- (last (progn (while (cdr articles) (setq articles (cdr articles)))
- (car articles)))
- (nov (nnkiboze-nov-file-name)))
- (if (file-exists-p nov)
- (save-excursion
- (set-buffer nntp-server-buffer)
- (erase-buffer)
- (insert-file-contents nov)
- (goto-char (point-min))
- (while (and (not (eobp)) (< first (read (current-buffer))))
- (forward-line 1))
- (beginning-of-line)
- (if (not (eobp)) (delete-region 1 (point)))
- (while (and (not (eobp)) (>= last (read (current-buffer))))
- (forward-line 1))
- (beginning-of-line)
- (if (not (eobp)) (delete-region (point) (point-max)))
- 'nov)))))
+ (if (stringp (car articles))
+ 'headers
+ (let ((first (car articles))
+ (last (progn (while (cdr articles) (setq articles (cdr articles)))
+ (car articles)))
+ (nov (nnkiboze-nov-file-name)))
+ (if (file-exists-p nov)
+ (save-excursion
+ (set-buffer nntp-server-buffer)
+ (erase-buffer)
+ (insert-file-contents nov)
+ (goto-char (point-min))
+ (while (and (not (eobp)) (< first (read (current-buffer))))
+ (forward-line 1))
+ (beginning-of-line)
+ (if (not (eobp)) (delete-region 1 (point)))
+ (while (and (not (eobp)) (>= last (read (current-buffer))))
+ (forward-line 1))
+ (beginning-of-line)
+ (if (not (eobp)) (delete-region (point) (point-max)))
+ 'nov))))))
(defun nnkiboze-open-server (newsgroups &optional something)
"Open a virtual newsgroup that contains NEWSGROUPS."
"Close news server."
t)
-(fset 'nnkiboze-request-quit (symbol-function 'nnkiboze-close-server))
+(defalias 'nnkiboze-request-quit (symbol-function 'nnkiboze-close-server))
(defun nnkiboze-server-opened (&optional server)
"Return server process status, T or NIL.
(setq nnkiboze-status-string "nnkiboze: LIST NEWSGROUPS is not implemented.")
nil)
-(fset 'nnkiboze-request-post 'nntp-request-post)
+(defalias 'nnkiboze-request-post 'nntp-request-post)
-(fset 'nnkiboze-request-post-buffer 'nntp-request-post-buffer)
+(defalias 'nnkiboze-request-post-buffer 'nntp-request-post-buffer)
\f
;;; Internal functions.
(obuf (current-buffer))
(beg (point-min))
end found group-art)
- (if (= (length methods) 1)
+ (if (and (sequencep methods) (= (length methods) 1))
;; If there is only just one group to put everything in, we
;; just return a list with just this one method in.
(setq group-art
(count 0)
beg article art-string start stop)
(nnmbox-possibly-change-newsgroup newsgroup)
- (while sequence
- (setq article (car sequence))
- (setq art-string (nnmbox-article-string article))
- (set-buffer nnmbox-mbox-buffer)
- (if (or (search-forward art-string nil t)
- (progn (goto-char (point-min))
- (search-forward art-string nil t)))
- (progn
- (setq start
- (save-excursion
- (re-search-backward
- (concat "^" rmail-unix-mail-delimiter) nil t)
- (point)))
- (search-forward "\n\n" nil t)
- (setq stop (1- (point)))
- (set-buffer nntp-server-buffer)
- (insert (format "221 %d Article retrieved.\n" article))
- (setq beg (point))
- (insert-buffer-substring nnmbox-mbox-buffer start stop)
- (goto-char (point-max))
- (insert ".\n")))
- (setq sequence (cdr sequence))
- (setq count (1+ count))
+ (if (stringp (car sequence))
+ 'headers
+ (while sequence
+ (setq article (car sequence))
+ (setq art-string (nnmbox-article-string article))
+ (set-buffer nnmbox-mbox-buffer)
+ (if (or (search-forward art-string nil t)
+ (progn (goto-char (point-min))
+ (search-forward art-string nil t)))
+ (progn
+ (setq start
+ (save-excursion
+ (re-search-backward
+ (concat "^" rmail-unix-mail-delimiter) nil t)
+ (point)))
+ (search-forward "\n\n" nil t)
+ (setq stop (1- (point)))
+ (set-buffer nntp-server-buffer)
+ (insert (format "221 %d Article retrieved.\n" article))
+ (setq beg (point))
+ (insert-buffer-substring nnmbox-mbox-buffer start stop)
+ (goto-char (point-max))
+ (insert ".\n")))
+ (setq sequence (cdr sequence))
+ (setq count (1+ count))
+ (and (numberp nnmail-large-newsgroup)
+ (> number nnmail-large-newsgroup)
+ (zerop (% count 20))
+ gnus-verbose-backends
+ (message "nnmbox: Receiving headers... %d%%"
+ (/ (* count 100) number))))
+
(and (numberp nnmail-large-newsgroup)
(> number nnmail-large-newsgroup)
- (zerop (% count 20))
gnus-verbose-backends
- (message "nnmbox: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (message "nnmbox: Receiving headers...done"))
- (and (numberp nnmail-large-newsgroup)
- (> number nnmail-large-newsgroup)
- gnus-verbose-backends
- (message "nnmbox: Receiving headers... done"))
-
- ;; Fold continuation lines.
- (goto-char (point-min))
- (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
- (replace-match " " t t))
- 'headers)))
+ ;; Fold continuation lines.
+ (goto-char (point-min))
+ (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+ (replace-match " " t t))
+ 'headers))))
(defun nnmbox-open-server (server &optional defs)
(nnheader-init-server-buffer)
(defun nnmbox-request-post (&optional server)
(mail-send-and-exit nil))
-(fset 'nnmbox-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nnmbox-request-post-buffer 'nnmail-request-post-buffer)
(defun nnmbox-request-expire-articles
(articles newsgroup &optional server force)
(save-excursion
(set-buffer nntp-server-buffer)
(erase-buffer)
- (let ((file nil)
- (number (length sequence))
- (count 0)
- beg article)
+ (let* ((file nil)
+ (number (length sequence))
+ (large (and (numberp nnmail-large-newsgroup)
+ (> number nnmail-large-newsgroup)))
+ (count 0)
+ beg article)
(nnmh-possibly-change-directory newsgroup)
- (while sequence
- (setq article (car sequence))
- (setq file
- (concat nnmh-current-directory (prin1-to-string article)))
- (if (and (file-exists-p file)
- (not (file-directory-p file)))
- (progn
- (insert (format "221 %d Article retrieved.\n" article))
- (setq beg (point))
- (nnheader-insert-head file)
- (goto-char beg)
- (if (search-forward "\n\n" nil t)
- (forward-char -1)
- (goto-char (point-max))
- (insert "\n\n"))
- (insert (format "Lines: %d\n" (count-lines (point) (point-max))))
- (insert ".\n")
- (delete-region (point) (point-max))))
- (setq sequence (cdr sequence))
- (setq count (1+ count))
- (and (numberp nnmail-large-newsgroup)
- (> number nnmail-large-newsgroup)
- (zerop (% count 20))
- (message "nnmh: Receiving headers... %d%%"
- (/ (* count 100) number))))
-
- (and (numberp nnmail-large-newsgroup)
- (> number nnmail-large-newsgroup)
- (message "nnmh: Receiving headers... done"))
-
- ;; Fold continuation lines.
- (goto-char (point-min))
- (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
- (replace-match " " t t))
- 'headers)))
+ (if (stringp (car sequence))
+ 'headers
+ (while sequence
+ (setq article (car sequence))
+ (setq file
+ (concat nnmh-current-directory (int-to-string article)))
+ (if (and (file-exists-p file)
+ (not (file-directory-p file)))
+ (progn
+ (insert (format "221 %d Article retrieved.\n" article))
+ (setq beg (point))
+ (nnheader-insert-head file)
+ (goto-char beg)
+ (if (search-forward "\n\n" nil t)
+ (forward-char -1)
+ (goto-char (point-max))
+ (insert "\n\n"))
+ (insert ".\n")
+ (delete-region (point) (point-max))))
+ (setq sequence (cdr sequence))
+ (setq count (1+ count))
+
+ (and large
+ (zerop (% count 20))
+ (message "nnmh: Receiving headers... %d%%"
+ (/ (* count 100) number))))
+
+ (and large (message "nnmh: Receiving headers...done"))
+
+ ;; Fold continuation lines.
+ (goto-char (point-min))
+ (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+ (replace-match " " t t))
+ 'headers))))
(defun nnmh-open-server (server &optional defs)
(nnheader-init-server-buffer)
(nnmh-possibly-change-directory newsgroup)
(let ((file (if (stringp id)
nil
- (concat nnmh-current-directory (prin1-to-string id))))
+ (concat nnmh-current-directory (int-to-string id))))
(nntp-server-buffer (or buffer nntp-server-buffer)))
- (if (and (stringp file)
- (file-exists-p file)
- (not (file-directory-p file)))
- (save-excursion
- (nnmail-find-file file)))))
+ (and (stringp file)
+ (file-exists-p file)
+ (not (file-directory-p file))
+ (save-excursion (nnmail-find-file file)))))
(defun nnmh-request-group (group &optional server dont-check)
(and nnmh-get-new-mail (or dont-check (nnmh-get-new-mail group)))
(defun nnmh-request-post (&optional server)
(mail-send-and-exit nil))
-(fset 'nnmh-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nnmh-request-post-buffer 'nnmail-request-post-buffer)
(defun nnmh-request-expire-articles (articles newsgroup &optional server force)
(nnmh-possibly-change-directory newsgroup)
(if (or (not nnmh-get-new-mail) (not nnmail-spool-file))
()
;; We first activate all the groups.
- (nnmh-request-list)
- (setq nnmh-group-alist (nnmail-get-active))
+ (if (or (not group) (not nnmh-group-alist))
+ (progn
+ (nnmh-request-list)
+ (setq nnmh-group-alist (nnmail-get-active))))
;; The we go through all the existing spool files and split the
;; mail from each.
(while spools
(number (length sequence))
(count 0)
beg article)
- (nnml-possibly-change-directory newsgroup)
- (if (nnml-retrieve-headers-with-nov sequence)
- 'nov
- (while sequence
- (setq article (car sequence))
- (setq file
- (concat nnml-current-directory (prin1-to-string article)))
- (if (and (file-exists-p file)
- (not (file-directory-p file)))
- (progn
- (insert (format "221 %d Article retrieved.\n" article))
- (setq beg (point))
- (nnheader-insert-head file)
- (goto-char beg)
- (if (search-forward "\n\n" nil t)
- (forward-char -1)
- (goto-char (point-max))
- (insert "\n\n"))
- (insert ".\n")
- (delete-region (point) (point-max))))
- (setq sequence (cdr sequence))
- (setq count (1+ count))
+ (if (stringp (car sequence))
+ 'headers
+ (nnml-possibly-change-directory newsgroup)
+ (if (nnml-retrieve-headers-with-nov sequence)
+ 'nov
+ (while sequence
+ (setq article (car sequence))
+ (setq file
+ (concat nnml-current-directory (int-to-string article)))
+ (if (and (file-exists-p file)
+ (not (file-directory-p file)))
+ (progn
+ (insert (format "221 %d Article retrieved.\n" article))
+ (setq beg (point))
+ (nnheader-insert-head file)
+ (goto-char beg)
+ (if (search-forward "\n\n" nil t)
+ (forward-char -1)
+ (goto-char (point-max))
+ (insert "\n\n"))
+ (insert ".\n")
+ (delete-region (point) (point-max))))
+ (setq sequence (cdr sequence))
+ (setq count (1+ count))
+ (and (numberp nnmail-large-newsgroup)
+ (> number nnmail-large-newsgroup)
+ (zerop (% count 20))
+ gnus-verbose-backends
+ (message "nnml: Receiving headers... %d%%"
+ (/ (* count 100) number))))
+
(and (numberp nnmail-large-newsgroup)
(> number nnmail-large-newsgroup)
- (zerop (% count 20))
gnus-verbose-backends
- (message "nnml: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (message "nnml: Receiving headers...done"))
- (and (numberp nnmail-large-newsgroup)
- (> number nnmail-large-newsgroup)
- gnus-verbose-backends
- (message "nnml: Receiving headers... done"))
-
- ;; Fold continuation lines.
- (goto-char (point-min))
- (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
- (replace-match " " t t))
- 'headers))))
+ ;; Fold continuation lines.
+ (goto-char (point-min))
+ (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+ (replace-match " " t t))
+ 'headers)))))
(defun nnml-open-server (server &optional defs)
(nnheader-init-server-buffer)
(nnml-possibly-change-directory newsgroup)
(let ((file (if (stringp id)
nil
- (concat nnml-current-directory (prin1-to-string id))))
+ (concat nnml-current-directory (int-to-string id))))
(nntp-server-buffer (or buffer nntp-server-buffer)))
(if (and (stringp file)
(file-exists-p file)
(defun nnml-request-post (&optional server)
(mail-send-and-exit nil))
-(fset 'nnml-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nnml-request-post-buffer 'nnmail-request-post-buffer)
(defun nnml-request-expire-articles (articles newsgroup &optional server force)
(nnml-possibly-change-directory newsgroup)
(if (or (not nnml-get-new-mail) (not nnmail-spool-file))
()
;; We first activate all the groups.
- (nnml-request-list)
- (setq nnml-group-alist (nnmail-get-active))
+ (if (or (not group) (not nnml-group-alist))
+ (progn
+ (nnml-request-list)
+ (setq nnml-group-alist (nnmail-get-active))))
;; The we go through all the existing spool files and split the
;; mail from each.
(while spools
(message "NNSPOOL: Receiving headers... %d%%"
(/ (* count 100) number))))
- (and do-message (message "NNSPOOL: Receiving headers... done"))
+ (and do-message (message "NNSPOOL: Receiving headers...done"))
;; Fold continuation lines.
(goto-char (point-min))
(goto-char (point-min))
(if (or (zerop (buffer-size))
(search-forward "spooled" nil t))
- ()
+ (kill-buffer (current-buffer))
;; Make status message by unfolding lines.
(subst-char-in-region (point-min) (point-max) ?\n ?\\ 'noundo)
(setq nnspool-status-string (buffer-string))
(message "nnspool: %s" nnspool-status-string)
- (kill-buffer (current-buffer)))))
+ ;(kill-buffer (current-buffer))
+ )))
-(fset 'nnspool-request-post-buffer 'nntp-request-post-buffer)
+(defalias 'nnspool-request-post-buffer 'nntp-request-post-buffer)
\f
;;; Internal functions.
(defun nnspool-retrieve-headers-with-nov (articles)
(if (or gnus-nov-is-evil nnspool-nov-is-evil)
nil
- (let ((nov (concat nnspool-nov-directory
+ (let ((nov (concat (file-name-as-directory nnspool-nov-directory)
(nnspool-replace-chars-in-string
nnspool-current-group ?. ?/)
"/.overview"))
(nntp-accept-response)))
(and (numberp nntp-large-newsgroup)
(> number nntp-large-newsgroup)
- (message "NNTP: Receiving headers... done"))
+ (message "NNTP: Receiving headers...done"))
;; Now all of replies are received.
(setq received number)
(nntp-send-command nil "QUIT")))
(nntp-close-server-internal server)))
-(fset 'nntp-request-quit (symbol-function 'nntp-close-server))
+(defalias 'nntp-request-quit (symbol-function 'nntp-close-server))
(defun nntp-request-close ()
"Close all server connections."
(set-buffer (get-buffer-create "*virtual headers*"))
(buffer-disable-undo (current-buffer))
(erase-buffer)
- (let ((map nnvirtual-current-mapping)
- (offset 0)
- articles beg group active top article result prefix)
- (while sequence
- (while (< (car (car map)) (car sequence))
- (setq offset (car (car map)))
- (setq map (cdr map)))
- (setq top (car (car map)))
- (setq group (nth 1 (car map)))
- (setq prefix (gnus-group-real-prefix group))
- (setq active (nth 2 (car map)))
- (setq articles nil)
- (while (and sequence (<= (car sequence) top))
- (setq articles (cons (- (+ active (car sequence)) offset) articles))
- (setq sequence (cdr sequence)))
- (setq articles (nreverse articles))
- (if (and articles
- (setq result (gnus-retrieve-headers articles group)))
+ (if (stringp (car sequence))
+ 'headers
+ (let ((map nnvirtual-current-mapping)
+ (offset 0)
+ articles beg group active top article result prefix)
+ (while sequence
+ (while (< (car (car map)) (car sequence))
+ (setq offset (car (car map)))
+ (setq map (cdr map)))
+ (setq top (car (car map)))
+ (setq group (nth 1 (car map)))
+ (setq prefix (gnus-group-real-prefix group))
+ (setq active (nth 2 (car map)))
+ (setq articles nil)
+ (while (and sequence (<= (car sequence) top))
+ (setq articles (cons (- (+ active (car sequence)) offset) articles))
+ (setq sequence (cdr sequence)))
+ (setq articles (nreverse articles))
+ (if (and articles
+ (setq result (gnus-retrieve-headers articles group)))
+ (save-excursion
+ (set-buffer nntp-server-buffer)
+ ;; If we got HEAD headers, we convert them into NOV
+ ;; headers. This is slow, inefficient and, come to think
+ ;; of it, downright evil. So sue me. I couldn't be
+ ;; bothered to write a header parse routine that could
+ ;; parse a mixed HEAD/NOV buffer.
+ (and (eq result 'headers) (nnvirtual-convert-headers))
+ (goto-char (point-min))
+ (while (not (eobp))
+ (setq beg (point))
+ (setq article (read nntp-server-buffer))
+ (delete-region beg (point))
+ (insert (int-to-string (+ (- article active) offset)))
+ (beginning-of-line)
+ (looking-at "[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t")
+ (goto-char (match-end 0))
+ (or (search-forward
+ "\t" (save-excursion (end-of-line) (point)) t)
+ (end-of-line))
+ (while (= (char-after (1- (point))) ? )
+ (forward-char -1)
+ (delete-char 1))
+ (if (eolp)
+ (progn
+ (end-of-line)
+ (or (= (char-after (1- (point))) ?\t)
+ (insert ?\t))
+ (insert (format "Xref: %s %s:%d\t" (system-name)
+ group article)))
+ (if (not (string= "" prefix))
+ (while (re-search-forward
+ "[^ ]+:[0-9]+"
+ (save-excursion (end-of-line) (point)) t)
+ (save-excursion
+ (goto-char (match-beginning 0))
+ (insert prefix))))
+ (end-of-line)
+ (or (= (char-after (1- (point))) ?\t)
+ (insert ?\t)))
+ (forward-line 1))))
+ (goto-char (point-max))
+ (insert-buffer-substring nntp-server-buffer))
+ ;; The headers are ready for reading, so they are inserted into
+ ;; the nntp-server-buffer, which is where Gnus expects to find
+ ;; them.
+ (prog1
(save-excursion
(set-buffer nntp-server-buffer)
- ;; If we got HEAD headers, we convert them into NOV
- ;; headers. This is slow, inefficient and, come to think
- ;; of it, downright evil. So sue me. I couldn't be
- ;; bothered to write a header parse routine that could
- ;; parse a mixed HEAD/NOV buffer.
- (and (eq result 'headers) (nnvirtual-convert-headers))
- (goto-char (point-min))
- (while (not (eobp))
- (setq beg (point))
- (setq article (read nntp-server-buffer))
- (delete-region beg (point))
- (insert (int-to-string (+ (- article active) offset)))
- (beginning-of-line)
- (looking-at "[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t")
- (goto-char (match-end 0))
- (or (search-forward
- "\t" (save-excursion (end-of-line) (point)) t)
- (end-of-line))
- (while (= (char-after (1- (point))) ? )
- (forward-char -1)
- (delete-char 1))
- (if (eolp)
- (progn
- (end-of-line)
- (or (= (char-after (1- (point))) ?\t)
- (insert ?\t))
- (insert (format "Xref: %s %s:%d\t" (system-name)
- group article)))
- (if (not (string= "" prefix))
- (while (re-search-forward
- "[^ ]+:[0-9]+"
- (save-excursion (end-of-line) (point)) t)
- (save-excursion
- (goto-char (match-beginning 0))
- (insert prefix))))
- (end-of-line)
- (or (= (char-after (1- (point))) ?\t)
- (insert ?\t)))
- (forward-line 1))))
- (goto-char (point-max))
- (insert-buffer-substring nntp-server-buffer))
- ;; The headers are ready for reading, so they are inserted into
- ;; the nntp-server-buffer, which is where Gnus expects to find
- ;; them.
- (prog1
- (save-excursion
- (set-buffer nntp-server-buffer)
- (erase-buffer)
- (insert-buffer-substring "*virtual headers*")
- 'nov)
- (kill-buffer (current-buffer))))))
+ (erase-buffer)
+ (insert-buffer-substring "*virtual headers*")
+ 'nov)
+ (kill-buffer (current-buffer)))))))
(defun nnvirtual-open-server (newsgroups &optional something)
"Open a virtual newsgroup that contains NEWSGROUPS."
"nnvirtual: LIST NEWSGROUPS is not implemented.")
nil)
-(fset 'nnvirtual-request-post 'nntp-request-post)
+(defalias 'nnvirtual-request-post 'nntp-request-post)
(defun nnvirtual-request-post-buffer
(post group subject header article-buffer info follow-to respect-poster)
* nnvirtual:: Combining articles from many groups.
* nnkiboze:: Looking through parts of the newsfeed for articles.
* nndir:: You can read a directory as if it was a newsgroup.
+* nneething:: Dired? Who needs dired?
* nndoc:: Single files can be the basis of a group.
* nndigest:: Digests can be undigested and treated as a group.
* Reading Mail:: Reading your personal mail with Gnus.
nndir will use @sc{nov} files if they are present.
+@node nneething
+@subsection nneething
+@cindex nneething
+
+From the @code{nndir} backend (which reads a single spool-like
+directory), it's just a hop and a skip to @code{nneething}, which
+pretends that any random directory is a newsgroup. Strange, but true.
+
+When @code{nneething} is presented with a directory, it will scan this
+directory and assign article numbers to each file. When you enter such a
+group, @code{nneething} must create "headers" that Gnus can use. After
+all, Gnus is a newsreader, in case you're forgetting. @code{nneething}
+does this in a two-step process. First, it snoops each file in question.
+If the file looks like an article (ie. the first few lines look like
+headers), it will use this as the head. If this is just some random file
+without a head (eg. a C source file), @code{nneething} will cobble up a
+header out of thin air. It will use file ownership, name and date and do
+whatever it can with these elements.
+
+All this should happen automatically for you, and you will be presented
+with something that looks very much like a newsgroup. Totally like a
+newsgroup, to be precise. If you select an article, it will be displayed
+in the article buffer, just as usual.
+
+If you select a line that represents a directory, Gnus will pop you into
+a new summary buffer for this @code{nneething} group. And so on. You can
+traverse the entire disk this way, if you feel like, but remember that
+Gnus is not dired, really, and does not intend to be, either.
+
+There are two overall modes to this action - ephemeral or solid. When
+doing the ephemeral thing (ie. @kbd{G D} from the group buffer), Gnus
+will not store information on what files you have read, and what files
+are new, and so on. If you create a solid @code{nneething} group the
+normal way with @kbd{G m}, Gnus will store a mapping table between
+article numbers and file names, and you can treat this group like any
+other groups. When you activate a solid @code{nneething} group, you will
+be told how many unread articles it contains, etc., etc.
+
+Some variables:
+
+@table @code
+@item nneething-map-file-directory
+@vindex nneething-map-file-directory
+All the mapping files for solid @code{nneething} groups will be stored
+in this directory, which defaults to @file{~/.nneething/}.
+
+@item nneething-exclude-files
+@vindex nneething-exclude-files
+All files that match this regexp will be ignored. Nice to use to exclude
+auto-save files and the like, which is what it does by default.
+
+@item nneething-map-file
+@vindex nneething-map-file
+Name of the map files.
+@end table
+
+
@node nndoc
@subsection nndoc
@cindex nndoc
post buffer has been initialized, and can be used for inserting a
signature. Nice if you use different signatures in different groups.
+@item gnus-post-prepapare-hook
+@vindex gnus-post-prepapare-hook
+This hook is called after a post buffer has been prepared. If you want
+to insert a signature at this point, you could put
+@code{gnus-inews-insert-signature} into this hook.
+
@item news-reply-header-hook
@vindex news-reply-header-hook
A related variable when following up and replying is this variable,