Using Shackle with Help Buffers
sk8ingdom opened this issue · 2 comments
I use the following in shackle-rules
:
("*Help*" :align below :ratio 0.33 :select t)
which works great. Unfortunately, when I follow a link to, for example, go to the function definition in an elisp file, it opens the file in the window spawned by shackle.
Any idea would I modify my configuration to instead open the file in the original window I called help from similar to helm-buffers-list
?
Any help is appreciated. Thanks for making an awesome package that's pivotal to my workflow!
A very similar example has been addressed in the README in the Limitations section. To check whether it's possible at all, use M-x shackle-trace-functions
and check the *shackle trace*
buffer. It should be possible, but I doubt it's worth the pain of hacking the unreadable mess help-fns.el
appears to be.
Hey, thanks a bunch for the feedback! If anyone encounters this issue in the future, I was able to solve it with ace-mode (code below). It requires an extra button push, but gives me more flexibility as well.
;; Enable ace-window
(require 'ace-window)
(global-set-key (kbd "C-x o") 'ace-window)
;; Ace configuration for help
(require 'ace-link)
(ace-link-setup-default)
;; Ace configuration for help
(defun my/help-find-file-ace-window ()
"Use ace window to select a window for opening a file from dired."
(interactive)
(let ((file (button-get (button-at (point)) 'path)))
(if (> (length (aw-window-list)) 1)
(aw-select "" (lambda (window)
(aw-switch-to-window window)
(find-file file)))
(find-file-other-window file))))
(define-key helpful-mode-map "o" 'my/help-find-file-ace-window)
(define-key helpful-mode-map (kbd "<return>") 'my/help-find-file-ace-window)