unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* calc embedded mode and evil mode
@ 2019-11-08 14:27 Eric S Fraga
  2019-11-08 18:06 ` Óscar Fuentes
  0 siblings, 1 reply; 3+ messages in thread
From: Eric S Fraga @ 2019-11-08 14:27 UTC (permalink / raw)
  To: help-gnu-emacs

Hello all,

I use evil mode extensively.  However, I also use embedded calc
mode.  The latter cannot be in evil mode as it has its own
bindings.  However, switching to embedded mode (C-x * e) leaves the
editing mode as it is, i.e. in evil mode.  I have tried the following,
to no effect:

   (add-hook 'calc-embedded-mode-hook #'(evil-emacs-state))
   
although typing C-z (bound to evil-emacs-state) after C-x *e does switch
to emacs state.

Any suggestions most welcome!  Thank you.
-- 
Eric S Fraga via Emacs 27.0.50 & org 9.2.6 on Debian bullseye/sid




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: calc embedded mode and evil mode
  2019-11-08 14:27 calc embedded mode and evil mode Eric S Fraga
@ 2019-11-08 18:06 ` Óscar Fuentes
  2019-11-09 12:20   ` Eric S Fraga
  0 siblings, 1 reply; 3+ messages in thread
From: Óscar Fuentes @ 2019-11-08 18:06 UTC (permalink / raw)
  To: help-gnu-emacs

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> I use evil mode extensively.  However, I also use embedded calc
> mode.  The latter cannot be in evil mode as it has its own
> bindings.  However, switching to embedded mode (C-x * e) leaves the
> editing mode as it is, i.e. in evil mode.  I have tried the following,
> to no effect:
>
>    (add-hook 'calc-embedded-mode-hook #'(evil-emacs-state))
>    
> although typing C-z (bound to evil-emacs-state) after C-x *e does switch
> to emacs state.
>
> Any suggestions most welcome!  Thank you.

(add-hook 'calc-embedded-new-formula-hook #'evil-emacs-state)

does the trick of changing to evil-emacs-state here. I don't know about
a method for returning to some Evil state after exiting calc-embedded.

But if I invoke calc-embedded while Evil is in insert-state, I can use
calc-embedded just fine, at least for the simple tests I've tried.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: calc embedded mode and evil mode
  2019-11-08 18:06 ` Óscar Fuentes
@ 2019-11-09 12:20   ` Eric S Fraga
  0 siblings, 0 replies; 3+ messages in thread
From: Eric S Fraga @ 2019-11-09 12:20 UTC (permalink / raw)
  To: help-gnu-emacs

On Friday,  8 Nov 2019 at 19:06, Óscar Fuentes wrote:
> (add-hook 'calc-embedded-new-formula-hook #'evil-emacs-state)
>
> does the trick of changing to evil-emacs-state here. 

Ah, for some reason, I had assumed this hook would only be invoked when
creating a new formula from scratch.  Silly me!  Yes, this works well
indeed.  Thank you.

More importantly, thanks for pointing out that the embedded calc
keybindings all work in evil insert mode so maybe that's the better
route overall in any case.

-- 
Eric S Fraga via Emacs 27.0.50 & org 9.2.6 on Debian bullseye/sid




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-09 12:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-08 14:27 calc embedded mode and evil mode Eric S Fraga
2019-11-08 18:06 ` Óscar Fuentes
2019-11-09 12:20   ` Eric S Fraga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).