more keywords, the tla+-open-dvi function
this commit adds a few more keywords that should be highligted and adds a new function to open the dvi file.master
parent
2e6a2c6a09
commit
84d7eafeea
24
tla+-mode.el
24
tla+-mode.el
|
@ -71,7 +71,7 @@
|
|||
:help "Typeset TLaTex and create PS Document"))
|
||||
|
||||
(bindings--define-key export-map [export-open]
|
||||
'(menu-item "Open DVI Viewer" tla+-run-tlatex-ps
|
||||
'(menu-item "Open DVI Viewer" tla+-open-dvi
|
||||
:help "Open DVI Viewer"))
|
||||
|
||||
;; Main Menu
|
||||
|
@ -93,7 +93,8 @@
|
|||
|
||||
(defconst tla+-font-lock-keywords
|
||||
(list
|
||||
'("\\<\\(MODULE\\|VARIABLE\\|EXTENDS\\)\\>" . font-lock-builtin-face)
|
||||
'("\\<\\(MODULE\\|CONSTANT\\|UNCHANGED\\|VARIABLE\\|THEOREM\\|EXCEPT\\|EXTENDS\\)\\>"
|
||||
. font-lock-builtin-face)
|
||||
'("\\\\\\*.*$" . font-lock-comment-face)
|
||||
'("(\\*.*\\*)" . font-lock-comment-face)
|
||||
'("\\('\\w*'\\)" . font-lock-variable-name-face)
|
||||
|
@ -143,8 +144,17 @@ Turning on Text mode runs the normal hook `text-mode-hook'."
|
|||
(split-window-below)
|
||||
(other-window 1)
|
||||
(switch-to-buffer sanybuffer)
|
||||
(erase-buffer)
|
||||
(insert output))))
|
||||
|
||||
|
||||
(defun tla+-open-dvi (buffername)
|
||||
(interactive "b")
|
||||
(save-excursion
|
||||
(switch-to-buffer buffername)
|
||||
(let* ((filename (buffer-file-name))
|
||||
(dviname (replace-regexp-in-string ".tla$" ".dvi" filename)))
|
||||
(shell-command (concat "xdvi " dviname " &")))))
|
||||
|
||||
(defun tla+-run-tlatex (type)
|
||||
"TODO: jump to line.."
|
||||
(interactive
|
||||
|
@ -159,15 +169,15 @@ Turning on Text mode runs the normal hook `text-mode-hook'."
|
|||
tla+-tlatools-path
|
||||
" tla2tex.TLA "
|
||||
filename))))
|
||||
(message (concat type))))
|
||||
type))
|
||||
;; (save-excursion
|
||||
;; (split-window-below)
|
||||
;; (other-window 1)
|
||||
;; (switch-to-buffer sanybuffer)
|
||||
;; (insert output))))
|
||||
|
||||
(defun tla+-run-tlatex-pdf () (tla+-run-tlatex "pdf"))
|
||||
(defun tla+-run-tlatex-dvi () (tla+-run-tlatex "dvi"))
|
||||
(defun tla+-run-tlatex-ps () (tla+-run-tlatex "ps"))
|
||||
(defun tla+-run-tlatex-pdf () (tla+-run-tlatex 'pdf))
|
||||
(defun tla+-run-tlatex-dvi () (tla+-run-tlatex 'dvi))
|
||||
(defun tla+-run-tlatex-ps () (tla+-run-tlatex 'ps))
|
||||
|
||||
(provide 'tla+-mode)
|
||||
|
|
Loading…
Reference in New Issue