bug-auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-AUCTeX] 11.84; C-c C-c doesn't suggest "View" for file name wit


From: David Kastrup
Subject: Re: [Bug-AUCTeX] 11.84; C-c C-c doesn't suggest "View" for file name with space.
Date: Mon, 05 Mar 2007 18:46:07 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux)

Ikumi Keita <address@hidden> writes:

> 1. Save the following content under the file name "/tmp/bbb ccc.tex".
[...]
> 2. Open the file with AUCTeX.
> 3. C-c C-c RET
> 4. Typeset finishes normally. Then C-c C-c RET again.
> 5. The minibuffer prompts with "Command: (default LaTeX)", not
>    "Command: (default View)".
> 6. C-c C-c RET again and again and again... but AUCTeX never suggests
>    "View" as its default.
>
> Analysis:
> With the file name "bbb ccc.tex", (TeX-save-document (TeX-master-file)),
> in the function TeX-command-query, returns t even after invocating C-c
> C-c sufficiently many times, so AUCTeX wrongly regards that typesetting
> is not ready yet.  That is caused by the fact that
> (TeX-output-extension), in the function TeX-save-document, returns
> "dvi\"", not "dvi".  The reason of it is that the function
> TeX-TeX-sentinel-check does not cater for the case that the file name
> reported by LaTeX is surrounded by doble quotes when the file name
> contains space.  LaTeX emits a message like
>
> Output written on "bbb ccc.dvi" (1 page, 224 bytes).
>
> so the surrounding dobule quotes must be removed to obtain the corrent
> output file name.
>
> Tentative fix:
> --- tex-buf.el~       Mon Jan 29 22:15:45 2007
> +++ tex-buf.el        Mon Feb 12 23:28:27 2007
> @@ -840,6 +840,11 @@
>                           nil t)
>       (let ((output-file (TeX-match-buffer 1)))
>         (setq TeX-current-page (concat "{" (TeX-match-buffer 2) "}"))
> +       ;; Remove surrounding double quotes, if present, for file names
> +       ;; with spaces.
> +       (if (and (eq (aref output-file 0) ?\")
> +                (eq (aref output-file (1- (length output-file))) ?\"))
> +           (setq output-file (substring output-file 1 -1)))
>         (setq TeX-output-extension
>               (if (string-match "\\.\\([^.]*\\)$" output-file)
>                   (match-string 1 output-file)

I agree with the analysis.  It may be possible to solve this with the
regexp, but I don't see how a single parenthesized expression could
optionally remove a pair of quotes.

If nobody has a better proposal, we probably want to check this in.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]