diff options
| author | Stefan Monnier | 2013-10-08 01:10:10 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-10-08 01:10:10 -0400 |
| commit | 8ffa1a0bfa38444fb0e598f9b51241e206b3d907 (patch) | |
| tree | 1c0035e310c2d9c0b0e0d0e65dfc6cd69818cac7 | |
| parent | f2223371ed7a582d8eb65311322e59da20742f98 (diff) | |
| download | emacs-8ffa1a0bfa38444fb0e598f9b51241e206b3d907.tar.gz emacs-8ffa1a0bfa38444fb0e598f9b51241e206b3d907.zip | |
* lisp/progmodes/perl-mode.el: Use lexical-binding.
Remove redundant :group args.
(perl-nochange): Change default to be closer to other major modes's
standard behavior.
(perl-indent-line): Don't consider text on current line as a
valid beginning of function from which to indent.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/progmodes/perl-mode.el | 46 |
2 files changed, 27 insertions, 26 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fd132cad1a2..6c7d61dff48 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2013-10-08 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2013-10-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * progmodes/perl-mode.el: Use lexical-binding. | ||
| 4 | Remove redundant :group args. | ||
| 5 | (perl-nochange): Change default to be closer to other major modes's | ||
| 6 | standard behavior. | ||
| 7 | (perl-indent-line): Don't consider text on current line as a | ||
| 8 | valid beginning of function from which to indent. | ||
| 9 | |||
| 3 | * emacs-lisp/backquote.el (backquote-process): Catch uses of , and ,@ | 10 | * emacs-lisp/backquote.el (backquote-process): Catch uses of , and ,@ |
| 4 | with more than one argument (bug#15538). | 11 | with more than one argument (bug#15538). |
| 5 | 12 | ||
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 8955c64aa9e..1fc60d18b6b 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; perl-mode.el --- Perl code editing commands for GNU Emacs -*- coding: utf-8 -*- | 1 | ;;; perl-mode.el --- Perl code editing commands for GNU Emacs -*- lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1990, 1994, 2001-2013 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1990, 1994, 2001-2013 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -127,7 +127,7 @@ | |||
| 127 | (modify-syntax-entry ?\n ">" st) | 127 | (modify-syntax-entry ?\n ">" st) |
| 128 | (modify-syntax-entry ?# "<" st) | 128 | (modify-syntax-entry ?# "<" st) |
| 129 | ;; `$' is also a prefix char so I was tempted to say "/ p", | 129 | ;; `$' is also a prefix char so I was tempted to say "/ p", |
| 130 | ;; but the `p' thingy basically overrides the `/' :-( --stef | 130 | ;; but the `p' thingy basically overrides the `/' :-( -- Stef |
| 131 | (modify-syntax-entry ?$ "/" st) | 131 | (modify-syntax-entry ?$ "/" st) |
| 132 | (modify-syntax-entry ?% ". p" st) | 132 | (modify-syntax-entry ?% ". p" st) |
| 133 | (modify-syntax-entry ?@ ". p" st) | 133 | (modify-syntax-entry ?@ ". p" st) |
| @@ -494,8 +494,7 @@ | |||
| 494 | 494 | ||
| 495 | (defcustom perl-indent-level 4 | 495 | (defcustom perl-indent-level 4 |
| 496 | "Indentation of Perl statements with respect to containing block." | 496 | "Indentation of Perl statements with respect to containing block." |
| 497 | :type 'integer | 497 | :type 'integer) |
| 498 | :group 'perl) | ||
| 499 | 498 | ||
| 500 | ;; Is is not unusual to put both things like perl-indent-level and | 499 | ;; Is is not unusual to put both things like perl-indent-level and |
| 501 | ;; cperl-indent-level in the local variable section of a file. If only | 500 | ;; cperl-indent-level in the local variable section of a file. If only |
| @@ -511,45 +510,37 @@ | |||
| 511 | 510 | ||
| 512 | (defcustom perl-continued-statement-offset 4 | 511 | (defcustom perl-continued-statement-offset 4 |
| 513 | "Extra indent for lines not starting new statements." | 512 | "Extra indent for lines not starting new statements." |
| 514 | :type 'integer | 513 | :type 'integer) |
| 515 | :group 'perl) | ||
| 516 | (defcustom perl-continued-brace-offset -4 | 514 | (defcustom perl-continued-brace-offset -4 |
| 517 | "Extra indent for substatements that start with open-braces. | 515 | "Extra indent for substatements that start with open-braces. |
| 518 | This is in addition to `perl-continued-statement-offset'." | 516 | This is in addition to `perl-continued-statement-offset'." |
| 519 | :type 'integer | 517 | :type 'integer) |
| 520 | :group 'perl) | ||
| 521 | (defcustom perl-brace-offset 0 | 518 | (defcustom perl-brace-offset 0 |
| 522 | "Extra indentation for braces, compared with other text in same context." | 519 | "Extra indentation for braces, compared with other text in same context." |
| 523 | :type 'integer | 520 | :type 'integer) |
| 524 | :group 'perl) | ||
| 525 | (defcustom perl-brace-imaginary-offset 0 | 521 | (defcustom perl-brace-imaginary-offset 0 |
| 526 | "Imagined indentation of an open brace that actually follows a statement." | 522 | "Imagined indentation of an open brace that actually follows a statement." |
| 527 | :type 'integer | 523 | :type 'integer) |
| 528 | :group 'perl) | ||
| 529 | (defcustom perl-label-offset -2 | 524 | (defcustom perl-label-offset -2 |
| 530 | "Offset of Perl label lines relative to usual indentation." | 525 | "Offset of Perl label lines relative to usual indentation." |
| 531 | :type 'integer | 526 | :type 'integer) |
| 532 | :group 'perl) | ||
| 533 | (defcustom perl-indent-continued-arguments nil | 527 | (defcustom perl-indent-continued-arguments nil |
| 534 | "If non-nil offset of argument lines relative to usual indentation. | 528 | "If non-nil offset of argument lines relative to usual indentation. |
| 535 | If nil, continued arguments are aligned with the first argument." | 529 | If nil, continued arguments are aligned with the first argument." |
| 536 | :type '(choice integer (const nil)) | 530 | :type '(choice integer (const nil))) |
| 537 | :group 'perl) | ||
| 538 | 531 | ||
| 539 | (defcustom perl-indent-parens-as-block nil | 532 | (defcustom perl-indent-parens-as-block nil |
| 540 | "Non-nil means that non-block ()-, {}- and []-groups are indented as blocks. | 533 | "Non-nil means that non-block ()-, {}- and []-groups are indented as blocks. |
| 541 | The closing bracket is aligned with the line of the opening bracket, | 534 | The closing bracket is aligned with the line of the opening bracket, |
| 542 | not the contents of the brackets." | 535 | not the contents of the brackets." |
| 543 | :version "24.3" | 536 | :version "24.3" |
| 544 | :type 'boolean | 537 | :type 'boolean) |
| 545 | :group 'perl) | ||
| 546 | 538 | ||
| 547 | (defcustom perl-tab-always-indent tab-always-indent | 539 | (defcustom perl-tab-always-indent tab-always-indent |
| 548 | "Non-nil means TAB in Perl mode always indents the current line. | 540 | "Non-nil means TAB in Perl mode always indents the current line. |
| 549 | Otherwise it inserts a tab character if you type it past the first | 541 | Otherwise it inserts a tab character if you type it past the first |
| 550 | nonwhite character on the line." | 542 | nonwhite character on the line." |
| 551 | :type 'boolean | 543 | :type 'boolean) |
| 552 | :group 'perl) | ||
| 553 | 544 | ||
| 554 | ;; I changed the default to nil for consistency with general Emacs | 545 | ;; I changed the default to nil for consistency with general Emacs |
| 555 | ;; conventions -- rms. | 546 | ;; conventions -- rms. |
| @@ -558,13 +549,12 @@ nonwhite character on the line." | |||
| 558 | For lines which don't need indenting, TAB either indents an | 549 | For lines which don't need indenting, TAB either indents an |
| 559 | existing comment, moves to end-of-line, or if at end-of-line already, | 550 | existing comment, moves to end-of-line, or if at end-of-line already, |
| 560 | create a new comment." | 551 | create a new comment." |
| 561 | :type 'boolean | 552 | :type 'boolean) |
| 562 | :group 'perl) | ||
| 563 | 553 | ||
| 564 | (defcustom perl-nochange ";?#\\|\f\\|\\s(\\|\\(\\w\\|\\s_\\)+:[^:]" | 554 | (defcustom perl-nochange "\f" |
| 565 | "Lines starting with this regular expression are not auto-indented." | 555 | "Lines starting with this regular expression are not auto-indented." |
| 566 | :type 'regexp | 556 | :type 'regexp |
| 567 | :group 'perl) | 557 | :options '(";?#\\|\f\\|\\s(\\|\\(\\w\\|\\s_\\)+:[^:]")) |
| 568 | 558 | ||
| 569 | ;; Outline support | 559 | ;; Outline support |
| 570 | 560 | ||
| @@ -685,7 +675,7 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'." | |||
| 685 | 675 | ||
| 686 | (define-obsolete-function-alias 'electric-perl-terminator | 676 | (define-obsolete-function-alias 'electric-perl-terminator |
| 687 | 'perl-electric-terminator "22.1") | 677 | 'perl-electric-terminator "22.1") |
| 688 | (defun perl-electric-noindent-p (char) | 678 | (defun perl-electric-noindent-p (_char) |
| 689 | (unless (eolp) 'no-indent)) | 679 | (unless (eolp) 'no-indent)) |
| 690 | 680 | ||
| 691 | (defun perl-electric-terminator (arg) | 681 | (defun perl-electric-terminator (arg) |
| @@ -803,7 +793,11 @@ Return the amount the indentation | |||
| 803 | changed by, or (parse-state) if line starts in a quoted string." | 793 | changed by, or (parse-state) if line starts in a quoted string." |
| 804 | (let ((case-fold-search nil) | 794 | (let ((case-fold-search nil) |
| 805 | (pos (- (point-max) (point))) | 795 | (pos (- (point-max) (point))) |
| 806 | (bof (or parse-start (save-excursion (perl-beginning-of-function)))) | 796 | (bof (or parse-start (save-excursion |
| 797 | ;; Don't consider text on this line as a | ||
| 798 | ;; valid BOF from which to indent. | ||
| 799 | (goto-char (line-end-position 0)) | ||
| 800 | (perl-beginning-of-function)))) | ||
| 807 | beg indent shift-amt) | 801 | beg indent shift-amt) |
| 808 | (beginning-of-line) | 802 | (beginning-of-line) |
| 809 | (setq beg (point)) | 803 | (setq beg (point)) |