all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Problems with keybindings for functions with arguments
Date: Fri, 08 Mar 2013 17:04:45 +0100	[thread overview]
Message-ID: <87boatyj1e.fsf@gmail.com> (raw)
In-Reply-To: 9B7AA49C628B4703A5931FB17A73DE30@us.oracle.com

"Drew Adams" <drew.adams@oracle.com> 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




  reply	other threads:[~2013-03-08 16:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08 14:01 Problems with keybindings for functions with arguments Thorsten Jolitz
2013-03-08 14:20 ` Jambunathan K
2013-03-08 14:56   ` Thorsten Jolitz
2013-03-08 15:03 ` Drew Adams
2013-03-08 16:04   ` Thorsten Jolitz [this message]
2013-03-08 16:17 ` Nicolas Richard
2013-03-08 22:26   ` Nicolas Richard
     [not found] <mailman.21680.1362751341.855.help-gnu-emacs@gnu.org>
2013-03-08 18:39 ` Joost Kremers
2013-03-09 13:35   ` Thorsten Jolitz
     [not found]   ` <mailman.21759.1362836184.855.help-gnu-emacs@gnu.org>
2013-03-10 13:26     ` Joost Kremers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87boatyj1e.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.