Remove help-fns+, add helpful plugin #363

This commit is contained in:
Henrik Lissner 2018-01-21 21:37:15 -05:00
parent ad59665a3d
commit c5b72566ea
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
5 changed files with 26 additions and 6 deletions

View file

@ -215,9 +215,17 @@ extension, try to guess one."
(er/contract-region 0))) (er/contract-region 0)))
(advice-add #'evil-escape :before #'doom*quit-expand-region)) (advice-add #'evil-escape :before #'doom*quit-expand-region))
(def-package! help-fns+ ; Improved help commands (def-package! helpful
:commands (describe-buffer describe-command describe-file :commands (helpful-callable helpful-function helpful-macro helpful-command
describe-keymap describe-option describe-option-of-type)) helpful-key helpful-variable helpful-at-point)
:init
(setq counsel-describe-function-function #'helpful-callable
counsel-describe-variable-function #'helpful-variable)
(global-set-key [remap describe-function] #'helpful-callable)
(global-set-key [remap describe-command] #'helpful-command)
(global-set-key [remap describe-variable] #'helpful-variable)
(global-set-key [remap describe-key] #'helpful-key))
(def-package! pcre2el (def-package! pcre2el
:commands rxt-quote-pcre) :commands rxt-quote-pcre)

View file

@ -27,7 +27,7 @@
(package! command-log-mode) (package! command-log-mode)
(package! editorconfig) (package! editorconfig)
(package! expand-region) (package! expand-region)
(package! help-fns+) (package! helpful)
(package! pcre2el) (package! pcre2el)
(package! smart-forward) (package! smart-forward)
(package! smartparens) (package! smartparens)

View file

@ -109,7 +109,6 @@ the command buffer."
(goto-char (cdr location)) (goto-char (cdr location))
(recenter) (recenter)
(setq origin (selected-window)))) (setq origin (selected-window))))
(+popup/close)
(select-window origin))) (select-window origin)))
;; Help buffers use `pop-to-window' to decide where to open followed links, ;; Help buffers use `pop-to-window' to decide where to open followed links,
@ -141,6 +140,18 @@ the command buffer."
(doom--switch-from-popup (find-function-search-for-symbol fun 'defface file))))) (doom--switch-from-popup (find-function-search-for-symbol fun 'defface file)))))
;; `helpful'
(after! helpful
(defun +popup*helpful--navigate (orig-fn &rest args)
(let (origin)
(save-popups!
(apply orig-fn args)
(setq origin (selected-window))
(recenter))
(select-window origin)))
(advice-add #'helpful--navigate :around #'+popup*helpful--navigate))
;; `neotree' ;; `neotree'
(after! neotree (after! neotree
(advice-add #'neo-util--set-window-width :override #'ignore) (advice-add #'neo-util--set-window-width :override #'ignore)

View file

@ -150,7 +150,7 @@ ALIST supports one custom parameter: `size', which will resolve to
(set! :popup "^\\*Completions" '((slot . -1) (vslot . -2)) '((transient . 0))) (set! :popup "^\\*Completions" '((slot . -1) (vslot . -2)) '((transient . 0)))
(set! :popup "^\\*Compilation" nil '((transient . 0) (quit . t))) (set! :popup "^\\*Compilation" nil '((transient . 0) (quit . t)))
(set! :popup "^\\*\\(?:scratch\\|Messages\\)" nil '((transient))) (set! :popup "^\\*\\(?:scratch\\|Messages\\)" nil '((transient)))
(set! :popup "^\\*Help" (set! :popup "^\\*[Hh]elp"
'((slot . 2) (vslot . 2) (size . 0.2)) '((slot . 2) (vslot . 2) (size . 0.2))
'((select . t))) '((select . t)))
(set! :popup "^\\*doom \\(?:term\\|eshell\\)" (set! :popup "^\\*doom \\(?:term\\|eshell\\)"

View file

@ -208,6 +208,7 @@
:desc "Find definition" :n "." #'+lookup/definition :desc "Find definition" :n "." #'+lookup/definition
:desc "Find references" :n "/" #'+lookup/references :desc "Find references" :n "/" #'+lookup/references
:desc "Find documentation" :n "h" #'+lookup/documentation :desc "Find documentation" :n "h" #'+lookup/documentation
:desc "Describe at point" :n "." #'helpful-at-point
:desc "What face" :n "'" #'doom/what-face :desc "What face" :n "'" #'doom/what-face
:desc "What minor modes" :n ";" #'doom/what-minor-mode :desc "What minor modes" :n ";" #'doom/what-minor-mode
:desc "Info" :n "i" #'info :desc "Info" :n "i" #'info