help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: automate command after saving


From: Phillip Lord
Subject: Re: automate command after saving
Date: Thu, 19 Nov 2015 14:17:58 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)


You could do this using after-save-hook. So, something like

(add-hook 'after-save-hook
          'pandoc-hook)

(defun pandoc-hook()
  (compile "pandoc -t latex...."))

Personally, I do this outside Emacs, though, with this little bash
script.

#!/bin/bash
make $*
while inotifywait -r -e MODIFY --exclude ".#*" --exclude ".*~" .
do
    make $*;
done;

Cheap, cheerful but effective.

Phil

Martin Kaffanke <martin@kaffanke.at> writes:

> Hi there,
>
> I'd like to run a command after saving, but just if I switch it on.
>
> Following scenario:
>
> When I write on  an org file, before printing I look at the pdf version
> created by
>
> pandoc -t latex -o filename-without-org-but-with.pdf filename.org
>
> And then I switch to emacs to do corrections.
>
> Now I'd like to automatically run pandoc again when I switch back to
> evince (which automaticaly loads the pdf new when changed on disk).
>
> How could a make a switch for emacs to automatically run pandoc again
> after C-x C-s?
>
> Thanks for your Ideas,
> Martin

-- 
Phillip Lord,                           Phone: +44 (0) 191 208 7827
Lecturer in Bioinformatics,             Email: phillip.lord@newcastle.ac.uk
School of Computing Science,            
http://homepages.cs.ncl.ac.uk/phillip.lord
Room 914 Claremont Tower,               skype: russet_apples
Newcastle University,                   twitter: phillord
NE1 7RU                                 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]