260 |
Use the information in `TeX-command-list' to determine how to run the |
Use the information in `TeX-command-list' to determine how to run the |
261 |
command. If OVERRIDE-CONFIRM is a prefix argument, confirmation will be |
command. If OVERRIDE-CONFIRM is a prefix argument, confirmation will be |
262 |
asked if it is positive, and suppressed if it is not." |
asked if it is positive, and suppressed if it is not." |
263 |
(setq TeX-current-process-region-p (eq file 'TeX-region-file)) |
(cond ((eq file 'TeX-region-file) |
264 |
|
(setq TeX-current-process-region-p t)) |
265 |
|
((eq file 'TeX-master-file) |
266 |
|
(setq TeX-current-process-region-p nil))) |
267 |
(let ((command (TeX-command-expand (nth 1 (assoc name TeX-command-list)) |
(let ((command (TeX-command-expand (nth 1 (assoc name TeX-command-list)) |
268 |
file)) |
file)) |
269 |
(hook (nth 2 (assoc name TeX-command-list))) |
(hook (nth 2 (assoc name TeX-command-list))) |
489 |
The viewer is started either on region or master file, |
The viewer is started either on region or master file, |
490 |
depending on the last command issued." |
depending on the last command issued." |
491 |
(interactive) |
(interactive) |
492 |
(let ((output-file (concat (if TeX-current-process-region-p |
(let ((output-file (TeX-active-master (TeX-output-extension)))) |
493 |
(TeX-region-file) |
(if (file-exists-p output-file) |
494 |
(TeX-master-file)) "." (TeX-output-extension)))) |
(TeX-command "View" 'TeX-active-master 0) |
495 |
(cond ((and TeX-current-process-region-p |
(message "Output file %S does not exist." output-file)))) |
|
(file-exists-p output-file)) |
|
|
(TeX-command "View" 'TeX-region-file 0)) |
|
|
((and (not TeX-current-process-region-p) |
|
|
(file-exists-p output-file)) |
|
|
(TeX-command "View" 'TeX-master-file 0)) |
|
|
(t |
|
|
(message "Output file %S does not exist." output-file))))) |
|
496 |
|
|
497 |
(defun TeX-output-style-check (styles) |
(defun TeX-output-style-check (styles) |
498 |
"Check STYLES compared to the current view output file extension and |
"Check STYLES compared to the current view output file extension and |
1080 |
|
|
1081 |
(defun TeX-active-process () |
(defun TeX-active-process () |
1082 |
"Return the active process for the current buffer." |
"Return the active process for the current buffer." |
1083 |
(if TeX-current-process-region-p |
(TeX-process (TeX-active-master))) |
|
(TeX-process (TeX-region-file)) |
|
|
(TeX-process (TeX-master-file)))) |
|
1084 |
|
|
1085 |
(defun TeX-active-buffer () |
(defun TeX-active-buffer () |
1086 |
"Return the buffer of the active process for this buffer." |
"Return the buffer of the active process for this buffer." |
1087 |
(if TeX-current-process-region-p |
(TeX-process-buffer (TeX-active-master))) |
|
(TeX-process-buffer (TeX-region-file)) |
|
|
(TeX-process-buffer (TeX-master-file)))) |
|
1088 |
|
|
1089 |
(defun TeX-active-master (&optional extension nondirectory) |
(defun TeX-active-master (&optional extension nondirectory) |
1090 |
"The master file currently being compiled. |
"The master file currently being compiled. |
1408 |
;; Find the error. |
;; Find the error. |
1409 |
(if (null file) |
(if (null file) |
1410 |
(error "Error occured after last TeX file closed")) |
(error "Error occured after last TeX file closed")) |
1411 |
(run-hooks 'TeX-translate-location-hook) |
(let ((runbuf (current-buffer)) |
1412 |
(find-file-other-window file) |
(master (with-current-buffer |
1413 |
(goto-line (+ offset line)) |
TeX-command-buffer |
1414 |
(if (not (string= string " ")) |
(expand-file-name (TeX-master-file))))) |
1415 |
(search-forward string nil t)) |
(run-hooks 'TeX-translate-location-hook) |
1416 |
|
(find-file-other-window file) |
1417 |
;; Explain the error. |
(setq TeX-master master) |
1418 |
(if TeX-display-help |
(goto-line (+ offset line)) |
1419 |
(TeX-help-error error context) |
(if (not (string= string " ")) |
1420 |
(message (concat "! " error))))) |
(search-forward string nil t)) |
1421 |
|
|
1422 |
|
;; Explain the error. |
1423 |
|
(if TeX-display-help |
1424 |
|
(TeX-help-error error context runbuf) |
1425 |
|
(message (concat "! " error)))))) |
1426 |
|
|
1427 |
(defun TeX-warning (string) |
(defun TeX-warning (string) |
1428 |
"Display a warning for STRING. |
"Display a warning for STRING. |
1478 |
|
|
1479 |
;; Go back to TeX-buffer |
;; Go back to TeX-buffer |
1480 |
(if TeX-debug-bad-boxes |
(if TeX-debug-bad-boxes |
1481 |
(progn |
(let ((runbuf (current-buffer)) |
1482 |
|
(master (with-current-buffer |
1483 |
|
TeX-command-buffer |
1484 |
|
(expand-file-name (TeX-master-file))))) |
1485 |
(run-hooks 'TeX-translate-location-hook) |
(run-hooks 'TeX-translate-location-hook) |
1486 |
(find-file-other-window file) |
(find-file-other-window file) |
1487 |
|
(setq TeX-master master) |
1488 |
;; Find line and string |
;; Find line and string |
1489 |
(goto-line (+ offset line)) |
(goto-line (+ offset line)) |
1490 |
(beginning-of-line 0) |
(beginning-of-line 0) |
1495 |
(search-forward string nil t)) |
(search-forward string nil t)) |
1496 |
;; Display help |
;; Display help |
1497 |
(if TeX-display-help |
(if TeX-display-help |
1498 |
(TeX-help-error error (if bad-box context (concat "\n" context))) |
(TeX-help-error error (if bad-box context (concat "\n" context)) |
1499 |
|
runbuf) |
1500 |
(message (concat "! " error))) |
(message (concat "! " error))) |
1501 |
nil) |
nil) |
1502 |
t))) |
t))) |
1503 |
|
|
1504 |
;;; - Help |
;;; - Help |
1505 |
|
|
1506 |
(defun TeX-help-error (error output) |
(defun TeX-help-error (error output runbuffer) |
1507 |
"Print ERROR in context OUTPUT in another window." |
"Print ERROR in context OUTPUT from RUNBUFFER in another window." |
1508 |
|
|
1509 |
(let ((old-buffer (current-buffer)) |
(let ((old-buffer (current-buffer)) |
1510 |
(log-file (TeX-active-master "log")) |
(log-file (with-current-buffer runbuffer |
1511 |
|
(with-current-buffer TeX-command-buffer |
1512 |
|
(expand-file-name (TeX-active-master "log"))))) |
1513 |
(TeX-error-pointer 0)) |
(TeX-error-pointer 0)) |
1514 |
|
|
1515 |
;; Find help text entry. |
;; Find help text entry. |