diff options
author | Eric Abrahamsen <eric@ericabrahamsen.net> | 2018-11-16 12:53:56 -0800 |
---|---|---|
committer | Eric Abrahamsen <eric@ericabrahamsen.net> | 2019-08-03 14:52:56 -0700 |
commit | cb12a84f2c519a48dd87453c925e3bc36d9944db (patch) | |
tree | 69d5c1c16b8ba0bd2c23fccb2b5b642f7228f818 /lisp/gnus/nnmail.el | |
parent | c6b4eed80ae3529ada01ca6a5ef5d5b196e97bde (diff) | |
download | emacs-cb12a84f2c519a48dd87453c925e3bc36d9944db.tar.gz emacs-cb12a84f2c519a48dd87453c925e3bc36d9944db.tar.bz2 emacs-cb12a84f2c519a48dd87453c925e3bc36d9944db.zip |
Remove Gnus group name encoding/decoding
This completes the process started in c1b63af445. Gnus group names are
now fully decoded inside the Gnus system.
* lisp/gnus/gnus-agent.el (gnus-agent-file-coding-system): Change
default to utf-8-emacs.
(gnus-agent-decoded-group-names, gnus-agent-decoded-group-name):
Remove variable and function. Remove all usage in this file.
* lisp/gnus/gnus-cache.el (gnus-cache-decoded-group-names,
gnus-cache-unified-group-names, gnus-cache-decoded-group-name):
Remove these variables and function. Remove all usage in this file.
* lisp/gnus/gnus-group.el (gnus-tmp-decoded-group): Remove this
variable, gnus-tmp-group is now decoded.
(gnus-group-completing-read): Don't encode or decode group names
here.
(gnus-group-make-group): Remove ENCODED argument.
* lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): Decode group
names here.
* lisp/gnus/gnus-start.el (gnus-make-hashtable-from-newsrc-alist):
check for encoded group names and decode.
(gnus-active-to-gnus-format): Make sure incoming group names are
decoded.
(gnus-read-newsrc-el-file): Check for encoded group names in
gnus-topic-alist.
* lisp/gnus/nnagent.el: Don't use a unibyte buffer.
* lisp/gnus/nnheader.el (nnheader-file-coding-system): Switch default
from 'raw-text to 'undecided, on the assumption that 'undecided will
probably write 'utf-8-emacs unless the user has arranged things
otherwise.
* lisp/gnus/nnimap.el (nnimap-decode-gnus-group,
nnimap-encode-gnus-group): Remove functions and their use.
* lisp/gnus/nnmail.el (nnmail-parse-active): Remove encoding.
(nnmail-active-file-coding-system): Default to 'utf-8-emacs instead
of 'raw-text.
(nnmail-group-names-not-encoded-p): Obsolete this variable; stop
using it.
* lisp/gnus/gnus-art.el:
* lisp/gnus/gnus-cus.el:
* lisp/gnus/gnus-msg.el:
* lisp/gnus/gnus-start.el:
* lisp/gnus/gnus-sum.el:
* lisp/gnus/gnus.el:
* lisp/gnus/nnml.el:
* lisp/gnus/message.el:
* lisp/gnus/nnrss.el: Stop using gnus-group-decoded-name in all these
files.
Diffstat (limited to 'lisp/gnus/nnmail.el')
-rw-r--r-- | lisp/gnus/nnmail.el | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index 0699e818123..de6b01774d6 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -665,9 +665,12 @@ nn*-request-list should have been called before calling this function." (condition-case err (progn (narrow-to-region (point) (point-at-eol)) - (setq group (read buffer)) - (unless (stringp group) - (setq group (encode-coding-string (symbol-name group) 'latin-1))) + (setq group (read buffer) + group + (cond ((symbolp group) + (symbol-name group)) + ((numberp group) + (number-to-string group)))) (if (and (numberp (setq max (read buffer))) (numberp (setq min (read buffer)))) (push (list group (cons min max)) @@ -677,7 +680,7 @@ nn*-request-list should have been called before calling this function." (forward-line 1)) group-assoc)) -(defcustom nnmail-active-file-coding-system 'raw-text +(defcustom nnmail-active-file-coding-system 'utf-8-emacs "Coding system for active file." :group 'nnmail-various :type 'coding-system) @@ -687,7 +690,7 @@ nn*-request-list should have been called before calling this function." (let ((coding-system-for-write nnmail-active-file-coding-system)) (when file-name (with-temp-file file-name - (mm-disable-multibyte) +; (mm-disable-multibyte) (nnmail-generate-active group-assoc))))) (defun nnmail-generate-active (alist) @@ -695,7 +698,7 @@ nn*-request-list should have been called before calling this function." (erase-buffer) (let (group) (while (setq group (pop alist)) - (insert (format "%S %d %d y\n" (intern (car group)) (cdadr group) + (insert (format "%s %d %d y\n" (car group) (cdadr group) (caadr group)))) (goto-char (point-max)) (while (search-backward "\\." nil t) @@ -1027,8 +1030,8 @@ If SOURCE is a directory spec, try to return the group name component." (nnmail-check-duplication message-id func artnum-func)) 1)) -(defvar nnmail-group-names-not-encoded-p nil - "Non-nil means group names are not encoded.") +(make-obsolete-variable 'nnmail-group-names-not-encoded-p + "Group names are always decoded" "27.1") (defun nnmail-split-incoming (incoming func &optional exit-func group artnum-func junk-func) @@ -1036,18 +1039,21 @@ If SOURCE is a directory spec, try to return the group name component." FUNC will be called with the buffer narrowed to each mail. INCOMING can also be a buffer object. In that case, the mail 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. (nnmail-split-methods (if (and group (not nnmail-resplit-incoming)) (list (list group "")) - nnmail-split-methods)) - (nnmail-group-names-not-encoded-p t)) + nnmail-split-methods))) ;; Insert the incoming file. (with-current-buffer (get-buffer-create nnmail-article-buffer) (erase-buffer) (if (bufferp incoming) (insert-buffer-substring incoming) + ;; The following coding system is set to + ;; `mm-text-coding-system', which is set to some flavor of + ;; 'raw-text "to get rid of ^Ms". But it's going to do a lot + ;; more than that, right? Shouldn't this also be 'undecided? (let ((coding-system-for-read nnmail-incoming-coding-system)) (mm-insert-file-contents incoming))) (prog1 |