(add-hook 'gnus-exit-group-hook 'gnus-uu-clean-up)
(add-hook 'gnus-exit-group-hook 'gnus-uu-check-for-generated-files)
+\f
-;; Major mode for posting encoded articles.
+;;;
+;;; uuencoded posting
+;;;
(require 'sendmail)
(require 'rnews)
(defvar gnus-uu-post-inserted-file-name nil)
(defvar gnus-uu-winconf-post-news nil)
-;; The following map and mode was taken from rnewspost.el and edited
-;; somewhat.
-(defvar gnus-uu-post-reply-mode-map nil)
-(if gnus-uu-post-reply-mode-map
- ()
- (setq gnus-uu-post-reply-mode-map (make-keymap))
- (define-key gnus-uu-post-reply-mode-map "\C-c?" 'describe-mode)
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-f\C-d"
- 'news-reply-distribution)
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-f\C-k"
- 'news-reply-keywords)
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-f\C-n"
- 'news-reply-newsgroups)
-
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-f\C-f"
- 'news-reply-followup-to)
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-f\C-s" 'mail-subject)
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-f\C-a"
- 'gnus-uu-post-reply-summary)
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-r"
- 'news-caesar-buffer-body)
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-w" 'news-reply-signature)
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-y"
- 'news-reply-yank-original)
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-q"
- 'mail-fill-yanked-message)
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-c"
- 'gnus-uu-post-news-inews)
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-s"
- 'gnus-uu-post-news-inews)
- (define-key gnus-uu-post-reply-mode-map "\C-c\C-i"
- 'gnus-uu-post-insert-binary-in-article)
- )
-
-;; This mode was taken from rnewspost.el and modified slightly.
-(defun gnus-uu-post-reply-mode ()
- "Major mode for editing binary news to be posted on USENET.
-First-time posters are asked to please read the articles in newsgroup:
- news.announce.newusers .
-
-Like news-reply-mode, which is like Text Mode, but with these
-additional commands:
-
-\\<gnus-uu-post-reply-mode-map>\\[gnus-uu-post-news-inews] post the message.
-C-c C-f move to a header field (and create it if there isn't):
- C-c C-f C-n move to Newsgroups: C-c C-f C-s move to Subj:
- C-c C-f C-f move to Followup-To: C-c C-f C-k move to Keywords:
- C-c C-f C-d move to Distribution: C-c C-f C-a move to Summary:
-C-c C-y news-reply-yank-original (insert current message, in NEWS).
-C-c C-q mail-fill-yanked-message (fill what was yanked).
-C-c C-r caesar rotate all letters by 13 places in the article's body (rot13).
-\\[gnus-uu-post-insert-binary-in-article] encode and include a file in this article.
-
-This mode is almost identical to news-reply-mode, but has some
-additional commands for treating encoded binary articles. In
-particular, \\[gnus-uu-post-news-inews] will ask for a file to include, if
-one hasn't been included already. It will post, first, the message
-composed, and then it will post as many additional articles it takes
-to post the entire encoded files.
-
- Relevant Variables
-
- `gnus-uu-post-encode-method'
- There are three functions supplied with gnus-uu for encoding files:
- `gnus-uu-post-encode-uuencode', which does straight uuencoding;
- `gnus-uu-post-encode-mime', which encodes with base64 and adds MIME
- headers; and `gnus-uu-post-encode-mime-uuencode', which encodes with
- uuencode and adds MIME headers.
-
- `gnus-uu-post-include-before-composing'
- Non-nil means that gnus-uu will ask for a file to encode before you
- compose the article. If this variable is t, you can either include
- an encoded file with `C-c C-i' or have one included for you when you
- post the article.
-
- `gnus-uu-post-length'
- Maximum length of an article. The encoded file will be split into how
- many articles it takes to post the entire file.
-
- `gnus-uu-post-separate-description'
- Non-nil means that the description will be posted in a separate
- article. The first article will typically be numbered (0/x). If
- this variable is nil, the description the user enters will be
- included at the beginning of the first article, which will be
- numbered (1/x). Default is t.
-
- `gnus-uu-post-threaded'
- Non-nil means that gnus-uu will post the encoded file in a thread.
- This may not be smart, as no other decoder I have seen are able to
- follow threads when collecting uuencoded articles. (Well, I have seen
- one package that does that - gnus-uu, but somehow, I don't think that
- counts...) Default is nil.
-"
- (interactive)
- ;; require...
- (or (fboundp 'mail-setup) (load "sendmail"))
- (kill-all-local-variables)
- (make-local-variable 'mail-reply-buffer)
- (setq mail-reply-buffer nil)
- (set-syntax-table text-mode-syntax-table)
- (use-local-map gnus-uu-post-reply-mode-map)
- (setq local-abbrev-table text-mode-abbrev-table)
- (setq major-mode 'gnus-uu-post-reply-mode)
- (setq mode-name "Gnus UU News")
- (make-local-variable 'paragraph-separate)
- (make-local-variable 'paragraph-start)
- (setq paragraph-start (concat "^" (regexp-quote mail-header-separator)
- "$\\|" paragraph-start))
- (setq paragraph-separate (concat "^" (regexp-quote mail-header-separator)
- "$\\|" paragraph-separate))
- (run-hooks 'text-mode-hook 'gnus-uu-post-reply-mode-hook))
-
(defun gnus-uu-post-news ()
"Compose an article and post an encoded file."
(interactive)
(setq gnus-uu-post-inserted-file-name nil)
(setq gnus-uu-winconf-post-news (current-window-configuration))
- (let (news-reply-mode)
- (fset 'news-reply-mode 'gnus-uu-post-reply-mode)
- (gnus-summary-post-news)
- (if gnus-uu-post-include-before-composing
- (save-excursion (setq gnus-uu-post-inserted-file-name
- (gnus-uu-post-insert-binary))))))
+
+ (gnus-summary-post-news)
+
+ (use-local-map (copy-keymap (current-local-map)))
+ (local-set-key "\C-c\C-c" 'gnus-summary-edit-article-done)
+ (local-set-key "\C-c\C-f\C-a" 'gnus-uu-post-reply-summary)
+ (local-set-key "\C-c\C-c" 'gnus-uu-post-news-inews)
+ (local-set-key "\C-c\C-s" 'gnus-uu-post-news-inews)
+ (local-set-key "\C-c\C-i" 'gnus-uu-post-insert-binary-in-article)
+
+ (if gnus-uu-post-include-before-composing
+ (save-excursion (setq gnus-uu-post-inserted-file-name
+ (gnus-uu-post-insert-binary)))))
(defun gnus-uu-post-insert-binary-in-article ()
"Inserts an encoded file in the buffer.
(defvar gnus-use-adaptive-scoring nil
"*If non-nil, use some adaptive scoring scheme.")
+(defvar gnus-use-cache nil
+ "*If non-nil, Gnus will cache (some) articles locally.")
+
(defvar gnus-fetch-old-headers nil
"*Non-nil means that Gnus will try to build threads by grabbing old headers.
If an unread article in the group refers to an older, already read (or
(defconst gnus-maintainer "Lars Magne Ingebrigtsen <larsi@ifi.uio.no>"
"The mail address of the Gnus maintainer.")
-(defconst gnus-version "(ding) Gnus v0.62"
+(defconst gnus-version "(ding) Gnus v0.63"
"Version number for this version of Gnus.")
(defvar gnus-info-nodes
(autoload 'gnus-execute "gnus-kill")
(autoload 'gnus-expunge "gnus-kill")
+ (autoload 'gnus-cache-possibly-enter-article "gnus-cache")
+ (autoload 'gnus-cache-save-buffers "gnus-cache")
+ (autoload 'gnus-cache-possibly-remove-article "gnus-cache")
+ (autoload 'gnus-cache-request-article "gnus-cache")
+ (autoload 'gnus-cache-retrieve-headers "gnus-cache")
+ (autoload 'gnus-cache-possibly-alter-active "gnus-cache")
+ (autoload 'gnus-jog-cache "gnus-cache" nil t)
+
(autoload 'pp "pp")
(autoload 'pp-to-string "pp")
(autoload 'mail-extract-address-components "mail-extr")
"Return the value of the header FIELD of current article."
(save-excursion
(save-restriction
- (gnus-narrow-to-headers)
- (mail-fetch-field field))))
+ (let ((case-fold-search t))
+ (gnus-narrow-to-headers)
+ (mail-fetch-field field)))))
(defun gnus-goto-colon ()
(beginning-of-line)
(and gnus-current-startup-file
(get-file-buffer gnus-current-startup-file)
(kill-buffer (get-file-buffer gnus-current-startup-file)))
+ ;; Save any cache buffers.
+ (and gnus-use-cache (gnus-cache-save-buffers))
;; Clear the dribble buffer.
(gnus-dribble-clear)
;; Kill global KILL file buffer.
"Return a list of elements of LIST1 that do not appear in LIST2.
Both lists have to be sorted over <."
(let (out)
- (while (and list1 list2)
- (cond ((= (car list1) (car list2))
- (setq list1 (cdr list1)
- list2 (cdr list2)))
- ((< (car list1) (car list2))
- (setq out (cons (car list1) out))
- (setq list1 (cdr list1)))
- (t
- (setq out (cons (car list2) out))
- (setq list2 (cdr list2)))))
- (nreverse (append (or list1 list2) out))))
+ (if (or (null list1) (null list2))
+ (or list1 list2)
+ (while (and list1 list2)
+ (cond ((= (car list1) (car list2))
+ (setq list1 (cdr list1)
+ list2 (cdr list2)))
+ ((< (car list1) (car list2))
+ (setq out (cons (car list1) out))
+ (setq list1 (cdr list1)))
+ (t
+ (setq out (cons (car list2) out))
+ (setq list2 (cdr list2)))))
+ (nconc (nreverse out) (or list1 list2)))))
(defun gnus-intersection (list1 list2)
(let ((result nil))
(if gnus-xemacs [button2] [mouse-2]) 'gnus-mouse-pick-group)
(define-key gnus-group-mode-map "<" 'beginning-of-buffer)
(define-key gnus-group-mode-map ">" 'end-of-buffer)
+ (define-key gnus-group-mode-map "\C-c\C-b" 'gnus-bug)
(define-prefix-command 'gnus-group-make-map)
(define-key gnus-group-mode-map "M" 'gnus-group-make-map)
If not, METHOD should be a list where the first element is the method
and the second element is the address."
(interactive
- (list (list (intern (completing-read
- "Which backend: "
- gnus-valid-select-methods nil t "nntp"))
- ;; Suggested by mapjph@bath.ac.uk.
- (completing-read
- "Address: "
- (mapcar (lambda (server) (list server))
- gnus-secondary-servers)))))
+ (list (let ((how (completing-read
+ "Which backend: "
+ (append gnus-valid-select-methods gnus-server-alist)
+ nil t "nntp")))
+ ;; We either got a backend name or a virtual server name.
+ ;; If the first, we also need an address.
+ (if (assoc how gnus-valid-select-methods)
+ (list (intern how)
+ ;; Suggested by mapjph@bath.ac.uk.
+ (completing-read
+ "Address: "
+ (mapcar (lambda (server) (list server))
+ gnus-secondary-servers)))
+ ;; We got a server name, so we find the method.
+ (gnus-server-to-method how)))))
(gnus-browse-foreign-server method))
\f
(mapcar (lambda (headers) (list (int-to-string (header-number headers))))
gnus-newsgroup-headers)
nil 'require-match))))
- (if (gnus-summary-goto-subject article)
- (gnus-summary-display-article article all-headers))
- (gnus-summary-position-cursor))
+ (prog1
+ (and (gnus-summary-goto-subject article)
+ (gnus-summary-display-article article all-headers))
+ (gnus-summary-position-cursor)))
(defun gnus-summary-goto-last-article ()
"Go to the last article."
(interactive)
- (if gnus-last-article
- (gnus-summary-goto-article gnus-last-article))
- (gnus-summary-position-cursor))
+ (prog1
+ (and gnus-last-article
+ (gnus-summary-goto-article gnus-last-article))
+ (gnus-summary-position-cursor)))
(defun gnus-summary-pop-article (number)
"Pop one article off the history and go to the previous.
(let ((header (car (gnus-gethash (downcase message-id)
gnus-newsgroup-dependencies))))
(if header
- (gnus-summary-goto-article (header-number header))
+ (or (gnus-summary-goto-article (header-number header))
+ ;; The header has been read, but the article had been
+ ;; expunged, so we insert it again.
+ (progn
+ (gnus-summary-insert-line
+ nil header 0 nil gnus-read-mark nil nil
+ (header-subject header))
+ (forward-line -1)
+ (header-number header)))
(let ((gnus-override-method gnus-refer-article-method))
(and gnus-refer-article-method
(or (gnus-server-opened gnus-refer-article-method)
gnus-newsgroup-name)) ; Server
(list 'gnus-request-accept-article
(if select-method
- (quote select-method)
+ (list 'quote select-method)
to-newsgroup)
(not (cdr articles))) ; Accept form
(not (cdr articles)))) ; Only save nov last time
latter case, they will be copied into the relevant groups."
(interactive "P")
(gnus-set-global-variables)
- (let ((respool-methods (gnus-methods-using 'respool)))
+ (let ((respool-methods (gnus-methods-using 'respool))
+ (methname
+ (symbol-name (car (gnus-find-method-for-group gnus-newsgroup-name)))))
(or respool-method
(setq respool-method
(completing-read
"What method do you want to use when respooling? "
- respool-methods nil t)))
- (if (assoc (symbol-name
- (car (gnus-find-method-for-group gnus-newsgroup-name)))
- respool-methods)
- (gnus-summary-move-article n nil (intern respool-method)))
- (gnus-summary-copy-article n nil (intern respool-method))))
+ respool-methods nil t methname)))
+ (or (string= respool-method "")
+ (if (assoc (symbol-name
+ (car (gnus-find-method-for-group gnus-newsgroup-name)))
+ respool-methods)
+ (gnus-summary-move-article n nil (intern respool-method))
+ (gnus-summary-copy-article n nil (intern respool-method))))))
;; Suggested by gregj@unidata.com (Gregory J. Grubbs).
(defun gnus-summary-copy-article (n &optional to-newsgroup select-method)
(> (gnus-summary-thread-level) level))
(gnus-summary-raise-score score))
(setq e (point))))
- (or (zerop (gnus-summary-next-subject 1 t))
- (goto-char e)))
+ (let ((gnus-summary-check-current t))
+ (or (zerop (gnus-summary-next-subject 1 t))
+ (goto-char e))))
(gnus-summary-recenter)
(gnus-summary-position-cursor)
(gnus-set-mode-line 'summary))
(= mark gnus-low-score-mark)
(= mark gnus-read-mark))))
(setq mark gnus-expirable-mark))
- (let* ((buffer-read-only nil)
- (mark (or (and (stringp mark) (aref mark 0)) mark gnus-del-mark))
+ (let* ((mark (or (and (stringp mark) (aref mark 0)) mark gnus-del-mark))
(article (or article (gnus-summary-article-number))))
(if (or (= mark gnus-unread-mark)
(= mark gnus-ticked-mark)
(= mark gnus-dormant-mark))
(gnus-mark-article-as-unread article mark)
(gnus-mark-article-as-read article mark))
+
+ ;; See whether the article is to be put in the cache.
+ (and gnus-use-cache
+ (save-excursion
+ (gnus-summary-select-article)
+ (gnus-cache-possibly-enter-article
+ gnus-newsgroup-name article
+ (gnus-get-header-by-number article)
+ (= mark gnus-ticked-mark)
+ (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
+
(if (gnus-summary-goto-subject article)
- (progn
+ (let ((buffer-read-only nil))
(gnus-summary-show-thread)
(beginning-of-line)
(and (eq (gnus-summary-article-mark) ?Z)
(gnus-add-current-to-buffer-list)
(gnus-article-mode))))
-(defun gnus-request-article-this-buffer (article &optional group)
+(defun gnus-request-article-this-buffer (article group)
"Get an article and insert it into this buffer."
(setq group (or group gnus-newsgroup-name))
;; Using `gnus-request-article' directly will insert the article into
;; It is an extracted pseudo-article.
(setq article nil)
(gnus-request-pseudo-article header)))))
- ;; Get the article and into the article buffer.
- (if 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))
+
+ ;; Check the cache.
+ (if (and gnus-use-cache
+ (numberp article)
+ (gnus-cache-request-article article group))
+ 'article
+ ;; Get the article and into the article buffer.
+ (if 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)))
(defun gnus-read-header (id)
"Read the headers of article ID and enter them into the Gnus system."
;; Set the global newsgroup variables here.
;; Suggested by Jim Sisolak
;; <sisolak@trans4.neep.wisc.edu>.
- (gnus-set-global-variables)))
+ (gnus-set-global-variables)
+ (and gnus-use-cache
+ (gnus-cache-possibly-enter-article
+ group article
+ (gnus-get-header-by-number article)
+ (memq article gnus-newsgroup-marked)
+ (memq article gnus-newsgroup-dormant)
+ (memq article gnus-newsgroup-unreads)))))
;; gnus-have-all-headers must be either T or NIL.
(setq gnus-have-all-headers
(not (not (or all-headers gnus-show-all-headers))))
(process-send-eof process))
(error "Couldn't start process"))))))))
+(defun gnus-article-de-quoted-unreadable (&optional force)
+ "Do a naïve translation of a quoted-printable-encoded article.
+This is in no way, shape or form meant as a replacement for real MIME
+processing, but is simply a stop-gap measure until MIME support is
+written.
+If FORCE, decode the article whether it is marked as quoted-printable
+or not."
+ (interactive (list 'force))
+ (save-excursion
+ (set-buffer gnus-article-buffer)
+ (let ((case-fold-search t)
+ (type (gnus-fetch-field "content-transfer-encoding")))
+ (if (or force (and type (string-match "quoted-printable" type)))
+ (progn
+ (goto-char (point-min))
+ (search-forward "\n\n" nil 'move)
+ (gnus-mime-decode-quoted-printable (point) (point-max)))))))
(defun gnus-mime-decode-quoted-printable (from to)
;; Decode quoted-printable from region between FROM and TO.
(delete-char 2))
((message "Malformed MIME quoted-printable message"))))))
-(defun gnus-article-de-quoted-unreadable ()
- "Do a naive translation of a quoted-printable-encoded article.
-This is in no way, shape or form meant as a replacement for real MIME
-processing, but is simply a stop-gap measure until MIME support is
-written."
- ;; Unquote quoted-printable from news articles.
- (interactive)
- (save-excursion
- (set-buffer gnus-article-buffer)
- (let ((case-fold-search t)
- (type (gnus-fetch-field "content-transfer-encoding")))
- (cond ((and (stringp type) (string-match "quoted-printable" type))
- (goto-char (point-min))
- (search-forward "\n\n" nil 'move)
- (message "MIME Unquoting printable...")
- (gnus-mime-decode-quoted-printable (point) (point-max))
- (message "MIME Unquoting printable...done")))
- (set-buffer gnus-summary-buffer))))
-
-(defun gnus-article-date-ut (date type)
+
+(defun gnus-article-date-ut (&optional type)
"Convert DATE date to universal time in the current article.
If TYPE is `local', convert to local time; if it is `lapsed', output
how much time has lapsed since DATE."
- (interactive (list (header-date gnus-current-headers) 'ut))
- (if (not date)
- ()
+ (interactive (list 'ut))
+ (let ((date (header-date (or gnus-current-headers
+ (gnus-get-header-by-number
+ (gnus-summary-article-number))))))
(save-excursion
(set-buffer gnus-article-buffer)
(let ((buffer-read-only nil))
((eq type 'lapsed)
(let* ((sec (- (gnus-seconds-since-epoch (current-time-string))
(gnus-seconds-since-epoch date)))
- (units (list (cons 'year (* 1.0 365 24 60 60))
+ (units (list (cons 'year (* 365.25 24 60 60))
(cons 'week (* 7 24 60 60))
(cons 'day (* 24 60 60))
(cons 'hour (* 60 60))
"X-Sent: "
(mapconcat
(lambda (unit)
- (if (zerop (setq num (floor (/ sec (cdr unit)))))
+ (if (zerop (setq num (ffloor (/ sec (cdr unit)))))
""
(setq sec (- sec (* num (cdr unit))))
(prog1
- (concat (if prev ", " "") (int-to-string num)
+ (concat (if prev ", " "") (int-to-string (floor num))
" " (symbol-name (car unit))
(if (> num 1) "s" ""))
(setq prev t))))
(t
(error "Unknown conversion type: %s" type))))))))
-(defun gnus-article-date-local (date)
+(defun gnus-article-date-local ()
"Convert the current article date to the local timezone."
- (interactive (list (header-date gnus-current-headers)))
- (gnus-article-date-ut date 'local))
+ (interactive)
+ (gnus-article-date-ut 'local))
-(defun gnus-article-date-lapsed (date)
+(defun gnus-article-date-lapsed ()
"Convert the current article date to time lapsed since it was sent."
- (interactive (list (header-date gnus-current-headers)))
- (gnus-article-date-ut date 'lapsed))
+ (interactive)
+ (gnus-article-date-ut 'lapsed))
;; Article savers.
(defun gnus-retrieve-headers (articles group)
(let ((method (gnus-find-method-for-group group)))
- (funcall (gnus-get-function method 'retrieve-headers)
- articles (gnus-group-real-name group) (nth 1 method))))
+ (if gnus-use-cache
+ (gnus-cache-retrieve-headers articles group)
+ (funcall (gnus-get-function method 'retrieve-headers)
+ articles (gnus-group-real-name group) (nth 1 method)))))
(defun gnus-retrieve-groups (groups method)
(funcall (gnus-get-function method 'retrieve-groups) groups (nth 1 method)))
(setq groups (cdr groups)))
(gnus-group-make-help-group)
(and gnus-novice-user
- (message (substitute-command-keys "\\<gnus-group-mode-map>\\[gnus-group-list-killed] to list killed groups")))))))
+ (message "`G k' to list killed groups"))))))
;; `gnus-group-change-level' is the fundamental function for changing
;; subscription levels of newsgroups. This might mean just changing
(defun gnus-get-unread-articles (&optional level)
(let ((newsrc (cdr gnus-newsrc-alist))
(level (or level (1+ gnus-level-subscribed)))
- info group active virtuals)
+ info group active virtuals method)
(message "Checking new news...")
(while newsrc
(setq info (car newsrc))
;; be reached) we just set the number of unread articles in this
;; newsgroup to t. This means that Gnus thinks that there are
;; unread articles, but it has no idea how many.
- (if (nth 4 info)
+ (if (setq method (nth 4 info))
(if (or (and gnus-activate-foreign-newsgroups
(not (numberp gnus-activate-foreign-newsgroups)))
(and (numberp gnus-activate-foreign-newsgroups)
(<= (nth 1 info) gnus-activate-foreign-newsgroups)
(<= (nth 1 info) level)))
- (if (eq (car (nth 4 info)) 'nnvirtual)
+ (if (eq (car (if (stringp method)
+ (gnus-server-to-method method)
+ (nth 4 info))) 'nnvirtual)
(setq virtuals (cons info virtuals))
(setq active (gnus-activate-newsgroup (car info)))))
(if (and (not gnus-read-active-file)
(num 0)
(marked (nth 3 info))
srange lowest group highest)
+ ;; If a cache is present, we may have to alter the active info.
+ (and gnus-use-cache
+ (gnus-cache-possibly-alter-active (car info) active))
;; Modify the list of read articles according to what articles
;; are available; then tally the unread articles and add the
;; number to the group hash table entry.
(load ding-file t t t)
(error nil))
(and gnus-newsrc-assoc (setq gnus-newsrc-alist gnus-newsrc-assoc)))
- (gnus-uncompress-newsrc-assoc)
+ (let ((inhibit-quit t))
+ (gnus-uncompress-newsrc-assoc))
(gnus-make-hashtable-from-newsrc-alist)
(if (not (file-newer-than-file-p file ding-file))
()
(insert ";; Never delete this file - touch .newsrc instead to force Gnus\n")
(insert ";; to read .newsrc.\n")
(let ((variables gnus-variable-list)
+ (inhibit-quit t)
(gnus-newsrc-alist (cdr gnus-newsrc-alist))
variable)
;; insert lisp expressions.
(setq gnus-server-mode-map (make-sparse-keymap))
(suppress-keymap gnus-server-mode-map)
(define-key gnus-server-mode-map " " 'gnus-server-read-server)
+ (define-key gnus-server-mode-map "\r" 'gnus-server-read-server)
(define-key gnus-server-mode-map "q" 'gnus-server-exit)
(define-key gnus-server-mode-map "l" 'gnus-server-list-servers)
(define-key gnus-server-mode-map "k" 'gnus-server-kill-server)
(gnus-server-insert-server-line nil (car entry) (cdr entry))
(gnus-server-position-cursor))))))
-(defun gnus-server-set-info (info)
+(defun gnus-server-set-info (server info)
;; Enter a select method into the virtual server alist.
(gnus-dribble-enter
- (concat "(gnus-server-set-info '"
+ (concat "(gnus-server-set-info \"" server "\" '"
(prin1-to-string info) ")"))
(let* ((server (nth 1 info))
(entry (assoc server gnus-server-alist)))
(gnus-add-current-to-buffer-list)
(emacs-lisp-mode)
(use-local-map (copy-keymap (current-local-map)))
- (local-set-key "\C-c\C-c" 'gnus-server-edit-server-done)
+ (let ((done-func '(lambda ()
+ "Exit editing mode and update the information."
+ (interactive)
+ (gnus-server-edit-server-done 'group))))
+ (setcar (cdr (nth 4 done-func)) server)
+ (local-set-key "\C-c\C-c" done-func))
(erase-buffer)
(insert ";; Type `C-c C-c' after you have edited the server.\n\n")
- (insert "(gnus-server-set-info \n "
- (pp-to-string (list 'quote (cdr (assoc server gnus-server-alist))))
- " )\n"))
+ (insert (pp-to-string (cdr (assoc server gnus-server-alist)))))
-(defun gnus-server-edit-server-done ()
+(defun gnus-server-edit-server-done (server)
(interactive)
(set-buffer (get-buffer-create gnus-server-edit-buffer))
- (eval-current-buffer)
+ (goto-char (point-min))
+ (let ((form (read (current-buffer))))
+ (gnus-server-set-info server form))
(kill-buffer (current-buffer))
(and gnus-winconf-edit-server
(set-window-configuration gnus-winconf-edit-server))
(defun gnus-server-read-server (server)
"Browse a server."
- (interactive (gnus-server-server-name))
- (gnus-browse-foreign-server (gnus-server-to-method server)))
+ (interactive (list (gnus-server-server-name)))
+ (gnus-browse-foreign-server (gnus-server-to-method server) (current-buffer)))
;;; Gnus score functions.
I could steal code from @code{Mew}, the @sc{mime} mail reader for Emacs,
but I'm not quite sure what the status of that project is. (ding) might
support @sc{mime} quite soon, and it might not.
-@item
-Some form of caching would come in handy. Not only for those with
-extremely slow @sc{nntp} connections, but as a more general way of
-saving articles in a simple fashion. (You'd basically just mark an
-article as @dfn{cached}. Gnus would put it in some local directory, and
-each time you request that article from that group, Gnus would fetch the
-local copy instead.) Lots of quite interesting stuff to be considered
-(caching @sc{nov} headers or not?) before jumping into it. It would
-require much twiddling of Gnus internals to make it work transparently.
@item
When the user references the parent of an article, some sort of
re-threading should be done to build a proper tree. The same goes for
* Ticking and Marking:: Marking articles as read, expirable, etc.
* Threading:: How threads are made.
* Asynchronous Fetching:: Gnus might be able to pre-fetch articles.
+* Article Caching:: You may store articles in a cache.
* Exiting the Summary Buffer:: Returning to the Group buffer.
* Process/Prefix:: A convention used by many treatment commands.
* Saving Articles:: Ways of customizing article saving.
return an alist where the articles you are not interested in have been
removed. You could also do sorting on article score and the like.
+@node Article Caching
+@section Article Caching
+@cindex article caching
+@cindex caching
+
+If you have an @emph{extremely} slow @sc{nntp} connection, you may
+consider turning article caching on. Each article will then be stored
+locally under your home directory. As you may surmise, this could
+potentially use @emph{huge} amounts of disk space, as well as eat up all
+your inodes so fast it will make your head swim. In vodka.
+
+Used carefully, though, it could be just an easier way to save articles.
+
+@vindex gnus-use-long-file-name
+@vindex gnus-cache-directory
+@vindex gnus-use-cache
+To turn caching on, set @code{gnus-use-cache} to @code{t}. By default,
+all articles that are ticked or marked as dormant will then be copied
+over to your local cache (@code{gnus-cache-directory}). Whether this
+cache is flat or hierarchal is controlled by the
+@code{gnus-use-long-file-name} variable, as usual.
+
+When re-select a ticked or dormant article, it will be fetched from the
+cache instead of from the server. As articles in your cache will never
+expire, this might serve as a method of saving articles while still
+keeping them where they belong. Just mark all articles you want to save
+as dormant, and don't worry.
+
+When an article is marked as read, is it removed from the cache.
+
+@vindex gnus-cache-remove-articles
+@vindex gnus-cache-enter-articles
+The entering/removal of articles from the cache is controlled by the
+@code{gnus-cache-enter-articles} and @code{gnus-cache-remove-articles}
+variables. Both are lists of symbols. The first is @code{(ticked
+dormant)} by default, meaning that ticked and dormant articles will be
+put in the cache. The latter is @code{(read)} by default, meaning that
+articles that are marked as read are removed from the cache. Possibly
+symbols in these two lists are @code{ticked}, @code{dormant},
+@code{unread} and @code{read}.
+
+@findex gnus-jog-cache
+So where does the massive article-fetching and storing come into the
+picture? The @code{gnus-jog-cache} command will go through all
+subscribed newsgroups, request all unread articles, and store them in
+the cache. You should only ever, ever ever ever, use this command if 1)
+your connetion to the @sc{nntp} server is really, really, really slow
+and 2) you have a really, really, really huge disk. Seriously.
+
+
@node Exiting the Summary Buffer
@section Exiting the Summary Buffer
@cindex summary exit