diff options
| author | Richard M. Stallman | 1995-02-17 23:25:17 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-02-17 23:25:17 +0000 |
| commit | 7d0ca249c89ee12baba0f84b166a885aef357744 (patch) | |
| tree | 66df4ec3e58c8d370ed0e78b7fd9f614a2acd832 | |
| parent | 95bf6435fc9b151b931173011a5a0f2a90bd4d0e (diff) | |
| download | emacs-7d0ca249c89ee12baba0f84b166a885aef357744.tar.gz emacs-7d0ca249c89ee12baba0f84b166a885aef357744.zip | |
(tex-append): Try splitting on last period, then
try splitting on first period.
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 11 |
1 files 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." | |||
| 1101 | (if (stringp file-name) | 1101 | (if (stringp file-name) |
| 1102 | (let ((file (file-name-nondirectory file-name)) | 1102 | (let ((file (file-name-nondirectory file-name)) |
| 1103 | trial-name) | 1103 | trial-name) |
| 1104 | ;; try spliting on first period | 1104 | ;; Try spliting on last period. |
| 1105 | ;; The first-period split can get fooled when two files | ||
| 1106 | ;; named a.tex and a.b.tex are both tex'd; | ||
| 1107 | ;; the last-period split must be right if it matches at all. | ||
| 1105 | (setq trial-name | 1108 | (setq trial-name |
| 1106 | (concat (file-name-directory file-name) | 1109 | (concat (file-name-directory file-name) |
| 1107 | (substring file 0 | 1110 | (substring file 0 |
| 1108 | (string-match "\\." file)) | 1111 | (string-match "\\.[^.]*$" file)) |
| 1109 | suffix)) | 1112 | suffix)) |
| 1110 | (if (or (file-exists-p trial-name) | 1113 | (if (or (file-exists-p trial-name) |
| 1111 | (file-exists-p (concat trial-name ".aux"))) ;for BibTeX files | 1114 | (file-exists-p (concat trial-name ".aux"))) ;for BibTeX files |
| 1112 | trial-name | 1115 | trial-name |
| 1113 | ;; not found, so split on last period | 1116 | ;; Not found, so split on first period. |
| 1114 | (concat (file-name-directory file-name) | 1117 | (concat (file-name-directory file-name) |
| 1115 | (substring file 0 | 1118 | (substring file 0 |
| 1116 | (string-match "\\.[^.]*$" file)) | 1119 | (string-match "\\." file)) |
| 1117 | suffix))) | 1120 | suffix))) |
| 1118 | " ")) | 1121 | " ")) |
| 1119 | 1122 | ||