aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2012-03-29 23:13:04 -0400
committerStefan Monnier2012-03-29 23:13:04 -0400
commit81fdff0036dd12c4d0ef9ef742def02bdb0dc502 (patch)
tree1ce58b893acc0ccb71d3b853d66c45b1deb121ce /lisp
parent581355cc06ed0800e3e675bfbb2aa00945462f42 (diff)
downloademacs-81fdff0036dd12c4d0ef9ef742def02bdb0dc502.tar.gz
emacs-81fdff0036dd12c4d0ef9ef742def02bdb0dc502.zip
* lisp/progmodes/perl-mode.el (perl-indent-line): Use `noindent' in strings.
(perl-calculate-indent): Return `noindent' in strings.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/perl-mode.el23
2 files changed, 17 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e0aef6b2dd9..1adaa8b5984 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * progmodes/perl-mode.el (perl-indent-line): Use `noindent' in strings.
4 (perl-calculate-indent): Return `noindent' in strings.
5
12012-03-28 Sam Steingold <sds@gnu.org> 62012-03-28 Sam Steingold <sds@gnu.org>
2 7
3 * calendar/calendar.el (calendar-exit): Use `quit-windows-on' 8 * calendar/calendar.el (calendar-exit): Use `quit-windows-on'
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index de728da236d..26c6e5a9f03 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -378,7 +378,7 @@ The expansion is entirely correct because it uses the C preprocessor."
378 ;; we are: we have to go back to the beginning of this 378 ;; we are: we have to go back to the beginning of this
379 ;; "string" and count from there. 379 ;; "string" and count from there.
380 (condition-case nil 380 (condition-case nil
381 (progn 381 (progn
382 ;; Start after the first char since it doesn't have 382 ;; Start after the first char since it doesn't have
383 ;; paren-syntax (an alternative would be to let-bind 383 ;; paren-syntax (an alternative would be to let-bind
384 ;; parse-sexp-lookup-properties). 384 ;; parse-sexp-lookup-properties).
@@ -415,17 +415,17 @@ The expansion is entirely correct because it uses the C preprocessor."
415 ;; s{...}{...}) we're right after the first arg, so we still have to 415 ;; s{...}{...}) we're right after the first arg, so we still have to
416 ;; handle the second part. 416 ;; handle the second part.
417 (when (and twoargs close) 417 (when (and twoargs close)
418 ;; Skip whitespace and make sure that font-lock will 418 ;; Skip whitespace and make sure that font-lock will
419 ;; refontify the second part in the proper context. 419 ;; refontify the second part in the proper context.
420 (put-text-property 420 (put-text-property
421 (point) (progn (forward-comment (point-max)) (point)) 421 (point) (progn (forward-comment (point-max)) (point))
422 'syntax-multiline t) 422 'syntax-multiline t)
423 ;; 423 ;;
424 (when (< (point) limit) 424 (when (< (point) limit)
425 (put-text-property (point) (1+ (point)) 425 (put-text-property (point) (1+ (point))
426 'syntax-table 426 'syntax-table
427 (if (assoc (char-after) 427 (if (assoc (char-after)
428 perl-quote-like-pairs) 428 perl-quote-like-pairs)
429 ;; Put an `e' in the cdr to mark this 429 ;; Put an `e' in the cdr to mark this
430 ;; char as "second arg starter". 430 ;; char as "second arg starter".
431 (string-to-syntax "|e") 431 (string-to-syntax "|e")
@@ -756,6 +756,7 @@ changed by, or (parse-state) if line starts in a quoted string."
756 (setq shift-amt 756 (setq shift-amt
757 (cond ((eq (char-after bof) ?=) 0) 757 (cond ((eq (char-after bof) ?=) 0)
758 ((listp (setq indent (perl-calculate-indent bof))) indent) 758 ((listp (setq indent (perl-calculate-indent bof))) indent)
759 ((eq 'noindent indent) indent)
759 ((looking-at (or nochange perl-nochange)) 0) 760 ((looking-at (or nochange perl-nochange)) 0)
760 (t 761 (t
761 (skip-chars-forward " \t\f") 762 (skip-chars-forward " \t\f")
@@ -849,7 +850,7 @@ Optional argument PARSE-START should be the position of `beginning-of-defun'."
849 ;; following_quotep minimum_paren-depth_this_scan) 850 ;; following_quotep minimum_paren-depth_this_scan)
850 ;; Parsing stops if depth in parentheses becomes equal to third arg. 851 ;; Parsing stops if depth in parentheses becomes equal to third arg.
851 (setq containing-sexp (nth 1 state))) 852 (setq containing-sexp (nth 1 state)))
852 (cond ((nth 3 state) state) ; In a quoted string? 853 (cond ((nth 3 state) 'noindent) ; In a quoted string?
853 ((null containing-sexp) ; Line is at top level. 854 ((null containing-sexp) ; Line is at top level.
854 (skip-chars-forward " \t\f") 855 (skip-chars-forward " \t\f")
855 (if (= (following-char) ?{) 856 (if (= (following-char) ?{)