1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

* lisp/net/tramp-integration.el (shortdoc): Use `tramp--with-startup'.

This commit is contained in:
Michael Albinus 2024-08-06 20:25:20 +02:00
parent fb642d9cf5
commit f0a7eec5a7

View file

@ -274,37 +274,38 @@ NAME must be equal to `tramp-current-connection'."
;;; Integration of shortdoc.el: ;;; Integration of shortdoc.el:
(with-eval-after-load 'shortdoc (tramp--with-startup
;; Some packages deactivate Tramp. They don't deserve a shortdoc entry then. (with-eval-after-load 'shortdoc
(when (file-remote-p "/ssh:user@host:/tmp/foo") ;; Some packages deactivate Tramp. They don't deserve a shortdoc entry then.
(dolist (elem `((file-remote-p (when (file-remote-p "/ssh:user@host:/tmp/foo")
:eval (file-remote-p "/ssh:user@host:/tmp/foo") (dolist (elem `((file-remote-p
:eval (file-remote-p "/ssh:user@host:/tmp/foo" 'method) :eval (file-remote-p "/ssh:user@host:/tmp/foo")
:eval (file-remote-p "/ssh:user@[::1]#1234:/tmp/foo" 'host) :eval (file-remote-p "/ssh:user@host:/tmp/foo" 'method)
;; We don't want to see the text properties. :eval (file-remote-p "/ssh:user@[::1]#1234:/tmp/foo" 'host)
:no-eval (file-remote-p "/sudo::/tmp/foo" 'user) ;; We don't want to see the text properties.
:result ,(substring-no-properties :no-eval (file-remote-p "/sudo::/tmp/foo" 'user)
(file-remote-p "/sudo::/tmp/foo" 'user))) :result ,(substring-no-properties
(file-local-name (file-remote-p "/sudo::/tmp/foo" 'user)))
:eval (file-local-name "/ssh:user@host:/tmp/foo")) (file-local-name
(file-local-copy :eval (file-local-name "/ssh:user@host:/tmp/foo"))
:no-eval (file-local-copy "/ssh:user@host:/tmp/foo") (file-local-copy
:eg-result "/tmp/tramp.8ihLbO" :no-eval (file-local-copy "/ssh:user@host:/tmp/foo")
:eval (file-local-copy "/tmp/foo")))) :eg-result "/tmp/tramp.8ihLbO"
(unless (assoc (car elem) :eval (file-local-copy "/tmp/foo"))))
(member "Remote Files" (assq 'file shortdoc--groups))) (unless (assoc (car elem)
(shortdoc-add-function 'file "Remote Files" elem))) (member "Remote Files" (assq 'file shortdoc--groups)))
(shortdoc-add-function 'file "Remote Files" elem)))
(add-hook (add-hook
'tramp-integration-unload-hook 'tramp-integration-unload-hook
(lambda () (lambda ()
(let ((glist (assq 'file shortdoc--groups))) (let ((glist (assq 'file shortdoc--groups)))
(while (and (consp glist) (while (and (consp glist)
(not (and (stringp (cadr glist)) (not (and (stringp (cadr glist))
(string-equal (cadr glist) "Remote Files")))) (string-equal (cadr glist) "Remote Files"))))
(setq glist (cdr glist))) (setq glist (cdr glist)))
(when (consp glist) (when (consp glist)
(setcdr glist nil))))))) (setcdr glist nil))))))))
;;; Integration of compile.el: ;;; Integration of compile.el: