diff options
Diffstat (limited to 'lisp/hcel-source.el')
-rw-r--r-- | lisp/hcel-source.el | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lisp/hcel-source.el b/lisp/hcel-source.el index c397387..29efab0 100644 --- a/lisp/hcel-source.el +++ b/lisp/hcel-source.el @@ -89,6 +89,19 @@ If NO-JUMP is non-nil, just open the source and does not jump to the location wi 'next-error)) buffer)) +(defun hcel-switch-buffer () + (interactive) + (switch-to-buffer + (read-buffer + "Switch to buffer: " nil t + (lambda (buffer) + (equal + (buffer-local-value + 'major-mode + (get-buffer (if (stringp buffer) buffer (car buffer)))) + 'hcel-mode))))) +(define-key hcel-mode-map "b" 'hcel-switch-buffer) + (defun hcel-definition-site-at-point () "Call definitionSite for identifier at point. @@ -149,17 +162,13 @@ May cause error if the identifier has exact location." ;; same module (alist-get 'doc (hcel-lookup-identifier-at-point)) ;; other module - (when-let - ((definition (ignore-errors (hcel-definition-site-at-point)))) - (alist-get 'documentation definition)) + (alist-get 'documentation + (ignore-errors (hcel-definition-site-at-point))) ;; hoogle (when-let ((hoogle-docs (ignore-errors (hcel-hoogle-docs-at-point)))) (when (length> hoogle-docs 0) (concat "Hoogle: " hoogle-docs)))))) - (with-temp-buffer - (insert docs) - (shr-render-region (point-min) (point-max)) - (buffer-string)))) + (hcel-render-html docs))) ;; TODO: multiple expressions (defun hcel-expressions-type (beg end) |