| categories: emacs | tags: | View Comments

Org-mode has clickable links, and they are awesome. You can make your own links, for example here is a link for twitter handles that opens a browser to the handle, and exports as an html link.

(org-add-link-type "twitter"
(lambda (handle)
(lambda (path desc backend)


Check it out here: johnkitchin.

There is another alternative to make clickable text, and that is the button-lock package. You define a regular expression for the text you want to be clickable, and a function to run when it is clicked. Here is an example.

(require 'button-lock)
(global-button-lock-mode)

(button-lock-set-button
"@\$$[-a-zA-Z0-9_:]*\$$"
(lambda ()
(interactive)
(re-search-backward "@")
(re-search-forward  "@\$$[a-zA-Z0-9_]*\$$")
(let* ((handle (match-string-no-properties 1)))


Check it out: @johnkitchin. Of course, you can make your clicking function more sophisticated, e.g. to give you a menu of options , e.g. to send a tweet to someone, or open the web page, or look them up in your org-contacts. The differences between this and an org-mode link are that this works in any mode, and it has no export in org-mode, so it will go as plain text. Since this is just a feature for Emacs though, that should be fine.

org-mode source

Org-mode version = 8.2.10