]> git.eshelyaron.com Git - emacs.git/commitdiff
Some Tramp corrections, Bug#48067
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 29 Apr 2021 13:04:51 +0000 (15:04 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 29 Apr 2021 13:04:51 +0000 (15:04 +0200)
* doc/misc/tramp.texi (Frequently Asked Questions): Rephrase GNU
ELPA warnings.

* lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter):
Improve handling of gio warning.  (Bug#48067)

doc/misc/tramp.texi
lisp/net/tramp-sh.el

index e0f648fbd97e59560191f3187c69030c2213b5f2..ebfc14d93686726a7d3e632d83dc7e5fd063f362 100644 (file)
@@ -5100,12 +5100,12 @@ I get an error @samp{tramp-file-name-handler: Invalid function:
 tramp-compat-with-mutex}
 
 @value{tramp} comes with compatibility code for different Emacs
-versions.  When you see this warning, you don't use the Emacs built-in
-version of @value{tramp}.  In case you have installed @value{tramp}
-from GNU ELPA, see the package README file for instructions how to
-recompile it.
+versions.  When you see such a message (the text might differ), you
+don't use the Emacs built-in version of @value{tramp}.  In case you
+have installed @value{tramp} from GNU ELPA, see the package README
+file for instructions how to recompile it.
 @ifset installchapter
-In case you have installed it from its Git repository, @ref{Recompilation}.
+@xref{Recompilation}.
 @end ifset
 
 
index 4a3072ee346d8ad9d3da137cba8fe3560f504722..b51ba11247f656efe87620e2a36380fa4d5f0b06 100644 (file)
@@ -3708,7 +3708,8 @@ Fall back to normal file name handler if no Tramp handler exists."
        (remote-prefix
         (with-current-buffer (process-buffer proc)
           (file-remote-p default-directory)))
-       (rest-string (process-get proc 'rest-string)))
+       (rest-string (process-get proc 'rest-string))
+       pos)
     (when rest-string
       (tramp-message proc 10 "Previous string:\n%s" rest-string))
     (tramp-message proc 6 "%S\n%s" proc string)
@@ -3737,22 +3738,23 @@ Fall back to normal file name handler if no Tramp handler exists."
           ;; some assumptions.
           ((string-match
             "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
+          (setq pos (match-end 0))
            (cond
             ((getenv "EMACS_EMBA_CI") 'GInotifyFileMonitor)
             ((eq system-type 'cygwin) 'GPollFileMonitor)
-            (t tramp-cache-undefined)))
+            (t nil)))
           ;; TODO: What happens, if several monitor names are reported?
           ((string-match "\
 Supported arguments for GIO_USE_FILE_MONITOR environment variable:
 \\s-*\\([[:alpha:]]+\\) - 20" string)
+          (setq pos (match-end 0))
            (intern
            (format "G%sFileMonitor" (capitalize (match-string 1 string)))))
-          (t (throw 'doesnt-work nil))))
-       (setq string (substring string (match-end 0))))
+          (t (setq pos (length string)) nil)))
+       (setq string (substring string pos)))
 
       ;; Delete empty lines.
-      (setq string (tramp-compat-string-replace "\n\n" "\n" string)
-           string (replace-regexp-in-string "^\n" "" string))
+      (setq string (tramp-compat-string-replace "\n\n" "\n" string))
 
       (while (string-match
              (eval-when-compile
@@ -3783,6 +3785,8 @@ Supported arguments for GIO_USE_FILE_MONITOR environment variable:
             `(file-notify ,object file-notify-callback))))))
 
     ;; Save rest of the string.
+    (while (string-match "^\n" string)
+      (setq string (replace-match "" nil nil string)))
     (when (zerop (length string)) (setq string nil))
     (when string (tramp-message proc 10 "Rest string:\n%s" string))
     (process-put proc 'rest-string string)))