]> git.eshelyaron.com Git - emacs.git/commitdiff
Replace octal regexp with [:ascii:] char class in Gnus
authorEric Abrahamsen <eric@ericabrahamsen.net>
Mon, 17 Jun 2019 18:06:38 +0000 (11:06 -0700)
committerEric Abrahamsen <eric@ericabrahamsen.net>
Mon, 17 Jun 2019 18:06:38 +0000 (11:06 -0700)
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.

lisp/gnus/gnus-group.el
lisp/gnus/gnus-registry.el
lisp/gnus/gnus-start.el
lisp/gnus/message.el

index ed81e12a08549c0aad6a5b0770616af3b530465f..41234e963ad4394723b61e058c0957bd2800696f 100644 (file)
@@ -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)
index 8f3c11be5029a7a33aa8dbbc4b4210e722a3e052..e83bc97bacbfd7c8811212b5cf5ada23b2598be6 100644 (file)
@@ -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
index 090d1154363737e5a5473dcd850950941a17bd86..7bac61cc6cd2a82d730d61f7930a4445b22a8e9d 100644 (file)
@@ -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))))
index c8b6f0ee6857cd5bff3f2a6fd4f40f122058aca6..c2374c70730f79b9c114c5d5f9160ebe46581020 100644 (file)
@@ -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.