Add autoload entry.

This commit is contained in:
jenchieh 2019-06-29 16:57:04 +08:00
parent 1f38085c8f
commit ca71d2a3d5

View File

@ -522,6 +522,7 @@ otherwise fetch cached tree."
;;; commands ;;; commands
;;;###autoload
(defun origami-open-node (buffer point) (defun origami-open-node (buffer point)
"Open the fold node at POINT in BUFFER. The fold node opened "Open the fold node at POINT in BUFFER. The fold node opened
will be the deepest nested at POINT." will be the deepest nested at POINT."
@ -533,6 +534,7 @@ will be the deepest nested at POINT."
(origami-fold-assoc path (lambda (node) (origami-fold-assoc path (lambda (node)
(origami-fold-open-set node t)))))))) (origami-fold-open-set node t))))))))
;;;###autoload
(defun origami-open-node-recursively (buffer point) (defun origami-open-node-recursively (buffer point)
"Open the fold node and all of its children at POINT in BUFFER. "Open the fold node and all of its children at POINT in BUFFER.
The fold node opened will be the deepest nested at POINT." The fold node opened will be the deepest nested at POINT."
@ -548,6 +550,7 @@ The fold node opened will be the deepest nested at POINT."
(origami-fold-open-set node t)) (origami-fold-open-set node t))
node)))))))) node))))))))
;;;###autoload
(defun origami-show-node (buffer point) (defun origami-show-node (buffer point)
"Like `origami-open-node' but also opens parent fold nodes "Like `origami-open-node' but also opens parent fold nodes
recursively so as to ensure the position where POINT is is recursively so as to ensure the position where POINT is is
@ -562,6 +565,7 @@ visible."
(origami-fold-open-set node t)) (origami-fold-open-set node t))
path)))))) path))))))
;;;###autoload
(defun origami-close-node (buffer point) (defun origami-close-node (buffer point)
"Close the fold node at POINT in BUFFER. The fold node closed "Close the fold node at POINT in BUFFER. The fold node closed
will be the deepest nested at POINT." will be the deepest nested at POINT."
@ -574,6 +578,7 @@ will be the deepest nested at POINT."
path (lambda (node) path (lambda (node)
(origami-fold-open-set node nil)))))))) (origami-fold-open-set node nil))))))))
;;;###autoload
(defun origami-close-node-recursively (buffer point) (defun origami-close-node-recursively (buffer point)
"Close the fold node and all of its children at POINT in BUFFER. "Close the fold node and all of its children at POINT in BUFFER.
The fold node closed will be the deepest nested at POINT." The fold node closed will be the deepest nested at POINT."
@ -589,6 +594,7 @@ The fold node closed will be the deepest nested at POINT."
(origami-fold-open-set node nil)) (origami-fold-open-set node nil))
node)))))))) node))))))))
;;;###autoload
(defun origami-toggle-node (buffer point) (defun origami-toggle-node (buffer point)
"Toggle the fold node at POINT in BUFFER open or closed. The "Toggle the fold node at POINT in BUFFER open or closed. The
fold node opened or closed will be the deepest nested at POINT." fold node opened or closed will be the deepest nested at POINT."
@ -603,6 +609,7 @@ fold node opened or closed will be the deepest nested at POINT."
node (not (origami-fold-open? node (not (origami-fold-open?
(-last-item path))))))))))) (-last-item path)))))))))))
;;;###autoload
(defun origami-forward-toggle-node (buffer point) (defun origami-forward-toggle-node (buffer point)
"Like `origami-toggle-node' but search forward in BUFFER for a "Like `origami-toggle-node' but search forward in BUFFER for a
fold node. If a fold node is found after POINT and before the fold node. If a fold node is found after POINT and before the
@ -619,6 +626,7 @@ as `origami-toggle-node'."
node (not (origami-fold-open? node (not (origami-fold-open?
(-last-item path))))))))))) (-last-item path)))))))))))
;;;###autoload
(defun origami-recursively-toggle-node (buffer point) (defun origami-recursively-toggle-node (buffer point)
"Cycle a fold node between recursively closed, open and "Cycle a fold node between recursively closed, open and
recursively open depending on its current state. The fold node recursively open depending on its current state. The fold node
@ -641,6 +649,7 @@ familiar. It's easiest to grasp this just by giving it a go."
(t (origami-open-node-recursively buffer (origami-fold-beg node)))) (t (origami-open-node-recursively buffer (origami-fold-beg node))))
(origami-forward-toggle-node buffer point))))) (origami-forward-toggle-node buffer point)))))
;;;###autoload
(defun origami-open-all-nodes (buffer) (defun origami-open-all-nodes (buffer)
"Recursively open every fold node in BUFFER." "Recursively open every fold node in BUFFER."
(interactive (list (current-buffer))) (interactive (list (current-buffer)))
@ -652,6 +661,7 @@ familiar. It's easiest to grasp this just by giving it a go."
(origami-fold-open-set node t)) (origami-fold-open-set node t))
tree))))) tree)))))
;;;###autoload
(defun origami-close-all-nodes (buffer) (defun origami-close-all-nodes (buffer)
"Recursively close every fold node in BUFFER." "Recursively close every fold node in BUFFER."
(interactive (list (current-buffer))) (interactive (list (current-buffer)))
@ -663,6 +673,7 @@ familiar. It's easiest to grasp this just by giving it a go."
(origami-fold-open-set node nil)) (origami-fold-open-set node nil))
tree))))) tree)))))
;;;###autoload
(defun origami-toggle-all-nodes (buffer) (defun origami-toggle-all-nodes (buffer)
"Toggle all fold nodes in the buffer recursively open or "Toggle all fold nodes in the buffer recursively open or
recursively closed." recursively closed."
@ -673,6 +684,7 @@ recursively closed."
(origami-close-all-nodes buffer) (origami-close-all-nodes buffer)
(origami-open-all-nodes buffer)))) (origami-open-all-nodes buffer))))
;;;###autoload
(defun origami-show-only-node (buffer point) (defun origami-show-only-node (buffer point)
"Close all fold nodes in BUFFER except for those necessary to "Close all fold nodes in BUFFER except for those necessary to
make POINT visible. Very useful for quickly collapsing everything make POINT visible. Very useful for quickly collapsing everything
@ -681,6 +693,7 @@ in the buffer other than what you are looking at."
(origami-close-all-nodes buffer) (origami-close-all-nodes buffer)
(origami-show-node buffer point)) (origami-show-node buffer point))
;;;###autoload
(defun origami-previous-fold (buffer point) (defun origami-previous-fold (buffer point)
"Move point to the beginning of the fold before POINT. If POINT "Move point to the beginning of the fold before POINT. If POINT
is in a fold, move to the beginning of the fold that POINT is is in a fold, move to the beginning of the fold that POINT is
@ -695,6 +708,7 @@ in."
(if (< state point) state pos)))) (if (< state point) state pos))))
goto-char))) goto-char)))
;;;###autoload
(defun origami-next-fold (buffer point) (defun origami-next-fold (buffer point)
"Move point to the end of the fold after POINT. If POINT is in "Move point to the end of the fold after POINT. If POINT is in
a fold, move to the end of the fold that POINT is in." a fold, move to the end of the fold that POINT is in."
@ -707,6 +721,7 @@ a fold, move to the end of the fold that POINT is in."
(->> (-last (lambda (pos) (> pos point)))) (->> (-last (lambda (pos) (> pos point))))
goto-char))) goto-char)))
;;;###autoload
(defun origami-forward-fold (buffer point) (defun origami-forward-fold (buffer point)
"Move point to the beginning of the first fold in the BUFFER "Move point to the beginning of the first fold in the BUFFER
after POINT." after POINT."
@ -719,6 +734,7 @@ after POINT."
(->> (-last (lambda (pos) (> pos point)))) (->> (-last (lambda (pos) (> pos point))))
goto-char))) goto-char)))
;;;###autoload
(defun origami-forward-fold-same-level (buffer point) (defun origami-forward-fold-same-level (buffer point)
"Move point to the beginning of the next fold in the buffer "Move point to the beginning of the next fold in the buffer
that is a sibling of the fold the point is currently in." that is a sibling of the fold the point is currently in."
@ -732,6 +748,7 @@ that is a sibling of the fold the point is currently in."
origami-fold-beg)) origami-fold-beg))
(goto-char c))))) (goto-char c)))))
;;;###autoload
(defun origami-backward-fold-same-level (buffer point) (defun origami-backward-fold-same-level (buffer point)
"Move point to the beginning of the previous fold in the buffer "Move point to the beginning of the previous fold in the buffer
that is a sibling of the fold the point is currently in." that is a sibling of the fold the point is currently in."
@ -745,6 +762,7 @@ that is a sibling of the fold the point is currently in."
origami-fold-beg)) origami-fold-beg))
(goto-char c))))) (goto-char c)))))
;;;###autoload
(defun origami-undo (buffer) (defun origami-undo (buffer)
"Undo the last folding operation applied to BUFFER. Undo "Undo the last folding operation applied to BUFFER. Undo
history is linear. If you undo some fold operations and then history is linear. If you undo some fold operations and then
@ -756,6 +774,7 @@ operations undone."
(let ((old-tree (origami-get-cached-tree buffer))) (let ((old-tree (origami-get-cached-tree buffer)))
(origami-apply-new-tree buffer current-tree old-tree)))) (origami-apply-new-tree buffer current-tree old-tree))))
;;;###autoload
(defun origami-redo (buffer) (defun origami-redo (buffer)
"Redo the last folding operation applied to BUFFER. You can "Redo the last folding operation applied to BUFFER. You can
only redo undone operations while a new folding operation hasn't only redo undone operations while a new folding operation hasn't
@ -766,6 +785,7 @@ been performed to BUFFER."
(let ((new-tree (origami-get-cached-tree buffer))) (let ((new-tree (origami-get-cached-tree buffer)))
(origami-apply-new-tree buffer current-tree new-tree)))) (origami-apply-new-tree buffer current-tree new-tree))))
;;;###autoload
(defun origami-reset (buffer) (defun origami-reset (buffer)
"Remove all folds from BUFFER and reset all origami state "Remove all folds from BUFFER and reset all origami state
associated with this buffer. Useful during development or if you associated with this buffer. Useful during development or if you