diff options
| author | Konstantin Kharlamov | 2019-06-13 03:18:43 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-07-06 10:54:25 +0300 |
| commit | dfc322d77fd1ce3aa4d852e0ff07bb36944f6432 (patch) | |
| tree | 8c17686c0e2ae4beaab2f4568cd3654f0fb756cc /lisp/nxml | |
| parent | 814b509b1ddf7863d18f7f443e8d733173904e81 (diff) | |
| download | emacs-dfc322d77fd1ce3aa4d852e0ff07bb36944f6432.tar.gz emacs-dfc322d77fd1ce3aa4d852e0ff07bb36944f6432.zip | |
Replace manually crafted hex regexes with [:xdigit:]
* admin/charsets/mapconv:
* build-aux/gitlog-to-changelog (parse_amend_file, git_dir_option):
* lisp/progmodes/verilog-mode.el (verilog-delay-re):
(verilog-type-font-keywords, verilog-read-always-signals-recurse):
(verilog-is-number):
* lisp/progmodes/vera-mode.el (vera-font-lock-keywords):
* test/src/emacs-module-tests.el (mod-test-sum-test):
* lisp/xml.el: (xml--entity-replacement-text):
* lisp/version.el (emacs-repository-version-git):
* lisp/textmodes/sgml-mode.el (sgml-quote):
* lisp/textmodes/css-mode.el (css-escapes-re)
(css--colors-regexp):
* lisp/progmodes/prolog.el (prolog-syntax-propertize-function):
* lisp/progmodes/hideif.el (hif-token-regexp, hif-tokenize):
* lisp/progmodes/ebnf-dtd.el: (ebnf-dtd-attlistdecl)
(ebnf-dtd-entitydecl, ebnf-dtd-lex):
* lisp/progmodes/ebnf-ebx.el (ebnf-ebx-hex-character):
* lisp/progmodes/ebnf-abn.el (ebnf-abn-character):
* lisp/progmodes/cperl-mode.el (cperl-highlight-charclass)
(cperl-find-pods-heres):
* lisp/progmodes/cc-mode.el (c-maybe-quoted-number-head)
(c-maybe-quoted-number, c-parse-quotes-before-change)
(c-parse-quotes-after-change, c-quoted-number-head-before-point)
(c-quoted-number-straddling-point):
* lisp/progmodes/ada-mode.el (featurep, ada-in-numeric-literal-p)
(ada-font-lock-keywords):
* lisp/org/org-mobile.el (org-mobile-copy-agenda-files)
* lisp/org/org-table.el (org-table-number-regexp):
(org-mobile-update-checksum-for-capture-file):
* lisp/nxml/xsd-regexp.el (xsdre-gen-categories):
* lisp/nxml/xmltok.el (let*):
* lisp/nxml/rng-xsd.el (rng-xsd-convert-hex-binary)
(rng-xsd-convert-any-uri):
* lisp/nxml/rng-uri.el (rng-uri-file-name-1)
(rng-uri-unescape-multibyte, rng-uri-unescape-unibyte)
(rng-uri-unescape-unibyte-match)
(rng-uri-unescape-unibyte-replace):
* lisp/nxml/rng-cmpct.el (rng-c-process-escapes):
* lisp/nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* lisp/net/shr-color.el (shr-color->hexadecimal):
* lisp/mail/rfc2231.el (rfc2231-decode-encoded-string):
* lisp/international/mule-cmds.el (read-char-by-name):
* lisp/htmlfontify.el (hfy-hex-regex):
* lisp/gnus/nneething.el (nneething-decode-file-name):
* lisp/gnus/mml-sec.el (mml-secure-find-usable-keys):
* lisp/gnus/gnus-art.el (gnus-button-mid-or-mail-heuristic-alist):
* lisp/faces.el (read-color):
* lisp/epg.el (epg--status-ERRSIG, epg--status-VALIDSIG)
(epg--status-SIG_CREATED, epg--decode-percent-escape)
(epg--decode-hexstring, epg--decode-quotedstring)
(epg-dn-from-string):
* lisp/emulation/cua-rect.el (cua-incr-rectangle):
* lisp/dnd.el (dnd-unescape-uri):
* lisp/cedet/semantic/lex.el (semantic-lex-number-expression):
* lisp/cedet/semantic/java.el (semantic-java-number-regexp):
* lisp/calc/calc-lang.el (pascal):
* lisp/calc/calc-ext.el (math-read-number-fancy):
* lisp/calc/calc-aent.el (math-read-token):
Replace various combinations of [0-9a-fA-F] with [[:xdigit:]].
(Bug#36167)
Diffstat (limited to 'lisp/nxml')
| -rw-r--r-- | lisp/nxml/nxml-maint.el | 4 | ||||
| -rw-r--r-- | lisp/nxml/rng-cmpct.el | 2 | ||||
| -rw-r--r-- | lisp/nxml/rng-uri.el | 10 | ||||
| -rw-r--r-- | lisp/nxml/rng-xsd.el | 4 | ||||
| -rw-r--r-- | lisp/nxml/xmltok.el | 2 | ||||
| -rw-r--r-- | lisp/nxml/xsd-regexp.el | 2 |
6 files changed, 12 insertions, 12 deletions
diff --git a/lisp/nxml/nxml-maint.el b/lisp/nxml/nxml-maint.el index 2956efb736e..c524567a5b2 100644 --- a/lisp/nxml/nxml-maint.el +++ b/lisp/nxml/nxml-maint.el | |||
| @@ -34,10 +34,10 @@ | |||
| 34 | (let (lst head) | 34 | (let (lst head) |
| 35 | (with-current-buffer (find-file-noselect file) | 35 | (with-current-buffer (find-file-noselect file) |
| 36 | (goto-char (point-min)) | 36 | (goto-char (point-min)) |
| 37 | (while (re-search-forward "^ *\\([a-fA-F0-9]\\{2\\}\\)[ \t]+" nil t) | 37 | (while (re-search-forward "^ *\\([[:xdigit:]]\\{2\\}\\)[ \t]+" nil t) |
| 38 | (let ((row (match-string 1)) | 38 | (let ((row (match-string 1)) |
| 39 | (eol (line-end-position))) | 39 | (eol (line-end-position))) |
| 40 | (while (re-search-forward "\\([a-fA-F0-9]\\{2\\}\\)-\\([a-fA-F0-9]\\{2\\}\\)\\|\\([a-fA-F0-9]\\{2\\}\\)" eol t) | 40 | (while (re-search-forward "\\([[:xdigit:]]\\{2\\}\\)-\\([[:xdigit:]]\\{2\\}\\)\\|\\([[:xdigit:]]\\{2\\}\\)" eol t) |
| 41 | (setq lst | 41 | (setq lst |
| 42 | (cons (if (match-beginning 3) | 42 | (cons (if (match-beginning 3) |
| 43 | (concat "#x" row (match-string 3)) | 43 | (concat "#x" row (match-string 3)) |
diff --git a/lisp/nxml/rng-cmpct.el b/lisp/nxml/rng-cmpct.el index d36f9d92f26..60c871990e1 100644 --- a/lisp/nxml/rng-cmpct.el +++ b/lisp/nxml/rng-cmpct.el | |||
| @@ -369,7 +369,7 @@ OVERRIDE is either nil, require or t." | |||
| 369 | (and pos | 369 | (and pos |
| 370 | (rng-c-error "Nul character found (binary file?)"))) | 370 | (rng-c-error "Nul character found (binary file?)"))) |
| 371 | (let ((offset 0)) | 371 | (let ((offset 0)) |
| 372 | (while (re-search-forward "\\\\x+{\\([0-9a-fA-F]+\\)}" | 372 | (while (re-search-forward "\\\\x+{\\([[:xdigit:]]+\\)}" |
| 373 | (point-max) | 373 | (point-max) |
| 374 | t) | 374 | t) |
| 375 | (let* ((ch (decode-char 'ucs (string-to-number (match-string 1) 16)))) | 375 | (let* ((ch (decode-char 'ucs (string-to-number (match-string 1) 16)))) |
diff --git a/lisp/nxml/rng-uri.el b/lisp/nxml/rng-uri.el index 798475bbc3d..5a67cc7f145 100644 --- a/lisp/nxml/rng-uri.el +++ b/lisp/nxml/rng-uri.el | |||
| @@ -68,7 +68,7 @@ Signal an error if URI is not a valid file URL." | |||
| 68 | 68 | ||
| 69 | ;; pattern is either nil or match or replace | 69 | ;; pattern is either nil or match or replace |
| 70 | (defun rng-uri-file-name-1 (uri pattern) | 70 | (defun rng-uri-file-name-1 (uri pattern) |
| 71 | (unless (string-match "\\`\\(?:[^%]\\|%[0-9a-fA-F]{2}\\)*\\'" uri) | 71 | (unless (string-match "\\`\\(?:[^%]\\|%[[:xdigit:]]{2}\\)*\\'" uri) |
| 72 | (rng-uri-error "Bad escapes in URI `%s'" uri)) | 72 | (rng-uri-error "Bad escapes in URI `%s'" uri)) |
| 73 | (setq uri (rng-uri-unescape-multibyte uri)) | 73 | (setq uri (rng-uri-unescape-multibyte uri)) |
| 74 | (let* ((components | 74 | (let* ((components |
| @@ -299,7 +299,7 @@ Both FULL and BASE must be absolute URIs." | |||
| 299 | (mapconcat 'identity segments "/"))) | 299 | (mapconcat 'identity segments "/"))) |
| 300 | 300 | ||
| 301 | (defun rng-uri-unescape-multibyte (str) | 301 | (defun rng-uri-unescape-multibyte (str) |
| 302 | (replace-regexp-in-string "\\(?:%[89a-fA-F][0-9a-fA-F]\\)+" | 302 | (replace-regexp-in-string "\\(?:%[89a-fA-F][[:xdigit:]]\\)+" |
| 303 | 'rng-multibyte-percent-decode | 303 | 'rng-multibyte-percent-decode |
| 304 | str)) | 304 | str)) |
| 305 | 305 | ||
| @@ -310,7 +310,7 @@ Both FULL and BASE must be absolute URIs." | |||
| 310 | 'utf-8)) | 310 | 'utf-8)) |
| 311 | 311 | ||
| 312 | (defun rng-uri-unescape-unibyte (str) | 312 | (defun rng-uri-unescape-unibyte (str) |
| 313 | (replace-regexp-in-string "%[0-7][0-9a-fA-F]" | 313 | (replace-regexp-in-string "%[0-7][[:xdigit:]]" |
| 314 | (lambda (h) | 314 | (lambda (h) |
| 315 | (string-to-number (substring h 1) 16)) | 315 | (string-to-number (substring h 1) 16)) |
| 316 | str | 316 | str |
| @@ -318,7 +318,7 @@ Both FULL and BASE must be absolute URIs." | |||
| 318 | t)) | 318 | t)) |
| 319 | 319 | ||
| 320 | (defun rng-uri-unescape-unibyte-match (str) | 320 | (defun rng-uri-unescape-unibyte-match (str) |
| 321 | (replace-regexp-in-string "%[0-7][0-9a-fA-F]\\|[^%]" | 321 | (replace-regexp-in-string "%[0-7][[:xdigit:]]\\|[^%]" |
| 322 | (lambda (match) | 322 | (lambda (match) |
| 323 | (if (string= match "*") | 323 | (if (string= match "*") |
| 324 | "\\([^/]*\\)" | 324 | "\\([^/]*\\)" |
| @@ -333,7 +333,7 @@ Both FULL and BASE must be absolute URIs." | |||
| 333 | 333 | ||
| 334 | (defun rng-uri-unescape-unibyte-replace (str next-match-index) | 334 | (defun rng-uri-unescape-unibyte-replace (str next-match-index) |
| 335 | (replace-regexp-in-string | 335 | (replace-regexp-in-string |
| 336 | "%[0-7][0-9a-fA-F]\\|[^%]" | 336 | "%[0-7][[:xdigit:]]\\|[^%]" |
| 337 | (lambda (match) | 337 | (lambda (match) |
| 338 | (if (string= match "*") | 338 | (if (string= match "*") |
| 339 | (let ((n next-match-index)) | 339 | (let ((n next-match-index)) |
diff --git a/lisp/nxml/rng-xsd.el b/lisp/nxml/rng-xsd.el index f308b049f3b..582d08e149f 100644 --- a/lisp/nxml/rng-xsd.el +++ b/lisp/nxml/rng-xsd.el | |||
| @@ -330,7 +330,7 @@ trailing digits. For example, -0021.0430 would be represented by [-1 | |||
| 330 | (match-string 1 string))) | 330 | (match-string 1 string))) |
| 331 | 331 | ||
| 332 | (defun rng-xsd-convert-hex-binary (string) | 332 | (defun rng-xsd-convert-hex-binary (string) |
| 333 | (and (string-match "\\`[ \r\n\t]*\\(\\(?:[0-9A-Fa-f][0-9A-Fa-f]\\)*\\)[ \r\n\t]*\\'" | 333 | (and (string-match "\\`[ \r\n\t]*\\(\\(?:[[:xdigit:]][[:xdigit:]]\\)*\\)[ \r\n\t]*\\'" |
| 334 | string) | 334 | string) |
| 335 | (downcase (match-string 1 string)))) | 335 | (downcase (match-string 1 string)))) |
| 336 | 336 | ||
| @@ -360,7 +360,7 @@ trailing digits. For example, -0021.0430 would be represented by [-1 | |||
| 360 | n))) | 360 | n))) |
| 361 | 361 | ||
| 362 | (defun rng-xsd-convert-any-uri (string) | 362 | (defun rng-xsd-convert-any-uri (string) |
| 363 | (and (string-match "\\`\\(?:[^%]\\|%[0-9a-fA-F][0-9a-fA-F]\\)*\\'" string) | 363 | (and (string-match "\\`\\(?:[^%]\\|%[[:xdigit:]][[:xdigit:]]\\)*\\'" string) |
| 364 | (string-match "\\`[^#]*\\(?:#[^#]*\\)?\\'" string) | 364 | (string-match "\\`[^#]*\\(?:#[^#]*\\)?\\'" string) |
| 365 | (string-match "\\`\\(?:[a-zA-Z][-+.A-Za-z0-9]*:.+\\|[^:]*\\(?:[#/?].*\\)?\\)\\'" string) | 365 | (string-match "\\`\\(?:[a-zA-Z][-+.A-Za-z0-9]*:.+\\|[^:]*\\(?:[#/?].*\\)?\\)\\'" string) |
| 366 | string)) | 366 | string)) |
diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el index afa33e064f3..3cab5ed9b7b 100644 --- a/lisp/nxml/xmltok.el +++ b/lisp/nxml/xmltok.el | |||
| @@ -413,7 +413,7 @@ and VALUE-END, otherwise a STRING giving the value." | |||
| 413 | (xmltok-g decimal-ref-close ";") opt)) | 413 | (xmltok-g decimal-ref-close ";") opt)) |
| 414 | (hex-ref | 414 | (hex-ref |
| 415 | (xmltok+ "x" open | 415 | (xmltok+ "x" open |
| 416 | (xmltok-g hex "[0-9a-fA-F]" +) | 416 | (xmltok-g hex "[[:xdigit:]]" +) |
| 417 | (xmltok-g hex-ref-close ";") opt | 417 | (xmltok-g hex-ref-close ";") opt |
| 418 | close opt)) | 418 | close opt)) |
| 419 | (char-ref | 419 | (char-ref |
diff --git a/lisp/nxml/xsd-regexp.el b/lisp/nxml/xsd-regexp.el index 7ae169c19c6..c002e6fd9fb 100644 --- a/lisp/nxml/xsd-regexp.el +++ b/lisp/nxml/xsd-regexp.el | |||
| @@ -702,7 +702,7 @@ Code is inserted into the current buffer." | |||
| 702 | (with-current-buffer (find-file-noselect file) | 702 | (with-current-buffer (find-file-noselect file) |
| 703 | (goto-char (point-min)) | 703 | (goto-char (point-min)) |
| 704 | (mapc (lambda (x) (put x 'xsdre-ranges nil)) xsdre-gen-categories) | 704 | (mapc (lambda (x) (put x 'xsdre-ranges nil)) xsdre-gen-categories) |
| 705 | (while (re-search-forward "^\\([0-9A-Fa-f]*\\);[^;]*;\\([A-Z][a-z]\\);" | 705 | (while (re-search-forward "^\\([[:xdigit:]]*\\);[^;]*;\\([A-Z][a-z]\\);" |
| 706 | nil | 706 | nil |
| 707 | t) | 707 | t) |
| 708 | (let* ((sym (intern (match-string-no-properties 2))) | 708 | (let* ((sym (intern (match-string-no-properties 2))) |