aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Steingold2014-09-05 15:07:52 -0400
committerSam Steingold2014-09-05 15:07:52 -0400
commit2beb60dc1092ca1eb2270b58e8f54f238b6d5ebd (patch)
tree85310907f79764f0dfa35c935761bc0ce94846c1
parent833cea36b9eb2f7c15f05a7de4c70d693353452c (diff)
downloademacs-2beb60dc1092ca1eb2270b58e8f54f238b6d5ebd.tar.gz
emacs-2beb60dc1092ca1eb2270b58e8f54f238b6d5ebd.zip
New custom variable `tex-print-file-extension' to help users who use PDF instead of DVI.
* lisp/textmodes/tex-mode.el (tex-print-file-extension): New user option. (tex-print): Use it instead of the hard-coded string.
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/textmodes/tex-mode.el14
3 files changed, 23 insertions, 2 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 3b7516dd819..669b51ebb38 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -163,6 +163,11 @@ reinclusion protected header files from being fully hidden.
163*** New custom variable `hide-ifdef-exclude-define-regexp' to define symbol 163*** New custom variable `hide-ifdef-exclude-define-regexp' to define symbol
164name patterns (e.x. all "FOR_DOXYGEN_ONLY_*") to be excluded. 164name patterns (e.x. all "FOR_DOXYGEN_ONLY_*") to be excluded.
165 165
166** TeX mode
167
168*** New custom variable `tex-print-file-extension' to help users who
169use PDF instead of DVI.
170
166** Obsolete packages 171** Obsolete packages
167 172
168--- 173---
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9bfcdb631c3..502981d6179 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-09-05 Sam Steingold <sds@gnu.org>
2
3 * textmodes/tex-mode.el (tex-print-file-extension): New user
4 option.
5 (tex-print): Use it instead of the hard-coded string.
6
12014-09-05 Michael Albinus <michael.albinus@gmx.de> 72014-09-05 Michael Albinus <michael.albinus@gmx.de>
2 8
3 * net/tramp-sh.el (tramp-sh-handle-start-file-process): 9 * net/tramp-sh.el (tramp-sh-handle-start-file-process):
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 18843bcd15a..2e2f412b997 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -2573,18 +2573,28 @@ line LINE of the window, or centered if LINE is nil."
2573 (prefix-numeric-value linenum) 2573 (prefix-numeric-value linenum)
2574 (/ (window-height) 2))))))) 2574 (/ (window-height) 2)))))))
2575 2575
2576(defcustom tex-print-file-extension ".dvi"
2577 "The TeX-compiled file extension for viewing and printing.
2578If you use pdflatex instead of latex, set this to \".pdf\" and modify
2579 `tex-dvi-view-command' and `tex-dvi-print-command' appropriatelty."
2580 :type 'string
2581 :group 'tex-view
2582 :version "24.5")
2583
2576(defun tex-print (&optional alt) 2584(defun tex-print (&optional alt)
2577 "Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file]. 2585 "Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file].
2578Runs the shell command defined by `tex-dvi-print-command'. If prefix argument 2586Runs the shell command defined by `tex-dvi-print-command'. If prefix argument
2579is provided, use the alternative command, `tex-alt-dvi-print-command'." 2587is provided, use the alternative command, `tex-alt-dvi-print-command'."
2580 (interactive "P") 2588 (interactive "P")
2581 (let ((print-file-name-dvi (tex-append tex-print-file ".dvi")) 2589 (let ((print-file-name-dvi (tex-append tex-print-file
2590 tex-print-file-extension))
2582 test-name) 2591 test-name)
2583 (if (and (not (equal (current-buffer) tex-last-buffer-texed)) 2592 (if (and (not (equal (current-buffer) tex-last-buffer-texed))
2584 (buffer-file-name) 2593 (buffer-file-name)
2585 ;; Check that this buffer's printed file is up to date. 2594 ;; Check that this buffer's printed file is up to date.
2586 (file-newer-than-file-p 2595 (file-newer-than-file-p
2587 (setq test-name (tex-append (buffer-file-name) ".dvi")) 2596 (setq test-name (tex-append (buffer-file-name)
2597 tex-print-file-extension))
2588 (buffer-file-name))) 2598 (buffer-file-name)))
2589 (setq print-file-name-dvi test-name)) 2599 (setq print-file-name-dvi test-name))
2590 (if (not (file-exists-p print-file-name-dvi)) 2600 (if (not (file-exists-p print-file-name-dvi))