[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17815: 24.4.50; (process-file) erroneously raises its buffer when ru
bug#17815: 24.4.50; (process-file) erroneously raises its buffer when running with TRAMP
Sun, 22 Jun 2014 08:55:43 -0400
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)
> Well, all handlers I could factor out for several backends, live in
> tramp.el as `tramp-handle-...'. `tramp-adb-handle-process-file' and
> `tramp-sh-handle-process-file' contain subtle differences, it will be
> harder to refactor them.
Those functions are almost 100 lines long and yet the diff between the
two is only the little thing below. Clearly, there's room for a good
refactoring. Maybe you can't replace them with a single function, but
you can create a third function that holds most of the code.
@@ -1,4 +1,4 @@
(program &optional infile destination display &rest args)
"Like `process-file' for Tramp files."
;; The implementation is not complete yet.
@@ -66,20 +66,16 @@
;; it. Call it in a subshell, in order to preserve working
- (setq ret
- (if (tramp-send-command-and-check
- v (format "\\cd %s; %s"
- (tramp-shell-quote-argument localname)
- t t)
- 0 1))
+ (setq ret 0)
+ v (format "(cd %s; %s)"
+ (tramp-shell-quote-argument localname) command)
;; We should add the output anyway.
- (with-current-buffer (tramp-get-connection-buffer v)
+ (insert-buffer-substring (tramp-get-connection-buffer v)))
(when (and display (get-buffer-window outbuf t)) (redisplay))))
;; When the user did interrupt, we should do it also. We use
;; return code -1 as marker.
@@ -101,7 +97,7 @@
;; `process-file-side-effects' has been introduced with GNU
;; Emacs 23.2. If set to `nil', no remote file will be changed
;; by `program'. If it doesn't exist, we assume its default
- ;; value `t'.
+ ;; value 't'.
(unless (and (boundp 'process-file-side-effects)
(not (symbol-value 'process-file-side-effects)))
(tramp-flush-directory-property v ""))