From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleksandr Gavenko Newsgroups: gmane.emacs.help Subject: Re: (require ...) and file dependencies. Date: Sat, 03 Jan 2015 16:04:00 +0200 Organization: Oleksandr Gavenko , http://gavenkoa.users.sf.net Message-ID: <87y4pk9d0v.fsf@gavenkoa.example.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1420293885 23298 80.91.229.3 (3 Jan 2015 14:04:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 Jan 2015 14:04:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 03 15:04:38 2015 Return-path: Envelope-to: geh-help-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 1Y7PJj-0005pp-BP for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Jan 2015 15:04:35 +0100 Original-Received: from localhost ([::1]:54477 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7PJi-00034o-Nm for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Jan 2015 09:04:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7PJW-00034j-Or for help-gnu-emacs@gnu.org; Sat, 03 Jan 2015 09:04:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y7PJS-0007Eh-OR for help-gnu-emacs@gnu.org; Sat, 03 Jan 2015 09:04:22 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:42378) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7PJS-0007Ec-HK for help-gnu-emacs@gnu.org; Sat, 03 Jan 2015 09:04:18 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Y7PJP-0005lX-55 for help-gnu-emacs@gnu.org; Sat, 03 Jan 2015 15:04:15 +0100 Original-Received: from 46.211.79.104 ([46.211.79.104]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 03 Jan 2015 15:04:15 +0100 Original-Received: from gavenkoa by 46.211.79.104 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 03 Jan 2015 15:04:15 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 106 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 46.211.79.104 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:KmSVngxiunc28UN6QQNNu74iPPc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:101863 Archived-At: On 2014-12-28, Stefan Monnier wrote: >> They may fixed by: >> >> (eval-when-compile >> (defvar ...)) > > No, it's fixed with > > (defvar ) > > Siuch (defvar ) declarations (i.e. without an initial value) are > annotations for the *compiler*, so you don't want to pas them to the > `eval'uator (hence you don't want to wrap them in `eval-when-compile'). > The fact that they also work when wrapped in `eval-when-compile' is an > accident which might get fixed at any point. Thanks for tips. I found: >> (eval-when-compile >> (defvar ...)) by grepping some sources. I usually try to check how things done by another before inventing own style. Currently Emacs sources have some occurrences of such code (so I send replay also in private to rise attention). I run: ack -C 4 eval-when-compile # with 4 line context and look to `defvar`. Before showing complete list I put weird code, which seems need to be fixed: lisp/progmodes/sql.el 1391:(eval-when-compile 1392- (defvar sql-mode-ansi-font-lock-keywords) 1393- (setq sql-mode-ansi-font-lock-keywords nil)) Here strange comment and strange conditional defvar: lisp/progmodes/verilog-mode.el 8407:(eval-when-compile 8408- ;; Prevent compile warnings; these are let's, not globals 8409: ;; Do not remove the eval-when-compile 8410- ;; - we want an error when we are debugging this code if they are refed. 8411- (defvar sigs-in) 8412- (defvar sigs-inout) 8413- (defvar sigs-intf) (defvar sigs-out) (defvar sigs-out-d) (defvar sigs-out-i) (defvar sigs-out-unk) (defvar sigs-temp) ;; These are known to be from other packages and may not be defined (defvar diff-command nil) (defvar vector-skip-list) ;; There are known to be from newer versions of Emacs (defvar create-lockfiles)) 10065:(eval-when-compile 10066- (if (not (boundp 'indent-pt)) 10067- (defvar indent-pt nil "Local used by insert-indent"))) I don't understand Gnus magic for XEmacs: lisp/gnus/gnus-ml.el 87:(eval-when-compile 88- (when (featurep 'xemacs) 89- (defvar gnus-mailing-list-mode-hook) 90- (defvar gnus-mailing-list-mode-on-hook) 91- (defvar gnus-mailing-list-mode-off-hook))) lisp/gnus/gnus-salt.el 103:(eval-when-compile 104- (when (featurep 'xemacs) 105- (defvar gnus-pick-mode-on-hook) 106- (defvar gnus-pick-mode-off-hook))) 342:(eval-when-compile 343- (when (featurep 'xemacs) 344- (defvar gnus-binary-mode-on-hook) 345- (defvar gnus-binary-mode-off-hook))) lisp/gnus/gnus-dired.el 89:(eval-when-compile 90- (when (featurep 'xemacs) 91- (defvar gnus-dired-mode-hook) 92- (defvar gnus-dired-mode-on-hook) 93- (defvar gnus-dired-mode-off-hook))) Seems that this can be fixed by anyone with commit right away: lisp/org/org.el 8477:(eval-when-compile 8478- (defvar org-property-drawer-re)) lisp/org/org-colview.el 752:(eval-when-compile (defvar org-columns-time)) lisp/printing.el 1099:(eval-when-compile 1100- ;; User Interface --- declared here to avoid compiler warnings 1101- (defvar pr-path-style) 1102- (defvar pr-auto-region) 1103- (defvar pr-menu-char-height) -- Best regards!