Skip to content

Instantly share code, notes, and snippets.

@lexdene
Forked from dongweiming/gist:7526221
Created November 19, 2013 05:35
Show Gist options
  • Save lexdene/7540775 to your computer and use it in GitHub Desktop.
Save lexdene/7540775 to your computer and use it in GitHub Desktop.
在.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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment