Created
July 12, 2012 20:37
-
-
Save pjones/3100801 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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