[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: compiling remote rst files
From: |
Michael Albinus |
Subject: |
Re: compiling remote rst files |
Date: |
Wed, 10 Jan 2007 23:07:45 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux) |
Hans Halvorson <address@hidden> writes:
> Michael,
Hello Hans,
> I have pasted in below the definition of the "rst-compile" in rst.el.
> The problem is with the call to "rst-compile-find-conf" in the first
> let clause. This function tries to search for a file called
> "docutils.conf" in all directories above the directory of the current
> buffer. I do not know if that function is strictly incompatible with
> Tramp, or whether it just takes a very long time to search on some
> remote hosts. But I have waited for up to two minutes after calling
> rst-compile before pressing C-g to cancel.
I've modified the code slightly:
(let ((file-name "docutils.conf")
(buffer-file "/ssh:localhost:~/.emacs"))
;; Move up in the dir hierarchy till we find a change log file.
(let ((dir (file-name-directory buffer-file)))
(while (and (or (not (string= "/" dir)) (setq dir nil) nil)
(not (file-exists-p (concat dir file-name))))
(message dir)
;; Move up to the parent dir and try again.
(setq dir (expand-file-name (file-name-directory
(directory-file-name
(file-name-directory dir))))) )
(or (and dir (concat dir file-name)) nil)
))
If you evaluate the code, you'll see something like this in *Messages*:
Mark set
/ssh:address@hidden:~/
/ssh:address@hidden:/home/albinus/
/ssh:address@hidden:/home/
/ssh:address@hidden:/ [340 times]
Quit
The point is that the iteration goes via upper directories, and an
upper directory is computed as
(file-name-directory
(directory-file-name
(file-name-directory dir)))
That is correct, but for "/ssh:address@hidden:/" the upper directory
is "/ssh:address@hidden:/" again. The stop condition (string= "/" dir)
does not match in case of remote files.
> It is my opinion that the writers of rst.el should remove that call to
> rst-compile-find-conf; it is far too expensive an operation in any
> case. But until they do that, should Tramp try to disable the search?
I fear, Tramp cannot solve the problem; rst.el must take remote files
into account.
> For now, I just use "compile" directly with Tramp. Remote compilation
> is not quite working: it does not terminate properly -- Emacs is not
> receiving the signal that the compilation is finished.
Thanks for reporting; I've fixed it in Tramp CVS.
> Best wishes,
> Hans
Best regards, Michael.