help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: simple editor required


From: Paul Edwards
Subject: Re: simple editor required
Date: Mon, 16 Jun 2003 10:31:19 GMT

"Kai Großjohann" <address@hidden> wrote in message news:address@hidden
> >> > (global-set-key (kbd "DEL") 'delete-char)
> >> > (global-set-key (kbd "DEL") (kbd "C-d"))
> >>
> >> What does it mean to not work?  Does Emacs crash?
> >
> > No, it just has no effect.  The DEL key remains bound to
> > delete-backward-char and keeps trying to delete the previous
> > character.
>
> Gah?  How can this be?  I mean, C-h l tells that the key in question
> is the DEL key.  Hm.
>
> Is the statement really executed?  Try putting (message "Hi there")
> (sit-for 3) before and after the statement to see if Emacs ever gets
> there.

Yes it does.

> Also try M-: to eval the statement from a running Emacs, to
> see if that has any effect.

just says "delete-char" doesn't do anything

> Hm.  Oh!  It could be that the key is not bound in the global map,
> but instead in some local map, instead.  Try C-x b foo RET, which
> creates a buffer named foo in fundamental mode.  Maybe the DEL key
> works in that mode?

created buffer, but no effect.

from another post...
>>>>(add-hook 'c-common-mode-hook
>>>>  (lambda () (local-set-key "\C-?" 'delete-char)))

had no effect when editting .c file.

> I think that emacs-lisp-mode or lisp-interaction-mode have their own
> bindings for DEL, so you'd have to do like
>
> (define-key emacs-lisp-mode-map (kbd "DEL") 'delete-char)

AND THE WINNER IS!!!  :-)

Thanks a lot for figuring that out Kai.

And since I now use text mode for everything, all I need is...
(define-key text-mode-map (kbd "DEL") 'delete-char)

and it works!

For technical curiosity though, why was everyone convinced
the global-set-key would work?  And indeed it did work on
Xemacs.  I would have thought this situation would have
come up all the time for the presumably large number of
people who want that behaviour of DEL doing a delete-char.

I'll now go back and check the relatively minor problems I
have within text mode.

BFN.  Paul.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]