emacs-diffs
[Top][All Lists]
Advanced

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

master 649a528: Fix indent-region for identifiers with underscores in cp


From: Lars Ingebrigtsen
Subject: master 649a528: Fix indent-region for identifiers with underscores in cperl-mode
Date: Fri, 28 Aug 2020 10:33:24 -0400 (EDT)

branch: master
commit 649a52822f207e1d302f0e089010b84d5e882281
Author: Harald Jörg <haj@posteo.de>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix indent-region for identifiers with underscores in cperl-mode
    
     * 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 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index c47aa2e..44579cf 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -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)



reply via email to

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