all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* elint warnings
@ 2013-08-02  9:37 Sebastien Vauban
  2013-08-02 14:42 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastien Vauban @ 2013-08-02  9:37 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Hello,

When elint'ing simple .emacs files such as:

--8<---------------cut here---------------start------------->8---
(when (require 'package)

  ;; archives from which to fetch
  (setq package-archives
        (append '(("org"       . "http://orgmode.org/elpa/")
                  ("melpa"     . "http://melpa.milkbox.net/packages/")
                  ("marmalade" . "http://marmalade-repo.org/packages/")
                  ("ELPA"      . "http://tromey.com/elpa/"))
                package-archives))

  ;; ...

  )

;; ensure a file ends in a newline when it is saved
(setq require-final-newline t)
--8<---------------cut here---------------end--------------->8---

I get hundreds of warnings (in the real case, with many more lines in my
.emacs file), such as:

--8<---------------cut here---------------start------------->8---
Linting d:/Users/fni/src/emacs-leuven/elint.el

In top level expression:
elint.el:1:Warning: Setting previously unbound symbol: package-archives
elint.el:1:Warning: Reference to unbound symbol: package-archives

In top level expression:
elint.el:16:Warning: Setting previously unbound symbol: require-final-newline

Linting finished.
--8<---------------cut here---------------end--------------->8---

I don't understand them: why is `package-archives' said to be unknown, while
it will only execute after the lib `package' has been loaded?

So, elint does not load the packages?  Then, what's the purpose of elint?  Why
real warnings should I be aware of (and how)?

Best regards,
  Seb

-- 
Sebastien Vauban


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: elint warnings
  2013-08-02  9:37 elint warnings Sebastien Vauban
@ 2013-08-02 14:42 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2013-08-02 14:42 UTC (permalink / raw)
  To: help-gnu-emacs

> (when (require 'package)

I'm not very familiar with elint, but at least the byte compiler will
issue similar warnings because it only processes `require' statements
that are at the top-level rather than within a `when' or some other
such construct.  So maybe you want to do

   (require 'package)
   (when (featurep 'package)

instead.  Of course, after (require 'package) you actually know that
(featurep 'package) is true (otherwise it would have signaled an error
rather than returning).  So I assume you mean (require 'package nil t).

   
        Stefan




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-02 14:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-02  9:37 elint warnings Sebastien Vauban
2013-08-02 14:42 ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.