unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Aaron Jensen <aaronjensen@gmail.com>
Cc: 34196@debbugs.gnu.org
Subject: bug#34196: 27.0.50; tramp hangs on wrong password with global-auto-revert-mode
Date: Tue, 05 Feb 2019 13:51:31 +0100	[thread overview]
Message-ID: <877eeewg8c.fsf@gmx.de> (raw)
In-Reply-To: <CAHyO48wRgVX-eNUHQXADEhOh3fHksVggxjKu23-=G_PSZzy-iQ@mail.gmail.com> (Aaron Jensen's message of "Mon, 4 Feb 2019 08:47:47 -0800")

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

Aaron Jensen <aaronjensen@gmail.com> writes:

Hi Aaron,

[Pls keep the Cc, for the archives]

> I think that not-yet-connected tramp buffers need to be excluded from
> garm entirely, if that is possible.

Good idea. I've appended a patch, which reverts the last change from
tramp.el, and implements your proposal in autorevert.el. This is also
better, because Tramp as library shouldn't care about auto-revert.

Could you, pls, check whether this works for you?

> Thanks,
>
> Aaron

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2191 bytes --]

diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 16a742a458..150693baf1 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -767,6 +767,16 @@ auto-revert-buffers
 		    (buffer-list)
 		  auto-revert-buffer-list))
 	  remaining new)
+      ;; Buffers with remote contents shall be reverted only if the
+      ;; connection is established already.
+      (setq bufs (delq nil
+                       (mapcar
+                        (lambda (buf)
+                          (with-current-buffer buf
+                            (and (or (not (file-remote-p default-directory))
+                                     (file-remote-p default-directory nil t))
+                                 buf)))
+                        bufs)))
       ;; Partition `bufs' into two halves depending on whether or not
       ;; the buffers are in `auto-revert-remaining-buffers'.  The two
       ;; halves are then re-joined with the "remaining" buffers at the
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 82d2e5a4d3..d000bbe3d6 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4060,23 +4060,17 @@ tramp-process-actions
   (save-restriction
     (with-tramp-progress-reporter
 	proc 3 "Waiting for prompts from remote shell"
-      ;; `global-auto-revert-mode' could activate remote operations
-      ;; while we aren't ready.  We disable it temporarily.
-      (let ((garm (bound-and-true-p global-auto-revert-mode))
-	    exit)
-	(when garm (global-auto-revert-mode -1))
-	(unwind-protect
-	    (if timeout
-		(with-timeout (timeout (setq exit 'timeout))
-		  (while (not exit)
-		    (setq exit
-			  (catch 'tramp-action
-			    (tramp-process-one-action proc vec actions)))))
+      (let (exit)
+	(if timeout
+	    (with-timeout (timeout (setq exit 'timeout))
 	      (while (not exit)
 		(setq exit
 		      (catch 'tramp-action
 			(tramp-process-one-action proc vec actions)))))
-	  (when garm (global-auto-revert-mode)))
+	  (while (not exit)
+	    (setq exit
+		  (catch 'tramp-action
+		    (tramp-process-one-action proc vec actions)))))
 	(with-current-buffer (tramp-get-connection-buffer vec)
 	  (widen)
 	  (tramp-message vec 6 "\n%s" (buffer-string)))

  parent reply	other threads:[~2019-02-05 12:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25 15:36 bug#34196: 27.0.50; tramp hangs on wrong password with global-auto-revert-mode Aaron Jensen
2019-01-27 14:34 ` Aaron Jensen
2019-01-27 14:52   ` Aaron Jensen
2019-01-27 17:25     ` Michael Albinus
2019-02-04 15:06       ` Michael Albinus
     [not found]         ` <CAHyO48wRgVX-eNUHQXADEhOh3fHksVggxjKu23-=G_PSZzy-iQ@mail.gmail.com>
2019-02-05 12:51           ` Michael Albinus [this message]
2019-02-05 16:43             ` Aaron Jensen
2019-02-05 17:59               ` Michael Albinus
2019-02-05 18:14                 ` Aaron Jensen
2019-02-05 19:22                   ` Michael Albinus
2019-02-05 19:27                     ` Aaron Jensen
2019-02-05 20:07                       ` Michael Albinus
2019-02-05 22:41                         ` Aaron Jensen
2019-02-06  8:11                           ` Michael Albinus
2019-02-13 19:00 ` bug#34196: Error in auto-revert-buffers: Wrong type argument Alex Branham
2019-02-13 23:09   ` Michael Albinus
2019-02-14 17:05     ` Alex Branham
2019-02-14 20:25       ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=877eeewg8c.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=34196@debbugs.gnu.org \
    --cc=aaronjensen@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).