aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Abrahamsen2018-11-16 12:53:56 -0800
committerEric Abrahamsen2019-08-03 14:52:56 -0700
commitcb12a84f2c519a48dd87453c925e3bc36d9944db (patch)
tree69d5c1c16b8ba0bd2c23fccb2b5b642f7228f818
parentc6b4eed80ae3529ada01ca6a5ef5d5b196e97bde (diff)
downloademacs-cb12a84f2c519a48dd87453c925e3bc36d9944db.tar.gz
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.
-rw-r--r--lisp/gnus/gnus-agent.el58
-rw-r--r--lisp/gnus/gnus-art.el4
-rw-r--r--lisp/gnus/gnus-cache.el41
-rw-r--r--lisp/gnus/gnus-cus.el5
-rw-r--r--lisp/gnus/gnus-group.el209
-rw-r--r--lisp/gnus/gnus-msg.el3
-rw-r--r--lisp/gnus/gnus-srvr.el45
-rw-r--r--lisp/gnus/gnus-start.el43
-rw-r--r--lisp/gnus/gnus-sum.el113
-rw-r--r--lisp/gnus/gnus-util.el7
-rw-r--r--lisp/gnus/gnus.el4
-rw-r--r--lisp/gnus/message.el21
-rw-r--r--lisp/gnus/nnagent.el23
-rw-r--r--lisp/gnus/nnheader.el7
-rw-r--r--lisp/gnus/nnimap.el62
-rw-r--r--lisp/gnus/nnmail.el28
-rw-r--r--lisp/gnus/nnmaildir.el2
-rw-r--r--lisp/gnus/nnml.el92
-rw-r--r--lisp/gnus/nnrss.el2
19 files changed, 276 insertions, 493 deletions
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 40d0d246056..d9c9e940700 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -229,7 +229,7 @@ NOTES:
229 "Cache of message subjects for spam messages. 229 "Cache of message subjects for spam messages.
230Actually a hash table holding subjects mapped to t.") 230Actually a hash table holding subjects mapped to t.")
231(defvar gnus-agent-file-name nil) 231(defvar gnus-agent-file-name nil)
232(defvar gnus-agent-file-coding-system 'raw-text) 232(defvar gnus-agent-file-coding-system 'utf-8-emacs)
233(defvar gnus-agent-file-loading-cache nil) 233(defvar gnus-agent-file-loading-cache nil)
234(defvar gnus-agent-total-fetched-hashtb nil) 234(defvar gnus-agent-total-fetched-hashtb nil)
235(defvar gnus-agent-inhibit-update-total-fetched-for nil) 235(defvar gnus-agent-inhibit-update-total-fetched-for nil)
@@ -406,8 +406,6 @@ manipulated as follows:
406(defun gnus-agent-read-group () 406(defun gnus-agent-read-group ()
407 "Read a group name in the minibuffer, with completion." 407 "Read a group name in the minibuffer, with completion."
408 (let ((def (or (gnus-group-group-name) gnus-newsgroup-name))) 408 (let ((def (or (gnus-group-group-name) gnus-newsgroup-name)))
409 (when def
410 (setq def (gnus-group-decoded-name def)))
411 (gnus-group-completing-read nil nil t nil nil def))) 409 (gnus-group-completing-read nil nil t nil nil def)))
412 410
413;;; Fetching setup functions. 411;;; Fetching setup functions.
@@ -1330,7 +1328,10 @@ downloaded into the agent."
1330 (gnus-make-directory (file-name-directory file)) 1328 (gnus-make-directory (file-name-directory file))
1331 (with-temp-file file 1329 (with-temp-file file
1332 ;; Emacs got problem to match non-ASCII group in multibyte buffer. 1330 ;; Emacs got problem to match non-ASCII group in multibyte buffer.
1333 (mm-disable-multibyte) 1331
1332 ;; FIXME: Is this still an issue now that group names are
1333 ;; always strings?
1334 ;(mm-disable-multibyte)
1334 (when (file-exists-p file) 1335 (when (file-exists-p file)
1335 (nnheader-insert-file-contents file) 1336 (nnheader-insert-file-contents file)
1336 1337
@@ -1360,7 +1361,7 @@ downloaded into the agent."
1360 (gnus-make-directory (file-name-directory file)) 1361 (gnus-make-directory (file-name-directory file))
1361 (with-temp-buffer 1362 (with-temp-buffer
1362 ;; Emacs got problem to match non-ASCII group in multibyte buffer. 1363 ;; Emacs got problem to match non-ASCII group in multibyte buffer.
1363 (mm-disable-multibyte) 1364 ;(mm-disable-multibyte)
1364 (when (file-exists-p file) 1365 (when (file-exists-p file)
1365 (nnheader-insert-file-contents file) 1366 (nnheader-insert-file-contents file)
1366 1367
@@ -1372,18 +1373,6 @@ downloaded into the agent."
1372 oactive-min (read (current-buffer))) ;; min 1373 oactive-min (read (current-buffer))) ;; min
1373 (cons oactive-min oactive-max)))))))) 1374 (cons oactive-min oactive-max))))))))
1374 1375
1375(defvar gnus-agent-decoded-group-names nil
1376 "Alist of non-ASCII group names and decoded ones.")
1377
1378(defun gnus-agent-decoded-group-name (group)
1379 "Return a decoded group name of GROUP."
1380 (or (cdr (assoc group gnus-agent-decoded-group-names))
1381 (if (string-match "[^\000-\177]" group)
1382 (let ((decoded (gnus-group-decoded-name group)))
1383 (push (cons group decoded) gnus-agent-decoded-group-names)
1384 decoded)
1385 group)))
1386
1387(defun gnus-agent-group-path (group) 1376(defun gnus-agent-group-path (group)
1388 "Translate GROUP into a file name." 1377 "Translate GROUP into a file name."
1389 1378
@@ -1395,7 +1384,7 @@ downloaded into the agent."
1395 (nnheader-translate-file-chars 1384 (nnheader-translate-file-chars
1396 (nnheader-replace-duplicate-chars-in-string 1385 (nnheader-replace-duplicate-chars-in-string
1397 (nnheader-replace-chars-in-string 1386 (nnheader-replace-chars-in-string
1398 (gnus-group-real-name (gnus-agent-decoded-group-name group)) 1387 (gnus-group-real-name group)
1399 ?/ ?_) 1388 ?/ ?_)
1400 ?. ?_))) 1389 ?. ?_)))
1401 (if (or nnmail-use-long-file-names 1390 (if (or nnmail-use-long-file-names
@@ -1409,7 +1398,7 @@ downloaded into the agent."
1409 ;; unplugged. The agent must, therefore, use the same directory 1398 ;; unplugged. The agent must, therefore, use the same directory
1410 ;; while plugged. 1399 ;; while plugged.
1411 (nnmail-group-pathname 1400 (nnmail-group-pathname
1412 (gnus-group-real-name (gnus-agent-decoded-group-name group)) 1401 (gnus-group-real-name group)
1413 (if gnus-command-method 1402 (if gnus-command-method
1414 (gnus-agent-directory) 1403 (gnus-agent-directory)
1415 (let ((gnus-command-method (gnus-find-method-for-group group))) 1404 (let ((gnus-command-method (gnus-find-method-for-group group)))
@@ -1437,7 +1426,7 @@ downloaded into the agent."
1437 (format " *Gnus agent %s history*" 1426 (format " *Gnus agent %s history*"
1438 (gnus-agent-method))))) 1427 (gnus-agent-method)))))
1439 gnus-agent-history-buffers) 1428 gnus-agent-history-buffers)
1440 (mm-disable-multibyte) ;; everything is binary 1429 ;(mm-disable-multibyte) ;; everything is binary
1441 (erase-buffer) 1430 (erase-buffer)
1442 (insert "\n") 1431 (insert "\n")
1443 (let ((file (gnus-agent-lib-file "history"))) 1432 (let ((file (gnus-agent-lib-file "history")))
@@ -1525,8 +1514,7 @@ downloaded into the agent."
1525 (setq selected-sets (nreverse selected-sets)) 1514 (setq selected-sets (nreverse selected-sets))
1526 1515
1527 (gnus-make-directory dir) 1516 (gnus-make-directory dir)
1528 (gnus-message 7 "Fetching articles for %s..." 1517 (gnus-message 7 "Fetching articles for %s..." group)
1529 (gnus-agent-decoded-group-name group))
1530 1518
1531 (unwind-protect 1519 (unwind-protect
1532 (while (setq articles (pop selected-sets)) 1520 (while (setq articles (pop selected-sets))
@@ -1537,8 +1525,7 @@ downloaded into the agent."
1537 (let (article) 1525 (let (article)
1538 (while (setq article (pop articles)) 1526 (while (setq article (pop articles))
1539 (gnus-message 10 "Fetching article %s for %s..." 1527 (gnus-message 10 "Fetching article %s for %s..."
1540 article 1528 article group)
1541 (gnus-agent-decoded-group-name group))
1542 (when (or 1529 (when (or
1543 (gnus-backlog-request-article group article 1530 (gnus-backlog-request-article group article
1544 nntp-server-buffer) 1531 nntp-server-buffer)
@@ -1875,8 +1862,7 @@ article numbers will be returned."
1875 (with-current-buffer nntp-server-buffer 1862 (with-current-buffer nntp-server-buffer
1876 (if articles 1863 (if articles
1877 (progn 1864 (progn
1878 (gnus-message 8 "Fetching headers for %s..." 1865 (gnus-message 8 "Fetching headers for %s..." group)
1879 (gnus-agent-decoded-group-name group))
1880 1866
1881 ;; Fetch them. 1867 ;; Fetch them.
1882 (gnus-make-directory (nnheader-translate-file-chars 1868 (gnus-make-directory (nnheader-translate-file-chars
@@ -3058,8 +3044,7 @@ FORCE is equivalent to setting the expiration predicates to true."
3058 ;; provided a non-nil active 3044 ;; provided a non-nil active
3059 3045
3060 (let ((dir (gnus-agent-group-pathname group)) 3046 (let ((dir (gnus-agent-group-pathname group))
3061 (file-name-coding-system nnmail-pathname-coding-system) 3047 (file-name-coding-system nnmail-pathname-coding-system))
3062 (decoded (gnus-agent-decoded-group-name group)))
3063 (gnus-agent-with-refreshed-group 3048 (gnus-agent-with-refreshed-group
3064 group 3049 group
3065 (when (boundp 'gnus-agent-expire-current-dirs) 3050 (when (boundp 'gnus-agent-expire-current-dirs)
@@ -3068,8 +3053,8 @@ FORCE is equivalent to setting the expiration predicates to true."
3068 (if (and (not force) 3053 (if (and (not force)
3069 (eq 'DISABLE (gnus-agent-find-parameter group 3054 (eq 'DISABLE (gnus-agent-find-parameter group
3070 'agent-enable-expiration))) 3055 'agent-enable-expiration)))
3071 (gnus-message 5 "Expiry skipping over %s" decoded) 3056 (gnus-message 5 "Expiry skipping over %s" group)
3072 (gnus-message 5 "Expiring articles in %s" decoded) 3057 (gnus-message 5 "Expiring articles in %s" group)
3073 (gnus-agent-load-alist group) 3058 (gnus-agent-load-alist group)
3074 (let* ((bytes-freed 0) 3059 (let* ((bytes-freed 0)
3075 (size-files-deleted 0.0) 3060 (size-files-deleted 0.0)
@@ -3293,7 +3278,7 @@ line." (point) nov-file)))
3293 (keep 3278 (keep
3294 (gnus-agent-message 10 3279 (gnus-agent-message 10
3295 "gnus-agent-expire: %s:%d: Kept %s article%s." 3280 "gnus-agent-expire: %s:%d: Kept %s article%s."
3296 decoded article-number keep (if fetch-date " and file" "")) 3281 group article-number keep (if fetch-date " and file" ""))
3297 (when fetch-date 3282 (when fetch-date
3298 (unless (file-exists-p 3283 (unless (file-exists-p
3299 (concat dir (number-to-string 3284 (concat dir (number-to-string
@@ -3301,7 +3286,7 @@ line." (point) nov-file)))
3301 (setf (nth 1 entry) nil) 3286 (setf (nth 1 entry) nil)
3302 (gnus-agent-message 3 "gnus-agent-expire cleared \ 3287 (gnus-agent-message 3 "gnus-agent-expire cleared \
3303download flag on %s:%d as the cached article file is missing." 3288download flag on %s:%d as the cached article file is missing."
3304 decoded (caar dlist))) 3289 group (caar dlist)))
3305 (unless marker 3290 (unless marker
3306 (gnus-message 1 "gnus-agent-expire detected a \ 3291 (gnus-message 1 "gnus-agent-expire detected a \
3307missing NOV entry. Run gnus-agent-regenerate-group to restore it."))) 3292missing NOV entry. Run gnus-agent-regenerate-group to restore it.")))
@@ -3379,12 +3364,12 @@ article alist" type) actions))
3379 3364
3380 (when actions 3365 (when actions
3381 (gnus-agent-message 8 "gnus-agent-expire: %s:%d: %s" 3366 (gnus-agent-message 8 "gnus-agent-expire: %s:%d: %s"
3382 decoded article-number 3367 group article-number
3383 (mapconcat #'identity actions ", "))))) 3368 (mapconcat #'identity actions ", ")))))
3384 (t 3369 (t
3385 (gnus-agent-message 3370 (gnus-agent-message
3386 10 "gnus-agent-expire: %s:%d: Article kept as \ 3371 10 "gnus-agent-expire: %s:%d: Article kept as \
3387expiration tests failed." decoded article-number) 3372expiration tests failed." group article-number)
3388 (gnus-agent-append-to-list 3373 (gnus-agent-append-to-list
3389 tail-alist (cons article-number fetch-date))) 3374 tail-alist (cons article-number fetch-date)))
3390 ) 3375 )
@@ -3835,7 +3820,7 @@ If REREAD is not nil, downloaded articles are marked as unread."
3835 (sit-for 1) 3820 (sit-for 1)
3836 t))))) 3821 t)))))
3837 (when group 3822 (when group
3838 (gnus-message 5 "Regenerating in %s" (gnus-agent-decoded-group-name group)) 3823 (gnus-message 5 "Regenerating in %s" group)
3839 (let* ((gnus-command-method (or gnus-command-method 3824 (let* ((gnus-command-method (or gnus-command-method
3840 (gnus-find-method-for-group group))) 3825 (gnus-find-method-for-group group)))
3841 (file (gnus-agent-article-name ".overview" group)) 3826 (file (gnus-agent-article-name ".overview" group))
@@ -3912,8 +3897,7 @@ If REREAD is not nil, downloaded articles are marked as unread."
3912 (> (car downloaded) (car nov-arts)))) 3897 (> (car downloaded) (car nov-arts))))
3913 ;; This entry is missing from the overview file 3898 ;; This entry is missing from the overview file
3914 (gnus-message 3 "Regenerating NOV %s %d..." 3899 (gnus-message 3 "Regenerating NOV %s %d..."
3915 (gnus-agent-decoded-group-name group) 3900 group (car downloaded))
3916 (car downloaded))
3917 (let ((file (concat dir (number-to-string (car downloaded))))) 3901 (let ((file (concat dir (number-to-string (car downloaded)))))
3918 (mm-with-unibyte-buffer 3902 (mm-with-unibyte-buffer
3919 (nnheader-insert-file-contents file) 3903 (nnheader-insert-file-contents file)
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 8f5a313c618..af8ec68ddd2 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -4506,9 +4506,7 @@ commands:
4506(defun gnus-article-setup-buffer () 4506(defun gnus-article-setup-buffer ()
4507 "Initialize the article buffer." 4507 "Initialize the article buffer."
4508 (let* ((name (if gnus-single-article-buffer "*Article*" 4508 (let* ((name (if gnus-single-article-buffer "*Article*"
4509 (concat "*Article " 4509 (concat "*Article " gnus-newsgroup-name "*")))
4510 (gnus-group-decoded-name gnus-newsgroup-name)
4511 "*")))
4512 (original 4510 (original
4513 (progn (string-match "\\*Article" name) 4511 (progn (string-match "\\*Article" name)
4514 (concat " *Original Article" 4512 (concat " *Original Article"
diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el
index afe8a8a416c..f43c4344dc2 100644
--- a/lisp/gnus/gnus-cache.el
+++ b/lisp/gnus/gnus-cache.el
@@ -430,41 +430,7 @@ Returns the list of articles removed."
430 (and unread (memq 'unread class)) 430 (and unread (memq 'unread class))
431 (and (not unread) (not ticked) (not dormant) (memq 'read class)))) 431 (and (not unread) (not ticked) (not dormant) (memq 'read class))))
432 432
433(defvar gnus-cache-decoded-group-names nil
434 "Alist of original group names and decoded group names.
435Decoding is done according to `gnus-group-name-charset-method-alist'
436or `gnus-group-name-charset-group-alist'.")
437
438(defvar gnus-cache-unified-group-names nil
439 "Alist of unified decoded group names and original group names.
440A group name is decoded according to
441`gnus-group-name-charset-method-alist' or
442`gnus-group-name-charset-group-alist' first, and is encoded and
443decoded again according to `nnmail-pathname-coding-system',
444`file-name-coding-system', or `default-file-name-coding-system'.
445
446It is used when asking for an original group name from a cache
447directory name, in which non-ASCII characters might have been unified
448into the ones of a certain charset particularly if the `utf-8' coding
449system for example was used.")
450
451(defun gnus-cache-decoded-group-name (group)
452 "Return a decoded group name of GROUP."
453 (or (cdr (assoc group gnus-cache-decoded-group-names))
454 (let ((decoded (gnus-group-decoded-name group))
455 (coding (or nnmail-pathname-coding-system
456 file-name-coding-system
457 default-file-name-coding-system)))
458 (push (cons group decoded) gnus-cache-decoded-group-names)
459 (push (cons (decode-coding-string
460 (encode-coding-string decoded coding)
461 coding)
462 group)
463 gnus-cache-unified-group-names)
464 decoded)))
465
466(defun gnus-cache-file-name (group article) 433(defun gnus-cache-file-name (group article)
467 (setq group (gnus-cache-decoded-group-name group))
468 (expand-file-name 434 (expand-file-name
469 (if (stringp article) article (int-to-string article)) 435 (if (stringp article) article (int-to-string article))
470 (file-name-as-directory 436 (file-name-as-directory
@@ -733,12 +699,7 @@ If LOW, update the lower bound instead."
733 (push (pop files) alphs))) 699 (push (pop files) alphs)))
734 ;; If we have nums, then this is probably a valid group. 700 ;; If we have nums, then this is probably a valid group.
735 (when (setq nums (sort nums '<)) 701 (when (setq nums (sort nums '<))
736 ;; Use non-decoded group name. 702 (puthash group
737 ;; FIXME: this is kind of a workaround. The active file should
738 ;; be updated at the time articles are cached. It will make
739 ;; `gnus-cache-unified-group-names' needless.
740 (puthash (or (cdr (assoc group gnus-cache-unified-group-names))
741 group)
742 (cons (car nums) (car (last nums))) 703 (cons (car nums) (car (last nums)))
743 gnus-cache-active-hashtb)) 704 gnus-cache-active-hashtb))
744 ;; Go through all the other files. 705 ;; Go through all the other files.
diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el
index fb8b300e350..3598ead7613 100644
--- a/lisp/gnus/gnus-cus.el
+++ b/lisp/gnus/gnus-cus.el
@@ -396,7 +396,7 @@ category."))
396 :tag "topic parameters" 396 :tag "topic parameters"
397 "(gnus)Topic Parameters")) 397 "(gnus)Topic Parameters"))
398 (widget-insert " for <") 398 (widget-insert " for <")
399 (widget-insert (gnus-group-decoded-name (or group topic))) 399 (widget-insert (or group topic))
400 (widget-insert "> and press ") 400 (widget-insert "> and press ")
401 (widget-create 'push-button 401 (widget-create 'push-button
402 :tag "done" 402 :tag "done"
@@ -845,8 +845,7 @@ When called interactively, FILE defaults to the current score file.
845This can be changed using the `\\[gnus-score-change-score-file]' command." 845This can be changed using the `\\[gnus-score-change-score-file]' command."
846 (interactive (list gnus-current-score-file)) 846 (interactive (list gnus-current-score-file))
847 (unless file 847 (unless file
848 (error "No score file for %s" 848 (error "No score file for %s" gnus-newsgroup-name))
849 (gnus-group-decoded-name gnus-newsgroup-name)))
850 (let ((scores (gnus-score-load file)) 849 (let ((scores (gnus-score-load file))
851 (types (mapcar (lambda (entry) 850 (types (mapcar (lambda (entry)
852 `(group :format "%v%h\n" 851 `(group :format "%v%h\n"
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 299ebdec50a..7e0ceec17b6 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -479,7 +479,6 @@ simple manner."
479(defvar gnus-tmp-news-method) 479(defvar gnus-tmp-news-method)
480(defvar gnus-tmp-colon) 480(defvar gnus-tmp-colon)
481(defvar gnus-tmp-news-server) 481(defvar gnus-tmp-news-server)
482(defvar gnus-tmp-decoded-group)
483(defvar gnus-tmp-header) 482(defvar gnus-tmp-header)
484(defvar gnus-tmp-process-marked) 483(defvar gnus-tmp-process-marked)
485(defvar gnus-tmp-summary-live) 484(defvar gnus-tmp-summary-live)
@@ -518,14 +517,9 @@ simple manner."
518 (?T (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))) ?d) 517 (?T (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))) ?d)
519 (?i (+ (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked))) 518 (?i (+ (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked)))
520 (gnus-range-length (cdr (assq 'tick gnus-tmp-marked)))) ?d) 519 (gnus-range-length (cdr (assq 'tick gnus-tmp-marked)))) ?d)
521 (?g (if (boundp 'gnus-tmp-decoded-group) 520 (?g gnus-tmp-group ?s)
522 gnus-tmp-decoded-group
523 gnus-tmp-group)
524 ?s)
525 (?G gnus-tmp-qualified-group ?s) 521 (?G gnus-tmp-qualified-group ?s)
526 (?c (gnus-short-group-name (if (boundp 'gnus-tmp-decoded-group) 522 (?c (gnus-short-group-name gnus-tmp-group)
527 gnus-tmp-decoded-group
528 gnus-tmp-group))
529 ?s) 523 ?s)
530 (?C gnus-tmp-comment ?s) 524 (?C gnus-tmp-comment ?s)
531 (?D gnus-tmp-newsgroup-description ?s) 525 (?D gnus-tmp-newsgroup-description ?s)
@@ -1398,8 +1392,7 @@ if it is a string, only list groups matching REGEXP."
1398 ((functionp regexp) (funcall regexp group)))) 1392 ((functionp regexp) (funcall regexp group))))
1399 (add-text-properties 1393 (add-text-properties
1400 (point) (prog1 (1+ (point)) 1394 (point) (prog1 (1+ (point))
1401 (insert " " mark " *: " 1395 (insert " " mark " *: " group
1402 (gnus-group-decoded-name group)
1403 "\n")) 1396 "\n"))
1404 (list 'gnus-group group 1397 (list 'gnus-group group
1405 'gnus-unread t 1398 'gnus-unread t
@@ -1508,8 +1501,6 @@ if it is a string, only list groups matching REGEXP."
1508 "Insert a group line in the group buffer." 1501 "Insert a group line in the group buffer."
1509 (let* ((gnus-tmp-method 1502 (let* ((gnus-tmp-method
1510 (gnus-server-get-method gnus-tmp-group gnus-tmp-method)) 1503 (gnus-server-get-method gnus-tmp-group gnus-tmp-method))
1511 (group-name-charset (gnus-group-name-charset gnus-tmp-method
1512 gnus-tmp-group))
1513 (gnus-tmp-active (gnus-active gnus-tmp-group)) 1504 (gnus-tmp-active (gnus-active gnus-tmp-group))
1514 (gnus-tmp-number-total 1505 (gnus-tmp-number-total
1515 (if gnus-tmp-active 1506 (if gnus-tmp-active
@@ -1528,16 +1519,13 @@ if it is a string, only list groups matching REGEXP."
1528 ((= gnus-tmp-level gnus-level-zombie) ?Z) 1519 ((= gnus-tmp-level gnus-level-zombie) ?Z)
1529 (t ?K))) 1520 (t ?K)))
1530 (gnus-tmp-qualified-group 1521 (gnus-tmp-qualified-group
1531 (gnus-group-name-decode (gnus-group-real-name gnus-tmp-group) 1522 (gnus-group-real-name gnus-tmp-group))
1532 group-name-charset))
1533 (gnus-tmp-comment 1523 (gnus-tmp-comment
1534 (or (gnus-group-get-parameter gnus-tmp-group 'comment t) 1524 (or (gnus-group-get-parameter gnus-tmp-group 'comment t)
1535 gnus-tmp-group)) 1525 gnus-tmp-group))
1536 (gnus-tmp-newsgroup-description 1526 (gnus-tmp-newsgroup-description
1537 (if gnus-description-hashtb 1527 (if gnus-description-hashtb
1538 (or (gnus-group-name-decode 1528 (or (gethash gnus-tmp-group gnus-description-hashtb) "")
1539 (gethash gnus-tmp-group gnus-description-hashtb)
1540 group-name-charset) "")
1541 "")) 1529 ""))
1542 (gnus-tmp-moderated 1530 (gnus-tmp-moderated
1543 (if (and gnus-moderated-hashtb 1531 (if (and gnus-moderated-hashtb
@@ -1574,9 +1562,7 @@ if it is a string, only list groups matching REGEXP."
1574 (point) 1562 (point)
1575 (prog1 (1+ (point)) 1563 (prog1 (1+ (point))
1576 ;; Insert the text. 1564 ;; Insert the text.
1577 (let ((gnus-tmp-decoded-group (gnus-group-name-decode 1565 (eval gnus-group-line-format-spec))
1578 gnus-tmp-group group-name-charset)))
1579 (eval gnus-group-line-format-spec)))
1580 `(gnus-group ,gnus-tmp-group 1566 `(gnus-group ,gnus-tmp-group
1581 gnus-unread ,(if (numberp number) 1567 gnus-unread ,(if (numberp number)
1582 (string-to-number gnus-tmp-number-of-unread) 1568 (string-to-number gnus-tmp-number-of-unread)
@@ -2117,9 +2103,7 @@ be permanent."
2117(defun gnus-group-name-at-point () 2103(defun gnus-group-name-at-point ()
2118 "Return a group name from around point if it exists, or nil." 2104 "Return a group name from around point if it exists, or nil."
2119 (if (derived-mode-p 'gnus-group-mode) 2105 (if (derived-mode-p 'gnus-group-mode)
2120 (let ((group (gnus-group-group-name))) 2106 (gnus-group-group-name)
2121 (when group
2122 (gnus-group-decoded-name group)))
2123 ;; FIXME: Use rx. 2107 ;; FIXME: Use rx.
2124 (let ((regexp "[][\C-@-\t\v-*,/:-@\\^`{-\C-?]*\ 2108 (let ((regexp "[][\C-@-\t\v-*,/:-@\\^`{-\C-?]*\
2125\\(nn[a-z]+\\(?:\\+[^][\C-@-*,/:-@\\^`{-\C-?]+\\)?:\ 2109\\(nn[a-z]+\\(?:\\+[^][\C-@-*,/:-@\\^`{-\C-?]+\\)?:\
@@ -2160,41 +2144,25 @@ be permanent."
2160 require-match initial-input hist 2144 require-match initial-input hist
2161 def) 2145 def)
2162 "Read a group name with completion. 2146 "Read a group name with completion.
2163Non-ASCII group names are allowed. The arguments are the same as 2147The arguments are the same as `completing-read' except that
2164`completing-read' except that COLLECTION and HIST default to 2148COLLECTION and HIST default to `gnus-active-hashtb' and
2165`gnus-active-hashtb' and `gnus-group-history' respectively if 2149`gnus-group-history' respectively if they are omitted. Can
2166they are omitted. Can handle COLLECTION as a list, hash table, 2150handle COLLECTION as a list, hash table, or vector."
2167or vector." 2151 ;; This function handles vectors for backwards compatibility. In
2152 ;; theory, `collection' will only ever be a list or a hash table.
2168 (or collection (setq collection gnus-active-hashtb)) 2153 (or collection (setq collection gnus-active-hashtb))
2169 (let* ((choices 2154 (let* ((choices
2170 (mapcar
2171 (lambda (g)
2172 (if (string-match "[^\000-\177]" g)
2173 (gnus-group-decoded-name g)
2174 g))
2175 (cond ((listp collection) 2155 (cond ((listp collection)
2176 collection) 2156 collection)
2177 ((vectorp collection) 2157 ((vectorp collection)
2178 (mapatoms #'symbol-name collection)) 2158 (mapatoms #'symbol-name collection))
2179 ((hash-table-p collection) 2159 ((hash-table-p collection)
2180 (hash-table-keys collection))))) 2160 (hash-table-keys collection))))
2181 (group 2161 (group
2182 (gnus-completing-read (or prompt "Group") (reverse choices) 2162 (gnus-completing-read (or prompt "Group") (reverse choices)
2183 require-match initial-input 2163 require-match initial-input
2184 (or hist 'gnus-group-history) 2164 (or hist 'gnus-group-history)
2185 def))) 2165 def)))
2186 (unless (cond ((and (listp collection)
2187 (symbolp (car collection)))
2188 (member group (mapcar 'symbol-name collection)))
2189 ((listp collection)
2190 (member group collection))
2191 ((vectorp collection)
2192 (symbol-value (intern-soft group collection)))
2193 ((hash-table-p collection)
2194 (gethash group collection)))
2195 (setq group
2196 (encode-coding-string
2197 group (gnus-group-name-charset nil group))))
2198 (replace-regexp-in-string "\n" "" group))) 2166 (replace-regexp-in-string "\n" "" group)))
2199 2167
2200;;;###autoload 2168;;;###autoload
@@ -2755,13 +2723,13 @@ The user will be prompted for GROUP."
2755 (interactive (list (gnus-group-completing-read))) 2723 (interactive (list (gnus-group-completing-read)))
2756 (gnus-group-make-group (gnus-group-real-name group) 2724 (gnus-group-make-group (gnus-group-real-name group)
2757 (gnus-group-server group) 2725 (gnus-group-server group)
2758 nil nil t)) 2726 nil nil))
2759 2727
2760(defun gnus-group-make-group (name &optional method address args encoded) 2728(defun gnus-group-make-group (name &optional method address args)
2761 "Add a new newsgroup. 2729 "Add a new newsgroup.
2762The user will be prompted for a NAME, for a select METHOD, and an 2730The user will be prompted for a NAME, for a select METHOD, and an
2763ADDRESS. NAME should be a human-readable string (i.e., not be encoded 2731ADDRESS. NAME should be a human-readable string (i.e., not be encoded
2764even if it contains non-ASCII characters) unless ENCODED is non-nil. 2732even if it contains non-ASCII characters).
2765 2733
2766If the backend supports it, the group will also be created on the 2734If the backend supports it, the group will also be created on the
2767server." 2735server."
@@ -2772,10 +2740,6 @@ server."
2772 2740
2773 (when (stringp method) 2741 (when (stringp method)
2774 (setq method (or (gnus-server-to-method method) method))) 2742 (setq method (or (gnus-server-to-method method) method)))
2775 (unless encoded
2776 (setq name (encode-coding-string
2777 name
2778 (gnus-group-name-charset method name))))
2779 (let* ((meth (gnus-method-simplify 2743 (let* ((meth (gnus-method-simplify
2780 (when (and method 2744 (when (and method
2781 (not (gnus-server-equal method gnus-select-method))) 2745 (not (gnus-server-equal method gnus-select-method)))
@@ -2784,7 +2748,7 @@ server."
2784 (nname (if method (gnus-group-prefixed-name name meth) name)) 2748 (nname (if method (gnus-group-prefixed-name name meth) name))
2785 backend info) 2749 backend info)
2786 (when (gnus-group-entry nname) 2750 (when (gnus-group-entry nname)
2787 (error "Group %s already exists" (gnus-group-decoded-name nname))) 2751 (error "Group %s already exists" nname))
2788 ;; Subscribe to the new group. 2752 ;; Subscribe to the new group.
2789 (gnus-group-change-level 2753 (gnus-group-change-level
2790 (setq info (list t nname gnus-level-default-subscribed nil nil meth)) 2754 (setq info (list t nname gnus-level-default-subscribed nil nil meth))
@@ -2860,20 +2824,19 @@ be removed from the server, even when it's empty."
2860 (unless (gnus-check-backend-function 'request-delete-group group) 2824 (unless (gnus-check-backend-function 'request-delete-group group)
2861 (error "This back end does not support group deletion")) 2825 (error "This back end does not support group deletion"))
2862 (prog1 2826 (prog1
2863 (let ((group-decoded (gnus-group-decoded-name group))) 2827 (when (or no-prompt
2864 (when (or no-prompt 2828 (gnus-yes-or-no-p
2865 (gnus-yes-or-no-p 2829 (format
2866 (format 2830 "Do you really want to delete %s%s? "
2867 "Do you really want to delete %s%s? " 2831 group (if force " and all its contents" ""))))
2868 group-decoded (if force " and all its contents" "")))) 2832 (gnus-message 6 "Deleting group %s..." group)
2869 (gnus-message 6 "Deleting group %s..." group-decoded) 2833 (if (not (gnus-request-delete-group group force))
2870 (if (not (gnus-request-delete-group group force)) 2834 (gnus-error 3 "Couldn't delete group %s" group)
2871 (gnus-error 3 "Couldn't delete group %s" group-decoded) 2835 (gnus-message 6 "Deleting group %s...done" group)
2872 (gnus-message 6 "Deleting group %s...done" group-decoded) 2836 (gnus-group-goto-group group)
2873 (gnus-group-goto-group group) 2837 (gnus-group-kill-group 1 t)
2874 (gnus-group-kill-group 1 t) 2838 (gnus-set-active group nil)
2875 (gnus-set-active group nil) 2839 t))
2876 t)))
2877 (gnus-group-position-point))) 2840 (gnus-group-position-point)))
2878 2841
2879(defun gnus-group-rename-group (group new-name) 2842(defun gnus-group-rename-group (group new-name)
@@ -2887,13 +2850,9 @@ and NEW-NAME will be prompted for."
2887 (error "This back end does not support renaming groups")) 2850 (error "This back end does not support renaming groups"))
2888 (setq new-name (gnus-read-group 2851 (setq new-name (gnus-read-group
2889 "Rename group to: " 2852 "Rename group to: "
2890 (gnus-group-real-name (gnus-group-decoded-name group))) 2853 (gnus-group-real-name group))
2891 method (gnus-info-method (gnus-get-info group))) 2854 method (gnus-info-method (gnus-get-info group)))
2892 (list group (encode-coding-string 2855 (list group (gnus-group-prefixed-name new-name method))))
2893 new-name
2894 (gnus-group-name-charset
2895 method
2896 (gnus-group-prefixed-name new-name method))))))
2897 2856
2898 (unless (gnus-check-backend-function 'request-rename-group group) 2857 (unless (gnus-check-backend-function 'request-rename-group group)
2899 (error "This back end does not support renaming groups")) 2858 (error "This back end does not support renaming groups"))
@@ -2912,34 +2871,30 @@ and NEW-NAME will be prompted for."
2912 (gnus-group-real-name new-name) 2871 (gnus-group-real-name new-name)
2913 (gnus-info-method (gnus-get-info group))))) 2872 (gnus-info-method (gnus-get-info group)))))
2914 2873
2915 (let ((decoded-group (gnus-group-decoded-name group)) 2874 (when (gnus-active new-name)
2916 (decoded-new-name (gnus-group-decoded-name new-name))) 2875 (error "The group %s already exists" new-name))
2917 (when (gnus-active new-name)
2918 (error "The group %s already exists" decoded-new-name))
2919 2876
2920 (gnus-message 6 "Renaming group %s to %s..." 2877 (gnus-message 6 "Renaming group %s to %s..." group new-name)
2921 decoded-group decoded-new-name) 2878 (prog1
2922 (prog1 2879 (if (progn
2923 (if (progn 2880 (gnus-group-goto-group group)
2924 (gnus-group-goto-group group) 2881 (not (when (< (gnus-group-group-level) gnus-level-zombie)
2925 (not (when (< (gnus-group-group-level) gnus-level-zombie) 2882 (gnus-request-rename-group group new-name))))
2926 (gnus-request-rename-group group new-name)))) 2883 (gnus-error 3 "Couldn't rename group %s to %s"
2927 (gnus-error 3 "Couldn't rename group %s to %s" 2884 group new-name)
2928 decoded-group decoded-new-name) 2885 ;; We rename the group internally by killing it...
2929 ;; We rename the group internally by killing it... 2886 (gnus-group-kill-group)
2930 (gnus-group-kill-group) 2887 ;; ... changing its name ...
2931 ;; ... changing its name ... 2888 (setcar (cdar gnus-list-of-killed-groups) new-name)
2932 (setcar (cdar gnus-list-of-killed-groups) new-name) 2889 ;; ... and then yanking it. Magic!
2933 ;; ... and then yanking it. Magic! 2890 (gnus-group-yank-group)
2934 (gnus-group-yank-group) 2891 (gnus-set-active new-name (gnus-active group))
2935 (gnus-set-active new-name (gnus-active group)) 2892 (gnus-message 6 "Renaming group %s to %s...done" group new-name)
2936 (gnus-message 6 "Renaming group %s to %s...done" 2893 new-name)
2937 decoded-group decoded-new-name) 2894 (setq gnus-killed-list (delete group gnus-killed-list))
2938 new-name) 2895 (gnus-set-active group nil)
2939 (setq gnus-killed-list (delete group gnus-killed-list)) 2896 (gnus-dribble-touch)
2940 (gnus-set-active group nil) 2897 (gnus-group-position-point)))
2941 (gnus-dribble-touch)
2942 (gnus-group-position-point))))
2943 2898
2944(defun gnus-group-edit-group (group &optional part) 2899(defun gnus-group-edit-group (group &optional part)
2945 "Edit the group on the current line." 2900 "Edit the group on the current line."
@@ -2966,7 +2921,7 @@ and NEW-NAME will be prompted for."
2966 ((eq part 'method) "select method") 2921 ((eq part 'method) "select method")
2967 ((eq part 'params) "group parameters") 2922 ((eq part 'params) "group parameters")
2968 (t "group info")) 2923 (t "group info"))
2969 (gnus-group-decoded-name group)) 2924 group)
2970 `(lambda (form) 2925 `(lambda (form)
2971 (gnus-group-edit-group-done ',part ,group form))) 2926 (gnus-group-edit-group-done ',part ,group form)))
2972 (local-set-key 2927 (local-set-key
@@ -3105,8 +3060,7 @@ If called with a prefix argument, ask for the file type."
3105 (coding (gnus-group-name-charset method name))) 3060 (coding (gnus-group-name-charset method name)))
3106 (setcar (cdr method) (encode-coding-string file coding)) 3061 (setcar (cdr method) (encode-coding-string file coding))
3107 (gnus-group-make-group 3062 (gnus-group-make-group
3108 (encode-coding-string (gnus-group-real-name name) coding) 3063 (gnus-group-real-name name) method nil nil)))
3109 method nil nil t)))
3110 3064
3111(defvar nnweb-type-definition) 3065(defvar nnweb-type-definition)
3112(defvar gnus-group-web-type-history nil) 3066(defvar gnus-group-web-type-history nil)
@@ -3611,7 +3565,7 @@ up is returned."
3611 "Do you really want to mark all articles in %s as read? " 3565 "Do you really want to mark all articles in %s as read? "
3612 "Mark all unread articles in %s as read? ") 3566 "Mark all unread articles in %s as read? ")
3613 (if (= (length groups) 1) 3567 (if (= (length groups) 1)
3614 (gnus-group-decoded-name (car groups)) 3568 (car groups)
3615 (format "these %d groups" (length groups))))))) 3569 (format "these %d groups" (length groups)))))))
3616 n 3570 n
3617 (while (setq group (pop groups)) 3571 (while (setq group (pop groups))
@@ -3696,8 +3650,7 @@ Uses the process/prefix convention."
3696 3650
3697(defun gnus-group-expire-articles-1 (group) 3651(defun gnus-group-expire-articles-1 (group)
3698 (when (gnus-check-backend-function 'request-expire-articles group) 3652 (when (gnus-check-backend-function 'request-expire-articles group)
3699 (gnus-message 6 "Expiring articles in %s..." 3653 (gnus-message 6 "Expiring articles in %s..." group)
3700 (gnus-group-decoded-name group))
3701 (let* ((info (gnus-get-info group)) 3654 (let* ((info (gnus-get-info group))
3702 (expirable (if (gnus-group-total-expirable-p group) 3655 (expirable (if (gnus-group-total-expirable-p group)
3703 (cons nil (gnus-list-of-read-articles group)) 3656 (cons nil (gnus-list-of-read-articles group))
@@ -3724,8 +3677,7 @@ Uses the process/prefix convention."
3724 ;; Just expire using the normal expiry values. 3677 ;; Just expire using the normal expiry values.
3725 (gnus-request-expire-articles articles-to-expire group)))) 3678 (gnus-request-expire-articles articles-to-expire group))))
3726 (gnus-close-group group)) 3679 (gnus-close-group group))
3727 (gnus-message 6 "Expiring articles in %s...done" 3680 (gnus-message 6 "Expiring articles in %s...done" group)
3728 (gnus-group-decoded-name group))
3729 ;; Return the list of un-expired articles. 3681 ;; Return the list of un-expired articles.
3730 (cdr expirable)))) 3682 (cdr expirable))))
3731 3683
@@ -3762,7 +3714,7 @@ Uses the process/prefix convention."
3762 (dolist (group (gnus-group-process-prefix n)) 3714 (dolist (group (gnus-group-process-prefix n))
3763 (gnus-group-remove-mark group) 3715 (gnus-group-remove-mark group)
3764 (gnus-message 6 "Changed level of %s from %d to %d" 3716 (gnus-message 6 "Changed level of %s from %d to %d"
3765 (gnus-group-decoded-name group) 3717 group
3766 (or (gnus-group-group-level) gnus-level-killed) 3718 (or (gnus-group-group-level) gnus-level-killed)
3767 level) 3719 level)
3768 (gnus-group-change-level 3720 (gnus-group-change-level
@@ -3909,7 +3861,7 @@ of groups killed."
3909 ;; `gnus-newsrc-hashtb', this check will always return nil. 3861 ;; `gnus-newsrc-hashtb', this check will always return nil.
3910 (when (numberp (gnus-group-unread group)) 3862 (when (numberp (gnus-group-unread group))
3911 (gnus-request-update-group-status group 'unsubscribe)) 3863 (gnus-request-update-group-status group 'unsubscribe))
3912 (message "Killed group %s" (gnus-group-decoded-name group))) 3864 (message "Killed group %s" group))
3913 ;; If there are lots and lots of groups to be killed, we use 3865 ;; If there are lots and lots of groups to be killed, we use
3914 ;; this thing instead. 3866 ;; this thing instead.
3915 (dolist (group (nreverse groups)) 3867 (dolist (group (nreverse groups))
@@ -4047,7 +3999,7 @@ entail asking the server for the groups."
4047 (add-text-properties 3999 (add-text-properties
4048 (point) (prog1 (1+ (point)) 4000 (point) (prog1 (1+ (point))
4049 (insert " *: " 4001 (insert " *: "
4050 (gnus-group-decoded-name group) 4002 group
4051 "\n")) 4003 "\n"))
4052 (list 'gnus-group group 4004 (list 'gnus-group group
4053 'gnus-unread t 4005 'gnus-unread t
@@ -4494,9 +4446,9 @@ and the second element is the address."
4494 (prin1-to-string (car method))) 4446 (prin1-to-string (car method)))
4495 (and (consp method) 4447 (and (consp method)
4496 (nth 1 (gnus-info-method info))) 4448 (nth 1 (gnus-info-method info)))
4497 nil t) 4449 nil)
4498 ;; It's a native group. 4450 ;; It's a native group.
4499 (gnus-group-make-group (gnus-info-group info) nil nil nil t))) 4451 (gnus-group-make-group (gnus-info-group info) nil nil nil)))
4500 (gnus-message 6 "Note: New group created") 4452 (gnus-message 6 "Note: New group created")
4501 (setq entry 4453 (setq entry
4502 (gnus-group-entry (gnus-group-prefixed-name 4454 (gnus-group-entry (gnus-group-prefixed-name
@@ -4685,7 +4637,7 @@ This command may read the active file."
4685 (while (setq point (text-property-not-all (point) (point-max) 4637 (while (setq point (text-property-not-all (point) (point-max)
4686 'gnus-group nil)) 4638 'gnus-group nil))
4687 (goto-char point) 4639 (goto-char point)
4688 (push (symbol-name (get-text-property point 'gnus-group)) groups) 4640 (push (get-text-property point 'gnus-group) groups)
4689 (forward-char 1)) 4641 (forward-char 1))
4690 groups)) 4642 groups))
4691 4643
@@ -4776,21 +4728,20 @@ Note: currently only implemented in nnml."
4776 (error "No group to compact")) 4728 (error "No group to compact"))
4777 (unless (gnus-check-backend-function 'request-compact-group group) 4729 (unless (gnus-check-backend-function 'request-compact-group group)
4778 (error "This back end does not support group compaction")) 4730 (error "This back end does not support group compaction"))
4779 (let ((group-decoded (gnus-group-decoded-name group))) 4731 (gnus-message 6 "\
4780 (gnus-message 6 "\
4781Compacting group %s... (this may take a long time)" 4732Compacting group %s... (this may take a long time)"
4782 group-decoded) 4733 group)
4783 (prog1 4734 (prog1
4784 (if (not (gnus-request-compact-group group)) 4735 (if (not (gnus-request-compact-group group))
4785 (gnus-error 3 "Couldn't compact group %s" group-decoded) 4736 (gnus-error 3 "Couldn't compact group %s" group)
4786 (gnus-message 6 "Compacting group %s...done" group-decoded) 4737 (gnus-message 6 "Compacting group %s...done" group)
4787 t) 4738 t)
4788 ;; Invalidate the "original article" buffer which might be out of date. 4739 ;; Invalidate the "original article" buffer which might be out of date.
4789 ;; #### NOTE: Yes, this might be a bit rude, but since compaction 4740 ;; #### NOTE: Yes, this might be a bit rude, but since compaction
4790 ;; #### will not happen very often, I think this is acceptable. 4741 ;; #### will not happen very often, I think this is acceptable.
4791 (gnus-kill-buffer gnus-original-article-buffer) 4742 (gnus-kill-buffer gnus-original-article-buffer)
4792 ;; Update the group line to reflect new information (art number etc). 4743 ;; Update the group line to reflect new information (art number etc).
4793 (gnus-group-update-group-line)))) 4744 (gnus-group-update-group-line)))
4794 4745
4795(provide 'gnus-group) 4746(provide 'gnus-group)
4796 4747
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 819936d935a..25efb8afda3 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -391,7 +391,7 @@ only affect the Gcc copy, but not the original message."
391(defun gnus-inews-make-draft (articles) 391(defun gnus-inews-make-draft (articles)
392 `(lambda () 392 `(lambda ()
393 (gnus-inews-make-draft-meta-information 393 (gnus-inews-make-draft-meta-information
394 ,(gnus-group-decoded-name gnus-newsgroup-name) ',articles))) 394 ,gnus-newsgroup-name ',articles)))
395 395
396(autoload 'nnir-article-number "nnir" nil nil 'macro) 396(autoload 'nnir-article-number "nnir" nil nil 'macro)
397(autoload 'nnir-article-group "nnir" nil nil 'macro) 397(autoload 'nnir-article-group "nnir" nil nil 'macro)
@@ -1680,7 +1680,6 @@ this is a reply."
1680(defun gnus-inews-insert-gcc (&optional group) 1680(defun gnus-inews-insert-gcc (&optional group)
1681 "Insert the Gcc to say where the article is to be archived." 1681 "Insert the Gcc to say where the article is to be archived."
1682 (let* ((group (or group gnus-newsgroup-name)) 1682 (let* ((group (or group gnus-newsgroup-name))
1683 (group (when group (gnus-group-decoded-name group)))
1684 (var (or gnus-outgoing-message-group gnus-message-archive-group)) 1683 (var (or gnus-outgoing-message-group gnus-message-archive-group))
1685 (gcc-self-val 1684 (gcc-self-val
1686 (and group (not (gnus-virtual-group-p group)) 1685 (and group (not (gnus-virtual-group-p group))
diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index 972ff28e63f..71c7807518f 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -784,11 +784,13 @@ claim them."
784 (while (not (eobp)) 784 (while (not (eobp))
785 (ignore-errors 785 (ignore-errors
786 (push (cons 786 (push (cons
787 (buffer-substring 787 (decode-coding-string
788 (point) 788 (buffer-substring
789 (progn 789 (point)
790 (skip-chars-forward "^ \t") 790 (progn
791 (point))) 791 (skip-chars-forward "^ \t")
792 (point)))
793 'utf-8-emacs)
792 (let ((last (read cur))) 794 (let ((last (read cur)))
793 (cons (read cur) last))) 795 (cons (read cur) last)))
794 groups)) 796 groups))
@@ -796,18 +798,20 @@ claim them."
796 (while (not (eobp)) 798 (while (not (eobp))
797 (ignore-errors 799 (ignore-errors
798 (push (cons 800 (push (cons
799 (if (eq (char-after) ?\") 801 (decode-coding-string
800 (read cur) 802 (if (eq (char-after) ?\")
801 (let ((p (point)) (name "")) 803 (read cur)
802 (skip-chars-forward "^ \t\\\\") 804 (let ((p (point)) (name ""))
803 (setq name (buffer-substring p (point))) 805 (skip-chars-forward "^ \t\\\\")
804 (while (eq (char-after) ?\\) 806 (setq name (buffer-substring p (point)))
805 (setq p (1+ (point))) 807 (while (eq (char-after) ?\\)
806 (forward-char 2) 808 (setq p (1+ (point)))
807 (skip-chars-forward "^ \t\\\\") 809 (forward-char 2)
808 (setq name (concat name (buffer-substring 810 (skip-chars-forward "^ \t\\\\")
809 p (point))))) 811 (setq name (concat name (buffer-substring
810 name)) 812 p (point)))))
813 name))
814 'utf-8-emacs)
811 (let ((last (read cur))) 815 (let ((last (read cur)))
812 (cons (read cur) last))) 816 (cons (read cur) last)))
813 groups)) 817 groups))
@@ -859,12 +863,7 @@ claim them."
859 ((= level gnus-level-zombie) ?Z) 863 ((= level gnus-level-zombie) ?Z)
860 (t ?K))) 864 (t ?K)))
861 (max 0 (- (1+ (cddr group)) (cadr group))) 865 (max 0 (- (1+ (cddr group)) (cadr group)))
862 ;; Don't decode if name is ASCII 866 name)))
863 (if (eq (detect-coding-string name t) 'undecided)
864 name
865 (decode-coding-string
866 name
867 (inline (gnus-group-name-charset method name)))))))
868 (list 'gnus-group name) 867 (list 'gnus-group name)
869 ))) 868 )))
870 (switch-to-buffer (current-buffer))) 869 (switch-to-buffer (current-buffer)))
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 0f91c4d9b4e..f7ede54b105 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -35,6 +35,7 @@
35(autoload 'gnus-agent-read-servers-validate "gnus-agent") 35(autoload 'gnus-agent-read-servers-validate "gnus-agent")
36(autoload 'gnus-agent-save-local "gnus-agent") 36(autoload 'gnus-agent-save-local "gnus-agent")
37(autoload 'gnus-agent-possibly-alter-active "gnus-agent") 37(autoload 'gnus-agent-possibly-alter-active "gnus-agent")
38(declare-function gnus-group-decoded-name "gnus-group" (string))
38 39
39(eval-when-compile (require 'cl-lib)) 40(eval-when-compile (require 'cl-lib))
40 41
@@ -1828,17 +1829,22 @@ The info element is shared with the same element of
1828 (if (setq rest (member method methods)) 1829 (if (setq rest (member method methods))
1829 (gnus-info-set-method info (car rest)) 1830 (gnus-info-set-method info (car rest))
1830 (push method methods))) 1831 (push method methods)))
1832 ;; Check for encoded group names and decode them.
1833 (when (string-match-p "[^[:ascii:]]" (setq gname (car info)))
1834 (let ((decoded (gnus-group-decoded-name gname)))
1835 (setf gname decoded
1836 (car info) decoded)))
1831 ;; Check for duplicates. 1837 ;; Check for duplicates.
1832 (if (gethash (car info) gnus-newsrc-hashtb) 1838 (if (gethash gname gnus-newsrc-hashtb)
1833 ;; Remove this entry from the alist. 1839 ;; Remove this entry from the alist.
1834 (setcdr alist (cddr alist)) 1840 (setcdr alist (cddr alist))
1835 (puthash 1841 (puthash
1836 (car info) 1842 gname
1837 ;; Preserve number of unread articles in groups. 1843 ;; Preserve number of unread articles in groups.
1838 (list (and ohashtb (car (gethash (car info) ohashtb))) 1844 (list (and ohashtb (car (gethash gname ohashtb)))
1839 info) 1845 info)
1840 gnus-newsrc-hashtb) 1846 gnus-newsrc-hashtb)
1841 (push (car info) gnus-group-list)) 1847 (push gname gnus-group-list))
1842 (setq alist (cdr alist))) 1848 (setq alist (cdr alist)))
1843 (setq gnus-group-list (nreverse gnus-group-list)) 1849 (setq gnus-group-list (nreverse gnus-group-list))
1844 ;; Make the same select-methods in `gnus-server-alist' identical 1850 ;; Make the same select-methods in `gnus-server-alist' identical
@@ -2144,9 +2150,7 @@ The info element is shared with the same element of
2144 (cond ((numberp group) 2150 (cond ((numberp group)
2145 (number-to-string group)) 2151 (number-to-string group))
2146 ((symbolp group) 2152 ((symbolp group)
2147 (encode-coding-string 2153 (symbol-name group))
2148 (symbol-name group)
2149 'latin-1))
2150 ((stringp group) 2154 ((stringp group)
2151 group))))) 2155 group)))))
2152 (numberp (setq max (read cur))) 2156 (numberp (setq max (read cur)))
@@ -2155,7 +2159,11 @@ The info element is shared with the same element of
2155 (skip-chars-forward " \t") 2159 (skip-chars-forward " \t")
2156 (memq (char-after) 2160 (memq (char-after)
2157 '(?= ?x ?j))))) 2161 '(?= ?x ?j)))))
2158 (progn (puthash group (cons min max) hashtb) 2162 (progn (when (string-match-p "[^[:ascii:]]" group)
2163 ;; NNTP servers may give us encoded group
2164 ;; names.
2165 (setq group (gnus-group-decoded-name group)))
2166 (puthash group (cons min max) hashtb)
2159 ;; If group is moderated, stick it in the 2167 ;; If group is moderated, stick it in the
2160 ;; moderation cache. 2168 ;; moderation cache.
2161 (when (eq (char-after) ?m) 2169 (when (eq (char-after) ?m)
@@ -2394,6 +2402,17 @@ If FORCE is non-nil, the .newsrc file is read."
2394 (when gnus-newsrc-assoc 2402 (when gnus-newsrc-assoc
2395 (setq gnus-newsrc-alist gnus-newsrc-assoc)))) 2403 (setq gnus-newsrc-alist gnus-newsrc-assoc))))
2396 (gnus-make-hashtable-from-newsrc-alist) 2404 (gnus-make-hashtable-from-newsrc-alist)
2405 (when gnus-topic-alist
2406 (setq gnus-topic-alist
2407 (mapcar
2408 (lambda (elt)
2409 (cons (car elt)
2410 (mapcar (lambda (g)
2411 (if (string-match-p "[^[:ascii:]]" g)
2412 (gnus-group-decoded-name g)
2413 g))
2414 (cdr elt))))
2415 gnus-topic-alist)))
2397 (when (file-newer-than-file-p file ding-file) 2416 (when (file-newer-than-file-p file ding-file)
2398 ;; Old format quick file 2417 ;; Old format quick file
2399 (gnus-message 5 "Reading %s..." file) 2418 (gnus-message 5 "Reading %s..." file)
@@ -2492,7 +2511,9 @@ If FORCE is non-nil, the .newsrc file is read."
2492 (read buf)) 2511 (read buf))
2493 group (if (numberp group) 2512 group (if (numberp group)
2494 (number-to-string group) 2513 (number-to-string group)
2495 (symbol-name group))) 2514 ;; newsrc files are written as 'raw-text.
2515 (decode-coding-string
2516 (symbol-name group) 'raw-text)))
2496 (widen) 2517 (widen)
2497 (cond 2518 (cond
2498 ;; It's possible that "group" is actually an options line. 2519 ;; It's possible that "group" is actually an options line.
@@ -2911,10 +2932,6 @@ SPECIFIC-VARIABLES, or those in `gnus-variable-list'."
2911 (setq default-directory (file-name-directory buffer-file-name)) 2932 (setq default-directory (file-name-directory buffer-file-name))
2912 (buffer-disable-undo) 2933 (buffer-disable-undo)
2913 (erase-buffer) 2934 (erase-buffer)
2914 ;; Use a unibyte buffer since group names are unibyte strings;
2915 ;; in particular, non-ASCII group names are the ones encoded by
2916 ;; a certain coding system.
2917 (mm-disable-multibyte)
2918 ;; Write options. 2935 ;; Write options.
2919 (when gnus-newsrc-options 2936 (when gnus-newsrc-options
2920 (insert gnus-newsrc-options)) 2937 (insert gnus-newsrc-options))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 73f0eb39184..a6a0bdb2287 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3500,8 +3500,7 @@ value of GROUP, and puts the buffer in `gnus-summary-mode'.
3500 3500
3501Returns non-nil if the setup was successful." 3501Returns non-nil if the setup was successful."
3502 (let ((buffer (gnus-summary-buffer-name group)) 3502 (let ((buffer (gnus-summary-buffer-name group))
3503 (dead-name (concat "*Dead Summary " 3503 (dead-name (concat "*Dead Summary " group "*")))
3504 (gnus-group-decoded-name group) "*")))
3505 ;; If a dead summary buffer exists, we kill it. 3504 ;; If a dead summary buffer exists, we kill it.
3506 (gnus-kill-buffer dead-name) 3505 (gnus-kill-buffer dead-name)
3507 (if (get-buffer buffer) 3506 (if (get-buffer buffer)
@@ -3984,8 +3983,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
3984 ;; (when (and (not (gnus-group-native-p group)) 3983 ;; (when (and (not (gnus-group-native-p group))
3985 ;; (not (gethash group gnus-newsrc-hashtb))) 3984 ;; (not (gethash group gnus-newsrc-hashtb)))
3986 ;; (error "Dead non-native groups can't be entered")) 3985 ;; (error "Dead non-native groups can't be entered"))
3987 (gnus-message 7 "Retrieving newsgroup: %s..." 3986 (gnus-message 7 "Retrieving newsgroup: %s..." group)
3988 (gnus-group-decoded-name group))
3989 (let* ((new-group (gnus-summary-setup-buffer group)) 3987 (let* ((new-group (gnus-summary-setup-buffer group))
3990 (quit-config (gnus-group-quit-config group)) 3988 (quit-config (gnus-group-quit-config group))
3991 (did-select (and new-group (gnus-select-newsgroup 3989 (did-select (and new-group (gnus-select-newsgroup
@@ -4016,8 +4014,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
4016 (gnus-group-next-unread-group 1)) 4014 (gnus-group-next-unread-group 1))
4017 (gnus-handle-ephemeral-exit quit-config))) 4015 (gnus-handle-ephemeral-exit quit-config)))
4018 (if (null (gnus-list-of-unread-articles group)) 4016 (if (null (gnus-list-of-unread-articles group))
4019 (gnus-message 3 "Group %s contains no messages" 4017 (gnus-message 3 "Group %s contains no messages" group)
4020 (gnus-group-decoded-name group))
4021 (gnus-message 3 "Can't select group")) 4018 (gnus-message 3 "Can't select group"))
4022 nil) 4019 nil)
4023 ;; The user did a `C-g' while prompting for number of articles, 4020 ;; The user did a `C-g' while prompting for number of articles,
@@ -5618,25 +5615,24 @@ or a straight list of headers."
5618 5615
5619(defun gnus-fetch-headers (articles &optional limit force-new dependencies) 5616(defun gnus-fetch-headers (articles &optional limit force-new dependencies)
5620 "Fetch headers of ARTICLES." 5617 "Fetch headers of ARTICLES."
5621 (let ((name (gnus-group-decoded-name gnus-newsgroup-name))) 5618 (gnus-message 7 "Fetching headers for %s..." gnus-newsgroup-name)
5622 (gnus-message 7 "Fetching headers for %s..." name) 5619 (prog1
5623 (prog1 5620 (if (eq 'nov
5624 (if (eq 'nov 5621 (setq gnus-headers-retrieved-by
5625 (setq gnus-headers-retrieved-by 5622 (gnus-retrieve-headers
5626 (gnus-retrieve-headers 5623 articles gnus-newsgroup-name
5627 articles gnus-newsgroup-name 5624 (or limit
5628 (or limit 5625 ;; We might want to fetch old headers, but
5629 ;; We might want to fetch old headers, but 5626 ;; not if there is only 1 article.
5630 ;; not if there is only 1 article. 5627 (and (or (and
5631 (and (or (and 5628 (not (eq gnus-fetch-old-headers 'some))
5632 (not (eq gnus-fetch-old-headers 'some)) 5629 (not (numberp gnus-fetch-old-headers)))
5633 (not (numberp gnus-fetch-old-headers))) 5630 (> (length articles) 1))
5634 (> (length articles) 1)) 5631 gnus-fetch-old-headers)))))
5635 gnus-fetch-old-headers))))) 5632 (gnus-get-newsgroup-headers-xover
5636 (gnus-get-newsgroup-headers-xover 5633 articles force-new dependencies gnus-newsgroup-name t)
5637 articles force-new dependencies gnus-newsgroup-name t) 5634 (gnus-get-newsgroup-headers dependencies force-new))
5638 (gnus-get-newsgroup-headers dependencies force-new)) 5635 (gnus-message 7 "Fetching headers for %s...done" gnus-newsgroup-name)))
5639 (gnus-message 7 "Fetching headers for %s...done" name))))
5640 5636
5641(defun gnus-select-newsgroup (group &optional read-all select-articles) 5637(defun gnus-select-newsgroup (group &optional read-all select-articles)
5642 "Select newsgroup GROUP. 5638 "Select newsgroup GROUP.
@@ -5649,13 +5645,12 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5649 t 5645 t
5650 gnus-summary-ignore-duplicates)) 5646 gnus-summary-ignore-duplicates))
5651 (info (nth 1 entry)) 5647 (info (nth 1 entry))
5652 charset articles fetched-articles cached) 5648 articles fetched-articles cached)
5653 5649
5654 (unless (gnus-check-server 5650 (unless (gnus-check-server
5655 (set (make-local-variable 'gnus-current-select-method) 5651 (set (make-local-variable 'gnus-current-select-method)
5656 (gnus-find-method-for-group group))) 5652 (gnus-find-method-for-group group)))
5657 (error "Couldn't open server")) 5653 (error "Couldn't open server"))
5658 (setq charset (gnus-group-name-charset gnus-current-select-method group))
5659 5654
5660 (or (and entry (not (eq (car entry) t))) ; Either it's active... 5655 (or (and entry (not (eq (car entry) t))) ; Either it's active...
5661 (gnus-activate-group group) ; Or we can activate it... 5656 (gnus-activate-group group) ; Or we can activate it...
@@ -5663,16 +5658,12 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5663 (when (derived-mode-p 'gnus-summary-mode) 5658 (when (derived-mode-p 'gnus-summary-mode)
5664 (gnus-kill-buffer (current-buffer))) 5659 (gnus-kill-buffer (current-buffer)))
5665 (error 5660 (error
5666 "Couldn't activate group %s: %s" 5661 "Couldn't activate group %s: %s" group (gnus-status-message group))))
5667 (decode-coding-string group charset)
5668 (decode-coding-string (gnus-status-message group) charset))))
5669 5662
5670 (unless (gnus-request-group group t nil info) 5663 (unless (gnus-request-group group t nil info)
5671 (when (derived-mode-p 'gnus-summary-mode) 5664 (when (derived-mode-p 'gnus-summary-mode)
5672 (gnus-kill-buffer (current-buffer))) 5665 (gnus-kill-buffer (current-buffer)))
5673 (error "Couldn't request group %s: %s" 5666 (error "Couldn't request group %s: %s" group (gnus-status-message group)))
5674 (decode-coding-string group charset)
5675 (decode-coding-string (gnus-status-message group) charset)))
5676 5667
5677 (when (and gnus-agent 5668 (when (and gnus-agent
5678 (gnus-active group)) 5669 (gnus-active group))
@@ -5938,13 +5929,11 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5938 (if only-read-p 5929 (if only-read-p
5939 (format 5930 (format
5940 "How many articles from %s (available %d, default %d): " 5931 "How many articles from %s (available %d, default %d): "
5941 (gnus-group-real-name 5932 (gnus-group-real-name gnus-newsgroup-name)
5942 (gnus-group-decoded-name gnus-newsgroup-name))
5943 number default) 5933 number default)
5944 (format 5934 (format
5945 "How many articles from %s (%d default): " 5935 "How many articles from %s (%d default): "
5946 (gnus-group-real-name 5936 (gnus-group-real-name gnus-newsgroup-name)
5947 (gnus-group-decoded-name gnus-newsgroup-name))
5948 default)) 5937 default))
5949 nil 5938 nil
5950 nil 5939 nil
@@ -5956,8 +5945,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5956 (read-string 5945 (read-string
5957 (format "%s %s (%d scored, %d total): " 5946 (format "%s %s (%d scored, %d total): "
5958 "How many articles from" 5947 "How many articles from"
5959 (gnus-group-decoded-name 5948 (gnus-group-real-name gnus-newsgroup-name)
5960 (gnus-group-real-name gnus-newsgroup-name))
5961 scored number)))) 5949 scored number))))
5962 (if (string-match "^[ \t]*$" input) 5950 (if (string-match "^[ \t]*$" input)
5963 number input))) 5951 number input)))
@@ -6199,8 +6187,7 @@ If WHERE is `summary', the summary mode line format will be used."
6199 (intern 6187 (intern
6200 (format "gnus-%s-mode-line-format-spec" where)))) 6188 (format "gnus-%s-mode-line-format-spec" where))))
6201 (gnus-tmp-group-name (gnus-mode-string-quote 6189 (gnus-tmp-group-name (gnus-mode-string-quote
6202 (gnus-group-decoded-name 6190 gnus-newsgroup-name))
6203 gnus-newsgroup-name)))
6204 (gnus-tmp-article-number (or gnus-current-article 0)) 6191 (gnus-tmp-article-number (or gnus-current-article 0))
6205 (gnus-tmp-unread gnus-newsgroup-unreads) 6192 (gnus-tmp-unread gnus-newsgroup-unreads)
6206 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads)) 6193 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads))
@@ -7921,11 +7908,11 @@ If BACKWARD, the previous article is selected instead of the next."
7921 (not (gnus-ephemeral-group-p gnus-newsgroup-name))) 7908 (not (gnus-ephemeral-group-p gnus-newsgroup-name)))
7922 (format " (Type %s for %s [%s])" 7909 (format " (Type %s for %s [%s])"
7923 (single-key-description cmd) 7910 (single-key-description cmd)
7924 (gnus-group-decoded-name group) 7911 group
7925 (gnus-group-unread group)) 7912 (gnus-group-unread group))
7926 (format " (Type %s to exit %s)" 7913 (format " (Type %s to exit %s)"
7927 (single-key-description cmd) 7914 (single-key-description cmd)
7928 (gnus-group-decoded-name gnus-newsgroup-name))))) 7915 gnus-newsgroup-name))))
7929 ;; Confirm auto selection. 7916 ;; Confirm auto selection.
7930 (setq key (car (setq keve (gnus-read-event-char prompt))) 7917 (setq key (car (setq keve (gnus-read-event-char prompt)))
7931 ended t) 7918 ended t)
@@ -10110,7 +10097,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
10110 (copy-buf (save-excursion 10097 (copy-buf (save-excursion
10111 (nnheader-set-temp-buffer " *copy article*"))) 10098 (nnheader-set-temp-buffer " *copy article*")))
10112 art-group to-method new-xref article to-groups 10099 art-group to-method new-xref article to-groups
10113 articles-to-update-marks encoded) 10100 articles-to-update-marks)
10114 (unless (assq action names) 10101 (unless (assq action names)
10115 (error "Unknown action %s" action)) 10102 (error "Unknown action %s" action))
10116 ;; Read the newsgroup name. 10103 ;; Read the newsgroup name.
@@ -10132,22 +10119,12 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
10132 (symbol-value 10119 (symbol-value
10133 (intern (format "gnus-current-%s-group" action))) 10120 (intern (format "gnus-current-%s-group" action)))
10134 articles prefix) 10121 articles prefix)
10135 encoded to-newsgroup
10136 to-method (gnus-server-to-method (gnus-group-method to-newsgroup))) 10122 to-method (gnus-server-to-method (gnus-group-method to-newsgroup)))
10137 (set (intern (format "gnus-current-%s-group" action)) 10123 (set (intern (format "gnus-current-%s-group" action)) to-newsgroup))
10138 (decode-coding-string
10139 to-newsgroup
10140 (gnus-group-name-charset to-method to-newsgroup))))
10141 (unless to-method 10124 (unless to-method
10142 (setq to-method (or select-method 10125 (setq to-method (or select-method
10143 (gnus-server-to-method 10126 (gnus-server-to-method
10144 (gnus-group-method to-newsgroup))))) 10127 (gnus-group-method to-newsgroup)))))
10145 (setq to-newsgroup
10146 (or encoded
10147 (and to-newsgroup
10148 (encode-coding-string
10149 to-newsgroup
10150 (gnus-group-name-charset to-method to-newsgroup)))))
10151 ;; Check the method we are to move this article to... 10128 ;; Check the method we are to move this article to...
10152 (unless (gnus-check-backend-function 10129 (unless (gnus-check-backend-function
10153 'request-accept-article (car to-method)) 10130 'request-accept-article (car to-method))
@@ -10157,7 +10134,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
10157 (gnus-message 6 "%s to %s: %s..." 10134 (gnus-message 6 "%s to %s: %s..."
10158 (caddr (assq action names)) 10135 (caddr (assq action names))
10159 (or (car select-method) 10136 (or (car select-method)
10160 (gnus-group-decoded-name to-newsgroup)) 10137 to-newsgroup)
10161 articles) 10138 articles)
10162 ;; This `while' is not equivalent to a `dolist' (bug#33653#134). 10139 ;; This `while' is not equivalent to a `dolist' (bug#33653#134).
10163 (while articles 10140 (while articles
@@ -12469,27 +12446,23 @@ save those articles instead."
12469 (t 12446 (t
12470 (gnus-completing-read 12447 (gnus-completing-read
12471 prom (nreverse split-name) nil nil 'gnus-group-history)))) 12448 prom (nreverse split-name) nil nil 'gnus-group-history))))
12472 (to-method (gnus-server-to-method (gnus-group-method to-newsgroup))) 12449 (to-method (gnus-server-to-method (gnus-group-method to-newsgroup))))
12473 encoded)
12474 (when to-newsgroup 12450 (when to-newsgroup
12475 (if (or (string= to-newsgroup "") 12451 (if (or (string= to-newsgroup "")
12476 (string= to-newsgroup prefix)) 12452 (string= to-newsgroup prefix))
12477 (setq to-newsgroup default)) 12453 (setq to-newsgroup default))
12478 (unless to-newsgroup 12454 (unless to-newsgroup
12479 (user-error "No group name entered")) 12455 (error "No group name entered"))
12480 (setq encoded (encode-coding-string 12456 (or (gnus-active to-newsgroup)
12481 to-newsgroup 12457 (gnus-activate-group to-newsgroup nil nil to-method)
12482 (gnus-group-name-charset to-method to-newsgroup)))
12483 (or (gnus-active encoded)
12484 (gnus-activate-group encoded nil nil to-method)
12485 (if (gnus-y-or-n-p (format "No such group: %s. Create it? " 12458 (if (gnus-y-or-n-p (format "No such group: %s. Create it? "
12486 to-newsgroup)) 12459 to-newsgroup))
12487 (or (and (gnus-request-create-group encoded to-method) 12460 (or (and (gnus-request-create-group to-newsgroup to-method)
12488 (gnus-activate-group encoded nil nil to-method) 12461 (gnus-activate-group to-newsgroup nil nil to-method)
12489 (gnus-subscribe-group encoded)) 12462 (gnus-subscribe-group to-newsgroup))
12490 (error "Couldn't create group %s" to-newsgroup))) 12463 (error "Couldn't create group %s" to-newsgroup)))
12491 (user-error "No such group: %s" to-newsgroup)) 12464 (error "No such group: %s" to-newsgroup))
12492 encoded))) 12465 to-newsgroup)))
12493 12466
12494(defvar gnus-summary-save-parts-counter) 12467(defvar gnus-summary-save-parts-counter)
12495(declare-function mm-uu-dissect "mm-uu" (&optional noheader mime-type)) 12468(declare-function mm-uu-dissect "mm-uu" (&optional noheader mime-type))
@@ -13156,7 +13129,7 @@ If ALL is a number, fetch this number of articles."
13156 (read-string 13129 (read-string
13157 (format 13130 (format
13158 "How many articles from %s (%s %d): " 13131 "How many articles from %s (%s %d): "
13159 (gnus-group-decoded-name gnus-newsgroup-name) 13132 gnus-newsgroup-name
13160 (if initial "max" "default") 13133 (if initial "max" "default")
13161 len) 13134 len)
13162 nil nil 13135 nil nil
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 9ccdb83865c..c6be59fd19f 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1173,16 +1173,9 @@ ARG is passed to the first function."
1173 "Return non-nil if all ELEMENTS are non-nil." 1173 "Return non-nil if all ELEMENTS are non-nil."
1174 (not (memq nil elements))) 1174 (not (memq nil elements)))
1175 1175
1176;; gnus.el requires mm-util.
1177(declare-function mm-disable-multibyte "mm-util")
1178
1179(defun gnus-write-active-file (file hashtb &optional full-names) 1176(defun gnus-write-active-file (file hashtb &optional full-names)
1180 ;; `coding-system-for-write' should be `raw-text' or equivalent.
1181 (let ((coding-system-for-write nnmail-active-file-coding-system)) 1177 (let ((coding-system-for-write nnmail-active-file-coding-system))
1182 (with-temp-file file 1178 (with-temp-file file
1183 ;; The buffer should be in the unibyte mode because group names
1184 ;; are ASCII text or encoded non-ASCII text (i.e., unibyte).
1185 (mm-disable-multibyte)
1186 (maphash 1179 (maphash
1187 (lambda (group active) 1180 (lambda (group active)
1188 (when active 1181 (when active
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 9ee7db9e203..f990569a300 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -3444,11 +3444,9 @@ server is native)."
3444 "Return the prefix of the current group name." 3444 "Return the prefix of the current group name."
3445 (< 0 (length (gnus-group-real-prefix group)))) 3445 (< 0 (length (gnus-group-real-prefix group))))
3446 3446
3447(declare-function gnus-group-decoded-name "gnus-group" (string))
3448
3449(defun gnus-summary-buffer-name (group) 3447(defun gnus-summary-buffer-name (group)
3450 "Return the summary buffer name of GROUP." 3448 "Return the summary buffer name of GROUP."
3451 (concat "*Summary " (gnus-group-decoded-name group) "*")) 3449 (concat "*Summary " group "*"))
3452 3450
3453(defun gnus-group-method (group) 3451(defun gnus-group-method (group)
3454 "Return the server or method used for selecting GROUP. 3452 "Return the server or method used for selecting GROUP.
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 4900686b852..71e1750ba4b 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1894,7 +1894,6 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'."
1894(autoload 'gnus-delay-article "gnus-delay") 1894(autoload 'gnus-delay-article "gnus-delay")
1895(autoload 'gnus-extract-address-components "gnus-util") 1895(autoload 'gnus-extract-address-components "gnus-util")
1896(autoload 'gnus-find-method-for-group "gnus") 1896(autoload 'gnus-find-method-for-group "gnus")
1897(autoload 'gnus-group-decoded-name "gnus-group")
1898(autoload 'gnus-group-name-charset "gnus-group") 1897(autoload 'gnus-group-name-charset "gnus-group")
1899(autoload 'gnus-group-name-decode "gnus-group") 1898(autoload 'gnus-group-name-decode "gnus-group")
1900(autoload 'gnus-groups-from-server "gnus") 1899(autoload 'gnus-groups-from-server "gnus")
@@ -5628,7 +5627,7 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'."
5628 (concat 5627 (concat
5629 msg-id (if msg-id " (") 5628 msg-id (if msg-id " (")
5630 (if (car name) 5629 (if (car name)
5631 (if (string-match "[^\000-\177]" (car name)) 5630 (if (string-match "[^[:ascii:]]" (car name))
5632 ;; Quote a string containing non-ASCII characters. 5631 ;; Quote a string containing non-ASCII characters.
5633 ;; It will make the RFC2047 encoder cause an error 5632 ;; It will make the RFC2047 encoder cause an error
5634 ;; if there are special characters. 5633 ;; if there are special characters.
@@ -7285,12 +7284,11 @@ news, Source is the list of newsgroups is was posted to."
7285 (let* ((group (message-fetch-field "newsgroups")) 7284 (let* ((group (message-fetch-field "newsgroups"))
7286 (from (message-fetch-field "from")) 7285 (from (message-fetch-field "from"))
7287 (prefix 7286 (prefix
7288 (if group 7287 (or group
7289 (gnus-group-decoded-name group) 7288 (or (and from (or
7290 (or (and from (or 7289 (car (gnus-extract-address-components from))
7291 (car (gnus-extract-address-components from)) 7290 (cadr (gnus-extract-address-components from))))
7292 (cadr (gnus-extract-address-components from)))) 7291 "(nowhere)"))))
7293 "(nowhere)"))))
7294 (concat "[" 7292 (concat "["
7295 (if message-forward-decoded-p 7293 (if message-forward-decoded-p
7296 prefix 7294 prefix
@@ -7304,10 +7302,9 @@ Source is the sender, and if the original message was news, Source is
7304the list of newsgroups is was posted to." 7302the list of newsgroups is was posted to."
7305 (let* ((group (message-fetch-field "newsgroups")) 7303 (let* ((group (message-fetch-field "newsgroups"))
7306 (prefix 7304 (prefix
7307 (if group 7305 (or group
7308 (gnus-group-decoded-name group) 7306 (or (message-fetch-field "from")
7309 (or (message-fetch-field "from") 7307 "(nowhere)"))))
7310 "(nowhere)"))))
7311 (concat "[" 7308 (concat "["
7312 (if message-forward-decoded-p 7309 (if message-forward-decoded-p
7313 prefix 7310 prefix
diff --git a/lisp/gnus/nnagent.el b/lisp/gnus/nnagent.el
index 64f3a861810..f0baf99bd4c 100644
--- a/lisp/gnus/nnagent.el
+++ b/lisp/gnus/nnagent.el
@@ -117,18 +117,17 @@
117 (gnus-request-accept-article "nndraft:queue" nil t t)) 117 (gnus-request-accept-article "nndraft:queue" nil t t))
118 118
119(deffoo nnagent-request-set-mark (group action server) 119(deffoo nnagent-request-set-mark (group action server)
120 (mm-with-unibyte-buffer 120 (insert "(gnus-agent-synchronize-group-flags \""
121 (insert "(gnus-agent-synchronize-group-flags \"" 121 group
122 group 122 "\" '")
123 "\" '") 123 (gnus-pp action)
124 (gnus-pp action) 124 (insert " \""
125 (insert " \"" 125 (gnus-method-to-server gnus-command-method)
126 (gnus-method-to-server gnus-command-method) 126 "\"")
127 "\"") 127 (insert ")\n")
128 (insert ")\n") 128 (let ((coding-system-for-write nnheader-file-coding-system))
129 (let ((coding-system-for-write nnheader-file-coding-system)) 129 (write-region (point-min) (point-max) (gnus-agent-lib-file "flags")
130 (write-region (point-min) (point-max) (gnus-agent-lib-file "flags") 130 t 'silent))
131 t 'silent)))
132 ;; Also set the marks for the original back end that keeps marks in 131 ;; Also set the marks for the original back end that keeps marks in
133 ;; the local system. 132 ;; the local system.
134 (let ((gnus-agent nil)) 133 (let ((gnus-agent nil))
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index 6ef324ae916..c87cfc8c7cb 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -30,7 +30,6 @@
30 30
31(defvar nnmail-extra-headers) 31(defvar nnmail-extra-headers)
32(defvar gnus-newsgroup-name) 32(defvar gnus-newsgroup-name)
33(defvar nnheader-file-coding-system)
34(defvar jka-compr-compression-info-list) 33(defvar jka-compr-compression-info-list)
35 34
36;; Requiring `gnus-util' at compile time creates a circular 35;; Requiring `gnus-util' at compile time creates a circular
@@ -499,7 +498,8 @@ the line could be found."
499 498
500(defvar nntp-server-buffer nil) 499(defvar nntp-server-buffer nil)
501(defvar nntp-process-response nil) 500(defvar nntp-process-response nil)
502 501(defvar nnheader-file-coding-system 'undecided
502 "Coding system used in file backends of Gnus.")
503(defvar nnheader-callback-function nil) 503(defvar nnheader-callback-function nil)
504 504
505(defun nnheader-init-server-buffer () 505(defun nnheader-init-server-buffer ()
@@ -871,9 +871,6 @@ first. Otherwise, find the newest one, though it may take a time."
871 (when (string-match (car ange-ftp-path-format) path) 871 (when (string-match (car ange-ftp-path-format) path)
872 (ange-ftp-re-read-dir path))))) 872 (ange-ftp-re-read-dir path)))))
873 873
874(defvar nnheader-file-coding-system 'raw-text
875 "Coding system used in file backends of Gnus.")
876
877(defun nnheader-insert-file-contents (filename &optional visit beg end replace) 874(defun nnheader-insert-file-contents (filename &optional visit beg end replace)
878 "Like `insert-file-contents', q.v., but only reads in the file. 875 "Like `insert-file-contents', q.v., but only reads in the file.
879A buffer may be modified in several ways after reading into the buffer due 876A buffer may be modified in several ways after reading into the buffer due
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 0c5aaf32d42..6f2ebfb7fe6 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -118,12 +118,6 @@ some servers.")
118 118
119(defvoo nnimap-namespace nil) 119(defvoo nnimap-namespace nil)
120 120
121(defun nnimap-decode-gnus-group (group)
122 (decode-coding-string group 'utf-8))
123
124(defun nnimap-encode-gnus-group (group)
125 (encode-coding-string group 'utf-8))
126
127(defvoo nnimap-fetch-partial-articles nil 121(defvoo nnimap-fetch-partial-articles nil
128 "If non-nil, Gnus will fetch partial articles. 122 "If non-nil, Gnus will fetch partial articles.
129If t, Gnus will fetch only the first part. If a string, it 123If t, Gnus will fetch only the first part. If a string, it
@@ -208,8 +202,6 @@ textual parts.")
208 (format "%s" (nreverse params)))) 202 (format "%s" (nreverse params))))
209 203
210(deffoo nnimap-retrieve-headers (articles &optional group server _fetch-old) 204(deffoo nnimap-retrieve-headers (articles &optional group server _fetch-old)
211 (when group
212 (setq group (nnimap-decode-gnus-group group)))
213 (with-current-buffer nntp-server-buffer 205 (with-current-buffer nntp-server-buffer
214 (erase-buffer) 206 (erase-buffer)
215 (when (nnimap-change-group group server) 207 (when (nnimap-change-group group server)
@@ -644,8 +636,6 @@ textual parts.")
644 nnimap-status-string) 636 nnimap-status-string)
645 637
646(deffoo nnimap-request-article (article &optional group server to-buffer) 638(deffoo nnimap-request-article (article &optional group server to-buffer)
647 (when group
648 (setq group (nnimap-decode-gnus-group group)))
649 (with-current-buffer nntp-server-buffer 639 (with-current-buffer nntp-server-buffer
650 (let ((result (nnimap-change-group group server)) 640 (let ((result (nnimap-change-group group server))
651 parts structure) 641 parts structure)
@@ -677,8 +667,6 @@ textual parts.")
677 (cons group article))))))) 667 (cons group article)))))))
678 668
679(deffoo nnimap-request-head (article &optional group server to-buffer) 669(deffoo nnimap-request-head (article &optional group server to-buffer)
680 (when group
681 (setq group (nnimap-decode-gnus-group group)))
682 (when (nnimap-change-group group server) 670 (when (nnimap-change-group group server)
683 (with-current-buffer (nnimap-buffer) 671 (with-current-buffer (nnimap-buffer)
684 (when (stringp article) 672 (when (stringp article)
@@ -696,8 +684,6 @@ textual parts.")
696 (cons group article))))))) 684 (cons group article)))))))
697 685
698(deffoo nnimap-request-articles (articles &optional group server) 686(deffoo nnimap-request-articles (articles &optional group server)
699 (when group
700 (setq group (nnimap-decode-gnus-group group)))
701 (with-current-buffer nntp-server-buffer 687 (with-current-buffer nntp-server-buffer
702 (let ((result (nnimap-change-group group server))) 688 (let ((result (nnimap-change-group group server)))
703 (when result 689 (when result
@@ -847,7 +833,6 @@ textual parts.")
847 (nreverse parts))) 833 (nreverse parts)))
848 834
849(deffoo nnimap-request-group (group &optional server dont-check info) 835(deffoo nnimap-request-group (group &optional server dont-check info)
850 (setq group (nnimap-decode-gnus-group group))
851 (let ((result (nnimap-change-group 836 (let ((result (nnimap-change-group
852 ;; Don't SELECT the group if we're going to select it 837 ;; Don't SELECT the group if we're going to select it
853 ;; later, anyway. 838 ;; later, anyway.
@@ -874,11 +859,10 @@ textual parts.")
874 (- (cdr active) (car active)) 859 (- (cdr active) (car active))
875 (car active) 860 (car active)
876 (cdr active) 861 (cdr active)
877 (nnimap-encode-gnus-group group))) 862 group))
878 t)))) 863 t))))
879 864
880(deffoo nnimap-request-group-scan (group &optional server info) 865(deffoo nnimap-request-group-scan (group &optional server info)
881 (setq group (nnimap-decode-gnus-group group))
882 (when (nnimap-change-group nil server) 866 (when (nnimap-change-group nil server)
883 (let (marks high low) 867 (let (marks high low)
884 (with-current-buffer (nnimap-buffer) 868 (with-current-buffer (nnimap-buffer)
@@ -910,23 +894,20 @@ textual parts.")
910 (insert 894 (insert
911 (format 895 (format
912 "211 %d %d %d %S\n" (1+ (- high low)) low high 896 "211 %d %d %d %S\n" (1+ (- high low)) low high
913 (nnimap-encode-gnus-group group))) 897 group))
914 t)))) 898 t))))
915 899
916(deffoo nnimap-request-create-group (group &optional server _args) 900(deffoo nnimap-request-create-group (group &optional server _args)
917 (setq group (nnimap-decode-gnus-group group))
918 (when (nnimap-change-group nil server) 901 (when (nnimap-change-group nil server)
919 (with-current-buffer (nnimap-buffer) 902 (with-current-buffer (nnimap-buffer)
920 (car (nnimap-command "CREATE %S" (nnimap-group-to-imap group)))))) 903 (car (nnimap-command "CREATE %S" (nnimap-group-to-imap group))))))
921 904
922(deffoo nnimap-request-delete-group (group &optional _force server) 905(deffoo nnimap-request-delete-group (group &optional _force server)
923 (setq group (nnimap-decode-gnus-group group))
924 (when (nnimap-change-group nil server) 906 (when (nnimap-change-group nil server)
925 (with-current-buffer (nnimap-buffer) 907 (with-current-buffer (nnimap-buffer)
926 (car (nnimap-command "DELETE %S" (nnimap-group-to-imap group)))))) 908 (car (nnimap-command "DELETE %S" (nnimap-group-to-imap group))))))
927 909
928(deffoo nnimap-request-rename-group (group new-name &optional server) 910(deffoo nnimap-request-rename-group (group new-name &optional server)
929 (setq group (nnimap-decode-gnus-group group))
930 (when (nnimap-change-group nil server) 911 (when (nnimap-change-group nil server)
931 (with-current-buffer (nnimap-buffer) 912 (with-current-buffer (nnimap-buffer)
932 (nnimap-unselect-group) 913 (nnimap-unselect-group)
@@ -941,7 +922,6 @@ textual parts.")
941 (nnimap-command "EXAMINE DOES.NOT.EXIST")) 922 (nnimap-command "EXAMINE DOES.NOT.EXIST"))
942 923
943(deffoo nnimap-request-expunge-group (group &optional server) 924(deffoo nnimap-request-expunge-group (group &optional server)
944 (setq group (nnimap-decode-gnus-group group))
945 (when (nnimap-change-group group server) 925 (when (nnimap-change-group group server)
946 (with-current-buffer (nnimap-buffer) 926 (with-current-buffer (nnimap-buffer)
947 (car (nnimap-command "EXPUNGE"))))) 927 (car (nnimap-command "EXPUNGE")))))
@@ -970,9 +950,6 @@ textual parts.")
970(deffoo nnimap-request-move-article (article group server accept-form 950(deffoo nnimap-request-move-article (article group server accept-form
971 &optional _last 951 &optional _last
972 internal-move-group) 952 internal-move-group)
973 (setq group (nnimap-decode-gnus-group group))
974 (when internal-move-group
975 (setq internal-move-group (nnimap-decode-gnus-group internal-move-group)))
976 (with-temp-buffer 953 (with-temp-buffer
977 (mm-disable-multibyte) 954 (mm-disable-multibyte)
978 (when (funcall (if internal-move-group 955 (when (funcall (if internal-move-group
@@ -1006,7 +983,6 @@ textual parts.")
1006 result)))))) 983 result))))))
1007 984
1008(deffoo nnimap-request-expire-articles (articles group &optional server force) 985(deffoo nnimap-request-expire-articles (articles group &optional server force)
1009 (setq group (nnimap-decode-gnus-group group))
1010 (cond 986 (cond
1011 ((null articles) 987 ((null articles)
1012 nil) 988 nil)
@@ -1151,8 +1127,6 @@ If LIMIT, first try to limit the search to the N last articles."
1151 "delete this article now")))))) 1127 "delete this article now"))))))
1152 1128
1153(deffoo nnimap-request-scan (&optional group server) 1129(deffoo nnimap-request-scan (&optional group server)
1154 (when group
1155 (setq group (nnimap-decode-gnus-group group)))
1156 (when (and (nnimap-change-group nil server) 1130 (when (and (nnimap-change-group nil server)
1157 nnimap-inbox 1131 nnimap-inbox
1158 nnimap-split-methods) 1132 nnimap-split-methods)
@@ -1171,7 +1145,6 @@ If LIMIT, first try to limit the search to the N last articles."
1171 flags)) 1145 flags))
1172 1146
1173(deffoo nnimap-request-update-group-status (group status &optional server) 1147(deffoo nnimap-request-update-group-status (group status &optional server)
1174 (setq group (nnimap-decode-gnus-group group))
1175 (when (nnimap-change-group nil server) 1148 (when (nnimap-change-group nil server)
1176 (let ((command (assoc 1149 (let ((command (assoc
1177 status 1150 status
@@ -1182,7 +1155,6 @@ If LIMIT, first try to limit the search to the N last articles."
1182 (nnimap-command "%s %S" (cadr command) (nnimap-group-to-imap group))))))) 1155 (nnimap-command "%s %S" (cadr command) (nnimap-group-to-imap group)))))))
1183 1156
1184(deffoo nnimap-request-set-mark (group actions &optional server) 1157(deffoo nnimap-request-set-mark (group actions &optional server)
1185 (setq group (nnimap-decode-gnus-group group))
1186 (when (nnimap-change-group group server) 1158 (when (nnimap-change-group group server)
1187 (let (sequence) 1159 (let (sequence)
1188 (with-current-buffer (nnimap-buffer) 1160 (with-current-buffer (nnimap-buffer)
@@ -1217,8 +1189,7 @@ If LIMIT, first try to limit the search to the N last articles."
1217 ;; that's determined by the IMAP server later. So just 1189 ;; that's determined by the IMAP server later. So just
1218 ;; return the group name. 1190 ;; return the group name.
1219 (lambda (group) 1191 (lambda (group)
1220 (list (list group))))))) 1192 (list (list group)))))))
1221 (setq group (nnimap-decode-gnus-group group))
1222 (when (nnimap-change-group nil server) 1193 (when (nnimap-change-group nil server)
1223 (nnmail-check-syntax) 1194 (nnmail-check-syntax)
1224 (let ((message-id (message-field-value "message-id")) 1195 (let ((message-id (message-field-value "message-id"))
@@ -1296,7 +1267,6 @@ If LIMIT, first try to limit the search to the N last articles."
1296 result)) 1267 result))
1297 1268
1298(deffoo nnimap-request-replace-article (article group buffer) 1269(deffoo nnimap-request-replace-article (article group buffer)
1299 (setq group (nnimap-decode-gnus-group group))
1300 (let (group-art) 1270 (let (group-art)
1301 (when (and (nnimap-change-group group) 1271 (when (and (nnimap-change-group group)
1302 ;; Put the article into the group. 1272 ;; Put the article into the group.
@@ -1380,8 +1350,7 @@ If LIMIT, first try to limit the search to the N last articles."
1380 (dolist (response responses) 1350 (dolist (response responses)
1381 (let* ((sequence (car response)) 1351 (let* ((sequence (car response))
1382 (response (cadr response)) 1352 (response (cadr response))
1383 (group (cadr (assoc sequence sequences))) 1353 (group (cadr (assoc sequence sequences))))
1384 (egroup (nnimap-encode-gnus-group group)))
1385 (when (and group 1354 (when (and group
1386 (equal (caar response) "OK")) 1355 (equal (caar response) "OK"))
1387 (let ((uidnext (nnimap-find-parameter "UIDNEXT" response)) 1356 (let ((uidnext (nnimap-find-parameter "UIDNEXT" response))
@@ -1393,14 +1362,14 @@ If LIMIT, first try to limit the search to the N last articles."
1393 (setq highest (1- (string-to-number (car uidnext))))) 1362 (setq highest (1- (string-to-number (car uidnext)))))
1394 (cond 1363 (cond
1395 ((null highest) 1364 ((null highest)
1396 (insert (format "%S 0 1 y\n" egroup))) 1365 (insert (format "%S 0 1 y\n" group)))
1397 ((zerop exists) 1366 ((zerop exists)
1398 ;; Empty group. 1367 ;; Empty group.
1399 (insert (format "%S %d %d y\n" egroup 1368 (insert (format "%S %d %d y\n" group
1400 highest (1+ highest)))) 1369 highest (1+ highest))))
1401 (t 1370 (t
1402 ;; Return the widest possible range. 1371 ;; Return the widest possible range.
1403 (insert (format "%S %d 1 y\n" egroup 1372 (insert (format "%S %d 1 y\n" group
1404 (or highest exists))))))))) 1373 (or highest exists)))))))))
1405 t))))) 1374 t)))))
1406 1375
@@ -1412,7 +1381,7 @@ If LIMIT, first try to limit the search to the N last articles."
1412 (nnimap-get-groups))) 1381 (nnimap-get-groups)))
1413 (unless (assoc group nnimap-current-infos) 1382 (unless (assoc group nnimap-current-infos)
1414 ;; Insert dummy numbers here -- they don't matter. 1383 ;; Insert dummy numbers here -- they don't matter.
1415 (insert (format "%S 0 1 y\n" (nnimap-encode-gnus-group group))))) 1384 (insert (format "%S 0 1 y\n" group))))
1416 t))) 1385 t)))
1417 1386
1418(deffoo nnimap-retrieve-group-data-early (server infos) 1387(deffoo nnimap-retrieve-group-data-early (server infos)
@@ -1429,8 +1398,7 @@ If LIMIT, first try to limit the search to the N last articles."
1429 ;; what and how to request the data. 1398 ;; what and how to request the data.
1430 (dolist (info infos) 1399 (dolist (info infos)
1431 (setq params (gnus-info-params info) 1400 (setq params (gnus-info-params info)
1432 group (nnimap-decode-gnus-group 1401 group (gnus-group-real-name (gnus-info-group info))
1433 (gnus-group-real-name (gnus-info-group info)))
1434 active (cdr (assq 'active params)) 1402 active (cdr (assq 'active params))
1435 unexist (assq 'unexist (gnus-info-marks info)) 1403 unexist (assq 'unexist (gnus-info-marks info))
1436 uidvalidity (cdr (assq 'uidvalidity params)) 1404 uidvalidity (cdr (assq 'uidvalidity params))
@@ -1511,16 +1479,13 @@ If LIMIT, first try to limit the search to the N last articles."
1511 (active (gnus-active group))) 1479 (active (gnus-active group)))
1512 (when active 1480 (when active
1513 (insert (format "%S %d %d y\n" 1481 (insert (format "%S %d %d y\n"
1514 (nnimap-encode-gnus-group 1482 (gnus-group-real-name group)
1515 (nnimap-decode-gnus-group
1516 (gnus-group-real-name group)))
1517 (cdr active) 1483 (cdr active)
1518 (car active)))))))))))) 1484 (car active))))))))))))
1519 1485
1520(defun nnimap-update-infos (flags infos) 1486(defun nnimap-update-infos (flags infos)
1521 (dolist (info infos) 1487 (dolist (info infos)
1522 (let* ((group (nnimap-decode-gnus-group 1488 (let* ((group (gnus-group-real-name (gnus-info-group info)))
1523 (gnus-group-real-name (gnus-info-group info))))
1524 (marks (cdr (assoc group flags)))) 1489 (marks (cdr (assoc group flags))))
1525 (when marks 1490 (when marks
1526 (nnimap-update-info info marks))))) 1491 (nnimap-update-info info marks)))))
@@ -1734,8 +1699,7 @@ If LIMIT, first try to limit the search to the N last articles."
1734 (nreverse result)))) 1699 (nreverse result))))
1735 1700
1736(defun nnimap-store-info (info active) 1701(defun nnimap-store-info (info active)
1737 (let* ((group (nnimap-decode-gnus-group 1702 (let* ((group (gnus-group-real-name (gnus-info-group info)))
1738 (gnus-group-real-name (gnus-info-group info))))
1739 (entry (assoc group nnimap-current-infos))) 1703 (entry (assoc group nnimap-current-infos)))
1740 (if entry 1704 (if entry
1741 (setcdr entry (list info active)) 1705 (setcdr entry (list info active))
@@ -1860,8 +1824,6 @@ If LIMIT, first try to limit the search to the N last articles."
1860(autoload 'nnir-search-thread "nnir") 1824(autoload 'nnir-search-thread "nnir")
1861 1825
1862(deffoo nnimap-request-thread (header &optional group server) 1826(deffoo nnimap-request-thread (header &optional group server)
1863 (when group
1864 (setq group (nnimap-decode-gnus-group group)))
1865 (if gnus-refer-thread-use-nnir 1827 (if gnus-refer-thread-use-nnir
1866 (nnir-search-thread header) 1828 (nnir-search-thread header)
1867 (when (nnimap-change-group group server) 1829 (when (nnimap-change-group group server)
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."
665 (condition-case err 665 (condition-case err
666 (progn 666 (progn
667 (narrow-to-region (point) (point-at-eol)) 667 (narrow-to-region (point) (point-at-eol))
668 (setq group (read buffer)) 668 (setq group (read buffer)
669 (unless (stringp group) 669 group
670 (setq group (encode-coding-string (symbol-name group) 'latin-1))) 670 (cond ((symbolp group)
671 (symbol-name group))
672 ((numberp group)
673 (number-to-string group))))
671 (if (and (numberp (setq max (read buffer))) 674 (if (and (numberp (setq max (read buffer)))
672 (numberp (setq min (read buffer)))) 675 (numberp (setq min (read buffer))))
673 (push (list group (cons min max)) 676 (push (list group (cons min max))
@@ -677,7 +680,7 @@ nn*-request-list should have been called before calling this function."
677 (forward-line 1)) 680 (forward-line 1))
678 group-assoc)) 681 group-assoc))
679 682
680(defcustom nnmail-active-file-coding-system 'raw-text 683(defcustom nnmail-active-file-coding-system 'utf-8-emacs
681 "Coding system for active file." 684 "Coding system for active file."
682 :group 'nnmail-various 685 :group 'nnmail-various
683 :type 'coding-system) 686 :type 'coding-system)
@@ -687,7 +690,7 @@ nn*-request-list should have been called before calling this function."
687 (let ((coding-system-for-write nnmail-active-file-coding-system)) 690 (let ((coding-system-for-write nnmail-active-file-coding-system))
688 (when file-name 691 (when file-name
689 (with-temp-file file-name 692 (with-temp-file file-name
690 (mm-disable-multibyte) 693; (mm-disable-multibyte)
691 (nnmail-generate-active group-assoc))))) 694 (nnmail-generate-active group-assoc)))))
692 695
693(defun nnmail-generate-active (alist) 696(defun nnmail-generate-active (alist)
@@ -695,7 +698,7 @@ nn*-request-list should have been called before calling this function."
695 (erase-buffer) 698 (erase-buffer)
696 (let (group) 699 (let (group)
697 (while (setq group (pop alist)) 700 (while (setq group (pop alist))
698 (insert (format "%S %d %d y\n" (intern (car group)) (cdadr group) 701 (insert (format "%s %d %d y\n" (car group) (cdadr group)
699 (caadr group)))) 702 (caadr group))))
700 (goto-char (point-max)) 703 (goto-char (point-max))
701 (while (search-backward "\\." nil t) 704 (while (search-backward "\\." nil t)
@@ -1027,8 +1030,8 @@ If SOURCE is a directory spec, try to return the group name component."
1027 (nnmail-check-duplication message-id func artnum-func)) 1030 (nnmail-check-duplication message-id func artnum-func))
1028 1)) 1031 1))
1029 1032
1030(defvar nnmail-group-names-not-encoded-p nil 1033(make-obsolete-variable 'nnmail-group-names-not-encoded-p
1031 "Non-nil means group names are not encoded.") 1034 "Group names are always decoded" "27.1")
1032 1035
1033(defun nnmail-split-incoming (incoming func &optional exit-func 1036(defun nnmail-split-incoming (incoming func &optional exit-func
1034 group artnum-func junk-func) 1037 group artnum-func junk-func)
@@ -1036,18 +1039,21 @@ If SOURCE is a directory spec, try to return the group name component."
1036FUNC will be called with the buffer narrowed to each mail. 1039FUNC will be called with the buffer narrowed to each mail.
1037INCOMING can also be a buffer object. In that case, the mail 1040INCOMING can also be a buffer object. In that case, the mail
1038will be copied over from that buffer." 1041will be copied over from that buffer."
1039 (let ( ;; If this is a group-specific split, we bind the split 1042 (let (;; If this is a group-specific split, we bind the split
1040 ;; methods to just this group. 1043 ;; methods to just this group.
1041 (nnmail-split-methods (if (and group 1044 (nnmail-split-methods (if (and group
1042 (not nnmail-resplit-incoming)) 1045 (not nnmail-resplit-incoming))
1043 (list (list group "")) 1046 (list (list group ""))
1044 nnmail-split-methods)) 1047 nnmail-split-methods)))
1045 (nnmail-group-names-not-encoded-p t))
1046 ;; Insert the incoming file. 1048 ;; Insert the incoming file.
1047 (with-current-buffer (get-buffer-create nnmail-article-buffer) 1049 (with-current-buffer (get-buffer-create nnmail-article-buffer)
1048 (erase-buffer) 1050 (erase-buffer)
1049 (if (bufferp incoming) 1051 (if (bufferp incoming)
1050 (insert-buffer-substring incoming) 1052 (insert-buffer-substring incoming)
1053 ;; The following coding system is set to
1054 ;; `mm-text-coding-system', which is set to some flavor of
1055 ;; 'raw-text "to get rid of ^Ms". But it's going to do a lot
1056 ;; more than that, right? Shouldn't this also be 'undecided?
1051 (let ((coding-system-for-read nnmail-incoming-coding-system)) 1057 (let ((coding-system-for-read nnmail-incoming-coding-system))
1052 (mm-insert-file-contents incoming))) 1058 (mm-insert-file-contents incoming)))
1053 (prog1 1059 (prog1
diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el
index 246f52c8d2b..d62e1e92536 100644
--- a/lisp/gnus/nnmaildir.el
+++ b/lisp/gnus/nnmaildir.el
@@ -415,7 +415,7 @@ This variable is set by `nnmaildir-request-article'.")
415 (t (signal (car err) (cdr err))))))))) 415 (t (signal (car err) (cdr err)))))))))
416 416
417(defun nnmaildir--update-nov (server group article) 417(defun nnmaildir--update-nov (server group article)
418 (let ((nnheader-file-coding-system 'binary) 418 (let ((nnheader-file-coding-system 'undecided)
419 (srv-dir (nnmaildir--srv-dir server)) 419 (srv-dir (nnmaildir--srv-dir server))
420 (storage-version 1) ;; [version article-number msgid [...nov...]] 420 (storage-version 1) ;; [version article-number msgid [...nov...]]
421 dir gname pgname msgdir prefix suffix file attr mtime novdir novfile 421 dir gname pgname msgdir prefix suffix file attr mtime novdir novfile
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index 89c8b23b65a..302589bd6d7 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -111,36 +111,9 @@ non-nil.")
111 111
112(nnoo-define-basics nnml) 112(nnoo-define-basics nnml)
113 113
114(eval-when-compile
115 (defsubst nnml-group-name-charset (group server-or-method)
116 (gnus-group-name-charset
117 (if (stringp server-or-method)
118 (gnus-server-to-method
119 (if (string-match "\\+" server-or-method)
120 (concat (substring server-or-method 0 (match-beginning 0))
121 ":" (substring server-or-method (match-end 0)))
122 (concat "nnml:" server-or-method)))
123 (or server-or-method gnus-command-method '(nnml "")))
124 group)))
125
126(defun nnml-decoded-group-name (group &optional server-or-method)
127 "Return a decoded group name of GROUP on SERVER-OR-METHOD."
128 (if nnmail-group-names-not-encoded-p
129 group
130 (decode-coding-string
131 group
132 (nnml-group-name-charset group server-or-method))))
133
134(defun nnml-encoded-group-name (group &optional server-or-method)
135 "Return an encoded group name of GROUP on SERVER-OR-METHOD."
136 (encode-coding-string
137 group
138 (nnml-group-name-charset group server-or-method)))
139
140(defun nnml-group-pathname (group &optional file server) 114(defun nnml-group-pathname (group &optional file server)
141 "Return an absolute file name of FILE for GROUP on SERVER." 115 "Return an absolute file name of FILE for GROUP on SERVER."
142 (nnmail-group-pathname (inline (nnml-decoded-group-name group server)) 116 (nnmail-group-pathname group nnml-directory file))
143 nnml-directory file))
144 117
145(deffoo nnml-retrieve-headers (sequence &optional group server fetch-old) 118(deffoo nnml-retrieve-headers (sequence &optional group server fetch-old)
146 (when (nnml-possibly-change-directory group server) 119 (when (nnml-possibly-change-directory group server)
@@ -243,8 +216,7 @@ non-nil.")
243 (string-to-number (file-name-nondirectory path))))))) 216 (string-to-number (file-name-nondirectory path)))))))
244 217
245(deffoo nnml-request-group (group &optional server dont-check info) 218(deffoo nnml-request-group (group &optional server dont-check info)
246 (let ((file-name-coding-system nnmail-pathname-coding-system) 219 (let ((file-name-coding-system nnmail-pathname-coding-system))
247 (decoded (nnml-decoded-group-name group server)))
248 (cond 220 (cond
249 ((not (nnml-possibly-change-directory group server)) 221 ((not (nnml-possibly-change-directory group server))
250 (nnheader-report 'nnml "Invalid group (no such directory)")) 222 (nnheader-report 'nnml "Invalid group (no such directory)"))
@@ -254,15 +226,15 @@ non-nil.")
254 ((not (file-directory-p nnml-current-directory)) 226 ((not (file-directory-p nnml-current-directory))
255 (nnheader-report 'nnml "%s is not a directory" nnml-current-directory)) 227 (nnheader-report 'nnml "%s is not a directory" nnml-current-directory))
256 (dont-check 228 (dont-check
257 (nnheader-report 'nnml "Group %s selected" decoded) 229 (nnheader-report 'nnml "Group %s selected" group)
258 t) 230 t)
259 (t 231 (t
260 (nnheader-re-read-dir nnml-current-directory) 232 (nnheader-re-read-dir nnml-current-directory)
261 (nnmail-activate 'nnml) 233 (nnmail-activate 'nnml)
262 (let ((active (nth 1 (assoc-string group nnml-group-alist)))) 234 (let ((active (nth 1 (assoc-string group nnml-group-alist))))
263 (if (not active) 235 (if (not active)
264 (nnheader-report 'nnml "No such group: %s" decoded) 236 (nnheader-report 'nnml "No such group: %s" group)
265 (nnheader-report 'nnml "Selected group %s" decoded) 237 (nnheader-report 'nnml "Selected group %s" group)
266 (nnheader-insert "211 %d %d %d %s\n" 238 (nnheader-insert "211 %d %d %d %s\n"
267 (max (1+ (- (cdr active) (car active))) 0) 239 (max (1+ (- (cdr active) (car active))) 0)
268 (car active) (cdr active) group))))))) 240 (car active) (cdr active) group)))))))
@@ -332,7 +304,6 @@ non-nil.")
332 (active-articles 304 (active-articles
333 (nnml-directory-articles nnml-current-directory)) 305 (nnml-directory-articles nnml-current-directory))
334 (is-old t) 306 (is-old t)
335 (decoded (nnml-decoded-group-name group server))
336 article rest mod-time number target) 307 article rest mod-time number target)
337 (nnmail-activate 'nnml) 308 (nnmail-activate 'nnml)
338 309
@@ -370,7 +341,7 @@ non-nil.")
370 (if target 341 (if target
371 (progn 342 (progn
372 (nnheader-message 5 "Deleting article %s in %s" 343 (nnheader-message 5 "Deleting article %s in %s"
373 number decoded) 344 number group)
374 (condition-case () 345 (condition-case ()
375 (funcall nnmail-delete-file-function article) 346 (funcall nnmail-delete-file-function article)
376 (file-error 347 (file-error
@@ -506,13 +477,12 @@ non-nil.")
506 nnml-current-directory t 477 nnml-current-directory t
507 (concat 478 (concat
508 nnheader-numerical-short-files 479 nnheader-numerical-short-files
509 "\\|" (regexp-quote nnml-nov-file-name) "$"))) 480 "\\|" (regexp-quote nnml-nov-file-name) "$"))))
510 (decoded (nnml-decoded-group-name group server)))
511 (dolist (article articles) 481 (dolist (article articles)
512 (when (file-writable-p article) 482 (when (file-writable-p article)
513 (nnheader-message 5 "Deleting article %s in %s..." 483 (nnheader-message 5 "Deleting article %s in %s..."
514 (file-name-nondirectory article) 484 (file-name-nondirectory article)
515 decoded) 485 group)
516 (funcall nnmail-delete-file-function article)))) 486 (funcall nnmail-delete-file-function article))))
517 ;; Try to delete the directory itself. 487 ;; Try to delete the directory itself.
518 (ignore-errors (delete-directory nnml-current-directory)))) 488 (ignore-errors (delete-directory nnml-current-directory))))
@@ -687,15 +657,7 @@ article number. This function is called narrowed to an article."
687 (if (stringp nnml-use-compressed-files) 657 (if (stringp nnml-use-compressed-files)
688 nnml-use-compressed-files 658 nnml-use-compressed-files
689 ".gz"))) 659 ".gz")))
690 decoded dec file first headers) 660 file first headers)
691 (when nnmail-group-names-not-encoded-p
692 (dolist (ga (prog1 group-art (setq group-art nil)))
693 (setq group-art (nconc group-art
694 (list (cons (nnml-encoded-group-name (car ga)
695 server)
696 (cdr ga))))
697 decoded (nconc decoded (list (car ga)))))
698 (setq dec decoded))
699 (nnmail-insert-xref group-art) 661 (nnmail-insert-xref group-art)
700 (run-hooks 'nnmail-prepare-save-mail-hook) 662 (run-hooks 'nnmail-prepare-save-mail-hook)
701 (run-hooks 'nnml-prepare-save-mail-hook) 663 (run-hooks 'nnml-prepare-save-mail-hook)
@@ -705,16 +667,10 @@ article number. This function is called narrowed to an article."
705 (forward-line 1)) 667 (forward-line 1))
706 ;; We save the article in all the groups it belongs in. 668 ;; We save the article in all the groups it belongs in.
707 (dolist (ga group-art) 669 (dolist (ga group-art)
708 (if nnmail-group-names-not-encoded-p 670 (nnml-possibly-create-directory (car ga) server)
709 (progn 671 (setq file (nnml-group-pathname
710 (nnml-possibly-create-directory (car decoded) server) 672 (car ga) (concat (number-to-string (cdr ga)) extension)
711 (setq file (nnmail-group-pathname 673 server))
712 (pop decoded) nnml-directory
713 (concat (number-to-string (cdr ga)) extension))))
714 (nnml-possibly-create-directory (car ga) server)
715 (setq file (nnml-group-pathname
716 (car ga) (concat (number-to-string (cdr ga)) extension)
717 server)))
718 (if first 674 (if first
719 ;; It was already saved, so we just make a hard link. 675 ;; It was already saved, so we just make a hard link.
720 (let ((file-name-coding-system nnmail-pathname-coding-system)) 676 (let ((file-name-coding-system nnmail-pathname-coding-system))
@@ -731,18 +687,13 @@ article number. This function is called narrowed to an article."
731 (let ((func (if full-nov 687 (let ((func (if full-nov
732 'nnml-add-nov 688 'nnml-add-nov
733 'nnml-add-incremental-nov))) 689 'nnml-add-incremental-nov)))
734 (if nnmail-group-names-not-encoded-p 690 (dolist (ga group-art)
735 (dolist (ga group-art) 691 (funcall func (car ga) (cdr ga) headers))))
736 (funcall func (pop dec) (cdr ga) headers))
737 (dolist (ga group-art)
738 (funcall func (car ga) (cdr ga) headers)))))
739 group-art) 692 group-art)
740 693
741(defun nnml-active-number (group &optional server) 694(defun nnml-active-number (group &optional server)
742 "Compute the next article number in GROUP on SERVER." 695 "Compute the next article number in GROUP on SERVER."
743 (let* ((encoded (if nnmail-group-names-not-encoded-p 696 (let ((active (cadr (assoc-string group nnml-group-alist))))
744 (nnml-encoded-group-name group server)))
745 (active (cadr (assoc-string (or encoded group) nnml-group-alist))))
746 ;; The group wasn't known to nnml, so we just create an active 697 ;; The group wasn't known to nnml, so we just create an active
747 ;; entry for it. 698 ;; entry for it.
748 (unless active 699 (unless active
@@ -760,7 +711,7 @@ article number. This function is called narrowed to an article."
760 (cons (caar nnml-article-file-alist) 711 (cons (caar nnml-article-file-alist)
761 (caar (last nnml-article-file-alist))) 712 (caar (last nnml-article-file-alist)))
762 (cons 1 0))) 713 (cons 1 0)))
763 (push (list (or encoded group) active) nnml-group-alist)) 714 (push (list group active) nnml-group-alist))
764 (setcdr active (1+ (cdr active))) 715 (setcdr active (1+ (cdr active)))
765 (while (file-exists-p 716 (while (file-exists-p
766 (nnml-group-pathname group (int-to-string (cdr active)) server)) 717 (nnml-group-pathname group (int-to-string (cdr active)) server))
@@ -821,16 +772,15 @@ article number. This function is called narrowed to an article."
821 headers)))) 772 headers))))
822 773
823(defun nnml-get-nov-buffer (group &optional incrementalp) 774(defun nnml-get-nov-buffer (group &optional incrementalp)
824 (let* ((decoded (nnml-decoded-group-name group)) 775 (let ((buffer (get-buffer-create (format " *nnml %soverview %s*"
825 (buffer (get-buffer-create (format " *nnml %soverview %s*"
826 (if incrementalp 776 (if incrementalp
827 "incremental " 777 "incremental "
828 "") 778 "")
829 decoded))) 779 group)))
830 (file-name-coding-system nnmail-pathname-coding-system)) 780 (file-name-coding-system nnmail-pathname-coding-system))
831 (with-current-buffer buffer 781 (with-current-buffer buffer
832 (set (make-local-variable 'nnml-nov-buffer-file-name) 782 (set (make-local-variable 'nnml-nov-buffer-file-name)
833 (nnmail-group-pathname decoded nnml-directory nnml-nov-file-name)) 783 (nnmail-group-pathname group nnml-directory nnml-nov-file-name))
834 (erase-buffer) 784 (erase-buffer)
835 (when (and (not incrementalp) 785 (when (and (not incrementalp)
836 (file-exists-p nnml-nov-buffer-file-name)) 786 (file-exists-p nnml-nov-buffer-file-name))
@@ -908,7 +858,7 @@ Unless no-active is non-nil, update the active file too."
908 ;; Update the active info for this group. 858 ;; Update the active info for this group.
909 (let ((group (directory-file-name dir)) 859 (let ((group (directory-file-name dir))
910 entry last) 860 entry last)
911 (setq group (nnheader-file-to-group (nnml-encoded-group-name group) 861 (setq group (nnheader-file-to-group group
912 nnml-directory) 862 nnml-directory)
913 entry (assoc group nnml-group-alist) 863 entry (assoc group nnml-group-alist)
914 last (or (caadr entry) 0) 864 last (or (caadr entry) 0)
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el
index 82d3f574249..958745d5790 100644
--- a/lisp/gnus/nnrss.el
+++ b/lisp/gnus/nnrss.el
@@ -368,7 +368,7 @@ for decoding when the cdr that the data specify is not available.")
368 (with-current-buffer nntp-server-buffer 368 (with-current-buffer nntp-server-buffer
369 (erase-buffer) 369 (erase-buffer)
370 (dolist (group groups) 370 (dolist (group groups)
371 (let ((elem (assoc-string (gnus-group-decoded-name group) nnrss-server-data))) 371 (let ((elem (assoc-string group nnrss-server-data)))
372 (insert (format "%S %s 1 y\n" group (or (cadr elem) 0))))) 372 (insert (format "%S %s 1 y\n" group (or (cadr elem) 0)))))
373 'active)) 373 'active))
374 374