]> git.eshelyaron.com Git - emacs.git/commitdiff
More regexp corrections and tweaks
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 Mar 2019 06:08:37 +0000 (23:08 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 Mar 2019 06:11:21 +0000 (23:11 -0700)
Problems reported by Mattias EngdegĂ„rd in:
https://lists.gnu.org/r/emacs-devel/2019-03/msg00247.html
* lisp/align.el (align-rules-list):
* lisp/comint.el (comint-output-filter):
* lisp/language/china-util.el (encode-hz-region):
* lisp/progmodes/cperl-mode.el (cperl-indent-exp):
* lisp/progmodes/idlwave.el (idlwave-is-pointer-dereference):
* lisp/progmodes/scheme.el (dsssl-font-lock-keywords):
* lisp/textmodes/texinfmt.el (texinfo-accent-commands):
* test/src/regex-emacs-tests.el (regex-tests-re-even-escapes):
Fix some regular-expression typos.

lisp/align.el
lisp/comint.el
lisp/language/china-util.el
lisp/progmodes/cperl-mode.el
lisp/progmodes/idlwave.el
lisp/progmodes/scheme.el
lisp/textmodes/texinfmt.el
test/src/regex-emacs-tests.el

index 43918811b9aa70ad4c0de71a86fff505d3c30d80..594d15eee15e4abb9f83f3ecfc4ddb1aff47b88e 100644 (file)
@@ -399,7 +399,7 @@ The possible settings for `align-region-separate' are:
                   (lambda (end reverse)
                     (funcall (if reverse 're-search-backward
                                're-search-forward)
-                             (concat "[^ \t\n\\\\]"
+                             (concat "[^ \t\n\\]"
                                      (regexp-quote comment-start)
                                      "\\(.+\\)$") end t))))
      (modes    . align-open-comment-modes))
index a5fca7ea2a16074cd117167f813c151f9387ed9b..e5012be982be235ec849d67ada43133534837b91 100644 (file)
@@ -2081,7 +2081,7 @@ Make backspaces delete the previous character."
                        (prompt-re (concat "\\`" (regexp-quote prompt))))
                   (while (string-match prompt-re string)
                     (setq string (substring string (match-end 0)))))))
-            (while (string-match (concat "\\(^" comint-prompt-regexp
+            (while (string-match (concat "\\(" comint-prompt-regexp
                                          "\\)\\1+")
                                  string)
               (setq string (replace-match "\\1" nil nil string)))
index 70710bac18a59f8a50dae6ef5483e673607447a2..163856513353279f528c7495648349c96c6c1a44 100644 (file)
@@ -168,7 +168,7 @@ Return the length of resulting text."
              ;; ESC ESC -> ESC
              (delete-char 1)
            (forward-char -1)
-           (if (looking-at iso2022-gb-designation)
+           (if (looking-at "\e\\$A")
                (progn
                  (delete-region (match-beginning 0) (match-end 0))
                  (insert hz-gb-designation)
index a9402e17a920a3a6b20a29ce539e56cc07ed4e90..970c5669c6c1954236fb90917e5bf326e81a300d 100644 (file)
@@ -4924,7 +4924,7 @@ conditional/loop constructs."
                              (if (looking-at "\\(state\\|my\\|local\\|our\\)\\>")
                                  (forward-sexp -1))))
                        (if (looking-at
-                            (concat "\\(\\elsif\\|if\\|unless\\|while\\|until"
+                            (concat "\\(elsif\\|if\\|unless\\|while\\|until"
                                     "\\|for\\(each\\)?\\>\\(\\("
                                     cperl-maybe-white-and-comment-rex
                                     "\\(state\\|my\\|local\\|our\\)\\)?"
index 25bc788ffc4c9cdb9d56d7e6c17d07643ce24dec..5ff22571b907ea66639990f0bf28f2d2b65920ed 100644 (file)
@@ -3690,7 +3690,7 @@ constants - a double quote followed by an octal digit."
    (save-excursion
      (forward-char)
      (re-search-backward (concat "\\(" idlwave-idl-keywords
-                                 "\\|[[(*+-/=,^><]\\)\\s-*\\*") limit t))))
+                                 "\\|[-[(*+/=,^><]\\)\\s-*\\*") limit t))))
 
 
 ;; Statement templates
index 62f521ee94a055fa4225e2c38bf89d895d8722e3..507a4c7085d7a922b0760ade7d7d7190b1025dbc 100644 (file)
@@ -433,7 +433,7 @@ that variable's value is a string."
               ;; (make-regexp '("case" "cond" "else" "if" "lambda"
               ;; "let" "let*" "letrec" "and" "or" "map" "with-mode"))
               "and\\|c\\(ase\\|ond\\)\\|else\\|if\\|"
-              "l\\(ambda\\|et\\(\\|*\\|rec\\)\\)\\|map\\|or\\|with-mode"
+              "l\\(ambda\\|et\\(\\|\\*\\|rec\\)\\)\\|map\\|or\\|with-mode"
               "\\)\\>")
       1)
      ;; DSSSL syntax
index 61c31a511c1f77478d3859c46c288cbf2a57c0ff..4bfecb48b6539c9e555d050fb3a2b07411745b38 100644 (file)
@@ -552,13 +552,7 @@ if large.  You can use `Info-split' to do this manually."
 
 (defvar texinfo-accent-commands
   (concat
-   "@^\\|"
-   "@`\\|"
-   "@'\\|"
-   "@\"\\|"
-   "@,\\|"
-   "@=\\|"
-   "@~\\|"
+   "@[\"',=^`~]\\|"
    "@OE{\\|"
    "@oe{\\|"
    "@AA{\\|"
index 9a403165734bd39c6d573c80ea493de3775bb98f..0ae50c94d4c3fd8ebb2fad524d964c474435d1e1 100644 (file)
@@ -278,7 +278,7 @@ on success"
 
 
 (defconst regex-tests-re-even-escapes
-  "\\(?:^\\|[^\\\\]\\)\\(?:\\\\\\\\\\)*"
+  "\\(?:^\\|[^\\]\\)\\(?:\\\\\\\\\\)*"
   "Regex that matches an even number of \\ characters")
 
 (defconst regex-tests-re-odd-escapes