From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: indent-tabs-mode in dir-locals Date: Wed, 07 Jan 2009 02:12:33 +0200 Organization: JURTA Message-ID: <87tz8cht3i.fsf@jurta.org> References: <1ik59b527r.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1231287475 24939 80.91.229.12 (7 Jan 2009 00:17:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Jan 2009 00:17:55 +0000 (UTC) Cc: emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 07 01:19:06 2009 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 1LKM8V-0002xb-Kf for ged-emacs-devel@m.gmane.org; Wed, 07 Jan 2009 01:19:03 +0100 Original-Received: from localhost ([127.0.0.1]:49104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKM7F-0003et-S4 for ged-emacs-devel@m.gmane.org; Tue, 06 Jan 2009 19:17:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKM7C-0003dy-8h for emacs-devel@gnu.org; Tue, 06 Jan 2009 19:17:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKM7A-0003cT-Oe for emacs-devel@gnu.org; Tue, 06 Jan 2009 19:17:41 -0500 Original-Received: from [199.232.76.173] (port=55465 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKM7A-0003cE-KJ for emacs-devel@gnu.org; Tue, 06 Jan 2009 19:17:40 -0500 Original-Received: from relay01.kiev.sovam.com ([62.64.120.200]:1674) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LKM76-0002Q7-SF; Tue, 06 Jan 2009 19:17:37 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay01.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1LKM78-000AQp-4I; Wed, 07 Jan 2009 02:17:38 +0200 In-Reply-To: <1ik59b527r.fsf@fencepost.gnu.org> (Glenn Morris's message of "Sat, 03 Jan 2009 19:44:56 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) X-Scanner-Signature: 88f972a75cd389d721acc69b695bb680 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Trusted X-SpamTest-Info: Profiles 6671 [Jan 07 2009] X-SpamTest-Info: {received from trusted relay: common white list} X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: white ip list X-SpamTest-Rate: 10 X-SpamTest-Status: Trusted X-SpamTest-Status-Extended: trusted X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.8-5.1 (or MacOS X 10.2-10.3) 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:107677 Archived-At: > I had believed the unwritten rule till now was "respect whatever the > file currently uses" (which there should be a setting for; but that's > a wishlist item). The problem is that this rule is still unwritten ;) So we should add a function: (defun indent-tabs-mode-maybe () (if (and (null indent-tabs-mode) ;; Trust the major mode. (not (local-variable-p 'indent-tabs-mode)) (save-excursion (goto-char (point-min)) ;; If there are at least 10 lines with a leading TAB, use TABs. (re-search-forward "^ " (+ (point) 100000) t 10))) (set (make-local-variable 'indent-tabs-mode) t))) based on heuristics from Stefan at http://thread.gmane.org/gmane.emacs.devel/42665/focus=43402 -- Juri Linkov http://www.jurta.org/emacs/