diff options
author | Eric Abrahamsen <eric@ericabrahamsen.net> | 2019-06-17 11:03:31 -0700 |
---|---|---|
committer | Eric Abrahamsen <eric@ericabrahamsen.net> | 2019-06-17 11:03:31 -0700 |
commit | 573e21d03415e5a05e650cfce6d252c00ae26164 (patch) | |
tree | ccceb0d8984afa302bc92040a048352d9a8723f0 | |
parent | f04141241917af9a8311a55b9f71ac99f78f7c17 (diff) | |
download | emacs-573e21d03415e5a05e650cfce6d252c00ae26164.tar.gz |
Remove Gnus group name decoding in Gnus agent
No longer necessary, as group names are already decoded.
* lisp/gnus/gnus-agent.el: Remove variable
gnus-agent-decoded-group-names and function
gnus-agent-decoded-group-name.
(gnus-agent-read-group):
(gnus-agent-group-path):
(gnus-agent-group-pathname):
(gnus-agent-fetch-articles):
(gnus-agent-fetch-headers):
(gnus-agent-expire-group-1):
(gnus-agent-regenerate-group): Remove calls in these functions.
-rw-r--r-- | lisp/gnus/gnus-agent.el | 47 |
1 files changed, 14 insertions, 33 deletions
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index f0b0a5dccd7..b932fb5d347 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -406,8 +406,6 @@ manipulated as follows: (defun gnus-agent-read-group () "Read a group name in the minibuffer, with completion." (let ((def (or (gnus-group-group-name) gnus-newsgroup-name))) - (when def - (setq def (gnus-group-decoded-name def))) (gnus-group-completing-read nil nil t nil nil def))) ;;; Fetching setup functions. @@ -1372,18 +1370,6 @@ downloaded into the agent." oactive-min (read (current-buffer))) ;; min (cons oactive-min oactive-max)))))))) -(defvar gnus-agent-decoded-group-names nil - "Alist of non-ASCII group names and decoded ones.") - -(defun gnus-agent-decoded-group-name (group) - "Return a decoded group name of GROUP." - (or (cdr (assoc group gnus-agent-decoded-group-names)) - (if (string-match "[^\000-\177]" group) - (let ((decoded (gnus-group-decoded-name group))) - (push (cons group decoded) gnus-agent-decoded-group-names) - decoded) - group))) - (defun gnus-agent-group-path (group) "Translate GROUP into a file name." @@ -1395,7 +1381,7 @@ downloaded into the agent." (nnheader-translate-file-chars (nnheader-replace-duplicate-chars-in-string (nnheader-replace-chars-in-string - (gnus-group-real-name (gnus-agent-decoded-group-name group)) + (gnus-group-real-name group) ?/ ?_) ?. ?_))) (if (or nnmail-use-long-file-names @@ -1409,7 +1395,7 @@ downloaded into the agent." ;; unplugged. The agent must, therefore, use the same directory ;; while plugged. (nnmail-group-pathname - (gnus-group-real-name (gnus-agent-decoded-group-name group)) + (gnus-group-real-name group) (if gnus-command-method (gnus-agent-directory) (let ((gnus-command-method (gnus-find-method-for-group group))) @@ -1525,8 +1511,7 @@ downloaded into the agent." (setq selected-sets (nreverse selected-sets)) (gnus-make-directory dir) - (gnus-message 7 "Fetching articles for %s..." - (gnus-agent-decoded-group-name group)) + (gnus-message 7 "Fetching articles for %s..." group) (unwind-protect (while (setq articles (pop selected-sets)) @@ -1537,8 +1522,7 @@ downloaded into the agent." (let (article) (while (setq article (pop articles)) (gnus-message 10 "Fetching article %s for %s..." - article - (gnus-agent-decoded-group-name group)) + article group) (when (or (gnus-backlog-request-article group article nntp-server-buffer) @@ -1875,8 +1859,7 @@ article numbers will be returned." (with-current-buffer nntp-server-buffer (if articles (progn - (gnus-message 8 "Fetching headers for %s..." - (gnus-agent-decoded-group-name group)) + (gnus-message 8 "Fetching headers for %s..." group) ;; Fetch them. (gnus-make-directory (nnheader-translate-file-chars @@ -3071,8 +3054,7 @@ FORCE is equivalent to setting the expiration predicates to true." ;; provided a non-nil active (let ((dir (gnus-agent-group-pathname group)) - (file-name-coding-system nnmail-pathname-coding-system) - (decoded (gnus-agent-decoded-group-name group))) + (file-name-coding-system nnmail-pathname-coding-system)) (gnus-agent-with-refreshed-group group (when (boundp 'gnus-agent-expire-current-dirs) @@ -3081,8 +3063,8 @@ FORCE is equivalent to setting the expiration predicates to true." (if (and (not force) (eq 'DISABLE (gnus-agent-find-parameter group 'agent-enable-expiration))) - (gnus-message 5 "Expiry skipping over %s" decoded) - (gnus-message 5 "Expiring articles in %s" decoded) + (gnus-message 5 "Expiry skipping over %s" group) + (gnus-message 5 "Expiring articles in %s" group) (gnus-agent-load-alist group) (let* ((bytes-freed 0) (size-files-deleted 0.0) @@ -3306,7 +3288,7 @@ line." (point) nov-file))) (keep (gnus-agent-message 10 "gnus-agent-expire: %s:%d: Kept %s article%s." - decoded article-number keep (if fetch-date " and file" "")) + group article-number keep (if fetch-date " and file" "")) (when fetch-date (unless (file-exists-p (concat dir (number-to-string @@ -3314,7 +3296,7 @@ line." (point) nov-file))) (setf (nth 1 entry) nil) (gnus-agent-message 3 "gnus-agent-expire cleared \ download flag on %s:%d as the cached article file is missing." - decoded (caar dlist))) + group (caar dlist))) (unless marker (gnus-message 1 "gnus-agent-expire detected a \ missing NOV entry. Run gnus-agent-regenerate-group to restore it."))) @@ -3392,12 +3374,12 @@ article alist" type) actions)) (when actions (gnus-agent-message 8 "gnus-agent-expire: %s:%d: %s" - decoded article-number + group article-number (mapconcat #'identity actions ", "))))) (t (gnus-agent-message 10 "gnus-agent-expire: %s:%d: Article kept as \ -expiration tests failed." decoded article-number) +expiration tests failed." group article-number) (gnus-agent-append-to-list tail-alist (cons article-number fetch-date))) ) @@ -3848,7 +3830,7 @@ If REREAD is not nil, downloaded articles are marked as unread." (sit-for 1) t))))) (when group - (gnus-message 5 "Regenerating in %s" (gnus-agent-decoded-group-name group)) + (gnus-message 5 "Regenerating in %s" group) (let* ((gnus-command-method (or gnus-command-method (gnus-find-method-for-group group))) (file (gnus-agent-article-name ".overview" group)) @@ -3925,8 +3907,7 @@ If REREAD is not nil, downloaded articles are marked as unread." (> (car downloaded) (car nov-arts)))) ;; This entry is missing from the overview file (gnus-message 3 "Regenerating NOV %s %d..." - (gnus-agent-decoded-group-name group) - (car downloaded)) + group (car downloaded)) (let ((file (concat dir (number-to-string (car downloaded))))) (mm-with-unibyte-buffer (nnheader-insert-file-contents file) |