Gnus development mailing list
 help / color / mirror / Atom feed
From: Fabrice Popineau <Fabrice.Popineau@supelec.fr>
Subject: Re: nnmail-split-fancy-match-partial-words
Date: Sun, 05 Mar 2006 21:39:39 +0100	[thread overview]
Message-ID: <hd6c1v90.fsf@esemetz.metz.supelec.fr> (raw)
In-Reply-To: <v9acc7lhkd.fsf@marauder.physik.uni-ulm.de>

* Reiner Steib <reinersteib+gmane@imap.cc> writes:

    > On Fri, Mar 03 2006, Katsumi Yamaoka wrote:
    >>>>>>> In <slpzq2t8.fsf@esemetz.metz.supelec.fr>
    >>>>>>> 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




  reply	other threads:[~2006-03-05 20:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-03  9:45 nnmail-split-fancy-match-partial-words Fabrice Popineau
2006-03-03 11:13 ` nnmail-split-fancy-match-partial-words Katsumi Yamaoka
2006-03-03 14:38   ` nnmail-split-fancy-match-partial-words Reiner Steib
2006-03-05 20:39     ` Fabrice Popineau [this message]
2006-03-05 21:50       ` nnmail-split-fancy-match-partial-words Reiner Steib
2006-03-06  4:00         ` nnmail-split-fancy-match-partial-words Katsumi Yamaoka
2006-03-06  8:19           ` nnmail-split-fancy-match-partial-words Fabrice Popineau
2006-03-07  9:55           ` nnmail-split-fancy-match-partial-words Katsumi Yamaoka
2006-03-08  9:06             ` nnmail-split-fancy-match-partial-words Katsumi Yamaoka
2006-03-09 15:41               ` nnmail-split-fancy-match-partial-words Reiner Steib
2006-03-10  2:02                 ` nnmail-split-fancy-match-partial-words Katsumi Yamaoka
2006-03-05 20:43     ` nnmail-split-fancy-match-partial-words Fabrice Popineau
2006-03-06 15:45       ` set-file-modes (XEmacs on w32) (was: nnmail-split-fancy-match-partial-words) Reiner Steib
2006-03-09 20:50         ` set-file-modes (XEmacs on w32) Reiner Steib

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=hd6c1v90.fsf@esemetz.metz.supelec.fr \
    --to=fabrice.popineau@supelec.fr \
    /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).