[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C-x TAB indent-rigidly default set to 4 columns, not to 1
From: |
Michael Slass |
Subject: |
Re: C-x TAB indent-rigidly default set to 4 columns, not to 1 |
Date: |
Tue, 18 May 2004 22:14:07 GMT |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
nospam55 <nospa@no.yahoo.no> writes:
>thanks Mike; your solution has still some problem with C-u C-u M-x irFrequent ,
>but leads to
>
> ;; we refer to "Prefix Command Arguments" ,
> ;; fsf emacs lisp reference manual
> (defun irFrequent (arg beg end)
> "`indent-rigidly' region with 4 spaces, or prefix-arg spaces if provided"
> (interactive "P\nr")
> (indent-rigidly beg end (prefix-numeric-value (or arg 4)) ) ;
> alternative 1/2
> ;; (indent-rigidly beg end (if arg (prefix-numeric-value arg) 4) ) ;
> alternative 2/2
> )
>
>
>which looks great and seems to work !
>
I think you might still want the number of spaces argument to be
optional:
(defun irFrequent (beg end &optional spaces)
"`indent-rigidly' 4 spaces.
With prefix-arg, or optional arg SPACES, `indent-rigidly' by that amount
instead."
(interactive "r\nP")
(indent-rigidly beg end (prefix-numeric-value (or spaces 4))))
--
Mike Slass