1029 |
If enabled, PDFTeX will be used as an executable by default. |
If enabled, PDFTeX will be used as an executable by default. |
1030 |
You can customize an initial value, and you can use the |
You can customize an initial value, and you can use the |
1031 |
function `TeX-global-PDF-mode' for toggling this value." |
function `TeX-global-PDF-mode' for toggling this value." |
1032 |
:group 'TeX-command) |
:group 'TeX-command |
1033 |
|
(when TeX-Omega-mode |
1034 |
|
(setq TeX-PDF-mode nil)) |
1035 |
|
(setq TeX-PDF-mode-parsed nil) |
1036 |
|
(TeX-set-mode-name nil nil t) |
1037 |
|
(setq TeX-output-extension |
1038 |
|
(if TeX-PDF-mode "pdf" "dvi"))) |
1039 |
|
|
1040 |
(defun TeX-global-PDF-mode (&optional arg) |
(defun TeX-global-PDF-mode (&optional arg) |
1041 |
"Toggle default for `TeX-PDF-mode'." |
"Toggle default for `TeX-PDF-mode'." |
1046 |
(not (default-value 'TeX-PDF-mode)))) |
(not (default-value 'TeX-PDF-mode)))) |
1047 |
(TeX-set-mode-name 'TeX-PDF-mode nil t))) |
(TeX-set-mode-name 'TeX-PDF-mode nil t))) |
1048 |
|
|
1049 |
(defun TeX-PDF-mode (&optional arg parsed) |
(defalias 'tex-pdf-mode 'TeX-PDF-mode) |
1050 |
"Toggles PDF mode. |
|
1051 |
Interactive ARG if positive switches on, non-positive off. |
(defvar TeX-PDF-mode-parsed nil |
1052 |
|
"Set if `TeX-PDF-mode' has come about by parsing.") |
1053 |
If PARSED is non-nil, buffer-local values of `TeX-PDF-mode' will not |
|
1054 |
get overwritten. |
(make-variable-buffer-local 'TeX-PDF-mode-parsed) |
1055 |
If the current value was parsed and conflicts with the new value, |
|
1056 |
the default will be used instead. |
(defun TeX-PDF-mode-parsed (arg) |
1057 |
|
"Change `TeX-PDF-mode' to ARG based on parsing. |
1058 |
|
If this conflicts with previous parsed settings, |
1059 |
|
just use the default. If an explicit setting is |
1060 |
|
already established, don't do anything." |
1061 |
|
|
|
See `TeX-global-PDF-mode' for toggling the default value." |
|
1062 |
;; Basically we have the following situations: |
;; Basically we have the following situations: |
1063 |
;; TeX-PDF-mode-parsed (local-variable-p 'TeX-PDF-mode): |
;; TeX-PDF-mode-parsed (local-variable-p 'TeX-PDF-mode): |
1064 |
;; nil nil : virgin state |
;; nil nil : virgin state |
1065 |
;; t nil : conflicting parsed info -> use default. |
;; nil t : stably set state (possibly because of conflicting parse info) |
|
;; nil t : stably set state |
|
1066 |
;; t t : non-conflicting parsed info |
;; t t : non-conflicting parsed info |
|
(interactive "P") |
|
|
(if TeX-Omega-mode |
|
|
(setq parsed nil arg nil) |
|
|
(setq arg (if arg (> (prefix-numeric-value arg) 0) |
|
|
(not TeX-PDF-mode)))) |
|
|
(if parsed |
|
|
(if TeX-PDF-mode-parsed |
|
|
(unless (eq TeX-PDF-mode arg) |
|
|
(kill-local-variable 'TeX-PDF-mode)) |
|
|
(unless (local-variable-p 'TeX-PDF-mode (current-buffer)) |
|
|
(setq TeX-PDF-mode-parsed t |
|
|
TeX-PDF-mode arg))) |
|
|
(if TeX-PDF-mode-parsed |
|
|
(setq TeX-PDF-mode-parsed nil)) |
|
|
(setq TeX-PDF-mode arg)) |
|
|
(TeX-set-mode-name nil nil t) |
|
|
(setq TeX-output-extension |
|
|
(if TeX-PDF-mode "pdf" "dvi")) |
|
|
(run-hooks 'TeX-PDF-mode-hook) |
|
|
TeX-PDF-mode) |
|
|
(defalias 'tex-pdf-mode 'TeX-PDF-mode) |
|
1067 |
|
|
1068 |
|
(if TeX-PDF-mode-parsed |
1069 |
|
(unless (eq TeX-PDF-mode arg) |
1070 |
|
(TeX-PDF-mode (if (default-value 'TeX-PDF-mode) 1 0))) |
1071 |
|
(unless (local-variable-p 'TeX-PDF-mode (current-buffer)) |
1072 |
|
(TeX-PDF-mode (if arg 1 0)) |
1073 |
|
(setq TeX-PDF-mode-parsed t)))) |
1074 |
|
|
1075 |
(defun TeX-PDF-mode-on () |
(defun TeX-PDF-mode-on () |
1076 |
(TeX-PDF-mode 1 t)) |
"Use only from parsing routines." |
1077 |
|
(TeX-PDF-mode-parsed t)) |
1078 |
|
|
1079 |
(defun TeX-PDF-mode-off () |
(defun TeX-PDF-mode-off () |
1080 |
(TeX-PDF-mode 0 t)) |
"Use only from parsing routines." |
1081 |
|
(TeX-PDF-mode-parsed nil)) |
|
(defvar TeX-PDF-mode-parsed nil |
|
|
"Set if `TeX-PDF-mode' has come about by parsing.") |
|
|
|
|
|
(make-variable-buffer-local 'TeX-PDF-mode-parsed) |
|
1082 |
|
|
1083 |
(defcustom TeX-DVI-via-PDFTeX nil |
(defcustom TeX-DVI-via-PDFTeX nil |
1084 |
"Whether to use PDFTeX also for producing DVI files." |
"Whether to use PDFTeX also for producing DVI files." |