From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#24394: 25.1.50; (find-file "/sudo::") ignores async-shell-command-buffer settings Date: Sun, 11 Sep 2016 12:10:17 +0200 Message-ID: <87y42ysq5y.fsf@gmx.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1473589605 14366 195.159.176.226 (11 Sep 2016 10:26:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Sep 2016 10:26:45 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: 24394@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 11 12:26:42 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bj1yB-0000vE-3Z for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2016 12:26:40 +0200 Original-Received: from localhost ([::1]:37089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj1jG-0000cB-L0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2016 06:11:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj1jA-0000bl-8v for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 06:11:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bj1j4-000143-89 for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 06:11:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj1j4-00013z-4P for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 06:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bj1j3-00077b-VY for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 06:11:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Sep 2016 10:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24394 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24394-submit@debbugs.gnu.org id=B24394.147358862727326 (code B ref 24394); Sun, 11 Sep 2016 10:11:01 +0000 Original-Received: (at 24394) by debbugs.gnu.org; 11 Sep 2016 10:10:27 +0000 Original-Received: from localhost ([127.0.0.1]:55922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bj1iU-00076g-Np for submit@debbugs.gnu.org; Sun, 11 Sep 2016 06:10:26 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:51857) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bj1iT-00076T-NK for 24394@debbugs.gnu.org; Sun, 11 Sep 2016 06:10:26 -0400 Original-Received: from detlef.gmx.de ([79.195.4.70]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MWk3f-1bYLZ20f3T-00XvsI; Sun, 11 Sep 2016 12:10:19 +0200 X-Provags-ID: V03:K0:cyXYtT40bzKRdVU38mCTOAWthEHtZCNdGm1mfxspJwIKVUUHwgX QPSS0QmS5eEMMuSoCIz9yKiRH/QagUbE4w6mooqAWoSd5RZEQ8x86d4s6dfRkJeI75akP4i HUDt0f4IA58Tty5wAC5T3LpccyunW8ekav8I+7POzsI4xwCaL8OWKVeHjxZGPZMuePFBVAo sZG5KbPj8EbC/pXQ9Oiww== X-UI-Out-Filterresults: notjunk:1;V01:K0:h09vWCQhzZs=:WKdBCI9IeTWd69N1b8QbuN Iv6NCDnai5VkNrx8aPq01bVzIHdg+DFNjA7dFeaBXEqZBoMePCi55z6twG+UatsAfnJvZLXSx 1EJrXfuuQg9ij+/LyDIrHdo1kpFv+VZ9dHa0OLLvV7xkZXDSNddK8VedDtTehtZU0T9Z3R/9X UiVVQw4SW98spKOZ91qFRVoMDwjoaQAA1H5RzwJDMbs5yKGiqhISIdRdvg+ZI4w3qNGkpDz6U z8PQJIvsuO6eehwr4kSxCrcAYGFFz/4i8N9F+953d8gD3iqr/Mzm4pYdfezR6YM9julBYSrP0 tLKkR9AKt0Jlv/urOvJR2JvuE7Y8R6VlMfq4itqHG+s2BkQk/+j3O8uovImvzy0xLSCbdm+v/ +47StYrCJmJIYGurfsNVRS+aL6htfdqB8MfrZoxB7HPEbkGemTQ5MCJxvnyec6liy9T8yaZt/ XGk1q/yG6m6rVXCksuHl8/BoCeNkn75+iiKY6qnb1UBJZc7HVBfUad/4jd+cCBqV/Z1fWn6dS 5DaMnEtZRtN+cutU5ikoyjLu1VBjGPEGSFlOEJfQR6K0nmY0MSwpCReEohuBl5v8uRiy+8vWA FgzY1klDviyYjHVTkTk5OQQNGlnHNtw3uXCzRUEDAQYuD6sMfqzWOsauBXLvjSLeNJkcDZfNV JVzhLcbdeWXvon0YD09PQl+hdP53kW6NZUeP0qt8MeFOcM5AOfSTD3xP0DpqrfzAWDtAoIL1x Xb1C8723oyE06VkyzKHoNGEzcCePPH4aU4UfUGRRvUVX4E50sZ5GNG9vggkSu+KHF9LfNfaX X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:123161 Archived-At: Tino Calancha writes: Hi Tino, > emacs -Q -eval "(setq async-shell-command-buffer 'new-buffer)" > > I) M-&: i=0; while true; do echo $i; i=$((i+1)); sleep 1;done RET > ;; Repeating the command will not prompt for confirmation > II) M-&: M-p RET ; create buffer "*Async Shell Command*<2>". > III) M-:(let ((dir (expand-file-name default-directory))) > (find-file (concat "/sudo::") dir)) RET > IV) M-&: M-p RET > ;; Received prompt to kill buffer "*Async Shell Command*". > > In IV) the machine is the same as before and the original user > still is the owner of the Emacs session: i would expect IV) create > the buffer "*Async Shell Command*<3>" without any prompt. > Even if i set `async-shell-command-buffer' to 'new-buffer in > /root/.emacs i receive the prompt. You are right, Tramp's handler for `shell-command' ignores `async-shell-command-buffer'. The reason for this is the following comment in `tramp-handle-shell-command': --8<---------------cut here---------------start------------->8--- ;; Check whether there is another process running. Tramp does not ;; support 2 (asynchronous) processes in parallel. --8<---------------cut here---------------end--------------->8--- Well, this comment is more than 8 years old, and it is not true anymore (I've just tested). I don't remember when this was fixed, but so what ... However, I'm kind of reluctant to fix this in `tramp-handle-shell-command'. The respective code in `shell-command' spans over ~40 lines, and I don't believe Tramp shall simply copy those lines (and other details not handled in Tramp yet). It's even questionable that Tramp shall offer an own handler for `shell-command'. The reason why Tramp does this is the use of `shell-file-name' and `shell-command-switch'. They keep host local values, for remote connections other values are needed. It is a long standing request, that Tramp shall offer connection local variables, which carry different values for different remote hosts. If we would have such a mechanism, `shell-command' could use `process-file' and `start-file-process', and it would not need to call a file name handler anymore. And this error would go away. Comments? Best regards, Michael.