all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Thierry Volpiatto <thievol@posteo.net>
Cc: 48067@debbugs.gnu.org
Subject: bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
Date: Wed, 28 Apr 2021 15:57:37 +0200	[thread overview]
Message-ID: <87bl9y5x66.fsf@gmx.de> (raw)
In-Reply-To: <87czuefu94.fsf@posteo.net> (Thierry Volpiatto's message of "Wed,  28 Apr 2021 12:41:21 +0000")

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

Thierry Volpiatto <thievol@posteo.net> writes:

> Hello Michael,

Hi Thierry,

> What I did: M-x helm-find-files => /sudo::/home/thierry/tmp/
> Looks the watchers are recorded with a warning though.

That's OK. The warning tells us that it is an older gio version, which
doesn't want to speak about its implementation details. Not a big deal,
Tramp handles this.

> Then I delete test.txt from external terminal.
> It seems the watcher catched the event but the notification is with the
> local name of directory instead of the remote name.
> I.e. /home/thierry/tmp/ instead of /sudo::/home/thierry/tmp/
> not sure if it is normal.

That's OK. gio doesn't know Tramp and its syntax :-)

> 14:39:28.298343 tramp-sh-gio-monitor-process-filter (6) # #<process gio>
>
> (gio monitor:27194): GLib-GIO-%1b[1;33mWARNING%1b[0m **:
> %1b[34m14:39:28.217%1b[0m: Can't find module 'help' specified in GIO_USE_FILE_MONITOR

And here's the problem. The warning includes escape sequences, which are
not known to tramp-sh-gio-monitor-process-filter. So I've reworked the
patch as attached, could you pls test?

> Thanks.

Best regards, Michael.


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

*** /tmp/ediffoD9hFR	2021-04-28 15:56:06.972513700 +0200
--- /home/albinus/src/tramp/lisp/tramp-sh.el	2021-04-28 15:49:29.271184411 +0200
***************
*** 3730,3760 ****

        ;; Determine monitor name.
        (unless (tramp-connection-property-p proc "gio-file-monitor")
!         (cond
!          ;; We have seen this on cygwin gio and on emba.  Let's make some assumptions.
!          ((string-match
!            "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
!           (cond
!            ((getenv "EMACS_EMBA_CI")
!             (tramp-set-connection-property
!              proc "gio-file-monitor" 'GInotifyFileMonitor))
!            ((eq system-type 'cygwin)
!             (tramp-set-connection-property
!              proc "gio-file-monitor" 'GPollFileMonitor))
!            (t (tramp-error proc 'file-error "Cannot determine gio monitor"))))
!          ;; TODO: What happens, if several monitor names are reported?
!          ((string-match "\
  Supported arguments for GIO_USE_FILE_MONITOR environment variable:
  \\s-*\\([[:alpha:]]+\\) - 20" string)
-           (tramp-set-connection-property
-            proc "gio-file-monitor"
             (intern
!             (format "G%sFileMonitor" (capitalize (match-string 1 string))))))
!          (t (throw 'doesnt-work nil)))
!         (setq string (replace-match "" nil nil string)))

        ;; Delete empty lines.
!       (setq string (tramp-compat-string-replace "\n\n" "\n" string))

        (while (string-match
  	      (eval-when-compile
--- 3730,3758 ----

        ;; Determine monitor name.
        (unless (tramp-connection-property-p proc "gio-file-monitor")
!         (tramp-set-connection-property
!          proc "gio-file-monitor"
!          (cond
!           ;; We have seen this on cygwin gio and on emba.  Let's make
!           ;; some assumptions.
!           ((string-match
!             "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
!            (cond
!             ((getenv "EMACS_EMBA_CI") 'GInotifyFileMonitor)
!             ((eq system-type 'cygwin) 'GPollFileMonitor)
!             (t tramp-cache-undefined)))
!           ;; TODO: What happens, if several monitor names are reported?
!           ((string-match "\
  Supported arguments for GIO_USE_FILE_MONITOR environment variable:
  \\s-*\\([[:alpha:]]+\\) - 20" string)
             (intern
! 	    (format "G%sFileMonitor" (capitalize (match-string 1 string)))))
!           (t (throw 'doesnt-work nil))))
! 	(setq string (substring string (match-end 0))))

        ;; Delete empty lines.
!       (setq string (tramp-compat-string-replace "\n\n" "\n" string)
! 	    string (replace-regexp-in-string "^\n" "" string))

        (while (string-match
  	      (eval-when-compile

  parent reply	other threads:[~2021-04-28 13:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 16:58 bug#48067: 28.0.50; Tramp error: cannot determine gio monitor Thierry Volpiatto
2021-04-27 19:19 ` Michael Albinus
2021-04-27 21:38   ` Thierry Volpiatto
2021-04-28  5:59     ` Thierry Volpiatto
2021-04-28  7:38       ` Michael Albinus
2021-04-28 10:56         ` Thierry Volpiatto
2021-04-28 11:16           ` Michael Albinus
     [not found]             ` <87czuefu94.fsf@posteo.net>
2021-04-28 13:57               ` Michael Albinus [this message]
     [not found]                 ` <87zgxi1nci.fsf@posteo.net>
     [not found]                   ` <87zgxixx8j.fsf@posteo.net>
2021-04-28 16:25                     ` Michael Albinus
     [not found]                       ` <87tunqxrii.fsf@posteo.net>
2021-04-28 17:39                         ` Michael Albinus
2021-04-28 18:28                           ` Thierry Volpiatto
2021-04-28 18:47                           ` Thierry Volpiatto
2021-04-28 18:56                             ` Michael Albinus
2021-04-29  5:33                               ` Thierry Volpiatto
2021-04-29  7:17                                 ` Michael Albinus
2021-04-29  7:48                                   ` Thierry Volpiatto
2021-04-29  6:09                               ` Thierry Volpiatto
2021-04-29  6:46                                 ` Thierry Volpiatto
2021-04-29  8:11                                   ` Michael Albinus
2021-04-29  8:42                                     ` Thierry Volpiatto
     [not found]                                     ` <87r1it5u0q.fsf@posteo.net>
     [not found]                                       ` <87pmydz9my.fsf@gmx.de>
2021-04-29 10:55                                         ` Michael Albinus
2021-04-29 11:26                                           ` Thierry Volpiatto
2021-04-29 11:30                                             ` Thierry Volpiatto
2021-04-29 13:09                                               ` Michael Albinus
2021-04-29 13:07                                             ` Michael Albinus
2021-04-29 13:20                                               ` Thierry Volpiatto

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=87bl9y5x66.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=48067@debbugs.gnu.org \
    --cc=thievol@posteo.net \
    /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.