Commit ec7995fa authored by Katsumi Yamaoka's avatar Katsumi Yamaoka
Browse files

Synch with Gnus trunk

=====================
2010-03-23  Katsumi Yamaoka  <yamaoka@jpl.org>

 * gnus-art.el (canlock-verify): Autoload it for Emacs 21.

 * message.el (ecomplete-setup): Autoload it for Emacs <23.

 * mml-sec.el (mml-secure-cache-passphrase): Default to t that is
 password-cache's default if it is not bound.
 (mml-secure-passphrase-cache-expiry): Default to 16 that is
 password-cache-expiry's default if it is not bound.

 * pop3.el (pop3-list): Don't use 3rd arg of `split-string' which is not
 available in Emacs 21.

2010-03-23  Teodor Zlatanov  <tzz@lifelogs.com>

 * auth-source.el (auth-sources): Fix up definition so extra parameters
 are always inline.

2010-03-22  Martin Stjernholm  <mast@lysator.liu.se>

 * nnimap.el (nnimap-verify-uidvalidity): Fixed bug where uidvalidity
 wasn't updated after mismatch.  Clear cached mailbox info correctly
 when uidvalidity changes.
 (nnimap-group-prefixed-name): New function to avoid some code
 duplication.
 (nnimap-verify-uidvalidity, nnimap-group-overview-filename)
 (nnimap-request-group): Use it.
 (nnimap-retrieve-groups, nnimap-verify-uidvalidity)
 (nnimap-update-unseen): Significantly improved speed of Gnus startup
 with many imap folders.  This is done by caching the group status from
 the imap server persistently in a group parameter `imap-status'. (This
 was cached before too if `nnimap-retrieve-groups-asynchronous' was set,
 but not persistently, so every Gnus startup was still very slow.)

2010-03-20  Teodor Zlatanov  <tzz@lifelogs.com>

 * auth-source.el: Set up autoloads.  Bump to 23.2 because of the
 secrets.el dependency.
 (auth-sources): Add optional user name.  Add secrets.el configuration
 choice (unused right now).

2010-03-20  Teodor Zlatanov  <tzz@lifelogs.com>

 * gnus-sum.el (gnus-summary-make-menu-bar): Let
 `gnus-registry-install-shortcuts' fill in the functions.

 * gnus-registry.el (gnus-summary-misc-menu): Declare to avoid
 warnings.
 (gnus-registry-misc-menus): Variable to hold registry mark menus.
 (gnus-registry-install-shortcuts): Populate and use it in a
 `gnus-summary-menu-hook' lambda, under "Gnus"->"Registry Marks".

