doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker
MIT License
19.39k stars 3.05k forks source link

Bound keys are lost in org-brain-visualize #4586

Closed rakanalh closed 3 years ago

rakanalh commented 3 years ago

Describe the feature Using org-brain, executing org-mode-visualize would show a buffer which helps visualize the structure of entries. However, bound keys such as SPC SPC would show SPC SPC is undefined error. Basically, none of the key bindings i am used to have in doom-emacs are available.

Edit: I guess this would count as a feature request to support evil keybindings for org-brain in addition to having doom-specific keybindings in org-mode-visualize mode.

System information

```
SYSTEM  type       gnu/linux
        config     x86_64-pc-linux-gnu
        shell      /usr/bin/zsh
        uname      Linux 5.10.10-arch1-1 #1 SMP PREEMPT Sat, 23 Jan 2021 23:59:48 +0000 x86_64
        path       (/usr/local/bin /usr/bin /bin /usr/sbin /sbin /usr/local/git/bin /usr/local/go/bin /opt/sm/bin /opt/sm/pkg/active/bin /opt/sm/pkg/active/sbin /bin ~/Code/Go/bin ~/.bin ~/.cargo/bin /usr/lib/emacs/28.0.50/x86_64-pc-linux-gnu)
EMACS   dir        ~/.emacs.d/
        version    28.0.50
        build      Jan 03, 2021
        buildopts  --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games --with-sound=alsa --with-modules --without-gconf --without-gsettings --enable-link-time-optimization --with-x-toolkit=gtk3 --without-xaw3d --without-compress-install 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -flto -fuse-linker-plugin' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
        features   XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2
        traits     (batch server-running envvar-file)
DOOM    dir        ~/dotfiles/.doom.d/
        version    2.0.9
        build      HEAD -> develop 56e9d273e 2021-01-28 21:23:07 -0500
        elc-files  0
        modules    (:completion company ivy :ui doom doom-dashboard doom-quit hl-todo hydra modeline nav-flash ophints (popup +all +defaults) treemacs vc-gutter vi-tilde-fringe window-select workspaces zen :editor (evil +everywhere) file-templates fold (format +onsave) multiple-cursors rotate-text snippets :emacs dired electric ibuffer vc (undo +tree) :term vterm :checkers syntax :tools (debugger +lsp) editorconfig (eval +overlay) (lookup +docsets) (lsp +peek) (magit +forge) :lang data emacs-lisp go javascript lua markdown (org +brain +dragndrop +ipython +pandoc +pomodoro +journal +present) python (rust +lsp) sh solidity yaml :email (mu4e +gmail) :app calendar irc :config (default +bindings +smartparens))
        packages   ((auto-highlight-symbol) (rust-mode :disable t) (format-all :disable t) (whitespace :disable t) (cargo) (flycheck-mypy) (parent-mode) (rust-playground) (org-present) (mu4e-dashboard :recipe (:host github :repo rougier/mu4e-dashboard)) (mu4e-alert) (protobuf-mode) (google-translate) (org-gtasks :recipe (:host github :repo rakanalh/org-gtasks :files (org-gtasks.el))))
        unpin      (rustic lsp-mode lsp-ui)
        elpa       (protobuf-mode)
```
hlissner commented 3 years ago

Sorry for the late response. This request may be better suited to evil-collection. As a rudimentary workaround, give this a try:

;; Add to ~/.doom.d/config.el
(after! org-brain
  (set-evil-initial-state! 'org-brain-visualize-mode 'normal)
  (let (keys)
    (map-keymap (lambda (event function)
                  (push function keys)
                  (push event keys))
                org-brain-visualize-mode-map)
    (apply #'evil-define-key* 'normal org-brain-visualize-mode-map keys)))

I'm hoping this will be enough for rudimentary "evilification" of org-brain-visualize.