mirror of
https://github.com/vale981/boon
synced 2025-03-05 09:31:43 -05:00
attempt 2
This commit is contained in:
parent
e5591395f3
commit
6f696084a9
1 changed files with 18 additions and 14 deletions
|
@ -70,20 +70,24 @@ This item is either the symbol at point, or, if this fails, the sexp at point."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(skip-chars-forward "^|") (point))))))
|
(skip-chars-forward "^|") (point))))))
|
||||||
|
|
||||||
(with-eval-after-load 'org
|
(declare-function org-back-to-heading "org" (&optional invisible-ok))
|
||||||
(defun boon-select-org-tree ()
|
(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
|
||||||
"Return the region corresponding to the current subtree."
|
(declare-function org-at-heading-p "org" (&optional ignored))
|
||||||
(interactive)
|
(declare-function org-with-limited-levels "org-macs" (&rest body))
|
||||||
(lambda ()
|
|
||||||
(boon-regs-from-bounds
|
(defun boon-select-org-tree ()
|
||||||
(save-excursion
|
"Return the region corresponding to the current subtree."
|
||||||
(save-match-data
|
(interactive)
|
||||||
(org-with-limited-levels
|
(lambda ()
|
||||||
(cons
|
(boon-regs-from-bounds
|
||||||
(progn (org-back-to-heading t) (point))
|
(save-excursion
|
||||||
(progn (org-end-of-subtree t t)
|
(save-match-data
|
||||||
(when (and (org-at-heading-p) (not (eobp))) (backward-char 1))
|
(org-with-limited-levels
|
||||||
(point))))))))))
|
(cons
|
||||||
|
(progn (org-back-to-heading t) (point))
|
||||||
|
(progn (org-end-of-subtree t t)
|
||||||
|
(when (and (org-at-heading-p) (not (eobp))) (backward-char 1))
|
||||||
|
(point)))))))))
|
||||||
|
|
||||||
(defun boon-select-justline ()
|
(defun boon-select-justline ()
|
||||||
"Return the region of the current line, without any newline."
|
"Return the region of the current line, without any newline."
|
||||||
|
|
Loading…
Add table
Reference in a new issue