Sorry for the delay.
Christophe Grand <
chris...@cgrand.net> writes:
> On Tue, Dec 3, 2013 at 4:35 PM, Bastien <
bastie...@gmail.com>
> wrote:
>
> Well, I retested and it works well when
>
>
> Is this a conjunction or a disjunction?
Conjunction.
> 1. (reload/auto-reload *ns*) is right after the (ns ...) form
>
>
> I suspect that by registerinig it first for auto-reload it prevents
> auto-reloading behaviour to get discraded by an exception.
> How many times do you get "Reloading kickhub.html.templates" when you
> modify a html file?
When (reload/auto-reload *ns*) is at the end of the file, I get this
message once, the change in the .html is reflected okay, but further
changes are not.
When (reload/auto-reload *ns*) is right after the (ns ...) form I
never get this message but all changes in .html are reflected okay.
> 2. I update a .html template from within an Emacs with a nrepl
> � �connection.
>
> huh? Could you explain a bit more your setup?
I use immutant. My init.clj in immutant is basic:
(ns immutant.init
(:use kickhub.core)
(:require [immutant.web :as web]))
(web/start #'ring-handler)
and my #'ring-handler nothing very fancy:
(def ring-handler
(middleware/app-handler
[(wrap-friend-github (wrap-friend app-routes))]))
Then I start immutant with
~$ lein immutant run
and get all those messages.
From there, touching .html files does not trigger any change.
My defproject form contains:
:immutant {:context-path "/" :nrepl-port 4005}
which allows me to connect to the immutant instant through Emacs.
I start M-x cider RET within my project.clj file (or any other .clj
file of the project), load the templates.clj file with C-c C-l (the
cider function to load the code in the buffer).
Then, if I edit a .html buffer and save it, the changes are reflected
in localhost:8080
> If you just ssh into
> the box and modify (touch) the file, does it trigger a reload?
Nope.
> The other use-case I'm interested in is when I'm on a server
> where a
> git pull write a new version of a .html template. �In this case,
> the
> templates are not reloaded and a ~$ touch [src]/index.html does
> not
> work either, but given (2) I guess this is expeected. �I probably
> should use a git hook or something similar.
>
>
> The watch mechanism is tied to the parent folder of the template
> through its inode, not its path so it may explain why you don't get
> reloads after git pull (if you could confirm with ls -i it would be
> nice).
I'm not sure what to test here.
I hope the explanations above make sense, and that someone else can
confirm how the auto-reloading works for him from immutant!
Thanks,
--
Bastien