Hello!

I'm sorry for reposting the message: I haven't noticed the list address
the first time.

---------- Forwarded message ----------

I've just run across a simple bug (at least, it looks to me like a bug)
in tramp.el from tramp-2.0.22 (and from 2.0.24 as well).

It should be obvious from the patch what I mean.

Here is a longer description in words of the fix:

The three part of tramp-handle-shell-command function's body are
evaluated one after another, and so the final strange fallback
expressions get evaluated in normal situations: a warning about wrong
default-directory appears, and the command returns errors. Putiing them
into an (if ) expression as the else-case fixes the bug.


By the way, are there any plans on implementing asynchronous
shell-command execution: do you expect it to be hard to do? This feature
is missing me, so perhaps I could take part in implementing it, if I had
some guidelines on how to do that. (I'm trying to setup Emacs+TRAMP for
editing remote RPM spec files and compiling them remotely on the build
server;  I almost like the way it works at the moment, but I cannot
observe the output of rpmbuild as it appears, only after it completes;
that's why I'd like to have the asynchronous execution feature
implemented.)

Regards,

-- 
Ivan Zakharyaschev
ALT Linux Team member, Sisyphus developer
http://www.altlinux.ru, http://www.altlinux.com
--- /usr/share/emacs/site-lisp/tramp/tramp.el.orig      Mon Sep 30 01:10:14 2002
+++ /usr/share/emacs/site-lisp/tramp/tramp.el   Mon Sep 30 00:52:51 2002
@@ -2909,7 +2909,7 @@
   "Like `shell-command' for tramp files.
 This will break if COMMAND prints a newline, followed by the value of
 `tramp-end-of-output', followed by another newline."
-  (when (tramp-tramp-file-p default-directory)
+  (if (tramp-tramp-file-p default-directory)
     (with-parsed-tramp-file-name default-directory nil
       (when (tramp-ange-ftp-file-name-p multi-method method)
        (let ((default-directory (tramp-make-ange-ftp-file-name
@@ -2956,13 +2956,13 @@
          (setq status (read (current-buffer))))
        (unless (zerop (buffer-size))
          (pop-to-buffer output-buffer))
-       status)))
+       status))
   ;; The following is only executed if something strange was
   ;; happening.  Emit a helpful message and do it anyway.
   (message "tramp-handle-shell-command called with non-tramp directory: `%s'"
           default-directory)
   (tramp-run-real-handler 'shell-command
-                         (list command output-buffer error-buffer)))
+                         (list command output-buffer error-buffer))))
 
 ;; File Editing.
 

Reply via email to