Random thoughts shooting out of volatile mind
Fixing hyde.el

Recently after changing my blog to use jekyll and Github I came across the hyde.el an emacs plugin which allows to maintain a jekyll powered blog from emacs. You can find the post by author here and source code here on Github.

At first site I was very happy about plugin and started using it but I could successfully use it only once properly then whenever I launch the plugin I get error message

*zsh:cd blog path no such directory*

(Note: I'm a zsh user not sure if this error is particular to zsh only. If you face same error on other shell please let me know)

After error hyde mode never showed jekyll blog properly. Looking at the source code I saw all the statements which were commands were executed using shell-command elisp function similar to following

let (
(cmd (format "cd '%s' && git diff-files --quiet '%s' > /dev/null" repo file))
(= (shell-command cmd) 1))

The cd command in the string was failing some how spoiling all other stuff!.. Probably the ~ in the path to blog was not properly expanded by shell-command, So I thought why not use elisp in built cd function instead and bingo the hyde mode works perfectly fine now!..

I've raised a pull request as I don't like to maintain a fork. Hope author will consider merging my changes. Hope this fix helps others too. Cya.

Posted by: copyninja on Friday, 23 March 2012

blog comments powered by Disqus
Fork me on GitHub