Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jul 2003 20:04:52 +0200
From:      "Fredrik =?iso-8859-1?Q?Carl=E9n?=" <baterista@arrhythmetic.net>
To:        freebsd-questions@freebsd.org
Subject:   Off-topic Emacs question
Message-ID:  <WorldClient-F200307222004.AA04520296@arrhythmetic.net>

next in thread | raw e-mail | index | archive | help
I know, this is non-specific to FreeBSD, but I have learned to love you 
all on this list, and this should be an easy nut to crack (as we say 
idiomatically at least here in Sweden...):

I want to define key bindings for the function sgml-tag
like this
(global-set-key "\C-t" 'sgml-tag)

But I don't want it to be interactive: For speedy markup, I would like to 
be able to do something like 
(sgml-tag "head" -1)

...but I need to do it when defining a key binding, something like this I 
thought, but Emacs tells me "No":
(global-set-key "\C-t" (sgml-tag "head" -1))

Isn't it possible to bind complete function calls to keys? It must be...

The doc for global-set-key only says
-------------------------------------------------
global-set-key is an interactive compiled Lisp function in `subr'.
(global-set-key KEY COMMAND)

Give KEY a global binding as COMMAND.
COMMAND is the command definition to use; usually it is
a symbol naming an interactively-callable function.
[...]
-------------------------------------------------

Notice the word "usually"?

As you might have guessed, I'm not exactly a brilliant LISP 
programmer...YET!

If anyone at all *wants* to help me, thank you! 

/Fredrik



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?WorldClient-F200307222004.AA04520296>