emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/gnus-decoded cf1afe6 3/7: Replace octal regexp wit


From: Eric Abrahamsen
Subject: [Emacs-diffs] scratch/gnus-decoded cf1afe6 3/7: Replace octal regexp with [:ascii:] char class in Gnus
Date: Fri, 21 Jun 2019 16:55:34 -0400 (EDT)

branch: scratch/gnus-decoded
commit cf1afe686aa1b248433d1f8578585ed6c0eaa652
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    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.
---
 lisp/gnus/gnus-group.el    | 2 +-
 lisp/gnus/gnus-registry.el | 4 ++--
 lisp/gnus/gnus-start.el    | 6 +++---
 lisp/gnus/message.el       | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index ed81e12..41234e9 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -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)
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index 8f3c11b..e83bc97 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -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
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 090d115..7bac61c 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -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))))
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index c8b6f0e..c2374c7 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]