emacs-devel
[Top][All Lists]
Advanced

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

Re: add-log.el: Indenting broken.


From: Miles Bader
Subject: Re: add-log.el: Indenting broken.
Date: 03 Dec 2002 11:55:45 +0900

"Stefan Monnier" <monnier+gnu/address@hidden> writes:
> > Now I agree, the new behavior is annoying, because it doesn't do the
> > right thing at the left-margin.
> 
> I've restored it to what it was originally.

Your change seems like the right thing, but I noticed that
`indent-for-tab-command' actually does something stupid in this case:

   (defun indent-for-tab-command (&optional arg)
     ...
     (cond
      ((or ;; indent-to-left-margin is only meant for indenting,
           ;; so we force it to always insert a tab here.
           (eq indent-line-function 'indent-to-left-margin)
           ...
       (insert-tab arg))

It seems to me that this special case should only apply if point is not
within the left margin, so that doing `C-a TAB' will always have the
effect of `fixing' the current indentation (rather than just inserting a
tab), and won't modify the buffer if the indentation for the line is
already correct.

So perhaps a better test might be:

   (and (eq indent-line-function 'indent-to-left-margin)
        (< (current-column) left-margin))

[I don't like the special-casing in `indent-for-tab-command' at all, and
 would actually rather remove it, but it's already that way so I'm
 trying to be conservative.]

-Miles
-- 
自らを空にして、心を開く時、道は開かれる




reply via email to

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