Function: with-tramp-file-property

with-tramp-file-property is an autoloaded macro defined in tramp-cache.el.gz.

Signature

(with-tramp-file-property KEY FILE PROPERTY &rest BODY)

Documentation

Check in Tramp cache for PROPERTY, otherwise execute BODY and set cache.

FILE must be a local file name on a connection identified via KEY.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-cache.el.gz
;;;###tramp-autoload
(defmacro with-tramp-file-property (key file property &rest body)
  "Check in Tramp cache for PROPERTY, otherwise execute BODY and set cache.
FILE must be a local file name on a connection identified via KEY."
  (declare (indent 3) (debug t))
  `(let ((value (tramp-get-file-property
		 ,key ,file ,property tramp-cache-undefined)))
     (when (eq value tramp-cache-undefined)
       ;; We cannot pass @body as parameter to
       ;; `tramp-set-file-property' because it mangles our debug
       ;; messages.
       (setq value (progn ,@body))
       (tramp-set-file-property ,key ,file ,property value))
     value))