noctuid / link-hint.el

Pentadactyl-like Link Hinting in Emacs with Avy
GNU General Public License v3.0
162 stars 22 forks source link

link-hint doesn't work in help-mode: Unknown button type ‘epkg-package’ #182

Closed yiufung closed 3 years ago

yiufung commented 3 years ago

Starting from scratch, it seems link-hint doesn't work in Help-mode. Testing under Emacs 28.0.50 with native-comp branch.

Error message:

Debugger entered--Lisp error: (error "Unknown button type ‘epkg-package’")
  error("Unknown button type `%s'" epkg-package)
  link-hint--overlay-epkg-category(#<overlay from 22 to 28 in *Help*>)
  link-hint--next-epkg-button(2148)
  link-hint--collect(1 2148 link-hint-epkg-button)
  link-hint--collect-visible-links()
  link-hint--get-links()
  link-hint--one(:open)
  link-hint-open-link()
  funcall-interactively(link-hint-open-link)
  command-execute(link-hint-open-link)

Complete init file:

;; Bootstrap `straight.el'
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

;; Bootstrap `use-package'
;; Integration with use-package
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)

(global-set-key (kbd "M-o") 'other-window)

(use-package link-hint
  :demand t
  :bind ("C-c C-o" . link-hint-open-link)
  :config
  (add-hook 'eww-mode-hook
            #'(lambda () (bind-key "f" #'link-hint-open-link eww-mode-map)))
  (add-hook 'w3m-mode-hook
            #'(lambda () (bind-key "f" #'link-hint-open-link w3m-mode-map)))
  (add-hook 'help-mode-hook
            #'(lambda () (bind-key "f" #'link-hint-open-link help-mode-map))))

Emacs version:

GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.17.4) of 2021-01-25
akirak commented 3 years ago

Sorry, this is a bug from one of my former PRs. This occurs if epkg is not installed on your machine. I have sent a PR #183 to fix the issue, so please use the branch until @noctuid merges the PR.

yiufung commented 3 years ago

Thanks for the prompt response, it works now