From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Modal Keyboard Layout for EMACS Date: Fri, 23 Nov 2012 13:55:27 -0500 Message-ID: References: <5f81bc03-eafb-4330-96b1-383d17886c0c@googlegroups.com> <701fe418-7090-46c7-be06-ff2a0840e0dd@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1353696945 11300 80.91.229.3 (23 Nov 2012 18:55:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Nov 2012 18:55:45 +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 19:55:57 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 1TbyPt-0005nJ-Eh for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Nov 2012 19:55:57 +0100 Original-Received: from localhost ([::1]:58436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbyPi-0002jt-Rq for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Nov 2012 13:55:46 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:57989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbyPd-0002jY-3T for help-gnu-emacs@gnu.org; Fri, 23 Nov 2012 13:55:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbyPb-000636-HW for help-gnu-emacs@gnu.org; Fri, 23 Nov 2012 13:55:41 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:47524) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbyPb-00062J-B6 for help-gnu-emacs@gnu.org; Fri, 23 Nov 2012 13:55:39 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TbyPk-0005hy-8B for help-gnu-emacs@gnu.org; Fri, 23 Nov 2012 19:55:48 +0100 Original-Received: from 69-165-164-58.dsl.teksavvy.com ([69.165.164.58]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Nov 2012 19:55:48 +0100 Original-Received: from monnier by 69-165-164-58.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Nov 2012 19:55:48 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 69-165-164-58.dsl.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:9EO4USidorbloEGkTq1SuYCdmSc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:87879 Archived-At: > Since Stefan wants to provide mvi-command-mode only, there is no need > to make both commands global. I think you misunderstand the meaning of global. "Global" here means "affects all buffers" as opposed to "local to a particular buffer". I guess they could both be buffer-local or bother be global, but having one be global and the other buffer local makes no sense. > By the way, I guess I know what Stefan wanted with mvi-normal-mode It was a typo for mvi-insert-mode. > (define-minor-mode mvi-emacs-mode > "Normal Emacs editing mode with escape to VI mode." > :lighter "" > :global t > (when mvi-emacs-mode > (mvi-emacs-mode -1) > (mvi-insert-mode -1) > (mvi-command-mode -1))) Better make it into a proper minor mode (rather than a weird beast which doesn't do anything when you turn it off and turns itself off when you turn it on). (define-minor-mode mvi-mode "Minimalistic VI-like mode." :global t (if mvi-mode (or mvi-insert-mode mvi-command-mode (mvi-command-mode)) (mvi-command-mode -1) (mvi-insert-mode -1))) -- Stefan