An open API service indexing awesome lists of open source software.

https://github.com/rocktakey/flymake-elisp-config

Setup load-path for flymake on Emacs Lisp mode
https://github.com/rocktakey/flymake-elisp-config

Last synced: 2 months ago
JSON representation

Setup load-path for flymake on Emacs Lisp mode

Awesome Lists containing this project

README

        

[[https://github.com/ROCKTAKEY/flymake-elisp-config][https://img.shields.io/github/tag/ROCKTAKEY/flymake-elisp-config.svg?style=flat-square]]
[[file:LICENSE][https://img.shields.io/github/license/ROCKTAKEY/flymake-elisp-config.svg?style=flat-square]]
[[https://codecov.io/gh/ROCKTAKEY/flymake-elisp-config?branch=master][https://img.shields.io/codecov/c/github/ROCKTAKEY/flymake-elisp-config.svg?style=flat-square]]
[[https://github.com/ROCKTAKEY/flymake-elisp-config/actions][https://img.shields.io/github/workflow/status/ROCKTAKEY/flymake-elisp-config/test/master.svg?style=flat-square]]
* flymake-elisp-config: Setup =load-path= for flymake on Emacs Lisp mode
Default =load-path= for flymake on Emacs Lisp mode can be set through =elisp-flymake-byte-compile-load-path=,
but it is just a global variable. When you are editing init.el, flymake should use all the =load-path=.
When you update some packages, =load-path= also should be updated.
When you are editing your package, flymake should use paths provided by cask or keg.

This package provides three features:
- Customizable variable =flymake-elisp-config-load-path-getter=, which is a =FUNCTION= returning =load-path= for flymake.
- Automatic setting of =load-path= for flymake by =flymake-elisp-config-auto-mode=.
- Manual setting of it by configurers named =flymake-elisp-config-as-*=.

* How to Use?
Just write in init.el:
#+begin_src emacs-lisp :tangle yes
;; Make `load-path' for flymake customizable through `flymake-elisp-config-load-path-getter'.
(flymake-elisp-config-global-mode)
;; Automatically set `load-path' for flymake.
(flymake-elisp-config-auto-mode)
#+end_src

If automatical setting is wrong, you can use =flymake-elisp-config-as-*= commands to change =load-path= for flymake manually.
- =flymake-elisp-config-as-config= :: Emacs configuration file such as init.el
- =flymake-elisp-config-as-keg= :: Emacs Lisp project managed by =keg=.
- =flymake-elisp-config-as-cask= :: Emacs Lisp project managed by =cask=.
- =flymake-elisp-config-as-default= :: Default Emacs Lisp file. It uses same =load-path= as default flymake.

* Add configurer
When you want to use another =load-path= getter, you can define =configurer=.
It can be achived by three steps:
1. Define predicate
2. Define configurer
3. Register to =flymake-elisp-config-auto-configurer-alist=

** Define predicate
Define predicate function, which takes =BUFFER= as an argument,
and which return =non-nil= only when =flymake= should use your new configurer.

** Define configurer
Define configurer function, which takes =BUFFER= as an argument,
and which sets =flymake-elisp-config-load-path-getter= in =BUFFER=.

The value of =flymake-elisp-config-load-path-getter= should be a function
which takes =BUFFER= as an argument, and returns list of path, like =load-path=,
which is used by =flymake= on =BUFFER=.

* License
This package is licensed by GPLv3. See [[file:LICENSE][LICENSE]].