From: Artur Malabarba <bruce.connor.am@gmail.com>
To: emacs-devel <emacs-devel@gnu.org>, Nicolas Petton <nicolas@petton.fr>
Cc: emacs-diffs@gnu.org
Subject: Re: map 6287979: Fix a false negative in `map-elt' with alists and values being nil
Date: Sat, 25 Apr 2015 15:50:05 +0100 [thread overview]
Message-ID: <CAAdUY-KRDiuF3myaoFQF7dMh1CbnWjnS6eJv62P3YoCDMVa9dQ@mail.gmail.com> (raw)
In-Reply-To: <E1Ylwzr-0005nr-SF@vcs.savannah.gnu.org>
Quick fix :-)
> +(defun map--elt-list (map key &optional default)
> + "Return the element of the list MAP at the index KEY.
> +If KEY is not found, return DEFAULT which defaults to nil."
> + (let ((pair (assoc key map)))
> + (if pair
> + (cdr (assoc key map))
> + default)))
How about the following?
(if pair (cdr pair)
default)))
next parent reply other threads:[~2015-04-25 14:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20150425100739.22272.85986@vcs.savannah.gnu.org>
[not found] ` <E1Ylwzr-0005nr-SF@vcs.savannah.gnu.org>
2015-04-25 14:50 ` Artur Malabarba [this message]
2015-04-25 14:52 ` map 6287979: Fix a false negative in `map-elt' with alists and values being nil Nicolas Petton
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=CAAdUY-KRDiuF3myaoFQF7dMh1CbnWjnS6eJv62P3YoCDMVa9dQ@mail.gmail.com \
--to=bruce.connor.am@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=emacs-diffs@gnu.org \
--cc=nicolas@petton.fr \
/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.