1 Aug 2009 09:18
Hooks for command on region and command on master
Vincent Belaïche <vincent.b.1 <at> hotmail.fr>
2009-08-01 07:18:21 GMT
2009-08-01 07:18:21 GMT
Dear all,
I would like to use different viewers when I view a region and when I
view the master file.
The reason is that I prefer to have GSView for region because it is
possible to ask reload with a command line option (namely -e) without
opening a new Window. However GSView is not that performant for a big
document, but it is quite fine for region.
On the other hand for the master document I would like to use
Foxit. Foxit does not allow to reload from command line. It does not
lock the file, but you have to close/reopen manually if you want the
view refressed. On the other hand Foxit is more performant than GSView
in many aspects.
So, what I had in mind is to have some kind of hook where
the variable `target' would be locally set to `master' or to `region'
when the hook is called. Then I would just have to put this kind of code
in my init file:
(add-hook TeX-view-hook
(lambda ()
(let ((a (assoc "^pdf$" TeX-output-view-style)))
(when a
(cond
((eq target 'region)
(setcdr a '("." (concat (getenv "JPE_GSVIEW")
" -e %o"))))
((eq target 'master)
(Continue reading)
RSS Feed