Fork me on GitHub
#emacs
<
2018-03-02
>
fbielejec10:03:59

Anyone tried using .dir-local.el with a load function, to set indent rules for a project? Like for example:

((clojure-mode 
  (eval . (load "~/indents.el"))))
and then in indents.el:
;; list of macros and indentation rules
(define-clojure-indent
  (defroutes 'defun)
  (GET 2)
  (POST 2)
  (PUT 2)
  (DELETE 2)
  (HEAD 2)
  (ANY 2)
  (OPTIONS 2)
  (PATCH 2)
  (rfn 2)
  (let-routes 1)
  (context 2)
  (wait-for 'defun))

hlolli12:03:32

@fbielejec you're missing a dot and a list

((clojure-mode .  ((eval . (load-file "~/indents.el")))))
or just nil for all files
((nil . ((eval . (load-file "~/indents.el")))))
I also thing you mean to use load-file, cleaner would be adding (provides 'my-clojure-indents) or smth at the end of indents.el and add the file to load-path, and require it.

fbielejec12:03:41

isn't dotted pair and a list equivalent here?

hlolli12:03:07

don't know

fbielejec12:03:31

I was also thinking about loading the indents.el from a remote server, a gist or github repository.

fbielejec12:03:23

Then the indents would be picked up by anyone modifying the project without any other action.

hlolli13:03:32

you could make your own emacs package reposotory and set up auto update function to look for new uploads each time emacs starts. Have not idea if that's difficult, came to my mind similar idea after learning about the lambdaisland repo.

gganley22:03:23

Is there a way to restrict the scope of M-? / xref-find-references to just one directory?