Commit cf1afe68 authored by Eric Abrahamsen's avatar Eric Abrahamsen

Replace octal regexp with [:ascii:] char class in Gnus

In the regexp used to match multibyte group names

* lisp/gnus/gnus-group.el (gnus-group-completing-read):
* lisp/gnus/gnus-registry.el (gnus-registry--munge-group-names):
* lisp/gnus/gnus-start.el (gnus-make-hashtable-from-newsrc-alist):
  (gnus-active-to-gnus-format):
  (gnus-read-newsrc-el-file):
* lisp/gnus/message.el (message-make-in-reply-to): Replace in these
  locations.
parent 573e21d0
......@@ -2159,7 +2159,7 @@ or vector."
(let* ((choices
(mapcar
(lambda (g)
(if (string-match "[^\000-\177]" g)
(if (string-match "[^[:ascii:]]" g)
(gnus-group-decoded-name g)
g))
(cond ((listp collection)
......
......@@ -280,7 +280,7 @@ Encode names if ENCODE is non-nil, otherwise decode."
(remhash group-name grouphash)
(puthash (encode-coding-string group-name 'utf-8-emacs)
val grouphash))
(when (string-match-p "[^\000-\177]" group-name)
(when (string-match-p "[^[:ascii:]]" group-name)
(remhash group-name grouphash)
(puthash (decode-coding-string group-name 'utf-8-emacs) val grouphash))))
grouphash))
......@@ -290,7 +290,7 @@ Encode names if ENCODE is non-nil, otherwise decode."
(when (seq-some (lambda (g)
(if encode
(multibyte-string-p g)
(string-match-p "[^\000-\177]" g)))
(string-match-p "[^[:ascii:]]" g)))
groups)
;; Create a replacement DATA.
(push (list id (cons (cons 'group (mapcar
......
......@@ -1836,7 +1836,7 @@ The info element is shared with the same element of
(gnus-info-set-method info (car rest))
(push method methods)))
;; Check for encoded group names and decode them.
(when (string-match-p "[^\000-\177]" (setq gname (car info)))
(when (string-match-p "[^[:ascii:]]" (setq gname (car info)))
(let ((decoded (gnus-group-decoded-name gname)))
(setf gname decoded
(car info) decoded)))
......@@ -2165,7 +2165,7 @@ The info element is shared with the same element of
(skip-chars-forward " \t")
(memq (char-after)
'(?= ?x ?j)))))
(progn (when (string-match-p "[^\000-\177]" group)
(progn (when (string-match-p "[^[:ascii:]]" group)
;; NNTP servers may give us encoded group
;; names.
(setq group (gnus-group-decoded-name group)))
......@@ -2414,7 +2414,7 @@ If FORCE is non-nil, the .newsrc file is read."
(lambda (elt)
(cons (car elt)
(mapcar (lambda (g)
(if (string-match-p "[^\000-\177]" g)
(if (string-match-p "[^[:ascii:]]" g)
(gnus-group-decoded-name g)
g))
(cdr elt))))
......
......@@ -5656,7 +5656,7 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'."
(concat
msg-id (if msg-id " (")
(if (car name)
(if (string-match "[^\000-\177]" (car name))
(if (string-match "[^[:ascii:]]" (car name))
;; Quote a string containing non-ASCII characters.
;; It will make the RFC2047 encoder cause an error
;; if there are special characters.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment