unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Problems with global-set-key
@ 2005-04-22  9:18 JS
  2005-04-22  9:33 ` Peter Dyballa
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: JS @ 2005-04-22  9:18 UTC (permalink / raw)


In my .emacs file I have made this:

(global-set-key "\C-z" 'shell)

And it works fine when I restart emacs.




But when I do this:

(global-set-key "\M-a" 'comment-dwim)

I get this error when I restart:




An error has occurred while loading `/home/johs/.emacs':

Symbol's function definition is void: global-set-key 

To ensure normal operation, you should investigate the cause
of the error in your initialization file and remove it.  Start
Emacs with the `--debug-init' option to view a complete error
backtrace
Loading view...done

------------------------

I have then tried to start emacs like this: emacs --debug-init and then I
get this:

Debugger entered--Lisp error: (void-function global-set-key )
  (global-set-key  "á"   (quote comment-dwim))
  eval-buffer(#<buffer  *load*> nil "~/.emacs" nil t)
  load-with-code-conversion("/home/johs/.emacs" "~/.emacs" t t)
  load("~/.emacs" t t)
  #[nil " …—
----------------------------


Why is it not possible to write the second statement? 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problems with global-set-key
  2005-04-22  9:18 Problems with global-set-key JS
@ 2005-04-22  9:33 ` Peter Dyballa
       [not found] ` <mailman.2557.1114162497.2895.help-gnu-emacs@gnu.org>
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Peter Dyballa @ 2005-04-22  9:33 UTC (permalink / raw)



Am 22.04.2005 um 11:18 schrieb JS:

> (global-set-key "\M-a" 'comment-dwim)
>

Have you tried without backslash? This one works for me for Emacsen 
2[012]:
	(global-set-key [M-f1]               'replace-string)

--
Greetings

   Pete

Know thyself.  Need help, call CIA.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problems with global-set-key
       [not found] ` <mailman.2557.1114162497.2895.help-gnu-emacs@gnu.org>
