From: Philippe M. Coatmeur <philippe.coatmeur@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Dude where is my car ?
Date: Fri, 25 May 2012 22:59:10 +0000 [thread overview]
Message-ID: <lz1um727gh.wl%philippe.coatmeur@gmail.com> (raw)
Hi everyone ;
I have this function that loops trough a list of lists of email
elements to extract them. The list looks like this :
(("<test@adamweb.net>" "Fri, 25 May 2012 23:49:58 +0200" "Re: plopz" "1648")
("contact <plop@gmail.com>" "Fri, 25 May 2012 22:21:49 +0000" "tst" "1647"))
(This is what you get if you C-h v with point over mail-bug-unseen-mails-one)
(defun mail-bug-desktop-notify-one ()
(mapcar
(lambda (x)
(if (not (member x mail-bug-advertised-mails-one))
(progn
(mail-bug-desktop-notification
"Mew mail!"
(format "%s %s %s" ;; Produces the values below
(car (nthcdr 1 x)) ;; Fri, 25 May 2012 23:49:58 +0200
(car (nthcdr 2 x)) ;; Re: plopz
(car (nthcdr 3 x))) ;; 1648
"500000" mail-bug-new-mail-icon-one)
(add-to-list 'mail-bug-advertised-mails-one x))))
mail-bug-unseen-mails-one))
And this works fine, so it follows that (car (car x)) is the first
element of each atomic list, right ? but when I try to extract it
emacs (24.1.50 cvs) insults me!? I spent more than a good hour trying
to figure this out
(format "%s %s %s"
(car (car x)) ;; Should produce <test@adamweb.net>
(car (nthcdr 2 x)) ;; Re: encor un autre
(car (nthcdr 3 x))) ;; 1643
error in process sentinel: format: Wrong type argument: listp, "<test@adamweb.net>"
error in process sentinel: Wrong type argument: listp, "<test@adamweb.net>"
(How am I supposed to interpret this first error ? Does format really
expect a list?) What is it that I'm doing wrong ? Where is my car?
Phil
next reply other threads:[~2012-05-25 22:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-25 22:59 Philippe M. Coatmeur [this message]
2012-05-26 2:51 ` Dude where is my car ? Eric Abrahamsen
2012-05-26 14:04 ` Stefan Monnier
[not found] ` <mailman.1688.1338000714.855.help-gnu-emacs@gnu.org>
2012-05-26 19:00 ` Philippe M. Coatmeur
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=lz1um727gh.wl%philippe.coatmeur@gmail.com \
--to=philippe.coatmeur@gmail.com \
--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.