Gnus development mailing list
 help / color / mirror / Atom feed
From: Gerd Flaig <gefla@pond.sub.org>
Subject: gnus-ifile category names with spaces
Date: Wed, 31 Dec 2003 16:37:34 +0100	[thread overview]
Message-ID: <87pte5gfr5.fsf@juliet.pond.sub.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 659 bytes --]

Hi,

some of my mail folder names contain spaces. Ifile doesn't like spaces
in category names. So I made a quick ugly hack to make it work with
ifile-gnus: Replace all spaces with '%20'. It would be nice to use a
more robust encoding some day, maybe real url-encoding. Patch
attached.

Comments appreciated.

     Goodbyte, Gerd.

P.S.: I recreated my .idata like this:

zsh% ifile -r
zsh% cd ~/Mail && find * -type f -name .overview | sed -e 's/\/.overview$//' | while read i; do ifile -v2 -i "$(echo $i | sed -e 's,/,.,g' -e 's/ /%20/g')" $i/*; done
-- 
The last thing one knows in constructing a work is what to put first.
                -- Blaise Pascal

[-- Attachment #2: ugly hack to make ifile-gnus convert spaces to %20 and vice versa --]
[-- Type: text/plain, Size: 1012 bytes --]

--- /tmp/ifile-gnus.el	Wed Dec 31 16:07:46 2003
+++ ifile-gnus.el	Wed Dec 31 16:01:01 2003
@@ -78,9 +78,12 @@
 	(apply 'call-process-region (point-min) (point-max) 
 	       ifile-program nil icat-buf nil ifile-classify-flags)
 	)
-      (message "ifile: recommendation is \"%s\"" 
-	       (buffer-substring (point-min) (- (point-max) 1)))
-      (buffer-substring (point-min) (- (point-max) 1)))))
+      (let ((recommendation
+	     (replace-regexp-in-string "%20" " " ;; quote hack
+				       (buffer-substring (point-min)
+							 (- (point-max) 1)))))
+	(message "ifile: recommendation is \"%s\"" recommendation)
+	recommendation))))
 
 (defun ifile-spam-filter (other-split)
   (if (and ifile-active (equal (ifile-recommend) "spam"))
@@ -97,7 +100,7 @@
       (setq group (if (member group ifile-spam-groups)
 		      "spam"
 		    "non-spam")))
-  group)
+  (replace-regexp-in-string " " "%20" group))
 
 (defun ifile-learn-about-article (flags message-format group-name)
   (let ((filtered-group-name 

             reply	other threads:[~2003-12-31 15:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-31 15:37 Gerd Flaig [this message]
2004-01-02 19:50 ` Lars Magne Ingebrigtsen

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=87pte5gfr5.fsf@juliet.pond.sub.org \
    --to=gefla@pond.sub.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).