comparison lisp/textmodes/tex-mode.el @ 62846:93362151dd3a

remove extraneous calls to shell-quote-argument
author Karl Berry <karl@gnu.org>
date Sat, 28 May 2005 16:57:21 +0000
parents ccc8869d7418
children 86b398407446
comparison
equal deleted inserted replaced
62845:28ffa958559d 62846:93362151dd3a
1631 :group 'tex) 1631 :group 'tex)
1632 1632
1633 (defvar tex-compile-commands 1633 (defvar tex-compile-commands
1634 '(((concat "pdf" tex-command 1634 '(((concat "pdf" tex-command
1635 " " (if (< 0 (length tex-start-commands)) 1635 " " (if (< 0 (length tex-start-commands))
1636 (shell-quote-argument tex-start-commands)) " %f") 1636 tex-start-commands) " %f")
1637 t "%r.pdf") 1637 t "%r.pdf")
1638 ((concat tex-command 1638 ((concat tex-command
1639 " " (if (< 0 (length tex-start-commands)) 1639 " " (if (< 0 (length tex-start-commands))
1640 (shell-quote-argument tex-start-commands)) " %f") 1640 tex-start-commands) " %f")
1641 t "%r.dvi") 1641 t "%r.dvi")
1642 ("yap %r &" "%r.dvi") 1642 ("yap %r &" "%r.dvi")
1643 ("xdvi %r &" "%r.dvi") 1643 ("xdvi %r &" "%r.dvi")
1644 ("advi %r &" "%r.dvi") 1644 ("advi %r &" "%r.dvi")
1645 ("bibtex %r" "%r.aux" "%r.bbl") 1645 ("bibtex %r" "%r.aux" "%r.bbl")
1898 (let* ((file (tex-main-file)) 1898 (let* ((file (tex-main-file))
1899 (default-directory 1899 (default-directory
1900 (prog1 (file-name-directory (expand-file-name file)) 1900 (prog1 (file-name-directory (expand-file-name file))
1901 (setq file (file-name-nondirectory file)))) 1901 (setq file (file-name-nondirectory file))))
1902 (root (file-name-sans-extension file)) 1902 (root (file-name-sans-extension file))
1903 (fspec (list (cons ?r (shell-quote-argument root)) 1903 (fspec (list (cons ?r root)
1904 (cons ?f (shell-quote-argument file)))) 1904 (cons ?f file)))
1905 (default (tex-compile-default fspec))) 1905 (default (tex-compile-default fspec)))
1906 (list default-directory 1906 (list default-directory
1907 (completing-read 1907 (completing-read
1908 (format "Command [%s]: " (tex-summarize-command default)) 1908 (format "Command [%s]: " (tex-summarize-command default))
1909 (mapcar (lambda (x) 1909 (mapcar (lambda (x)
1920 "Start a TeX run, using COMMAND on FILE." 1920 "Start a TeX run, using COMMAND on FILE."
1921 (let* ((star (string-match "\\*" command)) 1921 (let* ((star (string-match "\\*" command))
1922 (compile-command 1922 (compile-command
1923 (if star 1923 (if star
1924 (concat (substring command 0 star) 1924 (concat (substring command 0 star)
1925 (shell-quote-argument file) 1925 file
1926 (substring command (1+ star))) 1926 (substring command (1+ star)))
1927 (concat command " " 1927 (concat command " "
1928 tex-start-options 1928 tex-start-options
1929 (if (< 0 (length tex-start-commands)) 1929 (if (< 0 (length tex-start-commands))
1930 (concat 1930 (concat tex-start-commands " "))
1931 (shell-quote-argument tex-start-commands) " ")) 1931 file))))
1932 (shell-quote-argument file)))))
1933 (tex-send-tex-command compile-command dir))) 1932 (tex-send-tex-command compile-command dir)))
1934 1933
1935 (defun tex-send-tex-command (cmd &optional dir) 1934 (defun tex-send-tex-command (cmd &optional dir)
1936 (unless (or (equal dir (let ((buf (tex-shell-buf-no-error))) 1935 (unless (or (equal dir (let ((buf (tex-shell-buf-no-error)))
1937 (and buf (with-current-buffer buf 1936 (and buf (with-current-buffer buf
2230 (if (tex-shell-running) 2229 (if (tex-shell-running)
2231 (tex-kill-job) 2230 (tex-kill-job)
2232 (tex-start-shell)) 2231 (tex-start-shell))
2233 (tex-send-command 2232 (tex-send-command
2234 (if alt tex-alt-dvi-print-command tex-dvi-print-command) 2233 (if alt tex-alt-dvi-print-command tex-dvi-print-command)
2235 (shell-quote-argument 2234 print-file-name-dvi
2236 print-file-name-dvi)
2237 t)))) 2235 t))))
2238 2236
2239 (defun tex-alt-print () 2237 (defun tex-alt-print ()
2240 "Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file]. 2238 "Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file].
2241 Runs the shell command defined by `tex-alt-dvi-print-command'." 2239 Runs the shell command defined by `tex-alt-dvi-print-command'."