[Top][All Lists]
[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: |
28 Nov 2002 15:35:10 +0900 |
Eli Zaretskii <address@hidden> writes:
> > What do you use the TAB key for in ChangeLog files?
>
> You didn't ask me, but I'll give my answer anyway: I use it to reindent
> the change log text, like I do in other modes.
Ok, now I see what's going on -- I didn't try TAB in enough places.
It works fine if you're _after_ some change-log text (because the
preceding text will basically always start with a tab), but it screws up
if you're directly after a change-log header.
Now I agree, the new behavior is annoying, because it doesn't do the
right thing at the left-margin.
Something like the following seems appropriate to me:
(defun change-log-indent ()
(interactive)
(let ((cur-indent (current-indentation)))
(cond ((> (current-column) cur-indent)
(insert ?\t))
((= cur-indent 8)
(move-to-column cur-indent))
(t
(delete-horizontal-space)
(indent-to-column 8)))))
(set (make-local-variable 'indent-line-function) 'change-log-indent)
-Miles
--
Run away! Run away!