From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Mauger Newsgroups: gmane.emacs.devel Subject: Dynamically modifying menu entries Date: Sun, 18 Jul 2010 22:15:50 -0700 (PDT) Message-ID: <407470.62599.qm@web62502.mail.re1.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1279516565 15659 80.91.229.12 (19 Jul 2010 05:16:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 19 Jul 2010 05:16:05 +0000 (UTC) To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 19 07:16:04 2010 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.69) (envelope-from ) id 1Oaihv-00034z-Sq for ged-emacs-devel@m.gmane.org; Mon, 19 Jul 2010 07:16:04 +0200 Original-Received: from localhost ([127.0.0.1]:60924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oaihv-0000N3-BM for ged-emacs-devel@m.gmane.org; Mon, 19 Jul 2010 01:16:03 -0400 Original-Received: from [140.186.70.92] (port=37056 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oaihk-0000Ko-7u for emacs-devel@gnu.org; Mon, 19 Jul 2010 01:15:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oaihj-0002TM-7t for emacs-devel@gnu.org; Mon, 19 Jul 2010 01:15:52 -0400 Original-Received: from web62502.mail.re1.yahoo.com ([69.147.75.94]:20296) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Oaihj-0002T7-58 for emacs-devel@gnu.org; Mon, 19 Jul 2010 01:15:51 -0400 Original-Received: (qmail 66363 invoked by uid 60001); 19 Jul 2010 05:15:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1279516550; bh=KEHQ2iMT+dADebSaGZ4J/Q1I+hnc9hyZWs3pSsr4l/Y=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=w/sQjYAUvKJ9KXxD3m6BO7iZYe5rvhMawH5I+OnmLAAjJis6jCd796S6VhU7gggI0O5dRPidjL3yh2RAxzosaxsdvoe0w11eSDyTmgeriDAm6SSf75EkZZYymiXVHQNuWAgtDNwRvyC0NOT9eecJz2/sd9SswX1bJoL8CY+yupM= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=gAAIURt3IHwQdHwXHS4zloKTpIFOpFcy2n7DI9S48FAv838E8R1rknf4riTQlhJpRXlk1S1/2Ln23ufZB5YZv0JRMiTR6fQazshCVq3JbX8wKsmoDXQ2YPspXNKkcaAsovDbxN1sNxFgRRsETlgvumuaB+93J5ZoZbxh+gMoY8Q=; X-YMail-OSG: 4MzqA0oVM1n8h.9XwTjC6aGKJd9MyF41Ed71FCMN903hgmT 02I2ar2UnbSJsbCPDPz2JNNDxJxEfZwbandBq7u_ndReYKl6AjIgm6iOt7Zs _kmfng64Jq9kay2_VW0WLkRsPbWbsh1Cj3fAioZsDbzuishbgm4tLBfsTSM. L15tl7BzaBFOstvUN1ap8yMvj6oRMZR9Ed8oG.UCq6XCwOUEa5BsnjTpuYjV sWFiC..XmKgNVCf46y40DArM3HE0KZBwuGm6dMGpCQfhoxId6KZi7AuTSxYV UYB6z9F3F_iFCaGY1CuLRpyf96WwwX_97ImOW583LZEc0yA-- Original-Received: from [98.216.52.54] by web62502.mail.re1.yahoo.com via HTTP; Sun, 18 Jul 2010 22:15:50 PDT X-Mailer: YahooMailRC/420.4 YahooMailWebService/0.8.104.276605 X-detected-operating-system: by eggs.gnu.org: FreeBSD 6.x (1) 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:127569 Archived-At: I am building a menu using `easy-menu-define' with a submenu whose entries are dependent on the entries in a list in the package. The contents of the list may change and based on those changes the contents of the submenu may change. This is not as simple as enabling/disabling menu entries; it involves adding and removing entries based on the contents of the separate list. I have one submenu for which I have a separate API to maintain the list and corresponding submenu contents. In another case, the API feels like overkill. I've tried the :filter function and rather than filtering out existing menu entries I return an augmented list of entries. It worked on Gnome but I'm not sure that it is an appropriate way of dynamically populating a submenu. It also does appear that the submenu doesn't get refreshed as frequently as I'd like. Ideally, I'd like to be able to populate the submenu when it's selected rather than having to predefine the menu contents. What am I missing, or is using the :filter handler the way to go? TIA