Created
April 10, 2012 10:50
-
-
Save magnars/2350388 to your computer and use it in GitHub Desktop.
Push mark when using ido-imenu
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
;; Push mark when using ido-imenu | |
(defvar push-mark-before-goto-char nil) | |
(defadvice goto-char (before push-mark-first activate) | |
(when push-mark-before-goto-char | |
(push-mark))) | |
(defun ido-imenu-push-mark () | |
(interactive) | |
(let ((push-mark-before-goto-char t)) | |
(ido-imenu))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good question -- isn't advicing
goto-char
a bit risky performance-wise since it's called by so much other code, even non-interactive code?