From ef420d86a947e2498a03be322490eb4ef1e96577 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Tue, 4 Mar 1997 03:31:29 +0000 Subject: [PATCH] *** empty log message *** --- lisp/ChangeLog | 46 ++++ lisp/custom.el | 10 +- lisp/gnus-cache.el | 26 +-- lisp/gnus-cite.el | 54 ++--- lisp/gnus-cus.el | 8 +- lisp/gnus-ems.el | 70 ++++-- lisp/gnus-kill.el | 68 +++--- lisp/gnus-msg.el | 20 +- lisp/gnus-score.el | 68 +++--- lisp/gnus-uu.el | 198 ++++++++--------- lisp/gnus-vis.el | 224 +++++++++---------- lisp/gnus.el | 529 ++++++++++++++++++++++----------------------- lisp/nnbabyl.el | 12 +- lisp/nndoc.el | 24 +- lisp/nnfolder.el | 4 +- lisp/nnheader.el | 86 ++++---- lisp/nnkiboze.el | 24 +- lisp/nnmail.el | 59 ++--- lisp/nnmbox.el | 2 +- lisp/nnmh.el | 2 +- lisp/nnml.el | 2 +- lisp/nnspool.el | 4 +- lisp/nntp.el | 175 ++++++++------- lisp/nnvirtual.el | 20 +- texi/gnus.texi | 10 +- 25 files changed, 921 insertions(+), 824 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7d0957bfd..6b2a0194d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,51 @@ +Wed Aug 30 17:56:34 1995 Lars Magne Ingebrigtsen + + * custom.el ((string-match "XEmacs" emacs-version)): Would barf if + the menu-bar wasn't in use. + +Wed Aug 30 08:46:48 1995 Lars Magne Ingebrigtsen + + * gnus.el ('(gnus-read-init-file 'inhibit)): Don't load while + compiling. + (gnus-summary-next-article): Would not go to the next group when + all articles were canceled. + (gnus-summary-prepare): Create the hashtb before running the + prepare hook. + + * gnus.el: Renamed all `header-' macros `mail-header-'. Ran + `indent-sexp' on all functions in all files. + + * nnbabyl.el (nnbabyl-read-mbox): Would doubly insert RMAIL file + sometimes. + + * gnus-ems.el (appt-select-lowest-window): Not defined in XEmacs. + + * gnus-score.el (gnus-summary-header): Would bug out if there were + pseudo-articles in the buffer. + +Wed Aug 30 06:08:13 1995 Lars Magne Ingebrigtsen + + * gnus-score.el (gnus-score-find-trace): Didn't kill "*Gnus + Scores*" buffer on exit. + +Tue Aug 29 17:21:37 1995 Lars Magne Ingebrigtsen + + * gnus-msg.el (gnus-mail-reply-using-mail): Set auto-save-mode if + that is wanted. + + * gnus-ems.el (gnus-rebuild-thread-xemacs): Bugged out near the + end of buffers. + + * gnus.el (gnus-summary-read-group): Force a summary config. + Tue Aug 29 05:55:19 1995 Lars Magne Ingebrigtsen + * nntp.el: Do some pussy-footing around `accept-process-output'. + +Tue Aug 29 05:55:19 1995 Lars Magne Ingebrigtsen + + * gnus.el: 0.99.27 is released. + * gnus-msg.el (gnus-delete-supersedes-headers): Delete Supersedes. diff --git a/lisp/custom.el b/lisp/custom.el index 5b18d2bda..65bb35304 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -248,11 +248,11 @@ If called interactively, prompts for a face and face attributes." "Symbol used for highlighting text under mouse.") ;; Put it in the Help menu, if possible. -(condition-case nil - ;; This will not work under XEmacs. - (global-set-key [ menu-bar help-menu customize ] - '("Customize..." . customize)) - (error nil)) +(if (string-match "XEmacs" emacs-version) + nil + ;; This will not work under XEmacs. + (global-set-key [ menu-bar help-menu customize ] + '("Customize..." . customize))) ;;; Categories: ;; diff --git a/lisp/gnus-cache.el b/lisp/gnus-cache.el index b3d1afcbe..3b8b817ae 100644 --- a/lisp/gnus-cache.el +++ b/lisp/gnus-cache.el @@ -117,19 +117,19 @@ (defun gnus-cache-possibly-enter-article (group article headers ticked dormant unread) - (let ((number (header-number headers)) + (let ((number (mail-header-number headers)) file dir) - (if (or (not (vectorp headers)) ; This might be a dummy article. + (if (or (not (vectorp headers)) ; This might be a dummy article. (not (gnus-cache-member-of-class gnus-cache-enter-articles ticked dormant unread)) (file-exists-p (setq file (gnus-cache-file-name group article)))) - () ; Do nothing. + () ; Do nothing. ;; Possibly create the cache directory. (or (file-exists-p (setq dir (file-name-directory file))) (gnus-make-directory dir)) ;; Save the article in the cache. (if (file-exists-p file) - t ; The article already is saved, so we end here. + t ; The article already is saved, so we end here. (let ((gnus-use-cache nil)) (gnus-summary-select-article)) (save-excursion @@ -155,15 +155,15 @@ (beginning-of-line) ;; [number subject from date id references chars lines xref] (insert (format "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t\n" - (header-number headers) - (header-subject headers) - (header-from headers) - (header-date headers) - (header-id headers) - (or (header-references headers) "") - (or (header-chars headers) "") - (or (header-lines headers) "") - (or (header-xref headers) "")))) + (mail-header-number headers) + (mail-header-subject headers) + (mail-header-from headers) + (mail-header-date headers) + (mail-header-id headers) + (or (mail-header-references headers) "") + (or (mail-header-chars headers) "") + (or (mail-header-lines headers) "") + (or (mail-header-xref headers) "")))) t)))) (defun gnus-cache-enter-remove-article (article) diff --git a/lisp/gnus-cite.el b/lisp/gnus-cite.el index afabd0c96..a9458e13f 100644 --- a/lisp/gnus-cite.el +++ b/lisp/gnus-cite.el @@ -389,26 +389,26 @@ See also the documentation for `gnus-article-highlight-citation'." gnus-cite-loose-attribution-alist)))) ;; Find exact supercite citations. (gnus-cite-match-attributions 'small nil - (lambda (prefix tag) - (if tag - (concat "\\`" (regexp-quote prefix) "[ \t]*" - (regexp-quote tag) ">")))) + (lambda (prefix tag) + (if tag + (concat "\\`" (regexp-quote prefix) "[ \t]*" + (regexp-quote tag) ">")))) ;; Find loose supercite citations after attributions. (gnus-cite-match-attributions 'small t - (lambda (prefix tag) - (if tag (concat "\\<" (regexp-quote tag) "\\>")))) + (lambda (prefix tag) + (if tag (concat "\\<" (regexp-quote tag) "\\>")))) ;; Find loose supercite citations anywhere. (gnus-cite-match-attributions 'small nil - (lambda (prefix tag) - (if tag (concat "\\<" (regexp-quote tag) "\\>")))) + (lambda (prefix tag) + (if tag (concat "\\<" (regexp-quote tag) "\\>")))) ;; Find nested citations after attributions. (gnus-cite-match-attributions 'small-if-unique t - (lambda (prefix tag) - (concat "\\`" (regexp-quote prefix) ".+"))) + (lambda (prefix tag) + (concat "\\`" (regexp-quote prefix) ".+"))) ;; Find nested citations anywhere. (gnus-cite-match-attributions 'small nil - (lambda (prefix tag) - (concat "\\`" (regexp-quote prefix) ".+"))) + (lambda (prefix tag) + (concat "\\`" (regexp-quote prefix) ".+"))) ;; Remove loose prefixes with too few lines. (let ((alist gnus-cite-loose-prefix-alist) entry) @@ -487,21 +487,21 @@ See also the documentation for `gnus-article-highlight-citation'." (setq gnus-cite-attribution-alist (cons (cons in (car best)) gnus-cite-attribution-alist))) (if (memq best gnus-cite-loose-prefix-alist) - (let ((loop gnus-cite-prefix-alist) - (numbers (cdr best)) - current) - (setq gnus-cite-loose-prefix-alist - (delq best gnus-cite-loose-prefix-alist)) - (while loop - (setq current (car loop) - loop (cdr loop)) - (if (eq current best) - () - (setcdr current (gnus-set-difference (cdr current) numbers)) - (if (null (cdr current)) - (setq gnus-cite-loose-prefix-alist - (delq current gnus-cite-loose-prefix-alist) - atts (delq current atts))))))))))) + (let ((loop gnus-cite-prefix-alist) + (numbers (cdr best)) + current) + (setq gnus-cite-loose-prefix-alist + (delq best gnus-cite-loose-prefix-alist)) + (while loop + (setq current (car loop) + loop (cdr loop)) + (if (eq current best) + () + (setcdr current (gnus-set-difference (cdr current) numbers)) + (if (null (cdr current)) + (setq gnus-cite-loose-prefix-alist + (delq current gnus-cite-loose-prefix-alist) + atts (delq current atts))))))))))) (defun gnus-cite-find-loose (prefix) ;; Return a list of loose attribution lines prefixed by PREFIX. diff --git a/lisp/gnus-cus.el b/lisp/gnus-cus.el index 32fb78e12..bf1a9e3e3 100644 --- a/lisp/gnus-cus.el +++ b/lisp/gnus-cus.el @@ -40,7 +40,7 @@ "turquoise")) (defvar gnus-face-dark-name-list - '("blue" "firebrick" + '("skyblue" "firebrick" "dark green" "dark orange" "dark khaki" "dark violet" "dark turquoise")) @@ -326,7 +326,7 @@ alone.") ((eq gnus-background-mode 'dark) (list (list "From" nil (custom-face-lookup - "SkyeBlue" nil nil t t nil)) + "SkyBlue" nil nil t t nil)) (list "Subject" nil (custom-face-lookup "pink" nil nil t t nil)) @@ -337,7 +337,7 @@ alone.") (custom-face-lookup "cyan" nil nil t nil nil) (custom-face-lookup - "green" + "forestgreen" nil nil nil t nil)))) (t (list (list "From" nil @@ -350,7 +350,7 @@ alone.") nil nil t t nil)) (list "Newsgroups:.*," nil (custom-face-lookup - "red" nil nil t t nil)) + "indianred" nil nil t t nil)) (list "" (custom-face-lookup "DarkGreen" diff --git a/lisp/gnus-ems.el b/lisp/gnus-ems.el index 07ff7aad7..928b4a449 100644 --- a/lisp/gnus-ems.el +++ b/lisp/gnus-ems.el @@ -302,20 +302,20 @@ NOTE: This command only works with newsgroups that use real or simulated NNTP." (let ((header (car (gnus-gethash (downcase message-id) gnus-newsgroup-dependencies)))) (if header - (or (gnus-summary-goto-article (header-number header)) + (or (gnus-summary-goto-article (mail-header-number header)) ;; The header has been read, but the article had been ;; expunged, so we insert it again. (let ((beg (point))) (gnus-summary-insert-line nil header 0 nil gnus-read-mark nil nil - (header-subject header)) + (mail-header-subject header)) (save-excursion (goto-char beg) (remove-text-properties (1+ (gnus-point-at-bol)) (1+ (gnus-point-at-eol)) '(gnus-number nil gnus-mark nil gnus-level nil))) (forward-line -1) - (header-number header))) + (mail-header-number header))) (let ((gnus-override-method gnus-refer-article-method) (gnus-ancient-mark gnus-read-mark) (tmp-point (window-start @@ -332,7 +332,7 @@ NOTE: This command only works with newsgroups that use real or simulated NNTP." (if (gnus-article-prepare message-id nil (gnus-read-header message-id)) (progn - (setq number (header-number gnus-current-headers)) + (setq number (mail-header-number gnus-current-headers)) (gnus-rebuild-thread message-id) (gnus-summary-goto-subject number) (gnus-summary-recenter) @@ -447,7 +447,7 @@ call it with the value of the `gnus-data' text property." (if fun (funcall fun data)))) ;; Re-build the thread containing ID. -(defun gnus-rebuild-thread-xemacs (id) +(defun gnus-rebuild-thread-xemacs (id) (let ((dep gnus-newsgroup-dependencies) (buffer-read-only nil) parent headers refs thread art) @@ -455,7 +455,7 @@ call it with the value of the `gnus-data' text property." (car (setq art (gnus-gethash (downcase id) dep))))) (setq parent art) - (setq id (and (setq refs (header-references headers)) + (setq id (and (setq refs (mail-header-references headers)) (string-match "\\(<[^>]+>\\) *$" refs) (substring refs (match-beginning 1) (match-end 1))))) (setq thread (gnus-make-sub-thread (car parent))) @@ -465,9 +465,10 @@ call it with the value of the `gnus-data' text property." (save-excursion (while (and (>= (point) beg) (not (bobp))) - (remove-text-properties - (1+ (gnus-point-at-bol)) (1+ (gnus-point-at-eol)) - '(gnus-number nil gnus-mark nil gnus-level nil)) + (or (eobp) + (remove-text-properties + (1+ (gnus-point-at-bol)) (1+ (gnus-point-at-eol)) + '(gnus-number nil gnus-mark nil gnus-level nil))) (forward-line -1))) (gnus-summary-update-lines beg (point))))) @@ -488,6 +489,29 @@ call it with the value of the `gnus-data' text property." (defun gnus-window-top-edge-xemacs (&optional window) (nth 1 (window-pixel-edges window))) +;; Select the lowest window on the frame. +(defun gnus-appt-select-lowest-window-xemacs () + (let* ((lowest-window (selected-window)) + (bottom-edge (car (cdr (cdr (cdr (window-pixel-edges)))))) + (last-window (previous-window)) + (window-search t)) + (while window-search + (let* ((this-window (next-window)) + (next-bottom-edge (car (cdr (cdr (cdr + (window-pixel-edges + this-window))))))) + (if (< bottom-edge next-bottom-edge) + (progn + (setq bottom-edge next-bottom-edge) + (setq lowest-window this-window))) + + (select-window this-window) + (if (eq last-window this-window) + (progn + (select-window lowest-window) + (setq window-search nil))))))) + + (defun gnus-ems-redefine () (cond ((string-match "XEmacs\\|Lucid" emacs-version) @@ -508,31 +532,35 @@ call it with the value of the `gnus-data' text property." (fset 'gnus-article-add-button 'gnus-article-add-button-xemacs) (fset 'gnus-window-top-edge 'gnus-window-top-edge-xemacs) + (or (fboundp 'appt-select-lowest-window) + (fset 'appt-select-lowest-window + 'gnus-appt-select-lowest-window-xemacs)) + (if (not gnus-visual) () (setq gnus-group-mode-hook (cons '(lambda () - (easy-menu-add gnus-group-reading-menu) - (easy-menu-add gnus-group-group-menu) - (easy-menu-add gnus-group-misc-menu) - (gnus-install-mouse-tracker)) + (easy-menu-add gnus-group-reading-menu) + (easy-menu-add gnus-group-group-menu) + (easy-menu-add gnus-group-misc-menu) + (gnus-install-mouse-tracker)) gnus-group-mode-hook)) (setq gnus-summary-mode-hook (cons '(lambda () - (easy-menu-add gnus-summary-article-menu) - (easy-menu-add gnus-summary-thread-menu) - (easy-menu-add gnus-summary-misc-menu) - (easy-menu-add gnus-summary-post-menu) - (easy-menu-add gnus-summary-kill-menu) - (gnus-install-mouse-tracker)) + (easy-menu-add gnus-summary-article-menu) + (easy-menu-add gnus-summary-thread-menu) + (easy-menu-add gnus-summary-misc-menu) + (easy-menu-add gnus-summary-post-menu) + (easy-menu-add gnus-summary-kill-menu) + (gnus-install-mouse-tracker)) gnus-summary-mode-hook)) (setq gnus-article-mode-hook (cons '(lambda () - (easy-menu-add gnus-article-article-menu) - (easy-menu-add gnus-article-treatment-menu)) + (easy-menu-add gnus-article-article-menu) + (easy-menu-add gnus-article-treatment-menu)) gnus-article-mode-hook))) (defvar gnus-logo (make-glyph (make-specifier 'image))) diff --git a/lisp/gnus-kill.el b/lisp/gnus-kill.el index ec5eb74af..c5ff6ee6e 100644 --- a/lisp/gnus-kill.el +++ b/lisp/gnus-kill.el @@ -199,7 +199,7 @@ If NEWSGROUP is nil, the global kill file is selected." "Subject" (if (vectorp gnus-current-headers) (regexp-quote - (gnus-simplify-subject (header-subject gnus-current-headers))) + (gnus-simplify-subject (mail-header-subject gnus-current-headers))) ""))) (defun gnus-kill-file-kill-by-author () @@ -208,7 +208,7 @@ If NEWSGROUP is nil, the global kill file is selected." (gnus-kill-file-enter-kill "From" (if (vectorp gnus-current-headers) - (regexp-quote (header-from gnus-current-headers)) + (regexp-quote (mail-header-from gnus-current-headers)) ""))) (defun gnus-kill-file-kill-by-thread () @@ -217,14 +217,14 @@ If NEWSGROUP is nil, the global kill file is selected." (gnus-kill-file-enter-kill "References" (if (vectorp gnus-current-headers) - (regexp-quote (header-id gnus-current-headers)) + (regexp-quote (mail-header-id gnus-current-headers)) ""))) (defun gnus-kill-file-kill-by-xref () "Kill by Xref." (interactive) (let ((xref (and (vectorp gnus-current-headers) - (header-xref gnus-current-headers))) + (mail-header-xref gnus-current-headers))) (start 0) group) (if xref @@ -241,7 +241,7 @@ If NEWSGROUP is nil, the global kill file is selected." (defun gnus-kill-file-raise-followups-to-author (level) "Raise score for all followups to the current author." (interactive "p") - (let ((name (header-from gnus-current-headers)) + (let ((name (mail-header-from gnus-current-headers)) string) (save-excursion (gnus-kill-set-kill-buffer) @@ -357,14 +357,14 @@ Returns the number of articles marked as read." (let ((headers gnus-newsgroup-headers)) (if gnus-kill-killed (setq gnus-newsgroup-kill-headers - (mapcar (lambda (header) (header-number header)) + (mapcar (lambda (header) (mail-header-number header)) headers)) (while headers (or (gnus-member-of-range - (header-number (car headers)) + (mail-header-number (car headers)) gnus-newsgroup-killed) (setq gnus-newsgroup-kill-headers - (cons (header-number (car headers)) + (cons (mail-header-number (car headers)) gnus-newsgroup-kill-headers))) (setq headers (cdr headers)))) (setq files nil)) @@ -444,30 +444,30 @@ Returns the number of articles marked as read." '((?m . " ") (?j . "X"))) pattern modifier commands) - (while (not (eobp)) - (if (not (looking-at "[ \t]*/\\([^/]*\\)/\\([ahfcH]\\)?:\\([a-z=:]*\\)")) - () - (setq pattern (buffer-substring (match-beginning 1) (match-end 1))) - (setq modifier (if (match-beginning 2) (char-after (match-beginning 2)) - ?s)) - (setq commands (buffer-substring (match-beginning 3) (match-end 3))) - - ;; The "f:+" command marks everything *but* the matches as read, - ;; so we simply first match everything as read, and then unmark - ;; PATTERN later. - (and (string-match "\\+" commands) - (progn - (gnus-kill "from" ".") - (setq commands "m"))) - - (gnus-kill - (or (cdr (assq modifier mod-to-header)) "subject") - pattern - (if (string-match "m" commands) - '(gnus-summary-mark-as-unread nil " ") - '(gnus-summary-mark-as-read nil "X")) - nil t)) - (forward-line 1)))) + (while (not (eobp)) + (if (not (looking-at "[ \t]*/\\([^/]*\\)/\\([ahfcH]\\)?:\\([a-z=:]*\\)")) + () + (setq pattern (buffer-substring (match-beginning 1) (match-end 1))) + (setq modifier (if (match-beginning 2) (char-after (match-beginning 2)) + ?s)) + (setq commands (buffer-substring (match-beginning 3) (match-end 3))) + + ;; The "f:+" command marks everything *but* the matches as read, + ;; so we simply first match everything as read, and then unmark + ;; PATTERN later. + (and (string-match "\\+" commands) + (progn + (gnus-kill "from" ".") + (setq commands "m"))) + + (gnus-kill + (or (cdr (assq modifier mod-to-header)) "subject") + pattern + (if (string-match "m" commands) + '(gnus-summary-mark-as-unread nil " ") + '(gnus-summary-mark-as-read nil "X")) + nil t)) + (forward-line 1)))) ;; Kill changes and new format by suggested by JWZ and Sudish Joseph ;; . @@ -584,9 +584,9 @@ COMMAND must be a lisp expression or a string representing a key sequence." (gnus-last-article nil) (gnus-break-pages nil) ;No need to break pages. (gnus-mark-article-hook nil)) ;Inhibit marking as read. - (message "Searching for article: %d..." (header-number header)) + (message "Searching for article: %d..." (mail-header-number header)) (gnus-article-setup-buffer) - (gnus-article-prepare (header-number header) t) + (gnus-article-prepare (mail-header-number header) t) (if (save-excursion (set-buffer gnus-article-buffer) (goto-char (point-min)) diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index 858a83d7c..6db6e2f4f 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -348,7 +348,7 @@ header line with the old Message-ID." (if (not (string-equal (downcase (mail-strip-quoted-names - (header-from gnus-current-headers))) + (mail-header-from gnus-current-headers))) (downcase (mail-strip-quoted-names (gnus-inews-user-name))))) (error "This article is not yours.")) (save-excursion @@ -424,7 +424,7 @@ Type \\[describe-mode] in the buffer to get a list of commands." (save-excursion (set-buffer gnus-summary-buffer) (cons (current-buffer) gnus-current-article)))) - (from (and header (header-from header))) + (from (and header (mail-header-from header))) (winconf (current-window-configuration)) real-group) (and gnus-interactive-post @@ -463,7 +463,7 @@ Type \\[describe-mode] in the buffer to get a list of commands." (make-local-variable 'gnus-article-reply) (make-local-variable 'gnus-article-check-size) (make-local-variable 'gnus-reply-subject) - (setq gnus-reply-subject (and header (header-subject header))) + (setq gnus-reply-subject (and header (mail-header-subject header))) (setq gnus-article-reply sumart) ;; Handle `gnus-auto-mail-to-author'. ;; Suggested by Daniel Quinlan . @@ -1067,8 +1067,12 @@ Headers in `gnus-required-headers' will be generated." (if (or (not (re-search-forward (concat "^" (downcase (symbol-name header)) ":") nil t)) (progn - (if (= (following-char) ? ) (forward-char 1) (insert " ")) + ;; The header was found. We insert a space after the + ;; colon, if there is none. + (if (/= (following-char) ? ) (insert " ")) + ;; Find out whether the header is empty... (looking-at "[ \t]*$"))) + ;; So we find out what value we should insert. (progn (setq value (or (if (consp elem) @@ -1490,7 +1494,7 @@ mailer." (setq follow-to (funcall gnus-reply-to-function group))) (setq from (mail-fetch-field "from")) (setq date (or (mail-fetch-field "date") - (header-date gnus-current-headers))) + (mail-header-date gnus-current-headers))) (and from (let ((stop-pos (string-match " *at \\| *@ \\| *(\\| *<" from))) @@ -1522,6 +1526,7 @@ mailer." (or follow-to reply-to from sender ""))) subject message-of nil gnus-article-copy nil) + (auto-save-mode auto-save-default) (use-local-map (copy-keymap mail-mode-map)) (local-set-key "\C-c\C-c" 'gnus-mail-send-and-exit) @@ -1579,7 +1584,7 @@ mailer." (defun gnus-mail-yank-original () (interactive) (save-excursion - (mail-yank-original nil)) + (mail-yank-original nil)) (or mail-yank-hooks mail-citation-hook (run-hooks 'news-reply-header-hook))) @@ -1606,7 +1611,7 @@ mailer." gnus-newsgroup-name))) gnus-valid-select-methods)) (gnus-fetch-field "From") - gnus-newsgroup-name) + gnus-newsgroup-name) "] " (or (gnus-fetch-field "Subject") "")))) (defun gnus-forward-insert-buffer (buffer) @@ -1696,6 +1701,7 @@ If YANK is non-nil, include the original article." (erase-buffer) (mail-mode) (mail-setup gnus-maintainer nil nil nil nil nil) + (auto-save-mode auto-save-default) (make-local-variable 'gnus-prev-winconf) (setq gnus-prev-winconf winconf) (use-local-map (copy-keymap mail-mode-map)) diff --git a/lisp/gnus-score.el b/lisp/gnus-score.el index 7f7b32ec8..fdf88168b 100644 --- a/lisp/gnus-score.el +++ b/lisp/gnus-score.el @@ -275,8 +275,8 @@ used as score." (if (eq 'perm temporary) ; Temp nil temporary) - (not (nth 3 entry))) ; Prompt - ))) + (not (nth 3 entry))) ; Prompt + ))) (defun gnus-score-insert-help (string alist idx) (setq gnus-score-help-winconf (current-window-configuration)) @@ -323,7 +323,8 @@ used as score." (let ((article (gnus-summary-article-number)) headers) (if article - (if (setq headers (gnus-get-header-by-number article)) + (if (and (setq headers (gnus-get-header-by-number article)) + (vectorp headers)) (aref headers (nth 1 (assoc header gnus-header-index))) (if no-err nil @@ -350,7 +351,7 @@ If optional argument `SILENT' is nil, show effect of score entry." (read-string "Match: ") (if (y-or-n-p "Use regexp match? ") 'r 's) (and current-prefix-arg - (prefix-numeric-value current-prefix-arg)) + (prefix-numeric-value current-prefix-arg)) (cond ((not (y-or-n-p "Add to score file? ")) 'now) ((y-or-n-p "Expire kill? ") @@ -434,7 +435,7 @@ SCORE is the score to add." (prefix-numeric-value current-prefix-arg))) (save-excursion (or (and (stringp match) (> (length match) 0)) - (error "No match")) + (error "No match")) (goto-char (point-min)) (let ((regexp (cond ((eq type 'f) (gnus-simplify-subject-fuzzy match)) @@ -452,21 +453,21 @@ SCORE is the score to add." (beginning-of-line 2))))) (defun gnus-summary-score-crossposting (score date) - ;; Enter score file entry for current crossposting. - ;; SCORE is the score to add. - ;; DATE is the expire date. - (let ((xref (gnus-summary-header "xref")) - (start 0) - group) - (or xref (error "This article is not crossposted")) - (while (string-match " \\([^ \t]+\\):" xref start) - (setq start (match-end 0)) - (if (not (string= - (setq group - (substring xref (match-beginning 1) (match-end 1))) - gnus-newsgroup-name)) - (gnus-summary-score-entry - "xref" (concat " " group ":") nil score date t))))) + ;; Enter score file entry for current crossposting. + ;; SCORE is the score to add. + ;; DATE is the expire date. + (let ((xref (gnus-summary-header "xref")) + (start 0) + group) + (or xref (error "This article is not crossposted")) + (while (string-match " \\([^ \t]+\\):" xref start) + (setq start (match-end 0)) + (if (not (string= + (setq group + (substring xref (match-beginning 1) (match-end 1))) + gnus-newsgroup-name)) + (gnus-summary-score-entry + "xref" (concat " " group ":") nil score date t))))) ;;; @@ -821,8 +822,8 @@ SCORE is the score to add." ;; WARNING: The assq makes the function O(N*S) while it could ;; be written as O(N+S), where N is (length gnus-newsgroup-headers) ;; and S is (length gnus-newsgroup-scored). - (or (assq (header-number header) gnus-newsgroup-scored) - (setq gnus-scores-articles ;Total of 2 * N cons-cells used. + (or (assq (mail-header-number header) gnus-newsgroup-scored) + (setq gnus-scores-articles ;Total of 2 * N cons-cells used. (cons (cons header (or gnus-summary-default-score 0)) gnus-scores-articles)))) @@ -856,7 +857,7 @@ SCORE is the score to add." (while gnus-scores-articles (or (= gnus-summary-default-score (cdr (car gnus-scores-articles))) (setq gnus-newsgroup-scored - (cons (cons (header-number + (cons (cons (mail-header-number (car (car gnus-scores-articles))) (cdr (car gnus-scores-articles))) gnus-newsgroup-scored))) @@ -978,7 +979,7 @@ SCORE is the score to add." (found ;Match, update date. (gnus-score-set 'touched '(t) alist) (setcar (nthcdr 2 kill) now)) - ((< date expire) ;Old entry, remove. + ((< date expire) ;Old entry, remove. (gnus-score-set 'touched '(t) alist) (setcdr entries (cdr rest)) (setq rest entries))) @@ -1029,7 +1030,7 @@ SCORE is the score to add." (found ;Match, update date. (gnus-score-set 'touched '(t) alist) (setcar (nthcdr 2 kill) now)) - ((< date expire) ;Old entry, remove. + ((< date expire) ;Old entry, remove. (gnus-score-set 'touched '(t) alist) (setcdr entries (cdr rest)) (setq rest entries))) @@ -1041,7 +1042,7 @@ SCORE is the score to add." (save-restriction (let* ((buffer-read-only nil) (articles gnus-scores-articles) - (last (header-number (car (car gnus-scores-articles)))) + (last (mail-header-number (car (car gnus-scores-articles)))) (all-scores scores) (request-func (cond ((string= "head" (downcase header)) 'gnus-request-head) @@ -1060,7 +1061,7 @@ SCORE is the score to add." (setq ofunc request-func) (setq request-func 'gnus-request-article))) (while articles - (setq article (header-number (car (car articles)))) + (setq article (mail-header-number (car (car articles)))) (gnus-message 7 "Scoring on article %s of %s..." article last) (if (not (funcall request-func article gnus-newsgroup-name)) () @@ -1212,7 +1213,7 @@ SCORE is the score to add." (found ;Match, update date. (gnus-score-set 'touched '(t) alist) (setcar (nthcdr 2 kill) now)) - ((< date expire) ;Old entry, remove. + ((< date expire) ;Old entry, remove. (gnus-score-set 'touched '(t) alist) (setcdr entries (cdr rest)) (setq rest entries))) @@ -1223,7 +1224,7 @@ SCORE is the score to add." (defun gnus-score-add-followups (header score scores) (save-excursion (set-buffer gnus-summary-buffer) - (let* ((id (header-id header)) + (let* ((id (mail-header-id header)) (scores (car scores)) entry dont) ;; Don't enter a score if there already is one. @@ -1326,7 +1327,7 @@ SCORE is the score to add." arts (cdr arts)) (setcdr art (+ score (cdr art))) (setq gnus-score-trace - (cons (cons (header-number + (cons (cons (mail-header-number (car art)) kill) gnus-score-trace))) (while arts @@ -1347,7 +1348,7 @@ SCORE is the score to add." arts (cdr arts)) (setcdr art (+ score (cdr art))) (setq gnus-score-trace - (cons (cons (header-number (car art)) kill) + (cons (cons (mail-header-number (car art)) kill) gnus-score-trace))) (while arts (setq art (car arts) @@ -1408,7 +1409,7 @@ SCORE is the score to add." arts (cdr arts)) (setcdr art (+ score (cdr art))) (setq gnus-score-trace - (cons (cons (header-number + (cons (cons (mail-header-number (car art)) kill) gnus-score-trace))) (while arts @@ -1435,7 +1436,7 @@ SCORE is the score to add." (defun gnus-score-build-cons (article) ;; Build a `gnus-newsgroup-scored' type cons from ARTICLE. - (cons (header-number (car article)) (cdr article))) + (cons (mail-header-number (car article)) (cdr article))) (defconst gnus-header-index ;; Name to index alist. @@ -1620,6 +1621,7 @@ This mode is an extended emacs-lisp mode. (or (setq trace gnus-score-trace) (error "No score rules apply to the current article.")) (pop-to-buffer "*Gnus Scores*") + (gnus-add-current-to-buffer-list) (erase-buffer) (while trace (insert (format "%S\n" (cdr (car trace)))) diff --git a/lisp/gnus-uu.el b/lisp/gnus-uu.el index 1bae46052..1daea4757 100644 --- a/lisp/gnus-uu.el +++ b/lisp/gnus-uu.el @@ -518,7 +518,7 @@ The headers will be included in the sequence they are matched.") (save-excursion (while marked (and (setq headers (gnus-get-header-by-number (car marked))) - (setq subject (header-subject headers) + (setq subject (mail-header-subject headers) articles (gnus-uu-find-articles-matching (gnus-uu-reginize-string subject)) total (nconc total articles))) @@ -654,56 +654,56 @@ The headers will be included in the sequence they are matched.") 'begin 'end)) ((eq in-state 'last) (list 'end)) (t (list 'middle))))) - (t - (let ((name (file-name-nondirectory gnus-uu-saved-article-name)) - beg subj headers headline sorthead body end-string state) - (if (or (eq in-state 'first) - (eq in-state 'first-and-last)) - (progn - (setq state (list 'begin)) - (save-excursion (set-buffer (get-buffer-create "*gnus-uu-body*")) - (erase-buffer)) - (save-excursion - (set-buffer (get-buffer-create "*gnus-uu-pre*")) - (erase-buffer) - (insert (format - "Date: %s\nFrom: %s\nSubject: %s Digest\n\nTopics:\n" - (current-time-string) name name)))) - (if (not (eq in-state 'end)) - (setq state (list 'middle)))) - (save-excursion - (set-buffer (get-buffer "*gnus-uu-body*")) - (goto-char (setq beg (point-max))) - (save-excursion - (save-restriction - (set-buffer buffer) - (goto-char (point-min)) - (re-search-forward "\n\n") - (setq body (buffer-substring (1- (point)) (point-max))) - (narrow-to-region 1 (point)) - (if (not (setq headers gnus-uu-digest-headers)) - (setq sorthead (buffer-substring (point-min) (point-max))) - (while headers - (setq headline (car headers)) - (setq headers (cdr headers)) - (goto-char (point-min)) - (if (re-search-forward headline nil t) - (setq sorthead - (concat sorthead - (buffer-substring - (match-beginning 0) - (or (and (re-search-forward "^[^ \t]" nil t) - (1- (point))) - (progn (forward-line 1) (point))))))))) - (widen))) - (insert sorthead)(goto-char (point-max)) - (insert body)(goto-char (point-max)) - (insert (concat "\n" (make-string 30 ?-) "\n\n")) - (goto-char beg) - (if (re-search-forward "^Subject: \\(.*\\)$" nil t) - (progn - (setq subj (buffer-substring (match-beginning 1) (match-end 1))) - (save-excursion + (t + (let ((name (file-name-nondirectory gnus-uu-saved-article-name)) + beg subj headers headline sorthead body end-string state) + (if (or (eq in-state 'first) + (eq in-state 'first-and-last)) + (progn + (setq state (list 'begin)) + (save-excursion (set-buffer (get-buffer-create "*gnus-uu-body*")) + (erase-buffer)) + (save-excursion + (set-buffer (get-buffer-create "*gnus-uu-pre*")) + (erase-buffer) + (insert (format + "Date: %s\nFrom: %s\nSubject: %s Digest\n\nTopics:\n" + (current-time-string) name name)))) + (if (not (eq in-state 'end)) + (setq state (list 'middle)))) + (save-excursion + (set-buffer (get-buffer "*gnus-uu-body*")) + (goto-char (setq beg (point-max))) + (save-excursion + (save-restriction + (set-buffer buffer) + (goto-char (point-min)) + (re-search-forward "\n\n") + (setq body (buffer-substring (1- (point)) (point-max))) + (narrow-to-region 1 (point)) + (if (not (setq headers gnus-uu-digest-headers)) + (setq sorthead (buffer-substring (point-min) (point-max))) + (while headers + (setq headline (car headers)) + (setq headers (cdr headers)) + (goto-char (point-min)) + (if (re-search-forward headline nil t) + (setq sorthead + (concat sorthead + (buffer-substring + (match-beginning 0) + (or (and (re-search-forward "^[^ \t]" nil t) + (1- (point))) + (progn (forward-line 1) (point))))))))) + (widen))) + (insert sorthead)(goto-char (point-max)) + (insert body)(goto-char (point-max)) + (insert (concat "\n" (make-string 30 ?-) "\n\n")) + (goto-char beg) + (if (re-search-forward "^Subject: \\(.*\\)$" nil t) + (progn + (setq subj (buffer-substring (match-beginning 1) (match-end 1))) + (save-excursion (set-buffer (get-buffer "*gnus-uu-pre*")) (insert (format " %s\n" subj)))))) (if (or (eq in-state 'last) @@ -777,23 +777,23 @@ The headers will be included in the sequence they are matched.") (let ((state (list 'ok)) start-char end-char file-name) (save-excursion - (set-buffer process-buffer) - (goto-char (point-min)) - (if (not (re-search-forward gnus-uu-postscript-begin-string nil t)) - (setq state (list 'wrong-type)) - (beginning-of-line) - (setq start-char (point)) - (if (not (re-search-forward gnus-uu-postscript-end-string nil t)) - (setq state (list 'wrong-type)) - (setq end-char (point)) - (set-buffer (get-buffer-create gnus-uu-output-buffer-name)) - (insert-buffer-substring process-buffer start-char end-char) - (setq file-name (concat gnus-uu-work-dir (cdr gnus-article-current) ".ps")) - (write-region (point-min) (point-max) file-name) - (setq state (list file-name'begin 'end)) - - )) - ) + (set-buffer process-buffer) + (goto-char (point-min)) + (if (not (re-search-forward gnus-uu-postscript-begin-string nil t)) + (setq state (list 'wrong-type)) + (beginning-of-line) + (setq start-char (point)) + (if (not (re-search-forward gnus-uu-postscript-end-string nil t)) + (setq state (list 'wrong-type)) + (setq end-char (point)) + (set-buffer (get-buffer-create gnus-uu-output-buffer-name)) + (insert-buffer-substring process-buffer start-char end-char) + (setq file-name (concat gnus-uu-work-dir (cdr gnus-article-current) ".ps")) + (write-region (point-min) (point-max) file-name) + (setq state (list file-name'begin 'end)) + + )) + ) state)) @@ -893,21 +893,21 @@ The headers will be included in the sequence they are matched.") ;; Failing that, articles that have subjects that are part of the ;; same "series" as the current will be returned. (let (articles) - (cond - (n - (let ((backward (< n 0)) - (n (abs n))) - (save-excursion - (while (and (> n 0) - (setq articles (cons (gnus-summary-article-number) - articles)) - (gnus-summary-search-forward nil nil backward)) - (setq n (1- n)))) - (nreverse articles))) - (gnus-newsgroup-processable - (reverse gnus-newsgroup-processable)) - (t - (gnus-uu-find-articles-matching))))) + (cond + (n + (let ((backward (< n 0)) + (n (abs n))) + (save-excursion + (while (and (> n 0) + (setq articles (cons (gnus-summary-article-number) + articles)) + (gnus-summary-search-forward nil nil backward)) + (setq n (1- n)))) + (nreverse articles))) + (gnus-newsgroup-processable + (reverse gnus-newsgroup-processable)) + (t + (gnus-uu-find-articles-matching))))) (defun gnus-uu-string< (l1 l2) (string< (car l1) (car l2))) @@ -1103,8 +1103,8 @@ The headers will be included in the sequence they are matched.") (if (and (or (eq state 'last) (eq state 'first-and-last)) (not (memq 'end process-state))) - (if (and result-file (file-exists-p result-file)) - (delete-file result-file))) + (if (and result-file (file-exists-p result-file)) + (delete-file result-file))) (if (not (memq 'wrong-type process-state)) () @@ -1152,7 +1152,7 @@ The headers will be included in the sequence they are matched.") result-files)) (defun gnus-uu-part-number (article) - (let ((subject (header-subject (gnus-get-header-by-number article)))) + (let ((subject (mail-header-subject (gnus-get-header-by-number article)))) (if (string-match "[0-9]+ */[0-9]+\\|[0-9]+ * of *[0-9]+" subject) (substring subject (match-beginning 0) (match-end 0)) @@ -1197,7 +1197,7 @@ The headers will be included in the sequence they are matched.") (or (looking-at gnus-uu-body-line) (gnus-delete-line)) - ; Replace any slashes and spaces in file names before decoding + ; Replace any slashes and spaces in file names before decoding (goto-char name-beg) (while (re-search-forward "/" name-end t) (replace-match ",")) @@ -1206,7 +1206,7 @@ The headers will be included in the sequence they are matched.") (replace-match "_")) (goto-char name-beg) (if (re-search-forward "_*$" name-end t) - (replace-match "")) + (replace-match "")) (setq gnus-uu-file-name (buffer-substring name-beg name-end)) (and gnus-uu-uudecode-process @@ -1263,7 +1263,7 @@ The headers will be included in the sequence they are matched.") (progn (delete-process gnus-uu-uudecode-process) (message "gnus-uu: Couldn't uudecode") -; (sleep-for 2) + ; (sleep-for 2) (setq state (list 'wrong-type))))) (if (memq 'end state) @@ -1282,16 +1282,16 @@ The headers will be included in the sequence they are matched.") (let ((state (list 'ok)) start-char) (save-excursion - (set-buffer process-buffer) - (goto-char (point-min)) - (if (not (re-search-forward gnus-uu-shar-begin-string nil t)) - (setq state (list 'wrong-type)) - (beginning-of-line) - (setq start-char (point)) - (call-process-region - start-char (point-max) "sh" nil - (get-buffer-create gnus-uu-output-buffer-name) nil - "-c" (concat "cd " gnus-uu-work-dir " ; sh")))) + (set-buffer process-buffer) + (goto-char (point-min)) + (if (not (re-search-forward gnus-uu-shar-begin-string nil t)) + (setq state (list 'wrong-type)) + (beginning-of-line) + (setq start-char (point)) + (call-process-region + start-char (point-max) "sh" nil + (get-buffer-create gnus-uu-output-buffer-name) nil + "-c" (concat "cd " gnus-uu-work-dir " ; sh")))) state)) ;; Returns the name of what the shar file is going to unpack. diff --git a/lisp/gnus-vis.el b/lisp/gnus-vis.el index 3b6dbc1d1..3d23bd955 100644 --- a/lisp/gnus-vis.el +++ b/lisp/gnus-vis.el @@ -488,113 +488,113 @@ variable it the real callback function.") (and nil '(("Default header" - ["Ask" (gnus-score-set-default 'gnus-score-default-header nil) - :style radio - :selected (null gnus-score-default-header)] - ["From" (gnus-score-set-default 'gnus-score-default-header 'a) - :style radio - :selected (eq gnus-score-default-header 'a )] - ["Subject" (gnus-score-set-default 'gnus-score-default-header 's) - :style radio - :selected (eq gnus-score-default-header 's )] - ["Article body" - (gnus-score-set-default 'gnus-score-default-header 'b) - :style radio - :selected (eq gnus-score-default-header 'b )] - ["All headers" - (gnus-score-set-default 'gnus-score-default-header 'h) - :style radio - :selected (eq gnus-score-default-header 'h )] - ["Message-Id" (gnus-score-set-default 'gnus-score-default-header 'i) - :style radio - :selected (eq gnus-score-default-header 'i )] - ["Thread" (gnus-score-set-default 'gnus-score-default-header 't) - :style radio - :selected (eq gnus-score-default-header 't )] - ["Crossposting" - (gnus-score-set-default 'gnus-score-default-header 'x) - :style radio - :selected (eq gnus-score-default-header 'x )] - ["Lines" (gnus-score-set-default 'gnus-score-default-header 'l) - :style radio - :selected (eq gnus-score-default-header 'l )] - ["Date" (gnus-score-set-default 'gnus-score-default-header 'd) - :style radio - :selected (eq gnus-score-default-header 'd )] - ["Followups to author" - (gnus-score-set-default 'gnus-score-default-header 'f) - :style radio - :selected (eq gnus-score-default-header 'f )]) - ("Default type" - ["Ask" (gnus-score-set-default 'gnus-score-default-type nil) - :style radio - :selected (null gnus-score-default-type)] - ;; The `:active' key is commented out in the following, - ;; because the GNU Emacs hack to support radio buttons use - ;; active to indicate which button is selected. - ["Substring" (gnus-score-set-default 'gnus-score-default-type 's) - :style radio - ;; :active (not (memq gnus-score-default-header '(l d))) - :selected (eq gnus-score-default-type 's)] - ["Regexp" (gnus-score-set-default 'gnus-score-default-type 'r) - :style radio - ;; :active (not (memq gnus-score-default-header '(l d))) - :selected (eq gnus-score-default-type 'r)] - ["Exact" (gnus-score-set-default 'gnus-score-default-type 'e) - :style radio - ;; :active (not (memq gnus-score-default-header '(l d))) - :selected (eq gnus-score-default-type 'e)] - ["Fuzzy" (gnus-score-set-default 'gnus-score-default-type 'f) - :style radio - ;; :active (not (memq gnus-score-default-header '(l d))) - :selected (eq gnus-score-default-type 'f)] - ["Before date" (gnus-score-set-default 'gnus-score-default-type 'b) - :style radio - ;; :active (eq (gnus-score-default-header 'd)) - :selected (eq gnus-score-default-type 'b)] - ["At date" (gnus-score-set-default 'gnus-score-default-type 'n) - :style radio - ;; :active (eq (gnus-score-default-header 'd)) - :selected (eq gnus-score-default-type 'n)] - ["After date" (gnus-score-set-default 'gnus-score-default-type 'a) - :style radio - ;; :active (eq (gnus-score-default-header 'd)) - :selected (eq gnus-score-default-type 'a)] - ["Less than number" - (gnus-score-set-default 'gnus-score-default-type '<) - :style radio - ;; :active (eq (gnus-score-default-header 'l)) - :selected (eq gnus-score-default-type '<)] - ["Equal to number" - (gnus-score-set-default 'gnus-score-default-type '=) - :style radio - ;; :active (eq (gnus-score-default-header 'l)) - :selected (eq gnus-score-default-type '=)] - ["Greater than number" - (gnus-score-set-default 'gnus-score-default-type '>) - :style radio - ;; :active (eq (gnus-score-default-header 'l)) - :selected (eq gnus-score-default-type '>)]) - ["Default fold" gnus-score-default-fold-toggle - :style toggle - :selected gnus-score-default-fold] - ("Default duration" - ["Ask" (gnus-score-set-default 'gnus-score-default-duration nil) - :style radio - :selected (null gnus-score-default-duration)] - ["Permanent" - (gnus-score-set-default 'gnus-score-default-duration 'p) - :style radio - :selected (eq gnus-score-default-duration 'p)] - ["Temporary" - (gnus-score-set-default 'gnus-score-default-duration 't) - :style radio - :selected (eq gnus-score-default-duration 't)] - ["Immediate" - (gnus-score-set-default 'gnus-score-default-duration 'i) - :style radio - :selected (eq gnus-score-default-duration 'i)]) - )) + ["Ask" (gnus-score-set-default 'gnus-score-default-header nil) + :style radio + :selected (null gnus-score-default-header)] + ["From" (gnus-score-set-default 'gnus-score-default-header 'a) + :style radio + :selected (eq gnus-score-default-header 'a )] + ["Subject" (gnus-score-set-default 'gnus-score-default-header 's) + :style radio + :selected (eq gnus-score-default-header 's )] + ["Article body" + (gnus-score-set-default 'gnus-score-default-header 'b) + :style radio + :selected (eq gnus-score-default-header 'b )] + ["All headers" + (gnus-score-set-default 'gnus-score-default-header 'h) + :style radio + :selected (eq gnus-score-default-header 'h )] + ["Message-Id" (gnus-score-set-default 'gnus-score-default-header 'i) + :style radio + :selected (eq gnus-score-default-header 'i )] + ["Thread" (gnus-score-set-default 'gnus-score-default-header 't) + :style radio + :selected (eq gnus-score-default-header 't )] + ["Crossposting" + (gnus-score-set-default 'gnus-score-default-header 'x) + :style radio + :selected (eq gnus-score-default-header 'x )] + ["Lines" (gnus-score-set-default 'gnus-score-default-header 'l) + :style radio + :selected (eq gnus-score-default-header 'l )] + ["Date" (gnus-score-set-default 'gnus-score-default-header 'd) + :style radio + :selected (eq gnus-score-default-header 'd )] + ["Followups to author" + (gnus-score-set-default 'gnus-score-default-header 'f) + :style radio + :selected (eq gnus-score-default-header 'f )]) + ("Default type" + ["Ask" (gnus-score-set-default 'gnus-score-default-type nil) + :style radio + :selected (null gnus-score-default-type)] + ;; The `:active' key is commented out in the following, + ;; because the GNU Emacs hack to support radio buttons use + ;; active to indicate which button is selected. + ["Substring" (gnus-score-set-default 'gnus-score-default-type 's) + :style radio + ;; :active (not (memq gnus-score-default-header '(l d))) + :selected (eq gnus-score-default-type 's)] + ["Regexp" (gnus-score-set-default 'gnus-score-default-type 'r) + :style radio + ;; :active (not (memq gnus-score-default-header '(l d))) + :selected (eq gnus-score-default-type 'r)] + ["Exact" (gnus-score-set-default 'gnus-score-default-type 'e) + :style radio + ;; :active (not (memq gnus-score-default-header '(l d))) + :selected (eq gnus-score-default-type 'e)] + ["Fuzzy" (gnus-score-set-default 'gnus-score-default-type 'f) + :style radio + ;; :active (not (memq gnus-score-default-header '(l d))) + :selected (eq gnus-score-default-type 'f)] + ["Before date" (gnus-score-set-default 'gnus-score-default-type 'b) + :style radio + ;; :active (eq (gnus-score-default-header 'd)) + :selected (eq gnus-score-default-type 'b)] + ["At date" (gnus-score-set-default 'gnus-score-default-type 'n) + :style radio + ;; :active (eq (gnus-score-default-header 'd)) + :selected (eq gnus-score-default-type 'n)] + ["After date" (gnus-score-set-default 'gnus-score-default-type 'a) + :style radio + ;; :active (eq (gnus-score-default-header 'd)) + :selected (eq gnus-score-default-type 'a)] + ["Less than number" + (gnus-score-set-default 'gnus-score-default-type '<) + :style radio + ;; :active (eq (gnus-score-default-header 'l)) + :selected (eq gnus-score-default-type '<)] + ["Equal to number" + (gnus-score-set-default 'gnus-score-default-type '=) + :style radio + ;; :active (eq (gnus-score-default-header 'l)) + :selected (eq gnus-score-default-type '=)] + ["Greater than number" + (gnus-score-set-default 'gnus-score-default-type '>) + :style radio + ;; :active (eq (gnus-score-default-header 'l)) + :selected (eq gnus-score-default-type '>)]) + ["Default fold" gnus-score-default-fold-toggle + :style toggle + :selected gnus-score-default-fold] + ("Default duration" + ["Ask" (gnus-score-set-default 'gnus-score-default-duration nil) + :style radio + :selected (null gnus-score-default-duration)] + ["Permanent" + (gnus-score-set-default 'gnus-score-default-duration 'p) + :style radio + :selected (eq gnus-score-default-duration 'p)] + ["Temporary" + (gnus-score-set-default 'gnus-score-default-duration 't) + :style radio + :selected (eq gnus-score-default-duration 't)] + ["Immediate" + (gnus-score-set-default 'gnus-score-default-duration 'i) + :style radio + :selected (eq gnus-score-default-duration 'i)]) + )) (easy-menu-define gnus-summary-article-menu @@ -1127,7 +1127,7 @@ call it with the value of the `gnus-data' text property." (let* ((pos (posn-point (event-start event))) (data (get-text-property pos 'gnus-data)) (fun (get-text-property pos 'gnus-callback))) - (if fun (funcall fun data)))) + (if fun (funcall fun data)))) (defun gnus-article-press-button () "Check text at point for a callback function. @@ -1136,7 +1136,7 @@ call it with the value of the `gnus-data' text property." (interactive) (let* ((data (get-text-property (point) 'gnus-data)) (fun (get-text-property (point) 'gnus-callback))) - (if fun (funcall fun data)))) + (if fun (funcall fun data)))) ;; Suggested by Arne Elofsson (defun gnus-article-next-button () @@ -1144,7 +1144,7 @@ call it with the value of the `gnus-data' text property." (interactive) (if (get-text-property (point) 'gnus-callback) (goto-char (next-single-property-change (point) 'gnus-callback - nil (point-max)))) + nil (point-max)))) (let ((pos (next-single-property-change (point) 'gnus-callback))) (if pos (goto-char pos) @@ -1363,8 +1363,8 @@ External references are things like message-ids and URLs, as specified by (let ((string (buffer-substring (match-beginning group) (match-end group)))) - (set-text-properties 0 (length string) nil string) - string)) + (set-text-properties 0 (length string) nil string) + string)) (nthcdr 4 entry)))) (cond ((fboundp fun) (apply fun args)) diff --git a/lisp/gnus.el b/lisp/gnus.el index 989400088..aef11da26 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1147,10 +1147,10 @@ following hook: (list (lambda () (mapcar (lambda (header) - (header-set-subject + (mail-header-set-subject header (gnus-simplify-subject - (header-subject header) 're-only))) + (mail-header-subject header) 're-only))) gnus-newsgroup-headers))))") (defvar gnus-select-article-hook @@ -1287,12 +1287,12 @@ automatically when it is selected.") (list ?a '(or (car (funcall gnus-extract-address-components from)) from) ?s) (list ?F 'from ?s) - (list ?x (macroexpand '(header-xref header)) ?s) - (list ?D (macroexpand '(header-date header)) ?s) - (list ?d '(gnus-dd-mmm (header-date header)) ?s) - (list ?M (macroexpand '(header-id header)) ?s) - (list ?r (macroexpand '(header-references header)) ?s) - (list ?c '(or (header-chars header) 0) ?d) + (list ?x (macroexpand '(mail-header-xref header)) ?s) + (list ?D (macroexpand '(mail-header-date header)) ?s) + (list ?d '(gnus-dd-mmm (mail-header-date header)) ?s) + (list ?M (macroexpand '(mail-header-id header)) ?s) + (list ?r (macroexpand '(mail-header-references header)) ?s) + (list ?c '(or (mail-header-chars header) 0) ?d) (list ?L 'lines ?d) (list ?I 'indentation ?s) (list ?T '(if (= level 0) "" (make-string (frame-width) ? )) ?s) @@ -1343,7 +1343,7 @@ variable (string, integer, character, etc).") "gnus-bug@ifi.uio.no (The Gnus Bugfixing Girls + Boys)" "The mail address of the Gnus maintainers.") -(defconst gnus-version "(ding) Gnus v0.99.27" +(defconst gnus-version "(ding) Gnus v0.99.28" "Version number for this version of Gnus.") (defvar gnus-info-nodes @@ -1836,7 +1836,7 @@ Thank you for your help in stamping out bugs. (load gnus-init-file nil t)))) ;;; Load the user startup file. -(gnus-read-init-file 'inhibit) +(eval '(gnus-read-init-file 'inhibit)) ;;; Load the compatability functions. @@ -2077,7 +2077,7 @@ Otherwise, it is like ~/News/news/group/num." (concat (if (gnus-use-long-file-name 'not-save) (gnus-capitalize-newsgroup newsgroup) (gnus-newsgroup-directory-form newsgroup)) - "/" (int-to-string (header-number headers))) + "/" (int-to-string (mail-header-number headers))) (or gnus-article-save-directory "~/News")))) (if (and last-file (string-equal (file-name-directory default) @@ -2095,7 +2095,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is (concat (if (gnus-use-long-file-name 'not-save) newsgroup (gnus-newsgroup-directory-form newsgroup)) - "/" (int-to-string (header-number headers))) + "/" (int-to-string (mail-header-number headers))) (or gnus-article-save-directory "~/News")))) (if (and last-file (string-equal (file-name-directory default) @@ -2276,7 +2276,7 @@ the first newsgroup." "Make DIRECTORY recursively." ;; Why don't we use `(make-directory dir 'parents)'? That's just one ;; of the many mysteries of the universe. - (let* ((dir (expand-file-name dir default-directory)) + (let* ((dir (expand-file-name dir default-directory)) dirs err) (if (string-match "/$" dir) (setq dir (substring dir 0 (match-beginning 0)))) @@ -2361,34 +2361,34 @@ If optional argument RE-ONLY is non-nil, strip `Re:' only." ;; Functions are more convenient than macros in some cases. (defun gnus-header-number (header) - (header-number header)) + (mail-header-number header)) (defun gnus-header-subject (header) - (header-subject header)) + (mail-header-subject header)) (defun gnus-header-from (header) - (header-from header)) + (mail-header-from header)) (defun gnus-header-xref (header) - (header-xref header)) + (mail-header-xref header)) (defun gnus-header-lines (header) - (header-lines header)) + (mail-header-lines header)) (defun gnus-header-date (header) - (header-date header)) + (mail-header-date header)) (defun gnus-header-id (header) - (header-id header)) + (mail-header-id header)) (defun gnus-header-message-id (header) - (header-id header)) + (mail-header-id header)) (defun gnus-header-chars (header) - (header-chars header)) + (mail-header-chars header)) (defun gnus-header-references (header) - (header-references header)) + (mail-header-references header)) ;;; General various misc type functions. @@ -2639,14 +2639,14 @@ If optional argument RE-ONLY is non-nil, strip `Re:' only." (lambda (win) (let ((buf (window-buffer win))) (if (string-match "^\\*Summary" (buffer-name buf)) - (progn - (setq bufs (cons buf bufs)) - (pop-to-buffer buf) - (if (or (not lowest) - (< (gnus-window-top-edge) lowest)) - (progn - (setq lowest-buf buf) - (setq lowest (gnus-window-top-edge)))))))))) + (progn + (setq bufs (cons buf bufs)) + (pop-to-buffer buf) + (if (or (not lowest) + (< (gnus-window-top-edge) lowest)) + (progn + (setq lowest-buf buf) + (setq lowest (gnus-window-top-edge)))))))))) (and lowest-buf (progn (pop-to-buffer lowest-buf) @@ -2889,18 +2889,18 @@ Both lists have to be sorted over <." ;; This function modifies LIST1. (let* ((top (cons nil list1)) (prev top)) - (while (and list1 list2) - (cond ((= (car list1) (car list2)) - (setq prev list1 - list1 (cdr list1) - list2 (cdr list2))) - ((< (car list1) (car list2)) - (setcdr prev (cdr list1)) - (setq list1 (cdr list1))) - (t - (setq list2 (cdr list2))))) - (setcdr prev nil) - (cdr top))) + (while (and list1 list2) + (cond ((= (car list1) (car list2)) + (setq prev list1 + list1 (cdr list1) + list2 (cdr list2))) + ((< (car list1) (car list2)) + (setcdr prev (cdr list1)) + (setq list1 (cdr list1))) + (t + (setq list2 (cdr list2))))) + (setcdr prev nil) + (cdr top))) (defun gnus-compress-sequence (numbers &optional always-list) "Convert list of numbers to a list of ranges or a single range. @@ -3399,7 +3399,7 @@ listed." (setq level (car gnus-group-list-mode) unread (cdr gnus-group-list-mode))) (setq level (gnus-group-default-level level)) - (gnus-group-setup-buffer) ;May call from out of group buffer + (gnus-group-setup-buffer) ;May call from out of group buffer (let ((case-fold-search nil) (group (gnus-group-group-name))) (funcall gnus-group-prepare-function level unread nil) @@ -3446,14 +3446,14 @@ If REGEXP, only list groups matching REGEXP." group (car info) newsrc (cdr newsrc) unread (car (gnus-gethash group gnus-newsrc-hashtb))) - (and unread ; This group might be bogus + (and unread ; This group might be bogus (or (not regexp) (string-match regexp group)) (<= (setq clevel (car (cdr info))) level) (>= clevel lowest) - (or all ; We list all groups? - (eq unread t) ; We list unactivated groups - (> unread 0) ; We list groups with unread articles + (or all ; We list all groups? + (eq unread t) ; We list unactivated groups + (> unread 0) ; We list groups with unread articles (cdr (assq 'tick (nth 3 info)))) ; And groups with tickeds (gnus-group-insert-group-line nil group (car (cdr info)) (nth 3 info) unread (nth 4 info))))) @@ -3672,7 +3672,7 @@ moves the point to the colon." (process-marked (if (member group gnus-group-marked) gnus-process-mark ? )) (buffer-read-only nil) - header ; passed as parameter to user-funcs. + header ; passed as parameter to user-funcs. b) (beginning-of-line) (setq b (point)) @@ -4068,11 +4068,11 @@ If EXCLUDE-GROUP, do not go to that group." unread) (goto-char (point-min)) (if (or (eq (setq unread (gnus-group-group-unread)) t) ; Not active. - (not (zerop unread)) ; Has unread articles. + (not (zerop unread)) ; Has unread articles. (zerop (gnus-group-next-unread-group 1))) ; Next unread group. - (point) ; Success. + (point) ; Success. (goto-char opoint) - nil)) ; Not success. + nil)) ; Not success. (gnus-group-position-cursor))) (defun gnus-group-enter-server-mode () @@ -4870,8 +4870,8 @@ If GROUP, edit that local kill file instead." (setq gnus-current-kill-article article) (gnus-kill-file-edit-file group) (gnus-message 6 - (substitute-command-keys - "Editing a global kill file (Type \\[gnus-kill-file-exit] to exit)"))) + (substitute-command-keys + "Editing a global kill file (Type \\[gnus-kill-file-exit] to exit)"))) (defun gnus-group-edit-local-kill (article group) "Edit a local kill file." @@ -5219,7 +5219,7 @@ buffer. "Give a one line description of the group mode commands." (interactive) (gnus-message 6 - (substitute-command-keys "\\\\[gnus-group-next-group]:Forward \\[gnus-group-prev-group]:Backward \\[gnus-browse-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-browse-describe-briefly]:This help"))) + (substitute-command-keys "\\\\[gnus-group-next-group]:Forward \\[gnus-group-prev-group]:Backward \\[gnus-browse-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-browse-describe-briefly]:This help"))) ;;; @@ -5689,7 +5689,7 @@ article number." (and article (setq header (gnus-get-header-by-num article)) (vectorp header) - (header-subject header)))) + (mail-header-subject header)))) ;; Various summary mode internalish functions. @@ -5765,7 +5765,7 @@ article number." &optional dummy score) (or sformat (setq sformat gnus-summary-line-format-spec)) (let* ((indentation (aref gnus-thread-indent-array level)) - (lines (header-lines header)) + (lines (mail-header-lines header)) (score (or score gnus-summary-default-score 0)) (score-char (if (or (null gnus-summary-default-score) @@ -5774,7 +5774,7 @@ article number." (if (< score gnus-summary-default-score) gnus-score-below-mark gnus-score-over-mark))) (replied (if replied gnus-replied-mark ? )) - (from (header-from header)) + (from (mail-header-from header)) (name (cond ((string-match "(.+)" from) (substring from (1+ (match-beginning 0)) (1- (match-end 0)))) @@ -5785,8 +5785,8 @@ article number." (1- (match-end 0)))) (substring from 0 beg)))) (t from))) - (subject (header-subject header)) - (number (header-number header)) + (subject (mail-header-subject header)) + (number (mail-header-number header)) (opening-bracket (if dummy ?\< ?\[)) (closing-bracket (if dummy ?\> ?\])) (buffer-read-only nil) @@ -5883,7 +5883,7 @@ If NO-ARTICLE is non-nil, no article is selected initially." ((not new-group) (gnus-set-global-variables) (gnus-kill-buffer kill-buffer) - (gnus-configure-windows 'summary) + (gnus-configure-windows 'summary 'force) (gnus-set-mode-line 'summary) (gnus-summary-position-cursor) (message "") @@ -5937,8 +5937,6 @@ If NO-ARTICLE is non-nil, no article is selected initially." (gnus-update-format-specifications) ;; Generate the summary buffer. (gnus-summary-prepare) - ;; Create the header hashtb. - (gnus-make-headers-hashtable-by-number) (if (zerop (buffer-size)) (cond (gnus-newsgroup-dormant (gnus-summary-show-all-dormant)) @@ -5969,7 +5967,7 @@ If NO-ARTICLE is non-nil, no article is selected initially." gnus-auto-select-first (gnus-summary-first-unread-article)) () - (gnus-configure-windows 'summary)) + (gnus-configure-windows 'summary 'force)) (gnus-set-mode-line 'summary) (gnus-summary-position-cursor) ;; If in async mode, we send some info to the backend. @@ -6009,9 +6007,8 @@ If NO-ARTICLE is non-nil, no article is selected initially." gnus-newsgroup-headers) 'cull) (gnus-summary-update-lines) - ;; Remove the final newline. - ;;(goto-char (point-max)) - ;;(delete-char -1) + ;; Create the header hashtb. + (gnus-make-headers-hashtable-by-number) ;; Call hooks for modifying summary buffer. ;; Suggested by sven@tde.LTH.Se (Sven Mattisson). (goto-char (point-min)) @@ -6027,7 +6024,7 @@ If NO-ARTICLE is non-nil, no article is selected initially." subject hthread whole-subject) (while threads (setq whole-subject - (setq subject (header-subject (car (car threads))))) + (setq subject (mail-header-subject (car (car threads))))) (if gnus-summary-gather-subject-limit (or (and (numberp gnus-summary-gather-subject-limit) (> (length subject) gnus-summary-gather-subject-limit) @@ -6073,12 +6070,12 @@ If NO-ARTICLE is non-nil, no article is selected initially." (or gnus-thread-ignore-subject (let* ((prev (symbol-value refs)) (subject (gnus-simplify-subject-re - (header-subject (car prev)))) + (mail-header-subject (car prev)))) (headers (cdr prev))) (while headers (if (not (string= subject (gnus-simplify-subject-re - (header-subject (car headers))))) + (mail-header-subject (car headers))))) (progn (setq new-roots (cons (car headers) new-roots)) (setcdr prev (cdr headers))) @@ -6091,7 +6088,7 @@ If NO-ARTICLE is non-nil, no article is selected initially." ;; possible. (let ((r new-roots)) (while r - (gnus-sethash (concat (header-id (car r)) ".boo") + (gnus-sethash (concat (mail-header-id (car r)) ".boo") (list nil (car r)) gnus-newsgroup-dependencies) (setq r (cdr r)))) @@ -6125,17 +6122,17 @@ If NO-ARTICLE is non-nil, no article is selected initially." (let ((headers (cdr (symbol-value refs)))) ;; We weed out the low-scored articles. (while headers - (if (not (< (or (cdr (assq (header-number (car headers)) + (if (not (< (or (cdr (assq (mail-header-number (car headers)) gnus-newsgroup-scored)) default) below)) ;; It is over. (setq roots (cons (car headers) roots)) ;; It is below, so we mark it as read. (setq gnus-newsgroup-unreads - (delq (header-number (car headers)) + (delq (mail-header-number (car headers)) gnus-newsgroup-unreads)) (setq gnus-newsgroup-reads - (cons (cons (header-number (car headers)) + (cons (cons (mail-header-number (car headers)) gnus-low-score-mark) gnus-newsgroup-reads))) (setq headers (cdr headers)))) @@ -6147,22 +6144,22 @@ If NO-ARTICLE is non-nil, no article is selected initially." (or gnus-thread-ignore-subject (let* ((prev (symbol-value refs)) (subject (gnus-simplify-subject-re - (header-subject (car prev)))) + (mail-header-subject (car prev)))) (headers (cdr prev))) (while headers (if (not (string= subject (gnus-simplify-subject-re - (header-subject (car headers))))) + (mail-header-subject (car headers))))) (progn - (if (not (< (or (cdr (assq (header-number (car headers)) + (if (not (< (or (cdr (assq (mail-header-number (car headers)) gnus-newsgroup-scored)) default) below)) (setq new-roots (cons (car headers) new-roots)) (setq gnus-newsgroup-unreads - (delq (header-number (car headers)) + (delq (mail-header-number (car headers)) gnus-newsgroup-unreads)) (setq gnus-newsgroup-reads - (cons (cons (header-number (car headers)) + (cons (cons (mail-header-number (car headers)) gnus-low-score-mark) gnus-newsgroup-reads))) (setcdr prev (cdr headers))) @@ -6170,13 +6167,13 @@ If NO-ARTICLE is non-nil, no article is selected initially." (setq headers (cdr headers))))) ;; If this article is expunged, some of the children might be ;; roots. - (if (< (or (cdr (assq (header-number (car (symbol-value refs))) + (if (< (or (cdr (assq (mail-header-number (car (symbol-value refs))) gnus-newsgroup-scored)) default) below) (let* ((prev (symbol-value refs)) (headers (cdr prev))) (while headers - (setq article (header-number (car headers))) + (setq article (mail-header-number (car headers))) (if (not (< (or (cdr (assq article gnus-newsgroup-scored)) default) below)) (progn (setq new-roots (cons (car headers) new-roots)) @@ -6193,7 +6190,7 @@ If NO-ARTICLE is non-nil, no article is selected initially." (headers (cdr prev)) article) (while headers - (setq article (header-number (car headers))) + (setq article (mail-header-number (car headers))) (if (not (< (or (cdr (assq article gnus-newsgroup-scored)) default) below)) (setq prev headers) @@ -6211,7 +6208,7 @@ If NO-ARTICLE is non-nil, no article is selected initially." ;; possible. (let ((r new-roots)) (while r - (gnus-sethash (concat (header-id (car r)) ".boo") + (gnus-sethash (concat (mail-header-id (car r)) ".boo") (list nil (car r)) gnus-newsgroup-dependencies) (setq r (cdr r)))) @@ -6230,7 +6227,7 @@ If NO-ARTICLE is non-nil, no article is selected initially." (let ((head (car thread)) (tail (apply 'append (mapcar 'gnus-cut-thread (cdr thread))))) (if (and (null tail) - (let ((number (header-number head))) + (let ((number (mail-header-number head))) (or (memq number gnus-newsgroup-ancient) (memq number gnus-newsgroup-dormant) (and gnus-summary-expunge-below @@ -6251,14 +6248,14 @@ If NO-ARTICLE is non-nil, no article is selected initially." (defun gnus-trim-thread (thread) ;; Remove root ancient articles with only one child from THREAD. (if (and (eq gnus-fetch-old-headers 'some) - (memq (header-number (car thread)) gnus-newsgroup-ancient) + (memq (mail-header-number (car thread)) gnus-newsgroup-ancient) (= (length thread) 2)) (gnus-trim-thread (nth 1 thread)) thread)) (defun gnus-make-sub-thread (root) ;; This function makes a sub-tree for a node in the tree. - (let ((children (reverse (cdr (gnus-gethash (downcase (header-id root)) + (let ((children (reverse (cdr (gnus-gethash (downcase (mail-header-id root)) gnus-newsgroup-dependencies))))) (cons root (mapcar 'gnus-make-sub-thread children)))) @@ -6274,7 +6271,7 @@ If NO-ARTICLE is non-nil, no article is selected initially." (progn (setq heads (cdr (symbol-value refs))) (while heads - (if (not (memq (header-number (car heads)) + (if (not (memq (mail-header-number (car heads)) gnus-newsgroup-dormant)) (progn (setq id (symbol-name refs)) @@ -6307,12 +6304,12 @@ If NO-ARTICLE is non-nil, no article is selected initially." (and (setq header (gnus-nov-parse-line (read (current-buffer)) deps)) - (setq ref (header-references header)) + (setq ref (mail-header-references header)) (string-match "\\(<[^>]+>\\) *$" ref) (substring ref (match-beginning 1) (match-end 1)))))) (and header (setq gnus-newsgroup-headers (cons header gnus-newsgroup-headers) - gnus-newsgroup-ancient (cons (header-number header) + gnus-newsgroup-ancient (cons (mail-header-number header) gnus-newsgroup-ancient)))))) ;; Re-build the thread containing ID. @@ -6323,7 +6320,7 @@ If NO-ARTICLE is non-nil, no article is selected initially." (while (and id (setq headers (car (setq art (gnus-gethash (downcase id) dep))))) (setq parent art) - (setq id (and (setq refs (header-references headers)) + (setq id (and (setq refs (mail-header-references headers)) (string-match "\\(<[^>]+>\\) *$" refs) (substring refs (match-beginning 1) (match-end 1))))) (setq thread (gnus-make-sub-thread (car parent))) @@ -6335,7 +6332,7 @@ If NO-ARTICLE is non-nil, no article is selected initially." ;; Delete all lines in the summary buffer that correspond to articles ;; in this thread. (defun gnus-rebuild-remove-articles (thread) - (and (gnus-summary-goto-subject (header-number (car thread))) + (and (gnus-summary-goto-subject (mail-header-number (car thread))) (gnus-delete-line)) (mapcar (lambda (th) (gnus-rebuild-remove-articles th)) (cdr thread))) @@ -6359,42 +6356,42 @@ If NO-ARTICLE is non-nil, no article is selected initially." (defun gnus-thread-sort-by-number (h1 h2) "Sort threads by root article number." - (< (header-number (gnus-thread-header h1)) - (header-number (gnus-thread-header h2)))) + (< (mail-header-number (gnus-thread-header h1)) + (mail-header-number (gnus-thread-header h2)))) (defun gnus-thread-sort-by-author (h1 h2) "Sort threads by root author." (string-lessp (let ((extract (funcall gnus-extract-address-components - (header-from (gnus-thread-header h1))))) + (mail-header-from (gnus-thread-header h1))))) (or (car extract) (cdr extract))) (let ((extract (funcall gnus-extract-address-components - (header-from (gnus-thread-header h2))))) + (mail-header-from (gnus-thread-header h2))))) (or (car extract) (cdr extract))))) (defun gnus-thread-sort-by-subject (h1 h2) "Sort threads by root subject." (string-lessp (downcase (gnus-simplify-subject - (header-subject (gnus-thread-header h1)))) + (mail-header-subject (gnus-thread-header h1)))) (downcase (gnus-simplify-subject - (header-subject (gnus-thread-header h2)))))) + (mail-header-subject (gnus-thread-header h2)))))) (defun gnus-thread-sort-by-date (h1 h2) "Sort threads by root article date." (string-lessp - (gnus-sortable-date (header-date (gnus-thread-header h1))) - (gnus-sortable-date (header-date (gnus-thread-header h2))))) + (gnus-sortable-date (mail-header-date (gnus-thread-header h1))) + (gnus-sortable-date (mail-header-date (gnus-thread-header h2))))) (defun gnus-thread-sort-by-score (h1 h2) "Sort threads by root article score. Unscored articles will be counted as having a score of zero." - (> (or (cdr (assq (header-number (gnus-thread-header h1)) + (> (or (cdr (assq (mail-header-number (gnus-thread-header h1)) gnus-newsgroup-scored)) gnus-summary-default-score 0) - (or (cdr (assq (header-number (gnus-thread-header h2)) + (or (cdr (assq (mail-header-number (gnus-thread-header h2)) gnus-newsgroup-scored)) gnus-summary-default-score 0))) @@ -6416,10 +6413,10 @@ Unscored articles will be counted as having a score of zero." ;; This function find the total score of the thread below ROOT. (setq root (car root)) (apply gnus-thread-score-function - (or (cdr (assq (header-number root) gnus-newsgroup-scored)) + (or (cdr (assq (mail-header-number root) gnus-newsgroup-scored)) gnus-summary-default-score 0) (mapcar 'gnus-thread-total-score - (cdr (gnus-gethash (downcase (header-id root)) + (cdr (gnus-gethash (downcase (mail-header-id root)) gnus-newsgroup-dependencies))))) ;; Added by Per Abrahamsen . @@ -6467,7 +6464,7 @@ or a straight list of headers." (setcdr th (cdr (cdr (car thread)))) (setq gnus-tmp-gathered (nconc (mapcar - (lambda (h) (header-number (car h))) + (lambda (h) (mail-header-number (car h))) (cdr (cdr (car thread)))) gnus-tmp-gathered)) (setcdr (cdr (car thread)) nil)) @@ -6476,32 +6473,32 @@ or a straight list of headers." ;; We print adopted articles with empty subject fields. (setq gnus-tmp-gathered (nconc (mapcar - (lambda (h) (header-number (car h))) + (lambda (h) (mail-header-number (car h))) (cdr (cdr (car thread)))) gnus-tmp-gathered)) (setq level -1)) ((eq gnus-summary-make-false-root 'dummy) ;; We output a dummy root. (gnus-summary-insert-dummy-line - nil header (header-number (car (car (cdr (car thread))))))) + nil header (mail-header-number (car (car (cdr (car thread))))))) (t ;; We do not make a root for the gathered ;; sub-threads at all. (setq level -1)))) - (setq number (header-number header) - subject (header-subject header)) + (setq number (mail-header-number header) + subject (mail-header-subject header)) ;; Do the async thing. (and gnus-newsgroup-async (setq gnus-newsgroup-threads - (cons (cons number (header-lines header)) + (cons (cons number (mail-header-lines header)) gnus-newsgroup-threads))) ;; We may have to root out some bad articles... (and cull (= level 0) - (cond ((and (memq (setq number (header-number header)) + (cond ((and (memq (setq number (mail-header-number header)) gnus-newsgroup-dormant) (null thread)) (setq header nil)) @@ -6563,18 +6560,18 @@ or a straight list of headers." ;; Do the async thing, if that is required. (if gnus-newsgroup-async (setq gnus-newsgroup-threads - (mapcar (lambda (h) (cons (header-number h) (header-lines h))) + (mapcar (lambda (h) (cons (mail-header-number h) (mail-header-lines h))) headers))) (while headers (setq header (car headers) headers (cdr headers) - number (header-number header)) + number (mail-header-number header)) ;; We may have to root out some bad articles... (cond ((and cull - (memq (setq number (header-number header)) + (memq (setq number (mail-header-number header)) gnus-newsgroup-dormant))) ((and cull gnus-summary-expunge-below (< (or (cdr (assq number gnus-newsgroup-scored)) @@ -6596,7 +6593,7 @@ or a straight list of headers." gnus-ancient-mark))) (memq number gnus-newsgroup-replied) (memq number gnus-newsgroup-expirable) - (header-subject header) nil + (mail-header-subject header) nil (cdr (assq number gnus-newsgroup-scored)))))))) (defun gnus-select-newsgroup (group &optional read-all) @@ -6682,7 +6679,7 @@ If READ-ALL is non-nil, all articles in the group are selected." (setq gnus-newsgroup-unreads (gnus-set-sorted-intersection gnus-newsgroup-unreads - (mapcar (lambda (headers) (header-number headers)) + (mapcar (lambda (headers) (mail-header-number headers)) gnus-newsgroup-headers))) ;; Adjust and set lists of article marks. (and info @@ -6712,9 +6709,9 @@ If READ-ALL is non-nil, all articles in the group are selected." ;; First and last article in this newsgroup. (and gnus-newsgroup-headers (setq gnus-newsgroup-begin - (header-number (car gnus-newsgroup-headers))) + (mail-header-number (car gnus-newsgroup-headers))) (setq gnus-newsgroup-end - (header-number (gnus-last-element gnus-newsgroup-headers)))) + (mail-header-number (gnus-last-element gnus-newsgroup-headers)))) (setq gnus-reffed-article-number -1) ;; GROUP is successfully selected. (or gnus-newsgroup-headers t))))) @@ -6930,10 +6927,10 @@ If WHERE is `summary', the summary mode line format will be used." unread-and-unticked unselected)))) (subject (if gnus-current-headers - (header-subject gnus-current-headers) "")) + (mail-header-subject gnus-current-headers) "")) (max-len (and gnus-mode-non-string-length (- (frame-width) gnus-mode-non-string-length))) - header) ;; passed as argument to any user-format-funcs + header);; passed as argument to any user-format-funcs (setq mode-string (eval mformat)) (or (numberp max-len) (setq max-len (length mode-string))) @@ -6964,8 +6961,8 @@ The resulting hash table is returned, or nil if no Xrefs were found." start group entry number xrefs header) (while headers (setq header (car headers)) - (if (and (setq xrefs (header-xref header)) - (not (memq (header-number header) unreads))) + (if (and (setq xrefs (mail-header-xref header)) + (not (memq (mail-header-number header) unreads))) (progn (setq start 0) (while (string-match "\\([^ ]+\\):\\([0-9]+\\)" xrefs start) @@ -7116,7 +7113,7 @@ The resulting hash table is returned, or nil if no Xrefs were found." in-reply-to) (setq id nil ref nil) - (header-set-number header (read cur)) + (mail-header-set-number header (read cur)) ;; 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 @@ -7128,28 +7125,28 @@ The resulting hash table is returned, or nil if no Xrefs were found." (search-forward "\n.\n" nil t)) (point))) (if (search-forward "\nfrom: " nil t) - (header-set-from header (gnus-header-value)) - (header-set-from header "(nobody)")) + (mail-header-set-from header (gnus-header-value)) + (mail-header-set-from header "(nobody)")) (goto-char p) (if (search-forward "\nsubject: " nil t) - (header-set-subject header (gnus-header-value)) - (header-set-subject header "(none)")) + (mail-header-set-subject header (gnus-header-value)) + (mail-header-set-subject header "(none)")) (goto-char p) (and (search-forward "\nxref: " nil t) - (header-set-xref header (gnus-header-value))) + (mail-header-set-xref header (gnus-header-value))) (goto-char p) (or (numberp (and (search-forward "\nlines: " nil t) - (header-set-lines header (read cur)))) - (header-set-lines header 0)) + (mail-header-set-lines header (read cur)))) + (mail-header-set-lines header 0)) (goto-char p) (and (search-forward "\ndate: " nil t) - (header-set-date header (gnus-header-value))) + (mail-header-set-date header (gnus-header-value))) (goto-char p) (if (search-forward "\nmessage-id: " nil t) - (header-set-id header (setq id (gnus-header-value))) + (mail-header-set-id header (setq id (gnus-header-value))) ;; If there was no message-id, we just fake one to make ;; subsequent routines simpler. - (header-set-id + (mail-header-set-id header (setq id (concat "none+" (int-to-string @@ -7158,7 +7155,7 @@ The resulting hash table is returned, or nil if no Xrefs were found." (goto-char p) (if (search-forward "\nreferences: " nil t) (progn - (header-set-references header (gnus-header-value)) + (mail-header-set-references header (gnus-header-value)) (setq end (match-end 0)) (save-excursion (setq ref @@ -7178,7 +7175,7 @@ The resulting hash table is returned, or nil if no Xrefs were found." (setq in-reply-to (gnus-header-value)) (string-match "<[^>]+>" in-reply-to)) (progn - (header-set-references + (mail-header-set-references header (setq ref (substring in-reply-to (match-beginning 0) (match-end 0)))) @@ -7196,10 +7193,10 @@ The resulting hash table is returned, or nil if no Xrefs were found." ;; any additional Xrefs (in case the two articles ;; came from different servers. (progn - (header-set-xref + (mail-header-set-xref (car (symbol-value dep)) - (concat (or (header-xref (car (symbol-value dep))) "") - (or (header-xref header) ""))) + (concat (or (mail-header-xref (car (symbol-value dep))) "") + (or (mail-header-xref header) ""))) (setq header nil)) (setcar (symbol-value dep) header)) (set dep (list header))) @@ -7318,10 +7315,10 @@ list of headers that match SEQUENCE (see `nntp-retrieve-headers')." ;; Xrefs (in case the two articles came from different ;; servers. (progn - (header-set-xref + (mail-header-set-xref (car (symbol-value dep)) - (concat (or (header-xref (car (symbol-value dep))) "") - (or (header-xref header) ""))) + (concat (or (mail-header-xref (car (symbol-value dep))) "") + (or (mail-header-xref header) ""))) (setq header nil)) (setcar (symbol-value dep) header)) (set dep (list header)))) @@ -7341,8 +7338,8 @@ This is meant to be called in `gnus-article-internal-prepare-hook'." gnus-current-headers))) (or (not gnus-use-cross-reference) (not headers) - (and (header-xref headers) - (not (string= (header-xref headers) ""))) + (and (mail-header-xref headers) + (not (string= (mail-header-xref headers) ""))) (let ((case-fold-search t) xref) (save-restriction @@ -7355,7 +7352,7 @@ This is meant to be called in `gnus-article-internal-prepare-hook'." (goto-char (1+ (match-end 0))) (setq xref (buffer-substring (point) (progn (end-of-line) (point)))) - (header-set-xref headers xref)))))))) + (mail-header-set-xref headers xref)))))))) (defalias 'gnus-find-header-by-number 'gnus-get-header-by-number) (make-obsolete 'gnus-find-header-by-number 'gnus-get-header-by-number) @@ -7370,7 +7367,7 @@ This is meant to be called in `gnus-article-internal-prepare-hook'." (gnus-make-hashtable (length headers))) (while headers (setq header (car headers)) - (gnus-sethash (int-to-string (header-number header)) + (gnus-sethash (int-to-string (mail-header-number header)) header gnus-newsgroup-headers-hashtb-by-number) (setq headers (cdr headers)))))) @@ -7403,7 +7400,7 @@ If BACKWARD, find new header backward instead." "Extend newsgroup selection with HEADER. Optional argument BACKWARD means extend toward backward." (if header - (let ((artnum (header-number header))) + (let ((artnum (mail-header-number header))) (setq gnus-newsgroup-headers (if backward (cons header gnus-newsgroup-headers) @@ -7490,8 +7487,10 @@ searched for." (eq (get-text-property (point) 'gnus-mark) gnus-unread-mark)) (or (not subject) - (and (setq psubject (inline (gnus-summary-subject-string))) - (inline (gnus-subject-equal subject psubject))))))) + (and (setq psubject + (inline (gnus-summary-subject-string))) + (inline + (gnus-subject-equal subject psubject))))))) (if backward (if (bobp) nil (forward-char -1) t) (if (eobp) nil (forward-char 1) t))))) (if did @@ -7726,7 +7725,7 @@ gnus-exit-group-hook is called with no arguments if that value is non-nil." (mode major-mode) (buf (current-buffer))) (run-hooks 'gnus-summary-prepare-exit-hook) - (gnus-summary-update-info) ; Make all changes in this group permanent. + (gnus-summary-update-info) ; Make all changes in this group permanent. (set-buffer buf) (and gnus-use-cache (gnus-cache-possibly-remove-articles)) ;; Make sure where I was, and go to next newsgroup. @@ -7817,7 +7816,7 @@ gnus-exit-group-hook is called with no arguments if that value is non-nil." "Describe summary mode commands briefly." (interactive) (gnus-message 6 - (substitute-command-keys "\\\\[gnus-summary-next-page]:Select \\[gnus-summary-next-unread-article]:Forward \\[gnus-summary-prev-unread-article]:Backward \\[gnus-summary-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-summary-describe-briefly]:This help"))) + (substitute-command-keys "\\\\[gnus-summary-next-page]:Select \\[gnus-summary-next-unread-article]:Forward \\[gnus-summary-prev-unread-article]:Backward \\[gnus-summary-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-summary-describe-briefly]:This help"))) ;; Walking around group mode buffer from summary mode. @@ -7969,7 +7968,7 @@ returned." (progn (gnus-summary-recenter) (gnus-summary-position-cursor))) - n)) + n)) (defun gnus-summary-next-unread-subject (n) "Go to next N'th unread summary line." @@ -7996,7 +7995,7 @@ If optional argument UNREAD is non-nil, only unread article is selected." (mapcar (lambda (headers) (list - (int-to-string (header-number headers)))) + (int-to-string (mail-header-number headers)))) gnus-newsgroup-headers) nil 'require-match)))) (or article (error "No article number")) @@ -8092,9 +8091,9 @@ If BACKWARD, the previous article is selected instead of the next." (let (header) (cond ;; Is there such an article? - ((or (gnus-summary-display-article - (gnus-summary-search-forward unread subject backward)) - (eq (gnus-summary-article-mark) gnus-canceled-mark)) + ((and (gnus-summary-search-forward unread subject backward) + (or (gnus-summary-display-article (gnus-summary-article-number)) + (eq (gnus-summary-article-mark) gnus-canceled-mark))) (gnus-summary-position-cursor)) ;; If not, we try the first unread, if that is wanted. ((and subject @@ -8126,7 +8125,7 @@ If BACKWARD, the previous article is selected instead of the next." ;; it back. (select-window (get-buffer-window (current-buffer))) ;; Keep just the event type of CMD. - ;(and (listp cmd) (setq cmd (car cmd))) + ;(and (listp cmd) (setq cmd (car cmd))) ;; Select next unread newsgroup automagically. (cond ((not gnus-auto-select-next) @@ -8242,7 +8241,7 @@ Argument LINES specifies lines to be scrolled down." (gnus-summary-display-article article) (gnus-summary-recenter) (gnus-eval-in-buffer-window gnus-article-buffer - (gnus-article-prev-page lines)))) + (gnus-article-prev-page lines)))) (gnus-summary-position-cursor)) (defun gnus-summary-scroll-up (lines) @@ -8353,7 +8352,7 @@ If ALL-HEADERS is non-nil, no header lines are hidden." (string-to-int (completing-read "Article number: " - (mapcar (lambda (headers) (list (int-to-string (header-number headers)))) + (mapcar (lambda (headers) (list (int-to-string (mail-header-number headers)))) gnus-newsgroup-headers) nil 'require-match)))) (prog1 @@ -8391,8 +8390,8 @@ The difference between N and the number of articles fetched is returned." (while (and (> n 0) - (let ((ref (header-references (gnus-get-header-by-num - (gnus-summary-article-number))))) + (let ((ref (mail-header-references (gnus-get-header-by-num + (gnus-summary-article-number))))) (if (and ref (not (equal ref "")) (string-match "<[^<>]*>[ \t]*$" ref)) (gnus-summary-refer-article @@ -8420,15 +8419,15 @@ NOTE: This command only works with newsgroups that use real or simulated NNTP." (let ((header (car (gnus-gethash (downcase message-id) gnus-newsgroup-dependencies)))) (if header - (or (gnus-summary-goto-article (header-number header)) + (or (gnus-summary-goto-article (mail-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)) + (mail-header-subject header)) (forward-line -1) - (header-number header))) + (mail-header-number header))) (let ((gnus-override-method gnus-refer-article-method) (gnus-ancient-mark gnus-read-mark) (tmp-point (window-start @@ -8445,7 +8444,7 @@ NOTE: This command only works with newsgroups that use real or simulated NNTP." (if (gnus-article-prepare message-id nil (gnus-read-header message-id)) (progn - (setq number (header-number gnus-current-headers)) + (setq number (mail-header-number gnus-current-headers)) (gnus-rebuild-thread message-id) (gnus-summary-goto-subject number) (if (null gnus-use-full-window) @@ -8550,20 +8549,20 @@ gnus-select-article-hook is not called during the search." (gnus-message 9 "Searching article: %d..." gnus-current-article) (setq last gnus-current-article) (gnus-eval-in-buffer-window gnus-article-buffer - (save-restriction - (widen) - ;; Begin search from current point. - (setq found (funcall re-search regexp nil t)))) + (save-restriction + (widen) + ;; Begin search from current point. + (setq found (funcall re-search regexp nil t)))) ;; Then search next articles. (while (and (not found) (gnus-summary-display-article (gnus-summary-search-subject backward nil nil))) (gnus-message 9 "Searching article: %d..." gnus-current-article) (gnus-eval-in-buffer-window gnus-article-buffer - (save-restriction - (widen) - (goto-char (if backward (point-max) (point-min))) - (setq found (funcall re-search regexp nil t))))) + (save-restriction + (widen) + (goto-char (if backward (point-max) (point-min))) + (setq found (funcall re-search regexp nil t))))) (message "") ;; Adjust article pointer. (or (eq last gnus-current-article) @@ -8767,16 +8766,16 @@ and `request-accept' functions. (Ie. mail newsgroups at present.)" (while articles (if (setq art-group (gnus-request-move-article - (car articles) ; Article to move - gnus-newsgroup-name ; From newsgrouo + (car articles) ; Article to move + gnus-newsgroup-name ; From newsgrouo (nth 1 (gnus-find-method-for-group - gnus-newsgroup-name)) ; Server + gnus-newsgroup-name)) ; Server (list 'gnus-request-accept-article (if select-method (list 'quote select-method) to-newsgroup) - (not (cdr articles))) ; Accept form - (not (cdr articles)))) ; Only save nov last time + (not (cdr articles))) ; Accept form + (not (cdr articles)))) ; Only save nov last time (let* ((buffer-read-only nil) (entry (or @@ -8993,7 +8992,7 @@ functions. (Ie. mail newsgroups at present.)" (or total (setq gnus-newsgroup-expirable es)) ;; We go through the old list of expirable, and mark all ;; really expired articles as non-existant. - (or (eq es expirable) ; If nothing was expired, we don't mark. + (or (eq es expirable) ; If nothing was expired, we don't mark. (let ((gnus-use-cache nil)) (while expirable (or (memq (car expirable) es) @@ -9085,7 +9084,7 @@ This will have permanent effect only in mail groups." (setq buffer-read-only t) (buffer-disable-undo (current-buffer)) (gnus-configure-windows 'summary)) - (and gnus-visual (run-hooks 'gnus-visual-mark-article-hook)))) + (and gnus-visual (run-hooks 'gnus-visual-mark-article-hook)))) (defun gnus-summary-edit-article-postpone () "Postpone changes to the current article." @@ -9277,17 +9276,17 @@ number of articles marked is returned." (interactive "p") (let ((backward (< n 0)) (n (abs n))) - (while (and - (> n 0) - (if unmark - (gnus-summary-remove-process-mark (gnus-summary-article-number)) - (gnus-summary-set-process-mark (gnus-summary-article-number))) - (zerop (gnus-summary-next-subject (if backward -1 1) nil t))) - (setq n (1- n))) - (if (/= 0 n) (gnus-message 7 "No more articles")) - (gnus-summary-recenter) - (gnus-summary-position-cursor) - n)) + (while (and + (> n 0) + (if unmark + (gnus-summary-remove-process-mark (gnus-summary-article-number)) + (gnus-summary-set-process-mark (gnus-summary-article-number))) + (zerop (gnus-summary-next-subject (if backward -1 1) nil t))) + (setq n (1- n))) + (if (/= 0 n) (gnus-message 7 "No more articles")) + (gnus-summary-recenter) + (gnus-summary-position-cursor) + n)) (defun gnus-summary-unmark-as-processable (n) "Remove the process mark from the next N articles. @@ -9411,16 +9410,16 @@ returned." gnus-ticked-mark gnus-dormant-mark))))) (n (abs n)) (mark (or mark gnus-del-mark))) - (while (and (> n 0) - (gnus-summary-mark-article nil mark no-expire) - (zerop (gnus-summary-next-subject - (if backward -1 1) gnus-summary-goto-unread t))) - (setq n (1- n))) - (if (/= 0 n) (gnus-message 7 "No more %sarticles" (if mark "" "unread "))) - (gnus-summary-recenter) - (gnus-summary-position-cursor) - (gnus-set-mode-line 'summary) - n)) + (while (and (> n 0) + (gnus-summary-mark-article nil mark no-expire) + (zerop (gnus-summary-next-subject + (if backward -1 1) gnus-summary-goto-unread t))) + (setq n (1- n))) + (if (/= 0 n) (gnus-message 7 "No more %sarticles" (if mark "" "unread "))) + (gnus-summary-recenter) + (gnus-summary-position-cursor) + (gnus-set-mode-line 'summary) + n)) (defun gnus-summary-mark-article-as-read (mark) "Mark the current article quickly as read with MARK." @@ -9680,9 +9679,9 @@ even ticked and dormant ones." (concat (mapconcat (lambda (char) (char-to-string (symbol-value char))) '(gnus-del-mark gnus-read-mark gnus-ancient-mark - gnus-killed-mark gnus-kill-file-mark - gnus-low-score-mark gnus-expirable-mark - gnus-canceled-mark gnus-catchup-mark) + gnus-killed-mark gnus-kill-file-mark + gnus-low-score-mark gnus-expirable-mark + gnus-canceled-mark gnus-catchup-mark) "")))) (defalias 'gnus-summary-delete-marked-with @@ -10044,12 +10043,12 @@ done." (gnus-set-global-variables) (let ((backward (< n 0)) (n (abs n))) - (while (and (> n 0) - (gnus-summary-go-to-next-thread backward)) - (setq n (1- n))) - (gnus-summary-position-cursor) - (if (/= 0 n) (gnus-message 7 "No more threads")) - n)) + (while (and (> n 0) + (gnus-summary-go-to-next-thread backward)) + (setq n (1- n))) + (gnus-summary-position-cursor) + (if (/= 0 n) (gnus-message 7 "No more threads")) + n)) (defun gnus-summary-prev-thread (n) "Go to the same level previous N'th thread. @@ -10091,13 +10090,13 @@ taken." (gnus-set-global-variables) (let ((up (< n 0)) (n (abs n))) - (while (and (> n 0) - (if up (gnus-summary-go-up-thread) - (gnus-summary-go-down-thread))) - (setq n (1- n))) - (gnus-summary-position-cursor) - (if (/= 0 n) (gnus-message 7 "Can't go further")) - n)) + (while (and (> n 0) + (if up (gnus-summary-go-up-thread) + (gnus-summary-go-down-thread))) + (setq n (1- n))) + (gnus-summary-position-cursor) + (if (/= 0 n) (gnus-message 7 "Can't go further")) + n)) (defun gnus-summary-up-thread (n) "Go up thread N steps. @@ -10122,7 +10121,7 @@ If the prefix argument is negative, tick articles instead." (while killing ;; Mark the article... (cond ((null unmark) (gnus-summary-mark-article-as-read - gnus-killed-mark)) + gnus-killed-mark)) ((> unmark 0) (gnus-summary-mark-article-as-unread gnus-unread-mark)) (t (gnus-summary-mark-article-as-unread gnus-ticked-mark))) @@ -10166,9 +10165,9 @@ Argument REVERSE means reverse order." (let* ((header (gnus-get-header-by-num (gnus-summary-article-number))) (extract (funcall gnus-extract-address-components - (header-from header)))) + (mail-header-from header)))) (concat (or (car extract) (cdr extract)) - "\r" (header-subject header)))) + "\r" (mail-header-subject header)))) 'gnus-thread-sort-by-author) reverse)) @@ -10184,7 +10183,7 @@ Argument REVERSE means reverse order." (let* ((header (gnus-get-header-by-num (gnus-summary-article-number))) (extract (funcall gnus-extract-address-components - (header-from header)))) + (mail-header-from header)))) (concat (downcase (gnus-simplify-subject (gnus-summary-subject-string))) "\r" (or (car extract) (cdr extract))))) @@ -10200,7 +10199,7 @@ Argument REVERSE means reverse order." (cons (lambda () (gnus-sortable-date - (header-date + (mail-header-date (gnus-get-header-by-num (gnus-summary-article-number))))) 'gnus-thread-sort-by-date) reverse)) @@ -10759,7 +10758,7 @@ The following commands are available: (if (< article 0) (if (vectorp header) ;; It's a real article. - (setq article (header-id header)) + (setq article (mail-header-id header)) ;; It is an extracted pseudo-article. (setq article 'pseudo) (gnus-request-pseudo-article header))) @@ -10768,7 +10767,7 @@ The following commands are available: (if (not (eq (car method) 'nneething)) () (let ((dir (concat (file-name-as-directory (nth 1 method)) - (header-subject header)))) + (mail-header-subject header)))) (if (file-directory-p dir) (progn (setq article 'nneething) @@ -10799,9 +10798,9 @@ The following commands are available: (gnus-get-newsgroup-headers))))) nil (if (stringp id) - (header-set-number header gnus-reffed-article-number)) + (mail-header-set-number header gnus-reffed-article-number)) (setq gnus-newsgroup-headers (cons header gnus-newsgroup-headers)) - (gnus-sethash (int-to-string (header-number header)) header + (gnus-sethash (int-to-string (mail-header-number header)) header gnus-newsgroup-headers-hashtb-by-number) (if (stringp id) (setq gnus-reffed-article-number (1- gnus-reffed-article-number))) @@ -10824,7 +10823,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (gnus-check-server (gnus-find-method-for-group gnus-newsgroup-name)) (gnus-request-group gnus-newsgroup-name t))) - (let* ((article (if header (header-number header) article)) + (let* ((article (if header (mail-header-number header) article)) (summary-buffer (current-buffer)) (internal-hook gnus-article-internal-prepare-hook) (group gnus-newsgroup-name) @@ -11138,9 +11137,9 @@ or not." If TYPE is `local', convert to local time; if it is `lapsed', output how much time has lapsed since DATE." (interactive (list 'ut)) - (let ((date (header-date (or gnus-current-headers - (gnus-get-header-by-number - (gnus-summary-article-number))""))) + (let ((date (mail-header-date (or gnus-current-headers + (gnus-get-header-by-number + (gnus-summary-article-number))""))) (date-regexp "^Date: \\|^X-Sent: ")) (if (or (not date) (string= date "")) @@ -11299,7 +11298,7 @@ how much time has lapsed since DATE." (goto-char (point-min)) (insert "\^L\n0, unseen,,\n*** EOOH ***\n") (while (search-forward "\n\^_" nil t) ;single char - (replace-match "\n^_" t t)) ;2 chars: "^" and "_" + (replace-match "\n^_" t t)) ;2 chars: "^" and "_" (goto-char (point-max)) (insert "\^_"))) @@ -11395,7 +11394,7 @@ Argument LINES specifies lines to be scrolled down." (bobp) (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer? (progn - (gnus-narrow-to-page -1) ;Go to previous page. + (gnus-narrow-to-page -1) ;Go to previous page. (goto-char (point-max)) (recenter -1)) (scroll-down lines))) @@ -11403,7 +11402,7 @@ Argument LINES specifies lines to be scrolled down." (defun gnus-article-refer-article () "Read article specified by message-id around point." (interactive) - (search-forward ">" nil t) ;Move point to end of "<....>". + (search-forward ">" nil t) ;Move point to end of "<....>". (if (re-search-backward "\\(<[^<> \t\n]+>\\)" nil t) (let ((message-id (buffer-substring (match-beginning 1) (match-end 1)))) @@ -11421,7 +11420,7 @@ Argument LINES specifies lines to be scrolled down." "Describe article mode commands briefly." (interactive) (gnus-message 6 - (substitute-command-keys "\\\\[gnus-article-next-page]:Next page \\[gnus-article-prev-page]:Prev page \\[gnus-article-show-summary]:Show summary \\[gnus-info-find-node]:Run Info \\[gnus-article-describe-briefly]:This help"))) + (substitute-command-keys "\\\\[gnus-article-next-page]:Next page \\[gnus-article-prev-page]:Prev page \\[gnus-article-show-summary]:Show summary \\[gnus-info-find-node]:Run Info \\[gnus-article-describe-briefly]:This help"))) (defun gnus-article-summary-command () "Execute the last keystroke in the summary buffer." @@ -11873,7 +11872,7 @@ is returned insted of the status string." (defun gnus-request-group (group &optional dont-check) (let ((method (gnus-find-method-for-group group))) -; (and t (message "%s GROUP %s" (car method) group)) + ; (and t (message "%s GROUP %s" (car method) group)) (funcall (gnus-get-function method 'request-group) (gnus-group-real-name group) (nth 1 method) dont-check))) @@ -11924,24 +11923,24 @@ is returned insted of the status string." ;; Fix by Sudish Joseph . (defun gnus-request-post-buffer (post group subject header artbuf info follow-to respect-poster) - (let* ((info (or info (and group (nth 2 (gnus-gethash - group gnus-newsrc-hashtb))))) - (method - (if (and gnus-post-method - ;; Fix by Sudish Joseph . - (memq 'post (assoc - (format "%s" (car (gnus-find-method-for-group - gnus-newsgroup-name))) - gnus-valid-select-methods))) - gnus-post-method - (gnus-find-method-for-group gnus-newsgroup-name)))) - (or (gnus-check-server method) - (error "Can't open server %s:%s" (car method) (nth 1 method))) - (let ((mail-self-blind nil) - (mail-archive-file-name nil)) - (funcall (gnus-get-function method 'request-post-buffer) - post group subject header artbuf info follow-to - respect-poster)))) + (let* ((info (or info (and group (nth 2 (gnus-gethash + group gnus-newsrc-hashtb))))) + (method + (if (and gnus-post-method + ;; Fix by Sudish Joseph . + (memq 'post (assoc + (format "%s" (car (gnus-find-method-for-group + gnus-newsgroup-name))) + gnus-valid-select-methods))) + gnus-post-method + (gnus-find-method-for-group gnus-newsgroup-name)))) + (or (gnus-check-server method) + (error "Can't open server %s:%s" (car method) (nth 1 method))) + (let ((mail-self-blind nil) + (mail-archive-file-name nil)) + (funcall (gnus-get-function method 'request-post-buffer) + post group subject header artbuf info follow-to + respect-poster)))) (defun gnus-request-post (method &optional force) (and (stringp method) @@ -12017,7 +12016,7 @@ is returned insted of the status string." (defun gnus-check-backend-function (func group) (let ((method (if (stringp group) (car (gnus-find-method-for-group group)) - group))) + group))) (fboundp (intern (format "%s-%s" method func))))) (defun gnus-methods-using (method) @@ -12323,7 +12322,7 @@ The `-n' option line from .newsrc is respected." (gnus-gethash group gnus-newsrc-hashtb)) ;; We are trying to subscribe a group that is already ;; subscribed. - () ; Do nothing. + () ; Do nothing. (gnus-dribble-enter (format "(gnus-group-change-level %S %S %S %S %S)" @@ -13081,7 +13080,7 @@ If FORCE is non-nil, the .newsrc file is read." (cdr (cdr group)))) gnus-newsrc-alist))) (if (setq m (assoc (car group) marked)) - (setcdr (cdr (cdr info)) (cons (list (cons 'tick (cdr m))) nil)))) + (setcdr (cdr (cdr info)) (cons (list (cons 'tick (cdr m))) nil)))) (setq newsrc (cdr newsrc))) (setq newsrc killed) (while newsrc @@ -13246,7 +13245,7 @@ If FORCE is non-nil, the .newsrc file is read." (t ;; Not numbers and not eol, so this might be a buggy ;; line... - (or (eobp) ; If it was eob instead of ?\n, we allow it. + (or (eobp) ; If it was eob instead of ?\n, we allow it. (progn ;; The line was buggy. (setq group nil) @@ -13308,7 +13307,7 @@ If FORCE is non-nil, the .newsrc file is read." (prev gnus-newsrc-alist) entry mentry) (while rc - (or (null (nth 4 (car rc))) ; It's a native group. + (or (null (nth 4 (car rc))) ; It's a native group. (assoc (car (car rc)) newsrc) ; It's already in the alist. (if (setq entry (assoc (car (car prev)) newsrc)) (setcdr (setq mentry (memq entry newsrc)) @@ -13634,7 +13633,7 @@ The following commands are available: (setcar (nthcdr 3 mode-line-format) "")) (setq major-mode 'gnus-server-mode) (setq mode-name "Server") -; (gnus-group-set-mode-line) + ; (gnus-group-set-mode-line) (setq mode-line-process nil) (use-local-map gnus-server-mode-map) (buffer-disable-undo (current-buffer)) @@ -13727,7 +13726,7 @@ The following commands are available: (let ((entry (gnus-copy-sequence (if (equal (car method) "native") gnus-select-method - (cdr (assoc (car method) gnus-server-alist)))))) + (cdr (assoc (car method) gnus-server-alist)))))) (setcar (cdr entry) (concat (nth 1 entry) "+" group)) (nconc entry (cdr method)))) @@ -13935,12 +13934,12 @@ score files in the \"/ftp.some-where:/pub/score\" directory. (not (car gnus-score-file-list)) (gnus-file-newer-than gnus-kill-files-directory (car gnus-score-file-list))) - (setq gnus-score-file-list - (cons (nth 5 (file-attributes gnus-kill-files-directory)) - (nreverse - (directory-files - gnus-kill-files-directory t - (gnus-score-file-regexp)))))) + (setq gnus-score-file-list + (cons (nth 5 (file-attributes gnus-kill-files-directory)) + (nreverse + (directory-files + gnus-kill-files-directory t + (gnus-score-file-regexp)))))) ;; We do not use long file names, so we have to do some ;; directory traversing. (let ((mdir (length (expand-file-name gnus-kill-files-directory))) @@ -14069,7 +14068,7 @@ The list is determined from the variable gnus-score-file-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 + (cdr score-files) ; ensures caching of groups with no matches ;; handle the multiple match alist (while alist (and (string-match (car (car alist)) group) diff --git a/lisp/nnbabyl.el b/lisp/nnbabyl.el index 9dc8ddcbd..507b3cc0c 100644 --- a/lisp/nnbabyl.el +++ b/lisp/nnbabyl.el @@ -475,16 +475,12 @@ () (save-excursion (let ((delim (concat "^" nnbabyl-mail-delimiter)) - (buf (or (get-buffer (file-name-nondirectory nnbabyl-mbox-file)) - (create-file-buffer nnbabyl-mbox-file))) start end) - (set-buffer (setq nnbabyl-mbox-buffer buf)) + (set-buffer (setq nnbabyl-mbox-buffer + (nnheader-find-file-noselect + nnbabyl-mbox-file nil 'raw))) (buffer-disable-undo (current-buffer)) - - (insert-file-contents nnbabyl-mbox-file) - (setq buffer-file-name nnbabyl-mbox-file) - (set-buffer-modified-p nil) - + (goto-char (point-min)) (re-search-forward delim nil t) (setq start (match-end 0)) diff --git a/lisp/nndoc.el b/lisp/nndoc.el index 51538c7b2..5080e0fe8 100644 --- a/lisp/nndoc.el +++ b/lisp/nndoc.el @@ -206,9 +206,9 @@ Possible values: ;; headers. Aargh! (goto-char (point-min)) (if (search-forward "\n\n" nil t) - () ; We let this one pass. + () ; We let this one pass. (if (re-search-forward "^[ \t]+$" nil t) - (replace-match "" t t) ; We nix out a line of blanks. + (replace-match "" t t) ; We nix out a line of blanks. (while (and (looking-at "[^ ]+:") (zerop (forward-line 1)))) ;; We just insert a couple of lines. If you read digests @@ -300,7 +300,7 @@ Possible values: (defun nndoc-set-header-dependent-regexps () (if (not (eq nndoc-article-type 'digest)) () - (let ((case-fold-search t) ; We match a bit too much, keep it simple. + (let ((case-fold-search t) ; We match a bit too much, keep it simple. (boundary-id) (b-delimiter)) (save-excursion (set-buffer nndoc-current-buffer) @@ -340,15 +340,15 @@ Possible values: (let ((num 0)) (if (re-search-forward (or nndoc-first-article nndoc-article-begin) nil t) - (progn - (setq num 1) - (while (and (re-search-forward nndoc-article-begin nil t) - (or (not nndoc-end-of-file) - (not (looking-at nndoc-end-of-file))) - (or (not nndoc-head-begin) - (re-search-forward nndoc-head-begin nil t)) - (re-search-forward nndoc-head-end nil t)) - (setq num (1+ num))))) + (progn + (setq num 1) + (while (and (re-search-forward nndoc-article-begin nil t) + (or (not nndoc-end-of-file) + (not (looking-at nndoc-end-of-file))) + (or (not nndoc-head-begin) + (re-search-forward nndoc-head-begin nil t)) + (re-search-forward nndoc-head-end nil t)) + (setq num (1+ num))))) num))) (defun nndoc-narrow-to-article (article) diff --git a/lisp/nnfolder.el b/lisp/nnfolder.el index 3cdd034f1..f8264c279 100644 --- a/lisp/nnfolder.el +++ b/lisp/nnfolder.el @@ -607,8 +607,8 @@ such things as moving mail. All buffers always get killed upon server close.") (while (and (search-forward marker nil t) (re-search-forward number nil t)) (let ((newnum (string-to-number (buffer-substring - (match-beginning 0) - (match-end 0))))) + (match-beginning 0) + (match-end 0))))) (setq activenumber (max activenumber newnum)) (setq activemin (min activemin newnum)))) (setcar active (min activemin activenumber)) diff --git a/lisp/nnheader.el b/lisp/nnheader.el index 54b026614..c48b9a90d 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -36,93 +36,93 @@ ;;; Code: -(defalias 'nntp-header-number 'header-number) -(defmacro header-number (header) +(defalias 'nntp-header-number 'mail-header-number) +(defmacro mail-header-number (header) "Return article number in HEADER." (` (aref (, header) 0))) -(defalias 'nntp-set-header-number 'header-set-number) -(defmacro header-set-number (header number) +(defalias 'nntp-set-header-number 'mail-header-set-number) +(defmacro mail-header-set-number (header number) "Set article number of HEADER to NUMBER." (` (aset (, header) 0 (, number)))) -(defalias 'nntp-header-subject 'header-subject) -(defmacro header-subject (header) +(defalias 'nntp-header-subject 'mail-header-subject) +(defmacro mail-header-subject (header) "Return subject string in HEADER." (` (aref (, header) 1))) -(defalias 'nntp-set-header-subject 'header-set-subject) -(defmacro header-set-subject (header subject) +(defalias 'nntp-set-header-subject 'mail-header-set-subject) +(defmacro mail-header-set-subject (header subject) "Set article subject of HEADER to SUBJECT." (` (aset (, header) 1 (, subject)))) -(defalias 'nntp-header-from 'header-from) -(defmacro header-from (header) +(defalias 'nntp-header-from 'mail-header-from) +(defmacro mail-header-from (header) "Return author string in HEADER." (` (aref (, header) 2))) -(defalias 'nntp-set-header-from 'header-set-from) -(defmacro header-set-from (header from) +(defalias 'nntp-set-header-from 'mail-header-set-from) +(defmacro mail-header-set-from (header from) "Set article author of HEADER to FROM." (` (aset (, header) 2 (, from)))) -(defalias 'nntp-header-xref 'header-xref) -(defmacro header-xref (header) +(defalias 'nntp-header-xref 'mail-header-xref) +(defmacro mail-header-xref (header) "Return xref string in HEADER." (` (aref (, header) 8))) -(defalias 'nntp-set-header-xref 'header-set-xref) -(defmacro header-set-xref (header xref) +(defalias 'nntp-set-header-xref 'mail-header-set-xref) +(defmacro mail-header-set-xref (header xref) "Set article xref of HEADER to xref." (` (aset (, header) 8 (, xref)))) -(defalias 'nntp-header-lines 'header-lines) -(defmacro header-lines (header) +(defalias 'nntp-header-lines 'mail-header-lines) +(defmacro mail-header-lines (header) "Return lines in HEADER." (` (aref (, header) 7))) -(defalias 'nntp-set-header-lines 'header-set-lines) -(defmacro header-set-lines (header lines) +(defalias 'nntp-set-header-lines 'mail-header-set-lines) +(defmacro mail-header-set-lines (header lines) "Set article lines of HEADER to LINES." (` (aset (, header) 7 (, lines)))) -(defalias 'nntp-header-date 'header-date) -(defmacro header-date (header) +(defalias 'nntp-header-date 'mail-header-date) +(defmacro mail-header-date (header) "Return date in HEADER." (` (aref (, header) 3))) -(defalias 'nntp-set-header-date 'header-set-date) -(defmacro header-set-date (header date) +(defalias 'nntp-set-header-date 'mail-header-set-date) +(defmacro mail-header-set-date (header date) "Set article date of HEADER to DATE." (` (aset (, header) 3 (, date)))) -(defalias 'nntp-header-id 'header-id) -(defmacro header-id (header) +(defalias 'nntp-header-id 'mail-header-id) +(defmacro mail-header-id (header) "Return Id in HEADER." (` (aref (, header) 4))) -(defalias 'nntp-set-header-id 'header-set-id) -(defmacro header-set-id (header id) +(defalias 'nntp-set-header-id 'mail-header-set-id) +(defmacro mail-header-set-id (header id) "Set article Id of HEADER to ID." (` (aset (, header) 4 (, id)))) -(defalias 'nntp-header-references 'header-references) -(defmacro header-references (header) +(defalias 'nntp-header-references 'mail-header-references) +(defmacro mail-header-references (header) "Return references in HEADER." (` (aref (, header) 5))) -(defalias 'nntp-set-header-references 'header-set-references) -(defmacro header-set-references (header ref) +(defalias 'nntp-set-header-references 'mail-header-set-references) +(defmacro mail-header-set-references (header ref) "Set article references of HEADER to REF." (` (aset (, header) 5 (, ref)))) -(defalias 'nntp-header-chars 'header-chars) -(defmacro header-chars (header) +(defalias 'nntp-header-chars 'mail-header-chars) +(defmacro mail-header-chars (header) "Return number of chars of article in HEADER." (` (aref (, header) 6))) -(defalias 'nntp-set-header-chars 'header-set-chars) -(defmacro header-set-chars (header chars) +(defalias 'nntp-set-header-chars 'mail-header-set-chars) +(defmacro mail-header-set-chars (header chars) "Set number of chars in article of HEADER to CHARS." (` (aset (, header) 6 (, chars)))) @@ -213,7 +213,7 @@ A buffer may be modified in several ways after reading into the buffer due to advanced Emacs features, such as file-name-handlers, format decoding, find-file-hooks, etc. This function ensures that none of these modifications will take place." - (let (; (file-name-handler-alist nil) + (let ( ; (file-name-handler-alist nil) (format-alist nil) (after-insert-file-functions nil) (find-buffer-file-type-function @@ -271,13 +271,13 @@ The buffer is not selected, just returned to the caller." (buffer-name buf)) (format (if (buffer-modified-p buf) - "File %s changed on disk. Discard your edits? " - "File %s changed on disk. Reread from disk? ") + "File %s changed on disk. Discard your edits? " + "File %s changed on disk. Reread from disk? ") (file-name-nondirectory filename)) (format (if (buffer-modified-p buf) - "File %s changed on disk. Discard your edits in %s? " - "File %s changed on disk. Reread from disk into %s? ") + "File %s changed on disk. Discard your edits in %s? " + "File %s changed on disk. Reread from disk into %s? ") (file-name-nondirectory filename) (buffer-name buf)))) (save-excursion @@ -292,7 +292,7 @@ The buffer is not selected, just returned to the caller." ;;; (message "Symbolic link to file in buffer %s" ;;; (buffer-name linked-buf)))) (setq buf (create-file-buffer filename)) -;; (set-buffer-major-mode buf) + ;; (set-buffer-major-mode buf) (set-buffer buf) (erase-buffer) (if rawfile @@ -305,7 +305,7 @@ The buffer is not selected, just returned to the caller." (insert-file-contents filename t) (file-error ;; Run find-file-not-found-hooks until one returns non-nil. - (or t; (run-hook-with-args-until-success 'find-file-not-found-hooks) + (or t ; (run-hook-with-args-until-success 'find-file-not-found-hooks) ;; If they fail too, set error. (setq error t))))) ;; Find the file's truename, and maybe use that as visited name. diff --git a/lisp/nnkiboze.el b/lisp/nnkiboze.el index 143b90181..2b5457e56 100644 --- a/lisp/nnkiboze.el +++ b/lisp/nnkiboze.el @@ -106,7 +106,7 @@ If the stream is opened, return T, otherwise return NIL." ;; article fetching by message-id at all. (nntp-request-article article newsgroup gnus-nntp-server buffer) (let* ((header (gnus-get-header-by-number article)) - (xref (header-xref header)) + (xref (mail-header-xref header)) igroup iarticle) (or xref (error "nnkiboze: No xref")) (or (string-match " \\([^ ]+\\):\\([0-9]+\\)" xref) @@ -296,7 +296,7 @@ Finds out what articles are to be part of the nnkiboze groups." (save-excursion (set-buffer buffer) (goto-char (point-max)) - (let ((xref (header-xref header)) + (let ((xref (mail-header-xref header)) (prefix (gnus-group-real-prefix group)) (first t) article) @@ -306,18 +306,18 @@ Finds out what articles are to be part of the nnkiboze groups." (forward-line 1)) (setq article 1)) (insert (int-to-string article) "\t" - (or (header-subject header) "") "\t" - (or (header-from header) "") "\t" - (or (header-date header) "") "\t" - (or (header-id header) "") "\t" - (or (header-references header) "") "\t" - (int-to-string (or (header-chars header) 0)) "\t" - (int-to-string (or (header-lines header) 0)) "\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 (or (not xref) (equal "" xref)) (insert "Xref: " (system-name) " " group ":" - (int-to-string (header-number header)) + (int-to-string (mail-header-number header)) "\t\n") - (insert (header-xref header) "\t\n") + (insert (mail-header-xref header) "\t\n") (search-backward "\t" nil t) (search-backward "\t" nil t) (while (re-search-forward @@ -330,7 +330,7 @@ Finds out what articles are to be part of the nnkiboze groups." (save-excursion (goto-char (match-beginning 0)) (insert prefix group ":" - (int-to-string (header-number header)) " ") + (int-to-string (mail-header-number header)) " ") (setq first nil))) (save-excursion (goto-char (match-beginning 0)) diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 23b9e38a0..9b4a0d677 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -237,7 +237,9 @@ perfomed.") () (erase-buffer) (if post - (mail-setup method-address subject nil nil nil nil) + (progn + (mail-setup method-address subject nil nil nil nil) + (auto-save-mode auto-save-default)) (save-excursion (set-buffer article-buffer) (goto-char (point-min)) @@ -245,8 +247,8 @@ perfomed.") (progn (search-forward "\n\n") (point))) (let ((buffer-read-only nil)) (set-text-properties (point-min) (point-max) nil)) - (setq from (header-from header)) - (setq date (header-date header)) + (setq from (mail-header-from header)) + (setq date (mail-header-date header)) (and from (let ((stop-pos (string-match " *at \\| *@ \\| *(\\| *<" from))) @@ -256,12 +258,12 @@ perfomed.") (setq sender (mail-fetch-field "sender")) (setq cc (mail-fetch-field "cc")) (setq to (mail-fetch-field "to")) - (setq subject (header-subject header)) + (setq subject (mail-header-subject header)) (or (string-match "^[Rr][Ee]:" subject) (setq subject (concat "Re: " subject))) (setq reply-to (mail-fetch-field "reply-to")) - (setq references (header-references header)) - (setq message-id (header-id header)) + (setq references (mail-header-references header)) + (setq message-id (mail-header-id header)) (widen)) (setq news-reply-yank-from from) (setq news-reply-yank-message-id message-id) @@ -278,6 +280,7 @@ perfomed.") (if to (concat ", " to) "") (if cc (concat ", " cc) "")))) subject message-of nil article-buffer nil) + (auto-save-mode auto-save-default) ;; Note that "To" elements should already be in the message. (if (and follow-to (listp follow-to)) (progn @@ -442,15 +445,15 @@ nn*-request-list should have been called before calling this function." (match-end 2))))) group-assoc)))) -;; ;; In addition, add all groups mentioned in `nnmail-split-methods'. -;; (let ((methods (and (not (symbolp nnmail-split-methods)) -;; nnmail-split-methods))) -;; (while methods -;; (if (not (assoc (car (car methods)) group-assoc)) -;; (setq group-assoc -;; (cons (list (car (car methods)) (cons 1 0)) -;; group-assoc))) -;; (setq methods (cdr methods))) + ;; ;; In addition, add all groups mentioned in `nnmail-split-methods'. + ;; (let ((methods (and (not (symbolp nnmail-split-methods)) + ;; nnmail-split-methods))) + ;; (while methods + ;; (if (not (assoc (car (car methods)) group-assoc)) + ;; (setq group-assoc + ;; (cons (list (car (car methods)) (cons 1 0)) + ;; group-assoc))) + ;; (setq methods (cdr methods))) group-assoc)) @@ -702,7 +705,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." (setq split (cdr split) done (nnmail-split-it (car split)))) done)) ((assq split nnmail-split-cache) - ;; A compiled match expression. + ;; A compiled match expression. (goto-char (point-max)) (if (re-search-backward (cdr (assq split nnmail-split-cache)) nil t) (nnmail-split-it (nth 2 split)))) @@ -711,16 +714,16 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." (let* ((field (nth 0 split)) (value (nth 1 split)) (regexp (concat "^\\(" - (if (symbolp field) - (cdr (assq field - nnmail-split-abbrev-alist)) - field) - "\\):.*\\<\\(" - (if (symbolp value) - (cdr (assq value - nnmail-split-abbrev-alist)) - value) - "\\>\\)"))) + (if (symbolp field) + (cdr (assq field + nnmail-split-abbrev-alist)) + field) + "\\):.*\\<\\(" + (if (symbolp value) + (cdr (assq value + nnmail-split-abbrev-alist)) + value) + "\\>\\)"))) (setq nnmail-split-cache (cons (cons split regexp) nnmail-split-cache)) (goto-char (point-max)) @@ -824,7 +827,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." (if (or (not nnmail-delete-duplicates) (and nnmail-cache-buffer (buffer-name nnmail-cache-buffer))) - () ; The buffer is open. + () ; The buffer is open. (save-excursion (set-buffer (setq nnmail-cache-buffer @@ -839,7 +842,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." (not nnmail-delete-duplicates) (not (buffer-name nnmail-cache-buffer)) (not (buffer-modified-p nnmail-cache-buffer))) - () ; The buffer is closed. + () ; The buffer is closed. (save-excursion (set-buffer nnmail-cache-buffer) ;; Weed out the excess number of Message-IDs. diff --git a/lisp/nnmbox.el b/lisp/nnmbox.el index d018d0ada..ee7be4325 100644 --- a/lisp/nnmbox.el +++ b/lisp/nnmbox.el @@ -417,7 +417,7 @@ ;; This might be a bit naughty... creating groups on the drop of ;; a hat, but I don't know... (setq nnmbox-group-alist (cons (list group (setq active (cons 1 1))) - nnmbox-group-alist))) + nnmbox-group-alist))) (cdr active))) (defun nnmbox-read-mbox () diff --git a/lisp/nnmh.el b/lisp/nnmh.el index 1bfef2781..2322f35a0 100644 --- a/lisp/nnmh.el +++ b/lisp/nnmh.el @@ -303,7 +303,7 @@ (delete-file (concat nnmh-current-directory (int-to-string article))) (file-error nil))) - result)) + result)) (defun nnmh-request-accept-article (group &optional last) (if (stringp group) diff --git a/lisp/nnml.el b/lisp/nnml.el index 01ed2b637..949d39e95 100644 --- a/lisp/nnml.el +++ b/lisp/nnml.el @@ -671,7 +671,7 @@ all. This may very well take some time.") (setq chars (- (point-max) (point))) (point))) - (if (not (= 0 chars)) ; none of them empty files... + (if (not (= 0 chars)) ; none of them empty files... (progn (setq nov-line (nnml-make-nov-line chars)) (save-excursion diff --git a/lisp/nnspool.el b/lisp/nnspool.el index 4ee55b074..96f3df8dd 100644 --- a/lisp/nnspool.el +++ b/lisp/nnspool.el @@ -342,7 +342,7 @@ Newsgroup must be selected before calling this function." (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)) ))) (defalias 'nnspool-request-post-buffer 'nntp-request-post-buffer) @@ -419,7 +419,7 @@ Newsgroup must be selected before calling this function." (erase-buffer) (call-process "grep" nil t nil id nnspool-history-file) (goto-char (point-min)) - (if (looking-at "<[^>]+>[ \t]+[-0-9~]+[ \t]+\\([^ \t\n]*\\)") + (if (looking-at "<[^>]+>[ \t]+[-0-9~]+[ \t]+\\([^ \t\n]*\\)") (concat nnspool-spool-directory (nnspool-replace-chars-in-string (buffer-substring (match-beginning 1) (match-end 1)) diff --git a/lisp/nntp.el b/lisp/nntp.el index c6ab0a6ea..d7cd85dce 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -283,51 +283,51 @@ instead call function `nntp-status-message' to get status message.") (last-point (point-min)) (command (if nntp-server-list-active-group "LIST ACTIVE" "GROUP"))) - (while groups - (nntp-send-strings-to-server command (car groups)) - (setq groups (cdr groups)) - (setq count (1+ count)) - ;; Every 400 requests we have to read the stream in - ;; order to avoid deadlocks. - (if (or (null groups) ;All requests have been sent. - (zerop (% count nntp-maximum-request))) - (progn - (nntp-accept-response) + (while groups + (nntp-send-strings-to-server command (car groups)) + (setq groups (cdr groups)) + (setq count (1+ count)) + ;; Every 400 requests we have to read the stream in + ;; order to avoid deadlocks. + (if (or (null groups) ;All requests have been sent. + (zerop (% count nntp-maximum-request))) + (progn + (nntp-accept-response) + (while (progn + (goto-char last-point) + ;; Count replies. + (while (re-search-forward "^[0-9]" nil t) + (setq received (1+ received))) + (setq last-point (point)) + (< received count)) + (nntp-accept-response))))) + + ;; Wait for the reply from the final command. + (if nntp-server-list-active-group + (progn + (goto-char (point-max)) + (re-search-backward "^[0-9]" nil t) + (if (looking-at "^[23]") (while (progn - (goto-char last-point) - ;; Count replies. - (while (re-search-forward "^[0-9]" nil t) - (setq received (1+ received))) - (setq last-point (point)) - (< received count)) + (goto-char (- (point-max) 3)) + (not (looking-at "^\\.\r?\n"))) (nntp-accept-response))))) - ;; Wait for the reply from the final command. - (if nntp-server-list-active-group - (progn - (goto-char (point-max)) - (re-search-backward "^[0-9]" nil t) - (if (looking-at "^[23]") - (while (progn - (goto-char (- (point-max) 3)) - (not (looking-at "^\\.\r?\n"))) - (nntp-accept-response))))) - - ;; Now all replies are received. We remove CRs. - (goto-char (point-min)) - (while (search-forward "\r" nil t) - (replace-match "" t t)) + ;; Now all replies are received. We remove CRs. + (goto-char (point-min)) + (while (search-forward "\r" nil t) + (replace-match "" t t)) - (if nntp-server-list-active-group - (progn - ;; We have read active entries, so we just delete the - ;; superfluos gunk. - (goto-char (point-min)) - (while (re-search-forward "^[.2-5]" nil t) - (delete-region (match-beginning 0) - (progn (forward-line 1) (point)))) - 'active) - 'group)))) + (if nntp-server-list-active-group + (progn + ;; We have read active entries, so we just delete the + ;; superfluos gunk. + (goto-char (point-min)) + (while (re-search-forward "^[.2-5]" nil t) + (delete-region (match-beginning 0) + (progn (forward-line 1) (point)))) + 'active) + 'group)))) (defun nntp-open-server (server &optional defs) (nnheader-init-server-buffer) @@ -624,8 +624,8 @@ post to this group instead. If RESPECT-POSTER, heed the special (goto-char (point-min)) (narrow-to-region (point-min) (progn (search-forward "\n\n") (point))) - (setq from (header-from header)) - (setq date (header-date header)) + (setq from (mail-header-from header)) + (setq date (mail-header-date header)) (and from (let ((stop-pos (string-match " *at \\| *@ \\| *(\\| *<" from))) @@ -633,7 +633,7 @@ post to this group instead. If RESPECT-POSTER, heed the special message-of (concat (if stop-pos (substring from 0 stop-pos) from) "'s message of " date)))) - (setq subject (or subject (header-subject header))) + (setq subject (or subject (mail-header-subject header))) (or (string-match "^[Rr][Ee]:" subject) (setq subject (concat "Re: " subject))) (setq followup-to (mail-fetch-field "followup-to")) @@ -643,13 +643,13 @@ post to this group instead. If RESPECT-POSTER, heed the special (setq followup-to nil)) (setq newsgroups (or follow-to followup-to (mail-fetch-field "newsgroups"))) - (setq references (header-references header)) + (setq references (mail-header-references header)) (setq distribution (mail-fetch-field "distribution")) ;; Remove bogus distribution. (and (stringp distribution) (string-match "world" distribution) (setq distribution nil)) - (setq message-id (header-id header)) + (setq message-id (mail-header-id header)) (widen)) (setq news-reply-yank-from from) (setq news-reply-yank-message-id message-id) @@ -896,6 +896,7 @@ It will prompt for a password." (let ((count 0) (received 0) (last-point (point-min)) + (buf (current-buffer)) first) ;; We have to check `nntp-server-xover'. If it gets set to nil, ;; that means that the server does not understand XOVER, but we @@ -908,25 +909,31 @@ It will prompt for a password." (< (- (nth 1 sequence) (car sequence)) nntp-nov-gap)) (setq sequence (cdr sequence))) - (if (not (nntp-send-xover-command first (car sequence))) - () - (setq sequence (cdr sequence) - count (1+ count)) + (if (not (nntp-send-xover-command first (car sequence))) + () + (setq sequence (cdr sequence) + count (1+ count)) - ;; Every 400 requests we have to read the stream in - ;; order to avoid deadlocks. - (if (or (null sequence) ;All requests have been sent. - (zerop (% count nntp-maximum-request))) - (progn + ;; Every 400 requests we have to read the stream in + ;; order to avoid deadlocks. + (if (or (null sequence) ;All requests have been sent. + (zerop (% count nntp-maximum-request))) + (progn + (accept-process-output) + ;; On some Emacs versions the preceding function has + ;; a tendency to change the buffer. Perhaps. It's + ;; quite difficult to reporduce, because it only + ;; seems to happen once in a blue moon. + (set-buffer buf) + (while (progn + (goto-char last-point) + ;; Count replies. + (while (re-search-forward "^[0-9][0-9][0-9] " nil t) + (setq received (1+ received))) + (setq last-point (point)) + (< received count)) (accept-process-output) - (while (progn - (goto-char last-point) - ;; Count replies. - (while (re-search-forward "^[0-9][0-9][0-9] " nil t) - (setq received (1+ received))) - (setq last-point (point)) - (< received count)) - (accept-process-output)))))) + (set-buffer buf)))))) (if (not nntp-server-xover) () @@ -1138,25 +1145,29 @@ defining this function as macro." ;; accept-process-output is called. ;; Suggested by Jason Venner . ;; This is a copy of `nntp-default-sentinel'. - (if (or (not nntp-server-process) - (not (memq (process-status nntp-server-process) '(open run)))) - (error "nntp: Process connection closed; %s" (nntp-status-message)) - (if nntp-buggy-select - (progn - ;; We cannot use `accept-process-output'. - ;; Fujitsu UTS requires messages during sleep-for. I don't know why. - (message "NNTP: Reading...") - (sleep-for 1) - (message "")) - (condition-case errorcode - (accept-process-output nntp-server-process) - (error - (cond ((string-equal "select error: Invalid argument" - (nth 1 errorcode)) - ;; Ignore select error. - nil) - (t - (signal (car errorcode) (cdr errorcode))))))))) + (let ((buf (current-buffer))) + (prog1 + (if (or (not nntp-server-process) + (not (memq (process-status nntp-server-process) '(open run)))) + (error "nntp: Process connection closed; %s" (nntp-status-message)) + (if nntp-buggy-select + (progn + ;; We cannot use `accept-process-output'. + ;; Fujitsu UTS requires messages during sleep-for. + ;; I don't know why. + (message "NNTP: Reading...") + (sleep-for 1) + (message "")) + (condition-case errorcode + (accept-process-output nntp-server-process) + (error + (cond ((string-equal "select error: Invalid argument" + (nth 1 errorcode)) + ;; Ignore select error. + nil) + (t + (signal (car errorcode) (cdr errorcode)))))))) + (set-buffer buf)))) (defun nntp-last-element (list) "Return last element of LIST." diff --git a/lisp/nnvirtual.el b/lisp/nnvirtual.el index 22a4eecd1..80ec3cd0d 100644 --- a/lisp/nnvirtual.el +++ b/lisp/nnvirtual.el @@ -257,16 +257,16 @@ If the stream is opened, return T, otherwise return NIL." (while headers (setq header (car headers) headers (cdr headers)) - (insert (int-to-string (header-number header)) "\t" - (or (header-subject header) "") "\t" - (or (header-from header) "") "\t" - (or (header-date header) "") "\t" - (or (header-id header) "") "\t" - (or (header-references header) "") "\t" - (int-to-string (or (header-chars header) 0)) "\t" - (int-to-string (or (header-lines header) 0)) "\t" - (if (header-xref header) - (concat "Xref: " (header-xref header) "\t") + (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-newsgroups (group regexp &optional check) diff --git a/texi/gnus.texi b/texi/gnus.texi index ed56cdd18..bf17d24f5 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -2001,8 +2001,9 @@ Gnus to split the mail the normal way, you could set @code{nnmail-resplit-incoming} to @code{t}. @vindex nnmail-keep-last-article -If you use @code{procmail}, you should set -@code{nnmail-keep-last-article} to non-@code{nil}, to prevent Gnus from +If you use @code{procmail} to split things directory into an nnmh +directory (which you shouldn't do), you should set +@code{nnmail-keep-last-article} to non-@code{nil} to prevent Gnus from ever expiring the final article in a mail newsgroup. This is quite, quite important. @@ -5661,6 +5662,11 @@ in your @file{all.SCORE} file: ((mark -100)) @end lisp You may also consider doing something similar with @code{expunge}. + +@item Negated charater classes +If you say stuff like @code{[^abcd]*}, you may get unexpected results. +That will match newlines, which might lead to, well, The Unknown. Say +@code{[^abcd\n]*} instead. @end table @node Reverse Scoring -- 2.25.1