all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: torys.anderson@gmail.com (Tory S. Anderson),
	emacs list <help-gnu-emacs@gnu.org>
Subject: Re: Basic elisp question: bind key to function with arg
Date: Mon, 26 Jan 2015 01:16:15 +0200	[thread overview]
Message-ID: <54C5793F.7040800@yandex.ru> (raw)
In-Reply-To: <87d262ihel.fsf@gmail.com>

On 01/26/2015 01:12 AM, torys.anderson@gmail.com (Tory S. Anderson) wrote:
> I have the following in my emacs init, and it works fine:
>
>      (global-set-key [C-up] 'enlarge-window)
>      (global-set-key [C-down] (lambda () (interactive)
>                                 (enlarge-window -1)))
>
> But it seems awkward to me that I need to add all the extra just to pass a -1 arg to the function, so I'm suspecting there's a simpler way to write this. Any tips?

No, that's how you do it. Or you create a named function doing the same, 
and bind it instead.




  reply	other threads:[~2015-01-25 23:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-25 23:12 Basic elisp question: bind key to function with arg Tory S. Anderson
2015-01-25 23:16 ` Dmitry Gutov [this message]
2015-01-25 23:57   ` Marcin Borkowski

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=54C5793F.7040800@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=help-gnu-emacs@gnu.org \
    --cc=torys.anderson@gmail.com \
    /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.