From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Emacs pretest 22.1.91 Date: Wed, 27 Feb 2008 23:59:22 -0500 Message-ID: References: <87ejb8vl0i.fsf@stupidchicken.com> <47C55A60.5010709@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204174789 30312 80.91.229.12 (28 Feb 2008 04:59:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Feb 2008 04:59:49 +0000 (UTC) Cc: lekktu@gmail.com, matsuan@ca2.so-net.ne.jp, emacs-devel@gnu.org, jasonr@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 28 06:00:09 2008 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 1JUasL-0006wK-9x for ged-emacs-devel@m.gmane.org; Thu, 28 Feb 2008 06:00:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUarp-000100-5n for ged-emacs-devel@m.gmane.org; Wed, 27 Feb 2008 23:59:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUark-0000yk-U2 for emacs-devel@gnu.org; Wed, 27 Feb 2008 23:59:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUarj-0000wn-2o for emacs-devel@gnu.org; Wed, 27 Feb 2008 23:59:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUari-0000wc-Sy for emacs-devel@gnu.org; Wed, 27 Feb 2008 23:59:30 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JUarb-0000hH-HS; Wed, 27 Feb 2008 23:59:23 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CALnOxUdMCpz5Wmdsb2JhbACQXwEgnVeBAg X-IronPort-AV: E=Sophos;i="4.25,417,1199682000"; d="scan'208";a="15331946" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 27 Feb 2008 23:59:22 -0500 Original-Received: from pastel.home ([76.10.156.249]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id IGJ86322; Wed, 27 Feb 2008 23:59:22 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 73E607F25; Wed, 27 Feb 2008 23:59:22 -0500 (EST) In-Reply-To: (Eli Zaretskii's message of "Thu, 28 Feb 2008 06:14:55 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:90694 Archived-At: >> In this case, I believe the solution is to setup the tool-bar-map at the >> very beginning (maybe even before dumping), and then have a function >> (run after the .emacs) that can fix up the tool-bar-map by replacing the >> default image choice with the preferred images for the current setup (so >> it can obey image-library-alist, display-color-p, etc..). > Can you (or someone else) explain why is it necessary to set up > tool-bar-map so early? Why not set it up where you suggest to ``fix'' > it? So code can refer to it (e.g. compile.el builds a tool-bar-map of its own based on the pre-existing one and this is done when loading compile.elc). Actually, looking at how compile.el uses tool-bar-map, I see that if compile.el gets loaded before tool-bar-map is "adjusted" (images chosen depending on the display and libs), then compile's own tool-bar will lack this adjustment. So maybe the choice of which image to use should be done in the :filter function (currently trivial) defined in tool-bar.el as: (global-set-key [tool-bar] '(menu-item "tool bar" ignore :filter (lambda (ignore) tool-bar-map))) I.e. basically extend the format allowed in tool-bar-map to include various images and let the image be chosen later on by the :filter function. Of course, maybe this filter gets run early on as well... Stefan