[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Modal Keyboard Layout for EMACS
From: |
sergiusruiz |
Subject: |
Re: Modal Keyboard Layout for EMACS |
Date: |
Fri, 23 Nov 2012 04:55:19 -0800 (PST) |
User-agent: |
G2/1.0 |
Em quinta-feira, 22 de novembro de 2012 21h21min35s UTC-2, Stefan Monnier
escreveu:
> (defvar mvi-command-mode-map
> (let ((map (make-sparse-keymap)))
> (define-key map "h" 'backward-char)
> (define-key map "j" 'next-line)
> (define-key map "k" 'previous-line)
> (define-key map "l" 'forward-char)
> (define-key map "i" 'mvi-insert-mode)
> (define-key map "/" 'mvi-doubled-self-insert-key)
> map))
>
> (defun mvi-doubled-self-insert-key ()
> (interactive)
> (call-interactively 'self-insert-command)
> (mvi-insert-mode 1))
>
> (define-minor-mode mvi-command-mode
> "Minimalistic VI-like mode."
> :lighter " <N>"
> :global t
> (if mvi-command-mode (mvi-normal-mode -1))
>
> (defvar mvi-command-mode-map
> (let ((map (make-sparse-keymap)))
> (define-key map "\e" 'mvi-command-mode)
> (define-key map "/" 'mvi-command-mode)
> map))
>
> (define-minor-mode mvi-insert-mode
> "Normal Emacs editing mode with escape to VI mode."
> :lighter " <I>"
> :global t
> (if mvi-insert-mode (mvi-command-mode -1)))
That is for Monnier. I became very impressed with your el-script. It is small
and elegant. It seems however that you did'nt test it, which makes it even more
impressive. However, I want to use it, and I believe that Junnia wants to use
it too. By the way, I am not a full-fledged elisp programmer, and have
difficulty with modes. Therefore, I am not able to fix the program myself.
For instance, mvi-command-mode calls mvi-normal-mode. I cannot find the
definition of mvi-command-mode anywhere in your code. Here:
> (define-minor-mode mvi-command-mode
> "Minimalistic VI-like mode."
> :lighter " <N>"
> :global t
> (if mvi-command-mode (mvi-normal-mode -1))
Besides this, I miss the parameter init-value in all define-minor-mode macro
calls.
(define-minor-mode mvi-insert-mode
"Normal Emacs editing mode with escape to VI mode."
nil ;; <<==== Is this line missing?
:lighter " <I>"
:global t
(if mvi-insert-mode (mvi-command-mode -1)))
To make a long story short, I will be pleased in having a working copy of this
program.
Re: Modal Keyboard Layout for EMACS, rosangelamesil, 2012/11/23
Re: Modal Keyboard Layout for EMACS, rosangelamesil, 2012/11/23