all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: [PATCH] Use regexp types in defcustom where appropriate
Date: Sat, 21 Dec 2019 21:17:46 +0100	[thread overview]
Message-ID: <A464A9AF-5CC4-4FB8-A8A3-D7B191A565F8@acm.org> (raw)
In-Reply-To: <f6625a22-051c-3958-820c-5551d479c981@cs.ucla.edu>

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

21 dec. 2019 kl. 20.21 skrev Paul Eggert <eggert@cs.ucla.edu>:

> Did you miss some instances in rcirc-coding-system-alist?

So I did! Updating my script revealed no further positives, however.
Thanks for the quick review; patch updated.


[-- Attachment #2: 0001-Use-regexp-type-for-regexps-in-defcustom-declaration.patch --]
[-- Type: application/octet-stream, Size: 34924 bytes --]

From f9947a9219e490a55e5d5053dfa4e4915e5ded3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= <mattiase@acm.org>
Date: Sat, 21 Dec 2019 18:52:06 +0100
Subject: [PATCH] Use regexp type for regexps in defcustom declarations

* lisp/calendar/diary-lib.el (diary-face-attrs):
* lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-file-match):
* lisp/cedet/srecode/document.el
(srecode-document-autocomment-common-nouns-abbrevs)
(srecode-document-autocomment-function-alist)
(srecode-document-autocomment-return-first-alist)
(srecode-document-autocomment-return-last-alist)
(srecode-document-autocomment-param-alist)
(srecode-document-autocomment-param-type-alist):
* lisp/desktop.el (desktop-clear-preserve-buffers):
* lisp/elide-head.el (elide-head-headers-to-hide):
* lisp/erc/erc-backend.el (erc-encoding-coding-alist):
* lisp/erc/erc-ezbounce.el (erc-ezb-regexp):
* lisp/files.el (auto-save-file-name-transforms):
* lisp/gnus/deuglify.el (gnus-outlook-deuglify-attrib-cut-regexp)
(gnus-outlook-deuglify-attrib-verb-regexp)
(gnus-outlook-deuglify-attrib-end-regexp):
* lisp/gnus/gnus-fun.el (gnus-x-face-omit-files, gnus-face-omit-files):
* lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header):
* lisp/htmlfontify.el (hfy-src-doc-link-unstyle):
* lisp/info-look.el (info-lookup-file-name-alist):
* lisp/international/rfc1843.el (rfc1843-newsgroups-regexp):
* lisp/mail/feedmail.el (feedmail-queue-slug-suspect-regexp):
* lisp/mail/rmail-spam-filter.el (rsf-white-list, rsf-definitions-alist):
* lisp/man.el (Man-name-local-regexp):
* lisp/net/ange-ftp.el (ange-ftp-dumb-unix-host-regexp):
* lisp/net/newst-backend.el (newsticker-auto-mark-filter-list):
* lisp/net/rcirc.el (rcirc-authinfo, rcirc-coding-system-alist):
* lisp/net/tramp-adb.el (tramp-adb-prompt):
* lisp/org/org-agenda.el (org-agenda-hide-tags-regexp)
(org-agenda-category-icon-alist):
* lisp/org/org-protocol.el (org-protocol-data-separator):
* lisp/org/org-table.el (org-table-number-regexp):
* lisp/org/ox-latex.el (org-latex-known-warnings):
* lisp/progmodes/bug-reference.el (bug-reference-bug-regexp):
* lisp/progmodes/hideif.el (hide-ifdef-header-regexp):
* lisp/progmodes/idlw-help.el (idlwave-help-doclib-name)
(idlwave-help-doclib-keyword):
* lisp/progmodes/idlwave.el (idlwave-no-change-comment):
* lisp/progmodes/python.el (python-shell-prompt-input-regexps)
(python-shell-prompt-output-regexps, python-shell-prompt-regexp)
(python-shell-prompt-block-regexp, python-shell-prompt-output-regexp)
(python-shell-prompt-pdb-regexp, python-shell-compilation-regexp-alist)
(python-pdbtrack-stacktrace-info-regexp):
* lisp/progmodes/sql.el (sql-send-terminator, sql-ansi-statement-starters):
* lisp/speedbar.el (speedbar-directory-unshown-regexp)
(speedbar-file-unshown-regexp):
* lisp/textmodes/flyspell.el (flyspell-mark-duplications-exceptions)
(flyspell-tex-command-regexp):
* lisp/textmodes/paragraphs.el (sentence-end-base):
* lisp/textmodes/tildify.el (tildify-pattern, tildify-space-pattern):
* lisp/vc/ediff-init.el (ediff-metachars):
* lisp/vc/vc-git.el (vc-git-root-log-format):
* lisp/vc/vc-hg.el (vc-hg-root-log-format):
* lisp/whitespace.el (whitespace-indentation-regexp)
(whitespace-space-after-tab-regexp):
* lisp/woman.el (woman-manpath-man-regexp)
(woman-imenu-generic-expression):
Use 'regexp' instead of 'string' as type for values that are regexps
in defcustom declarations.
---
 lisp/calendar/diary-lib.el        |  2 +-
 lisp/cedet/semantic/db-ebrowse.el |  2 +-
 lisp/cedet/srecode/document.el    | 14 +++++++-------
 lisp/desktop.el                   |  2 +-
 lisp/elide-head.el                |  4 ++--
 lisp/erc/erc-backend.el           |  2 +-
 lisp/erc/erc-ezbounce.el          |  2 +-
 lisp/files.el                     |  2 +-
 lisp/gnus/deuglify.el             |  6 +++---
 lisp/gnus/gnus-fun.el             |  4 ++--
 lisp/gnus/spam.el                 |  2 +-
 lisp/htmlfontify.el               |  2 +-
 lisp/info-look.el                 |  2 +-
 lisp/international/rfc1843.el     |  2 +-
 lisp/mail/feedmail.el             |  2 +-
 lisp/mail/rmail-spam-filter.el    | 14 +++++++-------
 lisp/man.el                       |  2 +-
 lisp/net/ange-ftp.el              |  2 +-
 lisp/net/newst-backend.el         |  2 +-
 lisp/net/rcirc.el                 |  8 ++++----
 lisp/net/tramp-adb.el             |  2 +-
 lisp/org/org-agenda.el            |  4 ++--
 lisp/org/org-protocol.el          |  2 +-
 lisp/org/org-table.el             |  2 +-
 lisp/org/ox-latex.el              |  2 +-
 lisp/progmodes/bug-reference.el   |  2 +-
 lisp/progmodes/hideif.el          |  2 +-
 lisp/progmodes/idlw-help.el       |  4 ++--
 lisp/progmodes/idlwave.el         |  2 +-
 lisp/progmodes/python.el          | 16 ++++++++--------
 lisp/progmodes/sql.el             |  4 ++--
 lisp/speedbar.el                  |  4 ++--
 lisp/textmodes/flyspell.el        |  4 ++--
 lisp/textmodes/paragraphs.el      |  2 +-
 lisp/textmodes/tildify.el         |  4 ++--
 lisp/vc/ediff-init.el             |  2 +-
 lisp/vc/vc-git.el                 |  2 +-
 lisp/vc/vc-hg.el                  |  2 +-
 lisp/whitespace.el                |  8 ++++----
 lisp/woman.el                     |  4 ++--
 40 files changed, 76 insertions(+), 76 deletions(-)

diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 25849627cd..b20a4c907c 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -98,7 +98,7 @@ diary-face-attrs
 that this is a face (`:face') to apply.  TYPE is the type of
 attribute being applied.  Available TYPES (see `diary-attrtype-convert')
 are: `string', `symbol', `int', `tnil', `stringtnil'."
-  :type '(repeat (list (string :tag "Regular expression")
+  :type '(repeat (list (regexp :tag "Regular expression")
                        (integer :tag "Sub-expression")
                        (symbol :tag "Attribute (e.g. :foreground)")
                        (choice (const string :tag "A string")
diff --git a/lisp/cedet/semantic/db-ebrowse.el b/lisp/cedet/semantic/db-ebrowse.el
index 14ada88612..958f6ed640 100644
--- a/lisp/cedet/semantic/db-ebrowse.el
+++ b/lisp/cedet/semantic/db-ebrowse.el
@@ -74,7 +74,7 @@ semanticdb-ebrowse-file-match
 is only for searching via semanticdb, and thus only headers would
 be searched."
   :group 'semanticdb
-  :type 'string)
+  :type 'regexp)
 
 ;;; SEMANTIC Database related Code
 ;;; Classes:
diff --git a/lisp/cedet/srecode/document.el b/lisp/cedet/srecode/document.el
index 21acc61fef..df7bc0aa33 100644
--- a/lisp/cedet/srecode/document.el
+++ b/lisp/cedet/srecode/document.el
@@ -89,7 +89,7 @@ srecode-document-autocomment-common-nouns-abbrevs
 MATCH is a regexp to match in the type field.
 RESULT is a string."
   :group 'document
-  :type '(repeat (cons (string :tag "Regexp")
+  :type '(repeat (cons (regexp :tag "Regexp")
 		       (string :tag "Doc Text"))))
 
 (defcustom srecode-document-autocomment-function-alist
@@ -145,7 +145,7 @@ srecode-document-autocomment-function-alist
 Doesn't always work correctly, but that is just because English
 doesn't always work correctly."
   :group 'document
-  :type '(repeat (cons (string :tag "Regexp")
+  :type '(repeat (cons (regexp :tag "Regexp")
 		       (string :tag "Doc Text"))))
 
 (defcustom srecode-document-autocomment-common-nouns-abbrevs
@@ -176,7 +176,7 @@ srecode-document-autocomment-common-nouns-abbrevs
 MATCH is a regexp to match in the type field.
 RESULT is a string."
   :group 'document
-  :type '(repeat (cons (string :tag "Regexp")
+  :type '(repeat (cons (regexp :tag "Regexp")
 		       (string :tag "Doc Text"))))
 
 (defcustom srecode-document-autocomment-return-first-alist
@@ -193,7 +193,7 @@ srecode-document-autocomment-return-first-alist
 MATCH is a regexp to match in the type field.
 RESULT is a string."
   :group 'document
-  :type '(repeat (cons (string :tag "Regexp")
+  :type '(repeat (cons (regexp :tag "Regexp")
 		       (string :tag "Doc Text"))))
 
 (defcustom srecode-document-autocomment-return-last-alist
@@ -214,7 +214,7 @@ srecode-document-autocomment-return-last-alist
 RESULT is a string, which can contain %s, which is replaced with
 `match-string' 1."
   :group 'document
-  :type '(repeat (cons (string :tag "Regexp")
+  :type '(repeat (cons (regexp :tag "Regexp")
 		       (string :tag "Doc Text"))))
 
 (defcustom srecode-document-autocomment-param-alist
@@ -234,7 +234,7 @@ srecode-document-autocomment-param-alist
 When one is encountered, document-insert-parameters will automatically
 place this comment after the parameter name."
   :group 'document
-  :type '(repeat (cons (string :tag "Regexp")
+  :type '(repeat (cons (regexp :tag "Regexp")
 		       (string :tag "Doc Text"))))
 
 (defcustom srecode-document-autocomment-param-type-alist
@@ -259,7 +259,7 @@ srecode-document-autocomment-param-type-alist
 MATCH is a regexp to match in the type field.
 RESULT is a string."
   :group 'document
-  :type '(repeat (cons (string :tag "Regexp")
+  :type '(repeat (cons (regexp :tag "Regexp")
 		       (string :tag "Doc Text"))))
 
 ;;;###autoload
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 6f45278218..362a4e825a 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -344,7 +344,7 @@ desktop-clear-preserve-buffers
 Each element is a regular expression.  Buffers with a name matched by any of
 these won't be deleted."
   :version "23.3"                       ; added Warnings - bug#6336
-  :type '(repeat string)
+  :type '(repeat regexp)
   :group 'desktop)
 
 ;;;###autoload
diff --git a/lisp/elide-head.el b/lisp/elide-head.el
index c1678c003d..78197c0b47 100644
--- a/lisp/elide-head.el
+++ b/lisp/elide-head.el
@@ -64,8 +64,8 @@ elide-head-headers-to-hide
 first match is found to the end of the match for the corresponding
 cdr."
   :group 'elide-head
-  :type '(alist :key-type  (string :tag "Start regexp")
-		:value-type (string :tag "End regexp")))
+  :type '(alist :key-type  (regexp :tag "Start regexp")
+		:value-type (regexp :tag "End regexp")))
 
 (defvar elide-head-overlay nil)
 (make-variable-buffer-local 'elide-head-overlay)
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 72a7f86da2..2ac43e4274 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -375,7 +375,7 @@ erc-encoding-coding-alist
 `cyrillic-koi8', then add (\"#linux-ru\" . cyrillic-koi8) to the
 alist."
   :group 'erc-server
-  :type '(repeat (cons (string :tag "Target")
+  :type '(repeat (cons (regexp :tag "Target")
                        coding-system)))
 
 (defcustom erc-server-connect-function #'erc-open-network-stream
diff --git a/lisp/erc/erc-ezbounce.el b/lisp/erc/erc-ezbounce.el
index 899ea2f6b5..b3585c986a 100644
--- a/lisp/erc/erc-ezbounce.el
+++ b/lisp/erc/erc-ezbounce.el
@@ -34,7 +34,7 @@ erc-ezbounce
 (defcustom erc-ezb-regexp "^ezbounce!srv$"
   "Regexp used by the EZBouncer to identify itself to the user."
   :group 'erc-ezbounce
-  :type 'string)
+  :type 'regexp)
 
 (defcustom erc-ezb-login-alist '()
   "Alist of logins suitable for the server we're connecting to.
diff --git a/lisp/files.el b/lisp/files.el
index a384e7136e..1f307dfb0c 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -404,7 +404,7 @@ auto-save-file-name-transforms
 On MS-DOS filesystems without long names this variable is always
 ignored."
   :group 'auto-save
-  :type '(repeat (list (string :tag "Regexp") (string :tag "Replacement")
+  :type '(repeat (list (regexp :tag "Regexp") (string :tag "Replacement")
 					   (boolean :tag "Uniquify")))
   :initialize 'custom-initialize-delay
   :version "21.1")
diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el
index 3bf6a3aa2a..8f24276237 100644
--- a/lisp/gnus/deuglify.el
+++ b/lisp/gnus/deuglify.el
@@ -266,21 +266,21 @@ gnus-outlook-deuglify-attrib-cut-regexp
   "\\(On \\|Am \\)?\\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\),[^,]+, "
   "Regular expression matching the beginning of an attribution line that should be cut off."
   :version "22.1"
-  :type 'string
+  :type 'regexp
   :group 'gnus-outlook-deuglify)
 
 (defcustom gnus-outlook-deuglify-attrib-verb-regexp
   "wrote\\|writes\\|says\\|schrieb\\|schreibt\\|meinte\\|skrev\\|a écrit\\|schreef\\|escribió"
   "Regular expression matching the verb used in an attribution line."
   :version "22.1"
-  :type 'string
+  :type 'regexp
   :group 'gnus-outlook-deuglify)
 
 (defcustom  gnus-outlook-deuglify-attrib-end-regexp
   ": *\\|\\.\\.\\."
   "Regular expression matching the end of an attribution line."
   :version "22.1"
-  :type 'string
+  :type 'regexp
   :group 'gnus-outlook-deuglify)
 
 (defcustom gnus-outlook-display-hook nil
diff --git a/lisp/gnus/gnus-fun.el b/lisp/gnus/gnus-fun.el
index 8b710512be..323860bf18 100644
--- a/lisp/gnus/gnus-fun.el
+++ b/lisp/gnus/gnus-fun.el
@@ -40,7 +40,7 @@ gnus-x-face-omit-files
   "Regexp to match faces in `gnus-x-face-directory' to be omitted."
   :version "25.1"
   :group 'gnus-fun
-  :type '(choice (const nil) string))
+  :type '(choice (const nil) regexp))
 
 (defcustom gnus-face-directory (expand-file-name "faces" gnus-directory)
   "Directory where Face PNG files are stored."
@@ -52,7 +52,7 @@ gnus-face-omit-files
   "Regexp to match faces in `gnus-face-directory' to be omitted."
   :version "25.1"
   :group 'gnus-fun
-  :type '(choice (const nil) string))
+  :type '(choice (const nil) regexp))
 
 (defcustom gnus-convert-pbm-to-x-face-command "pbmtoxbm %s | compface"
   "Command for converting a PBM to an X-Face."
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index 83df2f6198..e7a63d278e 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -579,7 +579,7 @@ spam-spamassassin-spam-flag-header
 (defcustom spam-spamassassin-positive-spam-flag-header "YES"
   "The regex on `spam-spamassassin-spam-flag-header' for positive spam
 identification."
-  :type 'string
+  :type 'regexp
   :group 'spam-spamassassin)
 
 (defcustom spam-spamassassin-spam-status-header "X-Spam-Status"
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index 481b14738b..6b88ea9d73 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -197,7 +197,7 @@ hfy-src-doc-link-unstyle
   "Regex to remove from the `<style> a' variant of an htmlfontify CSS class."
   :group 'htmlfontify
   :tag   "src-doc-link-unstyle"
-  :type  '(string))
+  :type  '(regexp))
 
 (defcustom hfy-link-extn nil
   "File extension used for href links.
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 8a484bbed1..ea8fe9646a 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -75,7 +75,7 @@ info-lookup-file-name-alist
 
 If a file name matches REGEXP, then use help mode MODE instead of the
 buffer's major mode."
-  :group 'info-lookup :type '(repeat (cons (string :tag "Regexp")
+  :group 'info-lookup :type '(repeat (cons (regexp :tag "Regexp")
 					   (symbol :tag "Mode"))))
 
 (defvar info-lookup-history nil
diff --git a/lisp/international/rfc1843.el b/lisp/international/rfc1843.el
index 545ee4e53e..d7a6ddfce7 100644
--- a/lisp/international/rfc1843.el
+++ b/lisp/international/rfc1843.el
@@ -60,7 +60,7 @@ rfc1843-decode-hzp
 
 (defcustom rfc1843-newsgroups-regexp "chinese\\|hz"
   "Regexp of newsgroups in which might be HZ encoded."
-  :type 'string
+  :type 'regexp
   :group 'mime)
 
 (defun rfc1843-decode-region (from to)
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el
index 08db4262f1..7b7cefa405 100644
--- a/lisp/mail/feedmail.el
+++ b/lisp/mail/feedmail.el
@@ -1203,7 +1203,7 @@ feedmail-queue-slug-suspect-regexp
 feedmail-tidy-up-slug and indirectly by feedmail-queue-subject-slug-maker."
   :version "24.1"
   :group 'feedmail-queue
-  :type 'string
+  :type 'regexp
 )
 
 
diff --git a/lisp/mail/rmail-spam-filter.el b/lisp/mail/rmail-spam-filter.el
index 86217e5dd5..f08c050802 100644
--- a/lisp/mail/rmail-spam-filter.el
+++ b/lisp/mail/rmail-spam-filter.el
@@ -133,7 +133,7 @@ rsf-white-list
 flagged as a valid, non-spam message.  E.g., if your domain is
 \"emacs.com\" then including \"emacs\\\\.com\" in this list would
 flag all mail (purporting to be) from your colleagues as valid."
-  :type '(repeat string)
+  :type '(repeat regexp)
   :group 'rmail-spam-filter)
 
 (defcustom rsf-definitions-alist nil
@@ -157,22 +157,22 @@ rsf-definitions-alist
           (list :format "%v"
 	   (cons :format "%v" :value (from . "")
 		 (const :format ""  from)
-		 (string :tag "From"  ""))
+		 (regexp :tag "From"  ""))
 	   (cons :format "%v" :value (to . "")
 		 (const :format ""  to)
-		 (string :tag "To"  ""))
+		 (regexp :tag "To"  ""))
 	   (cons :format "%v" :value (subject . "")
 		 (const :format ""  subject)
-		 (string :tag "Subject"  ""))
+		 (regexp :tag "Subject"  ""))
 	   (cons :format "%v" :value (content-type . "")
 		 (const :format ""  content-type)
-		 (string :tag "Content-Type"  ""))
+		 (regexp :tag "Content-Type"  ""))
 	   (cons :format "%v" :value (contents . "")
 		 (const :format ""  contents)
-		 (string :tag "Contents"  ""))
+		 (regexp :tag "Contents"  ""))
 	   (cons :format "%v" :value (x-spam-status . "")
 		 (const :format ""  x-spam-status)
-		 (string :tag "X-Spam-Status"  ""))
+		 (regexp :tag "X-Spam-Status"  ""))
 	   (cons :format "%v" :value (action . output-and-delete)
 		 (const :format "" action)
 		 (choice :tag "Action selection"
diff --git a/lisp/man.el b/lisp/man.el
index 2509e5f90c..522661fbd1 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -253,7 +253,7 @@ Man-name-local-regexp
   "Regexp that matches the text that precedes the command's name.
 Used in `bookmark-set' to get the default bookmark name."
   :version "24.1"
-  :type 'string :group 'bookmark)
+  :type 'regexp :group 'bookmark)
 
 (defcustom manual-program "man"
   "Program used by `man' to produce man pages."
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 140a0e7e93..7157023342 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -838,7 +838,7 @@ ange-ftp-dumb-unix-host-regexp
   "If non-nil, regexp matching hosts on which `dir' command lists directory."
   :group 'ange-ftp
   :type '(choice (const :tag "Default" nil)
-		 string))
+		 regexp))
 
 (defcustom ange-ftp-binary-file-name-regexp ""
   "If a file matches this regexp then it is transferred in binary mode."
diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el
index 792ddbbf0b..43e1d2b4ec 100644
--- a/lisp/net/newst-backend.el
+++ b/lisp/net/newst-backend.el
@@ -363,7 +363,7 @@ newsticker-auto-mark-filter-list
                                (const :tag "Title" title)
                                (const :tag "Description" description)
                                (const :tag "All" all))
-                              (string :tag "Regexp")))))
+                              (regexp :tag "Regexp")))))
   :group 'newsticker-headline-processing)
 
 ;; ======================================================================
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index a373c7c7d3..e652508cd7 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -254,7 +254,7 @@ rcirc-authinfo
   (\"bitlbee\" bitlbee \"robert\" \"sekrit\")
   (\"dal.net\" nickserv \"bob\" \"sekrit\" \"NickServ@services.dal.net\")
   (\"quakenet.org\" quakenet \"bobby\" \"sekrit\"))"
-  :type '(alist :key-type (string :tag "Server")
+  :type '(alist :key-type (regexp :tag "Server")
 		:value-type (choice (list :tag "NickServ"
 					  (const nickserv)
 					  (string :tag "Nick")
@@ -359,9 +359,9 @@ rcirc-coding-system-alist
 messages.
 If VAL is a cons of coding systems, the car part is used for decoding,
 and the cdr part is used for encoding."
-  :type '(alist :key-type (choice (string :tag "Channel Regexp")
-					  (cons (string :tag "Channel Regexp")
-						(string :tag "Server Regexp")))
+  :type '(alist :key-type (choice (regexp :tag "Channel Regexp")
+					  (cons (regexp :tag "Channel Regexp")
+						(regexp :tag "Server Regexp")))
 		:value-type (choice coding-system
 				    (cons (coding-system :tag "Decode")
                                           (coding-system :tag "Encode")))))
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index f0abb27796..300def103e 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -58,7 +58,7 @@ tramp-adb-method
 (defcustom tramp-adb-prompt
   "^[[:digit:]]*|?[[:alnum:]\e;[]*@?[[:alnum:]]*[^#\\$]*[#\\$][[:space:]]"
   "Regexp used as prompt in almquist shell."
-  :type 'string
+  :type 'regexp
   :version "24.4"
   :group 'tramp)
 
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 2f0bd5f4e1..f77354f11f 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -1883,7 +1883,7 @@ org-agenda-hide-tags-regexp
   :group 'org-agenda-line-format
   :type '(choice
 	  (const  :tag "Hide none" nil)
-	  (string :tag "Regexp   ")))
+	  (regexp :tag "Regexp   ")))
 
 (defvaralias 'org-agenda-remove-tags-when-in-prefix
   'org-agenda-remove-tags)
@@ -1980,7 +1980,7 @@ org-agenda-category-icon-alist
   (\"Emacs\" \\='(space . (:width (16))))"
   :group 'org-agenda-line-format
   :version "24.1"
-  :type '(alist :key-type (string :tag "Regexp matching category")
+  :type '(alist :key-type (regexp :tag "Regexp matching category")
 		:value-type (choice (list :tag "Icon"
 					  (string :tag "File or data")
 					  (symbol :tag "Type")
diff --git a/lisp/org/org-protocol.el b/lisp/org/org-protocol.el
index 44c6abbd95..5ba2126820 100644
--- a/lisp/org/org-protocol.el
+++ b/lisp/org/org-protocol.el
@@ -278,7 +278,7 @@ org-protocol-data-separator
   :group 'org-protocol
   :version "24.4"
   :package-version '(Org . "8.0")
-  :type 'string)
+  :type 'regexp)
 
 ;;; Helper functions:
 
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index a2e77e0739..daacc988d5 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -198,7 +198,7 @@ org-table-number-regexp
 		 "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*\\|[<>]?[-+]?0[xX][[:xdigit:].]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$")
 	  (const :tag "Very General Number-Like, including hex and Calc radix, allows comma as decimal mark"
 		 "^\\([<>]?[-+^.,0-9]*[0-9][-+^.0-9eEdDx()%]*\\|[<>]?[-+]?0[xX][[:xdigit:].]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$")
-	  (string :tag "Regexp:")))
+	  (regexp :tag "Regexp:")))
 
 (defcustom org-table-number-fraction 0.5
   "Fraction of numbers in a column required to make the column align right.
diff --git a/lisp/org/ox-latex.el b/lisp/org/ox-latex.el
index 65f40fb7a1..72777c019c 100644
--- a/lisp/org/ox-latex.el
+++ b/lisp/org/ox-latex.el
@@ -1239,7 +1239,7 @@ org-latex-known-warnings
   :package-version '(Org . "8.3")
   :type '(repeat
 	  (cons
-	   (string :tag "Regexp")
+	   (regexp :tag "Regexp")
 	   (string :tag "Message"))))
 
 
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el
index 813ecbe384..b5db636895 100644
--- a/lisp/progmodes/bug-reference.el
+++ b/lisp/progmodes/bug-reference.el
@@ -72,7 +72,7 @@ bug-reference-bug-regexp
   "\\([Bb]ug ?#?\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z+-]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)"
   "Regular expression matching bug references.
 The second subexpression should match the bug reference (usually a number)."
