From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: sergiusruiz@gmail.com Newsgroups: gmane.emacs.help Subject: Re: Modal Keyboard Layout for EMACS Date: Fri, 23 Nov 2012 08:53:50 -0800 (PST) Message-ID: <701fe418-7090-46c7-be06-ff2a0840e0dd@googlegroups.com> References: <5f81bc03-eafb-4330-96b1-383d17886c0c@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1353689718 14436 80.91.229.3 (23 Nov 2012 16:55:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Nov 2012 16:55:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 23 17:55:30 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TbwXI-0002ZA-HR for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Nov 2012 17:55:28 +0100 Original-Received: from localhost ([::1]:51548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbwX8-0001Dy-1E for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Nov 2012 11:55:18 -0500 Original-Received: by 10.224.189.16 with SMTP id dc16mr3042784qab.0.1353689630934; Fri, 23 Nov 2012 08:53:50 -0800 (PST) Original-Received: by 10.49.48.41 with SMTP id i9mr695051qen.36.1353689630905; Fri, 23 Nov 2012 08:53:50 -0800 (PST) Original-Path: usenet.stanford.edu!i9no9472901qap.0!news-out.google.com!gf5ni2982588qab.0!nntp.google.com!i9no9472896qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <5f81bc03-eafb-4330-96b1-383d17886c0c@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=187.70.17.50; posting-account=YtpWYgoAAAAL1jlValsdctD7bqgJdaqj Original-NNTP-Posting-Host: 187.70.17.50 User-Agent: G2/1.0 Injection-Date: Fri, 23 Nov 2012 16:53:50 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:195551 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87875 Archived-At: Hi, Junia. I think I fixed the bugs in Stefan's version of mvi-command-mode. Now, it i= s working flawlessly. Since Stefan wants to provide mvi-command-mode only, = there is no need to make both commands global. By the way, I guess I know w= hat Stefan wanted with mvi-normal-mode: He wanted the normal emacs mode bac= k, what makes a lot of sense. I wrote a minor mvi-emacs-mode that exit from= mvi-insert-mode, mvi-command-mode, and mvi-emacs-mode itself. You should s= ave the file in mvi-command-mode.el and add the following line to your .ema= cs file: (require 'mvi-command-mode) To enter command mode, you should use M-x mvi-command-mode from anywhere in emacs (since the command mode is global). ;; Small modifications in a script by Stenfan Monnier (defvar mvi-command-mode-map=20 (let ((map (make-sparse-keymap)))=20 (define-key map "h" 'backward-char)=20 (define-key map "j" 'next-line)=20 (define-key map "k" 'previous-line)=20 (define-key map "l" 'forward-char)=20 (define-key map "i" 'mvi-insert-mode)=20 (define-key map "[" 'mvi-doubled-self-insert-key)=20 map))=20 (defun mvi-doubled-self-insert-key ()=20 (interactive)=20 (call-interactively 'self-insert-command)=20 (mvi-insert-mode 1))=20 =20 (defvar mvi-insert-mode-map=20 (let ((map (make-sparse-keymap)))=20 (define-key map "\e" 'mvi-command-mode)=20 (define-key map "[" 'mvi-command-mode)=20 map))=20 (define-minor-mode mvi-command-mode=20 "Minimalistic VI-like mode."=20 :lighter " "=20 :global t=20 (if mvi-command-mode (mvi-insert-mode -1)))=20 (define-minor-mode mvi-insert-mode=20 "Normal Emacs editing mode with escape to VI mode."=20 :lighter " "=20 (if mvi-insert-mode (mvi-command-mode -1)))=20 (define-minor-mode mvi-emacs-mode=20 "Normal Emacs editing mode with escape to VI mode."=20 :lighter ""=20 :global t (when mvi-emacs-mode=20 (mvi-emacs-mode -1) (mvi-insert-mode -1) (mvi-command-mode -1))) (provide 'mvi-command-mode)