From: Glenn Morris <rgm@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: easymenu suffix problem?
Date: Sun, 25 Nov 2007 22:45:19 -0500 [thread overview]
Message-ID: <0xtzn9vfe8.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <pjzlx381vz.fsf@fencepost.gnu.org> (Glenn Morris's message of "Sat, 24 Nov 2007 22:01:04 -0500")
Glenn Morris wrote:
> You get the same binding to menu-function-1 for each "For Year XXXX"
> entry, which means one always gets the holidays for 2002, no matter
> which item one clicks.
I think this can be worked around by using :label (undocumented, BTW)
instead of :suffix, and using a counter for the menu-item names. I
still don't understand if easymenu is doing the right thing with
:suffix though.
*** cal-menu.el.~1.78.~ 2007-11-24 18:48:06.000000000 -0800
--- cal-menu.el 2007-11-25 19:42:02.000000000 -0800
***************
*** 95,106 ****
,@(let ((l ()))
;; Show 11 years--5 before, 5 after year of middle month.
(dotimes (i 11)
! (push (vector "For Year"
`(lambda ()
(interactive)
(holiday-list (+ displayed-year ,(- i 5))
(+ displayed-year ,(- i 5))))
! :suffix `(number-to-string (+ displayed-year ,(- i 5))))
l))
(nreverse l))
"--"
--- 95,107 ----
,@(let ((l ()))
;; Show 11 years--5 before, 5 after year of middle month.
(dotimes (i 11)
! (push (vector (format "hol-year-%d" i)
`(lambda ()
(interactive)
(holiday-list (+ displayed-year ,(- i 5))
(+ displayed-year ,(- i 5))))
! :label `(format "For Year %d"
! (+ displayed-year ,(- i 5))))
l))
(nreverse l))
"--"
next prev parent reply other threads:[~2007-11-26 3:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-25 3:01 easymenu suffix problem? Glenn Morris
2007-11-26 3:45 ` Glenn Morris [this message]
2007-11-26 15:01 ` Stefan Monnier
2007-11-27 3:03 ` Glenn Morris
2007-11-27 4:26 ` Stefan Monnier
2008-01-15 22:33 ` Stefan Monnier
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=0xtzn9vfe8.fsf@fencepost.gnu.org \
--to=rgm@gnu.org \
--cc=emacs-devel@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.