Add compile_all target, fix all compilation warnings

* Rakefile (.elc): Set byte-compile-force-lexical-warnings when
compiling.
(:compile_all): New target that compiles yasnippet-debug.el and
yasnippet-tests.el too.
* .travis.yml (script): Use it instead of `compile'.  Update cl-lib to
0.6.1.  Don't error on warnings for Emacs 24.3 on yasnippet-tests.el.
* yasnippet-debug.el: Don't use `yas--loaddir' if it's not
bound (e.g., when compiling).  Require `color' and `edebug' at
toplevel.  Check if `subr-x' defines `when-let'.
(yas-debug-snippet-vars): Remove, it was unused and broken.
* yasnippet-tests.el (yas-with-snippet-dirs, (yas-should-expand)
(yas--collect-menu-items, yas-should-not-expand, yas-mock-insert)
(yas-mock-yank, yas--key-binding, yas-make-file-or-dirs)
(yas-variables, yas-call-with-saving-variables)
(yas-call-with-snippet-dirs, special-mode, string-suffix-p): Move to
top section.
(yas-tests--ran-exit-hook): Rename from yas--ran-exit-hook, and move
to top-level.
* yasnippet.el (yas--letenv): Evaluate the FORMs of ENV.
This commit is contained in:
Noam Postavsky
2017-07-18 20:15:14 -04:00
parent 304c01a44a
commit dd65fe6186
5 changed files with 192 additions and 191 deletions

View File

@@ -100,14 +100,22 @@ end
desc "Compile yasnippet.el into yasnippet.elc"
rule '.elc' => '.el' do |t|
set_warnings = ""
cmdline = $EMACS + ' --batch -L .'
if ENV['warnings']
set_warnings = " --eval \"(setq byte-compile-warnings #{ENV['warnings']})\""
cmdline += " --eval \"(setq byte-compile-warnings #{ENV['warnings']})\""
end
sh "#{$EMACS} --batch -L . --eval \"(setq byte-compile-error-on-warn t)\"" +
"#{set_warnings} -f batch-byte-compile #{t.source}"
if ENV['Werror']
cmdline += " --eval \"(setq byte-compile-error-on-warn #{ENV['Werror']})\""
end
if ENV['Wlexical']
cmdline += " --eval \"(setq byte-compile-force-lexical-warnings #{ENV['Wlexical']})\""
end
cmdline +=" -f batch-byte-compile #{t.source}"
sh cmdline
end
task :compile => FileList["yasnippet.el"].ext('elc')
task :compile_all => FileList["*.el"].ext('elc')
task :default => :doc