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: Patch: Follow convention for reading with the minibuffer. Date: Fri, 30 Sep 2005 15:52:40 -0400 Message-ID: <87vf0iibno.fsf-monnier+emacs@gnu.org> References: <87psqy1sk1.fsf@pacem.orebokech.com> <877jczfrj2.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1128110990 14744 80.91.229.2 (30 Sep 2005 20:09:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 30 Sep 2005 20:09:50 +0000 (UTC) Cc: Thien-Thi Nguyen , romain@orebokech.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 30 22:09:45 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ELRAF-0001Yj-K2 for ged-emacs-devel@m.gmane.org; Fri, 30 Sep 2005 22:07:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ELRAE-0006qJ-TA for ged-emacs-devel@m.gmane.org; Fri, 30 Sep 2005 16:07:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ELR6y-0005aW-TO for emacs-devel@gnu.org; Fri, 30 Sep 2005 16:04:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ELR6p-0005VU-Oo for emacs-devel@gnu.org; Fri, 30 Sep 2005 16:03:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ELR6o-0005Rt-69 for emacs-devel@gnu.org; Fri, 30 Sep 2005 16:03:54 -0400 Original-Received: from [209.226.175.93] (helo=tomts36-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ELQvz-0007Li-Mj; Fri, 30 Sep 2005 15:52:43 -0400 Original-Received: from alfajor ([67.71.32.13]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050930195241.HLFB16985.tomts36-srv.bellnexxia.net@alfajor>; Fri, 30 Sep 2005 15:52:41 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 19154D7A2D; Fri, 30 Sep 2005 15:52:40 -0400 (EDT) Original-To: Juri Linkov In-Reply-To: <877jczfrj2.fsf@jurta.org> (Juri Linkov's message of "Thu, 29 Sep 2005 23:57:29 +0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:43402 Archived-At: > I much prefer using spaces instead of tabs too. But since I noticed that > preferable indentation in the Emacs source tree is with tabs I put into > .emacs the following code: > (defvar indent-tabs-mode-dirs (list (file-name-directory > (directory-file-name data-directory))) > "Set indent-tabs-mode in all files under specified subdirectories.") This is wrong. For some file types indent-tabs-mode should always be t (e.g. for ChangeLog and Makefile) and for others it should always be nil (e.g. for LaTeX and TeXinfo). How 'bout: (add-hook 'find-file-hook (lambda () (if (and (null indent-tabs-mode) (local-variable-p 'indent-tabs-mode) ; Trust the major 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)))) -- Stefan