all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Cecil Westerhof <Cecil@decebal.nl>
To: help-gnu-emacs@gnu.org
Subject: Break from a dolist
Date: Sun, 09 Sep 2012 10:56:57 +0200	[thread overview]
Message-ID: <87bohfy3om.fsf@Compaq.site> (raw)

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


             reply	other threads:[~2012-09-09  8:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-09  8:56 Cecil Westerhof [this message]
2012-09-09  9:25 ` Break from a dolist Jambunathan K
     [not found] ` <mailman.8449.1347182656.855.help-gnu-emacs@gnu.org>
2012-09-09 12:49   ` Cecil Westerhof
2012-09-09 13:52     ` Le Wang
2012-09-09 14:13       ` Jambunathan K
     [not found]       ` <mailman.8455.1347199946.855.help-gnu-emacs@gnu.org>
2012-09-09 19:47         ` Cecil Westerhof

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=87bohfy3om.fsf@Compaq.site \
    --to=cecil@decebal.nl \
    --cc=help-gnu-emacs@gnu.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.