[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: global-set-key with parameter
From: |
Barry Margolin |
Subject: |
Re: global-set-key with parameter |
Date: |
Thu, 09 Oct 2008 02:40:51 -0400 |
User-agent: |
MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) |
In article <mailman.652.1223525988.25473.help-gnu-emacs@gnu.org>,
Fred Picher <frederificc@yahoo.ca> wrote:
> Hello all,
>
> I would like to bind the following function and parameter to the F5
> key in emacs 23, which is currently undefined. This is to save the
> buffer layout to be recalled using the lowercase 'w' key:
>
> C-x r w w
>
> That would be the window-configuration-to-register command I
> think. I could do something like:
>
> (global-set-key [f5] 'window-configuration-to-register)
>
> But how is the 'w' parameter passed to this command ?
You need to write a new Elisp function that calls
window-configuration-to-register with the parameter, and bind the key to
THAT function.
(defun window-config-to-register-w ()
"Store the window configuration in register 'w'."
(interactive)
(window-configuration-to-register ?w))
(global-set-key [f5] 'window-configuration-to-register-w)
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***