From: Junia <junnia@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Modal Keyboard Layout for EMACS
Date: Thu, 22 Nov 2012 12:52:58 -0800 (PST) [thread overview]
Message-ID: <4df5addb-a19c-4b3f-b79d-27e308a2b3ab@googlegroups.com> (raw)
In-Reply-To: <5f81bc03-eafb-4330-96b1-383d17886c0c@googlegroups.com>
There is a bug in the previously posted program. Nevertheless the new version still does not work with the / slash key en lieu de square bracket. Here is correct program.
;; Variables for possible keyboards
(defvar default-keyboard
(copy-keymap (current-global-map)))
(defvar emap
(copy-keymap (current-global-map)))
(defun tovim() (interactive)
(setq minor-mode-alist
(assq-delete-all 'normal minor-mode-alist))
(add-to-list 'minor-mode-alist '(normal "<N>"))
(force-mode-line-update)
(use-global-map vmap))
(define-key emap "[" 'tovim)
(defvar vmap
(copy-keymap (current-global-map)))
(define-key vmap (kbd "h") 'backward-char)
(define-key vmap (kbd "j") 'next-line)
(define-key vmap (kbd "k") 'previous-line)
(define-key vmap (kbd "l") 'forward-char)
(defun ademacs()
(setq minor-mode-alist
(assq-delete-all 'normal minor-mode-alist))
(add-to-list 'minor-mode-alist '(normal "<I>"))
(force-mode-line-update)
(use-global-map emap) )
(defun toemacs() (interactive)
(ademacs))
(define-key vmap (kbd "i") 'toemacs)
(defun slash()(interactive)
(ademacs) ; type twice for [
(insert "["))
(define-key vmap (kbd "[") 'slash)
(defun puremacs()
(use-global-map default-keyboard))
(define-minor-mode normal
nil
:lighter " <N> "
'(emap)
:group 'normal
(if normal (ademacs) (puremacs) ))
(define-globalized-minor-mode gnormal normal
(lambda() (normal t)))
(provide 'normal)
next prev parent reply other threads:[~2012-11-22 20:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-22 20:04 Modal Keyboard Layout for EMACS Junia
2012-11-22 20:52 ` Junia [this message]
2012-11-22 23:21 ` Stefan Monnier
[not found] ` <mailman.13585.1353626494.855.help-gnu-emacs@gnu.org>
2012-11-23 12:55 ` sergiusruiz
2012-11-23 16:53 ` sergiusruiz
2012-11-23 18:55 ` Stefan Monnier
[not found] ` <mailman.13650.1353696942.855.help-gnu-emacs@gnu.org>
2012-11-24 0:00 ` rosangelamesil
2012-11-24 1:56 ` rosangelamesil
2012-11-24 3:16 ` rosangelamesil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4df5addb-a19c-4b3f-b79d-27e308a2b3ab@googlegroups.com \
--to=junnia@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.