aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2000-12-02 21:57:41 +0000
committerStefan Monnier2000-12-02 21:57:41 +0000
commit07c16ec439c7285e32152ba557c8f7a60fe410cf (patch)
tree076400bdd5fcc59adc5ee53a0dcf1cc1ce10d2f7
parentc19cc275304ba21cbe4fc36e69fdd48b66f02891 (diff)
downloademacs-07c16ec439c7285e32152ba557c8f7a60fe410cf.tar.gz
emacs-07c16ec439c7285e32152ba557c8f7a60fe410cf.zip
(tex-start-shell): Obey shell-file-name.
(tex-main-file, tex-file): Simplify. (tex-generate-zap-file-name): Use subst-char-in-string. (tex-strip-dots): Remove.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/textmodes/tex-mode.el27
2 files changed, 12 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e2bfc29089f..751867d50eb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12000-12-02 Stefan Monnier <monnier@cs.yale.edu> 12000-12-02 Stefan Monnier <monnier@cs.yale.edu>
2 2
3 * textmodes/tex-mode.el (tex-start-shell): Obey shell-file-name.
4 (tex-main-file, tex-file): Simplify.
5 (tex-generate-zap-file-name): Use subst-char-in-string.
6 (tex-strip-dots): Remove.
7
3 * tmm.el (tmm-get-keymap): Eval the menu name in `menu-item'. 8 * tmm.el (tmm-get-keymap): Eval the menu name in `menu-item'.
4 9
5 * textmodes/ispell.el (check-ispell-version): Don't use match-beginning 10 * textmodes/ispell.el (check-ispell-version): Don't use match-beginning
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 47b18f9d8a0..ab94c3f89d7 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1220,7 +1220,7 @@ Mark is left at original location."
1220 (with-current-buffer 1220 (with-current-buffer
1221 (make-comint 1221 (make-comint
1222 "tex-shell" 1222 "tex-shell"
1223 (or tex-shell-file-name (getenv "ESHELL") (getenv "SHELL") "/bin/sh") 1223 (or tex-shell-file-name (getenv "ESHELL") shell-file-name)
1224 nil) 1224 nil)
1225 (let ((proc (get-process "tex-shell"))) 1225 (let ((proc (get-process "tex-shell")))
1226 (set-process-sentinel proc 'tex-shell-sentinel) 1226 (set-process-sentinel proc 'tex-shell-sentinel)
@@ -1347,11 +1347,8 @@ ALL other buffers."
1347 (re-search-forward header-re 10000 t))) 1347 (re-search-forward header-re 10000 t)))
1348 (throw 'found (expand-file-name buffer-file-name)))))))) 1348 (throw 'found (expand-file-name buffer-file-name))))))))
1349 1349
1350(defun tex-main-file (&optional realfile) 1350(defun tex-main-file ()
1351 "Return the name of the main file with the `.tex' extension stripped. 1351 "Return the relative name of the main file."
1352If REALFILE is non-nil, return the pair (FILE . REALFILE) where FILE
1353is the filename without the extension while REALFILE is the filename
1354with extension."
1355 (let* ((file (or tex-main-file 1352 (let* ((file (or tex-main-file
1356 ;; Compatibility with AUCTeX. 1353 ;; Compatibility with AUCTeX.
1357 (and (boundp 'TeX-master) (stringp TeX-master) 1354 (and (boundp 'TeX-master) (stringp TeX-master)
@@ -1368,11 +1365,8 @@ with extension."
1368 ;; This isn't the main file, let's try to find better, 1365 ;; This isn't the main file, let's try to find better,
1369 (or (tex-guess-main-file) 1366 (or (tex-guess-main-file)
1370 ;; (tex-guess-main-file t) 1367 ;; (tex-guess-main-file t)
1371 buffer-file-name)))))) 1368 buffer-file-name)))))))
1372 (real (if (file-exists-p file) file (concat file ".tex")))) 1369 (if (file-exists-p file) file (concat file ".tex"))))
1373 (when (string-match "\\.tex\\'" file)
1374 (setq file (substring file 0 (match-beginning 0))))
1375 (if realfile (cons file real) file)))
1376 1370
1377 1371
1378(defun tex-start-tex (command file &optional dir) 1372(defun tex-start-tex (command file &optional dir)
@@ -1599,8 +1593,7 @@ This function is more useful than \\[tex-buffer] when you need the
1599`.aux' file of LaTeX to have the correct name." 1593`.aux' file of LaTeX to have the correct name."
1600 (interactive) 1594 (interactive)
1601 (let* ((source-file (tex-main-file)) 1595 (let* ((source-file (tex-main-file))
1602 (file-dir (expand-file-name (or (file-name-directory source-file) 1596 (file-dir (file-name-directory (expand-file-name source-file))))
1603 default-directory))))
1604 (if tex-offer-save 1597 (if tex-offer-save
1605 (save-some-buffers)) 1598 (save-some-buffers))
1606 (if (tex-shell-running) 1599 (if (tex-shell-running)
@@ -1617,13 +1610,7 @@ This function is more useful than \\[tex-buffer] when you need the
1617 ;; don't work with file names that start with #. 1610 ;; don't work with file names that start with #.
1618 (format "_TZ_%d-%s" 1611 (format "_TZ_%d-%s"
1619 (process-id (get-buffer-process "*tex-shell*")) 1612 (process-id (get-buffer-process "*tex-shell*"))
1620 (tex-strip-dots (system-name)))) 1613 (subst-char-in-string ?. ?- (system-name))))
1621
1622(defun tex-strip-dots (s)
1623 (setq s (copy-sequence s))
1624 (while (string-match "\\." s)
1625 (aset s (match-beginning 0) ?-))
1626 s)
1627 1614
1628;; This will perhaps be useful for modifying TEXINPUTS. 1615;; This will perhaps be useful for modifying TEXINPUTS.
1629;; Expand each file name, separated by colons, in the string S. 1616;; Expand each file name, separated by colons, in the string S.