From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/55453 Path: main.gmane.org!not-for-mail From: Gerd Flaig Newsgroups: gmane.emacs.gnus.general Subject: gnus-ifile category names with spaces Date: Wed, 31 Dec 2003 16:37:34 +0100 Sender: ding-owner@lists.math.uh.edu Message-ID: <87pte5gfr5.fsf@juliet.pond.sub.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1072901499 6388 80.91.224.253 (31 Dec 2003 20:11:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 31 Dec 2003 20:11:39 +0000 (UTC) Original-X-From: ding-owner+M3993@lists.math.uh.edu Wed Dec 31 21:11:32 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Abmgm-0006yi-00 for ; Wed, 31 Dec 2003 21:11:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1AbmgM-0007CW-00; Wed, 31 Dec 2003 14:11:06 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1AbiSx-0006hO-00 for ding@lists.math.uh.edu; Wed, 31 Dec 2003 09:40:59 -0600 Original-Received: from pond-gw.schlund.net (pond-gw.schlund.net [195.20.224.251]) by justine.libertine.org (Postfix) with ESMTP id 128513A0035 for ; Wed, 31 Dec 2003 09:40:58 -0600 (CST) Original-Received: by pond-gw.schlund.net (Postfix, from userid 66) id 0F53B4F40B; Wed, 31 Dec 2003 16:39:47 +0100 (CET) Original-Received: by juliet.pond.sub.org (Postfix, from userid 1000) id 55A0CB1AB; Wed, 31 Dec 2003 16:37:34 +0100 (CET) Original-To: Jeremy H.Brown , ding@gnus.org User-Agent: Gnus/5.1004 (Gnus v5.10.4) Emacs/21.2 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:55453 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:55453 --=-=-= 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 --=-=-= Content-Disposition: inline; filename=ifile-gnus-quotespace.diff Content-Description: ugly hack to make ifile-gnus convert spaces to %20 and vice versa --- /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 --=-=-=--