Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
- '27.1'
- '28.1'
- '29.1'
- '30.1'

steps:
- uses: purcell/setup-emacs@master
Expand Down
94 changes: 94 additions & 0 deletions helpful.el
Original file line number Diff line number Diff line change
Expand Up @@ -3000,6 +3000,100 @@ See also `helpful-max-buffers'."
(when (eq (buffer-local-value 'major-mode buffer) 'helpful-mode)
(kill-buffer buffer))))

;; overrides in apropos to try to use helpful-* instead.

(require 'apropos)

(define-button-type 'apropos-function
'apropos-label "Function"
'apropos-short-label "f"
'face 'apropos-function-button
'help-echo "mouse-2, RET: Display more help on this function"
'follow-link t
'action (lambda (button)
(helpful-function (button-get button 'apropos-symbol))))

(define-button-type 'apropos-macro
'apropos-label "Macro"
'apropos-short-label "m"
'face 'apropos-function-button
'help-echo "mouse-2, RET: Display more help on this macro"
'follow-link t
'action (lambda (button)
(helpful-function (button-get button 'apropos-symbol))))

(define-button-type 'apropos-command
'apropos-label "Command"
'apropos-short-label "c"
'face 'apropos-function-button
'help-echo "mouse-2, RET: Display more help on this command"
'follow-link t
'action (lambda (button)
(helpful-function (button-get button 'apropos-symbol))))

(define-button-type 'apropos-variable
'apropos-label "Variable"
'apropos-short-label "v"
'face 'apropos-variable-button
'help-echo "mouse-2, RET: Display more help on this variable"
'follow-link t
'action (lambda (button)
(helpful-variable (button-get button 'apropos-symbol))))

(define-button-type 'apropos-user-option
'apropos-label "User option"
'apropos-short-label "o"
'face 'apropos-user-option-button
'help-echo "mouse-2, RET: Display more help on this user option"
'follow-link t
'action (lambda (button)
(helpful-variable (button-get button 'apropos-symbol))))

;;; TODO: these need helpful functions before they can be hooked up:

;; (define-button-type 'apropos-face
;; 'apropos-label "Face"
;; 'apropos-short-label "F"
;; 'face '(font-lock-variable-name-face button)
;; 'help-echo "mouse-2, RET: Display more help on this face"
;; 'follow-link t
;; 'action (lambda (button)
;; (describe-face (button-get button 'apropos-symbol))))

;; (define-button-type 'apropos-group
;; 'apropos-label "Group"
;; 'apropos-short-label "g"
;; 'face 'apropos-misc-button
;; 'help-echo "mouse-2, RET: Display more help on this group"
;; 'follow-link t
;; 'action (lambda (button)
;; (customize-group-other-window
;; (button-get button 'apropos-symbol))))

;; (define-button-type 'apropos-widget
;; 'apropos-label "Widget"
;; 'apropos-short-label "w"
;; 'face 'apropos-misc-button
;; 'help-echo "mouse-2, RET: Display more help on this widget"
;; 'follow-link t
;; 'action (lambda (button)
;; (widget-browse-other-window (button-get button 'apropos-symbol))))

;; (define-button-type 'apropos-plist
;; 'apropos-label "Properties"
;; 'apropos-short-label "p"
;; 'face 'apropos-misc-button
;; 'help-echo "mouse-2, RET: Display more help on this plist"
;; 'follow-link t
;; 'action (lambda (button)
;; (apropos-describe-plist (button-get button 'apropos-symbol))))

;; (define-button-type 'apropos-library
;; 'help-echo "mouse-2, RET: Display more help on this library"
;; 'follow-link t
;; 'action (lambda (button)
;; (apropos-library (button-get button 'apropos-symbol))))

(defvar helpful-mode-map
(let* ((map (make-sparse-keymap)))
(define-key map (kbd "g") #'helpful-update)
Expand Down
Loading