[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX] preview context menu
From: |
Sebastian N. Fischmeister |
Subject: |
[AUCTeX] preview context menu |
Date: |
Fri, 9 Dec 2005 16:35:45 -0500 |
Hi.
Here is something, that saves a lot of my time. This can be
generalized for sure, since it makes a lot of assumptions about the
environment and the tex-ing style. Maybe it inspires someone here.
Sebastian
--------
(defun preview-open-xfig (ov)
"Open the figure in question with xfig."
(save-excursion
(set-buffer (overlay-buffer ov))
(re-search-forward "includegraphics\\[.*\\]" nil t)
(re-search-forward "{.*}" nil t)
(shell-command (concat "xfig -nosplash -startg 1 -specialtext -
latexfonts -startlatexFont default " (substring (match-string 0) 1
-1) ".fig"))
;;(message (concat "open: " (substring (match-string 0) 1 -1)))
))
(defun preview-context-menu (ov ev)
"Pop up a menu for OV at position EV."
(popup-menu
`("Preview"
["Toggle" (preview-toggle ,ov 'toggle ',ev)
(preview-active-contents ,ov)]
["Regenerate" (preview-regenerate ,ov)]
["Remove" (preview-delete ,ov)]
["Copy text" (preview-copy-text ,ov)]
["Open xfig" (preview-open-xfig, ov)]
["Copy MIME" (preview-copy-mml ,ov)
(preview-active-contents ,ov)])
ev))
- [AUCTeX] preview context menu,
Sebastian N. Fischmeister <=