bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11118: Patch


From: Stefan Monnier
Subject: bug#11118: Patch
Date: Thu, 29 Mar 2012 23:34:50 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

tags 11118 pending
thanks

The patch looks very good.  We can't install it just now because we're
in feature freeze, so we'll keep it for when the trunk opens again for
new features.
Thank you,


        Stefan


>>>>> "Peter" == Peter Oliver <address@hidden> writes:

> === modified file 'etc/NEWS'
> --- etc/NEWS  2012-03-27 20:24:48 +0000
> +++ etc/NEWS  2012-03-28 21:12:42 +0000
> @@ -784,6 +784,11 @@
>  If `nxml-bind-meta-tab-to-complete-flag' is non-nil (the default),
>  this performs tag completion.
 
> +** Perl mode
> +
> +*** There is a new option, perl-indent-parens-as-block, which causes
> +non-block closing brackets to be aligned with the line of the opening 
> bracket.
> +
>  ---
>  ** Prolog mode has been completely revamped, with lots of additional
>  functionality such as more intelligent indentation, electricity, support for

> === modified file 'lisp/ChangeLog'
> --- lisp/ChangeLog    2012-03-29 14:00:00 +0000
> +++ lisp/ChangeLog    2012-03-29 18:46:19 +0000
> @@ -1,3 +1,9 @@
> +2012-03-28  Peter Oliver  <address@hidden>
> +
> +     * progmodes/perl-mode.el (perl-indent-parens-as-block): New option
> +     to align non-block closing brackets with the opening line
> +     (bug#11118).
> +
>  2012-03-28  Sam Steingold  <address@hidden>
 
>       * calendar/calendar.el (calendar-exit): Use `quit-windows-on'

> === modified file 'lisp/progmodes/perl-mode.el'
> --- lisp/progmodes/perl-mode.el       2012-03-15 03:09:26 +0000
> +++ lisp/progmodes/perl-mode.el       2012-03-28 20:28:08 +0000
> @@ -510,6 +510,12 @@
>  If nil, continued arguments are aligned with the first argument."
>    :type '(choice integer (const nil))
>    :group 'perl)
> +(defcustom perl-indent-parens-as-block nil
> +  "*Non-nil means that non-block ()-, {}- and []-groups are indented as 
> blocks.
> +The closing bracket is aligned with the line of the opening
> +bracket, not the contents of the brackets."
> +  :type 'boolean
> +  :group 'perl)
 
>  (defcustom perl-tab-always-indent tab-always-indent
>    "Non-nil means TAB in Perl mode always indents the current line.
> @@ -852,7 +858,8 @@
>        (cond ((nth 3 state) state)    ; In a quoted string?
>           ((null containing-sexp)     ; Line is at top level.
>            (skip-chars-forward " \t\f")
> -          (if (= (following-char) ?{)
> +          (if (memq (following-char)
> +                    (if perl-indent-parens-as-block '(?\{ ?\( ?\[) '(?\{)))
>                0  ; move to beginning of line if it starts a function body
>              ;; indent a little if this is a continuation line
>              (perl-backward-to-noncomment)
> @@ -896,7 +903,9 @@
>                         0 perl-continued-statement-offset)
>                     (current-column)
>                     (if (save-excursion (goto-char indent-point)
> -                                       (looking-at "[ \t]*{"))
> +                                       (looking-at 
> +                                        (if perl-indent-parens-as-block
> +                                            "[ \t]*[{(\[]" "[ \t]*{")))
>                         perl-continued-brace-offset 0)))
>              ;; This line starts a new statement.
>              ;; Position at last unclosed open.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]