Thread View: gnu.emacs.help
7 messages
7 total messages
Started by Peter Clark
Wed, 06 Jan 1993 19:46
Remapping DEL key on a SUN4
Author: Peter Clark
Date: Wed, 06 Jan 1993 19:46
Date: Wed, 06 Jan 1993 19:46
20 lines
981 bytes
981 bytes
Hi all, I am using emacs 18.58 on a SUN 4 (Sparc 1) with a type 4 keyboard. I would like to remap the DEL key on the keypad from delete-backward-char to delete-char. I have tried in my .emacs (global-set-key "DEL" 'delete-char) (global-set-key "\DEL" 'delete-char) etc. to no avail. I did notice that I could do a M-x local-set-key DEL delete-char while running emacs and this worked OK. I've looked in the FAQ, I've tried everything, please help explain this!!! Thanks for all hints and pointers! Cheers, Peter Clark pedro@eerc.berkeley.edu
Re: Remapping DEL key on a SUN4
Author: Ethan Bradford
Date: Wed, 06 Jan 1993 16:36
Date: Wed, 06 Jan 1993 16:36
32 lines
1708 bytes
1708 bytes
In article <1ifcu5INNmn5@agate.berkeley.edu> pedro@eerc.berkeley.edu (Peter Clark) writes: Hi all, I am using emacs 18.58 on a SUN 4 (Sparc 1) with a type 4 keyboard. I would like to remap the DEL key on the keypad from delete-backward-char to delete-char. I have tried in my .emacs (global-set-key "DEL" 'delete-char) (global-set-key "\DEL" 'delete-char) etc. to no avail. To insert the delete key between the quotes, move there and type C-Q <DEL> (were by <DEL> I mean pressing the DEL key). I did notice that I could do a M-x local-set-key DEL delete-char while running emacs and this worked OK. After you successfully do a command with M-X, if you want to copy that command into your .emacs file, do C-X <ESC> (which is repeat-complex-command). This throws you into the minibuffer with a lisp version of your last command. Copy the line into the kill buffer (e.g. with C-A C-K ) and exit the minibuffer with C-G. Now you can paste the command into your .emacs file. -- Ethan
Re: Remapping DEL key on a SUN4
Author: Kevin Gallagher
Date: Thu, 07 Jan 1993 07:26
Date: Thu, 07 Jan 1993 07:26
37 lines
2254 bytes
2254 bytes
In article <ETHANB.93Jan6163624@ptolemy.astro.washington.edu> ethanb@ptolemy.astro.washington.edu (Ethan Bradford) writes: >In article <1ifcu5INNmn5@agate.berkeley.edu> pedro@eerc.berkeley.edu (Peter Clark) writes: > I am using emacs 18.58 on a SUN 4 (Sparc 1) with a type 4 keyboard. > > I would like to remap the DEL key on the keypad from delete-backward-char > to delete-char. I have tried in my .emacs > (global-set-key "DEL" 'delete-char) > (global-set-key "\DEL" 'delete-char) > etc. to no avail. > >To insert the delete key between the quotes, move there and type > C-Q <DEL> >(were by <DEL> I mean pressing the DEL key). Using "\C-?" should also work. C-? is fairly standard notation for the DEL character. However, this will not solve your problem, because most major modes redefine the binding of the DEL character one of the variations of delete-backward-char, like backward-delete-char-untabify, in the major mode local map, which overrides the global map. > I did notice that I could do a > M-x local-set-key DEL delete-char > while running emacs and this worked OK. Which changed the binding in the active buffer at the time you executed the local-set-key function. Other buffers were not affected. To change the binding in major modes that you use, you will have to use the setup hook for each major mode and assign the hook to a function which executes the local-set-key function to change the binding of DEL. -- ---------------------------------------------------------------------------- Kevin Gallagher kgallagh@digi.lonestar.org OR ...!uunet!digi!kgallagh DSC Communications Corporation Addr: MS 152, 1000 Coit Rd, Plano, TX 75075 ----------------------------------------------------------------------------
Re: Remapping DEL key on a SUN4
Author: Edward S. Hirgelt
Date: Thu, 07 Jan 1993 17:50
Date: Thu, 07 Jan 1993 17:50
23 lines
1124 bytes
1124 bytes
On 6 Jan 1993 19:46:13 GMT, pedro@eerc.berkeley.edu (Peter Clark) said: Peter> I would like to remap the DEL key on the keypad from Peter> delete-backward-char to delete-char. I have tried in my .emacs Peter> (global-set-key "DEL" 'delete-char) Peter> (global-set-key "\DEL" 'delete-char) Try (global-set-key "\C-?" 'delete-char) \C-? is translated to delete in quoted strings. Alternatively you can use ^Q (quoted-insert) to but the real delete into the string. Hope this helps, Ed -- Ex vitio alterius |Ed Hirgelt |esh@tss.com sapiens emendat suum. |Teknekron Software Systems, Inc| (Publilius Syrus) |Palo Alto, Ca. |
Re: Remapping DEL key on a SUN4
Author: Matthew J Brown
Date: Sun, 10 Jan 1993 13:35
Date: Sun, 10 Jan 1993 13:35
63 lines
3044 bytes
3044 bytes
In article <1ifcu5INNmn5@agate.berkeley.edu> pedro@eerc.berkeley.edu (Peter Clark) writes: > Hi all, > I am using emacs 18.58 on a SUN 4 (Sparc 1) with a type 4 keyboard. > I would like to remap the DEL key on the keypad from delete-backward-char > to delete-char. I have tried in my .emacs > (global-set-key "DEL" 'delete-char) > (global-set-key "\DEL" 'delete-char) > etc. to no avail. > I did notice that I could do a > M-x local-set-key DEL delete-char > while running emacs and this worked OK. > I've looked in the FAQ, I've tried everything, please help explain this!!! > Thanks for all hints and pointers! I assume you mean the "."/DEL key on the keypad, and you're running EMACS under X. From what you write I assume that this keycode is mapped to the keysym "Delete" at the moment, to do the same as the normal "Delete" key. What you're going to have to do, is to modify the X keymapping of this key with 'xmodmap'. Now, Emacs can understand both normal ASCII keys, and function keys, for which an escape sequence is sent to the rest of EMACS. EMACS does not understand 'symbol' keys (at least, I haven't found out how), so, to get EMACS to distinguish this key, you're going to have to map it to a function key. Choose a function key which is not mapped - X function keys range between F1 and F36. Map this to the keycode generated by the keypad 'del' key - this is 57 on a sun type 5, I believe it is the same on a type 4. You can use 'xev' to find out. Type the following at a UNIX prompt: % xmodmap -e 'keycode 57 = F35' (substitute the correct keycode number and function key) Now to bind the key. Firstly, make a sparse keymap and bind it to the function key escape sequence, esc [. (setq fnkey-map (make-sparse-keymap)) (define-key esc-map "[" fnkey-map) Now you can bind functions to the various escape sequences. We're using F35 here as delete, you can also use this technique to bind things to other function keys. You can use C-q to find out what different function keys send. (define-key fnkey-map "222z" 'delete-char) That's all there is to it. Hope this answers your question properly. -Matt -- | Matthew J. Brown | Dept. of Computing | If God intended for us to go to | | mjb@doc.ic.ac.uk | Imperial College, | lectures He wouldn't have created | | mjb02@cc.ic.ac.uk | 180 Queen's Gate | double-sided photocopiers. | | Morven on Lambda | LONDON SW7 2AZ | -IC RagMag 1991/92 |
Re: Remapping DEL key on a SUN4
Author: Olle Sundblad
Date: Thu, 21 Jan 1993 16:08
Date: Thu, 21 Jan 1993 16:08
39 lines
1971 bytes
1971 bytes
In article <1ifcu5INNmn5@agate.berkeley.edu>, pedro@eerc.berkeley.edu (Peter Clark) writes: |> Hi all, |> |> I am using emacs 18.58 on a SUN 4 (Sparc 1) with a type 4 keyboard. |> |> I would like to remap the DEL key on the keypad from delete-backward-char |> to delete-char. I have tried in my .emacs |> (global-set-key "DEL" 'delete-char) |> (global-set-key "\DEL" 'delete-char) |> etc. to no avail. |> |> I did notice that I could do a |> M-x local-set-key DEL delete-char |> while running emacs and this worked OK. |> |> I've looked in the FAQ, I've tried everything, please help explain this!!! |> |> Thanks for all hints and pointers! |> |> Cheers, Peter Clark |> pedro@eerc.berkeley.edu If I understand you right, you want: Delete to delete the character you stand on, and Backspace to delete the previous character? Well I also use a type 4 keyboard and if you use for example xev to check the code which the keyboard returns you'll see that they are the same for Bakspace and Delete so effectively it is only one key with two buttons. And thus they can`t work as two different buttons. But if you`ve found a way to separate them please mail me. -- ------------------------------------------------------------------- Who messed with my anti-paranoia shot? ------------------------------------------------------------------- Olle Sundblad d90-osu@nada.kth.se Student at the Royal Institute of Technology, Stockholm, Sweden Department of Computer Science
Re: Remapping DEL key on a SUN4
Author: Mark Chen
Date: Thu, 21 Jan 1993 19:30
Date: Thu, 21 Jan 1993 19:30
36 lines
1545 bytes
1545 bytes
In article <1ifcu5INNmn5@agate.berkeley.edu>, pedro@eerc.berkeley.edu (Peter Clark) writes: |> Hi all, |> |> I am using emacs 18.58 on a SUN 4 (Sparc 1) with a type 4 keyboard. |> |> I would like to remap the DEL key on the keypad from delete-backward-char |> to delete-char. I have tried in my .emacs |> (global-set-key "DEL" 'delete-char) |> (global-set-key "\DEL" 'delete-char) |> etc. to no avail. |> |> I did notice that I could do a |> M-x local-set-key DEL delete-char |> while running emacs and this worked OK. |> |> I've looked in the FAQ, I've tried everything, please help explain this!!! |> |> Thanks for all hints and pointers! |> |> Cheers, Peter Clark |> pedro@eerc.berkeley.edu The reason global-set-key doesn't work is that your DEL key (\C-?) is overridden locally by each of the modes. If you want to change it, you have to do it with mode hooks. For example: (defun reset-del () (local-set-key "\C-?" 'delete-char)) (setq text-mode-hook 'reset-del) ----- Mark Chen mchen@ssf-sys.DHL.COM
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads