Created
January 6, 2018 03:07
-
-
Save zarkone/487e944fe0afb8f70600c45054223acb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun should-collapse-p () | |
(string-match-p "\s-*(def.*" | |
(buffer-substring-no-properties | |
(line-beginning-position) | |
(line-end-position)))) | |
(defun open-by-controller (should-collapse-p) | |
(let* ((region (yafolding-get-element-region)) | |
(beg (car region)) | |
(end (cadr region))) | |
(save-excursion | |
(next-line) | |
(while (< (point) (+ 1 end)) | |
(when (should-collapse-p) | |
(yafolding-hide-element)) | |
(next-line))))) | |
;; (open-by-controller 'should-collapse-p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment