From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Buffer menu fix Date: Tue, 06 Sep 2005 07:39:22 +0300 Message-ID: References: <87slwkfxt9.fsf@stupidchicken.com> <87slwjpug0.fsf@stupidchicken.com> <87wtlvrwet.fsf@stupidchicken.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1125982662 20274 80.91.229.2 (6 Sep 2005 04:57:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Sep 2005 04:57:42 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 06 06:57:39 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ECVVl-0004ZO-TI for ged-emacs-devel@m.gmane.org; Tue, 06 Sep 2005 06:56:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ECVUe-0004ZZ-7Q for ged-emacs-devel@m.gmane.org; Tue, 06 Sep 2005 00:55:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ECVUF-0004VA-KB for emacs-devel@gnu.org; Tue, 06 Sep 2005 00:55:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ECVU6-0004Rl-A2 for emacs-devel@gnu.org; Tue, 06 Sep 2005 00:55:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ECVU6-0004RI-4F for emacs-devel@gnu.org; Tue, 06 Sep 2005 00:55:02 -0400 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ECVIs-00042x-TU for emacs-devel@gnu.org; Tue, 06 Sep 2005 00:43:27 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-84-228-143-173.inter.net.il [84.228.143.173]) by romy.inter.net.il (MOS 3.5.8-GR) with ESMTP id CHN27982 (AUTH halo1); Tue, 6 Sep 2005 07:39:22 +0300 (IDT) Original-To: Chong Yidong In-reply-to: <87wtlvrwet.fsf@stupidchicken.com> (message from Chong Yidong on Mon, 05 Sep 2005 18:18:18 -0400) 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:42641 Archived-At: > Cc: emacs-devel@gnu.org > From: Chong Yidong > Date: Mon, 05 Sep 2005 18:18:18 -0400 > > (defun Buffer-menu-make-sort-button (column ...) > ... > (propertize ... > 'keymap (let ((map (make-sparse-keymap)) > (fun `(lambda () > (interactive) > (Buffer-menu-sort ,column)))) > (define-key map [header-line mouse-1] fun) > ...)) > > When you bind a function to a key, you can't specify any additional > arguments to pass to that function. So you have to define one > function for each of the possible values of `column' in the code. > > The only way I can think of to get around this is to bind to a single > function that tries to re-construct the value of `column' based on > where the mouse was clicked. But that seems like a strange thing to > do -- you're throwing away information that you had (i.e., the value > of `column'), only to do a lot of work find out what it was later on. There must be some kind of misunderstanding here. I understand that you need to know where the mouse was clicked, but that information is stored in the mouse event that invokes the function, so if you use `(interactive "e")', you will have access to that information inside the function. Given this, what information is thrown away?