From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64546 Path: news.gmane.org!not-for-mail From: Didier Verna Newsgroups: gmane.emacs.gnus.general Subject: Re: Mixing whitespace and topical changes Date: Wed, 18 Apr 2007 11:54:59 +0200 Organization: The Gnus Project Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1176890174 31576 80.91.229.12 (18 Apr 2007 09:56:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 18 Apr 2007 09:56:14 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M13057@lists.math.uh.edu Wed Apr 18 11:56:06 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 1He6tR-0001pv-EG for ding-account@gmane.org; Wed, 18 Apr 2007 11:56:05 +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 1He6t1-0004Cr-MT; Wed, 18 Apr 2007 04:55:39 -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 1He6t0-0004CS-0v for ding@lists.math.uh.edu; Wed, 18 Apr 2007 04:55:38 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.63) (envelope-from ) id 1He6st-0002LI-Li for ding@lists.math.uh.edu; Wed, 18 Apr 2007 04:55:37 -0500 Original-Received: from 2.139.39-62.rev.gaoland.net ([62.39.139.2] helo=kualalumpur.lrde.epita.fr) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1He6ss-00030E-00 for ; Wed, 18 Apr 2007 11:55:30 +0200 Original-Received: from uzeb.lrde.epita.fr ([192.168.101.53]) by kualalumpur.lrde.epita.fr with esmtp (Exim 4.50) id 1He6sN-00035L-Vb for ding@gnus.org; Wed, 18 Apr 2007 11:54:59 +0200 Original-Received: by uzeb.lrde.epita.fr (Postfix, from userid 17030) id BA71A5E239; Wed, 18 Apr 2007 11:54:59 +0200 (CEST) In-Reply-To: (Didier Verna's message of "Wed\, 18 Apr 2007 09\:42\:37 +0200") User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.20 (linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAD1BMVEU+MCSXb1u1tLLBv7yt hnOhAz6kAAAACXBIWXMAAAsSAAALEgHS3X78AAABzklEQVQ4y1WT4XXDMAiEwS8DSK4GaFAGaFAG qPq8/0y9Q7Li6I8dvhwHGIlZrd4aHmbxjhd3M7F1kiHotTFMUPELIcHZrDUCD2B8uUucreFAVQPg sYssAsPIQOOHrFMbETSC+P0dF7UWBwrzfAEhgciljoIukhqlSXNm0rdqD0WDuTOedUmcwKTZk3Ec SYMMe/FqgmjJnSx6oYkD/FBRylH6BIZkFeDJeD6WAuNDWajbaXHg5JzWxFBue8mIL4nSBMBz7iHo p8QCOEAZigMKHWMBMNPpUKjQ2TwUrwRFV5TQc1Jm29hHeJTOXnoHyWPEPj3mVPIEe4DHyCFa2MkW nXgohKmitFNxAlWMiaCfU6F5tW+5HceseX6WP3xaLkOONt7Tki8C96RHiXmtD7mzwVZ/48+RaSo2 jATDfwbIb28qKjb/jpHkGMmpuL0EG918z0d0De80t4uKampoPaX1cQl4V0yLYiRZz0yhMGtocUzx Cswr7w3iKHato3DbeS0TCW1ksm1eThGWe1FIXLVqvzTRj7UfigB0XvYTfF9Db+AEw/ZTUQPESfKZ 6ry4OgrDesmfPYb5ALxEKUqL+BIk9pOivp3xmZnbJXroLYv+AzWmZA7pkKcdAAAAJnpUWHRDb21t ZW50AAB42nMuSk0sSU1RKM8syVAIyUhVcPf0DQAAUucHI5DLZXAAAAAaelRYdEpQRUctQ29sb3Jz cGFjZQAAeNozAgAAMwAzERZ+YwAAACd6VFh0SlBFRy1TYW1wbGluZy1mYWN0b3JzAAB42jOqMNIx rDAEYQARgwLpZA8bYgAAAABJRU5ErkJggg== X-Face: %A(6@>etHs)-46?KiYS+Jz@okm@fuWD@\3fh@?4@4pg{opC9@X _~:AR X-Attribution: dvl X-Web: http://www.gnus.org X-Url: http://www.gnus.org X-Home-Page: http://www.gnus.org Mail-Copies-To: never X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64546 Archived-At: --=-=-= If anyone's interested, here's a small overload on top of whitespace.el[1] to customize the behavior on a per-file basis. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=whitespace-rc.el Content-Transfer-Encoding: quoted-printable (require 'cl) (defcustom whitespace-files nil "List of file-specific behaviors for whitespace checking. Each entry looks like (REGEXP CHECK t|nil ...). REGEXP is a regexp that will be matched against the filename. CHECK is one of 'leading, 'trailing, 'indent, 'spacetab or 'ateol. Checks n= ot specified will inherit from the default value." :type '(repeat (group (regexp :tag "File Name Matching") (repeat :inline t :tag "Checks" (choice :inline t (list :inline t :tag "Leading" :format "%{%t%}: %v" (const :tag "" :value leading) boolean) (list :inline t :tag "Trailing" :format "%{%t%}: %v" (const :tag "" :value trailing) boolean) (list :inline t :tag "Indent" :format "%{%t%}: %v" (const :tag "" :value indent) boolean) (list :inline t :tag "Space Tab" :format "%{%t%}: %v" (const :tag "" :value spacetab) boolean) (list :inline t :tag "At EOL" :format "%{%t%}: %v" (const :tag "" :value ateol) boolean))))) :group 'whitespace) (defun whitespace-check-whitespace-mode (&optional arg) "Test and set the whitespace-mode in \"qualifying\" buffers. A buffer qualifies if its file name matches something in \`whitespace-files', or if its mode matches something in \`whitespace-modes'." (if (null whitespace-mode) ;; first, let's find a match on the filename (let* ((file-name (buffer-file-name)) (behavior (assoc* file-name whitespace-files :test #'(lambda (f r) (string-match r f))))) (cond (behavior (setq whitespace-mode t) (pop behavior) (let (symbol) (while (setq symbol (pop behavior)) (set (intern (concat "whitespace-check-buffer-" (symbol-name symbol))) (pop behavior))))) ;; otherwise, look at the major-mode (t (setq whitespace-mode (if (or arg (member major-mode whitespace-modes)) t nil))))))) --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Footnotes:=20 [1] $Id: whitespace.el,v 1.3 2005/03/25 17:09:08 aidan Exp $ --=20 Read the Jazz Blog !! http://jazzblog.didierverna.com Didier Verna, didier@lrde.epita.fr, http://www.lrde.epita.fr/~didier EPITA / LRDE, 14-16 rue Voltaire Tel.+33 (1) 44 08 01 85 94276 Le Kremlin-Bic=EAtre, France Fax.+33 (1) 53 14 59 22 didier@xemac= s.org --=-=-=--