unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19636: [TRAMP] global minor mode hangs connection when accessing files in :lighter
@ 2015-01-20 17:49 Philippe Vaucher
  2015-01-21 16:15 ` Michael Albinus
  0 siblings, 1 reply; 13+ messages in thread
From: Philippe Vaucher @ 2015-01-20 17:49 UTC (permalink / raw)
  To: 19636

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

Hello,

TRAMP hangs the connection for any new processes in both emacs 24.4
and emacs from the master branch when a global minor mode uses a
:lighter which evals `(file-truename default-directory)`.

To reproduce:

M-x find-file buggy-tramp-mode.el
M-x eval-buffer
M-x global-buggy-tramp-mode
M-x find-file /scpx:user@host:/tmp/foo.txt
M-x async-shell-command ls

The last command (new process) doens't complete and the TRAMP buffer
shows "Are you awake?". My understanding of the problem is that
`file-truename` tries to use a not-yet-ready TRAMP connection. To work
around that was tried is to use `tramp-connectable-p` or even
`file-remote-p` with the appropriate flags, but they both
(incorrectly?) return true.

The "real world" issue that it affects is
https://github.com/bbatsov/projectile/issues/523

Please ask if I'm unclear or you need more clarifications.

Thanks,
Philippe

[-- Attachment #2: buggy-tramp-mode.el --]
[-- Type: text/x-emacs-lisp, Size: 649 bytes --]

(require 'tramp)

(defcustom buggy-tramp-mode-lighter
  '(:eval (format " BUGGY[%s]" (if (or (not (file-remote-p default-directory)) (tramp-connectable-p default-directory))
                                   (file-truename default-directory)
                                 ":(")))
  "Buggy example."
  :group 'buggy-tramp-mode
  :type 'sexp
  :risky t)

;;(setq buggy-tramp-mode-lighter '(:eval (format " Projectile[%s]" default-directory)))

(define-minor-mode buggy-tramp-mode
  "test"
  :lighter buggy-tramp-mode-lighter
  :group 'buggy-tramp-mode)

(define-globalized-minor-mode global-buggy-tramp-mode
  buggy-tramp-mode
  buggy-tramp-mode)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-07-21 12:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-20 17:49 bug#19636: [TRAMP] global minor mode hangs connection when accessing files in :lighter Philippe Vaucher
2015-01-21 16:15 ` Michael Albinus
2015-01-21 17:40   ` Philippe Vaucher
2015-01-22 11:07     ` Philippe Vaucher
2015-01-25 19:40     ` Michael Albinus
2015-01-25 20:15       ` Philippe Vaucher
2015-01-25 21:10         ` Michael Albinus
2015-01-25 21:47           ` Philippe Vaucher
2017-03-25 20:43   ` Philippe Vaucher
2017-03-27 13:36     ` Michael Albinus
2017-03-27 15:46       ` Philippe Vaucher
2017-07-14 13:12         ` Michael Albinus
2017-07-21 12:56           ` Philippe Vaucher

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).