From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Functionality to check current indentation status Date: Wed, 13 Jan 2010 10:22:42 -0500 Message-ID: References: <7b501d5c1001130455l2615882bg339c4e41d1596102@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1263396311 12268 80.91.229.12 (13 Jan 2010 15:25:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Jan 2010 15:25:11 +0000 (UTC) Cc: Emacs-Devel devel To: Deniz Dogan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 13 16:25:03 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NV55f-0005K4-QA for ged-emacs-devel@m.gmane.org; Wed, 13 Jan 2010 16:25:00 +0100 Original-Received: from localhost ([127.0.0.1]:35468 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NV55g-00026K-Bt for ged-emacs-devel@m.gmane.org; Wed, 13 Jan 2010 10:25:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NV53c-0001Y5-Fq for emacs-devel@gnu.org; Wed, 13 Jan 2010 10:22:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NV53X-0001XX-7F for emacs-devel@gnu.org; Wed, 13 Jan 2010 10:22:51 -0500 Original-Received: from [199.232.76.173] (port=52968 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NV53W-0001XS-SJ for emacs-devel@gnu.org; Wed, 13 Jan 2010 10:22:46 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:5587 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NV53V-00065l-6Y for emacs-devel@gnu.org; Wed, 13 Jan 2010 10:22:46 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhoFADN0TUvO+KPG/2dsb2JhbACBRNV9hDAEijI X-IronPort-AV: E=Sophos;i="4.49,268,1262581200"; d="scan'208";a="53670242" Original-Received: from 206-248-163-198.dsl.teksavvy.com (HELO pastel.home) ([206.248.163.198]) by ironport2-out.pppoe.ca with ESMTP; 13 Jan 2010 10:22:43 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 61F69806E; Wed, 13 Jan 2010 10:22:42 -0500 (EST) In-Reply-To: <7b501d5c1001130455l2615882bg339c4e41d1596102@mail.gmail.com> (Deniz Dogan's message of "Wed, 13 Jan 2010 13:55:23 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:119919 Archived-At: > 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