* gnus-ifile category names with spaces
@ 2003-12-31 15:37 Gerd Flaig
2004-01-02 19:50 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Gerd Flaig @ 2003-12-31 15:37 UTC (permalink / 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: gnus-ifile category names with spaces
2003-12-31 15:37 gnus-ifile category names with spaces Gerd Flaig
@ 2004-01-02 19:50 ` Lars Magne Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 2004-01-02 19:50 UTC (permalink / raw)
Gerd Flaig <gefla@pond.sub.org> writes:
> 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.
`mm-url-form-encode-xwfu' will do URL encoding...
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-01-02 19:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-31 15:37 gnus-ifile category names with spaces Gerd Flaig
2004-01-02 19:50 ` Lars Magne Ingebrigtsen
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).