From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62157 Path: news.gmane.org!not-for-mail From: Fabrice Popineau Newsgroups: gmane.emacs.gnus.general Subject: Re: nnmail-split-fancy-match-partial-words Date: Sun, 05 Mar 2006 21:39:39 +0100 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: sea.gmane.org 1141591795 6229 80.91.229.2 (5 Mar 2006 20:49:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 5 Mar 2006 20:49:55 +0000 (UTC) Original-X-From: ding-owner+m10685@lists.math.uh.edu Sun Mar 05 21:49:54 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FG0Ao-0000cQ-Ce for ding-account@gmane.org; Sun, 05 Mar 2006 21:49:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1FG0Aa-0007YQ-00; Sun, 05 Mar 2006 14:49:36 -0600 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FG01N-0007YI-00 for ding@lists.math.uh.edu; Sun, 05 Mar 2006 14:40:05 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1FG01J-0006fi-25 for ding@lists.math.uh.edu; Sun, 05 Mar 2006 14:40:05 -0600 Original-Received: from smtp3-g19.free.fr ([212.27.42.29]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FG013-0004kU-00 for ; Sun, 05 Mar 2006 21:39:45 +0100 Original-Received: from SPARKY.metz.supelec.fr (lns-bzn-53-82-65-4-249.adsl.proxad.net [82.65.4.249]) by smtp3-g19.free.fr (Postfix) with ESMTP id 28E014805C for ; Sun, 5 Mar 2006 21:39:40 +0100 (CET) Original-To: ding@gnus.org X-Spam-Score: -2.5 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:62157 Archived-At: * Reiner Steib writes: > On Fri, Mar 03 2006, Katsumi Yamaoka wrote: >>>>>>> In >>>>>>> Fabrice Popineau wrote: >> Fabrice> Id' like to draw attention on the following point. I have Fabrice> a rather long nnmail-split-fancy list. I had this split Fabrice> rule : Fabrice> Fabrice> ("subject" "\\[ce\\]" foo.ce) [...] Fabrice> I ended up in crudely patching nnmail-split-it in Fabrice> nnmail.el but that's defintely not a clean answer to the Fabrice> problem. Maybe that's a limitation of regexp/syntax tables Fabrice> after all. Katsumi> Thank you for the patch, but it seems to be better to use Katsumi> "\\\\\\[.*\\\\\\]" because "\\[.*\\]" matches "[0-9]", Katsumi> "[a-z]", etc. Does anyone notice other adverse effects? Reiner> I'd rather not put such a special treatment into the code Reiner> _if_ we can avoid it. I agree: the list of special cases might become too long. Reiner> Or we could add a forth element specifying the Reiner> partial-words behavior in the split rule: Reiner> ("subject" ".*\\[ce\\].*" foo.ce t) I would like it, especially if the 4th element is optional. Incidentally, playing with this stuff, I came with another problem. I don't know if it is me or me and my configuration (native win32 xemacs 21.5b21) but there might be problems with nnmail-split-fancy-syntax-table. Namely, when I hacked nnmail.el, I byte-compiled it and restarted xemacs. It came that none of my split-fancy rules worked anymore. I tracked it down to nnmail-split-fancy-syntax-table not being what you would expect because: (make-syntax-table) #s(char-table type syntax data ()) AKA, #'make-syntax-table is returning an empty syntax table, which is weird. I ended up in defining nnmail-split-fancy-syntax-table as an actual copy of the syntax table found in the *nntpd* buffer : --- gnus\lisp\nnmail.el 2006-03-05 21:31:19.00 00000 +0100 +++ gnus\lisp\nnmail.el 2006-03-05 21: :31.000000000 +0100 @@ -599,10 +599,7 @@ "List of group/article elements that say where the previous split put messa s.") (defvar nnmail-split-fancy-syntax-table - (let ((table (make-syntax-table))) - ;; support the %-hack - (modify-syntax-entry ?\% "." table) - table) + nil "Syntax table used by `nnmail-split-fancy'.") (defvar nnmail-prepare-save-mail-hook nil @@ -1322,6 +1319,12 @@ (defun nnmail-split-fancy () "Fancy splitting method. See the documentation for the variable `nnmail-split-fancy' for details." + (or nnmail-split-fancy-syntax-table + (let ((table (copy-syntax-table (syntax-table (current-buffer))))) + ;; support the %-hack + (modify-syntax-entry ?\% "." table) + (setq nnmail-split-fancy-syntax-table table) + nnmail-split-fancy-syntax-table)) (with-syntax-table nnmail-split-fancy-syntax-table (nnmail-split-it nnmail-split-fancy))) This is kludge and the first thing to check is about the XEmacs versions affected by this problem. Best regards, Fabrice