Comments (17)
Uh, oh... just noticed somehow I've been using the wrong name for the function-key option!
It is named god-mode-enable-function-key-translation
, not -interaction
.
It seems I didn't notice the issue, because I usually press F11
as the first thing on my Emacs startup, and since I used the wrong hook, god-mode didn't get enabled on initialization... so F11
was working fine. But when I manually started god-mode afterwards, it turned out that function key translation wasn't disabled (because I was setting the wrong variable).
Sorry, my bad!
from god-mode.
Yes, indeed. The issue with initializing projectile key-binding still exists.
from god-mode.
Still, it might worth looking into why god-mode
does not work well with use-package
's :bind-keymap
option.
from god-mode.
This supersedes issue #155 I've opened/closed before.
from god-mode.
It depends on how you initialise God mode.
As mentioned in the README, calling the god-mode
function only affects future buffers.
To change both active and future buffers, you should call god-mode-all
instead on loading your emacs configuration.
from god-mode.
I do use god-mode-all
, with the binding set.
The issue happens once Emacs is initialised, then I turn god-mode on using the binding.
After this the indicators show that god-mode is turned on, yet c SPC p p
does not do anything.
Interestingly, if I add god-mode-all
to the emacs-init-hook
, god-mode does not get turned on after initialised.
from god-mode.
Sorry, I can't seem to recreate this, although I'm using after-init-hook
.
Calling god-mode-all
through after-init-hook
, or through doom-after-modules-config-hook
if you're using Doom Emacs, works fine.
I can use the c SPC p
prefix to call any projectile functions as soon as my Emacs starts up.
Would it be possible to share your Emacs config?
I can't find anything related to God mode in your .emacs.d
repository.
from god-mode.
Apologies, realised my github didn't contain the config I was working with.
Here is the version which reproduces the problem for me. The god-mode
version in my config uses the latest commit 607aff1
.
Also, I've disabled doom-modeline
, but the problem still remains.
Since I am not using Doom Emacs, only the individual doom-modeline
package, I don't have a doom-after-modules-config-hook
.
Regarding the after-init-hook
problem: I've accidentally added the -hook
suffix in my use-package
declaration. After fixing it, god-mode
is indeed enabled on startup. Yet, this doesn't resolve the problem with the projectile
key-map binding.
from god-mode.
Actually, I've encountered another issue.
For some reason enabling god-mode on startup using the after-init-hook
, causes the god-mode-enable-function-key-interaction
to be ignored. Even though I've set it to be nil
, when I try to press F11
after startup, I get the message: God: Unknown key binding for ‘C-<f11>‘
.
The behaviour is present in my earlier config.
If I remove god-mode from the after-init-hook
, then F11
works fine.
from god-mode.
or some reason enabling god-mode on startup using the
after-init-hook
, causes thegod-mode-enable-function-key-interaction
to be ignored. Even though I've set it to benil
, when I try to pressF11
after startup, I get the message:God: Unknown key binding for ‘C-<f11>‘
.
Just had a quick look, and it looks like you're setting god-mode-enable-function-key-interaction
too late.
Try setting it in the :init
part of use-package
, instead of in :custom
.
I've not yet investigated the issue with projectile and God mode.
I'll get to that soon, but if you find anything, please post on this issue.
from god-mode.
I've also tried using emacs-startup-hook
instead of after-init-hook
, which claims to be run later, and starts god-mode correctly, yet still captures the F11 key.
When I don't automatically start god-mode with either of the hooks, then setting god-mode-enable-function-key-interaction
using :custom
works fine, and F11 key registers correctly.
from god-mode.
Not a problem.
So the F11
issue is not a bug, but you're still having a problem calling projectile functions on start-up from what I understand?
from god-mode.
Okay, looking at your config, it's because projectile key bindings aren't exposed through your package configuration that uses :bind-keymap
.
Can you try this config for projectile and let me know if you're still having the issue?
(use-package projectile
:hook
(projectile-grep-finished . (lambda () (pop-to-buffer next-error-last-buffer)))
:bind-keymap
("C-c p" . projectile-command-map)
:init
(require 'projectile)
:config
(dolist (dir (list "node_modules" "target"))
(add-to-list 'projectile-globally-ignored-directories dir))
(projectile-mode))
This is sort of what Doom Emacs does too.
from god-mode.
I don't understand. My config is exactly the same as what you wrote.
from god-mode.
Haha not exactly.
There's a call to (require 'projectile)
you're missing.
I copied your config and added these lines:
(use-package projectile
:hook
(projectile-grep-finished . (lambda () (pop-to-buffer next-error-last-buffer)))
:bind-keymap
("C-c p" . projectile-command-map)
+ :init
+ (require 'projectile)
:config
(dolist (dir (list "node_modules" "target"))
(add-to-list 'projectile-globally-ignored-directories dir))
(projectile-mode))
from god-mode.
Adding the :init (require 'projectile)
doesn't seem to solve the issue for me.
from god-mode.
This seems to have solved it though:
(use-package projectile
:demand t
:hook
(projectile-grep-finished . (lambda () (pop-to-buffer next-error-last-buffer)))
:bind
("C-c p" . projectile-command-map)
:config
(dolist (dir (list "node_modules" "target"))
(add-to-list 'projectile-globally-ignored-directories dir))
(projectile-mode))
The difference is that I've used :bind
instead of :bind-keymap
, and added the :demand t
.
Not sure I understand what benefit :bind-keymap
gives over plain :blind
, but it seems the fact that it tries to do funny things, with loading the keymap and then using the binding again as prefix argument, could interfere with god-mode? At any rate, with :bind
the behaviour is more straightforward, such that the :demand
flag can circumvent the delayed loading.
...not sure how you've added those nice highlights on your code examples though! ;)
from god-mode.
Related Issues (20)
- The function "my-god-mode-update-modeline" does not work reliably HOT 4
- Fix mode line suggested in README resulting in unreadable mode line HOT 3
- God mode does not work in Transient UI HOT 8
- god-mode-all doesn't work in shell-mode HOT 4
- Keybinds recommendation
- Use Eldev HOT 1
- Add customisation to disable sticky `god-literal-key` HOT 10
- Idea: One-shot god-mode HOT 3
- [Idea] Disabling god mode after certain functions/key-presses HOT 5
- Have a discussion page for this project? HOT 1
- Extending god-mode system wide outside of Emacs HOT 13
- feature request: make describe-key work with god-mode HOT 10
- Make ESC just enter god-mode HOT 3
- Conflict with lispy-mode HOT 3
- Shifted key translation HOT 5
- Customize option to disable head icon showing on mode-line HOT 7
- god-mode doesn't work in *scratch* buffer
- binding for <C-tab> doesn't work in god-mode HOT 10
- Org-mode header navigation. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from god-mode.