-  :type 'string
+  :type 'regexp
   :version "24.3"			; previously defconst
   :group 'bug-reference)
 
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el
index 9fea447e76..adfeb0ba35 100644
--- a/lisp/progmodes/hideif.el
+++ b/lisp/progmodes/hideif.el
@@ -162,7 +162,7 @@ hide-ifdef-header-regexp
   "\\.h\\(h\\|xx\\|pp\\|\\+\\+\\)?\\'"
   "C/C++ header file name patterns to determine if current buffer is a header.
 Effective only if `hide-ifdef-expand-reinclusion-protection' is t."
-  :type 'string
+  :type 'regexp
   :version "25.1")
 
 (defvar hide-ifdef-mode-submap
diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el
index c4cf29c141..f4d4f4b4cd 100644
--- a/lisp/progmodes/idlw-help.el
+++ b/lisp/progmodes/idlw-help.el
@@ -182,14 +182,14 @@ idlwave-help-doclib-name
 which specifies the `name' section.  Can be used for localization
 support."
   :group 'idlwave-online-help
-  :type 'string)
+  :type 'regexp)
 
 (defcustom idlwave-help-doclib-keyword "KEYWORD"
   "A regexp for the heading word to search for in doclib headers
 which specifies the `keywords' section.  Can be used for localization
 support."
   :group 'idlwave-online-help
-  :type 'string)
+  :type 'regexp)
 
 (defface idlwave-help-link
   '((t :inherit link))
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 9c46ac84e2..c2071d21e5 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -314,7 +314,7 @@ idlwave-no-change-comment
 expression will not be changed.  Note that the indentation of a comment
 at the beginning of a line is never changed."
   :group 'idlwave-code-formatting
-  :type 'string)
+  :type 'regexp)
 
 (defcustom idlwave-begin-line-comment nil
   "A comment anchored at the beginning of line.
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 2956bfa041..0482cd78dc 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1993,7 +1993,7 @@ python-shell-prompt-input-regexps
     ;; IPython prompts activated, this adds some safeguard for that.
     "In : " "\\.\\.\\.: ")
   "List of regular expressions matching input prompts."
-  :type '(repeat string)
+  :type '(repeat regexp)
   :version "24.4")
 
 (defcustom python-shell-prompt-output-regexps
@@ -2001,28 +2001,28 @@ python-shell-prompt-output-regexps
     "Out\\[[0-9]+\\]: "                 ; IPython
     "Out :")                            ; ipdb safeguard
   "List of regular expressions matching output prompts."
-  :type '(repeat string)
+  :type '(repeat regexp)
   :version "24.4")
 
 (defcustom python-shell-prompt-regexp ">>> "
   "Regular expression matching top level input prompt of Python shell.
 It should not contain a caret (^) at the beginning."
-  :type 'string)
+  :type 'regexp)
 
 (defcustom python-shell-prompt-block-regexp "\\.\\.\\.:? "
   "Regular expression matching block input prompt of Python shell.
 It should not contain a caret (^) at the beginning."
-  :type 'string)
+  :type 'regexp)
 
 (defcustom python-shell-prompt-output-regexp ""
   "Regular expression matching output prompt of Python shell.
 It should not contain a caret (^) at the beginning."
-  :type 'string)
+  :type 'regexp)
 
 (defcustom python-shell-prompt-pdb-regexp "[(<]*[Ii]?[Pp]db[>)]+ "
   "Regular expression matching pdb input prompt of Python shell.
 It should not contain a caret (^) at the beginning."
-  :type 'string)
+  :type 'regexp)
 
 (define-obsolete-variable-alias
   'python-shell-enable-font-lock 'python-shell-font-lock-enable "25.1")
@@ -2111,7 +2111,7 @@ python-shell-compilation-regexp-alist
           "(" (group (1+ digit)) ")" (1+ (not (any "("))) "()")
      1 2))
   "`compilation-error-regexp-alist' for inferior Python."
-  :type '(alist string)
+  :type '(alist regexp)
   :group 'python)
 
 (defmacro python-shell--add-to-path-with-priority (pathvar paths)
@@ -3785,7 +3785,7 @@ python-pdbtrack-stacktrace-info-regexp
 
 Filename is expected in the first parenthesized expression.
 Line number is expected in the second parenthesized expression."
-  :type 'string
+  :type 'regexp
   :version "27.1"
   :safe 'stringp)
 
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index aa42873a3d..75dc84a952 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -905,7 +905,7 @@ sql-send-terminator
 		 (const  :tag "Default Terminator" t)
 		 (string :tag "Terminator String")
 		 (cons   :tag "Terminator Pattern and String"
-			 (string :tag "Terminator Pattern")
+			 (regexp :tag "Terminator Pattern")
 			 (string :tag "Terminator String")))
   :version "22.2"
   :group 'SQL)
@@ -1033,7 +1033,7 @@ sql-ansi-statement-starters
 identify additional keywords in a variable defined by
 the :statement feature."
   :version "24.1"
-  :type 'string
+  :type 'regexp
   :group 'SQL)
 
 ;; Customization for Oracle
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 961a1571c7..fa443cbbcc 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -641,7 +641,7 @@ speedbar-directory-unshown-regexp
 useful.  It is no longer necessary to include version-control
 directories here; see `vc-directory-exclusion-list'."
   :group 'speedbar
-  :type 'string)
+  :type 'regexp)
 
 (defcustom speedbar-file-unshown-regexp
   (let ((nstr "") (noext completion-ignored-extensions))
@@ -654,7 +654,7 @@ speedbar-file-unshown-regexp
   "Regexp matching files we don't want displayed in a speedbar buffer.
 It is generated from the variable `completion-ignored-extensions'."
   :group 'speedbar
-  :type 'string)
+  :type 'regexp)
 
 (defvar speedbar-file-regexp nil
   "Regular expression matching files we know how to expand.
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index ce788207cf..e8d47d4b76 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -89,7 +89,7 @@ flyspell-mark-duplications-exceptions
 downcased before comparing with these exceptions."
   :group 'flyspell
   :type '(alist :key-type (choice (const :tag "All dictionaries" nil)
-				  string)
+				  regexp)
 		:value-type (repeat string))
   :version "24.1")
 
@@ -234,7 +234,7 @@ flyspell-tex-command-regexp
   "A string that is the regular expression that matches TeX commands."
   :group 'flyspell
   :version "21.1"
-  :type 'string)
+  :type 'regexp)
 
 (defcustom flyspell-check-tex-math-command nil
   "Non-nil means check even inside TeX math environment.
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 3762010985..6b82bdb5f9 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -168,7 +168,7 @@ sentence-end
 (defcustom sentence-end-base "[.?!…‽][]\"'”’)}»›]*"
   "Regexp matching the basic end of a sentence, not including following space."
   :group 'paragraphs
-  :type 'string
+  :type 'regexp
   :version "25.1")
 (put 'sentence-end-base 'safe-local-variable 'stringp)
 
diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el
index ccbc2b086c..55742ba80b 100644
--- a/lisp/textmodes/tildify.el
+++ b/lisp/textmodes/tildify.el
@@ -67,7 +67,7 @@ tildify-pattern
 the value of `case-fold-search' setting."
   :version "25.1"
   :group 'tildify
-  :type 'string
+  :type 'regexp
   :safe t)
 
 (defcustom tildify-pattern-alist ()
@@ -417,7 +417,7 @@ tildify-space-pattern
 current `case-fold-search' setting."
   :version "25.1"
   :group 'tildify
-  :type 'string)
+  :type 'regexp)
 
 (defcustom tildify-space-predicates '(tildify-space-region-predicate)
   "A list of predicate functions for `tildify-space' function."
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index a9cbf40c5e..d30ba1a1cd 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -1282,7 +1282,7 @@ ediff-temp-file-mode
 (defcustom ediff-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]"
   "Regexp that matches characters that must be quoted with `\\' in shell command line.
 This default should work without changes."
-  :type 'string
+  :type 'regexp
   :group 'ediff)
 
 ;; needed to simulate frame-char-width in XEmacs.
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index cdb50db0d0..c39ee64fca 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -166,7 +166,7 @@ vc-git-root-log-format
 \"--pretty=tformat:FORMAT\"), REGEXP is a regular expression
 matching the resulting Git log output, and KEYWORDS is a list of
 `font-lock-keywords' for highlighting the Log View buffer."
-  :type '(list string string (repeat sexp))
+  :type '(list string regexp (repeat sexp))
   :version "24.1")
 
 (defcustom vc-git-commits-coding-system 'utf-8
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index f264ba2c9a..205303761a 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -182,7 +182,7 @@ vc-hg-root-log-format
 REGEXP is a regular expression matching the resulting Mercurial
 output, and KEYWORDS is a list of `font-lock-keywords' for
 highlighting the Log View buffer."
-  :type '(list string string (repeat sexp))
+  :type '(list string regexp (repeat sexp))
   :group 'vc-hg
   :version "24.5")
 
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 243e750246..ed81514629 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -716,8 +716,8 @@ whitespace-indentation-regexp
 
 Used when `whitespace-style' includes `indentation',
 `indentation::tab' or  `indentation::space'."
-  :type '(cons (string :tag "Indentation SPACEs")
-	       (string :tag "Indentation TABs"))
+  :type '(cons (regexp :tag "Indentation SPACEs")
+	       (regexp :tag "Indentation TABs"))
   :group 'whitespace)
 
 
