From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: Problems with keybindings for functions with arguments Date: Fri, 08 Mar 2013 17:04:45 +0100 Message-ID: <87boatyj1e.fsf@gmail.com> References: <87k3pixa5p.fsf@gmail.com> <9B7AA49C628B4703A5931FB17A73DE30@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1362758722 18101 80.91.229.3 (8 Mar 2013 16:05:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Mar 2013 16:05:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 08 17:05:47 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UDznj-0000cL-BA for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Mar 2013 17:05:43 +0100 Original-Received: from localhost ([::1]:42713 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDznN-0004c2-DD for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Mar 2013 11:05:21 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDzn6-0004YT-Tn for help-gnu-emacs@gnu.org; Fri, 08 Mar 2013 11:05:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDzn1-0008Mc-S7 for help-gnu-emacs@gnu.org; Fri, 08 Mar 2013 11:05:04 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:36249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDzn1-0008Js-JL for help-gnu-emacs@gnu.org; Fri, 08 Mar 2013 11:04:59 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UDznJ-00006P-Bz for help-gnu-emacs@gnu.org; Fri, 08 Mar 2013 17:05:17 +0100 Original-Received: from g231235140.adsl.alicedsl.de ([92.231.235.140]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Mar 2013 17:05:17 +0100 Original-Received: from tjolitz by g231235140.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Mar 2013 17:05:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231235140.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:YRf6CvZgpZTwCzL7KVj71nEwFLY= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89421 Archived-At: "Drew Adams" writes: >> #### question 1 #### > There is no canonical way. What you did is fine and typical. If you want the > key/binding list to say what the command is then you need to give the command a > name. E.g., instead of: > > (lambda () (interactive) (navi-show-headers 4)) > > Use: > > (defun show-headers-4 () (interactive) (navi-show-headers 4)) Ok, then I already knew the existing possibilities and did not miss the somehow better solution I suspected to exist. >> #### question 2 #### > Not sure what the question is. But if you want to use a numeric prefix arg for > LEVEL, then do so: > > (defun navi-show-headers (level) > "Act conditional on LEVEL" > (interactive "p") > (do-stuff level)) I think I will use this now ,-------------------------------------------------------------- | (defun show-headers-4 () (interactive) (navi-show-headers 4)) `-------------------------------------------------------------- so that question 2 becomes more or less obsolete like you describe, just standard usage of 'interactive'. Thanks for the answer. -- cheers, Thorsten