From b09c3fe0254f12755e3d7f45a8c9464f710e157e Mon Sep 17 00:00:00 2001 From: Gnus developers Date: Thu, 30 Jun 2011 22:20:32 +0000 Subject: [PATCH] gnus-group.el (gnus-read-ephemeral-emacs-bug-group): Take an optional quit window configuration. auth-source.el (epg-context-set-passphrase-callback): Remove duplicate autoload. nnir.el (nnir-request-article): Allow requesting articles by Message-ID with nnimap. gnus-sum.el (gnus-refer-article-methods): Allow (nnir) entry to use current server. auth-source.el: Autoload EPA/EPG functions. (auth-source-netrc-use-gpg-tokens): Clarify that it should not be changed when EPA/EPG is not available. (auth-source-backend): Rename "arg" member to "data". (auth-source-backend-parse, auth-source-plstore-search) (auth-source-plstore-create): Use it. --- lisp/gnus/ChangeLog | 27 +++++++++++++++++++++++++ lisp/gnus/auth-source.el | 30 ++++++++++++++++++---------- lisp/gnus/gnus-group.el | 10 ++++++---- lisp/gnus/gnus-sum.el | 7 ++++++- lisp/gnus/nnir.el | 43 ++++++++++++++++++++++++++++------------ 5 files changed, 88 insertions(+), 29 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index e66ae09d391..35ecf306122 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -3,6 +3,33 @@ * mml2015.el (mml2015-use): Don't try to load PGG on Emacs 24, when EPG is not fully working. +2011-06-30 Lars Magne Ingebrigtsen + + * dgnushack.el: Autoload sha1 on XEmacs. + + * gnus-group.el (gnus-read-ephemeral-emacs-bug-group): Take an optional + quit window configuration. + + * auth-source.el (epg-context-set-passphrase-callback): Remove + duplicate autoload. + +2011-06-30 Andrew Cohen + + * nnir.el (nnir-request-article): Allow requesting articles by + Message-ID with nnimap. + + * gnus-sum.el (gnus-refer-article-methods): Allow (nnir) entry to use + current server. + +2011-06-30 Teodor Zlatanov + + * auth-source.el: Autoload EPA/EPG functions. + (auth-source-netrc-use-gpg-tokens): Clarify that it should not be + changed when EPA/EPG is not available. + (auth-source-backend): Rename "arg" member to "data". + (auth-source-backend-parse, auth-source-plstore-search) + (auth-source-plstore-create): Use it. + 2011-06-30 Andrew Cohen * gnus-art.el (gnus-request-article-this-buffer): Use existing function diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index 25c6b924305..9391bf23d37 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -43,8 +43,6 @@ (require 'mm-util) (require 'gnus-util) (require 'assoc) -(require 'epa) -(require 'epg) (eval-when-compile (require 'cl)) (require 'eieio) @@ -65,6 +63,15 @@ (autoload 'plstore-save "plstore") (autoload 'plstore-get-file "plstore") +(autoload 'epa-passphrase-callback-function "epa") + +(autoload 'epg-context-operation "epg") +(autoload 'epg-make-context "epg") +(autoload 'epg-context-set-passphrase-callback "epg") +(autoload 'epg-decrypt-string "epg") +(autoload 'epg-context-set-armor "epg") +(autoload 'epg-encrypt-string "epg") + (defvar secrets-enabled) (defgroup auth-source nil @@ -109,9 +116,9 @@ let-binding." :type t :custom string :documentation "The backend protocol.") - (arg :initarg :arg - :initform nil - :documentation "The backend arg.") + (data :initarg :arg + :initform nil + :documentation "Internal backend data.") (create-function :initarg :create-function :initform ignore :type function @@ -171,7 +178,8 @@ let-binding." (defcustom auth-source-netrc-use-gpg-tokens 'never "Set this to tell auth-source when to create GPG password -tokens in netrc files. It's either an alist or `never'." +tokens in netrc files. It's either an alist or `never'. +Note that if EPA/EPG is not available, this should NOT be used." :group 'auth-source :version "23.2" ;; No Gnus :type `(choice @@ -394,7 +402,7 @@ with \"[a/b/c] \" if CHOICES is '\(?a ?b ?c\)." :type 'plstore :search-function 'auth-source-plstore-search :create-function 'auth-source-plstore-create - :arg (plstore-open (plist-get entry :source))) + :data (plstore-open (plist-get entry :source))) (auth-source-backend (plist-get entry :source) :source (plist-get entry :source) @@ -1520,7 +1528,7 @@ authentication tokens: (assert (not delete) nil "The PLSTORE auth-source backend doesn't support deletion yet") - (let* ((store (oref backend arg)) + (let* ((store (oref backend data)) (max (or max 5000)) ; sanity check: default to stop at 5K (ignored-keys '(:create :delete :max :backend :require)) (search-keys (loop for i below (length spec) by 2 @@ -1699,15 +1707,15 @@ authentication tokens: (setq artificial (plist-put artificial (intern (concat ":" (symbol-name r))) data)))))) - (plstore-put (oref backend arg) + (plstore-put (oref backend data) (sha1 (format "%s@%s:%s" (plist-get artificial :user) (plist-get artificial :host) (plist-get artificial :port))) artificial secret-artificial) (if (y-or-n-p (format "Save auth info to file %s? " - (plstore-get-file (oref backend arg)))) - (plstore-save (oref backend arg))))) + (plstore-get-file (oref backend data)))) + (plstore-save (oref backend data))))) ;;; older API diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 518f215a7ba..82d31567dc5 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -2428,7 +2428,7 @@ the bug number, and browsing the URL must return mbox output." :version "24.1" :type '(repeat (cons (symbol) (string :tag "URL format string")))) -(defun gnus-read-ephemeral-bug-group (number mbox-url) +(defun gnus-read-ephemeral-bug-group (number mbox-url &optional window-conf) "Browse bug NUMBER as ephemeral group." (interactive (list (read-string "Enter bug number: " (thing-at-point 'word) nil) @@ -2452,7 +2452,8 @@ the bug number, and browsing the URL must return mbox output." (gnus-group-read-ephemeral-group "gnus-read-ephemeral-bug" `(nndoc ,tmpfile - (nndoc-article-type mbox)))) + (nndoc-article-type mbox)) + nil window-conf)) (delete-file tmpfile))) (defun gnus-read-ephemeral-debian-bug-group (number) @@ -2463,13 +2464,14 @@ the bug number, and browsing the URL must return mbox output." number (cdr (assoc 'debian gnus-bug-group-download-format-alist)))) -(defun gnus-read-ephemeral-emacs-bug-group (number) +(defun gnus-read-ephemeral-emacs-bug-group (number &optional window-conf) "Browse Emacs bug NUMBER as ephemeral group." (interactive (list (read-string "Enter bug number: " (thing-at-point 'word) nil))) (gnus-read-ephemeral-bug-group number - (cdr (assoc 'emacs gnus-bug-group-download-format-alist)))) + (cdr (assoc 'emacs gnus-bug-group-download-format-alist)) + window-conf)) (defun gnus-group-jump-to-group (group &optional prompt) "Jump to newsgroup GROUP. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 4c059e9332a..798ae964460 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9050,7 +9050,12 @@ variable." (dolist (method gnus-refer-article-method) (push (if (eq 'current method) gnus-current-select-method - method) + (if (eq 'nnir (car method)) + (list + 'nnir + (or (cadr method) + (gnus-method-to-server gnus-current-select-method))) + method)) out)) (nreverse out))) ;; One single select method. diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index eaaac3f88ce..f1a97dc59d3 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -657,22 +657,39 @@ Add an entry here when adding a new search engine.") 'nov))) (deffoo nnir-request-article (article &optional group server to-buffer) - (if (stringp article) + (if (and (stringp article) + (not (eq 'nnimap (car (gnus-server-to-method server))))) (nnheader-report 'nnir - "nnir-retrieve-headers doesn't grok message ids: %s" - article) + "nnir-retrieve-headers only groks message ids for nnimap servers: %s" + server) (save-excursion - (let ((artfullgroup (nnir-article-group article)) - (artno (nnir-article-number article))) - (message "Requesting article %d from group %s" - artno artfullgroup) - (if to-buffer - (with-current-buffer to-buffer - (let ((gnus-article-decode-hook nil)) - (gnus-request-article-this-buffer artno artfullgroup))) - (gnus-request-article artno artfullgroup)) - (cons artfullgroup artno))))) + (let ((article article) + query) + (when (stringp article) + (setq gnus-override-method (gnus-server-to-method server)) + (setq query + (list + (cons 'query (format "HEADER Message-ID %s" article)) + (cons 'unique-id article) + (cons 'criteria ""))) + (unless (and (equal query nnir-current-query) + (equal server nnir-current-server)) + (setq nnir-artlist (nnir-run-imap query server)) + (setq nnir-current-query query) + (setq nnir-current-server server)) + (setq article 1)) + (unless (zerop (length nnir-artlist)) + (let ((artfullgroup (nnir-article-group article)) + (artno (nnir-article-number article))) + (message "Requesting article %d from group %s" + artno artfullgroup) + (if to-buffer + (with-current-buffer to-buffer + (let ((gnus-article-decode-hook nil)) + (gnus-request-article-this-buffer artno artfullgroup))) + (gnus-request-article artno artfullgroup)) + (cons artfullgroup artno))))))) (deffoo nnir-request-move-article (article group server accept-form &optional last internal-move-group) -- 2.39.2