Thread View: news.software.nntp
2 messages
2 total messages
Started by Robert Nicholson
Sat, 30 Jul 1994 08:31
simple elisp question... removing substrings?
Author: Robert Nicholson
Date: Sat, 30 Jul 1994 08:31
Date: Sat, 30 Jul 1994 08:31
55 lines
2717 bytes
2717 bytes
I make use of mail2news to put all subscribed mailing lists into their
appropriate newsgroup prefixed with "steffi." It's cool reading mail
with gnus :-)
However, whenever I want to save an article I wish it to be saved to
the newsgroup name without the "steffi." prefix.
I'm currently using
(defun gnus-plain-save-name-without-hostname (newsgroup headers &optional last-file)
(let((prefix (substring newsgroup 0 7))
(suffix (substring newsgroup 7 nil)))
(if (string= prefix "steffi.")
(gnus-plain-save-name suffix headers last-file)
(gnus-plain-save-name newsgroup headers last-file))))
which does the job nicely however what I really wanted was something
that just took a string say "steffi.zsh-list" and removed the
"steffi." if it was there or just returned the full-string when it
wasn't. ie. so that I can provide a solution that just has _one_
(gnus-plain call rather than two but I didn't want to do (setq either.
Is there some simple elisp that I'm overlooking? My way appears to be
rather terse.
--- r$
Also, is it possible for me to send _mail_ to these mailing lists by
posting _new_ messages in GNUS? ie. nobody's going to be reading those
groups :-)
I guess I could do it in elisp but can newsfeeds or some INN
configuration set particular newsgroups to be mailed rather than sent
via nntp?
---
If you haven't guessed I'm looking for a solution that allows me to do
all my mailing from within GNUS..
---
And while we're at it.
Should the following newfeeds entry surpress sending all "steffi." newsgroups
down to my host? Currently it doesn't.
news/demon\
:*,!junk/!local,!steffi.*\
:Tf,Wnm:
--
"Real programmers don't create classes. They build hierarchies"
(PGP key: send email with Subject: request pgp key)
(ASCII for text only messages)
Re: simple elisp question... removing substrings?
Author: Neil Jerram
Date: Sat, 30 Jul 1994 22:31
Date: Sat, 30 Jul 1994 22:31
29 lines
2084 bytes
2084 bytes
In article <ROBERT.94Jul30093150@steffi.demon.co.uk> robert@steffi.demon.co.uk (Robert Nicholson) writes:
(defun gnus-plain-save-name-without-hostname (newsgroup headers &optional last-file)
(let((prefix (substring newsgroup 0 7))
(suffix (substring newsgroup 7 nil)))
(if (string= prefix "steffi.")
(gnus-plain-save-name suffix headers last-file)
(gnus-plain-save-name newsgroup headers last-file))))
which does the job nicely however what I really wanted was something
that just took a string say "steffi.zsh-list" and removed the
"steffi." if it was there or just returned the full-string when it
wasn't. ie. so that I can provide a solution that just has _one_
(gnus-plain call rather than two but I didn't want to do (setq either.
It's just a question of moving the (if ...) construct:
(defun gnus-plain-save-name-without-hostname (newsgroup headers
&optional last-file)
(gnus-plain-save-name
(if (string-match "^steffi\\." newsgroup)
(substring newsgroup 7 nil)
newsgroup)
headers last-file))
This is one of the things I really like about Lisp.
Neil.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads