all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: 24394@debbugs.gnu.org
Subject: bug#24394: 25.1.50; (find-file "/sudo::") ignores async-shell-command-buffer settings
Date: Sun, 11 Sep 2016 12:10:17 +0200	[thread overview]
Message-ID: <87y42ysq5y.fsf@gmx.de> (raw)
In-Reply-To: <alpine.DEB.2.20.1609082336320.3930@calancha-pc>

Tino Calancha <tino.calancha@gmail.com> 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.





  parent reply	other threads:[~2016-09-11 10:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08 14:39 bug#24394: 25.1.50; (find-file "/sudo::") ignores async-shell-command-buffer settings Tino Calancha
2016-09-08 15:54 ` Tino Calancha
2016-09-11 10:10 ` Michael Albinus [this message]
2016-09-11 12:22   ` Tino Calancha
2016-09-12 10:07     ` Michael Albinus
2016-09-12 12:21       ` Tino Calancha
2019-03-22 13:45       ` Michael Albinus
2019-03-23 19:49         ` Tino Calancha
2019-03-24 12:43           ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y42ysq5y.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=24394@debbugs.gnu.org \
    --cc=tino.calancha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.