summaryrefslogtreecommitdiff
path: root/lisp/gnus
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-09-03 16:03:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-09-03 16:03:38 -0700
commitb49e353d9d01adbe60bc5d0b1658b4ef978b0b06 (patch)
tree9f2ffa6f7a6562abf661a4951012b488ad8b1ae7 /lisp/gnus
parent74b880cbc18bd0194c7b1fc44c4a983ee05adae2 (diff)
parentbc3200871917d5c54c8c4299a06bf8f8ba2ea02d (diff)
downloademacs-b49e353d9d01adbe60bc5d0b1658b4ef978b0b06.tar.gz
Merge from trunk.
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/ChangeLog223
-rw-r--r--lisp/gnus/auth-source.el4
-rw-r--r--lisp/gnus/gnus-agent.el2
-rw-r--r--lisp/gnus/gnus-art.el13
-rw-r--r--lisp/gnus/gnus-ems.el5
-rw-r--r--lisp/gnus/gnus-group.el51
-rw-r--r--lisp/gnus/gnus-html.el15
-rw-r--r--lisp/gnus/gnus-msg.el2
-rw-r--r--lisp/gnus/gnus-score.el10
-rw-r--r--lisp/gnus/gnus-spec.el21
-rw-r--r--lisp/gnus/gnus-sum.el117
-rw-r--r--lisp/gnus/gnus-util.el66
-rw-r--r--lisp/gnus/gnus.el2
-rw-r--r--lisp/gnus/mailcap.el2
-rw-r--r--lisp/gnus/message.el20
-rw-r--r--lisp/gnus/mml-smime.el2
-rw-r--r--lisp/gnus/mml1991.el94
-rw-r--r--lisp/gnus/mml2015.el2
-rw-r--r--lisp/gnus/nndraft.el2
-rw-r--r--lisp/gnus/nnimap.el22
-rw-r--r--lisp/gnus/nnir.el36
-rw-r--r--lisp/gnus/nnmail.el33
-rw-r--r--lisp/gnus/nnmaildir.el3
-rw-r--r--lisp/gnus/nnmairix.el23
-rw-r--r--lisp/gnus/nntp.el5
-rw-r--r--lisp/gnus/pop3.el2
-rw-r--r--lisp/gnus/spam.el50
-rw-r--r--lisp/gnus/starttls.el21
28 files changed, 578 insertions, 270 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index acdd1033933..ceac837bc55 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,226 @@
+2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * nnimap.el (nnimap-open-connection-1): Use the correct port number in
+ the error message.
+
+2011-09-02 Eli Zaretskii <eliz@gnu.org>
+
+ * message.el (message-setup-1): Return t (Bug#9392).
+
+2011-09-01 Andrew Cohen <cohen@andy.bu.edu>
+
+ * gnus-sum.el: When adding article headers to a summary buffer also
+ update gnus-newsgroup-articles (bug#9386).
+
+2011-08-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * auth-source.el: Autoload help-mode.
+
+2011-08-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-group.el (gnus-group-name-charset): Don't bug out on server
+ names.
+
+2011-08-27 Daiki Ueno <ueno@unixuser.org>
+
+ * mml-smime.el (mml-smime-epg-verify): Don't use the 4th arg of
+ mm-replace-in-string for compatibility issues.
+ * mml2015.el (mml2015-epg-verify): Ditto.
+
+2011-08-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mailcap.el (mailcap-mime-data): Regexp-quote MIME subtype.
+
+ * gnus-msg.el (gnus-setup-message): Remove extra apostrophe.
+
+2011-08-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * nnmail.el (nnmail-get-new-mail-1): If one mail source bugs out,
+ continue on and do the clean-up phase (bug#9188).
+
+ * gnus-sum.el (gnus-summary-expire-articles): When expiring articles,
+ just ignore groups that can't be opened instead of erroring out
+ (bug#9225).
+
+ * gnus-art.el (gnus-article-update-date-headers): Flip the default to
+ nil since some many people are fuddy-duddies.
+
+ * gnus-html.el (gnus-html-image-fetched): Don't cache zero-length
+ images.
+
+ * nntp.el (nntp-authinfo-file): Mark as obsolete -- use auth-source
+ instead.
+
+ * pop3.el (pop3-wait-for-messages): Don't use Gnus functions here.
+
+ * gnus-util.el (gnus-process-live-p): Copy over compat function.
+
+ * pop3.el (pop3-wait-for-messages): If the pop3 process dies, stop
+ processing.
+
+ * nntp.el (nntp-kill-buffer): Kill the process before killing the
+ buffer to avoid warnings.
+
+2011-08-20 Simon Josefsson <simon@josefsson.org>
+
+ * gnus-agent.el (gnus-agent-expire-done-message): Use %.f as format
+ specified to reduce precision.
+
+2011-08-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * nnimap.el (nnimap-transform-headers): Protect against (NIL ...)
+ bodystructures (bug#9314).
+
+2011-08-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-art.el (gnus-insert-mime-button, gnus-mime-display-alternative):
+ Make button keymap non-sticky after buttons.
+
+2011-08-18 David Engster <dengste@eml.cc>
+
+ * nnmairix.el (nnmairix-request-set-mark)
+ (nnmairix-goto-original-article): Remove adding of article to registry,
+ since `gnus-registry-add-group' isn't available anymore.
+ (nnmairix-determine-original-group-from-registry): Use
+ `gnus-registry-get-id-key' since `gnus-registry-fetch-groups' isn't
+ available anymore.
+
+2011-08-12 Simon Josefsson <simon@josefsson.org>
+
+ * starttls.el (starttls-any-program-available): Define as obsolete
+ function.
+
+2011-08-18 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-util.el (gnus-y-or-n-p): Reinstate the message-clearing y-or-n-p
+ versions which Gnus use when appropriate.
+
+ * gnus-group.el (gnus-group-clear-data): Add a y-or-n query, since it's
+ a pretty destructive command.
+
+ * nnmail.el (nnmail-extra-headers): Clarify slightly (bug#9302).
+
+2011-08-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * message.el (message-fix-before-sending): Make a different warning
+ about NUL characters (bug#9270).
+
+ * gnus-sum.el (gnus-auto-select-subject): Allow specifying a function
+ from custom (bug#9260).
+
+ * gnus-spec.el (gnus-lrm-string): Use 8206 instead of ?\x200e to make
+ things work in Emacs 22 and XEmacs, too.
+
+ * gnus-sum.el (gnus-summary-from-or-to-or-newsgroups): LRM-ify the
+ default From.
+
+ * gnus-spec.el (gnus-lrm-string-p): New macro.
+ (gnus-lrm-string): New constant.
+ (gnus-summary-line-format-spec): LRM-ify the from.
+ (gnus-tilde-max-form): LRM-ify string chopping.
+
+ * gnus-ems.el (gnus-string-mark-left-to-right): New function.
+
+ * message.el (message-is-yours-p): Allow disabling canlock checking
+ (bug#9295).
+ (message-shoot-gnksa-feet): Add `canlock-verify'.
+ (message-auto-save-directory): Use ~/ as the auto-save directory if the
+ message directory isn't writable (bug#9304).
+
+ * auth-source.el (auth-source-netrc-saver): Make the .authinfo file
+ non-world-readable.
+
+2011-08-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * nndraft.el (nndraft-update-unread-articles): Don't send delayed
+ articles.
+
+2011-08-13 Andreas Schwab <schwab@linux-m68k.org>
+
+ * gnus-score.el (gnus-all-score-files): Use copy-sequence instead of
+ copy-list.
+
+2011-08-12 Sam Steingold <sds@gnu.org>
+
+ * gnus-score.el (gnus-score-find-alist): Keep the score files already
+ in the reverse order to avoid modifying the cache with `nreverse'.
+ (gnus-all-score-files): Do not modify the value returned by
+ `gnus-score-find-alist' because it lives in a cache variable.
+ (gnus-current-home-score-file): No need to `nreverse' the return value
+ of `gnus-score-find-alist', it is already in the correct order.
+
+2011-08-11 Andrew Cohen <cohen@andy.bu.edu>
+
+ * nnimap.el (nnimap-transform-headers): BODYSTRUCTURE for messages of
+ type MESSAGE and subtype RFC822 is slightly different from those of
+ type TEXT.
+
+2011-08-05 Andrew Cohen <cohen@andy.bu.edu>
+
+ * gnus-sum.el (gnus-summary-refer-article): Warp to article. This
+ allows article-referral to work from an nnir group.
+
+2011-08-04 Andrew Cohen <cohen@andy.bu.edu>
+
+ * gnus.el (registry-ignore): Add nnir groups to the ignore-list.
+
+2011-08-04 Daiki Ueno <ueno@unixuser.org>
+
+ * mml1991.el (mml1991-epg-find-usable-key)
+ (mml1991-epg-find-usable-secret-key): New function.
+ (mml1991-epg-sign): Check if signing key is usable.
+ (mml1991-epg-encrypt): Check if encrypting key is usable (bug#8955).
+
+2011-08-03 Andrew Cohen <cohen@andy.bu.edu>
+
+ * nnir.el (nnir-read-server-parm): Add an argument to restrict to
+ server-variables only. This should fix a bug introduced with commit
+ e1889675b7f4adf057833c5513c9374134c4e053.
+ (nnir-run-query): 'nnir-search-engine should not be set from the global
+ environment.
+
+2011-08-02 Andrew Cohen <cohen@andy.bu.edu>
+
+ * nnir.el (nnir-search-thread): Position point on referring article
+ line.
+ (nnir-warp-to-article): Clean up summary buffers.
+
+ * nnimap.el (nnimap-request-thread): Whitespace fix.
+
+2011-08-02 Steve Purcell <steve@sanityinc.com> (tiny change)
+
+ * nnimap.el (nnimap-get-groups): Decode "&" correctly.
+
+2011-08-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * starttls.el (starttls-available-p): Renamed from
+ `starttls-any-program-available' and changed return convention.
+
+2011-07-31 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * nnmaildir.el (nnmaildir-request-accept-article): Don't call
+ `unix-sync' unless it's defined.
+
+2011-07-31 Marcus Harnisch <marcus.harnisch@gmx.net> (tiny change)
+
+ * gnus-art.el (gnus-article-stop-animations): Use `elt' instead of
+ `aref' for XEmacs compatibiltiy.
+
+2011-07-31 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * spam.el (spam-fetch-field-fast): Rewrite slightly for clarity.
+
+2011-07-31 Dave Abrahams <dave@boostpro.com> (tiny change)
+
+ * gnus-sum.el (gnus-summary-refer-thread): Since lambdas aren't
+ closures, quote the form properly (bug#9194).
+
+2011-07-31 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-sum.el (gnus-summary-insert-new-articles): Clean up slightly.
+ (gnus-summary-insert-new-articles): Protect against servers that are
+ down.
+
2011-07-29 Daniel Dehennin <daniel.dehennin@baby-gnu.org>
* mm-decode.el (mm-dissect-buffer): Add a default content-disposition
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el
index e249e97e826..74d69d0820c 100644
--- a/lisp/gnus/auth-source.el
+++ b/lisp/gnus/auth-source.el
@@ -70,6 +70,8 @@
(autoload 'epg-context-set-armor "epg")
(autoload 'epg-encrypt-string "epg")
+(autoload 'help-mode "help-mode" nil t)
+
(defvar secrets-enabled)
(defgroup auth-source nil
@@ -1377,6 +1379,8 @@ Respects `auth-source-save-behavior'. Uses
(insert "\n"))
(insert add "\n")
(write-region (point-min) (point-max) file nil 'silent)
+ ;; Make the .authinfo file non-world-readable.
+ (set-file-modes file #o600)
(auth-source-do-debug
"auth-source-netrc-create: wrote 1 new line to %s"
file)
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 424c55c40f5..26222119b98 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -3560,7 +3560,7 @@ articles in every agentized group? "))
units (cdr units)))
(format "Expiry recovered %d NOV entries, deleted %d files,\
- and freed %f %s."
+ and freed %.f %s."
(nth 0 stats)
(nth 1 stats)
size (car units)))
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index c29000f4691..eaf0ed52f51 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -1039,7 +1039,7 @@ Some of these headers are updated automatically. See
(item :tag "ISO8601 format" :value 'iso8601)
(item :tag "User-defined" :value 'user-defined)))
-(defcustom gnus-article-update-date-headers 1
+(defcustom gnus-article-update-date-headers nil
"A number that says how often to update the date header (in seconds).
If nil, don't update it at all."
:version "24.1"
@@ -4541,7 +4541,7 @@ commands:
(defun gnus-article-stop-animations ()
(dolist (timer (and (boundp 'timer-list)
timer-list))
- (when (eq (aref timer 5) 'image-animate-timeout)
+ (when (eq (elt timer 5) 'image-animate-timeout)
(cancel-timer timer))))
;; Set article window start at LINE, where LINE is the number of lines
@@ -5700,7 +5700,8 @@ all parts."
gnus-callback gnus-mm-display-part
gnus-part ,gnus-tmp-id
article-type annotation
- gnus-data ,handle))
+ gnus-data ,handle
+ rear-nonsticky t))
(setq e (if (bolp)
;; Exclude a newline.
(1- (point))
@@ -6013,7 +6014,8 @@ If displaying \"text/html\" is discouraged \(see
,gnus-mouse-face-prop ,gnus-article-mouse-face
face ,gnus-article-button-face
gnus-part ,id
- article-type multipart))
+ article-type multipart
+ rear-nonsticky t))
(widget-convert-button 'link from (point)
:action 'gnus-widget-press-button
:button-keymap gnus-widget-button-keymap)
@@ -6037,7 +6039,8 @@ If displaying \"text/html\" is discouraged \(see
,gnus-mouse-face-prop ,gnus-article-mouse-face
face ,gnus-article-button-face
gnus-part ,id
- gnus-data ,handle))
+ gnus-data ,handle
+ rear-nonsticky t))
(widget-convert-button 'link from (point)
:action 'gnus-widget-press-button
:button-keymap gnus-widget-button-keymap)
diff --git a/lisp/gnus/gnus-ems.el b/lisp/gnus/gnus-ems.el
index bc85e4960d4..aed471c38f4 100644
--- a/lisp/gnus/gnus-ems.el
+++ b/lisp/gnus/gnus-ems.el
@@ -209,6 +209,11 @@
(setq start end
end nil))))))
+(defmacro gnus-string-mark-left-to-right (string)
+ (if (fboundp 'string-mark-left-to-right)
+ `(string-mark-left-to-right ,string)
+ string))
+
(eval-and-compile
;; XEmacs does not have window-inside-pixel-edges
(defalias 'gnus-window-inside-pixel-edges
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 2a31ccd34f0..5cc01759a04 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1194,21 +1194,27 @@ The following commands are available:
(gnus-group-mode)))
(defun gnus-group-name-charset (method group)
- (if (null method)
- (setq method (gnus-find-method-for-group group)))
- (let ((item (or (assoc method gnus-group-name-charset-method-alist)
- (and (consp method)
- (assoc (list (car method) (cadr method))
- gnus-group-name-charset-method-alist))))
- (alist gnus-group-name-charset-group-alist)
- result)
- (if item
- (cdr item)
- (while (setq item (pop alist))
- (if (string-match (car item) group)
- (setq alist nil
- result (cdr item))))
- result)))
+ (unless method
+ (setq method (gnus-find-method-for-group group)))
+ (when (stringp method)
+ (setq method (gnus-server-to-method method)))
+ (if (eq (car method) 'nnimap)
+ ;; IMAP groups should not be encoded, since they do the encoding
+ ;; in utf7 in the protocol.
+ nil
+ (let ((item (or (assoc method gnus-group-name-charset-method-alist)
+ (and (consp method)
+ (assoc (list (car method) (cadr method))
+ gnus-group-name-charset-method-alist))))
+ (alist gnus-group-name-charset-group-alist)
+ result)
+ (if item
+ (cdr item)
+ (while (setq item (pop alist))
+ (if (string-match (car item) group)
+ (setq alist nil
+ result (cdr item))))
+ result))))
(defun gnus-group-name-decode (string charset)
;; Fixme: Don't decode in unibyte mode.
@@ -3471,13 +3477,14 @@ sort in reverse order."
"Clear all marks and read ranges from the current group.
Obeys the process/prefix convention."
(interactive "P")
- (gnus-group-iterate arg
- (lambda (group)
- (let (info)
- (gnus-info-clear-data (setq info (gnus-get-info group)))
- (gnus-get-unread-articles-in-group info (gnus-active group) t)
- (when (gnus-group-goto-group group)
- (gnus-group-update-group-line))))))
+ (when (gnus-y-or-n-p "Really clear data? ")
+ (gnus-group-iterate arg
+ (lambda (group)
+ (let (info)
+ (gnus-info-clear-data (setq info (gnus-get-info group)))
+ (gnus-get-unread-articles-in-group info (gnus-active group) t)
+ (when (gnus-group-goto-group group)
+ (gnus-group-update-group-line)))))))
(defun gnus-group-clear-data-on-native-groups ()
"Clear all marks and read ranges from all native groups."
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el
index d3da6aab1b7..f443c4021e2 100644
--- a/lisp/gnus/gnus-html.el
+++ b/lisp/gnus/gnus-html.el
@@ -399,15 +399,16 @@ Use ALT-TEXT for the image string."
(defun gnus-html-image-fetched (status buffer image)
"Callback function called when image has been fetched."
(unless (plist-get status :error)
- (when gnus-html-image-automatic-caching
- (url-store-in-cache (current-buffer)))
(when (and (or (search-forward "\n\n" nil t)
(search-forward "\r\n\r\n" nil t))
- (buffer-live-p buffer))
- (let ((data (buffer-substring (point) (point-max))))
- (with-current-buffer buffer
- (let ((inhibit-read-only t))
- (gnus-html-put-image data (car image) (cadr image)))))))
+ (not (eobp)))
+ (when gnus-html-image-automatic-caching
+ (url-store-in-cache (current-buffer)))
+ (when (buffer-live-p buffer)
+ (let ((data (buffer-substring (point) (point-max))))
+ (with-current-buffer buffer
+ (let ((inhibit-read-only t))
+ (gnus-html-put-image data (car image) (cadr image))))))))
(kill-buffer (current-buffer)))
(defun gnus-html-get-image-data (url)
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 9d3ec25c03a..d60c7165abd 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -435,7 +435,7 @@ Thank you for your help in stamping out bugs.
(progn
,@forms)
(gnus-inews-add-send-actions ,winconf ,buffer ,article ,config
- ,yanked ',winconf-name)
+ ,yanked ,winconf-name)
(setq gnus-message-buffer (current-buffer))
(set (make-local-variable 'gnus-message-group-art)
(cons ,group ,article))
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index 9bbfbfb057e..eb7234a811e 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -2834,8 +2834,7 @@ The list is determined from the variable `gnus-score-file-alist'."
;; handle the multiple match alist
(while alist
(when (string-match (caar alist) group)
- (setq score-files
- (nconc score-files (copy-sequence (cdar alist)))))
+ (setq score-files (append (cdar alist) score-files)))
(setq alist (cdr alist)))
(setq alist gnus-score-file-single-match-alist)
;; handle the single match alist
@@ -2845,8 +2844,7 @@ The list is determined from the variable `gnus-score-file-alist'."
;; and score-files is still nil. -sj
;; this can be construed as a "stop searching here" feature :>
;; and used to simplify regexps in the single-alist
- (setq score-files
- (nconc score-files (copy-sequence (cdar alist))))
+ (setq score-files (append (cdar alist) score-files))
(setq alist nil))
(setq alist (cdr alist)))
;; cache the score files
@@ -2866,7 +2864,7 @@ The list is determined from the variable `gnus-score-file-alist'."
(when gnus-score-use-all-scores
;; Get the initial score files for this group.
(when funcs
- (setq score-files (nreverse (gnus-score-find-alist group))))
+ (setq score-files (copy-sequence (gnus-score-find-alist group))))
;; Add any home adapt files.
(let ((home (gnus-home-score-file group t)))
(when home
@@ -3013,7 +3011,7 @@ If ADAPT, return the home adaptive file instead."
(defun gnus-current-home-score-file (group)
"Return the \"current\" regular score file."
- (car (nreverse (gnus-score-find-alist group))))
+ (car (gnus-score-find-alist group)))
;;;
;;; Score decays
diff --git a/lisp/gnus/gnus-spec.el b/lisp/gnus/gnus-spec.el
index 4682f512476..0fa64a84b75 100644
--- a/lisp/gnus/gnus-spec.el
+++ b/lisp/gnus/gnus-spec.el
@@ -90,6 +90,15 @@ text properties. This is only needed on XEmacs, as Emacs does this anyway."
(declare-function gnus-summary-from-or-to-or-newsgroups "gnus-sum"
(header gnus-tmp-from))
+(defmacro gnus-lrm-string-p (string)
+ (if (fboundp 'string-mark-left-to-rigth)
+ `(eq (aref ,string (1- (length ,string))) 8206)
+ nil))
+
+(defvar gnus-lrm-string (if (ignore-errors (string 8206))
+ (propertize (string 8206) 'invisible t)
+ ""))
+
(defun gnus-summary-line-format-spec ()
(insert gnus-tmp-unread gnus-tmp-replied
gnus-tmp-score-char gnus-tmp-indentation)
@@ -103,7 +112,9 @@ text properties. This is only needed on XEmacs, as Emacs does this anyway."
(gnus-summary-from-or-to-or-newsgroups
gnus-tmp-header gnus-tmp-from))))
(if (> (length val) 23)
- (substring val 0 23)
+ (if (gnus-lrm-string-p val)
+ (concat (substring val 0 23) gnus-lrm-string)
+ (substring val 0 23))
val))
gnus-tmp-closing-bracket))
(point))
@@ -351,13 +362,17 @@ Return a list of updated types."
`(if (> (,length-fun ,el) ,max)
,(if (< max-width 0)
`(,substring-fun ,el (- (,length-fun ,el) ,max))
- `(,substring-fun ,el 0 ,max))
+ `(if (gnus-lrm-string-p ,el)
+ (concat (,substring-fun ,el 0 ,max) ,gnus-lrm-string)
+ (,substring-fun ,el 0 ,max)))
,el)
`(let ((val (eval ,el)))
(if (> (,length-fun val) ,max)
,(if (< max-width 0)
`(,substring-fun val (- (,length-fun val) ,max))
- `(,substring-fun val 0 ,max))
+ `(if (gnus-lrm-string-p val)
+ (concat (,substring-fun val 0 ,max) ,gnus-lrm-string)
+ (,substring-fun val 0 ,max)))
val)))))
(defun gnus-tilde-cut-form (el cut-width)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 5917c9d7cef..fd441c46d17 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -375,7 +375,8 @@ place point on some subject line."
(const unread)
(const first)
(const unseen)
- (const unseen-or-unread)))
+ (const unseen-or-unread)
+ (function :tag "Function to call")))
(defcustom gnus-auto-select-next t
"*If non-nil, offer to go to the next group from the end of the previous.
@@ -3709,7 +3710,9 @@ buffer that was in action when the last article was fetched."
gnus-newsgroup-name)) 'nntp)
(gnus-group-real-name gnus-newsgroup-name))))
(concat gnus-summary-newsgroup-prefix newsgroups)))))
- (inline (gnus-summary-extract-address-component gnus-tmp-from)))))
+ (gnus-string-mark-left-to-right
+ (inline
+ (gnus-summary-extract-address-component gnus-tmp-from))))))
(defun gnus-summary-insert-line (gnus-tmp-header
gnus-tmp-level gnus-tmp-current
@@ -8627,6 +8630,8 @@ fetched for this group."
'list gnus-newsgroup-headers
(gnus-fetch-headers articles nil t)
'gnus-article-sort-by-number))
+ (setq gnus-newsgroup-articles
+ (gnus-sorted-nunion gnus-newsgroup-articles articles))
(gnus-summary-limit (append articles gnus-newsgroup-limit))))
(defun gnus-summary-limit-exclude-dormant ()
@@ -9015,13 +9020,15 @@ non-numeric or nil fetch the number specified by the
(refs (split-string (or (mail-header-references header)
"")))
(gnus-parse-headers-hook
- (lambda () (goto-char (point-min))
+ `(lambda () (goto-char (point-min))
(keep-lines
- (regexp-opt (append refs (list id subject)))))))
+ (regexp-opt ',(append refs (list id subject)))))))
(gnus-fetch-headers (list last) (if (numberp limit)
- (* 2 limit) limit) t)))))
+ (* 2 limit) limit) t))))
+ article-ids)
(when (listp new-headers)
(dolist (header new-headers)
+ (push (mail-header-number header) article-ids)
(when (member (mail-header-number header) gnus-newsgroup-unselected)
(push (mail-header-number header) gnus-newsgroup-unreads)
(setq gnus-newsgroup-unselected
@@ -9032,11 +9039,14 @@ non-numeric or nil fetch the number specified by the
(gnus-merge
'list gnus-newsgroup-headers new-headers
'gnus-article-sort-by-number)))
+ (setq gnus-newsgroup-articles
+ (gnus-sorted-nunion gnus-newsgroup-articles (nreverse article-ids)))
(gnus-summary-limit-include-thread id))))
(defun gnus-summary-refer-article (message-id)
"Fetch an article specified by MESSAGE-ID."
(interactive "sMessage-ID: ")
+ (gnus-warp-to-article)
(when (and (stringp message-id)
(not (zerop (length message-id))))
(setq message-id (gnus-replace-in-string message-id " " ""))
@@ -10283,34 +10293,33 @@ This will be the case if the article has both been mailed and posted."
;; There are expirable articles in this group, so we run them
;; through the expiry process.
(gnus-message 6 "Expiring articles...")
- (unless (gnus-check-group gnus-newsgroup-name)
- (error "Can't open server for %s" gnus-newsgroup-name))
- ;; The list of articles that weren't expired is returned.
- (save-excursion
- (if expiry-wait
- (let ((nnmail-expiry-wait-function nil)
- (nnmail-expiry-wait expiry-wait))
- (setq es (gnus-request-expire-articles
- expirable gnus-newsgroup-name)))
- (setq es (gnus-request-expire-articles
- expirable gnus-newsgroup-name)))
- (unless total
- (setq gnus-newsgroup-expirable es))
- ;; We go through the old list of expirable, and mark all
- ;; really expired articles as nonexistent.
- (unless (eq es expirable) ;If nothing was expired, we don't mark.
- (let ((gnus-use-cache nil))
- (dolist (article expirable)
- (when (and (not (memq article es))
- (gnus-data-find article))
- (gnus-summary-mark-article article gnus-canceled-mark)
- (run-hook-with-args 'gnus-summary-article-expire-hook
- 'delete
- (gnus-data-header
- (assoc article (gnus-data-list nil)))
- gnus-newsgroup-name
- nil
- nil))))))
+ (when (gnus-check-group gnus-newsgroup-name)
+ ;; The list of articles that weren't expired is returned.
+ (save-excursion
+ (if expiry-wait
+ (let ((nnmail-expiry-wait-function nil)
+ (nnmail-expiry-wait expiry-wait))
+ (setq es (gnus-request-expire-articles
+ expirable gnus-newsgroup-name)))
+ (setq es (gnus-request-expire-articles
+ expirable gnus-newsgroup-name)))
+ (unless total
+ (setq gnus-newsgroup-expirable es))
+ ;; We go through the old list of expirable, and mark all
+ ;; really expired articles as nonexistent.
+ (unless (eq es expirable) ;If nothing was expired, we don't mark.
+ (let ((gnus-use-cache nil))
+ (dolist (article expirable)
+ (when (and (not (memq article es))
+ (gnus-data-find article))
+ (gnus-summary-mark-article article gnus-canceled-mark)
+ (run-hook-with-args 'gnus-summary-article-expire-hook
+ 'delete
+ (gnus-data-header
+ (assoc article (gnus-data-list nil)))
+ gnus-newsgroup-name
+ nil
+ nil)))))))
(gnus-message 6 "Expiring articles...done")))))
(defun gnus-summary-expire-articles-now ()
@@ -12740,6 +12749,8 @@ returned."
gnus-newsgroup-headers
(gnus-fetch-headers articles)
'gnus-article-sort-by-number))
+ (setq gnus-newsgroup-articles
+ (gnus-sorted-nunion gnus-newsgroup-articles articles))
;; Suppress duplicates?
(when gnus-suppress-duplicates
(gnus-dup-suppress-articles))
@@ -12851,26 +12862,26 @@ If ALL is a number, fetch this number of articles."
(defun gnus-summary-insert-new-articles ()
"Insert all new articles in this group."
(interactive)
- (prog1
- (let ((old (sort (mapcar 'car gnus-newsgroup-data) '<))
- (old-high gnus-newsgroup-highest)
- (nnmail-fetched-sources (list t))
- i new)
- (setq gnus-newsgroup-active
- (gnus-copy-sequence
- (gnus-activate-group gnus-newsgroup-name 'scan)))
- (setq i (cdr gnus-newsgroup-active)
- gnus-newsgroup-highest i)
- (while (> i old-high)
- (push i new)
- (decf i))
- (if (not new)
- (message "No gnus is bad news")
- (gnus-summary-insert-articles new)
- (setq gnus-newsgroup-unreads
- (gnus-sorted-nunion gnus-newsgroup-unreads new))
- (gnus-summary-limit (gnus-sorted-nunion old new))))
- (gnus-summary-position-point)))
+ (let ((old (sort (mapcar 'car gnus-newsgroup-data) '<))
+ (old-high gnus-newsgroup-highest)
+ (nnmail-fetched-sources (list t))
+ (new-active (gnus-activate-group gnus-newsgroup-name 'scan))
+ i new)
+ (unless new-active
+ (error "Couldn't fetch new data"))
+ (setq gnus-newsgroup-active (gnus-copy-sequence new-active))
+ (setq i (cdr gnus-newsgroup-active)
+ gnus-newsgroup-highest i)
+ (while (> i old-high)
+ (push i new)
+ (decf i))
+ (if (not new)
+ (message "No gnus is bad news")
+ (gnus-summary-insert-articles new)
+ (setq gnus-newsgroup-unreads
+ (gnus-sorted-nunion gnus-newsgroup-unreads new))
+ (gnus-summary-limit (gnus-sorted-nunion old new))))
+ (gnus-summary-position-point))
;;; Bookmark support for Gnus.
(declare-function bookmark-make-record-default
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 7155c7f9607..34953611966 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -388,57 +388,14 @@ TIME defaults to the current time."
(define-key keymap key (pop plist))
(pop plist)))))
-;; Two silly functions to ensure that all `y-or-n-p' questions clear
-;; the echo area.
-;;
-;; Do we really need these functions? Workarounds for bugs in the corresponding
-;; Emacs functions? Maybe these bugs are no longer present in any supported
-;; (X)Emacs version? Alias them to the original functions and see if anyone
-;; reports a problem. If not, replace with original functions. --rsteib,
-;; 2007-12-14
-;;
-;; All supported Emacsen clear the echo area after `yes-or-no-p', so we can
-;; remove `yes-or-no-p'. RMS says that not clearing after `y-or-n-p' is
-;; intentional (see below), so we could remove `gnus-y-or-n-p' too.
-;; Objections? --rsteib, 2008-02-16
-;;
-;; ,----[ http://thread.gmane.org/gmane.emacs.gnus.general/65099/focus=66070 ]
-;; | From: Richard Stallman
-;; | Subject: Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
-;; | To: Katsumi Yamaoka [...]
-;; | Cc: emacs-devel@[...], xemacs-beta@[...], ding@[...]
-;; | Date: Mon, 07 Jan 2008 12:16:05 -0500
-;; | Message-ID: <E1JBva1-000528-VY@fencepost.gnu.org>
-;; |
-;; | The behavior of `y-or-n-p' that it doesn't clear the question
-;; | and the answer is not serious of course, but I feel it is not
-;; | cool.
-;; |
-;; | It is intentional.
-;; |
-;; | Currently, it is commented out in the trunk by Reiner Steib. He
-;; | also wrote the benefit of leaving the question and the answer in
-;; | the echo area as follows:
-;; |
-;; | (http://article.gmane.org/gmane.emacs.gnus.general/66061)
-;; | > In contrast to yes-or-no-p it is much easier to type y, n,
-;; | > SPC, DEL, etc accidentally, so it might be useful for the user
-;; | > to see what he has typed.
-;; |
-;; | Yes, that is the reason.
-;; `----
-
-;; (defun gnus-y-or-n-p (prompt)
-;; (prog1
-;; (y-or-n-p prompt)
-;; (message "")))
-;; (defun gnus-yes-or-no-p (prompt)
-;; (prog1
-;; (yes-or-no-p prompt)
-;; (message "")))
-
-(defalias 'gnus-y-or-n-p 'y-or-n-p)
-(defalias 'gnus-yes-or-no-p 'yes-or-no-p)
+(defun gnus-y-or-n-p (prompt)
+ (prog1
+ (y-or-n-p prompt)
+ (message "")))
+(defun gnus-yes-or-no-p (prompt)
+ (prog1
+ (yes-or-no-p prompt)
+ (message "")))
;; By Frank Schmitt <ich@Frank-Schmitt.net>. Allows to have
;; age-depending date representations. (e.g. just the time if it's
@@ -1292,6 +1249,13 @@ This function saves the current buffer."
(with-current-buffer gnus-group-buffer
(eq major-mode 'gnus-group-mode))))
+(defun gnus-process-live-p (process)
+ "Returns non-nil if PROCESS is alive.
+A process is considered alive if its status is `run', `open',
+`listen', `connect' or `stop'."
+ (memq (process-status process)
+ '(run open listen connect stop)))
+
(defun gnus-remove-if (predicate sequence &optional hash-table-p)
"Return a copy of SEQUENCE with all items satisfying PREDICATE removed.
SEQUENCE should be a list, a vector, or a string. Returns always a list.
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 7ff90f583cf..cd9b6eeb949 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -1875,7 +1875,7 @@ total number of articles in the group.")
:variable-default (mapcar
(lambda (g) (list g t))
'("delayed$" "drafts$" "queue$" "INBOX$"
- "^nnmairix:" "archive"))
+ "^nnmairix:" "^nnir:" "archive"))
:variable-document
"*Groups in which the registry should be turned off."
:variable-group gnus-registry
diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el
index dffb279daba..7959104d646 100644
--- a/lisp/gnus/mailcap.el
+++ b/lisp/gnus/mailcap.el
@@ -90,7 +90,7 @@ This is a compatibility function for different Emacsen."
;; files for the rest? -- fx
(defvar mailcap-mime-data
`(("application"
- ("vnd.ms-excel"
+ ("vnd\\.ms-excel"
(viewer . "gnumeric %s")
(test . (getenv "DISPLAY"))
(type . "application/vnd.ms-excel"))
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 47c4de0aedc..194ebf81873 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1310,7 +1310,7 @@ text and it replaces `self-insert-command' with the other command, e.g.
:type '(repeat function))
(defcustom message-auto-save-directory
- (if (file-exists-p message-directory)
+ (if (file-writable-p message-directory)
(file-name-as-directory (expand-file-name "drafts" message-directory))
"~/")
"*Directory where Message auto-saves buffers if Gnus isn't running.
@@ -1353,7 +1353,8 @@ candidates:
`quoted-text-only' Allow you to post quoted text only;
`multiple-copies' Allow you to post multiple copies;
`cancel-messages' Allow you to cancel or supersede messages from
- your other email addresses.")
+ your other email addresses;
+`canlock-verify' Allow you to cancel messages without verifying canlock.")
(defsubst message-gnksa-enable-p (feature)
(or (not (listp message-shoot-gnksa-feet))
@@ -4253,8 +4254,10 @@ conformance."
"Invisible text found and made visible; continue sending? ")
(error "Invisible text found and made visible")))))
(message-check 'illegible-text
- (let (char found choice)
+ (let (char found choice nul-chars)
(message-goto-body)
+ (setq nul-chars (save-excursion
+ (search-forward "\000" nil t)))
(while (progn
(skip-chars-forward mm-7bit-chars)
(when (get-text-property (point) 'no-illegible-text)
@@ -4280,7 +4283,9 @@ conformance."
(when found
(setq choice
(gnus-multiple-choice
- "Non-printable characters found. Continue sending?"
+ (if nul-chars
+ "NUL characters found, which may cause problems. Continue sending?"
+ "Non-printable characters found. Continue sending?")
`((?d "Remove non-printable characters and send")
(?r ,(format
"Replace non-printable characters with \"%s\" and send"
@@ -6525,7 +6530,9 @@ are not included."
(message-position-point)
;; Allow correct handling of `message-checksum' in `message-yank-original':
(set-buffer-modified-p nil)
- (undo-boundary))
+ (undo-boundary)
+ ;; rmail-start-mail expects message-mail to return t (Bug#9392)
+ t)
(defun message-set-auto-save-file-name ()
"Associate the message buffer with a file in the drafts directory."
@@ -7037,7 +7044,8 @@ regexp to match all of yours addresses."
(save-excursion
(save-restriction
(message-narrow-to-head-1)
- (if (message-fetch-field "Cancel-Lock")
+ (if (and (message-fetch-field "Cancel-Lock")
+ (message-gnksa-enable-p 'canlock-verify))
(if (null (canlock-verify))
t
(error "Failed to verify Cancel-lock: This article is not yours"))
diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el
index 43c91604ec5..7a7b3f6d82d 100644
--- a/lisp/gnus/mml-smime.el
+++ b/lisp/gnus/mml-smime.el
@@ -531,7 +531,7 @@ Content-Disposition: attachment; filename=smime.p7m
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-info "Corrupted")
(throw 'error handle))
- (setq part (mm-replace-in-string part "\n" "\r\n" t)
+ (setq part (mm-replace-in-string part "\n" "\r\n")
context (epg-make-context 'CMS))
(condition-case error
(setq plain (epg-verify-string context (mm-get-part signature) part))
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index a5d778845c1..ad9f95796fe 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -247,6 +247,10 @@ Whether the passphrase is cached at all is controlled by
(autoload 'epg-context-set-textmode "epg")
(autoload 'epg-context-set-signers "epg")
(autoload 'epg-context-set-passphrase-callback "epg")
+(autoload 'epg-key-sub-key-list "epg")
+(autoload 'epg-sub-key-capability "epg")
+(autoload 'epg-sub-key-validity "epg")
+(autoload 'epg-sub-key-fingerprint "epg")
(autoload 'epg-sign-string "epg")
(autoload 'epg-encrypt-string "epg")
(autoload 'epg-configuration "epg-config")
@@ -274,17 +278,59 @@ Whether the passphrase is cached at all is controlled by
(cons key-id mml1991-epg-secret-key-id-list))
(copy-sequence passphrase)))))
+(defun mml1991-epg-find-usable-key (keys usage)
+ (catch 'found
+ (while keys
+ (let ((pointer (epg-key-sub-key-list (car keys))))
+ (while pointer
+ (if (and (memq usage (epg-sub-key-capability (car pointer)))
+ (not (memq 'disabled (epg-sub-key-capability (car pointer))))
+ (not (memq (epg-sub-key-validity (car pointer))
+ '(revoked expired))))
+ (throw 'found (car keys)))
+ (setq pointer (cdr pointer))))
+ (setq keys (cdr keys)))))
+
+;; XXX: since gpg --list-secret-keys does not return validity of each
+;; key, `mml1991-epg-find-usable-key' defined above is not enough for
+;; secret keys. The function `mml1991-epg-find-usable-secret-key'
+;; below looks at appropriate public keys to check usability.
+(defun mml1991-epg-find-usable-secret-key (context name usage)
+ (let ((secret-keys (epg-list-keys context name t))
+ secret-key)
+ (while (and (not secret-key) secret-keys)
+ (if (mml1991-epg-find-usable-key
+ (epg-list-keys context (epg-sub-key-fingerprint
+ (car (epg-key-sub-key-list
+ (car secret-keys)))))
+ usage)
+ (setq secret-key (car secret-keys)
+ secret-keys nil)
+ (setq secret-keys (cdr secret-keys))))
+ secret-key))
+
(defun mml1991-epg-sign (cont)
(let ((context (epg-make-context))
- headers cte signers signature)
+ headers cte signer-key signers signature)
(if (eq mm-sign-option 'guided)
(setq signers (epa-select-keys context "Select keys for signing.
If no one is selected, default secret key is used. "
mml1991-signers t))
(if mml1991-signers
- (setq signers (mapcar (lambda (name)
- (car (epg-list-keys context name t)))
- mml1991-signers))))
+ (setq signers (delq nil
+ (mapcar
+ (lambda (name)
+ (setq signer-key
+ (mml1991-epg-find-usable-secret-key
+ context name 'sign))
+ (unless (or signer-key
+ (y-or-n-p
+ (format
+ "No secret key for %s; skip it? "
+ name)))
+ (error "No secret key for %s" name))
+ signer-key)
+ mml1991-signers)))))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
(epg-context-set-signers context signers)
@@ -344,7 +390,11 @@ If no one is selected, default secret key is used. "
(split-string
(message-options-get 'message-recipients)
"[ \f\t\n\r\v,]+")))
- cipher signers config)
+ recipient-key signer-key cipher signers config)
+ (when mml1991-encrypt-to-self
+ (unless mml1991-signers
+ (error "mml1991-signers is not set"))
+ (setq recipients (nconc recipients mml1991-signers)))
;; We should remove this check if epg-0.0.6 is released.
(if (and (condition-case nil
(require 'epg-config)
@@ -363,26 +413,32 @@ If no one is selected, default secret key is used. "
If no one is selected, symmetric encryption will be performed. "
recipients))
(setq recipients
- (delq nil (mapcar (lambda (name)
- (car (epg-list-keys context name)))
- recipients))))
- (if mml1991-encrypt-to-self
- (if mml1991-signers
- (setq recipients
- (nconc recipients
- (mapcar (lambda (name)
- (car (epg-list-keys context name)))
- mml1991-signers)))
- (error "mml1991-signers not set")))
+ (delq nil (mapcar
+ (lambda (name)
+ (setq recipient-key (mml1991-epg-find-usable-key
+ (epg-list-keys context name)
+ 'encrypt))
+ (unless (or recipient-key
+ (y-or-n-p
+ (format "No public key for %s; skip it? "
+ name)))
+ (error "No public key for %s" name))
+ recipient-key)
+ recipients)))
+ (unless recipients
+ (error "No recipient specified")))
(when sign
(if (eq mm-sign-option 'guided)
(setq signers (epa-select-keys context "Select keys for signing.
If no one is selected, default secret key is used. "
mml1991-signers t))
(if mml1991-signers
- (setq signers (mapcar (lambda (name)
- (car (epg-list-keys context name t)))
- mml1991-signers))))
+ (setq signers (delq nil
+ (mapcar
+ (lambda (name)
+ (mml1991-epg-find-usable-secret-key
+ context name 'sign))
+ mml1991-signers)))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el
index 7d8a4119c0e..b9310beed58 100644
--- a/lisp/gnus/mml2015.el
+++ b/lisp/gnus/mml2015.el
@@ -923,7 +923,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-info "Corrupted")
(throw 'error handle))
- (setq part (mm-replace-in-string part "\n" "\r\n" t)
+ (setq part (mm-replace-in-string part "\n" "\r\n")
signature (mm-get-part signature)
context (epg-make-context))
(condition-case error
diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el
index f528222dd16..0b47062a919 100644
--- a/lisp/gnus/nndraft.el
+++ b/lisp/gnus/nndraft.el
@@ -177,6 +177,8 @@ are generated if and only if they are also in `message-draft-headers'.")
(list 'nndraft "")))
(nnmail-get-active)))
(gnus-group-marked (copy-sequence groups))
+ ;; Don't send delayed articles.
+ (gnus-get-new-news-hook nil)
(inhibit-read-only t))
(gnus-group-get-new-news-this-group nil t)
(dolist (group groups)
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 52de48869d8..52c4b3c4290 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -216,9 +216,14 @@ textual parts.")
(let ((structure (ignore-errors
(read (current-buffer)))))
(while (and (consp structure)
- (not (stringp (car structure))))
+ (not (atom (car structure))))
(setq structure (car structure)))
- (setq lines (nth 7 structure))))
+ (setq lines (if (and
+ (stringp (car structure))
+ (equal (upcase (nth 0 structure)) "MESSAGE")
+ (equal (upcase (nth 1 structure)) "RFC822"))
+ (nth 9 structure)
+ (nth 7 structure)))))
(delete-region (line-beginning-position) (line-end-position))
(insert (format "211 %s Article retrieved." article))
(forward-line 1)
@@ -345,7 +350,6 @@ textual parts.")
(with-current-buffer (nnimap-make-process-buffer buffer)
(let* ((coding-system-for-read 'binary)
(coding-system-for-write 'binary)
- (port nil)
(ports
(cond
((memq nnimap-stream '(network plain starttls))
@@ -390,7 +394,7 @@ textual parts.")
(if (not stream)
(progn
(nnheader-report 'nnimap "Unable to contact %s:%s via %s"
- nnimap-address port nnimap-stream)
+ nnimap-address (car ports) nnimap-stream)
'no-connect)
(gnus-set-process-query-on-exit-flag stream nil)
(if (not (gnus-string-match-p "[*.] \\(OK\\|PREAUTH\\)" greeting))
@@ -1107,9 +1111,9 @@ textual parts.")
(separator (read (current-buffer)))
(group (read (current-buffer))))
(unless (member '%NoSelect flags)
- (push (if (stringp group)
- group
- (format "%s" group))
+ (push (utf7-decode (if (stringp group)
+ group
+ (format "%s" group)) t)
groups))))
(nreverse groups)))
@@ -1168,7 +1172,7 @@ textual parts.")
(nnimap-get-groups)))
(unless (assoc group nnimap-current-infos)
;; Insert dummy numbers here -- they don't matter.
- (insert (format "%S 0 1 y\n" group))))
+ (insert (format "%S 0 1 y\n" (utf7-encode group)))))
t)))
(deffoo nnimap-retrieve-group-data-early (server infos)
@@ -1566,7 +1570,7 @@ textual parts.")
(articles &optional limit force-new dependencies))
(deffoo nnimap-request-thread (header &optional group server)
- (if gnus-refer-thread-use-nnir
+ (if gnus-refer-thread-use-nnir
(nnir-search-thread header)
(when (nnimap-possibly-change-group group server)
(let* ((cmd (nnimap-make-thread-query header))
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index e6420a4d7bb..17fc3f3fe81 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -767,11 +767,18 @@ Add an entry here when adding a new search engine.")
(deffoo nnir-warp-to-article ()
(let* ((cur (if (> (gnus-summary-article-number) 0)
(gnus-summary-article-number)
- (error "This is not a real article.")))
- (gnus-newsgroup-name (nnir-article-group cur))
- (backend-number (nnir-article-number cur)))
- (gnus-summary-read-group-1 gnus-newsgroup-name t t gnus-summary-buffer
- nil (list backend-number))))
+ (error "This is not a real article")))
+ (backend-article-group (nnir-article-group cur))
+ (backend-article-number (nnir-article-number cur))
+ (quit-config (gnus-ephemeral-group-p gnus-newsgroup-name)))
+ ;; first exit from the nnir summary buffer.
+ (gnus-summary-exit)
+ ;; and if the nnir summary buffer in turn came from another
+ ;; summary buffer we have to clean that summary up too.
+ (when (eq (cdr quit-config) 'summary)
+ (gnus-summary-exit))
+ (gnus-summary-read-group-1 backend-article-group t t nil
+ nil (list backend-article-number))))
(nnoo-define-skeleton nnir)
@@ -1617,7 +1624,7 @@ actually)."
(let* ((server (car x))
(nnir-search-engine
(or (nnir-read-server-parm 'nnir-search-engine
- server)
+ server t)
(cdr (assoc (car
(gnus-server-to-method server))
nnir-method-default-engines))))
@@ -1636,14 +1643,16 @@ actually)."
nil)))
groups))))
-(defun nnir-read-server-parm (key server)
- "Returns the parameter value of key for the given server, where
-server is of form 'backend:name'."
+(defun nnir-read-server-parm (key server &optional not-global)
+ "Returns the parameter value corresponding to `key' for
+`server'. If no server-specific value is found consult the global
+environment unless `not-global' is non-nil."
(let ((method (gnus-server-to-method server)))
(cond ((and method (assq key (cddr method)))
- (nth 1 (assq key (cddr method))))
- ((boundp key) (symbol-value key))
- (t nil))))
+ (nth 1 (assq key (cddr method))))
+ ((and (not not-global) (boundp key)) (symbol-value key))
+ (t nil))))
+
(defun nnir-possibly-change-server (server)
(unless (and server (nnir-server-opened server))
@@ -1659,7 +1668,8 @@ server is of form 'backend:name'."
(cons 'server (gnus-method-to-server
(gnus-find-method-for-group
gnus-newsgroup-name))))))
- (gnus-group-make-nnir-group nil parm)))
+ (gnus-group-make-nnir-group nil parm)
+ (gnus-summary-goto-subject (gnus-id-to-article (mail-header-id header)))))
;; unused?
(defun nnir-artlist-groups (artlist)
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index 8906a036779..d83467a1ed5 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -554,7 +554,9 @@ parameter. It should return nil, `warn' or `delete'."
(const delete)))
(defcustom nnmail-extra-headers '(To Newsgroups)
- "*Extra headers to parse."
+ "Extra headers to parse.
+In addition to the standard headers, these extra headers will be
+included in NOV headers (and the like) when backends parse headers."
:version "21.1"
:group 'nnmail
:type '(repeat symbol))
@@ -1840,18 +1842,23 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
;; and fetch the mail from each.
(while (setq source (pop fetching-sources))
(when (setq new
- (mail-source-fetch
- source
- (gnus-byte-compile
- `(lambda (file orig-file)
- (nnmail-split-incoming
- file ',(intern (format "%s-save-mail" method))
- ',spool-func
- (or in-group
- (if (equal file orig-file)
- nil
- (nnmail-get-split-group orig-file ',source)))
- ',(intern (format "%s-active-number" method)))))))
+ (condition-case cond
+ (mail-source-fetch
+ source
+ (gnus-byte-compile
+ `(lambda (file orig-file)
+ (nnmail-split-incoming
+ file ',(intern (format "%s-save-mail" method))
+ ',spool-func
+ (or in-group
+ (if (equal file orig-file)
+ nil
+ (nnmail-get-split-group orig-file
+ ',source)))
+ ',(intern (format "%s-active-number" method))))))
+ ((error quit)
+ (message "Mail source %s failed: %s" source cond)
+ 0)))
(incf total new)
(incf i)))
;; If we did indeed read any incoming spools, we save all info.
diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el
index 8e2cd4bdde3..bbace7c784a 100644
--- a/lisp/gnus/nnmaildir.el
+++ b/lisp/gnus/nnmaildir.el
@@ -1381,7 +1381,8 @@ by nnmaildir-request-article.")
(error
(gmm-write-region (point-min) (point-max) tmpfile nil 'no-message nil
'excl)
- (unix-sync))) ;; no fsync :(
+ (when (fboundp 'unix-sync)
+ (unix-sync)))) ;; no fsync :(
(nnheader-cancel-timer 24h)
(condition-case err
(add-name-to-file tmpfile curfile)
diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el
index b82d6c2ee7b..3d1ac02b6aa 100644
--- a/lisp/gnus/nnmairix.el
+++ b/lisp/gnus/nnmairix.el
@@ -604,9 +604,7 @@ Other back ends might or might not work.")
;; Silence byte-compiler.
(defvar gnus-registry-install)
-(autoload 'gnus-registry-fetch-group "gnus-registry")
-(autoload 'gnus-registry-fetch-groups "gnus-registry")
-(autoload 'gnus-registry-add-group "gnus-registry")
+(autoload 'gnus-registry-get-id-key "gnus-registry")
(deffoo nnmairix-request-set-mark (group actions &optional server)
(when server
@@ -660,13 +658,7 @@ Other back ends might or might not work.")
nnmairix-only-use-registry)
(setq ogroup
(nnmairix-determine-original-group-from-path
- mid nnmairix-current-server))
- ;; if available and allowed, add this entry to the registry
- (when (and (boundp 'gnus-registry-install)
- gnus-registry-install)
- (dolist (cur ogroup)
- (unless (gnus-parameter-registry-ignore cur)
- (gnus-registry-add-group mid cur)))))
+ mid nnmairix-current-server)))
(unless ogroup
(nnheader-message
3 "Unable to set mark: couldn't find original group for %s" mid)
@@ -1630,14 +1622,7 @@ search in raw mode."
;; registry was not available or did not find article
;; so we search again with mairix in raw mode to get filename
(setq allgroups
- (nnmairix-determine-original-group-from-path mid server))
- ;; if available and allowed, add this entry to the registry
- (when (and (not no-registry)
- (boundp 'gnus-registry-install)
- gnus-registry-install)
- (dolist (cur allgroups)
- (unless (gnus-parameter-registry-ignore cur)
- (gnus-registry-add-group mid cur)))))
+ (nnmairix-determine-original-group-from-path mid server)))
(if (> (length allgroups) 1)
(setq group
(gnus-completing-read
@@ -1657,7 +1642,7 @@ search in raw mode."
(set mid (concat "<" mid)))
(unless (string-match ">$" mid)
(set mid (concat mid ">")))
- (gnus-registry-fetch-groups mid)))
+ (gnus-registry-get-id-key mid 'group)))
(defun nnmairix-determine-original-group-from-path (mid server)
"Determine original group(s) for message-id MID from the file path.
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 986fd51a613..325aa67f80d 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -261,6 +261,8 @@ See `nnml-marks-is-evil' for more information.")
(const :format "" "password")
(string :format "Password: %v")))))))
+(make-obsolete 'nntp-authinfo-file nil "Emacs 24.1")
+
(defvoo nntp-connection-timeout nil
@@ -430,6 +432,9 @@ be restored and the command retried."
(defun nntp-kill-buffer (buffer)
(when (buffer-name buffer)
+ (let ((process (get-buffer-process buffer)))
+ (when process
+ (delete-process process)))
(kill-buffer buffer)
(nnheader-init-server-buffer)))
diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el
index e29ddb0d44e..54c21703836 100644
--- a/lisp/gnus/pop3.el
+++ b/lisp/gnus/pop3.el
@@ -178,6 +178,8 @@ Use streaming commands."
(defun pop3-wait-for-messages (process count total-size)
(while (< (pop3-number-of-responses total-size) count)
+ (unless (memq (process-status process) '(open run))
+ (error "pop3 process died"))
(when total-size
(message "pop3 retrieved %dKB (%d%%)"
(truncate (/ (buffer-size) 1000))
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index 33dbaaa1f0c..c7f993d7293 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -1581,31 +1581,31 @@ to find it out)."
(when (numberp article)
(let* ((data-header (or prepared-data-header
(spam-fetch-article-header article))))
- (if (arrayp data-header)
- (cond
- ((equal field 'number)
- (mail-header-number data-header))
- ((equal field 'from)
- (mail-header-from data-header))
- ((equal field 'message-id)
- (mail-header-message-id data-header))
- ((equal field 'subject)
- (mail-header-subject data-header))
- ((equal field 'references)
- (mail-header-references data-header))
- ((equal field 'date)
- (mail-header-date data-header))
- ((equal field 'xref)
- (mail-header-xref data-header))
- ((equal field 'extra)
- (mail-header-extra data-header))
- (t
- (gnus-error
- 5
- "spam-fetch-field-fast: unknown field %s requested"
- field)
- nil))
- (gnus-message 6 "Article %d has a nil data header" article)))))
+ (cond
+ ((not (arrayp data-header))
+ (gnus-message 6 "Article %d has a nil data header" article))
+ ((equal field 'number)
+ (mail-header-number data-header))
+ ((equal field 'from)
+ (mail-header-from data-header))
+ ((equal field 'message-id)
+ (mail-header-message-id data-header))
+ ((equal field 'subject)
+ (mail-header-subject data-header))
+ ((equal field 'references)
+ (mail-header-references data-header))
+ ((equal field 'date)
+ (mail-header-date data-header))
+ ((equal field 'xref)
+ (mail-header-xref data-header))
+ ((equal field 'extra)
+ (mail-header-extra data-header))
+ (t
+ (gnus-error
+ 5
+ "spam-fetch-field-fast: unknown field %s requested"
+ field)
+ nil)))))
(defun spam-fetch-field-from-fast (article &optional prepared-data-header)
(spam-fetch-field-fast article 'from prepared-data-header))
diff --git a/lisp/gnus/starttls.el b/lisp/gnus/starttls.el
index 4b4839a4df2..b995f7478ce 100644
--- a/lisp/gnus/starttls.el
+++ b/lisp/gnus/starttls.el
@@ -295,18 +295,15 @@ GNUTLS requires a port number."
(starttls-set-process-query-on-exit-flag process nil)
process)))
-(defun starttls-any-program-available ()
- (let ((program (if starttls-use-gnutls
- starttls-gnutls-program
- starttls-program)))
- (condition-case ()
- (progn
- (call-process program)
- program)
- (error (progn
- (message "No STARTTLS program was available (tried '%s')"
- program)
- nil)))))
+(defun starttls-available-p ()
+ "Say whether the STARTTLS programs are available."
+ (executable-find (if starttls-use-gnutls
+ starttls-gnutls-program
+ starttls-program)))
+
+(defalias 'starttls-any-program-available 'starttls-available-p)
+(make-obsolete 'starttls-any-program-available 'starttls-available-p
+ "2011-08-02")
(provide 'starttls)