Function: with-tramp-saved-file-property

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

Signature

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

Documentation

Save PROPERTY, run BODY, reset PROPERTY.

Preserve timestamps.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-cache.el.gz
;;;###tramp-autoload
(defmacro with-tramp-saved-file-property (key file property &rest body)
  "Save PROPERTY, run BODY, reset PROPERTY.
Preserve timestamps."
  (declare (indent 3) (debug t))
  `(progn
     ;; Unify localname.  Remove hop from `tramp-file-name' structure.
     (setf ,key (tramp-file-name-unify ,key ,file))
     (let* ((hash (tramp-get-hash-table ,key))
	    (cached (and (hash-table-p hash) (gethash ,property hash))))
       (unwind-protect (progn ,@body)
	 ;; Reset PROPERTY.  Recompute hash, it could have been flushed.
         (setq hash (tramp-get-hash-table ,key))
	 (if (consp cached)
	     (puthash ,property cached hash)
	   (remhash ,property hash))))))