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 04:55:19 -0800 (PST) Message-ID: <7eb079b5-8d69-4cd4-a10b-96129beb45f5@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 1353675630 18711 80.91.229.3 (23 Nov 2012 13:00:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Nov 2012 13:00:30 +0000 (UTC) Cc: help-gnu-emacs@gnu.org 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 14:00:42 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 1Tbss5-00009Z-Cu for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Nov 2012 14:00:41 +0100 Original-Received: from localhost ([::1]:47486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tbsrr-0000hq-Fa for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Nov 2012 08:00:27 -0500 Original-Received: by 10.224.111.140 with SMTP id s12mr2691558qap.5.1353675319916; Fri, 23 Nov 2012 04:55:19 -0800 (PST) Original-Received: by 10.49.58.238 with SMTP id u14mr558534qeq.13.1353675319886; Fri, 23 Nov 2012 04:55:19 -0800 (PST) Original-Path: usenet.stanford.edu!i9no9325830qap.0!news-out.google.com!gf5ni2982588qab.0!nntp.google.com!i9no9371895qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=200.131.199.26; posting-account=YtpWYgoAAAAL1jlValsdctD7bqgJdaqj Original-NNTP-Posting-Host: 200.131.199.26 User-Agent: G2/1.0 Injection-Date: Fri, 23 Nov 2012 12:55:19 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:195538 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:87862 Archived-At: 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)) >=20 > (defun mvi-doubled-self-insert-key () > (interactive) > (call-interactively 'self-insert-command) > (mvi-insert-mode 1)) >=20 > (define-minor-mode mvi-command-mode > "Minimalistic VI-like mode." > :lighter " " > :global t > (if mvi-command-mode (mvi-normal-mode -1)) >=20 > (defvar mvi-command-mode-map > (let ((map (make-sparse-keymap))) > (define-key map "\e" 'mvi-command-mode) > (define-key map "/" 'mvi-command-mode) > map)) >=20 > (define-minor-mode mvi-insert-mode > "Normal Emacs editing mode with escape to VI mode." > :lighter " " > :global t > (if mvi-insert-mode (mvi-command-mode -1))) That is for Monnier. I became very impressed with your el-script. It is sma= ll and elegant. It seems however that you did'nt test it, which makes it ev= en more impressive. However, I want to use it, and I believe that Junnia wa= nts to use it too. By the way, I am not a full-fledged elisp programmer, an= d have difficulty with modes. Therefore, I am not able to fix the program m= yself. For instance, mvi-command-mode calls mvi-normal-mode. I cannot find the def= inition of mvi-command-mode anywhere in your code. Here: > (define-minor-mode mvi-command-mode > "Minimalistic VI-like mode." > :lighter " " > :global t > (if mvi-command-mode (mvi-normal-mode -1)) Besides this, I miss the parameter init-value in all define-minor-mode macr= o calls.=20 (define-minor-mode mvi-insert-mode "Normal Emacs editing mode with escape to VI mode." nil ;; <<=3D=3D=3D=3D Is this line missing? :lighter " " :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 t= his program.