From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Fix org.el compilation warnings Date: Fri, 26 May 2017 18:14:37 +0000 Message-ID: References: <87mva0v66x.fsf@kyleam.com> <87inkouy4f.fsf@kyleam.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f403045f8444187302055071500a" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEJlE-0006xD-5Q for emacs-orgmode@gnu.org; Fri, 26 May 2017 14:14:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEJlC-0004cv-W0 for emacs-orgmode@gnu.org; Fri, 26 May 2017 14:14:52 -0400 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:32817) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dEJlC-0004cp-JD for emacs-orgmode@gnu.org; Fri, 26 May 2017 14:14:50 -0400 Received: by mail-lf0-x22c.google.com with SMTP id m18so10043740lfj.0 for ; Fri, 26 May 2017 11:14:50 -0700 (PDT) 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: Kyle Meyer , emacs-org list --f403045f8444187302055071500a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Below update is after I updated to the latest org master: On Thu, May 25, 2017 at 10:53 PM Kyle Meyer wrote: > Ah, right ... 'make compile' uses a single Emacs instance, while 'make > single' uses a separate Emacs instance for each file. > I wasn't even doing that. I was doing M-x byte-compile-file and selecting org.el. That gives me (without applying your patch): Compiling file /home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/org-mode/lisp/org.el at Fri May 26 14:04:52 2017 In org-goto-map: org.el:7412:9:Warning: function org-goto-map used to take 0+ arguments, now takes 0 In org-todo: org.el:12398:12:Warning: function org-todo used to take 0+ arguments, now takes 0-1 In org-store-log-note: org.el:13635:8:Warning: function org-store-log-note used to take 0+ arguments, now takes 0 In org-at-timestamp-p: org.el:17909:40:Warning: reference to free variable =E2=80=98org-agenda-include-inactive-timestamps=E2=80=99 In org-self-insert-command: org.el:19910:32:Warning: function org-self-insert-command used to take 0+ arguments, now takes 1 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 > I get that too. > Your patch is only the appropriate fix if we're confident that > org-agenda will be loaded at the time that the > org-agenda-include-inactive-timestamps code path of org-at-timestamp-p > is executed. Otherwise, we're just silencing a warning about a possible > run-time void variable error. Have you looked this? No, I didn't.. your bound-and-true-p patch makes more sense. So.. should we consider the warnings output by simple byte-compile-file? Even if not, the warnings do not make sense.. just taking this example: In org-goto-map: org.el:7412:9:Warning: function org-goto-map used to take 0+ arguments, now takes 0 Nowhere is org-goto-map defined to take 0+ arguments (meaning have "&optional arg" as signature) and then redefined to have 0 arguments (which is the actual case). Wondering why the compiler thinks that. I had a quick look at byte-compile-arglist-warn function that outputs this warning.. but couldn't understand the logic for sig1 in there. --=20 Kaushal Modi --f403045f8444187302055071500a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Below update is after I up= dated to the latest org master:

On Thu= , May 25, 2017 at 10:53 PM Kyle Meyer <kyle@kyleam.com> wrote:
Ah= , right ... 'make compile' uses a single Emacs instance, while '= ;make
single' uses a separate Emacs instance for each file.
<= div>
I wasn't even doing that. I was doing M-x byte-compi= le-file and selecting org.el.

That gives me (witho= ut applying your patch):

=0C
Compil= ing file /home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/org-mode/lis= p/org.el at Fri May 26 14:04:52 2017

In org-goto-m= ap:
org.el:7412:9:Warning: function org-goto-map used to take 0+ = arguments, now
=C2=A0 =C2=A0 takes 0

In = org-todo:
org.el:12398:12:Warning: function org-todo used to take= 0+ arguments, now
=C2=A0 =C2=A0 takes 0-1

In org-store-log-note:
org.el:13635:8:Warning: function org-st= ore-log-note used to take 0+ arguments,
=C2=A0 =C2=A0 now takes 0=

In org-at-timestamp-p:
org.el:17909:40:= Warning: reference to free variable
=C2=A0 =C2=A0 =E2=80=98org-ag= enda-include-inactive-timestamps=E2=80=99

In org-s= elf-insert-command:
org.el:19910:32:Warning: function org-self-in= sert-command used to take 0+
=C2=A0 =C2=A0 arguments, now takes 1=

With 'make si= ngle' 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).

=C2=A0 =C2=A0 In toplevel form:
=C2=A0 =C2=A0 org.el:7914:51:Error: Symbol=E2=80=99s value as variable is v= oid: org-comment-string

I get that too.=
=C2=A0
Your patch is only the appropriate fix if we're confident that
org-agenda will be loaded at the time that the
org-agenda-include-inactive-timestamps code path of org-at-timestamp-p
is executed.=C2=A0 Otherwise, we're just silencing a warning about a po= ssible
run-time void variable error.=C2=A0 Have you looked this?
=
No, I didn't.. your bound-and-true-p patch makes more se= nse.

So.. should we consider the warnings output b= y simple byte-compile-file? Even if not, the warnings do not make sense.. j= ust taking this example:

In org-goto-map:
org.el:7412:9:Warning: function org-goto-map used to take 0+ arguments, n= ow
=C2=A0 =C2=A0 takes 0=C2=A0

Nowhere i= s org-goto-map defined to take 0+ arguments (meaning have "&option= al arg" as signature) and then redefined to have 0 arguments (which is= the actual case). Wondering why the compiler thinks that. I had a quick lo= ok at=C2=A0byte-compile-arglist-warn function that outputs this warning.. b= ut couldn't understand the logic for sig1 in there.
--

Kaushal Modi

--f403045f8444187302055071500a--