[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to make flymake happy without interfering with logic?
From: |
Stefan Monnier |
Subject: |
Re: How to make flymake happy without interfering with logic? |
Date: |
Tue, 05 Nov 2019 16:24:10 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> I have a file 'init-env.el' in '<user-emacs-directory>/lisp'
> directory. In my 'init.el' when I do (require 'init-env), flymake says
> no such file or directory.
flymake is designed for files which can be correctly byte-compiled from
a "vanilla" Emacs.
Wrapping your `load-path` modification inside an `eval-and-compile` is
one way to make it work. Another way could be to do
(if t (require 'init-env))
so the `require` is only executed when loading the file but not when
compiling it. Another could be to use
(require 'init-env (expand-file-name "lisp/init-env" user-emacs-directory)
Yet another might be to disable flymake in that file because the file
just doesn't lend itself to this kind of checking.
Stefan