@@ -747,8 +747,8 @@ whitespace-space-after-tab-regexp
 
 Used when `whitespace-style' includes `space-after-tab',
 `space-after-tab::tab' or `space-after-tab::space'."
-  :type '(cons (string :tag "SPACEs After TAB")
-	       string)
+  :type '(cons (regexp :tag "SPACEs After TAB")
+	       regexp)
   :group 'whitespace)
 
 (defcustom whitespace-big-indent-regexp
diff --git a/lisp/woman.el b/lisp/woman.el
index 39d9b806d2..27ccf9d99b 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -674,7 +674,7 @@ woman-manpath-man-regexp
 \"[Mm][Aa][Nn]\", which is case-insensitive mainly for the benefit of
 Microsoft platforms.  Its purpose is to avoid `cat?', `.', `..', etc."
   ;; Based on a suggestion by Wei-Xue Shi.
-  :type 'string
+  :type 'regexp
   :group 'woman-interface)
 
 (defcustom woman-path
@@ -753,7 +753,7 @@ woman-imenu-generic-expression
 An alist with elements of the form (MENU-TITLE REGEXP INDEX) --
 see the documentation for `imenu-generic-expression'."
   :type '(alist :key-type (choice :tag "Title" (const nil) string)
-                :value-type (group (choice (string :tag "Regexp")
+                :value-type (group (choice (regexp :tag "Regexp")
                                            function)
                                    integer))
   :group 'woman-interface)
-- 
2.21.0 (Apple Git-122.2)


[-- Attachment #3: Type: text/plain, Size: 2 bytes --]




  reply	other threads:[~2019-12-21 20:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-21 18:44 [PATCH] Use regexp types in defcustom where appropriate Mattias Engdegård
2019-12-21 19:21 ` Paul Eggert
2019-12-21 20:17   ` Mattias Engdegård [this message]
2019-12-21 19:33 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A464A9AF-5CC4-4FB8-A8A3-D7B191A565F8@acm.org \
    --to=mattiase@acm.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.