From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: easymenu suffix problem? Date: Sun, 25 Nov 2007 22:45:19 -0500 Message-ID: <0xtzn9vfe8.fsf@fencepost.gnu.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196048738 30709 80.91.229.12 (26 Nov 2007 03:45:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Nov 2007 03:45:38 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 26 04:45:45 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IwUuj-00089T-H1 for ged-emacs-devel@m.gmane.org; Mon, 26 Nov 2007 04:45:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwUuU-0002rV-GR for ged-emacs-devel@m.gmane.org; Sun, 25 Nov 2007 22:45:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IwUuQ-0002rG-LE for emacs-devel@gnu.org; Sun, 25 Nov 2007 22:45:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IwUuP-0002qy-BH for emacs-devel@gnu.org; Sun, 25 Nov 2007 22:45:22 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwUuP-0002qv-4t for emacs-devel@gnu.org; Sun, 25 Nov 2007 22:45:21 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IwUuO-0004pa-SK for emacs-devel@gnu.org; Sun, 25 Nov 2007 22:45:20 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1IwUuN-0002Wx-HL; Sun, 25 Nov 2007 22:45:19 -0500 X-Spook: underground morse Rand Corporation industrial espionage X-Ran: DWPwM3<$Sy{lIk,=9sq@?U-zeOaAfTjCfm%w`~(NpO:^}s&mNEiuk9p`e5""'i,w3.ZHy; X-Hue: cyan X-Attribution: GM In-Reply-To: (Glenn Morris's message of "Sat, 24 Nov 2007 22:01:04 -0500") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:84126 Archived-At: 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)) "--"