Function: with-tramp-file-property

with-tramp-file-property is a macro defined in tramp.el.gz.

Signature

(with-tramp-file-property VEC 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 VEC.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
(defmacro with-tramp-file-property (vec 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 VEC."
  (declare (indent 3) (debug t))
  `(if (file-name-absolute-p ,file)
       (let ((value (tramp-get-file-property
		     ,vec ,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 ,vec ,file ,property value))
	 value)
     ,@body))