From 6c1b41bd685f6b9fa5e8aca558cd3eb8c9b0cf9b Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 28 May 2014 13:18:05 +0200 Subject: [PATCH 1/6] 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. --- lisp/org.el | 8 +++++--- lisp/ox.el | 13 ++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 78d82a7ec..209f43009 100644 --- a/lisp/org.el +++ b/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. diff --git a/lisp/ox.el b/lisp/ox.el index d40303c44..f4f2c591f 100644 --- a/lisp/ox.el +++ b/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. From 3a736c51bcc50d04d89197fcabd4d7b30f3f3dba Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 28 May 2014 14:16:21 +0200 Subject: [PATCH 2/6] org-entities: forward declaration of org-toggle-pretty-entities and org-pretty-entities * lisp/org-entities.el: Remove superfluous require of org-macs. Forward declare 'org-toggle-pretty-entities' and 'org-pretty-entities'. --- lisp/org-entities.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org-entities.el b/lisp/org-entities.el index ba1eed12b..6324a625d 100644 --- a/lisp/org-entities.el +++ b/lisp/org-entities.el @@ -27,9 +27,8 @@ ;;; Code: -(require 'org-macs) - -(declare-function org-table-align "org-table" ()) +(declare-function org-toggle-pretty-entities "org" ()) +(declare-function org-table-align "org-table" ()) (eval-when-compile (require 'cl)) @@ -568,6 +567,7 @@ Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'." (goto-char pos) (org-table-align))) +(defvar org-pretty-entities) ;; declare defcustom from org (defun org-entities-help () "Create a Help buffer with all available entities." (interactive) From 310b9dd2b6c8e7103641b9f3e785dedea2a99f99 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 28 May 2014 14:40:52 +0200 Subject: [PATCH 3/6] ob-C: lexical-let requires cl at compilation time * lisp/ob-C.el: Require cl during compilation so that lexical-let is known. --- lisp/ob-C.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/ob-C.el b/lisp/ob-C.el index c460be326..2fcec790c 100644 --- a/lisp/ob-C.el +++ b/lisp/ob-C.el @@ -30,6 +30,8 @@ ;; - not much in the way of error feedback ;;; Code: +(eval-when-compile + (require 'cl)) (require 'ob) (require 'cc-mode) From 61b80915964f304f5778e6476c2ce5470a7a6d4d Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 28 May 2014 14:47:23 +0200 Subject: [PATCH 4/6] ob-core:forward declare org-every * lisp/ob-core.el (org-every): Forward declare 'org-every'. --- lisp/ob-core.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 7e77dca66..20d3f569f 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -38,6 +38,7 @@ (defvar org-src-lang-modes) (defvar org-babel-library-of-babel) (declare-function show-all "outline" ()) +(declare-function org-every "org" (pred seq)) (declare-function org-reduce "org" (CL-FUNC CL-SEQ &rest CL-KEYS)) (declare-function org-mark-ring-push "org" (&optional pos buffer)) (declare-function tramp-compat-make-temp-file "tramp-compat" From 790f5b4d3a898f00bda38a7ea09b8cb51e801a45 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 28 May 2014 14:52:14 +0200 Subject: [PATCH 5/6] ob-core, ob-exp, ob-haskell, ob-python: declarations for org-src-preserve-indentations * lisp/ob-core.el: Add comment to forward declaration of 'org-src-preserve-indentations'. * lisp/ob-exp.el: Require org-src to import 'org-src-preserve-indentations'. * lisp/ob-haskell.el, lisp/ob-python.el: Remove superfluous forward declaration of 'org-src-preserve-indentations', since it gets imported by other requires. --- lisp/ob-core.el | 2 +- lisp/ob-exp.el | 1 + lisp/ob-haskell.el | 1 - lisp/ob-python.el | 2 -- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 20d3f569f..eef408fd4 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -1349,7 +1349,7 @@ specified in the properties of the current outline entry." (org-entry-get org-babel-current-src-block-location (concat "header-args:" lang) 'inherit)))))) -(defvar org-src-preserve-indentation) +(defvar org-src-preserve-indentation) ;; declare defcustom from org-src (defun org-babel-parse-src-block-match () "Parse the results from a match of the `org-babel-src-block-regexp'." (let* ((block-indentation (length (match-string 1))) diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index 6d65496db..761c9f17a 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -24,6 +24,7 @@ ;;; Code: (require 'ob-core) +(require 'org-src) (eval-when-compile (require 'cl)) diff --git a/lisp/ob-haskell.el b/lisp/ob-haskell.el index 22240addd..00066702a 100644 --- a/lisp/ob-haskell.el +++ b/lisp/ob-haskell.el @@ -147,7 +147,6 @@ specifying a variable of the same value." (concat "[" (mapconcat #'org-babel-haskell-var-to-haskell var ", ") "]") (format "%S" var))) -(defvar org-src-preserve-indentation) (defvar org-export-copy-to-kill-ring) (declare-function org-export-to-file "ox" (backend file diff --git a/lisp/ob-python.el b/lisp/ob-python.el index baa5764ac..7cee10466 100644 --- a/lisp/ob-python.el +++ b/lisp/ob-python.el @@ -56,8 +56,6 @@ This will typically be either 'python or 'python-mode." :package-version '(Org . "8.0") :type 'symbol) -(defvar org-src-preserve-indentation) - (defcustom org-babel-python-hline-to "None" "Replace hlines in incoming tables with this when translating to python." :group 'org-babel From 3d973cdc6eff3f07dbe938ab1c59727aefd6c03e Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 28 May 2014 15:17:29 +0200 Subject: [PATCH 6/6] org: add forward declarations * lisp/org.el: Add forward declarations for a number of functions that the compiler otherwise warns about as potentially undefined at runtime. --- lisp/org.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lisp/org.el b/lisp/org.el index 209f43009..235019cad 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -111,6 +111,8 @@ Stars are put in group 1 and the trimmed body in group 2.") (unless (boundp 'diary-fancy-buffer) (org-defvaralias 'diary-fancy-buffer 'fancy-diary-buffer)) +(declare-function org-add-archive-files "org-archive" (files)) + (declare-function org-inlinetask-at-task-p "org-inlinetask" ()) (declare-function org-inlinetask-outline-regexp "org-inlinetask" ()) (declare-function org-inlinetask-toggle-visibility "org-inlinetask" ()) @@ -118,7 +120,10 @@ Stars are put in group 1 and the trimmed body in group 2.") (declare-function org-clock-get-last-clock-out-time "org-clock" ()) (declare-function org-clock-timestamps-up "org-clock" (&optional n)) (declare-function org-clock-timestamps-down "org-clock" (&optional n)) +(declare-function org-clock-remove-overlays "org-clock" (&optional beg end noremove)) (declare-function org-clock-sum-current-item "org-clock" (&optional tstart)) +(declare-function org-clock-update-time-maybe "org-clock" ()) +(declare-function org-clocktable-shift "org-clock" (dir n)) (declare-function orgtbl-mode "org-table" (&optional arg)) (declare-function org-clock-out "org-clock" (&optional switch-to-state fail-quietly at-time)) @@ -133,6 +138,10 @@ Stars are put in group 1 and the trimmed body in group 2.") (declare-function org-agenda-list "org-agenda" (&optional arg start-day span)) (declare-function org-agenda-redo "org-agenda" (&optional all)) (declare-function org-table-align "org-table" ()) +(declare-function org-table-begin "org-table" (&optional table-type)) +(declare-function org-table-blank-field "org-table" ()) +(declare-function org-table-end "org-table" (&optional table-type)) +(declare-function org-table-insert-row "org-table" (&optional arg)) (declare-function org-table-paste-rectangle "org-table" ()) (declare-function org-table-maybe-eval-formula "org-table" ()) (declare-function org-table-maybe-recalculate-line "org-table" ()) @@ -179,6 +188,7 @@ Stars are put in group 1 and the trimmed body in group 2.") (intern (concat "org-babel-expand-body:" lang))))))) org-babel-load-languages)) +(declare-function org-babel-tangle-file "ob-tangle" (file &optional target-file lang)) ;;;###autoload (defun org-babel-load-file (file &optional compile) "Load Emacs Lisp source code blocks in the Org-mode FILE.