emacs-devel
[Top][All Lists]
Advanced

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

Re: Functionality to check current indentation status


From: Stefan Monnier
Subject: Re: Functionality to check current indentation status
Date: Wed, 13 Jan 2010 10:22:42 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux)

> Is there any generic functionality for checking whether a specific
> line is indented appropriately according to major-mode? I mean other
> than indenting it and seeing whether anything was modified.

No.  The generic indentation code only knows of indent-line-function
which performs the re-indent rather than returning the
indentation amount.
And yes, I think this was a mistake in its design.

> If not, it would be useful for e.g. a minor-mode which would highlight
> lines that are not correctly indented, or for binding TAB to some
> imaginary function indent-or-expand-abbrev, which would indent the
> line if not already correct, otherwise call `expand-abbrev'.

You may take a look at the indent-for-tab-command code, especially the
part that implements the new completion behavior (conditional on
tab-always-indent being set to `complete').


        Stefan




reply via email to

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