From 7d0ca249c89ee12baba0f84b166a885aef357744 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 17 Feb 1995 23:25:17 +0000 Subject: [PATCH] (tex-append): Try splitting on last period, then try splitting on first period. --- lisp/textmodes/tex-mode.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 66c8485dd3e..495576b8e1c 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -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))) " ")) -- 2.39.5