Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun display-code-line-counts (ov)
- (when (eq 'code (overlay-get ov 'hs))
- (overlay-put ov 'display
- (format " ... [%d]"
- (count-lines (overlay-start ov)
- (overlay-end ov))))
- (overlay-put ov 'face '(:foreground "yellow green"))))
- (setq hs-set-up-overlay 'display-code-line-counts)
- (defvar my/py-hide-show-keywords '("class" "def" "elif" "else" "except"
- "for" "if" "while" "finally" "try" "with"))
- (defvar my/py-hide-show-hide-docstrings t)
- (setq hs-special-modes-alist
- (remove-if #'(lambda (x) (equal 'python-mode (car x)))
- hs-special-modes-alist))
- (add-to-list 'hs-special-modes-alist
- (list 'python-mode
- (mapconcat #'(lambda (x) (concat "^\\s-*" x "\\>"))
- py-hide-show-keywords "\\|")
- nil
- "#"
- #'python-nav-end-of-block))
Add Comment
Please, Sign In to add comment