From: Kevin Ryde <user42@zip.com.au>
To: ding@gnus.org
Subject: Re: Tabs in texi files
Date: Thu, 29 Mar 2007 08:54:48 +1000 [thread overview]
Message-ID: <873b3pf07b.fsf@zip.com.au> (raw)
In-Reply-To: <muxzm5x2ukr.fsf@uzeb.lrde.epita.fr> (Didier Verna's message of "Wed, 28 Mar 2007 18:37:08 +0200")
Didier Verna <didier@xemacs.org> 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))))
next prev parent reply other threads:[~2007-03-28 22:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-28 15:17 Katsumi Yamaoka
2007-03-28 16:21 ` Didier Verna
2007-03-28 16:37 ` Didier Verna
2007-03-28 22:32 ` Katsumi Yamaoka
2007-03-28 22:54 ` Kevin Ryde [this message]
2007-03-28 23:12 ` Katsumi Yamaoka
2007-03-28 16:47 ` Reiner Steib
2007-03-28 23:01 ` Miles Bader
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=873b3pf07b.fsf@zip.com.au \
--to=user42@zip.com.au \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).