[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C-u prefix behavior of TAB broken
From: |
martin rudalics |
Subject: |
Re: C-u prefix behavior of TAB broken |
Date: |
Sat, 22 Dec 2007 10:28:47 +0100 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
>> This said, IMNSHO the feature we're talking about shouldn't be implement
>> in lisp-mode and c-mode but directly generically in
>> indent-for-tab-command.
>>
>>If that works, by all means do it.
FWIW all indent-line-functions with the exception of `lisp-indent-line'
either don't have arguments or, like `c-indent-line', `f90-indent-line',
and `(c)perl-indent-line' expect completely different arguments here.
Hence a generic solution seems hardly practicable.
For the case a prefix argument is given and the region is not active, we
could try to set the region around the smallest containing form and call
`indent-region' on that. But that would be a different feature.
> I'd certainly be grateful!
>
> [I didn't realize I used it so much (on the face of it, it seems like a
> rather obscure bit of functionality), but I find my fingers keep trying
> to invoke it, and I keep being surprised when it doesn't work... ]
For `lisp-indent-line' I can offer the attached patch.
*** lisp-mode.el.~1.209.~ Tue Oct 9 11:52:54 2007
--- lisp-mode.el Sat Dec 22 09:55:52 2007
***************
*** 821,827 ****
(if (> (- (point-max) pos) (point))
(goto-char (- (point-max) pos)))
;; If desired, shift remaining lines of expression the same amount.
! (and whole-exp (not (zerop shift-amt))
(save-excursion
(goto-char beg)
(forward-sexp 1)
--- 821,831 ----
(if (> (- (point-max) pos) (point))
(goto-char (- (point-max) pos)))
;; If desired, shift remaining lines of expression the same amount.
! (and (or whole-exp
! (and current-prefix-arg
! (or (not transient-mark-mode)
! (not mark-active))))
! (not (zerop shift-amt))
(save-excursion
(goto-char beg)
(forward-sexp 1)
- C-u prefix behavior of TAB broken, Miles Bader, 2007/12/16
- Re: C-u prefix behavior of TAB broken, martin rudalics, 2007/12/17
- Re: C-u prefix behavior of TAB broken, Miles Bader, 2007/12/17
- Re: C-u prefix behavior of TAB broken, martin rudalics, 2007/12/17
- Re: C-u prefix behavior of TAB broken, Stefan Monnier, 2007/12/20
- Re: C-u prefix behavior of TAB broken, Richard Stallman, 2007/12/21
- Re: C-u prefix behavior of TAB broken, Miles Bader, 2007/12/21
- Re: C-u prefix behavior of TAB broken,
martin rudalics <=
- Re: C-u prefix behavior of TAB broken, Miles Bader, 2007/12/22
- Re: C-u prefix behavior of TAB broken, martin rudalics, 2007/12/22
- Re: C-u prefix behavior of TAB broken, Miles Bader, 2007/12/22
- Re: C-u prefix behavior of TAB broken, martin rudalics, 2007/12/22
- Re: C-u prefix behavior of TAB broken, Miles Bader, 2007/12/22
- Re: C-u prefix behavior of TAB broken, Stefan Monnier, 2007/12/22
- Re: C-u prefix behavior of TAB broken, Miles Bader, 2007/12/22
- Re: C-u prefix behavior of TAB broken, Stefan Monnier, 2007/12/23
- Re: C-u prefix behavior of TAB broken, Richard Stallman, 2007/12/22
- Re: C-u prefix behavior of TAB broken, martin rudalics, 2007/12/22