* hl-line.el (hl-line): New face.
[bpt/emacs.git] / lisp / progmodes / perl-mode.el
index b0e31ba..950e0cb 100644 (file)
@@ -721,7 +721,10 @@ changed by, or (parse-state) if line starts in a quoted string."
        (save-excursion
          (forward-char 1)
          (forward-sexp -1)
-         (perl-indent-new-calculate 'virtual nil parse-start)))
+         (perl-indent-new-calculate
+           ;; Recalculate the parsing-start, since we may have jumped
+           ;; dangerously close (typically in the case of nested functions).
+           'virtual nil (save-excursion (perl-beginning-of-function)))))
    (and (and (= (following-char) ?{)
             (save-excursion (forward-char) (perl-hanging-paren-p)))
        (+ (or default (perl-calculate-indent parse-start))
@@ -920,8 +923,9 @@ Returns new value of point in all cases."
   (or arg (setq arg 1))
   (if (< arg 0) (forward-char 1))
   (and (/= arg 0)
-       (re-search-backward "^\\s(\\|^\\s-*sub\\b[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\."
-                          nil 'move arg)
+       (re-search-backward
+        "^\\s(\\|^\\s-*sub\\b[ \t\n]*\\_<[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\."
+        nil 'move arg)
        (goto-char (1- (match-end 0))))
   (point))