Fix helpful-mode .. some more

still not quite there
This commit is contained in:
Case Duckworth 2021-09-06 23:49:55 -05:00
parent 429667cd4a
commit 6e277d08c9
1 changed files with 13 additions and 7 deletions

20
init.el
View File

@ -1010,15 +1010,19 @@ successive invocations."
(global-goto-address-mode)
(add-hook 'after-change-major-mode-hook #'goto-address-mode)))
;; TODO: figure out a popper.el / shackle.el ... thing to fix this
(setup (:straight helpful)
(:require-after 3)
(defvar helpful-pre-windows nil
"Window configuration /before/ helpful was called.")
(:option helpful-switch-buffer-function
(defun helpful-pop-to-buffer (&rest args)
(let ((foo
(if (eq major-mode 'helpful-mode)
#'pop-to-buffer-same-window
#'pop-to-buffer)))
(apply foo args))))
(if (eq major-mode 'helpful-mode)
(apply #'pop-to-buffer-same-window args)
(require 'winner)
(setq helpful-pre-windows (winner-conf))
(apply #'pop-to-buffer args))))
(:global "<help> f" #'helpful-callable
"<help> v" #'helpful-variable
@ -1031,7 +1035,9 @@ successive invocations."
(quit-window)
(unless (or (= 1 (count-windows))
(eq major-mode 'helpful-mode))
(delete-window))))))
(delete-window)
(ignore-errors
(winner-set helpful-pre-windows)))))))
(setup (:straight hungry-delete)
(:option hungry-delete-chars-to-skip " \t"