unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs reads both DEL and Backspace as DEL
@ 2003-01-23 16:29 Ivan A. Uemlianin
  2003-01-23 20:24 ` Greg Hill
  0 siblings, 1 reply; 8+ messages in thread
From: Ivan A. Uemlianin @ 2003-01-23 16:29 UTC (permalink / raw)


Dear All

I'm running GNU emacs 20.7 on Debian GNU/Linux 3.0

I'm just in the process of writin ga little ~/.emacs file.  I haven't 
been able to find the system default init file (not in /usr/share/emacs 
or /etc/default), but I wanted to have some different settings.

One change I wanted was to have the '<X|' key (Backspace?) as 
delete-backward-char and 'Delete' (DEL) as delete-char.  However, my 
emacs reads both of these keys as DEL (detectable with M-x describe-key).

Virtual consoles and other apps treat the keys differently, so I know 
the issue is with emacs (and not eg the keyboard).

Does anyone have any clues as to what's happening, and what I can do to 
change it?

Thanks

Ivan


-- 

==== ==== ==== ==== ====

Ivan A. Uemlianin, PhD

Research & Development
Jura Technology Ltd

mailto:ivan@jurakm.com
http://www.jurakm.com

==== ==== ==== ==== ====

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

* Re: Emacs reads both DEL and Backspace as DEL
  2003-01-23 16:29 Emacs reads both DEL and Backspace as DEL Ivan A. Uemlianin
@ 2003-01-23 20:24 ` Greg Hill
  2003-02-02 20:44   ` Roberto Huelga
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Hill @ 2003-01-23 20:24 UTC (permalink / raw)


At 4:29 PM +0000 1/23/03, Ivan A. Uemlianin wrote:
>Dear All
>
>I'm running GNU emacs 20.7 on Debian GNU/Linux 3.0
>
>I'm just in the process of writin ga little ~/.emacs file.  I 
>haven't been able to find the system default init file (not in 
>/usr/share/emacs or /etc/default), but I wanted to have some 
>different settings.
>
>One change I wanted was to have the '<X|' key (Backspace?) as 
>delete-backward-char and 'Delete' (DEL) as delete-char.  However, my 
>emacs reads both of these keys as DEL (detectable with M-x 
>describe-key).
>
>Virtual consoles and other apps treat the keys differently, so I 
>know the issue is with emacs (and not eg the keyboard).
>
>Does anyone have any clues as to what's happening, and what I can do 
>to change it?

On my platform, (Unix, on a Sun, using eXodus on a MAC (OS-9) as my 
terminal), I have to put the following into my shell login script:

   xmodmap -e "keycode 188 = BackSpace"

I used a program called xev to find out what the keycode was (188) 
for the key that I wanted to use as BackSpace.  If I didn't use 
xmodmap to change it, it was assigned the same keysym, "Delete", as 
the key I use for delete-char, whose keycode is 48.

I also have the following in my .emacs:

   (global-set-key [delete] 'delete-char)

after which describe-key starts identifying that key (keycode = 48) 
as "delete" instead of "DEL", although it continues to identify the 
other 'delete' key (keycode=188) as "DEL".

I also tried globally binding [backspace] to 'delete-backward-char, 
after which describe-key started indentifying the  188-key as 
"backspace" instead of as "DEL".  But that had the undesirable 
side-effect of interfering with the automatic re-binding of that key 
for certain major modes; so I just don't rebind [backspace] and 
everything works the way I like.

Due to differences in our platforms, the details may be a bit 
different for you.  But perhaps this will help you figure out what 
you need to do.

Good luck.

--Greg

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

* Re: Emacs reads both DEL and Backspace as DEL
       [not found] <mailman.874.1043340417.21513.help-gnu-emacs@gnu.org>
@ 2003-01-24 12:38 ` Kai Großjohann
  2003-01-24 16:42   ` Ivan Uemlianin
       [not found]   ` <mailman.931.1043427548.21513.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Kai Großjohann @ 2003-01-24 12:38 UTC (permalink / raw)


"Ivan A. Uemlianin" <ivan@jurakm.com> writes:

> One change I wanted was to have the '<X|' key (Backspace?) as
> delete-backward-char and 'Delete' (DEL) as delete-char.  However, my
> emacs reads both of these keys as DEL (detectable with M-x
> describe-key).

Are you running under a window system?  Under a window system, C-h c
and C-h l probably say different things about the keys.

You need to hit C-h c first, then the key, but for C-h l you have to
hit the key first, then C-h l.

