Skip to content

Instantly share code, notes, and snippets.

@lexdene
Forked from dongweiming/gist:7526221
Created November 19, 2013 05:35
Show Gist options
  • Select an option

  • Save lexdene/7540775 to your computer and use it in GitHub Desktop.

Select an option

Save lexdene/7540775 to your computer and use it in GitHub Desktop.

Revisions

  1. @dongweiming dongweiming created this gist Nov 18, 2013.
    23 changes: 23 additions & 0 deletions gistfile1.el
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    在.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))))
    3 changes: 3 additions & 0 deletions gistfile2.el
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    然后在.emacs.d/core/prelude-mode.el 82 行添加一个绑定 --- 看心情放什么地方啦

    (define-key map (kbd "C-c v") 'prelude-py-taglist)