diff options
| author | Lars Ingebrigtsen | 2017-02-01 13:48:02 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2017-02-01 13:49:11 +0100 |
| commit | 5d61ef0de9a3f5b1be9e93465cb88aae995975ba (patch) | |
| tree | ab1620230eefe195434295995a87ff58a501a9f5 | |
| parent | d805757618092d5d46b8a95d2a046146c4916dc6 (diff) | |
| download | emacs-5d61ef0de9a3f5b1be9e93465cb88aae995975ba.tar.gz emacs-5d61ef0de9a3f5b1be9e93465cb88aae995975ba.zip | |
Revert "DOn't use string-as-unibyte in Gnus"
This reverts commit d1c931009004aef847105b7bac6b6ffafd985b82.
Not all the cases where we had string-as-unibyte were characters,
so this needs to be considered more thoroughly before being redone.
| -rw-r--r-- | lisp/gnus/canlock.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 3 | ||||
| -rw-r--r-- | lisp/gnus/gnus-srvr.el | 10 | ||||
| -rw-r--r-- | lisp/gnus/gnus-start.el | 4 | ||||
| -rw-r--r-- | lisp/gnus/mml.el | 5 | ||||
| -rw-r--r-- | lisp/gnus/nnir.el | 10 | ||||
| -rw-r--r-- | lisp/gnus/nnmail.el | 7 |
7 files changed, 17 insertions, 24 deletions
diff --git a/lisp/gnus/canlock.el b/lisp/gnus/canlock.el index 6c28b1c66df..9e13ced4670 100644 --- a/lisp/gnus/canlock.el +++ b/lisp/gnus/canlock.el | |||
| @@ -90,7 +90,7 @@ buffer does not look like a news message." | |||
| 90 | (canlock-sha1 | 90 | (canlock-sha1 |
| 91 | (concat opad | 91 | (concat opad |
| 92 | (canlock-sha1 | 92 | (canlock-sha1 |
| 93 | (concat ipad (encode-coding-string message-id 'utf-8)))))))) | 93 | (concat ipad (string-as-unibyte message-id)))))))) |
| 94 | 94 | ||
| 95 | (defun canlock-narrow-to-header () | 95 | (defun canlock-narrow-to-header () |
| 96 | "Narrow the buffer to the head of the message." | 96 | "Narrow the buffer to the head of the message." |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index d96c511ec0d..a4ff840f755 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -2938,8 +2938,7 @@ message header will be added to the bodies of the \"text/html\" parts." | |||
| 2938 | (encode-coding-string | 2938 | (encode-coding-string |
| 2939 | title coding)) | 2939 | title coding)) |
| 2940 | body content)) | 2940 | body content)) |
| 2941 | (setq eheader (encode-coding-string | 2941 | (setq eheader (string-as-unibyte (buffer-string)) |
| 2942 | (buffer-string) 'utf-8) | ||
| 2943 | body content))) | 2942 | body content))) |
| 2944 | (erase-buffer) | 2943 | (erase-buffer) |
| 2945 | (mm-disable-multibyte) | 2944 | (mm-disable-multibyte) |
diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el index 67744cebc87..bed5993b9c1 100644 --- a/lisp/gnus/gnus-srvr.el +++ b/lisp/gnus/gnus-srvr.el | |||
| @@ -821,13 +821,12 @@ claim them." | |||
| 821 | (while (not (eobp)) | 821 | (while (not (eobp)) |
| 822 | (ignore-errors | 822 | (ignore-errors |
| 823 | (push (cons | 823 | (push (cons |
| 824 | (encode-coding-string | 824 | (string-as-unibyte |
| 825 | (buffer-substring | 825 | (buffer-substring |
| 826 | (point) | 826 | (point) |
| 827 | (progn | 827 | (progn |
| 828 | (skip-chars-forward "^ \t") | 828 | (skip-chars-forward "^ \t") |
| 829 | (point))) | 829 | (point)))) |
| 830 | 'utf-8) | ||
| 831 | (let ((last (read cur))) | 830 | (let ((last (read cur))) |
| 832 | (cons (read cur) last))) | 831 | (cons (read cur) last))) |
| 833 | groups)) | 832 | groups)) |
| @@ -835,7 +834,7 @@ claim them." | |||
| 835 | (while (not (eobp)) | 834 | (while (not (eobp)) |
| 836 | (ignore-errors | 835 | (ignore-errors |
| 837 | (push (cons | 836 | (push (cons |
| 838 | (encode-coding-string | 837 | (string-as-unibyte |
| 839 | (if (eq (char-after) ?\") | 838 | (if (eq (char-after) ?\") |
| 840 | (read cur) | 839 | (read cur) |
| 841 | (let ((p (point)) (name "")) | 840 | (let ((p (point)) (name "")) |
| @@ -847,8 +846,7 @@ claim them." | |||
| 847 | (skip-chars-forward "^ \t\\\\") | 846 | (skip-chars-forward "^ \t\\\\") |
| 848 | (setq name (concat name (buffer-substring | 847 | (setq name (concat name (buffer-substring |
| 849 | p (point))))) | 848 | p (point))))) |
| 850 | name)) | 849 | name))) |
| 851 | 'utf-8) | ||
| 852 | (let ((last (read cur))) | 850 | (let ((last (read cur))) |
| 853 | (cons (read cur) last))) | 851 | (cons (read cur) last))) |
| 854 | groups)) | 852 | groups)) |
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 2cefc78fb9e..be46339cd38 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el | |||
| @@ -1990,7 +1990,7 @@ backend check whether the group actually exists." | |||
| 1990 | (while lists | 1990 | (while lists |
| 1991 | (setq killed (car lists)) | 1991 | (setq killed (car lists)) |
| 1992 | (while killed | 1992 | (while killed |
| 1993 | (gnus-sethash (encode-coding-string (car killed) 'utf-8) nil hashtb) | 1993 | (gnus-sethash (string-as-unibyte (car killed)) nil hashtb) |
| 1994 | (setq killed (cdr killed))) | 1994 | (setq killed (cdr killed))) |
| 1995 | (setq lists (cdr lists))))) | 1995 | (setq lists (cdr lists))))) |
| 1996 | 1996 | ||
| @@ -2453,7 +2453,7 @@ If FORCE is non-nil, the .newsrc file is read." | |||
| 2453 | (dolist (elem gnus-newsrc-alist) | 2453 | (dolist (elem gnus-newsrc-alist) |
| 2454 | ;; Protect against broken .newsrc.el files. | 2454 | ;; Protect against broken .newsrc.el files. |
| 2455 | (when (car elem) | 2455 | (when (car elem) |
| 2456 | (setcar elem (encode-coding-string (car elem) 'utf-8)))) | 2456 | (setcar elem (string-as-unibyte (car elem))))) |
| 2457 | (gnus-make-hashtable-from-newsrc-alist) | 2457 | (gnus-make-hashtable-from-newsrc-alist) |
| 2458 | (when (file-newer-than-file-p file ding-file) | 2458 | (when (file-newer-than-file-p file ding-file) |
| 2459 | ;; Old format quick file | 2459 | ;; Old format quick file |
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index aaadf0c7778..3a31349d378 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el | |||
| @@ -696,10 +696,9 @@ be \"related\" or \"alternate\"." | |||
| 696 | (set-buffer-multibyte nil) | 696 | (set-buffer-multibyte nil) |
| 697 | (cond | 697 | (cond |
| 698 | ((cdr (assq 'buffer cont)) | 698 | ((cdr (assq 'buffer cont)) |
| 699 | (insert (encode-coding-string | 699 | (insert (string-as-unibyte |
| 700 | (with-current-buffer (cdr (assq 'buffer cont)) | 700 | (with-current-buffer (cdr (assq 'buffer cont)) |
| 701 | (buffer-string)) | 701 | (buffer-string))))) |
| 702 | 'utf-8))) | ||
| 703 | ((and filename | 702 | ((and filename |
| 704 | (not (equal (cdr (assq 'nofile cont)) "yes"))) | 703 | (not (equal (cdr (assq 'nofile cont)) "yes"))) |
| 705 | (let ((coding-system-for-read mm-binary-coding-system)) | 704 | (let ((coding-system-for-read mm-binary-coding-system)) |
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 174be65035f..9640f2c746f 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el | |||
| @@ -1818,20 +1818,19 @@ article came from is also searched." | |||
| 1818 | (if (eq (car method) 'nntp) | 1818 | (if (eq (car method) 'nntp) |
| 1819 | (while (not (eobp)) | 1819 | (while (not (eobp)) |
| 1820 | (ignore-errors | 1820 | (ignore-errors |
| 1821 | (push (encode-coding-string | 1821 | (push (string-as-unibyte |
| 1822 | (gnus-group-full-name | 1822 | (gnus-group-full-name |
| 1823 | (buffer-substring | 1823 | (buffer-substring |
| 1824 | (point) | 1824 | (point) |
| 1825 | (progn | 1825 | (progn |
| 1826 | (skip-chars-forward "^ \t") | 1826 | (skip-chars-forward "^ \t") |
| 1827 | (point))) | 1827 | (point))) |
| 1828 | method) | 1828 | method)) |
| 1829 | 'utf-8) | ||
| 1830 | groups)) | 1829 | groups)) |
| 1831 | (forward-line)) | 1830 | (forward-line)) |
| 1832 | (while (not (eobp)) | 1831 | (while (not (eobp)) |
| 1833 | (ignore-errors | 1832 | (ignore-errors |
| 1834 | (push (encode-coding-string | 1833 | (push (string-as-unibyte |
| 1835 | (if (eq (char-after) ?\") | 1834 | (if (eq (char-after) ?\") |
| 1836 | (gnus-group-full-name (read cur) method) | 1835 | (gnus-group-full-name (read cur) method) |
| 1837 | (let ((p (point)) (name "")) | 1836 | (let ((p (point)) (name "")) |
| @@ -1843,8 +1842,7 @@ article came from is also searched." | |||
| 1843 | (skip-chars-forward "^ \t\\\\") | 1842 | (skip-chars-forward "^ \t\\\\") |
| 1844 | (setq name (concat name (buffer-substring | 1843 | (setq name (concat name (buffer-substring |
| 1845 | p (point))))) | 1844 | p (point))))) |
| 1846 | (gnus-group-full-name name method))) | 1845 | (gnus-group-full-name name method)))) |
| 1847 | 'utf-8) | ||
| 1848 | groups)) | 1846 | groups)) |
| 1849 | (forward-line))))) | 1847 | (forward-line))))) |
| 1850 | groups)) | 1848 | groups)) |
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index 224d5db5427..3f2e08171e0 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el | |||
| @@ -665,7 +665,7 @@ nn*-request-list should have been called before calling this function." | |||
| 665 | (setq group (symbol-name group))) | 665 | (setq group (symbol-name group))) |
| 666 | (if (and (numberp (setq max (read buffer))) | 666 | (if (and (numberp (setq max (read buffer))) |
| 667 | (numberp (setq min (read buffer)))) | 667 | (numberp (setq min (read buffer)))) |
| 668 | (push (list (encode-coding-string group 'utf-8) (cons min max)) | 668 | (push (list (string-as-unibyte group) (cons min max)) |
| 669 | group-assoc))) | 669 | group-assoc))) |
| 670 | (error nil)) | 670 | (error nil)) |
| 671 | (widen) | 671 | (widen) |
| @@ -1251,9 +1251,8 @@ Return the number of characters in the body." | |||
| 1251 | (insert (if (mm-multibyte-p) | 1251 | (insert (if (mm-multibyte-p) |
| 1252 | (string-as-multibyte | 1252 | (string-as-multibyte |
| 1253 | (format " %s:%d" (caar group-alist) (cdar group-alist))) | 1253 | (format " %s:%d" (caar group-alist) (cdar group-alist))) |
| 1254 | (encode-coding-string | 1254 | (string-as-unibyte |
| 1255 | (format " %s:%d" (caar group-alist) (cdar group-alist)) | 1255 | (format " %s:%d" (caar group-alist) (cdar group-alist))))) |
| 1256 | 'utf-8))) | ||
| 1257 | (setq group-alist (cdr group-alist))) | 1256 | (setq group-alist (cdr group-alist))) |
| 1258 | (insert "\n"))) | 1257 | (insert "\n"))) |
| 1259 | 1258 | ||