Skip to content

Instantly share code, notes, and snippets.

@dongweiming
Created November 18, 2013 11:17
Show Gist options
  • Save dongweiming/7526221 to your computer and use it in GitHub Desktop.
Save dongweiming/7526221 to your computer and use it in GitHub Desktop.
prelude-taglist
在.emacs.d/core/prelude-core.el最后添加函数
(defun prelude-py-taglist (arg)
"简易版taglist"
(interactive "P")
(let ((buffer-other
(if arg
"*py-taglist*"
(format "*py-taglist from %s*" (buffer-name)))))
(occur-1 "class \\|def " nil
(if arg
(delq nil (mapcar (lambda (buffer)
(when (eq 'python-mode
(with-current-buffer buffer))
buffer))
(buffer-list)))
(list (current-buffer)))
buffer-other)
(let ((line (line-number-at-pos)))
(switch-to-buffer-other-window buffer-other)
(end-of-buffer)
(while (and (search-backward-regexp "^ *\\([0-9]+\\):" nil t)
(> (string-to-int (match-string 1)) line)) t))))
然后在.emacs.d/core/prelude-mode.el 82 行添加一个绑定 --- 看心情放什么地方啦
(define-key map (kbd "C-c v") 'prelude-py-taglist)
@lexdene
Copy link

lexdene commented Nov 19, 2013

好赞!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment