* lisp/net/tramp.el (tramp-file-notify-process-sentinel): New defun.
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch):
Set process sentinel.
(process-put p 'adjust-window-size-function #'ignore)
(set-process-query-on-exit-flag p nil)
(set-process-filter p #'tramp-gvfs-monitor-process-filter)
+ (set-process-sentinel p #'tramp-file-notify-process-sentinel)
;; There might be an error if the monitor is not supported.
;; Give the filter a chance to read the output.
(while (tramp-accept-process-output p 0))
(process-put p 'watch-name localname)
(set-process-query-on-exit-flag p nil)
(set-process-filter p filter)
+ (set-process-sentinel p #'tramp-file-notify-process-sentinel)
;; There might be an error if the monitor is not supported.
;; Give the filter a chance to read the output.
(while (tramp-accept-process-output p 0))
;; * Implement detaching/re-attaching remote sessions. By this, a
;; session could be reused after a connection loss. Use dtach, or
;; screen, or tmux, or mosh.
+;;
+;; * Implement `:stderr' of `make-process' as pipe process.
;;; tramp-sh.el ends here
;; Package: tramp
;; Version: 2.4.2-pre
;; Package-Requires: ((emacs "24.1"))
+;; URL: https://savannah.gnu.org/projects/tramp
;; This file is part of GNU Emacs.
(concat (file-remote-p default-directory)
(process-get proc 'watch-name))))))
+(defun tramp-file-notify-process-sentinel (proc event)
+ "Call `file-notify-rm-watch'."
+ (unless (process-live-p proc)
+ (tramp-message proc 5 "Sentinel called: `%S' `%s'" proc event)
+ (file-notify-rm-watch proc)))
+
;;; Functions for establishing connection:
;; The following functions are actions to be taken when seeing certain