From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#16573: 24.3; Auctex (11.87.2) in Elpa issues hundreds of warnings on compile Date: Fri, 31 Jan 2014 10:50:06 +0100 Message-ID: <87eh3obhv5.fsf__9960.24525161392$1391161894$gmane$org@thinkpad-t61.fritz.box> References: <87a9ee8u1y.fsf@thinkpad-t61.fritz.box> <87ppn9nbn4.fsf@gnu.org> <87lhxxn4rn.fsf@gnu.org> <87a9edmwzb.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1391161881 11797 80.91.229.3 (31 Jan 2014 09:51:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jan 2014 09:51:21 +0000 (UTC) Cc: David Kastrup , Neil Jackson , 16573@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 31 10:51:28 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W9Akx-0003XD-DH for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Jan 2014 10:51:27 +0100 Original-Received: from localhost ([::1]:53991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Akw-0004Vb-Vo for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Jan 2014 04:51:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Ako-0004VK-Ta for bug-gnu-emacs@gnu.org; Fri, 31 Jan 2014 04:51:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9Akj-0000KR-Iv for bug-gnu-emacs@gnu.org; Fri, 31 Jan 2014 04:51:18 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9AkY-0000Im-QR; Fri, 31 Jan 2014 04:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W9AkY-0007FU-6T; Fri, 31 Jan 2014 04:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-auctex@gnu.org Resent-Date: Fri, 31 Jan 2014 09:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16573 X-GNU-PR-Package: emacs,auctex X-GNU-PR-Keywords: Original-Received: via spool by 16573-submit@debbugs.gnu.org id=B16573.139116181827808 (code B ref 16573); Fri, 31 Jan 2014 09:51:02 +0000 Original-Received: (at 16573) by debbugs.gnu.org; 31 Jan 2014 09:50:18 +0000 Original-Received: from localhost ([127.0.0.1]:42358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9Ajq-0007ER-6f for submit@debbugs.gnu.org; Fri, 31 Jan 2014 04:50:18 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:58145) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9Ajm-0007EH-NO for 16573@debbugs.gnu.org; Fri, 31 Jan 2014 04:50:15 -0500 Original-Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 057A620EE9; Fri, 31 Jan 2014 04:50:13 -0500 (EST) Original-Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Fri, 31 Jan 2014 04:50:14 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:cc:subject:references:date :in-reply-to:message-id:mime-version:content-type; s=smtpout; bh=R/6weaoSc1p6dpZFv5CU1Vm1pgQ=; b=jgf7xGqLSIKF5/BCKmLuGNMtxKBo kFsZiW37u3DtKVnoyM1wotw7qEhosEVLVRAilymYVkauyOvQdrTOTgfUpaosT+uw eY6sj45S8SJUrOzK3ngZIEwKO7Y8ruH5kcOKcij6ttsY1xzNmb80MCfq6itJDZS9 hOvh/9enGWktYzw= X-Sasl-enc: BEBjCTLfh3RukKnqwxTizsXZPWx/eYeNsQNl1ldl+MlH 1391161813 Original-Received: from thinkpad-t61.fritz.box (unknown [95.88.145.206]) by mail.messagingengine.com (Postfix) with ESMTPA id A4656680228; Fri, 31 Jan 2014 04:50:12 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Thu, 30 Jan 2014 10:41:18 -0500") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:84337 Archived-At: Stefan Monnier writes: >> 1. Many TeX-* and LaTeX-* functions and variables are not generated >> before tex.el and latex.el are loaded. AUCTeX has an auto parser > [...] >> The byte-compiler doesn't seem to execute top-level funcalls, so all >> those functions/vars are unknown at compile-time. > > Indeed, the byte-compiler compiles the code, rather than executes it. > > But if it sees a (require 'foo) it will run that (require 'foo), > i.e. it will load foo.el(c), which executes all of the code in there. > So a (require 'tex) will execute (TeX-auto-add-type "symbol" "TeX") at > compile-time, and will hence cause TeX-symbol-list to exist at > compile-time. Ah, ok, but that doesn't help when foo.el does (TeX-auto-add-type "foo" "TeX") and uses the generated functions itself, like it's done by tex.el, latex.el, and all style files that define their own auto parsers. Concretely, I still get warnings if tex.el uses (TeX-symbol-list) generated by (TeX-auto-add-type "symbol" "TeX"), but if latex uses the same function, it's ok for the compiler. >> (TeX-auto-add-type "acronym" "LaTeX") > [...] >> I guess I should wrap those TeX-auto-add-type calls with a >> `eval-when-compile', right? > > You could. No, I get a compile error in tex.el when compiling (defun TeX-auto-add-type (...) ...) ... (eval-when-compile (TeX-auto-add-type "symbol" "TeX")) because then TeX-auto-add-type is not known at compile-time. So then I'd need to wrap the defun, too, and also the function and variables that are used in TeX-auto-add-type. That doesn't seem manageable... And if I wrap, e.g., the (TeX-auto-add-type "environment" "LaTeX") with eval-with-compile, it compiles fine (cause it's in latex.el which requires tex.el) and I get rid of some free-vars and unresolved warnings, but then I get an error when finding a latex document. Debugger entered--Lisp error: (void-function LaTeX-add-environments-auto) Wrapping with (eval-when (compile load eval) ...) seems to work, but I'm not sure if that's a good idea. > Or you could turn them into macros. Indeed, that looks like a typical use-case for macros, but I'm rather sure that there's a good reason that the auto parser stuff is like it is. David? >> 3. How should one deal with code like this? >> (when (featurep 'font-latex) >> (font-latex-add-keywords ...)) > > (when (fboundp 'font-latex-add-keywords) > (font-latex-add-keywords ...)) While we are at it: David, is there any reason why somebody would want to set TeX-install-font-lock to 'ignore nowadays so that font-latex is not loaded? If not, I'm tempted to remove the variable, require font-latex in tex.el, and get rid of all those boundness checks in the styles. >> 4. Or with code like this? >> >> (defun foo () >> (require 'url-util) >> (url-util-* ...)) > > Good question. We usually use `declare-function' for these, but > admittedly, it's not a great solution. I see. The reason for the code above is that foo is only callable in very special conditions. Concretely, there're some functions that are only used with recent GNU emacs version with dbus support and the user using Evince as pdf viewer. Bye, Tassilo