From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64467 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.gnus.general Subject: Re: Tabs in texi files Date: Thu, 29 Mar 2007 08:54:48 +1000 Organization: Bah Humbug Message-ID: <873b3pf07b.fsf@zip.com.au> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1175122962 30680 80.91.229.12 (28 Mar 2007 23:02:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Mar 2007 23:02:42 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M12991@lists.math.uh.edu Thu Mar 29 01:02:36 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1HWhA2-0003iX-TP for ding-account@gmane.org; Thu, 29 Mar 2007 01:02:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1HWhA1-000626-BR; Wed, 28 Mar 2007 18:02:33 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1HWh2i-0005wc-DO for ding@lists.math.uh.edu; Wed, 28 Mar 2007 17:55:00 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.63) (envelope-from ) id 1HWh2h-0006DY-8i for ding@lists.math.uh.edu; Wed, 28 Mar 2007 17:55:00 -0500 Original-Received: from mailout2-8.pacific.net.au ([61.8.2.231] helo=mailout2.pacific.net.au) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1HWh2e-0003RW-00 for ; Thu, 29 Mar 2007 00:54:57 +0200 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id DE2B110A1D0 for ; Thu, 29 Mar 2007 08:54:47 +1000 (EST) Original-Received: from localhost (ppp23BB.dyn.pacific.net.au [61.8.35.187]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 1BF768C0E for ; Thu, 29 Mar 2007 08:54:52 +1000 (EST) Original-Received: from gg by localhost with local (Exim 4.63) (envelope-from ) id 1HWh2X-0004fQ-2z for ding@gnus.org; Thu, 29 Mar 2007 08:54:49 +1000 Mail-Copies-To: never In-Reply-To: (Didier Verna's message of "Wed, 28 Mar 2007 18:37:08 +0200") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux) X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64467 Archived-At: Didier Verna writes: > > So what's the general recommendation for texi files ? I use the spot of code below to see any tabs that creep in (usually from cutting and pasting code). I've kept meaning to propose something like it for texinfo-mode, but I've been through various versions and still haven't got to a balance between warning vs fixing vs being overly intrusive. (defun my-texinfo-tab-warn-face (beg end) "Put `trailing-whitespace' face on any tabs from BEG to END, as a warning." (save-excursion (goto-char beg) (let ((modified (buffer-modified-p))) (while (re-search-forward "\t+" end t) (put-text-property (match-beginning 0) (match-end 0) 'face 'trailing-whitespace)) (set-buffer-modified-p modified)))) (add-hook 'after-change-functions (lambda (beg end prev-len) (if (eq major-mode 'texinfo-mode) (my-texinfo-tab-warn-face beg end)))) (add-hook 'texinfo-mode-hook (lambda () (my-texinfo-tab-warn-face (point-min) (point-max))))