Ver Fonte

org, ox: move defsubst before first use

* lisp/ox.el (org-export-get-parent): Move definition of
  'org-export-get-parent' before first use.  Leave comment at original
  place of definition.

* lisp/org.el (org-uniquify): Move definition of 'org-uniquify' before
  first use.  Leave comment at original place of definition.
Achim Gratz há 11 anos atrás
pai
commit
6c1b41bd68
2 ficheiros alterados com 13 adições e 8 exclusões
  1. 5 3
      lisp/org.el
  2. 8 5
      lisp/ox.el

+ 5 - 3
lisp/org.el

@@ -10602,6 +10602,10 @@ application the system uses for this file type."
     (move-marker org-open-link-marker nil)
     (run-hook-with-args 'org-follow-link-hook)))
 
+(defsubst org-uniquify (list)
+  "Non-destructively remove duplicate elements from LIST."
+  (let ((res (copy-sequence list))) (delete-dups res)))
+
 (defun org-offer-links-in-entry (buffer marker &optional nth zero)
   "Offer links in the current entry and return the selected link.
 If there is only one link, return it.
@@ -21832,9 +21836,7 @@ for the search purpose."
   "Return the reverse of STRING."
   (apply 'string (reverse (string-to-list string))))
 
-(defsubst org-uniquify (list)
-  "Non-destructively remove duplicate elements from LIST."
-  (let ((res (copy-sequence list))) (delete-dups res)))
+;; defsubst org-uniquify must be defined before first use
 
 (defun org-uniquify-alist (alist)
   "Merge elements of ALIST with the same key.

+ 8 - 5
lisp/ox.el

@@ -1843,6 +1843,13 @@ an alist where associations are (VARIABLE-NAME VALUE)."
       ;; Return value in appropriate order of appearance.
       (nreverse (funcall collect-bind nil nil)))))
 
+;; defsubst org-export-get-parent must be defined before first use,
+;; was originally defined in the topology section
+
+(defsubst org-export-get-parent (blob)
+  "Return BLOB parent or nil.
+BLOB is the element or object considered."
+  (org-element-property :parent blob))
 
 ;;;; Tree Properties
 ;;
@@ -5105,11 +5112,7 @@ Return the new string."
 ;; `org-export-get-genealogy' returns the full genealogy of a given
 ;; element or object, from closest parent to full parse tree.
 
-(defsubst org-export-get-parent (blob)
-  "Return BLOB parent or nil.
-BLOB is the element or object considered."
-  (org-element-property :parent blob))
-
+;; defsubst org-export-get-parent must be defined before first use
 (defun org-export-get-genealogy (blob)
   "Return full genealogy relative to a given element or object.