emacs-devel
[Top][All Lists]
Advanced

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

Re: Blackbox key bindings.


From: Michael Cadilhac
Subject: Re: Blackbox key bindings.
Date: Mon, 24 Oct 2005 00:30:27 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

   (Sorry if this mail arrives twice)

Michael Cadilhac <address@hidden> writes:

>   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.
>
    Oops, I forgot about the fact that we use _move_-end-of-line.

    Sorry for the noise :-/

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 'move-end-of-line 'bb-eol)
!   (blackbox-redefine-key 'move-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 |

Attachment: pgpyb69KVJe7u.pgp
Description: PGP signature


reply via email to

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