Maybe (global-set-key (kbd "<delete>") 'delete-char) works.
-- 
Ambibibentists unite!

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

* Re: Emacs reads both DEL and Backspace as DEL
  2003-01-24 12:38 ` Kai Großjohann
@ 2003-01-24 16:42   ` Ivan Uemlianin
       [not found]   ` <mailman.931.1043427548.21513.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Ivan Uemlianin @ 2003-01-24 16:42 UTC (permalink / raw)


Kai Großjohann wrote:
> "Ivan A. Uemlianin" <ivan@jurakm.com> writes:
> 
> 
>>One change I wanted was to have the '<X|' key (Backspace?) as
>>delete-backward-char and 'Delete' (DEL) as delete-char.  However, my
>>emacs reads both of these keys as DEL (detectable with M-x
>>describe-key).
> 
> 
> Are you running under a window system?  Under a window system, C-h c
> and C-h l probably say different things about the keys.
> 
> You need to hit C-h c first, then the key, but for C-h l you have to
> hit the key first, then C-h l.
> 
> Maybe (global-set-key (kbd "<delete>") 'delete-char) works.

This works perfectly!  Thank you very much!

Ivan

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

* Re: Emacs reads both DEL and Backspace as DEL
       [not found]   ` <mailman.931.1043427548.21513.help-gnu-emacs@gnu.org>
@ 2003-01-28  1:18     ` Dan Kalikow
  2003-01-28  6:23       ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Kalikow @ 2003-01-28  1:18 UTC (permalink / raw)


Since we seem to be solving key-binding problems here... :-)  I'm running Gnu Emacs (I think 21.3.50, the Cocoa version?) on Mac OSX 10.2.3 on a TI-PowerBook.  

My problem is related but (I think) different.  My kbd doesn't have two flavors of DEL -- only one DEL key.  Most non-Emacs apps on the laptop run "delete-previous-char" for DEL and "delete-next-char" for hold-down-Function-key-and-then-press-DEL.  This is an OK price to pay for a laptop keyboard, IMHO.  However if I run m-X describe-key for DEL, Emacs says 
====
DEL runs the command View-scroll-page-backward
   which is an interactive compiled Lisp function in `view'.
It is bound to DEL.
(View-scroll-page-backward &optional LINES)

Scroll "page size" or prefix LINES lines backward in View mode.
See also `View-scroll-page-forward'.
=====

for m-X describe-key for Function-DEL, Emacs says 

=====
DEL (translated from <kp-delete>) runs the command View-scroll-page-backward
   which is an interactive compiled Lisp function in `view'.
It is bound to DEL.
(View-scroll-page-backward &optional LINES)

Scroll "page size" or prefix LINES lines backward in View mode.
See also `View-scroll-page-forward'.
=====

to these unpracticed eyes, Emacs appears to think they're virtually the same.  Any ideas (or pointers to ideas) on what I should put in my .emacs file to tease apart forward- from backward-delete functions?  TIA for any advice. 

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

* Re: Emacs reads both DEL and Backspace as DEL
  2003-01-28  1:18     ` Dan Kalikow
@ 2003-01-28  6:23       ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2003-01-28  6:23 UTC (permalink / raw)


> From: Dan Kalikow <DrDan@Kalikow.com>
> Newsgroups: gnu.emacs.help
> Date: 28 Jan 2003 01:18:30 GMT
> 
> DEL runs the command View-scroll-page-backward
>    which is an interactive compiled Lisp function in `view'.
> =====
> DEL (translated from <kp-delete>) runs the command View-scroll-page-backward
>    which is an interactive compiled Lisp function in `view'.

Does the following help you have what you want?

     (define-key function-key-map [kp-delete] "\C-d")

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

* Re: Emacs reads both DEL and Backspace as DEL
  2003-01-23 20:24 ` Greg Hill
@ 2003-02-02 20:44   ` Roberto Huelga
  0 siblings, 0 replies; 8+ messages in thread
From: Roberto Huelga @ 2003-02-02 20:44 UTC (permalink / raw)


I'm a Mac OS X User and inserting the following line in the .emacs file 
backspace and del start to work properly

	(normal-erase-is-backspace-mode 1)

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

* Re: Emacs reads both DEL and Backspace as DEL
       [not found] <mailman.1323.1044218808.21513.help-gnu-emacs@gnu.org>
@ 2003-02-03 16:05 ` Stefan Monnier <foo@acm.com>
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2003-02-03 16:05 UTC (permalink / raw)


>>>>> "Roberto" == Roberto Huelga <rhuelga@multinterior.com> writes:
> I'm a Mac OS X User and inserting the following line in the .emacs file
> backspace and del start to work properly
> 	(normal-erase-is-backspace-mode 1)

Could you describe what you mean by "work properly" ?
Also describe why you think this is "proper".


        Stefan

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

end of thread, other threads:[~2003-02-03 16:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-23 16:29 Emacs reads both DEL and Backspace as DEL Ivan A. Uemlianin
2003-01-23 20:24 ` Greg Hill
2003-02-02 20:44   ` Roberto Huelga
     [not found] <mailman.874.1043340417.21513.help-gnu-emacs@gnu.org>
2003-01-24 12:38 ` Kai Großjohann
2003-01-24 16:42   ` Ivan Uemlianin
     [not found]   ` <mailman.931.1043427548.21513.help-gnu-emacs@gnu.org>
2003-01-28  1:18     ` Dan Kalikow
2003-01-28  6:23       ` Eli Zaretskii
     [not found] <mailman.1323.1044218808.21513.help-gnu-emacs@gnu.org>
2003-02-03 16:05 ` Stefan Monnier <foo@acm.com>

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).