[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX] Hooks for command on region and command on master
From: |
Vincent Belaïche |
Subject: |
[AUCTeX] Hooks for command on region and command on master |
Date: |
Sat, 01 Aug 2009 09:18:21 +0200 |
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)
(setcdr a '("." "start \"\" %o"))))))))
Note that JPE_GSVIEW is just an environment variable where I stored the
path of gsview.
After digging into AUCTeX documentation, I realized that there is no
such thing as such hook. I can contribute so that this feature is
available if other people think that it would be good to have this.
Vincent.
- [AUCTeX] Hooks for command on region and command on master,
Vincent Belaïche <=