|
|
|
@ -499,48 +499,5 @@ With a prefix argument ARG, find the `user-init-file' instead." |
|
|
|
(interactive "P") |
|
|
|
(sp-wrap-with-pair ,s))) |
|
|
|
|
|
|
|
;; needed for prelude-goto-symbol |
|
|
|
(require 'imenu) |
|
|
|
|
|
|
|
(defun prelude-goto-symbol (&optional symbol-list) |
|
|
|
"Refresh imenu and jump to a place in the buffer using Ido." |
|
|
|
(interactive) |
|
|
|
(cond |
|
|
|
((not symbol-list) |
|
|
|
(let (name-and-pos symbol-names position) |
|
|
|
(while (progn |
|
|
|
(imenu--cleanup) |
|
|
|
(setq imenu--index-alist nil) |
|
|
|
(prelude-goto-symbol (imenu--make-index-alist)) |
|
|
|
(setq selected-symbol |
|
|
|
(completing-read "Symbol? " (reverse symbol-names))) |
|
|
|
(string= (car imenu--rescan-item) selected-symbol))) |
|
|
|
(unless (and (boundp 'mark-active) mark-active) |
|
|
|
(push-mark nil t nil)) |
|
|
|
(setq position (cdr (assoc selected-symbol name-and-pos))) |
|
|
|
(cond |
|
|
|
((overlayp position) |
|
|
|
(goto-char (overlay-start position))) |
|
|
|
(t |
|
|
|
(goto-char position))) |
|
|
|
(recenter))) |
|
|
|
((listp symbol-list) |
|
|
|
(dolist (symbol symbol-list) |
|
|
|
(let (name position) |
|
|
|
(cond |
|
|
|
((and (listp symbol) (imenu--subalist-p symbol)) |
|
|
|
(prelude-goto-symbol symbol)) |
|
|
|
((listp symbol) |
|
|
|
(setq name (car symbol)) |
|
|
|
(setq position (cdr symbol))) |
|
|
|
((stringp symbol) |
|
|
|
(setq name symbol) |
|
|
|
(setq position |
|
|
|
(get-text-property 1 'org-imenu-marker symbol)))) |
|
|
|
(unless (or (null position) (null name) |
|
|
|
(string= (car imenu--rescan-item) name)) |
|
|
|
(add-to-list 'symbol-names (substring-no-properties name)) |
|
|
|
(add-to-list 'name-and-pos (cons (substring-no-properties name) position)))))))) |
|
|
|
|
|
|
|
(provide 'prelude-core) |
|
|
|
;;; prelude-core.el ends here |