Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to make calc mode default to input-mode #104

Open
spiderbit opened this issue Jul 24, 2020 · 2 comments
Open

how to make calc mode default to input-mode #104

spiderbit opened this issue Jul 24, 2020 · 2 comments

Comments

@spiderbit
Copy link

If I start calc mode and want to compute 5 numbers and most of the time I don't want to paste something so switching manually to insert mode after each number is super annoying.

So I thought let's setup some hook to bring it after each number in input mode again. Sadly calc starts when you type a number a minibuffer input field so it's not in the same buffer anymore, and with the buffer switch it activates command mode each time.

So I tried minibuffer-exit-hook:

  (add-hook 'minibuffer-exit-hook
	    (when (equal "Calculator" mode-name)
	      (xah-fly-insert-mode-activate)))

Which does not work, any idea?

@spiderbit
Copy link
Author

spiderbit commented Oct 1, 2020

So I just looked a bit into that problem didn't even remember that I reported this as "bug" already, but the solution to this is the following, I wonder if it makes sense to add that into xah-fly-keys upstream because I think I see no advantage to have command mode active by default in calc mode:

  (add-hook 'calc-start-hook #'xah-fly-insert-mode-activate)
  (advice-add 'calcDigit-start :after #'xah-fly-insert-mode-activate)

I don't know if I need to open a seperate bug but similar solution for org-agenda buffer:

  (add-hook 'org-agenda-mode-hook #'xah-fly-insert-mode-activate)
  (advice-add 'org-agenda-redo :after #'xah-fly-insert-mode-activate)

@spiderbit
Copy link
Author

spiderbit commented Oct 2, 2020

small mistake it's not the org-agenda-mode-hook but org-agenda-finalize-hook:

(add-hook 'org-agenda-finalize-hook #'xah-fly-insert-mode-activate)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant