From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64468 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Tabs in texi files Date: Thu, 29 Mar 2007 08:12:05 +0900 Organization: Emacsen advocacy group Message-ID: References: <873b3pf07b.fsf@zip.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1175123590 32572 80.91.229.12 (28 Mar 2007 23:13:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Mar 2007 23:13:10 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M12992@lists.math.uh.edu Thu Mar 29 01:13:02 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 1HWhK8-0000XK-UT for ding-account@gmane.org; Thu, 29 Mar 2007 01:13:01 +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 1HWhK1-00068X-RL; Wed, 28 Mar 2007 18:12:53 -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 1HWhK0-000680-4w for ding@lists.math.uh.edu; Wed, 28 Mar 2007 18:12:52 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.63) (envelope-from ) id 1HWhJt-0006Kr-UV for ding@lists.math.uh.edu; Wed, 28 Mar 2007 18:12:52 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1HWhJs-0003kP-00 for ; Thu, 29 Mar 2007 01:12:44 +0200 Original-Received: from [66.225.201.151] (port=43282 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.63) (envelope-from ) id 1HWhJS-0006FJ-Lq for ding@gnus.org; Wed, 28 Mar 2007 18:12:18 -0500 X-Hashcash: 1:20:070328:ding@gnus.org::25o/JEGZMlOmoLYG:0000H09g X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.96 (gnu/linux) Cancel-Lock: sha1:xfw4oIaLQEwbCRbSY1+aK5X0UcY= X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64468 Archived-At: >>>>> In <873b3pf07b.fsf@zip.com.au> Kevin Ryde wrote: > 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)))) I use: http://www.jpl.org/ftp/pub/elisp/develock.el.gz (or ftp://ftp.jpl.org/pub/elisp/develock.el.gz)