help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Automatic smart indentation


From: Stefan Monnier
Subject: Re: Automatic smart indentation
Date: Fri, 31 Oct 2003 17:23:17 GMT
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> (add-hook 'after-change-functions
>         (lambda (start end pre-change-length)
>               (indent-region start (buffer-size) nil)))

Modifying the buffer from within after-change-functions is tricky
business.  A more reliable approach is to keep track in
after-change-functions of the part of the text that gets modified,
and reindent later (from a post-command-hook).

See diff-mode.el for an example of how to do that.


        Stefan


reply via email to

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