all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* BACKSPACE in GNU-EMACS editor
@ 2005-02-09  0:07 new2linux
  2005-02-09 10:56 ` Peter Dyballa
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: new2linux @ 2005-02-09  0:07 UTC (permalink / raw)


Does anyone know the (global-set-key) def for utilizingthe backspace to
delete a go back 1 char and 1 word ?

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

* Re: BACKSPACE in GNU-EMACS editor
  2005-02-09  0:07 BACKSPACE in GNU-EMACS editor new2linux
@ 2005-02-09 10:56 ` Peter Dyballa
       [not found] ` <mailman.1496.1107948611.2841.help-gnu-emacs@gnu.org>
  2005-02-10 14:46 ` Stefan Monnier
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2005-02-09 10:56 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 09.02.2005 um 01:07 schrieb new2linux:

> Does anyone know the (global-set-key) def for utilizingthe backspace to
> delete a go back 1 char and 1 word ?

It might happen that your system cannot distinguish between C-d and 
Backspace, so you better first check what that keys is by entering C-h 
k and then pressing the backspace key. Use this name then for:

         (global-set-key [<NAME>]        'delete-backward-char)

Pressing Esc-backspace or M-backspace should automatically delete 
backward a whole word.

Pressing C-h b you'll see the keybindings in an extra *Help* buffer.
--
Greetings

   Pete

"I love deadlines. I love the whooshing noise they make as they go by" 
(Douglas Adams)

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

* Re: BACKSPACE in GNU-EMACS editor
       [not found] ` <mailman.1496.1107948611.2841.help-gnu-emacs@gnu.org>
@ 2005-02-09 21:50   ` new2linux
  2005-02-09 22:10     ` Peter Dyballa
  2005-02-10 14:49     ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: new2linux @ 2005-02-09 21:50 UTC (permalink / raw)


i got it working....how about the arrow keys on the keyboard
(up/down/right/left), do you have any samples ?

i tried this...but no luck:

(global-set-key [up] 'previous-line)
(global-set-key [down] 'next-line)
(global-set-key [right] 'forward-char)
(global-set-key [left] 'backward-char)

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

* Re: BACKSPACE in GNU-EMACS editor
  2005-02-09 21:50   ` new2linux
@ 2005-02-09 22:10     ` Peter Dyballa
  2005-02-10 14:49     ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2005-02-09 22:10 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 09.02.2005 um 22:50 schrieb new2linux:

> how about the arrow keys on the keyboard
> (up/down/right/left), do you have any samples ?

I have no samples, they're all in some Elisp files you can find using 
grep etc.

Before you can do any key bindings determine the symbols of the keys by 
checking them with C-h k! You could check too in which way they are 
changed by pressing modifiers like shift, control, meta, alt, super, 
hyper ...

--
Greetings

   Pete

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

* Re: BACKSPACE in GNU-EMACS editor
  2005-02-09  0:07 BACKSPACE in GNU-EMACS editor new2linux
  2005-02-09 10:56 ` Peter Dyballa
       [not found] ` <mailman.1496.1107948611.2841.help-gnu-emacs@gnu.org>
@ 2005-02-10 14:46 ` Stefan Monnier
  2 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2005-02-10 14:46 UTC (permalink / raw)


> Does anyone know the (global-set-key) def for utilizingthe backspace to
> delete a go back 1 char and 1 word ?

There's some grammar problem in your question, so I'm not sure I understand
it all, but in Emacs the backspace key (normally mapped to DEL aka C-?) is
already bound to delete-backward-char, so it seems like the problem is that
your Emacs does not properly recognize your backspace key.

Is this on a text terminal emulator, or is it in X11 mode, or in W32, ...?

What's the value of normal-erase-is-backspace ?
If it's t rather than nil, try M-x normal-erase-is-backspace-mode RET.

Otherwise, if you hit backspace and then C-h l what are the last elements
output by C-h l ?


        Stefan

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

* Re: BACKSPACE in GNU-EMACS editor
  2005-02-09 21:50   ` new2linux
  2005-02-09 22:10     ` Peter Dyballa
@ 2005-02-10 14:49     ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2005-02-10 14:49 UTC (permalink / raw)


> i got it working....how about the arrow keys on the keyboard
> (up/down/right/left), do you have any samples ?

> i tried this...but no luck:

> (global-set-key [up] 'previous-line)
> (global-set-key [down] 'next-line)
> (global-set-key [right] 'forward-char)
> (global-set-key [left] 'backward-char)

Note that both the backspace thingy you asked before and these cursor
motions are already the default behavior.

I.e. in your case the problem is not that Emacs's key bindings do not suit
you, but that for some reason Emacs does not properly recognize the keys
you're using.

In such a case `global-set-key' is not the right answer (although it can
work).  You want to use instead:

        (define-key function-key-map [foo] [bar])

where [foo] is the key-sequence that Emacs thinks he receives and [bar] is
the corrected key sequence.  Try to hit your `right' key and then do C-h
l to see what key-sequence Emacs received when you hit `right'.  If it says
something like ESC [ 0 ~, then try

        (define-key function-key-map "\e[0~" [right])


-- Stefan


PS: One of the differences between changing function-key-map and using
    global-set-key is that the former will also work when you use C-x right.

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

end of thread, other threads:[~2005-02-10 14:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-09  0:07 BACKSPACE in GNU-EMACS editor new2linux
2005-02-09 10:56 ` Peter Dyballa
     [not found] ` <mailman.1496.1107948611.2841.help-gnu-emacs@gnu.org>
2005-02-09 21:50   ` new2linux
2005-02-09 22:10     ` Peter Dyballa
2005-02-10 14:49     ` Stefan Monnier
2005-02-10 14:46 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.