emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Kaushal Modi <kaushal.modi@gmail.com>,
	emacs-org list <emacs-orgmode@gnu.org>
Subject: [PATCH] Silence byte-compiler under "make single"
Date: Fri, 26 May 2017 00:32:40 -0400	[thread overview]
Message-ID: <87fufsutjr.fsf@kyleam.com> (raw)
In-Reply-To: <87inkouy4f.fsf@kyleam.com>

Kyle Meyer <kyle@kyleam.com> 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 <kaushal.modi@gmail.com>
<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	other threads:[~2017-05-26  4:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25 22:31 Fix org.el compilation warnings Kaushal Modi
2017-05-25 23:59 ` Kyle Meyer
2017-05-26  0:35   ` Kaushal Modi
2017-05-26  2:53     ` Kyle Meyer
2017-05-26  4:32       ` Kyle Meyer [this message]
2017-05-26 18:14       ` Kaushal Modi
2017-05-26 20:45         ` Kyle Meyer
2017-05-26 22:31           ` Kaushal Modi
2017-05-26 23:17             ` syncing with Emacs (was: Fix org.el compilation warnings) Kyle Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fufsutjr.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kaushal.modi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).