Browse Source

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.
Bastien Guerry 13 years ago
parent
commit
7d117bd981
1 changed files with 4 additions and 0 deletions
  1. 4 0
      lisp/org.el

+ 4 - 0
lisp/org.el

@@ -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