[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Break from a dolist
From: |
Cecil Westerhof |
Subject: |
Break from a dolist |
Date: |
Sun, 09 Sep 2012 10:56:57 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
I have the following code to fetch the email address belonging to a
mailing list. I use it to automatically fill the to address when
posting to a newsgroup.
(defun dcbl-gnus-get-mailing-list-address ()
"Get gnus-newsgroup-name mailing list address (if it has one);"
(let ((to-address nil))
(when gnus-newsgroup-name
(dolist (item dcbl-gnus-mailing-lists)
(when (string-match (car item) gnus-newsgroup-name)
(setq to-address (cdr item)))))
to-address))
But when the address is found, it would be better to leave the loop.
Is this possible?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
- Break from a dolist,
Cecil Westerhof <=