[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/progmodes/perl-mode.el
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/progmodes/perl-mode.el |
Date: |
Sun, 20 Mar 2005 13:04:41 -0500 |
Index: emacs/lisp/progmodes/perl-mode.el
diff -c emacs/lisp/progmodes/perl-mode.el:1.54
emacs/lisp/progmodes/perl-mode.el:1.55
*** emacs/lisp/progmodes/perl-mode.el:1.54 Sun Mar 20 17:06:13 2005
--- emacs/lisp/progmodes/perl-mode.el Sun Mar 20 18:04:41 2005
***************
*** 653,672 ****
((looking-at (or nochange perl-nochange)) 0)
(t
(skip-chars-forward " \t\f")
! (cond ((looking-at "\\(\\w\\|\\s_\\)+:[^:]")
! (setq indent (max 1 (+ indent perl-label-offset))))
! ((= (char-syntax (following-char)) ?\))
! (setq indent
! (save-excursion
! (forward-char 1)
! (forward-sexp -1)
! (forward-char 1)
! (if (perl-hanging-paren-p)
! (- indent perl-indent-level)
! (forward-char -1)
! (current-column)))))
! ((= (following-char) ?{)
! (setq indent (+ indent perl-brace-offset))))
(- indent (current-column)))))
(skip-chars-forward " \t\f")
(if (and (numberp shift-amt) (/= 0 shift-amt))
--- 653,659 ----
((looking-at (or nochange perl-nochange)) 0)
(t
(skip-chars-forward " \t\f")
! (setq indent (perl-indent-new-calculate nil indent bof))
(- indent (current-column)))))
(skip-chars-forward " \t\f")
(if (and (numberp shift-amt) (/= 0 shift-amt))
***************
*** 702,714 ****
(save-excursion
(skip-syntax-backward " (") (not (bolp)))))
(defun perl-calculate-indent (&optional parse-start)
"Return appropriate indentation for current line as Perl code.
In usual case returns an integer: the column to indent to.
Returns (parse-state) if line starts inside a string.
Optional argument PARSE-START should be the position of `beginning-of-defun'."
(save-excursion
- (beginning-of-line)
(let ((indent-point (point))
(case-fold-search nil)
(colon-line-end 0)
--- 689,718 ----
(save-excursion
(skip-syntax-backward " (") (not (bolp)))))
+ (defun perl-indent-new-calculate (&optional virtual default parse-start)
+ (or
+ (and virtual (save-excursion (skip-chars-backward " \t") (bolp))
+ (current-column))
+ (and (looking-at "\\(\\w\\|\\s_\\)+:[^:]")
+ (max 1 (+ (or default (perl-calculate-indent parse-start))
+ perl-label-offset)))
+ (and (= (char-syntax (following-char)) ?\))
+ (save-excursion
+ (forward-char 1)
+ (forward-sexp -1)
+ (perl-indent-new-calculate 'virtual nil parse-start)))
+ (and (and (= (following-char) ?{)
+ (save-excursion (forward-char) (perl-hanging-paren-p)))
+ (+ (or default (perl-calculate-indent parse-start))
+ perl-brace-offset))
+ (or default (perl-calculate-indent parse-start))))
+
(defun perl-calculate-indent (&optional parse-start)
"Return appropriate indentation for current line as Perl code.
In usual case returns an integer: the column to indent to.
Returns (parse-state) if line starts inside a string.
Optional argument PARSE-START should be the position of `beginning-of-defun'."
(save-excursion
(let ((indent-point (point))
(case-fold-search nil)
(colon-line-end 0)