we can get help with "C-h ..." and emacs show a Help buffer,and jump to other place with the link . How can I make something like that with elisp, link to another buffer or show something else?
The builtin Button package provides a convenient way. For example,
(require 'button)
(insert-button "foo" 'action (lambda (x) (find-file user-init-file)))
will insert a button/link labeled "foo" that when activated (by pressing Enter while point is over the label or middle clicking) will bring up the init file.
Here is another example that mimics a www link,
(insert-button "fsf"
'action (lambda (x) (browse-url (button-get x 'url)))
'url "http://www.fsf.org")
See Elisp Reference Manual 38.17 Buttons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With