;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/button-incal.el (defun button-to-help (sym &optional no-dec) (if (stringp sym) (insert sym) (when (or (functionp sym) (boundp sym) (facep sym)) (insert-text-button (format (if no-dec "%s" "[%s]") (symbol-name sym)) 'face 'button 'action (lambda (&rest _r) (describe-symbol (symbol-at-point))))))) ;; (button-to-help "a string") ; a string ;; (button-to-help 'kill-emacs) ; [kill-emacs] ;; (button-to-help 'fill-column) ; [fill-column] ;; (button-to-help 'bold) ; [bold] ;; (button-to-help 'bogus-symbol) ; DNC ;; (button-to-help 'kill-line t) ; kill-line (provide 'button-incal)