1

I'm new to emacs (3 days), learning the basics of the ecosystem. I brew installed emacs, and after that I'm wanting to enable evil mode. Here is my init.el

(require 'package)
(setq package-list '(evil))

(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                (not (gnutls-available-p))))
   (url (concat (if no-ssl "http" "https") "://melpa.org/packages/")))
(add-to-list 'package-archives (cons "melpa" url) t))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))


;; Activate all packages in particular autoloads
(package-initialize)

(unless package-archive-contents
  (package-refresh-contents))

;; Install all missing packages
(dolist (package package-list)
  (unless (package-installed-p package)
    (package-install package)))


(require 'evil)
(evil-mode t)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages (quote (evil))))
 (custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
)

And I'm getting the following Warning. Looks like it's something related with some lisp coding stile guide but not sure.

Compiling no file at Sat Dec 30 16:12:10 2017
Warning (bytecomp): assignment to free variable ‘glc-direction’
Warning (bytecomp): reference to free variable ‘glc-direction’
Warning (bytecomp): reference to free variable ‘buffer-undo-tree’
Warning (bytecomp): the following functions are not known to be defined:
undo-tree-current, undo-tree-node-undo, undo-tree-node-previous
Warning (bytecomp): reference to free variable ‘undo-tree-mode’
Warning (bytecomp): Unused lexical variable ‘i’ [4 times]
Warning (bytecomp): ‘undo-elt-crosses-region’ is an obsolete function (as of 25.1). [2 times]
Warning (bytecomp): Unused lexical variable ‘i’ [7 times]
Warning (bytecomp): reference to free variable ‘undo-tree-visualizer-selection-mode’ [2 times]
Warning (bytecomp): Unused lexical variable ‘i’ [4 times]
Warning (bytecomp): ‘find-tag’ is an obsolete function (as of 25.1); use ‘xref-find-definitions’ instead. [2 times]
Warning (bytecomp): function evil-mode used to take 0+ arguments, now takes 0-1

I want to point out that this a fresh installation of emacs 25.3 and the only package I'm trying to install for now is evil, I haven't done anything yet with emacs.

This is something I should worry about? It's a way to fix it?

  • A guess would be that those warnings are not a problem. Those variables are not defined or used in your init file. If the warnings represent a problem they would likely be a problem for the library or libraries that you load. If Evil is the only such package, you might want to report this to the Evil maintainers. But wait to see what others say here, first. – Drew Dec 31 '17 at 0:06
  • Please do not post the same question to StackOverflow and emacs.SE. Choose one or the other. Please delete one of these duplicate questions. Thx. – Drew Dec 31 '17 at 0:14
1

Regarding ‘find-tag’ is an obsolete function this will need to be fixed in evil, but afaik find-tag will be around for a while yet.

It looks like the developers are aware but a fix hasn't been made, see evil/issues/952

  • That particular warning can definitely be ignored. The only ones to check are the ones about the free or unused variables. – Drew Dec 31 '17 at 0:15
  • Looks like evil-mode developers need to check that out. @Anntoin shared a like with the issue and they are aware of it. – Gilbert Dec 31 '17 at 0:40
  • 1
    If any of you has an actual fix for the find-tag one, go ahead and tell me. No, removing support for Emacs 24.3 isn't an option. I'll have a look at the other ones. – wasamasa Dec 31 '17 at 10:37
3

If getting warnings while compiling programs scares you, I have bad news for you. First of all, these warnings are only relevant for the developer of that program. It's unfortunate that users get to see those more often than the developers do. Not all warnings are meaningful or can be dealt with, so while a goal of having zero warnings while installing a package is laudable, it's rather hard to achieve. That being said, the less warnings, the better.

I went through Evil and its dependencies with flycheck and flycheck-next-error to figure out where your warnings come from:

Warning (bytecomp): assignment to free variable ‘glc-direction’
Warning (bytecomp): reference to free variable ‘glc-direction’
Warning (bytecomp): reference to free variable ‘buffer-undo-tree’
Warning (bytecomp): the following functions are not known to be defined:
undo-tree-current, undo-tree-node-undo, undo-tree-node-previous

These are from the goto-chg package. It used to belong to nobody and lived on the Emacswiki, but I've rectified this situation by taking over. The warnings are fixed now and shouldn't appear again.

Warning (bytecomp): reference to free variable ‘undo-tree-mode’
Warning (bytecomp): Unused lexical variable ‘i’ [4 times]
Warning (bytecomp): ‘undo-elt-crosses-region’ is an obsolete function (as of 25.1). [2 times]
Warning (bytecomp): Unused lexical variable ‘i’ [7 times]
Warning (bytecomp): reference to free variable ‘undo-tree-visualizer-selection-mode’ [2 times]
Warning (bytecomp): Unused lexical variable ‘i’ [4 times]

These are from the undo-tree package. I have no control over it, so if the warnings bother you greatly, feel free to write an email to its author.

Warning (bytecomp): ‘find-tag’ is an obsolete function (as of 25.1); use ‘xref-find-definitions’ instead. [2 times]
Warning (bytecomp): function evil-mode used to take 0+ arguments, now takes 0-1

These are the only ones that actually originate from Evil. There is no obvious way of fixing the find-tag one, other than dropping support for Emacsen older than 25.1 (which is how Emacs core resolves these warnings). I consider such a move unreasonable because that release is from late 2016. If anyone here has an idea how to do it, please let me know at https://github.com/emacs-evil/evil/issues/952. No idea about the second one, but the formulation suggests you won't ever see it again. I can't reproduce it myself.

edit: The first Evil-specific warning has also been fixed.

  • I appreciated you explanation. Nothing is bothering me so far, just want to understand what is going on. I'm learning many things about this tool and enjoying the process. – Gilbert Dec 31 '17 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.