From d23fd302a1618b1fe2bf611af77ca1be191ab741 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 9 Jul 2003 22:38:22 +0000 Subject: [PATCH] Synch to Gnus 200307092004. --- lisp/ChangeLog | 31 +++++++++- lisp/deuglify.el | 8 +-- lisp/flow-fill.el | 4 +- lisp/gnus-art.el | 12 ++-- lisp/gnus-draft.el | 2 +- lisp/gnus-group.el | 56 +++++++++--------- lisp/gnus-int.el | 12 ++-- lisp/gnus-msg.el | 10 ++-- lisp/gnus-start.el | 22 ++++---- lisp/gnus-sum.el | 42 +++++++------- lisp/gnus-util.el | 22 ++++---- lisp/gnus.el | 67 +++++++++++----------- lisp/imap.el | 159 ++++++++++++++++++++++++++++------------------------ 13 files changed, 244 insertions(+), 203 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8c1c2b4..bfc68ec 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,34 @@ +2003-07-09 Kai Gro,A_(Bjohann + From Gaute B Strokkenes (tiny patch). + + * imap.el (imap-wait-for-tag): Clarify comment. Use timeout zero + for second, after-process-has-died, accept-process-output. + (imap-arrival-filter): If PROC has no buffer, do nothing. + 2003-07-09 Jesper Harder + * flow-fill.el: Docstring and message fixes. + + * deuglify.el: do. + + * gnus-int.el: do. + + * gnus-msg.el: do. + + * gnus-util.el: do. + + * gnus-draft.el: do. + + * gnus-start.el: do. + + * gnus.el: do. + + * gnus-group.el: do. + + * gnus-art.el: do. + + * gnus-sum.el: do. + * mail-source.el (mail-source-movemail): Handle non-numerical return values. @@ -30,7 +59,7 @@ * imap.el (imap-wait-for-tag): After the process has died, look for more output still pending. From Gaute B Strokkenes - . + (tiny patch). 2003-07-07 Teodor Zlatanov diff --git a/lisp/deuglify.el b/lisp/deuglify.el index 89be369..a73d7f0 100644 --- a/lisp/deuglify.el +++ b/lisp/deuglify.el @@ -204,7 +204,7 @@ ;; Renamed `gnus-outlook-deuglify-article' to ;; `gnus-article-outlook-deuglify-article'. ;; Made it easier to deuglify the article while being in Gnus' Article -;; Edit Mode. (suggested by Phil Nitschke) +;; Edit Mode. (suggested by Phil Nitschke) ;; ;; ;; Revision 1.3 2002/01/02 23:35:54 rscholz @@ -300,10 +300,10 @@ It is run after `gnus-article-prepare-hook'." ;;;###autoload (defun gnus-article-outlook-unwrap-lines (&optional nodisplay) - "Unwrap lines that appear to be wrapped citation lines. + "Unwrap lines that appear to be wrapped citation lines. You can control what lines will be unwrapped by frobbing `gnus-outlook-deuglify-unwrap-min' and `gnus-outlook-deuglify-unwrap-max', -indicating the miminum and maximum length of an unwrapped citation line. If +indicating the minimum and maximum length of an unwrapped citation line. If NODISPLAY is non-nil, don't redisplay the article buffer." (interactive "P") (save-excursion @@ -330,7 +330,7 @@ NODISPLAY is non-nil, don't redisplay the article buffer." (unless nodisplay (gnus-outlook-display-article-buffer))) (defun gnus-outlook-rearrange-article (attr-start) - "Put the text from `attr-start' to the end of buffer at the top of the article buffer." + "Put the text from ATTR-START to the end of buffer at the top of the article buffer." (save-excursion (let ((inhibit-read-only t) (cite-marks gnus-outlook-deuglify-cite-marks)) diff --git a/lisp/flow-fill.el b/lisp/flow-fill.el index 987113d..ea95fb3 100644 --- a/lisp/flow-fill.el +++ b/lisp/flow-fill.el @@ -54,7 +54,7 @@ (defcustom fill-flowed-display-column 'fill-column "Column beyond which format=flowed lines are wrapped, when displayed. -This can be a lisp expression or an integer." +This can be a Lisp expression or an integer." :type '(choice (const :tag "Standard `fill-column'" fill-column) (const :tag "Fit Window" (- (window-width) 5)) (sexp) @@ -62,7 +62,7 @@ This can be a lisp expression or an integer." (defcustom fill-flowed-encode-column 66 "Column beyond which format=flowed lines are wrapped, in outgoing messages. -This can be a lisp expression or an integer. +This can be a Lisp expression or an integer. RFC 2646 suggests 66 characters for readability." :type '(choice (const :tag "Standard fill-column" fill-column) (const :tag "RFC 2646 default (66)" 66) diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index efc34cc..68e2eb7 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -6459,7 +6459,7 @@ Calls `describe-variable' or `describe-function'." "*Integer that says how many TeX-related buttons Gnus will show. The higher the number, the more buttons will appear and the more false positives are possible. Note that you can set this variable local to -specifific groups. Setting it higher in TeX groups is probably a good idea. +specific groups. Setting it higher in TeX groups is probably a good idea. See Info node `(gnus)Group Parameters' and the variable `gnus-parameters' on how to set variables in specific groups." :group 'gnus-article-buttons @@ -6470,7 +6470,7 @@ how to set variables in specific groups." "*Integer that says how many man-related buttons Gnus will show. The higher the number, the more buttons will appear and the more false positives are possible. Note that you can set this variable local to -specifific groups. Setting it higher in Unix groups is probably a good idea. +specific groups. Setting it higher in Unix groups is probably a good idea. See Info node `(gnus)Group Parameters' and the variable `gnus-parameters' on how to set variables in specific groups." :group 'gnus-article-buttons @@ -6481,7 +6481,7 @@ how to set variables in specific groups." "*Integer that says how many emacs-related buttons Gnus will show. The higher the number, the more buttons will appear and the more false positives are possible. Note that you can set this variable local to -specifific groups. Setting it higher in Emacs or Gnus related groups is +specific groups. Setting it higher in Emacs or Gnus related groups is probably a good idea. See Info node `(gnus)Group Parameters' and the variable `gnus-parameters' on how to set variables in specific groups." :group 'gnus-article-buttons @@ -6607,9 +6607,9 @@ positives are possible." Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where REGEXP: is the string (case insensitive) matching text around the button (can -also be lisp expression evaluating to a string), +also be Lisp expression evaluating to a string), BUTTON: is the number of the regexp grouping actually matching the button, -FORM: is a lisp expression which must eval to true for the button to +FORM: is a Lisp expression which must eval to true for the button to be added, CALLBACK: is the function to call when the user push this button, and each PAR: is a number of a regexp grouping whose text will be passed to CALLBACK. @@ -7222,7 +7222,7 @@ specified by `gnus-button-alist'." This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item is FUNCTION, FUNCTION will be apply to all newsgroups. If item is a -\(REGEXP . FUNCTION), FUNCTION will be only apply to thes newsgroups +\(REGEXP . FUNCTION), FUNCTION will be only apply to the newsgroups whose names match REGEXP. For example: diff --git a/lisp/gnus-draft.el b/lisp/gnus-draft.el index 4bad775..db83179 100644 --- a/lisp/gnus-draft.el +++ b/lisp/gnus-draft.el @@ -219,7 +219,7 @@ (dolist (group '("nndraft:drafts" "nndraft:queue")) (setq active (gnus-activate-group group)) (if (and active (>= (cdr active) (car active))) - (if (y-or-n-p "There are unsent drafts. Confirm to exit?") + (if (y-or-n-p "There are unsent drafts. Confirm to exit? ") (throw 'continue t) (error "Stop!")))))))) diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 92362fb..8c55846 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -181,8 +181,8 @@ with some simple extensions. %E Icon as defined by `gnus-group-icon-list'. %u User defined specifier. The next character in the format string should be a letter. Gnus will call the function gnus-user-format-function-X, - where X is the letter following %u. The function will be passed a - single dummy parameter as argument.. The function should return a + where X is the letter following %u. The function will be passed a + single dummy parameter as argument. The function should return a string, which will be inserted into the buffer just like information from any other group specifier. @@ -742,7 +742,7 @@ simple manner.") (defun gnus-topic-mode-p () "Return non-nil in `gnus-topic-mode'." - (and (boundp 'gnus-topic-mode) + (and (boundp 'gnus-topic-mode) (symbol-value 'gnus-topic-mode))) (defun gnus-group-make-menu-bar () @@ -760,7 +760,7 @@ simple manner.") ["Select" gnus-group-select-group :included (not (gnus-topic-mode-p)) :active (gnus-group-group-name)] - ["Select " gnus-topic-select-group + ["Select " gnus-topic-select-group :included (gnus-topic-mode-p)] ["See old articles" (gnus-group-select-group 'all) :keys "C-u SPC" :active (gnus-group-group-name)] @@ -769,7 +769,7 @@ simple manner.") :active (gnus-group-group-name) ,@(if (featurep 'xemacs) nil '(:help "Mark unread articles in the current group as read"))] - ["Catch up " gnus-topic-catchup-articles + ["Catch up " gnus-topic-catchup-articles :included (gnus-topic-mode-p) ,@(if (featurep 'xemacs) nil '(:help "Mark unread articles in the current group or topic as read"))] @@ -804,13 +804,13 @@ simple manner.") '(:help "Display the archived control message for the current group"))] ;; Actually one should check, if any of the marked groups gives t for ;; (gnus-check-backend-function 'request-expire-articles ...) - ["Expire articles" gnus-group-expire-articles + ["Expire articles" gnus-group-expire-articles :included (not (gnus-topic-mode-p)) :active (or (and (gnus-group-group-name) (gnus-check-backend-function 'request-expire-articles (gnus-group-group-name))) gnus-group-marked)] - ["Expire articles " gnus-topic-expire-articles + ["Expire articles " gnus-topic-expire-articles :included (gnus-topic-mode-p)] ["Set group level..." gnus-group-set-current-level (gnus-group-group-name)] @@ -1427,7 +1427,7 @@ if it is a string, only list groups matching REGEXP." (gnus-tmp-qualified-group (gnus-group-name-decode (gnus-group-real-name gnus-tmp-group) group-name-charset)) - (gnus-tmp-comment + (gnus-tmp-comment (or (gnus-group-get-parameter gnus-tmp-group 'comment t) gnus-tmp-group)) (gnus-tmp-newsgroup-description @@ -2282,7 +2282,7 @@ ADDRESS." (forward-line -1) (gnus-group-position-point) - ;; Load the backend and try to make the backend create + ;; Load the back end and try to make the back end create ;; the group as well. (when (assoc (symbol-name (setq backend (car (gnus-server-get-method nil meth)))) @@ -2321,7 +2321,7 @@ doing the deletion." (unless group (error "No group to delete")) (unless (gnus-check-backend-function 'request-delete-group group) - (error "This backend does not support group deletion")) + (error "This back end does not support group deletion")) (prog1 (if (and (not no-prompt) (not (gnus-yes-or-no-p @@ -2353,12 +2353,12 @@ and NEW-NAME will be prompted for." (progn (unless (gnus-check-backend-function 'request-rename-group (gnus-group-group-name)) - (error "This backend does not support renaming groups")) + (error "This back end does not support renaming groups")) (gnus-read-group "Rename group to: " (gnus-group-real-name (gnus-group-group-name)))))) (unless (gnus-check-backend-function 'request-rename-group group) - (error "This backend does not support renaming groups")) + (error "This back end does not support renaming groups")) (unless group (error "No group to rename")) (when (equal (gnus-group-real-name group) new-name) @@ -2596,18 +2596,18 @@ If SOLID (the prefix), create a solid group." (defun nnrss-discover-feed (arg)) (defun nnrss-save-server-data (arg))) (defun gnus-group-make-rss-group (&optional url) - "Given a URL, discover if there is an RSS feed. If there is, -use Gnus' to create an nnrss group" + "Given a URL, discover if there is an RSS feed. +If there is, use Gnus to create an nnrss group" (interactive) (require 'nnrss) (if (not url) (setq url (read-from-minibuffer "URL to Search for RSS: "))) (let ((feedinfo (nnrss-discover-feed url))) (if feedinfo - (let ((title (read-from-minibuffer "Title: " - (cdr (assoc 'title + (let ((title (read-from-minibuffer "Title: " + (cdr (assoc 'title feedinfo)))) - (desc (read-from-minibuffer "Description: " + (desc (read-from-minibuffer "Description: " (cdr (assoc 'description feedinfo)))) (href (cdr (assoc 'href feedinfo)))) @@ -2899,7 +2899,7 @@ If REVERSE, sort in reverse order." (gnus-group-sort-groups 'gnus-group-sort-by-rank reverse)) (defun gnus-group-sort-groups-by-method (&optional reverse) - "Sort the group buffer alphabetically by backend name. + "Sort the group buffer alphabetically by back end name. If REVERSE, sort in reverse order." (interactive "P") (gnus-group-sort-groups 'gnus-group-sort-by-method reverse)) @@ -2988,7 +2988,7 @@ sort in reverse order." (gnus-group-sort-selected-groups n 'gnus-group-sort-by-rank reverse)) (defun gnus-group-sort-selected-groups-by-method (&optional n reverse) - "Sort the group buffer alphabetically by backend name. + "Sort the group buffer alphabetically by back end name. Obeys the process/prefix convention. If REVERSE (the symbolic prefix), sort in reverse order." (interactive (gnus-interactive "P\ny")) @@ -3017,7 +3017,7 @@ sort in reverse order." (< (gnus-info-level info1) (gnus-info-level info2))) (defun gnus-group-sort-by-method (info1 info2) - "Sort alphabetically by backend name." + "Sort alphabetically by back end name." (string< (car (gnus-find-method-for-group (gnus-info-group info1) info1)) (car (gnus-find-method-for-group @@ -3492,7 +3492,7 @@ yanked) a list of yanked groups is returned." (defun gnus-group-list-all-groups (&optional arg) "List all newsgroups with level ARG or lower. -Default is gnus-level-unsubscribed, which lists all subscribed and most +Default is `gnus-level-unsubscribed', which lists all subscribed and most unsubscribed groups." (interactive "P") (gnus-group-list-groups (or arg gnus-level-unsubscribed) t)) @@ -3705,7 +3705,7 @@ If given a prefix argument, prompt for a group." (browse-url (eval url)) (setq url (concat "http://" hierarchy ".news-admin.org/charters/" name)) - (if (and (fboundp 'url-http-file-exists-p) + (if (and (fboundp 'url-http-file-exists-p) (url-http-file-exists-p url)) (browse-url url) (gnus-group-fetch-control group)))))) @@ -3730,9 +3730,9 @@ If given a prefix argument, prompt for a group." (let ((enable-local-variables nil)) (gnus-group-read-ephemeral-group group - `(nndoc ,group (nndoc-address + `(nndoc ,group (nndoc-address ,(find-file-noselect - (concat "/ftp@ftp.isc.org:/usenet/control/" + (concat "/ftp@ftp.isc.org:/usenet/control/" hierarchy "/" name ".Z"))) (nndoc-article-type mbox)) t nil nil)))))) @@ -3831,7 +3831,7 @@ If given a prefix argument, prompt for a group." (pop-to-buffer obuf))) (defun gnus-group-description-apropos (regexp) - "List all newsgroups that have names or descriptions that match a regexp." + "List all newsgroups that have names or descriptions that match REGEXP." (interactive "sGnus description apropos (regexp): ") (when (not (or gnus-description-hashtb (gnus-read-all-descriptions-files))) @@ -3933,7 +3933,7 @@ If GROUP, edit that local kill file instead." (defun gnus-group-suspend () "Suspend the current Gnus session. In fact, cleanup buffers except for group mode buffer. -The hook gnus-suspend-gnus-hook is called before actually suspending." +The hook `gnus-suspend-gnus-hook' is called before actually suspending." (interactive) (gnus-run-hooks 'gnus-suspend-gnus-hook) (gnus-offer-save-summaries) @@ -4019,10 +4019,10 @@ If not, METHOD should be a list where the first element is the method and the second element is the address." (interactive (list (let ((how (completing-read - "Which backend: " + "Which back end: " (append gnus-valid-select-methods gnus-server-alist) nil t (cons "nntp" 0) 'gnus-method-history))) - ;; We either got a backend name or a virtual server name. + ;; We either got a back end name or a virtual server name. ;; If the first, we also need an address. (if (assoc how gnus-valid-select-methods) (list (intern how) diff --git a/lisp/gnus-int.el b/lisp/gnus-int.el index 64b603e..073b461 100644 --- a/lisp/gnus-int.el +++ b/lisp/gnus-int.el @@ -206,8 +206,8 @@ If it is down, start it up (again)." (funcall (gnus-get-function gnus-command-method 'open-server) (nth 1 gnus-command-method) (nthcdr 2 gnus-command-method)) - (error - (gnus-message 1 (format + (error + (gnus-message 1 (format "Unable to open server due to: %s" (error-message-string err))) nil) @@ -288,8 +288,8 @@ If it is down, start it up (again)." (defun gnus-status-message (gnus-command-method) "Return the status message from GNUS-COMMAND-METHOD. -If GNUS-COMMAND-METHOD is a string, it is interpreted as a group name. The method -this group uses will be queried." +If GNUS-COMMAND-METHOD is a string, it is interpreted as a group +name. The method this group uses will be queried." (let ((gnus-command-method (if (stringp gnus-command-method) (gnus-find-method-for-group gnus-command-method) @@ -384,7 +384,7 @@ If FETCH-OLD, retrieve all headers (or some subset thereof) in the group." (gnus-group-real-name group) article)))) (defun gnus-request-set-mark (group action) - "Set marks on articles in the backend." + "Set marks on articles in the back end." (let ((gnus-command-method (gnus-find-method-for-group group))) (if (not (gnus-check-backend-function 'request-set-mark (car gnus-command-method))) @@ -394,7 +394,7 @@ If FETCH-OLD, retrieve all headers (or some subset thereof) in the group." (nth 1 gnus-command-method))))) (defun gnus-request-update-mark (group article mark) - "Allow the backend to change the mark the user tries to put on an article." + "Allow the back end to change the mark the user tries to put on an article." (let ((gnus-command-method (gnus-find-method-for-group group))) (if (not (gnus-check-backend-function 'request-update-mark (car gnus-command-method))) diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index 68d32a8..785c59f 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -274,7 +274,7 @@ See also the `mml-default-encrypt-method' variable." (defcustom gnus-message-replysignencrypted t - "Setting this causes automatically encryped messages to also be signed." + "Setting this causes automatically encrypted messages to also be signed." :group 'gnus-message :type 'boolean) @@ -621,7 +621,7 @@ If ARG is 1, prompt for group name to post to. This function prepares a news even when using mail groups. This is useful for posting messages to mail groups without actually sending them over the -network. The corresponding backend must have a 'request-post method." +network. The corresponding back end must have a 'request-post method." (interactive "P") ;; We can't `let' gnus-newsgroup-name here, since that leads ;; to local variables leaking. @@ -700,7 +700,7 @@ If ARG, don't do that. If ARG is 1, prompt for group name to post to. This function prepares a news even when using mail groups. This is useful for posting messages to mail groups without actually sending them over the -network. The corresponding backend must have a 'request-post method." +network. The corresponding back end must have a 'request-post method." (interactive "P") ;; We can't `let' gnus-newsgroup-name here, since that leads ;; to local variables leaking. @@ -1282,7 +1282,7 @@ If VERY-WIDE, make a very wide reply." (gnus-summary-work-articles 1)))) ;; Allow user to require confirmation before replying by mail to the ;; author of a news article (or mail message). - (when (or + (when (or (not (or (gnus-news-group-p gnus-newsgroup-name) gnus-confirm-treat-mail-like-news)) (not (cond ((stringp gnus-confirm-mail-reply-to-news) @@ -1647,7 +1647,7 @@ The current group name will be inserted at \"%s\".") ;; This mail group doesn't have a `to-list', so we add one ;; here. Magic! (when (gnus-y-or-n-p - (format "Do you want to add this as `to-list': %s " to-address)) + (format "Do you want to add this as `to-list': %s? " to-address)) (gnus-group-add-parameter group (cons 'to-list to-address)))))) (defun gnus-put-message () diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index 77ef2b3..72337cd 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -289,8 +289,8 @@ claim them." (repeat function))) (defcustom gnus-subscribe-newsgroup-hooks nil - "*Hooks run after you subscribe to a new group. The hooks will be called -with new group's name as argument." + "*Hooks run after you subscribe to a new group. +The hooks will be called with new group's name as argument." :group 'gnus-group-new :type 'hook) @@ -389,7 +389,7 @@ This hook is called as the first thing when Gnus is started." :group 'gnus-start :type 'hook) -(defcustom gnus-setup-news-hook +(defcustom gnus-setup-news-hook '(gnus-fixup-nnimap-unread-after-getting-new-news) "A hook after reading the .newsrc file, but before generating the buffer." :group 'gnus-start @@ -563,7 +563,7 @@ Can be used to turn version control on or off." (gnus-subscribe-newsgroup newsgroup)) (defun gnus-subscribe-alphabetically (newgroup) - "Subscribe new NEWSGROUP and insert it in alphabetical order." + "Subscribe new NEWGROUP and insert it in alphabetical order." (let ((groups (cdr gnus-newsrc-alist)) before) (while (and (not before) groups) @@ -573,7 +573,7 @@ Can be used to turn version control on or off." (gnus-subscribe-newsgroup newgroup before))) (defun gnus-subscribe-hierarchically (newgroup) - "Subscribe new NEWSGROUP and insert it in hierarchical newsgroup order." + "Subscribe new NEWGROUP and insert it in hierarchical newsgroup order." ;; Basic ideas by mike-w@cs.aukuni.ac.nz (Mike Williams) (save-excursion (set-buffer (nnheader-find-file-noselect gnus-current-startup-file)) @@ -1267,7 +1267,7 @@ for new groups, and subscribe the new groups as zombies." (gnus-message 7 "`A k' to list killed groups")))))) (defun gnus-subscribe-group (group &optional previous method) - "Subcribe GROUP and put it after PREVIOUS." + "Subscribe GROUP and put it after PREVIOUS." (gnus-group-change-level (if method (list t group gnus-level-default-subscribed nil nil method) @@ -1983,7 +1983,7 @@ newsgroup." (gnus-message 5 "%sdone" mesg))))))) (defun gnus-read-active-file-2 (groups method) - "Read an active file for GROUPS in METHOD using gnus-retrieve-groups." + "Read an active file for GROUPS in METHOD using `gnus-retrieve-groups'." (when groups (save-excursion (set-buffer nntp-server-buffer) @@ -2716,7 +2716,7 @@ If FORCE is non-nil, the .newsrc file is read." (gnus-save-newsrc-file))) (defun gnus-gnus-to-quick-newsrc-format (&optional minimal name &rest specific-variables) - "Print Gnus variables such as gnus-newsrc-alist in lisp format." + "Print Gnus variables such as `gnus-newsrc-alist' in Lisp format." (princ ";; -*- emacs-lisp -*-\n") (if name (princ (format ";; %s\n" name)) @@ -2742,7 +2742,7 @@ If FORCE is non-nil, the .newsrc file is read." (stringp gnus-save-killed-list)) (gnus-strip-killed-list) gnus-killed-list)) - (variables + (variables (or specific-variables (if gnus-save-killed-list gnus-variable-list ;; Remove the `gnus-killed-list' from the list of variables @@ -3067,7 +3067,7 @@ If FORCE is non-nil, the .newsrc file is read." ;;;###autoload (defun gnus-declare-backend (name &rest abilities) - "Declare backend NAME with ABILITIES as a Gnus backend." + "Declare back end NAME with ABILITIES as a Gnus back end." (setq gnus-valid-select-methods (nconc gnus-valid-select-methods (list (apply 'list name abilities)))) @@ -3083,7 +3083,7 @@ If this variable is nil, don't do anything." default-directory))) (eval-and-compile -(defalias 'gnus-display-time-event-handler +(defalias 'gnus-display-time-event-handler (if (gnus-boundp 'display-time-timer) 'display-time-event-handler (lambda () "Does nothing as `display-time-timer' is not bound. diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 0865a10..0e1a462 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -1108,7 +1108,7 @@ type of files to save." (defcustom gnus-read-all-available-headers nil "Whether Gnus should parse all headers made available to it. -This is mostly relevant for slow backends where the user may +This is mostly relevant for slow back ends where the user may wish to widen the summary buffer to include all headers that were fetched. Say, for nnultimate groups." :group 'gnus-summary @@ -3274,7 +3274,7 @@ buffer that was in action when the last article was fetched." gnus-unseen-mark) (t gnus-no-mark))) (gnus-tmp-downloaded - (cond (undownloaded + (cond (undownloaded gnus-undownloaded-mark) (gnus-newsgroup-agentized gnus-downloaded-mark) @@ -3650,7 +3650,7 @@ If SHOW-ALL is non-nil, already read articles are also listed." (gnus-run-hooks 'gnus-summary-prepare-hook))) (defsubst gnus-general-simplify-subject (subject) - "Simply subject by the same rules as gnus-gather-threads-by-subject." + "Simplify subject by the same rules as `gnus-gather-threads-by-subject'." (setq subject (cond ;; Truncate the subject. @@ -4086,7 +4086,7 @@ the id of the parent article (if any)." (forward-line 1))))))) (defun gnus-summary-update-article-line (article header) - "Update the line for ARTICLE using HEADERS." + "Update the line for ARTICLE using HEADER." (let* ((id (mail-header-id header)) (thread (gnus-id-to-thread id))) (unless thread @@ -4102,7 +4102,7 @@ the id of the parent article (if any)." (let ((inserted (- (point) (progn (gnus-summary-insert-line - header level nil + header level nil (memq article gnus-newsgroup-undownloaded) (gnus-article-mark article) (memq article gnus-newsgroup-replied) @@ -4129,7 +4129,7 @@ the id of the parent article (if any)." (point))))) (when (cdr datal) (gnus-data-update-list - (cdr datal) + (cdr datal) (- (gnus-data-pos data) (gnus-data-pos (cadr datal)) inserted))))))) (defun gnus-summary-update-article (article &optional iheader) @@ -4821,7 +4821,7 @@ or a straight list of headers." gnus-unseen-mark) (t gnus-no-mark)) gnus-tmp-downloaded - (cond ((memq number gnus-newsgroup-undownloaded) + (cond ((memq number gnus-newsgroup-undownloaded) gnus-undownloaded-mark) (gnus-newsgroup-agentized gnus-downloaded-mark) @@ -5030,7 +5030,7 @@ If SELECT-ARTICLES, only select those articles from GROUP." (gnus-set-active group (cons (caar alist) (cdr active))))) (setq gnus-summary-use-undownloaded-faces - (not (gnus-agent-find-parameter + (not (gnus-agent-find-parameter group 'agent-disable-undownloaded-faces)))) @@ -5347,7 +5347,7 @@ If SELECT-ARTICLES, only select those articles from GROUP." 'list)) (defun gnus-article-unpropagatable-p (mark) - "Return whether MARK should be propagated to backend." + "Return whether MARK should be propagated to back end." (memq mark gnus-article-unpropagated-mark-lists)) (defun gnus-adjust-marked-articles (info) @@ -6114,7 +6114,7 @@ If EXCLUDE-GROUP, do not go to this group." (if unread (progn (while data - (unless (memq (gnus-data-number (car data)) + (unless (memq (gnus-data-number (car data)) (cond ((eq gnus-auto-goto-ignores 'always-undownloaded) @@ -6364,7 +6364,7 @@ displayed, no centering will be performed." (defun gnus-summary-toggle-truncation (&optional arg) "Toggle truncation of summary lines. -With arg, turn line truncation on if arg is positive." +With ARG, turn line truncation on if ARG is positive." (interactive "P") (setq truncate-lines (if (null arg) (not truncate-lines) @@ -6834,7 +6834,7 @@ If prefix argument NO-ARTICLE is non-nil, no article is selected initially." "Go to the first subject satisfying any non-nil constraint. If UNREAD is non-nil, the article should be unread. If UNDOWNLOADED is non-nil, the article should be undownloaded. -If UNSEED is non-nil, the article should be unseen. +If UNSEEN is non-nil, the article should be unseen. Returns the article selected or nil if there are no matching articles." (interactive "P") (cond @@ -6859,7 +6859,7 @@ Returns the article selected or nil if there are no matching articles." (and unseen (memq num gnus-newsgroup-unseen))))))) (setq data (cdr data))) - (prog1 + (prog1 (if data (progn (goto-char (gnus-data-pos (car data))) @@ -7704,7 +7704,7 @@ article." (gnus-summary-position-point)))) (defun gnus-summary-insert-dormant-articles () - "Insert all the dormat articles for this group into the current buffer." + "Insert all the dormant articles for this group into the current buffer." (interactive) (let ((gnus-verbose (max 6 gnus-verbose))) (if (not gnus-newsgroup-dormant) @@ -7857,7 +7857,7 @@ If ALL, mark even excluded ticked and dormants as read." thread) (defun gnus-cut-threads (threads) - "Cut off all uninteresting articles from the beginning of threads." + "Cut off all uninteresting articles from the beginning of THREADS." (when (or (eq gnus-fetch-old-headers 'some) (eq gnus-fetch-old-headers 'invisible) (numberp gnus-fetch-old-headers) @@ -8091,7 +8091,7 @@ of what's specified by the `gnus-refer-thread-limit' variable." gnus-newsgroup-name limit)) 'nov) (gnus-build-all-threads) - (error "Can't fetch thread from backends that don't support NOV")) + (error "Can't fetch thread from back ends that don't support NOV")) (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name)) (gnus-summary-limit-include-thread id))) @@ -9115,9 +9115,9 @@ ACTION can be either `move' (the default), `crosspost' or `copy'." article gnus-newsgroup-name (current-buffer)))) ;; run the move/copy/crosspost/respool hook - (run-hook-with-args 'gnus-summary-article-move-hook + (run-hook-with-args 'gnus-summary-article-move-hook action - (gnus-data-header + (gnus-data-header (assoc article (gnus-data-list nil))) gnus-newsgroup-name to-newsgroup @@ -9404,7 +9404,7 @@ confirmation before the articles are deleted." (unless (memq (car articles) not-deleted) (gnus-summary-mark-article (car articles) gnus-canceled-mark)) (let* ((article (car articles)) - (id (mail-header-id (gnus-data-header + (id (mail-header-id (gnus-data-header (assoc article (gnus-data-list nil)))))) (run-hook-with-args 'gnus-summary-article-delete-hook 'delete id gnus-newsgroup-name nil @@ -9974,7 +9974,7 @@ If NO-EXPIRE, auto-expiry will be inhibited." (defun gnus-summary-update-download-mark (article) "Update the download mark." (gnus-summary-update-mark - (cond ((memq article gnus-newsgroup-undownloaded) + (cond ((memq article gnus-newsgroup-undownloaded) gnus-undownloaded-mark) (gnus-newsgroup-agentized gnus-downloaded-mark) @@ -11295,7 +11295,7 @@ If REVERSE, save parts that do not match TYPE." (defvar gnus-summary-highlight-line-trigger nil) (defun gnus-summary-highlight-line-0 () - (if (and (eq gnus-summary-highlight-line-trigger + (if (and (eq gnus-summary-highlight-line-trigger gnus-summary-highlight) gnus-summary-highlight-line-cached) gnus-summary-highlight-line-cached diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index db33e14..e69c753 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -164,7 +164,7 @@ ;; It's harmless, though, so the main purpose of this alias is to shut ;; up the byte compiler. (defalias 'gnus-make-local-hook - (if (eq (get 'make-local-hook 'byte-compile) + (if (eq (get 'make-local-hook 'byte-compile) 'byte-compile-obsolete) 'ignore ; Emacs 'make-local-hook)) ; XEmacs @@ -368,18 +368,18 @@ is slower." ;; the full date if it's older) (defun gnus-seconds-today () - "Returns the number of seconds passed today" + "Return the number of seconds passed today." (let ((now (decode-time (current-time)))) (+ (car now) (* (car (cdr now)) 60) (* (car (nthcdr 2 now)) 3600)))) (defun gnus-seconds-month () - "Returns the number of seconds passed this month" + "Return the number of seconds passed this month." (let ((now (decode-time (current-time)))) (+ (car now) (* (car (cdr now)) 60) (* (car (nthcdr 2 now)) 3600) (* (- (car (nthcdr 3 now)) 1) 3600 24)))) (defun gnus-seconds-year () - "Returns the number of seconds passed this year" + "Return the number of seconds passed this year." (let ((now (decode-time (current-time))) (days (format-time-string "%j" (current-time)))) (+ (car now) (* (car (cdr now)) 60) (* (car (nthcdr 2 now)) 3600) @@ -410,7 +410,7 @@ seconds passed since the start of today, of this month, of this year, respectively.") (defun gnus-user-date (messy-date) - "Format the messy-date acording to gnus-user-date-format-alist. + "Format the messy-date according to gnus-user-date-format-alist. Returns \" ? \" if there's bad input or if an other error occurs. Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"." (condition-case () @@ -615,7 +615,7 @@ If N, return the Nth ancestor instead." gname))) (defun gnus-make-sort-function (funs) - "Return a composite sort condition based on the functions in FUNC." + "Return a composite sort condition based on the functions in FUNS." (cond ;; Just a simple function. ((functionp funs) funs) @@ -632,7 +632,7 @@ If N, return the Nth ancestor instead." (car funs)))) (defun gnus-make-sort-function-1 (funs) - "Return a composite sort condition based on the functions in FUNC." + "Return a composite sort condition based on the functions in FUNS." (let ((function (car funs)) (first 't1) (last 't2)) @@ -983,7 +983,7 @@ with potentially long computations." (insert "\^_"))) (defun gnus-map-function (funs arg) - "Applies the result of the first function in FUNS to the second, and so on. + "Apply the result of the first function in FUNS to the second, and so on. ARG is passed to the first function." (while funs (setq arg (funcall (pop funs) arg))) @@ -1040,7 +1040,7 @@ Return the modified alist." `(setq ,alist (delq (,fun ,key ,alist) ,alist)))) (defun gnus-globalify-regexp (re) - "Returns a regexp that matches a whole line, iff RE matches a part of it." + "Return a regexp that matches a whole line, iff RE matches a part of it." (concat (unless (string-match "^\\^" re) "^.*") re (unless (string-match "\\$$" re) ".*$"))) @@ -1285,8 +1285,8 @@ SPEC is a predicate specifier that contains stuff like `or', `and', (t (list 'local-map map)))) -(defmacro gnus-completing-read-maybe-default (prompt table &optional predicate - require-match initial-contents +(defmacro gnus-completing-read-maybe-default (prompt table &optional predicate + require-match initial-contents history default) "Like `completing-read', allowing for non-existent 7th arg in older XEmacsen." `(completing-read ,prompt ,table ,predicate ,require-match diff --git a/lisp/gnus.el b/lisp/gnus.el index 7265a2e..9ae59fe 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1332,7 +1332,7 @@ If the default site is too slow, try one of these: ("dk" . (concat "http://www.usenet.dk/grupper.pl?get=" name)) ("england" . (concat "http://england.news-admin.org/charters/" name)) ("fr" . (concat "http://www.usenet-fr.net/fur/chartes/" name ".html")) - ("europa" . (concat "http://www.europa.usenet.eu.org/chartas/charta-en-" + ("europa" . (concat "http://www.europa.usenet.eu.org/chartas/charta-en-" (gnus-replace-in-string name "europa\\." "") ".html")) ("nl" . (concat "http://www.xs4all.nl/~sister/usenet/charters/" name)) ("aus" . (concat "http://aus.news-admin.org/groupinfo.php/" name)) @@ -1342,12 +1342,12 @@ If the default site is too slow, try one of these: ("uk" . (concat "http://www.usenet.org.uk/" name ".html")) ("wales" . (concat "http://www.wales-usenet.org/english/groups/" name ".html")) ("dfw" . (concat "http://www.cirr.com/dfw/charters/" name ".html")) - ("se" . (concat "http://www.usenet-se.net/Reglementen/" + ("se" . (concat "http://www.usenet-se.net/Reglementen/" (gnus-replace-in-string name "\\." "_") ".html")) - ("milw" . (concat "http://usenet.mil.wi.us/" + ("milw" . (concat "http://usenet.mil.wi.us/" (gnus-replace-in-string name "milw\\." "") "-charter")) ("ca" . (concat "http://www.sbay.org/ca/charter-" name ".html")) - ("netins" . (concat "http://www.netins.net/usenet/charter/" + ("netins" . (concat "http://www.netins.net/usenet/charter/" (gnus-replace-in-string name "\\." "-") "-charter.html"))) "*An alist of (HIERARCHY . FORM) pairs used to construct the URL of a charter. When FORM is evaluated `name' is bound to the name of the group." @@ -1484,7 +1484,7 @@ It calls `gnus-summary-expire-articles' by default." :type 'hook) (defcustom gnus-novice-user t - "*Non-nil means that you are a usenet novice. + "*Non-nil means that you are a Usenet novice. If non-nil, verbose messages may be displayed and confirmations may be required." :group 'gnus-meta @@ -1615,7 +1615,7 @@ If this variable is nil, screen refresh may be quicker." (defcustom gnus-mode-non-string-length nil "*Max length of mode-line non-string contents. If this is nil, Gnus will take space as is needed, leaving the rest -of the modeline intact. Note that the default of nil is unlikely +of the mode line intact. Note that the default of nil is unlikely to be desirable; see the manual for further details." :group 'gnus-various :type '(choice (const nil) @@ -1813,7 +1813,7 @@ total number of articles in the group.") ;; group parameters for spam processing added by Ted Zlatanov (defcustom gnus-install-group-spam-parameters t - "*Disable the group parameters for spam detection. + "*Disable the group parameters for spam detection. Enable if `G c' in XEmacs is giving you trouble, and make sure to submit a bug report." :type 'boolean :group 'gnus-start) @@ -1848,7 +1848,7 @@ regexps that should match all groups in which to do automatic spam tagging, associated with a classification (spam, ham, or neither). This only makes sense for mail groups." :variable-group spam - :variable-type '(repeat + :variable-type '(repeat (list :tag "Group contents spam/ham classification" (regexp :tag "Group") (choice @@ -1909,7 +1909,7 @@ Only applicable to non-spam (unclassified and ham) groups.") Only applicable to non-spam (unclassified and ham) groups.") (defvar gnus-group-ham-exit-processor-spamoracle "spamoracle-ham" - "The spamoracle summary exit ham processor. + "The spamoracle summary exit ham processor. Only applicable to non-spam (unclassified and ham) groups.") (gnus-define-group-parameter @@ -1918,7 +1918,7 @@ Only applicable to non-spam (unclassified and ham) groups.") :parameter-type '(choice :tag "Spam Summary Exit Processor" :value nil (list :tag "Spam Summary Exit Processor Choices" - (set + (set (variable-item gnus-group-spam-exit-processor-ifile) (variable-item gnus-group-spam-exit-processor-stat) (variable-item gnus-group-spam-exit-processor-bogofilter) @@ -1942,9 +1942,9 @@ a backend on summary exit. If non-nil, this should be a list of group name regexps that should match all groups in which to do automatic spam processing, associated with the appropriate processor." :variable-group spam - :variable-type '(repeat :tag "Spam/Ham Processors" + :variable-type '(repeat :tag "Spam/Ham Processors" (list :tag "Spam Summary Exit Processor Choices" - (regexp :tag "Group Regexp") + (regexp :tag "Group Regexp") (set :tag "Spam/Ham Summary Exit Processor" (variable-item gnus-group-spam-exit-processor-ifile) (variable-item gnus-group-spam-exit-processor-stat) @@ -1977,11 +1977,11 @@ to do spam-processed article moving, associated with the destination group or nil for explicit expiration. This only makes sense for mail groups." :variable-group spam - :variable-type '(repeat - :tag "Spam-processed articles destination" + :variable-type '(repeat + :tag "Spam-processed articles destination" (list - (regexp :tag "Group Regexp") - (choice + (regexp :tag "Group Regexp") + (choice :tag "Destination for spam-processed articles at summary exit" (string :tag "Move to a group") (const :tag "Expire" nil)))) @@ -1990,7 +1990,7 @@ mail groups." (gnus-define-group-parameter ham-process-destination - :parameter-type '(choice + :parameter-type '(choice :tag "Destination for ham articles at summary exit from a spam group" (string :tag "Move to a group") (const :tag "Do nothing" nil)) @@ -2006,22 +2006,22 @@ to do ham article moving, associated with the destination group or nil for explicit ignoring. This only makes sense for mail groups, and only works in spam groups." :variable-group spam - :variable-type '(repeat - :tag "Ham articles destination" + :variable-type '(repeat + :tag "Ham articles destination" (list - (regexp :tag "Group Regexp") - (choice + (regexp :tag "Group Regexp") + (choice :tag "Destination for ham articles at summary exit from spam group" (string :tag "Move to a group") (const :tag "Expire" nil)))) :parameter-document "Where ham articles will go at summary exit from a spam group.") - (gnus-define-group-parameter + (gnus-define-group-parameter ham-marks :type 'list :parameter-type '(list :tag "Ham mark choices" - (set + (set (variable-item gnus-del-mark) (variable-item gnus-read-mark) (variable-item gnus-killed-mark) @@ -2032,20 +2032,20 @@ mail groups, and only works in spam groups." "Marks considered ham (positively not spam). Such articles will be processed as ham (non-spam) on group exit. When nil, the global spam-ham-marks variable takes precedence." - :variable-default '((".*" ((gnus-del-mark + :variable-default '((".*" ((gnus-del-mark gnus-read-mark - gnus-killed-mark + gnus-killed-mark gnus-kill-file-mark gnus-low-score-mark)))) :variable-group spam :variable-document "*Groups in which to explicitly set the ham marks to some value.") - (gnus-define-group-parameter + (gnus-define-group-parameter spam-marks :type 'list :parameter-type '(list :tag "Spam mark choices" - (set + (set (variable-item gnus-spam-mark) (variable-item gnus-killed-mark) (variable-item gnus-kill-file-mark) @@ -2205,8 +2205,8 @@ covered by that variable." "Whether we want to use the Gnus agent or not. You may customize gnus-agent to disable its use. However, some -backends have started to use the agent as a client-side cache. -Disabling the agent may result in noticable loss of performance." +back ends have started to use the agent as a client-side cache. +Disabling the agent may result in noticeable loss of performance." :version "21.3" :group 'gnus-agent :type 'boolean) @@ -2408,20 +2408,20 @@ It has an effect on the values of `gnus-*-line-format-spec'." (defvar gnus-newsrc-alist nil "Assoc list of read articles. -gnus-newsrc-hashtb should be kept so that both hold the same information.") +`gnus-newsrc-hashtb' should be kept so that both hold the same information.") (defvar gnus-registry-alist nil "Assoc list of registry data. gnus-registry.el will populate this if it's loaded.") (defvar gnus-newsrc-hashtb nil - "Hashtable of gnus-newsrc-alist.") + "Hashtable of `gnus-newsrc-alist'.") (defvar gnus-killed-list nil "List of killed newsgroups.") (defvar gnus-killed-hashtb nil - "Hash table equivalent of gnus-killed-list.") + "Hash table equivalent of `gnus-killed-list'.") (defvar gnus-zombie-list nil "List of almost dead newsgroups.") @@ -3319,8 +3319,7 @@ server is native)." group))) (defun gnus-group-full-name (group method) - "Return the full name from GROUP and METHOD, even if the method is -native." + "Return the full name from GROUP and METHOD, even if the method is native." (gnus-group-prefixed-name group method t)) (defun gnus-group-guess-full-name (group) diff --git a/lisp/imap.el b/lisp/imap.el index 2abeee6..76d53ab 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -426,6 +426,10 @@ sure of changing the value of `foo'." (setcdr alist (imap-remassoc key (cdr alist))) alist))) +(defmacro imap-disable-multibyte () + "Enable multibyte in the current buffer." + '(set-buffer-multibyte nil)) + (defsubst imap-utf7-encode (string) (if imap-use-utf7 (and string @@ -509,6 +513,7 @@ sure of changing the value of `foo'." (sit-for 1)) (and imap-log (with-current-buffer (get-buffer-create imap-log-buffer) + (imap-disable-multibyte) (buffer-disable-undo) (goto-char (point-max)) (insert-buffer-substring buffer))) @@ -572,6 +577,7 @@ sure of changing the value of `foo'." (sit-for 1)) (and imap-log (with-current-buffer (get-buffer-create imap-log-buffer) + (imap-disable-multibyte) (buffer-disable-undo) (goto-char (point-max)) (insert-buffer-substring buffer))) @@ -621,6 +627,7 @@ sure of changing the value of `foo'." (sit-for 1)) (and imap-log (with-current-buffer (get-buffer-create imap-log-buffer) + (imap-disable-multibyte) (buffer-disable-undo) (goto-char (point-max)) (insert-buffer-substring buffer))) @@ -650,7 +657,7 @@ sure of changing the value of `foo'." (sit-for 1)) (and imap-log (with-current-buffer (get-buffer-create imap-log-buffer) - (set-buffer-multibyte nil) + (imap-disable-multibyte) (buffer-disable-undo) (goto-char (point-max)) (insert-buffer-substring buffer))) @@ -672,6 +679,7 @@ sure of changing the value of `foo'." (sit-for 1)) (and imap-log (with-current-buffer (get-buffer-create imap-log-buffer) + (imap-disable-multibyte) (buffer-disable-undo) (goto-char (point-max)) (insert-buffer-substring buffer))) @@ -709,6 +717,7 @@ sure of changing the value of `foo'." (sit-for 1)) (and imap-log (with-current-buffer (get-buffer-create imap-log-buffer) + (imap-disable-multibyte) (buffer-disable-undo) (goto-char (point-max)) (insert-buffer-substring buffer))) @@ -942,7 +951,7 @@ necessary. If nil, the buffer name is generated." (if (imap-opened buffer) (imap-close buffer)) (mapcar 'make-local-variable imap-local-variables) - (set-buffer-multibyte nil) + (imap-disable-multibyte) (buffer-disable-undo) (setq imap-server (or server imap-server)) (setq imap-port (or port imap-port)) @@ -965,7 +974,7 @@ necessary. If nil, the buffer name is generated." (with-current-buffer (get-buffer-create (generate-new-buffer-name " *temp*")) (mapcar 'make-local-variable imap-local-variables) - (set-buffer-multibyte nil) + (imap-disable-multibyte) (buffer-disable-undo) (setq imap-server (or server imap-server)) (setq imap-port (or port imap-port)) @@ -1650,6 +1659,7 @@ on failure." (setq cmdstr (concat cmdstr imap-client-eol)) (and imap-log (with-current-buffer (get-buffer-create imap-log-buffer) + (imap-disable-multibyte) (buffer-disable-undo) (goto-char (point-max)) (insert cmdstr))) @@ -1685,7 +1695,7 @@ on failure." (imap-send-command-1 cmdstr) (setq cmdstr nil) (if (not (eq (imap-wait-for-tag tag) 'INCOMPLETE)) - (setq command nil);; abort command if no cont-req + (setq command nil) ;; abort command if no cont-req (let ((process imap-process) (stream imap-stream) (eol imap-client-eol)) @@ -1693,6 +1703,7 @@ on failure." (and imap-log (with-current-buffer (get-buffer-create imap-log-buffer) + (imap-disable-multibyte) (buffer-disable-undo) (goto-char (point-max)) (insert-buffer-substring cmd))) @@ -1705,7 +1716,7 @@ on failure." (setq cmdstr nil) (unwind-protect (if (not (eq (imap-wait-for-tag tag) 'INCOMPLETE)) - (setq command nil);; abort command if no cont-req + (setq command nil) ;; abort command if no cont-req (setq command (cons (funcall cmd imap-continuation) command))) (setq imap-continuation nil))) @@ -1731,15 +1742,13 @@ on failure." (truncate (* (- imap-read-timeout (truncate imap-read-timeout)) 1000))))) - ;; Maybe the process has died, but the remote end wants to send - ;; some more stuff. + ;; A process can die _before_ we have processed everything it + ;; has to say. Moreover, this can happen in between the call to + ;; accept-process-output and the call to process-status in an + ;; iteration of the loop above. (when (and (null imap-continuation) (< imap-reached-tag tag)) - (accept-process-output imap-process - (truncate imap-read-timeout) - (truncate (* (- imap-read-timeout - (truncate imap-read-timeout)) - 1000)))) + (accept-process-output imap-process 0 0)) (when imap-have-messaged (message "")) (and (memq (process-status imap-process) '(open run)) @@ -1766,33 +1775,37 @@ Return nil if no complete line has arrived." (defun imap-arrival-filter (proc string) "IMAP process filter." - (with-current-buffer (process-buffer proc) - (goto-char (point-max)) - (insert string) - (and imap-log - (with-current-buffer (get-buffer-create imap-log-buffer) - (buffer-disable-undo) - (goto-char (point-max)) - (insert string))) - (let (end) - (goto-char (point-min)) - (while (setq end (imap-find-next-line)) - (save-restriction - (narrow-to-region (point-min) end) - (delete-backward-char (length imap-server-eol)) - (goto-char (point-min)) - (unwind-protect - (cond ((eq imap-state 'initial) - (imap-parse-greeting)) - ((or (eq imap-state 'auth) - (eq imap-state 'nonauth) - (eq imap-state 'selected) - (eq imap-state 'examine)) - (imap-parse-response)) - (t - (message "Unknown state %s in arrival filter" - imap-state))) - (delete-region (point-min) (point-max)))))))) + ;; Sometimes, we are called even though the process has died. + ;; Better abstain from doing stuff in that case. + (when (process-buffer proc) + (with-current-buffer (process-buffer proc) + (goto-char (point-max)) + (insert string) + (and imap-log + (with-current-buffer (get-buffer-create imap-log-buffer) + (imap-disable-multibyte) + (buffer-disable-undo) + (goto-char (point-max)) + (insert string))) + (let (end) + (goto-char (point-min)) + (while (setq end (imap-find-next-line)) + (save-restriction + (narrow-to-region (point-min) end) + (delete-backward-char (length imap-server-eol)) + (goto-char (point-min)) + (unwind-protect + (cond ((eq imap-state 'initial) + (imap-parse-greeting)) + ((or (eq imap-state 'auth) + (eq imap-state 'nonauth) + (eq imap-state 'selected) + (eq imap-state 'examine)) + (imap-parse-response)) + (t + (message "Unknown state %s in arrival filter" + imap-state))) + (delete-region (point-min) (point-max))))))))) ;; Imap parser. @@ -2418,31 +2431,31 @@ Return nil if no complete line has arrived." (defun imap-parse-envelope () (when (eq (char-after) ?\() (imap-forward) - (vector (prog1 (imap-parse-nstring);; date + (vector (prog1 (imap-parse-nstring) ;; date (imap-forward)) - (prog1 (imap-parse-nstring);; subject + (prog1 (imap-parse-nstring) ;; subject (imap-forward)) - (prog1 (imap-parse-address-list);; from + (prog1 (imap-parse-address-list) ;; from (imap-forward)) - (prog1 (imap-parse-address-list);; sender + (prog1 (imap-parse-address-list) ;; sender (imap-forward)) - (prog1 (imap-parse-address-list);; reply-to + (prog1 (imap-parse-address-list) ;; reply-to (imap-forward)) - (prog1 (imap-parse-address-list);; to + (prog1 (imap-parse-address-list) ;; to (imap-forward)) - (prog1 (imap-parse-address-list);; cc + (prog1 (imap-parse-address-list) ;; cc (imap-forward)) - (prog1 (imap-parse-address-list);; bcc + (prog1 (imap-parse-address-list) ;; bcc (imap-forward)) - (prog1 (imap-parse-nstring);; in-reply-to + (prog1 (imap-parse-nstring) ;; in-reply-to (imap-forward)) - (prog1 (imap-parse-nstring);; message-id + (prog1 (imap-parse-nstring) ;; message-id (imap-forward))))) ;; body-fld-param = "(" string SP string *(SP string SP string) ")" / nil (defsubst imap-parse-string-list () - (cond ((eq (char-after) ?\();; body-fld-param + (cond ((eq (char-after) ?\() ;; body-fld-param (let (strlist str) (imap-forward) (while (setq str (imap-parse-string)) @@ -2490,7 +2503,7 @@ Return nil if no complete line has arrived." (defsubst imap-parse-body-ext () (let (ext) - (when (eq (char-after) ?\ );; body-fld-dsp + (when (eq (char-after) ?\ ) ;; body-fld-dsp (imap-forward) (let (dsp) (if (eq (char-after) ?\() @@ -2502,12 +2515,12 @@ Return nil if no complete line has arrived." (imap-forward)) (assert (imap-parse-nil) t "In imap-parse-body-ext")) (push (nreverse dsp) ext)) - (when (eq (char-after) ?\ );; body-fld-lang + (when (eq (char-after) ?\ ) ;; body-fld-lang (imap-forward) (if (eq (char-after) ?\() (push (imap-parse-string-list) ext) (push (imap-parse-nstring) ext)) - (while (eq (char-after) ?\ );; body-extension + (while (eq (char-after) ?\ ) ;; body-extension (imap-forward) (setq ext (append (imap-parse-body-extension) ext))))) ext)) @@ -2588,38 +2601,38 @@ Return nil if no complete line has arrived." (imap-forward)) (push subbody body)) (imap-forward) - (push (imap-parse-string) body);; media-subtype - (when (eq (char-after) ?\ );; body-ext-mpart: + (push (imap-parse-string) body) ;; media-subtype + (when (eq (char-after) ?\ ) ;; body-ext-mpart: (imap-forward) - (if (eq (char-after) ?\();; body-fld-param + (if (eq (char-after) ?\() ;; body-fld-param (push (imap-parse-string-list) body) (push (and (imap-parse-nil) nil) body)) (setq body - (append (imap-parse-body-ext) body)));; body-ext-... + (append (imap-parse-body-ext) body))) ;; body-ext-... (assert (eq (char-after) ?\)) t "In imap-parse-body") (imap-forward) (nreverse body)) - (push (imap-parse-string) body);; media-type + (push (imap-parse-string) body) ;; media-type (imap-forward) - (push (imap-parse-string) body);; media-subtype + (push (imap-parse-string) body) ;; media-subtype (imap-forward) ;; next line for Sun SIMS bug (and (eq (char-after) ? ) (imap-forward)) - (if (eq (char-after) ?\();; body-fld-param + (if (eq (char-after) ?\() ;; body-fld-param (push (imap-parse-string-list) body) (push (and (imap-parse-nil) nil) body)) (imap-forward) - (push (imap-parse-nstring) body);; body-fld-id + (push (imap-parse-nstring) body) ;; body-fld-id (imap-forward) - (push (imap-parse-nstring) body);; body-fld-desc + (push (imap-parse-nstring) body) ;; body-fld-desc (imap-forward) ;; next `or' for Sun SIMS bug, it regard body-fld-enc as a ;; nstring and return nil instead of defaulting back to 7BIT ;; as the standard says. - (push (or (imap-parse-nstring) "7BIT") body);; body-fld-enc + (push (or (imap-parse-nstring) "7BIT") body) ;; body-fld-enc (imap-forward) - (push (imap-parse-number) body);; body-fld-octets + (push (imap-parse-number) body) ;; body-fld-octets ;; ok, we're done parsing the required parts, what comes now is one ;; of three things: @@ -2634,27 +2647,27 @@ Return nil if no complete line has arrived." (when (eq (char-after) ?\ ) (imap-forward) (let (lines) - (cond ((eq (char-after) ?\();; body-type-msg: - (push (imap-parse-envelope) body);; envelope + (cond ((eq (char-after) ?\() ;; body-type-msg: + (push (imap-parse-envelope) body) ;; envelope (imap-forward) - (push (imap-parse-body) body);; body + (push (imap-parse-body) body) ;; body ;; buggy stalker communigate pro 3.0 doesn't print ;; number of lines in message/rfc822 attachment (if (eq (char-after) ?\)) (push 0 body) (imap-forward) (push (imap-parse-number) body))) ;; body-fld-lines - ((setq lines (imap-parse-number)) ;; body-type-text: - (push lines body)) ;; body-fld-lines + ((setq lines (imap-parse-number)) ;; body-type-text: + (push lines body)) ;; body-fld-lines (t - (backward-char))))) ;; no match... + (backward-char))))) ;; no match... ;; ...and then parse the third one here... - (when (eq (char-after) ?\ );; body-ext-1part: + (when (eq (char-after) ?\ ) ;; body-ext-1part: (imap-forward) - (push (imap-parse-nstring) body);; body-fld-md5 - (setq body (append (imap-parse-body-ext) body)));; body-ext-1part.. + (push (imap-parse-nstring) body) ;; body-fld-md5 + (setq body (append (imap-parse-body-ext) body))) ;; body-ext-1part.. (assert (eq (char-after) ?\)) t "In imap-parse-body 2") (imap-forward) -- 1.7.10.4