[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Blackbox key bindings.
From: |
Michael Cadilhac |
Subject: |
Blackbox key bindings. |
Date: |
Sun, 23 Oct 2005 22:13:06 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Hi guys !
This mail is about blackbox, but I don't know if ESR is still
interested in maintaining such package, so he's not in the Cc ;-)
I use C-t for previous line (dvorak convenience), and as blackbox.el
bind only C-p, I'm often messed up with this game as the (bb-x) and
(bb-y) aren't computed rightly.
The attached patch should fix the issue.
Regards.
Index: lisp/play/blackbox.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/play/blackbox.el,v
retrieving revision 1.20
diff -c -r1.20 blackbox.el
*** lisp/play/blackbox.el 1 Aug 2005 15:30:16 -0000 1.20
--- lisp/play/blackbox.el 23 Oct 2005 20:02:34 -0000
***************
*** 89,111 ****
(defvar bb-balls-placed nil
"List of already placed balls.")
(unless blackbox-mode-map
(setq blackbox-mode-map (make-keymap))
(suppress-keymap blackbox-mode-map t)
! (define-key blackbox-mode-map "\C-f" 'bb-right)
! (define-key blackbox-mode-map [right] 'bb-right)
! (define-key blackbox-mode-map "\C-b" 'bb-left)
! (define-key blackbox-mode-map [left] 'bb-left)
! (define-key blackbox-mode-map "\C-p" 'bb-up)
! (define-key blackbox-mode-map [up] 'bb-up)
! (define-key blackbox-mode-map "\C-n" 'bb-down)
! (define-key blackbox-mode-map [down] 'bb-down)
! (define-key blackbox-mode-map "\C-e" 'bb-eol)
! (define-key blackbox-mode-map "\C-a" 'bb-bol)
(define-key blackbox-mode-map " " 'bb-romp)
(define-key blackbox-mode-map [insert] 'bb-romp)
! (define-key blackbox-mode-map "\C-m" 'bb-done)
! (define-key blackbox-mode-map [kp-enter] 'bb-done))
;; Blackbox mode is suitable only for specially formatted data.
(put 'blackbox-mode 'mode-class 'special)
--- 89,109 ----
(defvar bb-balls-placed nil
"List of already placed balls.")
+ (defun blackbox-redefine-key (oldfun newfun)
+ (define-key blackbox-mode-map (vector 'remap oldfun) newfun))
+
(unless blackbox-mode-map
(setq blackbox-mode-map (make-keymap))
(suppress-keymap blackbox-mode-map t)
! (blackbox-redefine-key 'backward-char 'bb-left)
! (blackbox-redefine-key 'forward-char 'bb-right)
! (blackbox-redefine-key 'previous-line 'bb-up)
! (blackbox-redefine-key 'next-line 'bb-down)
! (blackbox-redefine-key 'end-of-line 'bb-eol)
! (blackbox-redefine-key 'beginning-of-line 'bb-bol)
(define-key blackbox-mode-map " " 'bb-romp)
(define-key blackbox-mode-map [insert] 'bb-romp)
! (blackbox-redefine-key 'newline 'bb-done))
;; Blackbox mode is suitable only for specially formatted data.
(put 'blackbox-mode 'mode-class 'special)
--
Michael Cadilhac, a.k.a. Micha [mika] |
Epita/LRDE promo 2007 | Please note that you should
2 rue de la Convention | 08.70.65.13.14 | s/address@hidden/@/ my mail
address.
94270 Le Kremlin Bicetre | 06.23.20.31.30 |
pgpkFrO6Rcrl0.pgp
Description: PGP signature
- Blackbox key bindings.,
Michael Cadilhac <=