From unknown Wed Jun 25 03:55:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17815: 24.4.50; (process-file) erroneously raises its buffer when running with TRAMP Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jun 2014 08:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 17815@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.140325180221797 (code B ref -1); Fri, 20 Jun 2014 08:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Jun 2014 08:10:02 +0000 Received: from localhost ([127.0.0.1]:53735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxttY-0005fK-JR for submit@debbugs.gnu.org; Fri, 20 Jun 2014 04:10:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46673) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxttV-0005f2-RS for submit@debbugs.gnu.org; Fri, 20 Jun 2014 04:09:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxttK-0000np-1C for submit@debbugs.gnu.org; Fri, 20 Jun 2014 04:09:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxttJ-0000nk-Ut for submit@debbugs.gnu.org; Fri, 20 Jun 2014 04:09:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxttE-0004pw-2j for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 04:09:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wxtt7-0000lN-Pe for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 04:09:40 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:49057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxtt7-0000kl-LD for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 04:09:33 -0400 Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 3105F21273 for ; Fri, 20 Jun 2014 04:09:30 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Fri, 20 Jun 2014 04:09:30 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=from:to:subject:date:message-id:mime-version:content-type; s= mesmtp; bh=3BWv1Y5AprQwQdgzvaQFVQu6QgY=; b=ajyShIWUvH9ifBhII8c8m DJ+XO2udLaB9CZk+zDzw4mSYtZEBnF/HFfXKrMxB9IKETXbhcNhhkWB4Bx/xoXND HXfaesWkNSDh0lkcNAg4YFrJXQxlVWPH3EOW8UwIGREU6SnOWF1t6GPX1TilHHXY wLX5sKWIeY3GT1lxwxYTWw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :mime-version:content-type; s=smtpout; bh=3BWv1Y5AprQwQdgzvaQFVQ u6QgY=; b=Sjtwfe6kG5TnenmU67fNrlkiLfoC7h2yk599B7fXsylQw73ocltrH4 eue0OWCAv7FP7osgcUL6nflxoW45nGCowSlzFyi+On8/plWc+TaNTe+cXFdx9lHT XSGK1m6UQ+FRN37DSZ1bJ/9xzCvKGlZRNmAx4LFe8GxAs9TmI1654= X-Sasl-enc: HQlfj69shdDm6xBeJNg4XfxDJq9CeHtIlIH3ffAT7AoA 1403251769 Received: from shorty.local (unknown [23.243.199.75]) by mail.messagingengine.com (Postfix) with ESMTPA id EA96EC007AD for ; Fri, 20 Jun 2014 04:09:29 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1Wxtt2-0003Le-D2 for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 01:09:28 -0700 From: Dima Kogan Date: Fri, 20 Jun 2014 01:09:28 -0700 Message-ID: <87r42km287.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hi. The documentation is a bit unclear, so I'm not 100% sure this is a bug; it's definitely a surprising behavior, though. I have a bit of elisp to create a temporary buffer and to run a process, sending its output to this buffer: (let ((output-buffer (get-buffer-create "*test-buf*"))) (with-current-buffer output-buffer (erase-buffer) (let ((default-directory "/tmp")) (process-file "whoami" nil output-buffer t)))) Note that I do not ask for this buffer to be raised. On my machine (Debian/sid amd64) this indeed does not raise the *test-buf* buffer, and I do not even see it if I don't explicitly switch to it. This is good. If I change the directory from "/tmp" to any TRAMP path (for instance "/sudo::/tmp") then this elisp DOES raise *test-buf*. This difference between normal and TRAMP behavior sounds like a bug to me. Note that I have (process-file ... ... ... t). Changing this to nil resolves the issue. The documentation says Fourth arg DISPLAY non-nil means redisplay buffer as output is inserted. I don't know if "redisplay" includes "raise", but I do think the behavior should be the same, TRAMP or not. Thanks From unknown Wed Jun 25 03:55:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17815: 24.4.50; (process-file) erroneously raises its buffer when running with TRAMP Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jun 2014 08:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dima Kogan Cc: 17815@debbugs.gnu.org Received: via spool by 17815-submit@debbugs.gnu.org id=B17815.140325316724253 (code B ref 17815); Fri, 20 Jun 2014 08:33:01 +0000 Received: (at 17815) by debbugs.gnu.org; 20 Jun 2014 08:32:47 +0000 Received: from localhost ([127.0.0.1]:53765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxuFa-0006J6-Na for submit@debbugs.gnu.org; Fri, 20 Jun 2014 04:32:47 -0400 Received: from mout.gmx.net ([212.227.17.21]:60146) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxuFX-0006Ij-Q5 for 17815@debbugs.gnu.org; Fri, 20 Jun 2014 04:32:44 -0400 Received: from detlef.gmx.de ([93.209.88.241]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LoEPJ-1WUsxg1Rc1-00gEMj; Fri, 20 Jun 2014 10:32:37 +0200 From: Michael Albinus References: <87r42km287.fsf@secretsauce.net> Date: Fri, 20 Jun 2014 10:32:30 +0200 In-Reply-To: <87r42km287.fsf@secretsauce.net> (Dima Kogan's message of "Fri, 20 Jun 2014 01:09:28 -0700") Message-ID: <87wqccasm9.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:TswhCtbhxupyIG0t0M57k0ynrKW7OY7OsiqM/g55LF+VVfm81jk E8ypiG8HaDL8IY+OcMcq6NewrsnY5rvQYJkuiBEmDmtvDXzkeo5Sph7A0kw06I1GgwrbvO/ avt6uAeZX/Wt66xPtI114Z4lDnt+R0lAwxcYc5cTHmBFibhCMA+5ZVqheksycANeSMnD+cT x4BWUzBENJhGnqsV/gxew== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Dima Kogan writes: > Hi. Hi Dima, > If I change the directory from "/tmp" to any TRAMP path (for instance > "/sudo::/tmp") then this elisp DOES raise *test-buf*. This difference > between normal and TRAMP behavior sounds like a bug to me. I could reproduce it locally. And I agree, it is rather a bug in Tramp, which I will fix next days (being too busy just now). @Stefan: This is no regression, I could reproduce it even with Emacs 23.4. Therefore, I will fix it in the trunk. Please tell me if you believe it shall go into emacs-24. > Thanks Thanks for reporting, and best regards, Michael. From unknown Wed Jun 25 03:55:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17815: 24.4.50; (process-file) erroneously raises its buffer when running with TRAMP Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jun 2014 13:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Albinus Cc: Dima Kogan , 17815@debbugs.gnu.org Received: via spool by 17815-submit@debbugs.gnu.org id=B17815.140326978728774 (code B ref 17815); Fri, 20 Jun 2014 13:10:02 +0000 Received: (at 17815) by debbugs.gnu.org; 20 Jun 2014 13:09:47 +0000 Received: from localhost ([127.0.0.1]:53871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxyZZ-0007Ty-Tq for submit@debbugs.gnu.org; Fri, 20 Jun 2014 09:09:46 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:47256) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxyZS-0007TZ-SY for 17815@debbugs.gnu.org; Fri, 20 Jun 2014 09:09:39 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giYBAQRWIxALNBIUGA0kiAzSGReOegeEOAEDqRmBaoFxgVsh X-IPAS-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giYBAQRWIxALNBIUGA0kiAzSGReOegeEOAEDqRmBaoFxgVsh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="68722768" Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 20 Jun 2014 09:09:28 -0400 Received: by pastel.home (Postfix, from userid 20848) id 4D7B060D09; Fri, 20 Jun 2014 09:09:28 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87r42km287.fsf@secretsauce.net> <87wqccasm9.fsf@gmx.de> Date: Fri, 20 Jun 2014 09:09:28 -0400 In-Reply-To: <87wqccasm9.fsf@gmx.de> (Michael Albinus's message of "Fri, 20 Jun 2014 10:32:30 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > @Stefan: This is no regression, I could reproduce it even with Emacs > 23.4. Therefore, I will fix it in the trunk. Please tell me if you > believe it shall go into emacs-24. Show me the patch (when it's ready), so I can see whether it looks safe enough. Stefan From unknown Wed Jun 25 03:55:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17815: 24.4.50; (process-file) erroneously raises its buffer when running with TRAMP Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jun 2014 13:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Dima Kogan , 17815@debbugs.gnu.org Received: via spool by 17815-submit@debbugs.gnu.org id=B17815.1403272277332 (code B ref 17815); Fri, 20 Jun 2014 13:52:01 +0000 Received: (at 17815) by debbugs.gnu.org; 20 Jun 2014 13:51:17 +0000 Received: from localhost ([127.0.0.1]:53900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxzDl-00005C-Jc for submit@debbugs.gnu.org; Fri, 20 Jun 2014 09:51:17 -0400 Received: from mout.gmx.net ([212.227.17.22]:64124) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxzDg-00004t-L2 for 17815@debbugs.gnu.org; Fri, 20 Jun 2014 09:51:12 -0400 Received: from detlef.gmx.de ([93.209.88.241]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0LaXEN-1WI0Zb0Icp-00mIU6; Fri, 20 Jun 2014 15:50:58 +0200 From: Michael Albinus References: <87r42km287.fsf@secretsauce.net> <87wqccasm9.fsf@gmx.de> Date: Fri, 20 Jun 2014 15:50:48 +0200 In-Reply-To: (Stefan Monnier's message of "Fri, 20 Jun 2014 09:09:28 -0400") Message-ID: <87r42jbsg7.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:ul7y2CbhNjcoUA9bHmo5O+xVStYcHM43GS5rdL7Mcm7mSXBSEWC +2FY3xwHau3Rd2/a01kIcTA5rsoYzUOMF2ClRez3iygzz85yssvIDuVdMt2KSU/7IREZDCe bTyrMLltB14e7raOcbGcG2uMm8nH7lbjo8W891zZS5K/yiY130Ubmsu9qm5QW3cIti1YIzs /nNcs//3kl/sPYX5OObQQ== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain Stefan Monnier writes: >> @Stefan: This is no regression, I could reproduce it even with Emacs >> 23.4. Therefore, I will fix it in the trunk. Please tell me if you >> believe it shall go into emacs-24. > > Show me the patch (when it's ready), so I can see whether it looks > safe enough. That's what I've committed to the Tramp repository: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=diff diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 76a3c48..ba410f1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2014-06-20 Michael Albinus + + * tramp-adb.el (tramp-adb-handle-process-file): + * tramp-sh.el (tramp-sh-handle-process-file): + * tramp-smb.el (tramp-smb-handle-process-file): Do not raise the + output buffer when DISPLAY is non-nil. (Bug#17815) + 2014-06-16 Michael Albinus * tramp.el (tramp-call-process): Handle error strings. diff --git a/lisp/tramp-adb.el b/lisp/tramp-adb.el index f38cecb..91caa4a 100644 --- a/lisp/tramp-adb.el +++ b/lisp/tramp-adb.el @@ -801,11 +801,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." v (format "(cd %s; %s)" (tramp-shell-quote-argument localname) command) "") - ;; We should show the output anyway. + ;; We should add the output anyway. (when outbuf (with-current-buffer outbuf (insert-buffer-substring (tramp-get-connection-buffer v))) - (when display (display-buffer outbuf)))) + (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. (quit diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el index a6771cd..68f1ef4 100644 --- a/lisp/tramp-sh.el +++ b/lisp/tramp-sh.el @@ -2994,13 +2994,13 @@ the result will be a local, non-Tramp, file name." command) t t) 0 1)) - ;; We should show the output anyway. + ;; We should add the output anyway. (when outbuf (with-current-buffer outbuf (insert (with-current-buffer (tramp-get-connection-buffer v) (buffer-string)))) - (when display (display-buffer outbuf)))) + (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. (quit diff --git a/lisp/tramp-smb.el b/lisp/tramp-smb.el index aa44b8d..15ae9ed 100644 --- a/lisp/tramp-smb.el +++ b/lisp/tramp-smb.el @@ -1225,8 +1225,8 @@ target of the symlink differ." (error (setq ret 1))) - ;; We should show the output anyway. - (when (and outbuf display) (display-buffer outbuf)) + ;; We should redisplay the output. + (when (and display outbuf (get-buffer-window outbuf t)) (redisplay)) ;; Cleanup. We remove all file cache values for the connection, ;; because the remote process could have changed them. diff --git a/test/ChangeLog b/test/ChangeLog index c672532..5ba0b82 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-06-20 Michael Albinus + + * tramp-tests.el (tramp-test26-process-file): Extend test + according to Bug#17815. + 2014-06-15 Michael Albinus Version 2.2.10 released. diff --git a/test/tramp-tests.el b/test/tramp-tests.el index d30a5b0..b010ab4 100644 --- a/test/tramp-tests.el +++ b/test/tramp-tests.el @@ -1246,9 +1246,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) '(tramp-gvfs-file-name-handler tramp-smb-file-name-handler)))) - (let ((tmp-name (tramp--test-make-temp-name)) - (default-directory tramp-test-temporary-file-directory) - kill-buffer-query-functions) + (let* ((tmp-name (tramp--test-make-temp-name)) + (fnnd (file-name-nondirectory tmp-name)) + (default-directory tramp-test-temporary-file-directory) + kill-buffer-query-functions) (unwind-protect (progn ;; We cannot use "/bin/true" and "/bin/false"; those paths @@ -1259,17 +1260,25 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (with-temp-buffer (write-region "foo" nil tmp-name) (should (file-exists-p tmp-name)) - (should - (zerop - (process-file "ls" nil t nil (file-name-nondirectory tmp-name)))) + (should (zerop (process-file "ls" nil t nil fnnd))) + ;; `ls' could produce colorized output. + (goto-char (point-min)) + (while (re-search-forward tramp-color-escape-sequence-regexp nil t) + (replace-match "" nil nil)) + (should (string-equal (format "%s\n" fnnd) (buffer-string))) + (should-not (get-buffer-window (current-buffer) t)) + + ;; Second run. The output must be appended. + (should (zerop (process-file "ls" nil t t fnnd))) ;; `ls' could produce colorized output. (goto-char (point-min)) (while (re-search-forward tramp-color-escape-sequence-regexp nil t) (replace-match "" nil nil)) (should - (string-equal - (format "%s\n" (file-name-nondirectory tmp-name)) - (buffer-string))))) + (string-equal (format "%s\n%s\n" fnnd fnnd) (buffer-string))) + ;; A non-nil DISPLAY must not raise the buffer. + (should-not (get-buffer-window (current-buffer) t)))) + (ignore-errors (delete-file tmp-name))))) (ert-deftest tramp-test27-start-file-process () --=-=-= Content-Type: text/plain > Stefan Best regards, Michael. --=-=-=-- From unknown Wed Jun 25 03:55:49 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Dima Kogan Subject: bug#17815: closed (Re: bug#17815: 24.4.50; (process-file) erroneously raises its buffer when running with TRAMP) Message-ID: References: <87ha3d47ka.fsf@gmx.de> <87r42km287.fsf@secretsauce.net> X-Gnu-PR-Message: they-closed 17815 X-Gnu-PR-Package: emacs Reply-To: 17815@debbugs.gnu.org Date: Sun, 22 Jun 2014 09:29:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1403429343-5279-1" This is a multi-part message in MIME format... ------------=_1403429343-5279-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #17815: 24.4.50; (process-file) erroneously raises its buffer when running = with TRAMP which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 17815@debbugs.gnu.org. --=20 17815: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D17815 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1403429343-5279-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 17815-done) by debbugs.gnu.org; 22 Jun 2014 09:28:40 +0000 Received: from localhost ([127.0.0.1]:56664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wye4l-0001MV-HO for submit@debbugs.gnu.org; Sun, 22 Jun 2014 05:28:39 -0400 Received: from mout.gmx.net ([212.227.15.19]:55010) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wye4i-0001ME-3K for 17815-done@debbugs.gnu.org; Sun, 22 Jun 2014 05:28:37 -0400 Received: from detlef.gmx.de ([93.209.76.111]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Lr32V-1WTS7K2N19-00eaTY; Sun, 22 Jun 2014 11:28:29 +0200 From: Michael Albinus To: Stefan Monnier Subject: Re: bug#17815: 24.4.50; (process-file) erroneously raises its buffer when running with TRAMP References: <87r42km287.fsf@secretsauce.net> <87wqccasm9.fsf@gmx.de> <87r42jbsg7.fsf@gmx.de> Date: Sun, 22 Jun 2014 11:28:21 +0200 In-Reply-To: (Stefan Monnier's message of "Fri, 20 Jun 2014 10:49:01 -0400") Message-ID: <87ha3d47ka.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:1ZlxX/BY9qF/IkjETcnmdpvUnB38/nF527yEk7gq+gGW41v/iUS FM9xxrau4i0iljAS8jET0lUUtOlxpDGYmbjXNy1o1mXnwPSnghsha18vD6aPCj81SoSRPkc qT4XlhBkc1Qz1/0Ov6S8MURDPea4zdODHAsNl3NmNO8Q5jftnMvraUhZGOyU15bWLU1JZ+B slxOFKFTiy5Zi3DUajWPg== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17815-done Cc: Dima Kogan , 17815-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Stefan Monnier writes: >>>> @Stefan: This is no regression, I could reproduce it even with Emacs >>>> 23.4. Therefore, I will fix it in the trunk. Please tell me if you >>>> believe it shall go into emacs-24. >>> Show me the patch (when it's ready), so I can see whether it looks >>> safe enough. >> That's what I've committed to the Tramp repository: > > Looks safe enough for emacs-24, thanks. I've committed the lisp files to the emacs-24 branch as 117284, closing the bug. tramp-tests.el will be committed to the trunk, next time emacs-24 has been merged there. > And in trunk, could you try and reduce the code-duplication between > tramp-sh.el and tramp-adb.el? 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. > Stefan Best regards, Michael. ------------=_1403429343-5279-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 20 Jun 2014 08:10:02 +0000 Received: from localhost ([127.0.0.1]:53735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxttY-0005fK-JR for submit@debbugs.gnu.org; Fri, 20 Jun 2014 04:10:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46673) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxttV-0005f2-RS for submit@debbugs.gnu.org; Fri, 20 Jun 2014 04:09:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxttK-0000np-1C for submit@debbugs.gnu.org; Fri, 20 Jun 2014 04:09:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxttJ-0000nk-Ut for submit@debbugs.gnu.org; Fri, 20 Jun 2014 04:09:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxttE-0004pw-2j for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 04:09:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wxtt7-0000lN-Pe for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 04:09:40 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:49057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxtt7-0000kl-LD for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 04:09:33 -0400 Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 3105F21273 for ; Fri, 20 Jun 2014 04:09:30 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Fri, 20 Jun 2014 04:09:30 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=from:to:subject:date:message-id:mime-version:content-type; s= mesmtp; bh=3BWv1Y5AprQwQdgzvaQFVQu6QgY=; b=ajyShIWUvH9ifBhII8c8m DJ+XO2udLaB9CZk+zDzw4mSYtZEBnF/HFfXKrMxB9IKETXbhcNhhkWB4Bx/xoXND HXfaesWkNSDh0lkcNAg4YFrJXQxlVWPH3EOW8UwIGREU6SnOWF1t6GPX1TilHHXY wLX5sKWIeY3GT1lxwxYTWw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :mime-version:content-type; s=smtpout; bh=3BWv1Y5AprQwQdgzvaQFVQ u6QgY=; b=Sjtwfe6kG5TnenmU67fNrlkiLfoC7h2yk599B7fXsylQw73ocltrH4 eue0OWCAv7FP7osgcUL6nflxoW45nGCowSlzFyi+On8/plWc+TaNTe+cXFdx9lHT XSGK1m6UQ+FRN37DSZ1bJ/9xzCvKGlZRNmAx4LFe8GxAs9TmI1654= X-Sasl-enc: HQlfj69shdDm6xBeJNg4XfxDJq9CeHtIlIH3ffAT7AoA 1403251769 Received: from shorty.local (unknown [23.243.199.75]) by mail.messagingengine.com (Postfix) with ESMTPA id EA96EC007AD for ; Fri, 20 Jun 2014 04:09:29 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1Wxtt2-0003Le-D2 for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 01:09:28 -0700 From: Dima Kogan To: bug-gnu-emacs@gnu.org Subject: 24.4.50; (process-file) erroneously raises its buffer when running with TRAMP Date: Fri, 20 Jun 2014 01:09:28 -0700 Message-ID: <87r42km287.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hi. The documentation is a bit unclear, so I'm not 100% sure this is a bug; it's definitely a surprising behavior, though. I have a bit of elisp to create a temporary buffer and to run a process, sending its output to this buffer: (let ((output-buffer (get-buffer-create "*test-buf*"))) (with-current-buffer output-buffer (erase-buffer) (let ((default-directory "/tmp")) (process-file "whoami" nil output-buffer t)))) Note that I do not ask for this buffer to be raised. On my machine (Debian/sid amd64) this indeed does not raise the *test-buf* buffer, and I do not even see it if I don't explicitly switch to it. This is good. If I change the directory from "/tmp" to any TRAMP path (for instance "/sudo::/tmp") then this elisp DOES raise *test-buf*. This difference between normal and TRAMP behavior sounds like a bug to me. Note that I have (process-file ... ... ... t). Changing this to nil resolves the issue. The documentation says Fourth arg DISPLAY non-nil means redisplay buffer as output is inserted. I don't know if "redisplay" includes "raise", but I do think the behavior should be the same, TRAMP or not. Thanks ------------=_1403429343-5279-1-- From unknown Wed Jun 25 03:55:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17815: 24.4.50; (process-file) erroneously raises its buffer when running with TRAMP Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Jun 2014 12:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Albinus Cc: Dima Kogan , 17815-done@debbugs.gnu.org Received: via spool by 17815-done@debbugs.gnu.org id=D17815.140344175329598 (code D ref 17815); Sun, 22 Jun 2014 12:56:02 +0000 Received: (at 17815-done) by debbugs.gnu.org; 22 Jun 2014 12:55:53 +0000 Received: from localhost ([127.0.0.1]:56725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WyhJI-0007hJ-1J for submit@debbugs.gnu.org; Sun, 22 Jun 2014 08:55:52 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:22960) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WyhJF-0007h3-8C for 17815-done@debbugs.gnu.org; Sun, 22 Jun 2014 08:55:50 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCzQSFBgNJIgECNIZF456B4Q4BJRilDeBaoFxgVsh X-IPAS-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCzQSFBgNJIgECNIZF456B4Q4BJRilDeBaoFxgVsh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="69060542" Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 22 Jun 2014 08:55:43 -0400 Received: by pastel.home (Postfix, from userid 20848) id 3DC4560359; Sun, 22 Jun 2014 08:55:43 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87r42km287.fsf@secretsauce.net> <87wqccasm9.fsf@gmx.de> <87r42jbsg7.fsf@gmx.de> <87ha3d47ka.fsf@gmx.de> Date: Sun, 22 Jun 2014 08:55:43 -0400 In-Reply-To: <87ha3d47ka.fsf@gmx.de> (Michael Albinus's message of "Sun, 22 Jun 2014 11:28:21 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > 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. Stefan --- mine/tramp-sh.el +++ other/tramp-sh.el @@ -1,4 +1,4 @@ -(defun tramp-sh-handle-process-file +(defun tramp-adb-handle-process-file (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 ;; directory. (condition-case nil - (unwind-protect - (setq ret - (if (tramp-send-command-and-check - v (format "\\cd %s; %s" - (tramp-shell-quote-argument localname) - command) - t t) - 0 1)) + (progn + (setq ret 0) + (tramp-adb-barf-unless-okay + v (format "(cd %s; %s)" + (tramp-shell-quote-argument localname) command) + "") ;; We should add the output anyway. (when outbuf (with-current-buffer outbuf - (insert - (with-current-buffer (tramp-get-connection-buffer v) - (buffer-string)))) + (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 "")) From unknown Wed Jun 25 03:55:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17815: 24.4.50; (process-file) erroneously raises its buffer when running with TRAMP Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Jun 2014 13:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Dima Kogan , 17815@debbugs.gnu.org Received: via spool by 17815-submit@debbugs.gnu.org id=B17815.14034448411882 (code B ref 17815); Sun, 22 Jun 2014 13:48:01 +0000 Received: (at 17815) by debbugs.gnu.org; 22 Jun 2014 13:47:21 +0000 Received: from localhost ([127.0.0.1]:56740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wyi76-0000UH-Gt for submit@debbugs.gnu.org; Sun, 22 Jun 2014 09:47:20 -0400 Received: from mout.gmx.net ([212.227.15.18]:52716) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wyi73-0000Tw-4z for 17815@debbugs.gnu.org; Sun, 22 Jun 2014 09:47:18 -0400 Received: from detlef.gmx.de ([93.209.76.111]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MgHHO-1XIxyv2qhi-00NkUw; Sun, 22 Jun 2014 15:47:08 +0200 From: Michael Albinus References: <87r42km287.fsf@secretsauce.net> <87wqccasm9.fsf@gmx.de> <87r42jbsg7.fsf@gmx.de> <87ha3d47ka.fsf@gmx.de> Date: Sun, 22 Jun 2014 15:46:59 +0200 In-Reply-To: (Stefan Monnier's message of "Sun, 22 Jun 2014 08:55:43 -0400") Message-ID: <87a9953vl8.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:MJPItQqWOkzAps76YAqXCWY+dCCKOtOIm1kqnztzvCR7RmcHX2k lras8UO0wI1dTg6IUegetZHy4OfFP4P3bKszRtJ5g/22pprXFowDKp0pvN1OChR0TzjrDil zQEvNM1JgrKG6eOorbjVf3gORNLNZsgRidvK3CyXFqGCZMsSrrtIHtgOKjV9CNNYsXtaQR2 HdCEm74aohiaNTG6c9cOw== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Stefan Monnier writes: >> 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. Right, that's why I wrote about "subtle" differences. > 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. Sure. But lately I was plagued with recursive loading of Tramp packages, so I'm a little bit conservative in moving code between the different files. Whenever it is possible to refactor code out I'll do. *-process-file is on the list, but I cannot promise to do it immediately. One idea is to generalize `tramp-send-command' and friends, for most of the handlers this is the major difference between the different backends. Other handlers but *-process-file would profit from this as well. > Stefan Best regards, Michael.