[Top][All Lists]

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

Re: Indenting paragraphs manually

From: Dani Moncayo
Subject: Re: Indenting paragraphs manually
Date: Sun, 6 Mar 2011 21:57:20 +0100

On Sun, Mar 6, 2011 at 21:26, Drew Adams <address@hidden> wrote:
>> > You can type "C-x TAB" once and then repeat it with "C-x z".
>> Indeed, that is another solution, but IMO has it's own drawbacks:
>>  - As shown, the indentation is made by steps of 1 space.
>>  - If you use a prefix argument (to avoid the above problem), it
>>    becomes cumbersome.
>> The complexity of this method is also higher than having a simple,
>> easy to type command that indents the region to the next tab stop and
>> can be repeated several times in a row.
> (defun incremental-tab (arg)
>  (interactive "P")
>  (require 'repeat)
>  (let ((repeat-message-function  'ignore))
>    (setq last-repeatable-command  'indent-rigidly)
>    (repeat nil)))
> (define-key ctl-x-map "\t" 'incremental-tab)
> Or if `C-x TAB TAB...' is too much for you, hold down `f5':
> (global-set-key [f5] 'incremental-tab)
> Hit `C--' at any time to reverse, `C-1' to reverse back again:
> `f5 f5 f5 f5 C-- f5 f5 C-1 f5'...

Thanks, Drew! (I have to find the time to learn elisp... :) )

You've implemented a solution for this problem, but what do you think
about my original question in this thread, i.e., the behavior of the
<TAB> key in text mode, in the current Emacs trunk? Do you understand
it? Does the manual describes it well?

Dani Moncayo

reply via email to

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