<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-org-config--org-follow-link-same-window.el, branch main</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-27T20:08:52+00:00</updated>
<entry>
<title>feat(org): open file links in the same window on shift/right-click</title>
<updated>2026-05-27T20:08:52+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-27T20:08:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=a6157f471c9d64c00f0a2e33224e373864a7ae80'/>
<id>urn:sha1:a6157f471c9d64c00f0a2e33224e373864a7ae80</id>
<content type='text'>
Plain left-click on an Org file link keeps org's default of opening in the other window. I added S-mouse-1 and mouse-3 as a second gesture that opens the file link in the current window instead, for when I want the file to replace the buffer the link sits in.

The bindings live in org-mouse-map, the keymap org attaches to each link as a text property, rather than org-mode-map. That layer outranks both org-mode-map and the mouse-trap-mode emulation keymap, which otherwise swallows clicks in org buffers. Off a link the gesture does nothing, so a stray right-click is a silent no-op instead of a "No link found" error.
</content>
</entry>
</feed>
