From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: [PATCH] Silence byte-compiler under "make single" Date: Fri, 26 May 2017 00:32:40 -0400 Message-ID: <87fufsutjr.fsf@kyleam.com> References: <87mva0v66x.fsf@kyleam.com> <87inkouy4f.fsf@kyleam.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dE6vg-0005TP-8N for emacs-orgmode@gnu.org; Fri, 26 May 2017 00:32:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dE6vb-0004hT-NX for emacs-orgmode@gnu.org; Fri, 26 May 2017 00:32:48 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:54688 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dE6vb-0004fR-Gb for emacs-orgmode@gnu.org; Fri, 26 May 2017 00:32:43 -0400 In-Reply-To: <87inkouy4f.fsf@kyleam.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Kaushal Modi , emacs-org list Kyle Meyer 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=E2=80=99s 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 > =E2=80=98org-agenda-include-inactive-timestamps=E2=80=99 >=20=20=20=20=20 > In org--get-expected-indentation: > org.el:22608:28:Warning: reference to free variable > =E2=80=98org-element-greater-elements=E2=80=99 >=20=20=20=20=20 > In end of data: > org.el:24980:1:Warning: the following functions are not known to be d= efined: > 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 --- 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.") =20 -(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. \\ An entry can be toggled between COMMENT and normal with -`\\[org-toggle-comment]'.") +`\\[org-toggle-comment]'.")) =20 =20 ;;;; 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 --=20 2.13.0