2010-03-20  Martin Stjernholm  <mast@lysator.liu.se>

 * nnimap.el (nnimap-decode-group-name, nnimap-encode-group-name):
 In-place substitutions for the group name encoding/decoding.
 (nnimap-find-minmax-uid, nnimap-possibly-change-group)
 (nnimap-retrieve-headers-progress, nnimap-possibly-change-group)
 (nnimap-retrieve-headers-progress, nnimap-request-article-part)
 (nnimap-update-unseen, nnimap-request-list)
 (nnimap-retrieve-groups, nnimap-request-update-info-internal)
 (nnimap-request-set-mark, nnimap-split-to-groups)
 (nnimap-split-articles, nnimap-request-newgroups)
 (nnimap-request-create-group, nnimap-request-accept-article)
 (nnimap-request-delete-group, nnimap-request-rename-group)
 (nnimap-acl-get, nnimap-acl-edit): Use them.  Replace `mbx' with
 `encoded-mbx' for consistency.
 (nnimap-close-group): Call `imap-current-mailbox' instead of using the
 variable `imap-current-mailbox'.

 * gnus-agent.el (gnus-agent-fetch-articles, gnus-agent-fetch-headers)
 (gnus-agent-regenerate-group): Use `gnus-agent-decoded-group-name'.

2010-03-20  Bojan Petrovic  <bpetrovi@f.bg.ac.rs>

 * pop3.el (pop3-display-message-size-flag): Display message size byte
 counts during POP3 download.
 (pop3-movemail): Use it.
 (pop3-list): Implement listing of available messages.

2010-03-20  Mark Triggs  <mst@dishevelled.net>  (tiny change)

 * nnir.el (nnir-get-article-nov-override-function): New function to
 override the normal NOV retrieval.
 (nnir-retrieve-headers): Use it.
parent 1888398e
2010-03-23 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-art.el (canlock-verify): Autoload it for Emacs 21.
* message.el (ecomplete-setup): Autoload it for Emacs <23.
* mml-sec.el (mml-secure-cache-passphrase): Default to t that is
password-cache's default if it is not bound.
(mml-secure-passphrase-cache-expiry): Default to 16 that is
password-cache-expiry's default if it is not bound.
* pop3.el (pop3-list): Don't use 3rd arg of `split-string' which is not
available in Emacs 21.
2010-03-23 Teodor Zlatanov <tzz@lifelogs.com>
* auth-source.el (auth-sources): Fix up definition so extra parameters
are always inline.
2010-03-22 Martin Stjernholm <mast@lysator.liu.se>
* nnimap.el (nnimap-verify-uidvalidity): Fixed bug where uidvalidity
wasn't updated after mismatch. Clear cached mailbox info correctly
when uidvalidity changes.
(nnimap-group-prefixed-name): New function to avoid some code
duplication.
(nnimap-verify-uidvalidity, nnimap-group-overview-filename)
(nnimap-request-group): Use it.
(nnimap-retrieve-groups, nnimap-verify-uidvalidity)
(nnimap-update-unseen): Significantly improved speed of Gnus startup
with many imap folders. This is done by caching the group status from
the imap server persistently in a group parameter `imap-status'. (This
was cached before too if `nnimap-retrieve-groups-asynchronous' was set,
but not persistently, so every Gnus startup was still very slow.)
2010-03-20 Teodor Zlatanov <tzz@lifelogs.com>
* auth-source.el: Set up autoloads. Bump to 23.2 because of the
secrets.el dependency.
(auth-sources): Add optional user name. Add secrets.el configuration
choice (unused right now).
2010-03-20 Teodor Zlatanov <tzz@lifelogs.com>
* gnus-sum.el (gnus-summary-make-menu-bar): Let
`gnus-registry-install-shortcuts' fill in the functions.
* gnus-registry.el (gnus-summary-misc-menu): Declare to avoid
warnings.
(gnus-registry-misc-menus): Variable to hold registry mark menus.
(gnus-registry-install-shortcuts): Populate and use it in a
`gnus-summary-menu-hook' lambda, under "Gnus"->"Registry Marks".
2010-03-20 Martin Stjernholm <mast@lysator.liu.se>
* nnimap.el (nnimap-decode-group-name, nnimap-encode-group-name):
In-place substitutions for the group name encoding/decoding.
(nnimap-find-minmax-uid, nnimap-possibly-change-group)
(nnimap-retrieve-headers-progress, nnimap-possibly-change-group)
(nnimap-retrieve-headers-progress, nnimap-request-article-part)
(nnimap-update-unseen, nnimap-request-list)
(nnimap-retrieve-groups, nnimap-request-update-info-internal)
(nnimap-request-set-mark, nnimap-split-to-groups)
(nnimap-split-articles, nnimap-request-newgroups)
(nnimap-request-create-group, nnimap-request-accept-article)
(nnimap-request-delete-group, nnimap-request-rename-group)
(nnimap-acl-get, nnimap-acl-edit): Use them. Replace `mbx' with
`encoded-mbx' for consistency.
(nnimap-close-group): Call `imap-current-mailbox' instead of using the
variable `imap-current-mailbox'.
* gnus-agent.el (gnus-agent-fetch-articles, gnus-agent-fetch-headers)
(gnus-agent-regenerate-group): Use `gnus-agent-decoded-group-name'.
2010-03-20 Bojan Petrovic <bpetrovi@f.bg.ac.rs>
* pop3.el (pop3-display-message-size-flag): Display message size byte
counts during POP3 download.
(pop3-movemail): Use it.
(pop3-list): Implement listing of available messages.
2010-03-20 Mark Triggs <mst@dishevelled.net> (tiny change)
* nnir.el (nnir-get-article-nov-override-function): New function to
override the normal NOV retrieval.
(nnir-retrieve-headers): Use it.
2010-03-19 Michael Albinus <michael.albinus@gmx.de>
* auth-source.el (netrc-machine-user-or-password): Autoload.
......
......@@ -35,6 +35,9 @@
(eval-when-compile (require 'cl))
(autoload 'netrc-machine-user-or-password "netrc")
(autoload 'secrets-search-items "secrets")
(autoload 'secrets-get-alias "secrets")
(autoload 'secrets-get-attribute "secrets")
(defgroup auth-source nil
"Authentication sources."
......@@ -49,7 +52,7 @@
"List of authentication protocols and their names"
:group 'auth-source
:version "23.1" ;; No Gnus
:version "23.2" ;; No Gnus
:type '(repeat :tag "Authentication Protocols"
(cons :tag "Protocol Entry"
(symbol :tag "Protocol")
......@@ -71,7 +74,7 @@
(defcustom auth-source-do-cache t
"Whether auth-source should cache information."
:group 'auth-source
:version "23.1" ;; No Gnus
:version "23.2" ;; No Gnus
:type `boolean)
(defcustom auth-source-debug nil
......@@ -85,7 +88,7 @@ If the value is t, debug messages are logged with `message'.
If the value is a function, debug messages are logged by calling
that function using the same arguments as `message'."
:group 'auth-source
:version "23.1" ;; No Gnus
:version "23.2" ;; No Gnus
:type `(choice
:tag "auth-source debugging mode"
(const :tag "Log using `message' to the *Messages* buffer" t)
......@@ -96,19 +99,32 @@ If the value is a function, debug messages are logged by calling
"Whether auth-source should hide passwords in log messages.
Only relevant if `auth-source-debug' is not nil."
:group 'auth-source
:version "23.1" ;; No Gnus
:version "23.2" ;; No Gnus
:type `boolean)
(defcustom auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t))
"List of authentication sources.
Each entry is the authentication type with optional properties."
Each entry is the authentication type with optional properties.
It's best to customize this with `M-x customize-variable' because the choices
can get pretty complex."
:group 'auth-source
:version "23.1" ;; No Gnus
:version "23.2" ;; No Gnus
:type `(repeat :tag "Authentication Sources"
(list :tag "Source definition"
(const :format "" :value :source)
(string :tag "Authentication Source")
(choice :tag "Authentication backend choice"
(string :tag "Authentication Source (file)")
(list :tag "secrets.el (Secret Service API/KWallet/GNOME KeyRing)"
(const :format "" :value :secrets)
(choice :tag "Collection to use"
(string :tag "Collection name")
(const :tag "Default" 'default)
(const :tag "Any" t)
(const :tag "Temporary" "session")
(string :tag "Specific session name")
(const :tag "Fallback" nil))))
(const :format "" :value :host)
(choice :tag "Host (machine) choice"
(const :tag "Any" t)
......@@ -118,7 +134,15 @@ Each entry is the authentication type with optional properties."
(choice :tag "Protocol"
(const :tag "Any" t)
(const :tag "Fallback" nil)
,@auth-source-protocols-customize))))
,@auth-source-protocols-customize)
(repeat :tag "Extra Parameters" :inline t
(choice :tag "Extra parameter"
(list :tag "Preferred username" :inline t
(const :format "" :value :preferred-username)
(choice :tag "Personality or username"
(const :tag "Any" t)
(const :tag "Fallback" nil)
(string :tag "Specific user name"))))))))
;; temp for debugging
;; (unintern 'auth-source-protocols)
......
......@@ -1583,7 +1583,8 @@ downloaded into the agent."
(setq selected-sets (nreverse selected-sets))
(gnus-make-directory dir)
(gnus-message 7 "Fetching articles for %s..." group)
(gnus-message 7 "Fetching articles for %s..."
(gnus-agent-decoded-group-name group))
(unwind-protect
(while (setq articles (pop selected-sets))
......@@ -1594,7 +1595,8 @@ downloaded into the agent."
(let (article)
(while (setq article (pop articles))
(gnus-message 10 "Fetching article %s for %s..."
article group)
article
(gnus-agent-decoded-group-name group))
(when (or
(gnus-backlog-request-article group article
nntp-server-buffer)
......@@ -1942,7 +1944,8 @@ article numbers will be returned."
(if articles
(progn
(gnus-message 7 "Fetching headers for %s..." group)
(gnus-message 7 "Fetching headers for %s..."
(gnus-agent-decoded-group-name group))
;; Fetch them.
(gnus-make-directory (nnheader-translate-file-chars
......@@ -3904,7 +3907,7 @@ If REREAD is not nil, downloaded articles are marked as unread."
(sit-for 1)
t)))))
(when group
(gnus-message 5 "Regenerating in %s" group)
(gnus-message 5 "Regenerating in %s" (gnus-agent-decoded-group-name group))
(let* ((gnus-command-method (or gnus-command-method
(gnus-find-method-for-group group)))
(file (gnus-agent-article-name ".overview" group))
......@@ -3981,7 +3984,8 @@ If REREAD is not nil, downloaded articles are marked as unread."
(or (not nov-arts)
(> (car downloaded) (car nov-arts))))
;; This entry is missing from the overview file
(gnus-message 3 "Regenerating NOV %s %d..." group
(gnus-message 3 "Regenerating NOV %s %d..."
(gnus-agent-decoded-group-name group)
(car downloaded))
(let ((file (concat dir (number-to-string (car downloaded)))))
(mm-with-unibyte-buffer
......
......@@ -4192,6 +4192,8 @@ If variable `gnus-use-long-file-name' is non-nil, it is
(put-text-property (match-end 0) (point-max)
'face eface)))))))))
(autoload 'canlock-verify "canlock" nil t) ;; for Emacs 21.
(defun article-verify-cancel-lock ()
"Verify Cancel-Lock header."
(interactive)
......
......@@ -60,6 +60,7 @@
(require 'gnus-sum)
(require 'gnus-util)
(require 'nnmail)
(require 'easymenu)
(defvar gnus-adaptive-word-syntax-table)
......@@ -137,6 +138,10 @@ references.'"
(const :tag "Always Install" t)
(const :tag "Ask Me" ask)))
(defvar gnus-summary-misc-menu) ;; Avoid byte compiler warning.
(defvar gnus-registry-misc-menus nil) ; ugly way to keep the menus
(defcustom gnus-registry-clean-empty t
"Whether the empty registry entries should be deleted.
Registry entries are considered empty when they have no groups
......@@ -764,7 +769,8 @@ FUNCTION should take two parameters, a mark symbol and the cell value."
"Install the keyboard shortcuts and menus for the registry.
Uses `gnus-registry-marks' to find what shortcuts to install."
(let (keys-plist)
(gnus-registry-do-marks
(setq gnus-registry-misc-menus nil)
(gnus-registry-do-marks
:char
(lambda (mark data)
(let ((function-format
......@@ -813,19 +819,34 @@ Uses `gnus-registry-marks' to find what shortcuts to install."
;; all this just to get the mark, I must be doing it wrong
(intern ,(symbol-name mark))
articles ,remove t)
(gnus-message
9
"Applying mark %s to %d articles"
,(symbol-name mark) (length articles))
(dolist (article articles)
(gnus-summary-update-article
article
article
(assoc article (gnus-data-list nil)))))))
(push (intern function-name) keys-plist)
(push shortcut keys-plist)
(gnus-message
(push shortcut keys-plist)
(push (vector (format "%s %s"
(upcase-initials variant-name)
(symbol-name mark))
(intern function-name) t)
gnus-registry-misc-menus)
(gnus-message
9
"Defined mark handling function %s"
function-name))))))
(gnus-define-keys-1
'(gnus-registry-mark-map "M" gnus-summary-mark-map)
keys-plist)))
'(gnus-registry-mark-map "M" gnus-summary-mark-map)
keys-plist)
(add-hook 'gnus-summary-menu-hook
(lambda ()
(easy-menu-add-item
gnus-summary-misc-menu
nil
(cons "Registry Marks" gnus-registry-misc-menus))))))
;;; use like this:
;;; (defalias 'gnus-user-format-function-M
......
......@@ -2635,17 +2635,6 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs))))
["Set expirable mark" gnus-summary-mark-as-expirable t]
["Set bookmark" gnus-summary-set-bookmark t]
["Remove bookmark" gnus-summary-remove-bookmark t])
("Registry Mark"
["Important" gnus-registry-set-article-Important-mark t]
["Not Important" gnus-registry-remove-article-Important-mark t]
["Work" gnus-registry-set-article-Work-mark t]
["Not Work" gnus-registry-remove-article-Work-mark t]
["Later" gnus-registry-set-article-Later-mark t]
["Not Later" gnus-registry-remove-article-Later-mark t]
["Personal" gnus-registry-set-article-Personal-mark t]
["Not Personal" gnus-registry-remove-article-Personal-mark t]
["To Do" gnus-registry-set-article-To-Do-mark t]
["Not To Do" gnus-registry-remove-article-To-Do-mark t])
("Limit to"
["Marks..." gnus-summary-limit-to-marks t]
["Subject..." gnus-summary-limit-to-subject t]
......@@ -2691,6 +2680,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs))))
gnus-newsgroup-process-stack]
["Save" gnus-summary-save-process-mark t]
["Run command on marked..." gnus-summary-universal-argument t]))
("Registry Marks")
("Scroll article"
["Page forward" gnus-summary-next-page
,@(if (featurep 'xemacs) '(t)
......
......@@ -2850,6 +2850,8 @@ See also `message-forbidden-properties'."
(inhibit-read-only t))
(remove-text-properties begin end message-forbidden-properties))))
(autoload 'ecomplete-setup "ecomplete") ;; for Emacs <23.
;;;###autoload
(define-derived-mode message-mode text-mode "Message"
"Major mode for editing mail and news to be sent.
......
......@@ -105,12 +105,18 @@ details."
:group 'message
:type 'boolean)
(defcustom mml-secure-cache-passphrase password-cache
(defcustom mml-secure-cache-passphrase
(if (boundp 'password-cache)
password-cache
t)
"If t, cache passphrase."
:group 'message
:type 'boolean)
(defcustom mml-secure-passphrase-cache-expiry password-cache-expiry
(defcustom mml-secure-passphrase-cache-expiry
(if (boundp 'password-cache-expiry)
password-cache-expiry
16)
"How many seconds the passphrase is cached.
Whether the passphrase is cached at all is controlled by
`mml-secure-cache-passphrase'."
......
This diff is collapsed.
......@@ -358,6 +358,14 @@
(defvar nnir-imap-search-argument-history ()
"The history for querying search options in nnir")
(defvar nnir-get-article-nov-override-function nil
"If non-nil, a function that will be passed each search result. This
should return a message's headers in NOV format.
If this variable is nil, or if the provided function returns nil for a search
result, `gnus-retrieve-headers' will be called instead.")
;;; Developer Extension Variable:
(defvar nnir-engines
......@@ -779,25 +787,31 @@ and show thread that contains this article."
(nnir-possibly-change-server server)
(let ((gnus-override-method
(gnus-server-to-method server)))
(case (setq foo (gnus-retrieve-headers (list artno) artfullgroup nil))
(nov
(goto-char (point-min))
(setq novitem (nnheader-parse-nov))
(unless novitem
(pop-to-buffer nntp-server-buffer)
(error
"nnheader-parse-nov returned nil for article %s in group %s"
artno artfullgroup)))
(headers
(goto-char (point-min))
(setq novitem (nnheader-parse-head))
(unless novitem
(pop-to-buffer nntp-server-buffer)
(error
"nnheader-parse-head returned nil for article %s in group %s"
artno artfullgroup)))
(t (error "Unknown header type %s while requesting article %s of group %s"
foo artno artfullgroup))))
;; if nnir-get-article-nov-override-function is set, use it
(if nnir-get-article-nov-override-function
(setq novitem (funcall nnir-get-article-nov-override-function
artitem))
;; else, set novitem through nnheader-parse-nov/nnheader-parse-head
(case (setq foo (gnus-retrieve-headers (list artno)
artfullgroup nil))
(nov
(goto-char (point-min))
(setq novitem (nnheader-parse-nov))
(unless novitem
(pop-to-buffer nntp-server-buffer)
(error
"nnheader-parse-nov returned nil for article %s in group %s"
artno artfullgroup)))
(headers
(goto-char (point-min))
(setq novitem (nnheader-parse-head))
(unless novitem
(pop-to-buffer nntp-server-buffer)
(error
"nnheader-parse-head returned nil for article %s in group %s"
artno artfullgroup)))
(t (error "Unknown header type %s while requesting article %s of group %s"
foo artno artfullgroup)))))
;; replace article number in original group with article number
;; in nnir group
(mail-header-set-number novitem art)
......
......@@ -98,6 +98,12 @@ thing can fall apart and leave you with a corrupt mailbox."
:type 'boolean
:group 'pop3)
(defcustom pop3-display-message-size-flag t
"*If non-nil, display the size of the message that is being fetched."
:version "22.1" ;; Oort Gnus
:type 'boolean
:group 'pop3)
(defvar pop3-timestamp nil
"Timestamp returned when initially connected to the POP server.
Used for APOP authentication.")
......@@ -135,6 +141,7 @@ Shorter values mean quicker response, but are more CPU intensive.")
(crashbuf (get-buffer-create " *pop3-retr*"))
(n 1)
message-count
message-sizes
(pop3-password pop3-password))
;; for debugging only
(if pop3-debug (switch-to-buffer (process-buffer process)))
......@@ -149,10 +156,18 @@ Shorter values mean quicker response, but are more CPU intensive.")
(pop3-pass process))
(t (error "Invalid POP3 authentication scheme")))
(setq message-count (car (pop3-stat process)))
(when (and pop3-display-message-size-flag
(> message-count 0))
(setq message-sizes (pop3-list process)))
(unwind-protect
(while (<= n message-count)
(message "Retrieving message %d of %d from %s..."
n message-count pop3-mailhost)
(if pop3-display-message-size-flag
(message "Retrieving message %d of %d from %s... (%.1fk)"
n message-count pop3-mailhost
(/ (cdr (assoc n message-sizes))
1024.0))
(message "Retrieving message %d of %d from %s..."
n message-count pop3-mailhost))
(pop3-retr process n crashbuf)
(save-excursion
(set-buffer crashbuf)
......@@ -451,8 +466,28 @@ If NOW, use that time instead."
))
(defun pop3-list (process &optional msg)
"Scan listing of available messages.
This function currently does nothing.")
"If MSG is nil, return an alist of (MESSAGE-ID . SIZE) pairs.
Otherwise, return the size of the message-id MSG"
(pop3-send-command process (if msg
(format "LIST %d" msg)
"LIST"))
(let ((response (pop3-read-response process t)))
(if msg
(string-to-number (nth 2 (split-string response " ")))
(let ((start pop3-read-point) end)
(save-excursion
(set-buffer (process-buffer process))
(while (not (re-search-forward "^\\.\r\n" nil t))
(pop3-accept-process-output process)
(goto-char start))
(setq pop3-read-point (point-marker))
(goto-char (match-beginning 0))
(setq end (point-marker))
(mapcar #'(lambda (s) (let ((split (split-string s " ")))
(cons (string-to-number (nth 0 split))
(string-to-number (nth 1 split)))))
(delete "" (split-string (buffer-substring start end)
"\r\n"))))))))
(defun pop3-retr (process msg crashbuf)
"Retrieve message-id MSG to buffer CRASHBUF."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment