summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2021-04-29 15:04:51 +0200
committerMichael Albinus <michael.albinus@gmx.de>2021-04-29 15:04:51 +0200
commita8aa217bff255aa92eae5207c10df8877b0d137a (patch)
treec46c0462561d27c900f28cbe56d62ddbe6f32f9d
parent086e29d213ac89020d783af2618d4c53532f471e (diff)
downloademacs-a8aa217bff255aa92eae5207c10df8877b0d137a.tar.gz
emacs-a8aa217bff255aa92eae5207c10df8877b0d137a.tar.bz2
emacs-a8aa217bff255aa92eae5207c10df8877b0d137a.zip
Some Tramp corrections, Bug#48067
* 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)
-rw-r--r--doc/misc/tramp.texi10
-rw-r--r--lisp/net/tramp-sh.el16
2 files changed, 15 insertions, 11 deletions
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index e0f648fbd97..ebfc14d9368 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -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
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 4a3072ee346..b51ba11247f 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -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)))