emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: easymenu suffix problem?


From: Glenn Morris
Subject: Re: easymenu suffix problem?
Date: Sun, 25 Nov 2007 22:45:19 -0500
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

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))
      "--"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]