Skip to content

Commit

Permalink
Support try/catch/finally indenting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Piers Cawley committed Jun 19, 2013
1 parent 9c88c9e commit 2a202e1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cperl-mode.el
Expand Up @@ -4832,7 +4832,7 @@ statement would start; thus the block in ${func()} does not count."
(save-excursion (save-excursion
(forward-sexp -1) (forward-sexp -1)
;; else {} but not else::func {} ;; else {} but not else::func {}
(or (and (looking-at "\\(else\\|continue\\|grep\\|map\\|BEGIN\\|END\\|UNITCHECK\\|CHECK\\|INIT\\)\\>") (or (and (looking-at "\\(else\\|catch\\|try\\|continue\\|grep\\|map\\|BEGIN\\|END\\|UNITCHECK\\|CHECK\\|INIT\\)\\>")
(not (looking-at "\\(\\sw\\|_\\)+::"))) (not (looking-at "\\(\\sw\\|_\\)+::")))
;; sub f {} ;; sub f {}
(progn (progn
Expand Down Expand Up @@ -5677,6 +5677,7 @@ indentation and initial hashes. Behaves usually outside of comment."
'("if" "until" "while" "elsif" "else" '("if" "until" "while" "elsif" "else"
"given" "when" "default" "break" "given" "when" "default" "break"
"unless" "for" "unless" "for"
"try" "catch" "finally"
"foreach" "continue" "exit" "die" "last" "goto" "next" "foreach" "continue" "exit" "die" "last" "goto" "next"
"redo" "return" "local" "exec" "redo" "return" "local" "exec"
"do" "dump" "do" "dump"
Expand Down Expand Up @@ -5770,13 +5771,13 @@ indentation and initial hashes. Behaves usually outside of comment."
;; "sort" "splice" "split" "state" "study" "sub" "tie" "tr" ;; "sort" "splice" "split" "state" "study" "sub" "tie" "tr"
;; "undef" "unless" "unshift" "untie" "until" "use" ;; "undef" "unless" "unshift" "untie" "until" "use"
;; "when" "while" "y" ;; "when" "while" "y"
"AUTOLOAD\\|BEGIN\\|\\(UNIT\\)?CHECK\\|break\\|cho\\(p\\|mp\\)\\|d\\(e\\(f\\(ault|ined\\)\\|lete\\)\\|" "AUTOLOAD\\|BEGIN\\|\\(UNIT\\)?CHECK\\|break\\|c\\(atch\\|ho\\(p\\|mp\\)\\)\\|d\\(e\\(f\\(inally\\|ault\\|ined\\)\\|lete\\)\\|"
"o\\)\\|DESTROY\\|e\\(ach\\|val\\|xists\\|ls\\(e\\|if\\)\\)\\|" "o\\)\\|DESTROY\\|e\\(ach\\|val\\|xists\\|ls\\(e\\|if\\)\\)\\|"
"END\\|for\\(\\|each\\|mat\\)\\|g\\(iven\\|rep\\|oto\\)\\|INIT\\|if\\|keys\\|" "END\\|for\\(\\|each\\|mat\\)\\|g\\(iven\\|rep\\|oto\\)\\|INIT\\|if\\|keys\\|"
"l\\(ast\\|ocal\\)\\|m\\(ap\\|y\\)\\|n\\(ext\\|o\\)\\|our\\|" "l\\(ast\\|ocal\\)\\|m\\(ap\\|y\\)\\|n\\(ext\\|o\\)\\|our\\|"
"p\\(ackage\\|rint\\(\\|f\\)\\|ush\\|o\\(p\\|s\\)\\)\\|" "p\\(ackage\\|rint\\(\\|f\\)\\|ush\\|o\\(p\\|s\\)\\)\\|"
"q\\(\\|q\\|w\\|x\\|r\\)\\|re\\(turn\\|do\\)\\|s\\(ay\\|pli\\(ce\\|t\\)\\|" "q\\(\\|q\\|w\\|x\\|r\\)\\|re\\(turn\\|do\\)\\|s\\(ay\\|pli\\(ce\\|t\\)\\|"
"calar\\|t\\(ate\\|udy\\)\\|ub\\|hift\\|ort\\)\\|t\\(r\\|ie\\)\\|" "calar\\|t\\(ate\\|udy\\)\\|ub\\|hift\\|ort\\)\\|t\\(ry?\\|ie\\)\\|"
"u\\(se\\|n\\(shift\\|ti\\(l\\|e\\)\\|def\\|less\\)\\)\\|" "u\\(se\\|n\\(shift\\|ti\\(l\\|e\\)\\|def\\|less\\)\\)\\|"
"wh\\(en\\|ile\\)\\|y\\|__\\(END\\|DATA\\)__" ;__DATA__ added manually "wh\\(en\\|ile\\)\\|y\\|__\\(END\\|DATA\\)__" ;__DATA__ added manually
"\\|[sm]" ; Added manually "\\|[sm]" ; Added manually
Expand Down

0 comments on commit 2a202e1

Please sign in to comment.