]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix indent-region for identifiers with underscores in cperl-mode
authorHarald Jörg <haj@posteo.de>
Fri, 28 Aug 2020 14:33:13 +0000 (16:33 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 28 Aug 2020 14:33:13 +0000 (16:33 +0200)
 * lisp/progmodes/cperl-mode.el (cperl-fix-line-spacing): Fix Bug#18985.
 Hash keys or function names starting with a Perl keyword followed
 by an underscore (as in "for_me" are no longer split into two words
 by M-x indent-region.

lisp/progmodes/cperl-mode.el

index c47aa2ea8c278f5d91aa4621c6e881e96d51bf94..44579cfd386bafdae84d3897bd301843e602ac64 100644 (file)
@@ -4876,7 +4876,7 @@ Returns some position at the last line."
       ;;  }? continue
       ;;  blah; }
       (if (not
-          (or (looking-at "[ \t]*\\(els\\(e\\|if\\)\\|continue\\|if\\|while\\|for\\(each\\)?\\|until\\)")
+          (or (looking-at "[ \t]*\\(els\\(e\\|if\\)\\|continue\\|if\\|while\\|for\\(each\\)?\\|unless\\|until\\)\\_>")
               (setq have-brace (save-excursion (search-forward "}" ee t)))))
          nil                           ; Do not need to do anything
        ;; Looking at:
@@ -4884,7 +4884,7 @@ Returns some position at the last line."
        ;; else
        (if cperl-merge-trailing-else
            (if (looking-at
-                "[ \t]*}[ \t]*\n[ \t\n]*\\(els\\(e\\|if\\)\\|continue\\)\\>")
+                "[ \t]*}[ \t]*\n[ \t\n]*\\(els\\(e\\|if\\)\\|continue\\)\\_>")
                (progn
                  (search-forward "}")
                  (setq p (point))
@@ -4892,7 +4892,7 @@ Returns some position at the last line."
                  (delete-region p (point))
              (insert (make-string cperl-indent-region-fix-constructs ?\s))
                  (beginning-of-line)))
-         (if (looking-at "[ \t]*}[ \t]*\\(els\\(e\\|if\\)\\|continue\\)\\>")
+         (if (looking-at "[ \t]*}[ \t]*\\(els\\(e\\|if\\)\\|continue\\)\\_>")
              (save-excursion
                  (search-forward "}")
                  (delete-horizontal-space)
@@ -4904,7 +4904,7 @@ Returns some position at the last line."
                        (setq ret (point)))))))
        ;; Looking at:
        ;; }     else
-       (if (looking-at "[ \t]*}\\(\t*\\|[ \t][ \t]+\\)\\<\\(els\\(e\\|if\\)\\|continue\\)\\>")
+       (if (looking-at "[ \t]*}\\(\t*\\|[ \t][ \t]+\\)\\<\\(els\\(e\\|if\\)\\|continue\\)\\_>")
            (progn
              (search-forward "}")
              (delete-horizontal-space)