]> git.eshelyaron.com Git - emacs.git/commitdiff
(tex-append): Try splitting on last period, then
authorRichard M. Stallman <rms@gnu.org>
Fri, 17 Feb 1995 23:25:17 +0000 (23:25 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 17 Feb 1995 23:25:17 +0000 (23:25 +0000)
try splitting on first period.

lisp/textmodes/tex-mode.el

index 66c8485dd3e2701e8e3112151a3821e114df5475..495576b8e1c3b2d08b31e4d63f5109e4cc10954c 100644 (file)
@@ -1101,19 +1101,22 @@ so normally SUFFIX starts with one."
   (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)))
     " "))