changeset 10778:ace814499178

(tex-append): Try splitting on last period, then try splitting on first period.
author Richard M. Stallman <rms@gnu.org>
date Fri, 17 Feb 1995 23:25:17 +0000
parents 9f4a9820fea1
children 7d9423ce104d
files lisp/textmodes/tex-mode.el
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/tex-mode.el	Fri Feb 17 23:22:51 1995 +0000
+++ b/lisp/textmodes/tex-mode.el	Fri Feb 17 23:25:17 1995 +0000
@@ -1101,19 +1101,22 @@
   (if (stringp file-name)
       (let ((file (file-name-nondirectory file-name))
 	    trial-name)
-	;; try spliting on first period
+	;; Try spliting on last period.
+	;; The first-period split can get fooled when two files
+	;; named a.tex and a.b.tex are both tex'd;
+	;; the last-period split must be right if it matches at all.
 	(setq trial-name
 	      (concat (file-name-directory file-name)
 		      (substring file 0
-				 (string-match "\\." file))
+				 (string-match "\\.[^.]*$" file))
 		      suffix))
 	(if (or (file-exists-p trial-name)
 		(file-exists-p (concat trial-name ".aux"))) ;for BibTeX files
 	    trial-name
-	  ;; not found, so split on last period
+	  ;; Not found, so split on first period.
 	  (concat (file-name-directory file-name)
 		  (substring file 0
-			     (string-match "\\.[^.]*$" file))
+			     (string-match "\\." file))
 		  suffix)))
     " "))