aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2021-04-29 15:04:51 +0200
committerMichael Albinus2021-04-29 15:04:51 +0200
commita8aa217bff255aa92eae5207c10df8877b0d137a (patch)
treec46c0462561d27c900f28cbe56d62ddbe6f32f9d
parent086e29d213ac89020d783af2618d4c53532f471e (diff)
downloademacs-a8aa217bff255aa92eae5207c10df8877b0d137a.tar.gz
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:
5100tramp-compat-with-mutex} 5100tramp-compat-with-mutex}
5101 5101
5102@value{tramp} comes with compatibility code for different Emacs 5102@value{tramp} comes with compatibility code for different Emacs
5103versions. When you see this warning, you don't use the Emacs built-in 5103versions. When you see such a message (the text might differ), you
5104version of @value{tramp}. In case you have installed @value{tramp} 5104don't use the Emacs built-in version of @value{tramp}. In case you
5105from GNU ELPA, see the package README file for instructions how to 5105have installed @value{tramp} from GNU ELPA, see the package README
5106recompile it. 5106file for instructions how to recompile it.
5107@ifset installchapter 5107@ifset installchapter
5108In case you have installed it from its Git repository, @ref{Recompilation}. 5108@xref{Recompilation}.
5109@end ifset 5109@end ifset
5110 5110
5111 5111
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."
3708 (remote-prefix 3708 (remote-prefix
3709 (with-current-buffer (process-buffer proc) 3709 (with-current-buffer (process-buffer proc)
3710 (file-remote-p default-directory))) 3710 (file-remote-p default-directory)))
3711 (rest-string (process-get proc 'rest-string))) 3711 (rest-string (process-get proc 'rest-string))
3712 pos)
3712 (when rest-string 3713 (when rest-string
3713 (tramp-message proc 10 "Previous string:\n%s" rest-string)) 3714 (tramp-message proc 10 "Previous string:\n%s" rest-string))
3714 (tramp-message proc 6 "%S\n%s" proc string) 3715 (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."
3737 ;; some assumptions. 3738 ;; some assumptions.
3738 ((string-match 3739 ((string-match
3739 "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string) 3740 "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
3741 (setq pos (match-end 0))
3740 (cond 3742 (cond
3741 ((getenv "EMACS_EMBA_CI") 'GInotifyFileMonitor) 3743 ((getenv "EMACS_EMBA_CI") 'GInotifyFileMonitor)
3742 ((eq system-type 'cygwin) 'GPollFileMonitor) 3744 ((eq system-type 'cygwin) 'GPollFileMonitor)
3743 (t tramp-cache-undefined))) 3745 (t nil)))
3744 ;; TODO: What happens, if several monitor names are reported? 3746 ;; TODO: What happens, if several monitor names are reported?
3745 ((string-match "\ 3747 ((string-match "\
3746Supported arguments for GIO_USE_FILE_MONITOR environment variable: 3748Supported arguments for GIO_USE_FILE_MONITOR environment variable:
3747\\s-*\\([[:alpha:]]+\\) - 20" string) 3749\\s-*\\([[:alpha:]]+\\) - 20" string)
3750 (setq pos (match-end 0))
3748 (intern 3751 (intern
3749 (format "G%sFileMonitor" (capitalize (match-string 1 string))))) 3752 (format "G%sFileMonitor" (capitalize (match-string 1 string)))))
3750 (t (throw 'doesnt-work nil)))) 3753 (t (setq pos (length string)) nil)))
3751 (setq string (substring string (match-end 0)))) 3754 (setq string (substring string pos)))
3752 3755
3753 ;; Delete empty lines. 3756 ;; Delete empty lines.
3754 (setq string (tramp-compat-string-replace "\n\n" "\n" string) 3757 (setq string (tramp-compat-string-replace "\n\n" "\n" string))
3755 string (replace-regexp-in-string "^\n" "" string))
3756 3758
3757 (while (string-match 3759 (while (string-match
3758 (eval-when-compile 3760 (eval-when-compile
@@ -3783,6 +3785,8 @@ Supported arguments for GIO_USE_FILE_MONITOR environment variable:
3783 `(file-notify ,object file-notify-callback)))))) 3785 `(file-notify ,object file-notify-callback))))))
3784 3786
3785 ;; Save rest of the string. 3787 ;; Save rest of the string.
3788 (while (string-match "^\n" string)
3789 (setq string (replace-match "" nil nil string)))
3786 (when (zerop (length string)) (setq string nil)) 3790 (when (zerop (length string)) (setq string nil))
3787 (when string (tramp-message proc 10 "Rest string:\n%s" string)) 3791 (when string (tramp-message proc 10 "Rest string:\n%s" string))
3788 (process-put proc 'rest-string string))) 3792 (process-put proc 'rest-string string)))