Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cd command on PC version (Emacs 20.7.1)

0 views
Skip to first unread message

Edward M. Reingold

unread,
Aug 18, 2005, 3:55:03 PM8/18/05
to
When I use C-c C-f in a LaTeX file, the *tex-shell* buffer is generated and a
change directory command is given; on my PC it looks like

c:\ed\bin>cd c:/ed/
cd c:/ed/
The system cannot find the path specified.

The problem being that the slashes should be backslashes. Is there a simpel
fix to this--the directory name is given by file-name-directory which should
be smart enough to get it right for the PC!

Do I have to write my own PC version, or has this been done?

--

Professor Edward M. Reingold Email: rein...@iit.edu
Chairman, Department of Computer Science Voice: (312) 567-3309
Illinois Institute of Technology Assistant: (312) 567-5152
Stuart Building Fax: (312) 567-5067
10 West 31st Street, Suite 236
Chicago, IL 60616-3729 U.S.A.

Eli Zaretskii

unread,
Aug 19, 2005, 4:31:56 AM8/19/05
to help-gn...@gnu.org
> From: rein...@emr.cs.iit.edu (Edward M. Reingold)
> Date: 18 Aug 2005 14:55:03 -0500

>
> When I use C-c C-f in a LaTeX file, the *tex-shell* buffer is generated and a
> change directory command is given; on my PC it looks like
>
> c:\ed\bin>cd c:/ed/
> cd c:/ed/
> The system cannot find the path specified.
>
> The problem being that the slashes should be backslashes.

It's a bug. Please try the following patch:


--- lisp/textmodes/tex-mode.el.~0 2005-08-12 12:49:17.000000000 +0300
+++ lisp/textmodes/tex-mode.el 2005-08-19 11:30:38.021873500 +0300
@@ -1942,7 +1942,8 @@
default-directory))))
(not dir))
(let (shell-dirtrack-verbose)
- (tex-send-command tex-shell-cd-command dir)))
+ (tex-send-command tex-shell-cd-command
+ (convert-standard-filename (concat "\"" dir "\"")))))
(with-current-buffer (process-buffer (tex-send-command cmd))
(setq compilation-last-buffer (current-buffer))
(compilation-forget-errors)
@@ -2307,7 +2308,8 @@
(tex-out-file
(tex-append (file-name-nondirectory (buffer-file-name)) ""))
(file-dir (file-name-directory (buffer-file-name))))
- (tex-send-command tex-shell-cd-command file-dir)
+ (tex-send-command tex-shell-cd-command
+ (convert-standard-filename (concat "\"" file-dir "\"")))
(tex-send-command tex-bibtex-command tex-out-file))
(tex-display-shell))


Eli Zaretskii

unread,
Aug 19, 2005, 1:42:26 PM8/19/05
to help-gn...@gnu.org
> Date: Fri, 19 Aug 2005 11:31:56 +0300
> From: Eli Zaretskii <el...@gnu.org>

>
> > c:\ed\bin>cd c:/ed/
> > cd c:/ed/
> > The system cannot find the path specified.
> >
> > The problem being that the slashes should be backslashes.
>
> It's a bug. Please try the following patch:

Oops! sorry, bad patch. Try this one instead:

--- lisp/textmodes/tex-mode.el.~0 2005-08-12 12:49:17.000000000 +0300

+++ lisp/textmodes/tex-mode.el 2005-08-19 20:39:39.796875000 +0300


@@ -1942,7 +1942,8 @@
default-directory))))
(not dir))
(let (shell-dirtrack-verbose)
- (tex-send-command tex-shell-cd-command dir)))
+ (tex-send-command tex-shell-cd-command

+ (concat "\"" (convert-standard-filename dir) "\""))))


(with-current-buffer (process-buffer (tex-send-command cmd))
(setq compilation-last-buffer (current-buffer))
(compilation-forget-errors)
@@ -2307,7 +2308,8 @@
(tex-out-file
(tex-append (file-name-nondirectory (buffer-file-name)) ""))
(file-dir (file-name-directory (buffer-file-name))))
- (tex-send-command tex-shell-cd-command file-dir)
+ (tex-send-command tex-shell-cd-command

+ (concat "\"" (convert-standard-filename file-dir) "\""))
(tex-send-command tex-bibtex-command tex-out-file))
(tex-display-shell))


0 new messages