Goto Address Mode Opens Links in Emacs

Use `goto-address-mode` to make links in Emacs buffers clickable

Post added by

Tools / #emacs


Org mode has this nice thing where you can click a link in the buffer to open it in your browser. Turns out that’s not some special org-only behavior. It’s goto-address-mode, a minor mode that activates URLs and email addresses in the current buffer.

You can manually launch it with M-x goto-address-mode. It might be easier to automatically enable it for certain modes. You do that with a hook.

I want links to be available when reviewing notes and blog posts. Since I write those notes in a number of formats, I should add the hook one of the general major modes. text-mode is a good start.

;; base mode for prose
(add-hook 'text-mode-hook (lambda ()

Now I can open links from my Markdown and RST files with a click! Or a C-c <RET>.

goto-address-mode key bindings
C-c <RET>goto-address-at-pointOpens the link under point

I might add the hook for prog-mode later, if I find myself wanting to click URLs in source code.