Skip to content

Instantly share code, notes, and snippets.

@pjones
Created Jul 12, 2012
Embed
What would you like to do?
(defun pjones:org-goto (&optional alternative-interface)
"My version of `org-goto' that first widens the buffer (if
narrowed), jumps to the correct heading via `org-goto', then
narrows it again if necessary."
(interactive "P")
(let ((point-size (save-restriction (- (point-max) (point-min))))
(buff-size (buffer-size)))
(widen)
(org-goto alternative-interface)
(if (/= buff-size point-size) (org-narrow-to-subtree))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment