all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: 26.1 emacs-mac 7.2; map key to interactive lisp function (command) with an argument
Date: Sun, 21 Oct 2018 15:26:08 +0300	[thread overview]
Message-ID: <83pnw3trj3.fsf@gnu.org> (raw)
In-Reply-To: <50DFDFDA-C01D-49AA-97FB-30DF4DE9BB46@scratch.space> (message from Van L on Sun, 21 Oct 2018 15:18:39 +1100)

> From: Van L <van@scratch.space>
> Date: Sun, 21 Oct 2018 15:18:39 +1100
> 
> I am unable to have the following work.

The problem is your global-set-key forms: the general form is

  (global-set-key KEY COMMAND)

where COMMAND is a _symbol_, like this:

  (global-set-key (kbd "C-c o") 'foo)

So you need to define an interactive function named SOMETHING:

  (defun SOMETHING (...)
    (interactive)
    ...)

then bind it to a key:

  (global-set-key (kbd "C-c o") 'SOMETHING)

> The elisp documentation has for me the problem of tl;dr and after experimenting with a few paragraphs and failing I want to ask how to get this done. I wonder sometimes if the documentation is obtuse by design to steal time.

Please tell which part of the documentation confused you.  The doc
string of global-set-key says:

  COMMAND is the command definition to use; usually it is
  a symbol naming an interactively-callable function.

IOW, it usually should be a symbol, whereas in your example it is a
list that calls a function.



  reply	other threads:[~2018-10-21 12:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-21  4:18 26.1 emacs-mac 7.2; map key to interactive lisp function (command) with an argument Van L
2018-10-21 12:26 ` Eli Zaretskii [this message]
2018-10-21 20:33 ` Michael Heerdegen
2018-10-21 23:00   ` Van L
2018-10-22  6:25     ` Eli Zaretskii
2018-10-22 21:55       ` Van L

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=83pnw3trj3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --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.