I'm rebuilding my emacs configuration, and trying to compile without warnings. I'm using also cask. I have this case:
(require 'magit) ;; Enable a right limit of 70 chars for git logs (add-hook 'magit-log-edit-mode-hook 'turn-on-auto-fill) (provide 'my-magit) (fullframe magit-status magit-mode-quit-window nil) (setq magit-last-seen-setup-instructions "1.4.0") (global-set-key (kbd "C-c g s") 'magit-status) (require 'git-gutter) (global-git-gutter-mode +1)
Compiling this, give this warning:
In toplevel form: my-magit.el:10:7:Warning: assignment to free variable ‘magit-last-seen-setup-instructions’
I try and changing to
(defvar magit-last-seen-setup-instructions "1.4.0")
It works well, without warning, the difference with setq is that after that if another defvar is applied to this variable will ahve no effect, but could I apply it to the other variables like this or I will have issues for that. Another doubt is that I believe that this variable is defined in the package magit that is loaded previously. so I do not get why I get this warning.