Skip to content

Commit e16c032

Browse files
committed
add state
1 parent 9500406 commit e16c032

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

foldvis.el

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,12 @@ See macro `with-selected-window' description for arguments WINDOW and BODY."
158158

159159
(defun foldvis--choose-backend ()
160160
"Set the current possible backend."
161-
(setq foldvis--backend (or foldvis--backend
162-
(cl-some (lambda (x)
163-
(when (featurep x)
164-
x))
165-
foldvis-backends))))
161+
(setq foldvis--backend
162+
(or foldvis--backend
163+
(cl-some (lambda (x)
164+
(when (featurep x)
165+
x))
166+
foldvis-backends))))
166167

167168
(defun foldvis--call-backend (name)
168169
"Call the backend function by NAME."
@@ -201,6 +202,15 @@ See macro `with-selected-window' description for arguments WINDOW and BODY."
201202
(t (message "No folding backend found: %s" foldvis--backend)
202203
(foldvis-mode -1))))
203204

205+
(defun foldvis--turn-on-foldvis-mode ()
206+
"Turn on the `foldvis-mode'."
207+
(foldvis-mode 1))
208+
209+
;;;###autoload
210+
(define-globalized-minor-mode global-foldvis-mode
211+
foldvis-mode foldvis--turn-on-foldvis-mode
212+
:group 'foldvis)
213+
204214
;;
205215
;; (@* "Events" )
206216
;;

0 commit comments

Comments
 (0)