mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-12 06:09:54 +00:00
org.el: Add (require 'org-element) for more org-element commands
* org.el (org-mark-element, org-narrow-to-element) (org-transpose-element): Require org-element.
This commit is contained in:
parent
36def959ab
commit
7d117bd981
|
@ -21977,6 +21977,7 @@ Interactively, if this command is repeated or (in Transient Mark
|
||||||
mode) if the mark is active, it marks the next element after the
|
mode) if the mark is active, it marks the next element after the
|
||||||
ones already marked."
|
ones already marked."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(require 'org-element)
|
||||||
(let (deactivate-mark)
|
(let (deactivate-mark)
|
||||||
(if (or (and (eq last-command this-command) (mark t))
|
(if (or (and (eq last-command this-command) (mark t))
|
||||||
(and transient-mark-mode mark-active))
|
(and transient-mark-mode mark-active))
|
||||||
|
@ -21993,6 +21994,7 @@ ones already marked."
|
||||||
(defun org-narrow-to-element ()
|
(defun org-narrow-to-element ()
|
||||||
"Narrow buffer to current element."
|
"Narrow buffer to current element."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(require 'org-element)
|
||||||
(let ((elem (org-element-at-point)))
|
(let ((elem (org-element-at-point)))
|
||||||
(cond
|
(cond
|
||||||
((eq (car elem) 'headline)
|
((eq (car elem) 'headline)
|
||||||
|
@ -22013,6 +22015,7 @@ ones already marked."
|
||||||
"Transpose current and previous elements, keeping blank lines between.
|
"Transpose current and previous elements, keeping blank lines between.
|
||||||
Point is moved after both elements."
|
Point is moved after both elements."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(require 'org-element)
|
||||||
(org-skip-whitespace)
|
(org-skip-whitespace)
|
||||||
(let ((end (org-element-property :end (org-element-at-point))))
|
(let ((end (org-element-property :end (org-element-at-point))))
|
||||||
(org-drag-element-backward)
|
(org-drag-element-backward)
|
||||||
|
@ -22026,6 +22029,7 @@ modified."
|
||||||
(interactive)
|
(interactive)
|
||||||
(unless (eq major-mode 'org-mode)
|
(unless (eq major-mode 'org-mode)
|
||||||
(error "Cannot un-indent a buffer not in Org mode"))
|
(error "Cannot un-indent a buffer not in Org mode"))
|
||||||
|
(require 'org-element)
|
||||||
(let* ((parse-tree (org-element-parse-buffer 'greater-element))
|
(let* ((parse-tree (org-element-parse-buffer 'greater-element))
|
||||||
unindent-tree ; For byte-compiler.
|
unindent-tree ; For byte-compiler.
|
||||||
(unindent-tree
|
(unindent-tree
|
||||||
|
|
Loading…
Reference in a new issue