emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] Silence byte-compiler under "make single"


From: Kyle Meyer
Subject: [O] [PATCH] Silence byte-compiler under "make single"
Date: Fri, 26 May 2017 00:32:40 -0400

Kyle Meyer <address@hidden> writes:

> With 'make single' on master, I get a compile error due to the
> eval-when-compile's added in 53ee147f4 (Add support for new switches to
> org-get-heading, 2017-01-17) and 6dc6eb3b0 (Fix failing test,
> 2017-01-19).
>
>     In toplevel form:
>     org.el:7914:51:Error: Symbol’s value as variable is void: 
> org-comment-string
>
> If I wrap (defconst org-comment-string ...) in eval-and-compile to get
> rid of those, I see your reported warning and a few others (but not the
> others that you reported):
>
>     In org-at-timestamp-p:
>     org.el:17946:40:Warning: reference to free variable
>         ‘org-agenda-include-inactive-timestamps’
>     
>     In org--get-expected-indentation:
>     org.el:22608:28:Warning: reference to free variable
>         ‘org-element-greater-elements’
>     
>     In end of data:
>     org.el:24980:1:Warning: the following functions are not known to be 
> defined:
>         org-table-sort-lines, org-duration-from-minutes

The org-element-greater-elements warning was the only warning present on
maint, and that's covered by 6d4c188e3 now on the tip of maint.  The
following patch should take care of the rest of the "make single" issues
on master (with Emacs 25.2, at least).

-- >8 --
Subject: [PATCH] Silence byte-compiler under "make single"

* lisp/org.el (org-comment-string): Wrap definition in an
eval-and-compile because this variable is used within the body of
eval-when-compile, leading to an error under "make single".
(org-at-timestamp-p): Use bound-and-true-p to check
org-agenda-include-inactive-timestamps because org-agenda may not be
loaded yet.

Reported-by: Kaushal Modi <address@hidden>
<https://lists.gnu.org/archive/html/emacs-orgmode/2017-05/msg00326.html>
---
 lisp/org.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index a50966ea1..59cc9b4cb 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -129,6 +129,8 @@ (declare-function org-clock-timestamps-down "org-clock" 
(&optional n))
 (declare-function org-clock-timestamps-up "org-clock" (&optional n))
 (declare-function org-clock-update-time-maybe "org-clock" ())
 (declare-function org-clocktable-shift "org-clock" (dir n))
+(declare-function
+ org-duration-from-minutes "org-duration" (minutes &optional fmt canonical))
 (declare-function org-element-at-point "org-element" ())
 (declare-function org-element-cache-refresh "org-element" (pos))
 (declare-function org-element-cache-reset "org-element" (&optional all))
@@ -167,6 +169,9 @@ (declare-function org-table-maybe-recalculate-line 
"org-table" ())
 (declare-function org-table-next-row "org-table" ())
 (declare-function org-table-paste-rectangle "org-table" ())
 (declare-function org-table-recalculate "org-table" (&optional all noalign))
+(declare-function
+ org-table-sort-lines "org-table"
+ (&optional with-case sorting-type getkey-func compare-func interactive?))
 (declare-function org-table-wrap-region "org-table" (arg))
 (declare-function org-tags-view "org-agenda" (&optional todo-only match))
 (declare-function orgtbl-ascii-plot "org-table" (&optional ask))
@@ -525,11 +530,12 @@ (defconst org-archive-tag "ARCHIVE"
 An archived subtree does not open during visibility cycling, and does
 not contribute to the agenda listings.")
 
-(defconst org-comment-string "COMMENT"
-  "Entries starting with this keyword will never be exported.
+(eval-and-compile
+  (defconst org-comment-string "COMMENT"
+    "Entries starting with this keyword will never be exported.
 \\<org-mode-map>
 An entry can be toggled between COMMENT and normal with
-`\\[org-toggle-comment]'.")
+`\\[org-toggle-comment]'."))
 
 
 ;;;; LaTeX Environments and Fragments
@@ -17942,7 +17948,8 @@ (defun org-at-timestamp-p (&optional extended)
                     (or (and (eq extended 'agenda)
                              (or (org-at-planning-p)
                                  (org-at-property-p)
-                                 (and org-agenda-include-inactive-timestamps
+                                 (and (bound-and-true-p
+                                       org-agenda-include-inactive-timestamps)
                                       (org-at-clock-log-p))))
                         (eq 'timestamp
                             (save-excursion
-- 
2.13.0





reply via email to

[Prev in Thread] Current Thread [Next in Thread]