Commit 39f53f4d authored by Eric Abrahamsen's avatar Eric Abrahamsen

Obsolete and remove nmail-group-names-not-encoded-p

* lisp/gnus/nnmail.el (nnmail-group-names-not-encoded-p): Use
  make-obsolete-variable.
  (nnmail-split-incoming): Do not bind.
* lisp/gnus/nnml.el (nnml-save-mail, nnml-active-number): Remove
  check.
  (nnml-request-group, nnml-request-expire-articles): Group name is
  already decoded, don't decode again.
parent 8e5cfb97
Pipeline #1409 passed with stage
in 64 minutes and 37 seconds
...@@ -1026,8 +1026,8 @@ If SOURCE is a directory spec, try to return the group name component." ...@@ -1026,8 +1026,8 @@ If SOURCE is a directory spec, try to return the group name component."
(nnmail-check-duplication message-id func artnum-func)) (nnmail-check-duplication message-id func artnum-func))
1)) 1))
(defvar nnmail-group-names-not-encoded-p t (make-obsolete-variable 'nnmail-group-names-not-encoded-p
"Non-nil means group names are not encoded.") "Group names are always decoded" "27.1")
(defun nnmail-split-incoming (incoming func &optional exit-func (defun nnmail-split-incoming (incoming func &optional exit-func
group artnum-func junk-func) group artnum-func junk-func)
...@@ -1035,13 +1035,12 @@ If SOURCE is a directory spec, try to return the group name component." ...@@ -1035,13 +1035,12 @@ If SOURCE is a directory spec, try to return the group name component."
FUNC will be called with the buffer narrowed to each mail. FUNC will be called with the buffer narrowed to each mail.
INCOMING can also be a buffer object. In that case, the mail INCOMING can also be a buffer object. In that case, the mail
will be copied over from that buffer." will be copied over from that buffer."
(let ( ;; If this is a group-specific split, we bind the split (let (;; If this is a group-specific split, we bind the split
;; methods to just this group. ;; methods to just this group.
(nnmail-split-methods (if (and group (nnmail-split-methods (if (and group
(not nnmail-resplit-incoming)) (not nnmail-resplit-incoming))
(list (list group "")) (list (list group ""))
nnmail-split-methods)) nnmail-split-methods)))
(nnmail-group-names-not-encoded-p t))
;; Insert the incoming file. ;; Insert the incoming file.
(with-current-buffer (get-buffer-create nnmail-article-buffer) (with-current-buffer (get-buffer-create nnmail-article-buffer)
(erase-buffer) (erase-buffer)
......
...@@ -125,11 +125,9 @@ non-nil.") ...@@ -125,11 +125,9 @@ non-nil.")
(defun nnml-decoded-group-name (group &optional server-or-method) (defun nnml-decoded-group-name (group &optional server-or-method)
"Return a decoded group name of GROUP on SERVER-OR-METHOD." "Return a decoded group name of GROUP on SERVER-OR-METHOD."
(if nnmail-group-names-not-encoded-p (decode-coding-string
group group
(decode-coding-string (nnml-group-name-charset group server-or-method)))
group
(nnml-group-name-charset group server-or-method))))
(defun nnml-encoded-group-name (group &optional server-or-method) (defun nnml-encoded-group-name (group &optional server-or-method)
"Return an encoded group name of GROUP on SERVER-OR-METHOD." "Return an encoded group name of GROUP on SERVER-OR-METHOD."
...@@ -243,8 +241,7 @@ non-nil.") ...@@ -243,8 +241,7 @@ non-nil.")
(string-to-number (file-name-nondirectory path))))))) (string-to-number (file-name-nondirectory path)))))))
(deffoo nnml-request-group (group &optional server dont-check info) (deffoo nnml-request-group (group &optional server dont-check info)
(let ((file-name-coding-system nnmail-pathname-coding-system) (let ((file-name-coding-system nnmail-pathname-coding-system))
(decoded (nnml-decoded-group-name group server)))
(cond (cond
((not (nnml-possibly-change-directory group server)) ((not (nnml-possibly-change-directory group server))
(nnheader-report 'nnml "Invalid group (no such directory)")) (nnheader-report 'nnml "Invalid group (no such directory)"))
...@@ -254,15 +251,15 @@ non-nil.") ...@@ -254,15 +251,15 @@ non-nil.")
((not (file-directory-p nnml-current-directory)) ((not (file-directory-p nnml-current-directory))
(nnheader-report 'nnml "%s is not a directory" nnml-current-directory)) (nnheader-report 'nnml "%s is not a directory" nnml-current-directory))
(dont-check (dont-check
(nnheader-report 'nnml "Group %s selected" decoded) (nnheader-report 'nnml "Group %s selected" group)
t) t)
(t (t
(nnheader-re-read-dir nnml-current-directory) (nnheader-re-read-dir nnml-current-directory)
(nnmail-activate 'nnml) (nnmail-activate 'nnml)
(let ((active (nth 1 (assoc-string group nnml-group-alist)))) (let ((active (nth 1 (assoc-string group nnml-group-alist))))
(if (not active) (if (not active)
(nnheader-report 'nnml "No such group: %s" decoded) (nnheader-report 'nnml "No such group: %s" group)
(nnheader-report 'nnml "Selected group %s" decoded) (nnheader-report 'nnml "Selected group %s" group)
(nnheader-insert "211 %d %d %d %s\n" (nnheader-insert "211 %d %d %d %s\n"
(max (1+ (- (cdr active) (car active))) 0) (max (1+ (- (cdr active) (car active))) 0)
(car active) (cdr active) group))))))) (car active) (cdr active) group)))))))
...@@ -332,7 +329,6 @@ non-nil.") ...@@ -332,7 +329,6 @@ non-nil.")
(active-articles (active-articles
(nnml-directory-articles nnml-current-directory)) (nnml-directory-articles nnml-current-directory))
(is-old t) (is-old t)
(decoded (nnml-decoded-group-name group server))
article rest mod-time number target) article rest mod-time number target)
(nnmail-activate 'nnml) (nnmail-activate 'nnml)
...@@ -370,7 +366,7 @@ non-nil.") ...@@ -370,7 +366,7 @@ non-nil.")
(if target (if target
(progn (progn
(nnheader-message 5 "Deleting article %s in %s" (nnheader-message 5 "Deleting article %s in %s"
number decoded) number group)
(condition-case () (condition-case ()
(funcall nnmail-delete-file-function article) (funcall nnmail-delete-file-function article)
(file-error (file-error
...@@ -506,13 +502,12 @@ non-nil.") ...@@ -506,13 +502,12 @@ non-nil.")
nnml-current-directory t nnml-current-directory t
(concat (concat
nnheader-numerical-short-files nnheader-numerical-short-files
"\\|" (regexp-quote nnml-nov-file-name) "$"))) "\\|" (regexp-quote nnml-nov-file-name) "$"))))
(decoded (nnml-decoded-group-name group server)))
(dolist (article articles) (dolist (article articles)
(when (file-writable-p article) (when (file-writable-p article)
(nnheader-message 5 "Deleting article %s in %s..." (nnheader-message 5 "Deleting article %s in %s..."
(file-name-nondirectory article) (file-name-nondirectory article)
decoded) group)
(funcall nnmail-delete-file-function article)))) (funcall nnmail-delete-file-function article))))
;; Try to delete the directory itself. ;; Try to delete the directory itself.
(ignore-errors (delete-directory nnml-current-directory)))) (ignore-errors (delete-directory nnml-current-directory))))
...@@ -687,15 +682,7 @@ article number. This function is called narrowed to an article." ...@@ -687,15 +682,7 @@ article number. This function is called narrowed to an article."
(if (stringp nnml-use-compressed-files) (if (stringp nnml-use-compressed-files)
nnml-use-compressed-files nnml-use-compressed-files
".gz"))) ".gz")))
decoded dec file first headers) file first headers)
(when nnmail-group-names-not-encoded-p
(dolist (ga (prog1 group-art (setq group-art nil)))
(setq group-art (nconc group-art
(list (cons (nnml-encoded-group-name (car ga)
server)
(cdr ga))))
decoded (nconc decoded (list (car ga)))))
(setq dec decoded))
(nnmail-insert-xref group-art) (nnmail-insert-xref group-art)
(run-hooks 'nnmail-prepare-save-mail-hook) (run-hooks 'nnmail-prepare-save-mail-hook)
(run-hooks 'nnml-prepare-save-mail-hook) (run-hooks 'nnml-prepare-save-mail-hook)
...@@ -705,16 +692,10 @@ article number. This function is called narrowed to an article." ...@@ -705,16 +692,10 @@ article number. This function is called narrowed to an article."
(forward-line 1)) (forward-line 1))
;; We save the article in all the groups it belongs in. ;; We save the article in all the groups it belongs in.
(dolist (ga group-art) (dolist (ga group-art)
(if nnmail-group-names-not-encoded-p (nnml-possibly-create-directory (car ga) server)
(progn (setq file (nnml-group-pathname
(nnml-possibly-create-directory (car decoded) server) (car ga) (concat (number-to-string (cdr ga)) extension)
(setq file (nnmail-group-pathname server))
(pop decoded) nnml-directory
(concat (number-to-string (cdr ga)) extension))))
(nnml-possibly-create-directory (car ga) server)
(setq file (nnml-group-pathname
(car ga) (concat (number-to-string (cdr ga)) extension)
server)))
(if first (if first
;; It was already saved, so we just make a hard link. ;; It was already saved, so we just make a hard link.
(let ((file-name-coding-system nnmail-pathname-coding-system)) (let ((file-name-coding-system nnmail-pathname-coding-system))
...@@ -731,17 +712,12 @@ article number. This function is called narrowed to an article." ...@@ -731,17 +712,12 @@ article number. This function is called narrowed to an article."
(let ((func (if full-nov (let ((func (if full-nov
'nnml-add-nov 'nnml-add-nov
'nnml-add-incremental-nov))) 'nnml-add-incremental-nov)))
(if nnmail-group-names-not-encoded-p (dolist (ga group-art)
(dolist (ga group-art) (funcall func (car ga) (cdr ga) headers))))
(funcall func (pop dec) (cdr ga) headers))
(dolist (ga group-art)
(funcall func (car ga) (cdr ga) headers)))))
group-art) group-art)
(defun nnml-active-number (group &optional server) (defun nnml-active-number (group &optional server)
"Compute the next article number in GROUP on SERVER." "Compute the next article number in GROUP on SERVER."
;; FIXME: This originally checked `nnml-group-names-not-encoded-p'
;; and maybe encoded the group name.
(let ((active (cadr (assoc-string group nnml-group-alist)))) (let ((active (cadr (assoc-string group nnml-group-alist))))
;; The group wasn't known to nnml, so we just create an active ;; The group wasn't known to nnml, so we just create an active
;; entry for it. ;; entry for it.
......
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