help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modal Keyboard Layout for EMACS


From: Stefan Monnier
Subject: Re: Modal Keyboard Layout for EMACS
Date: Fri, 23 Nov 2012 13:55:27 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]