@ 2005-04-22  9:57   ` JS
  2005-04-22 10:54     ` Peter Dyballa
       [not found]     ` <mailman.2582.1114167378.2895.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: JS @ 2005-04-22  9:57 UTC (permalink / raw)


Peter Dyballa wrote:

> 
> Am 22.04.2005 um 11:18 schrieb JS:
> 
>> (global-set-key "\M-a" 'comment-dwim)
>>
> 
> Have you tried without backslash? This one works for me for Emacsen
> 2[012]:
> (global-set-key [M-f1]               'replace-string)
> 
> --
> Greetings
> 
>    Pete
> 
> Know thyself.  Need help, call CIA.

I just tried:

(global-set-key [M-a] 'comment-dwim)

That gives the same error as before.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problems with global-set-key
  2005-04-22  9:18 Problems with global-set-key JS
  2005-04-22  9:33 ` Peter Dyballa
       [not found] ` <mailman.2557.1114162497.2895.help-gnu-emacs@gnu.org>
@ 2005-04-22 10:31 ` Tim X
  2005-04-22 13:34 ` Barry Margolin
  3 siblings, 0 replies; 7+ messages in thread
From: Tim X @ 2005-04-22 10:31 UTC (permalink / raw)


JS <d44sf@44ada.com> writes:

> In my .emacs file I have made this:
>
> (global-set-key "\C-z" 'shell)
>
> And it works fine when I restart emacs.
>
>
>
>
> But when I do this:
>
> (global-set-key "\M-a" 'comment-dwim)
>
> I get this error when I restart:
>
>
>
>
> An error has occurred while loading `/home/johs/.emacs':
>
> Symbol's function definition is void: global-set-key 
>
> ------------------------
>
> I have then tried to start emacs like this: emacs --debug-init and then I
> get this:
>
> Debugger entered--Lisp error: (void-function global-set-key )
>   (global-set-key  "á"   (quote comment-dwim))
>   eval-buffer(#<buffer  *load*> nil "~/.emacs" nil t)
>   load-with-code-conversion("/home/johs/.emacs" "~/.emacs" t t)
>   load("~/.emacs" t t)
>   #[nil " —
> ----------------------------
Can you execute the command witin *scratch*?

If so, maybe you need to do a (require 'newcomment) to make sure the
definition for cmment-dwim is loaded before the key binding is used?


Tim

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problems with global-set-key
  2005-04-22  9:57   ` JS
@ 2005-04-22 10:54     ` Peter Dyballa
       [not found]     ` <mailman.2582.1114167378.2895.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 7+ messages in thread
From: Peter Dyballa @ 2005-04-22 10:54 UTC (permalink / raw)



Am 22.04.2005 um 11:57 schrieb JS:

> (global-set-key [M-a] 'comment-dwim)

How's that: (global-set-key [(meta a)] 'comment-dwim)

--
Greetings

   Pete

Remember: use logout to logout.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problems with global-set-key
       [not found]     ` <mailman.2582.1114167378.2895.help-gnu-emacs@gnu.org>
@ 2005-04-22 11:07       ` JS
  0 siblings, 0 replies; 7+ messages in thread
From: JS @ 2005-04-22 11:07 UTC (permalink / raw)


Peter Dyballa wrote:

> 
> Am 22.04.2005 um 11:57 schrieb JS:
> 
>> (global-set-key [M-a] 'comment-dwim)
> 
> How's that: (global-set-key [(meta a)] 'comment-dwim)


That did it!! Thanks, wierd that I have to do it like this when the standard
is just:
(global-set-key "\M-a" 'comment-dwim)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problems with global-set-key
  2005-04-22  9:18 Problems with global-set-key JS
                   ` (2 preceding siblings ...)
  2005-04-22 10:31 ` Tim X
@ 2005-04-22 13:34 ` Barry Margolin
  3 siblings, 0 replies; 7+ messages in thread
From: Barry Margolin @ 2005-04-22 13:34 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]

In article <d4afei$a6u$1@news.net.uni-c.dk>, JS <d44sf@44ada.com> 
wrote:

> In my .emacs file I have made this:
> 
> (global-set-key "\C-z" 'shell)
> 
> And it works fine when I restart emacs.
> 
> 
> 
> 
> But when I do this:
> 
> (global-set-key "\M-a" 'comment-dwim)
> 
> I get this error when I restart:
> 
> 
> 
> 
> An error has occurred while loading `/home/johs/.emacs':
> 
> Symbol's function definition is void: global-set-key 
> 
> To ensure normal operation, you should investigate the cause
> of the error in your initialization file and remove it.  Start
> Emacs with the `--debug-init' option to view a complete error
> backtrace
> Loading view...done
> 
> ------------------------
> 
> I have then tried to start emacs like this: emacs --debug-init and then I
> get this:
> 
> Debugger entered--Lisp error: (void-function global-set-key )

It looks to me like there's a strange character in your file after 
'global-set-key', so it's trying to find a function named 
global-set-key<strangechar>.  Notice the space before the close-paren -- 
that's not normal.  Normally Emacs Lisp will escape space characters in 
symbol names, so I suspect it's an international character that happens 
to look like space.

>   (global-set-key  "á"   (quote comment-dwim))
>   eval-buffer(#<buffer  *load*> nil "~/.emacs" nil t)
>   load-with-code-conversion("/home/johs/.emacs" "~/.emacs" t t)
>   load("~/.emacs" t t)
>   #[nil " …—
> ----------------------------
> 
> 
> Why is it not possible to write the second statement?

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-04-22 13:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-22  9:18 Problems with global-set-key JS
2005-04-22  9:33 ` Peter Dyballa
     [not found] ` <mailman.2557.1114162497.2895.help-gnu-emacs@gnu.org>
2005-04-22  9:57   ` JS
2005-04-22 10:54     ` Peter Dyballa
     [not found]     ` <mailman.2582.1114167378.2895.help-gnu-emacs@gnu.org>
2005-04-22 11:07       ` JS
2005-04-22 10:31 ` Tim X
2005-04-22 13:34 ` Barry Margolin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).