Emacs library to show images and documents in console using Linux framebuffer
Log | Files | Refs

commit 767e9cdd46d72de8290d5f52c70a7e2dffeeca67
parent e1e32823b59227a9e5a59ed2a8b5fd60fc7de30a
Author: Tomas Hlavaty <tom@logand.com>
Date:   Sat, 16 Jan 2021 15:13:33 +0100

fix remote hash calculation

using filename hash is fast but wrong as changes to file contents are
not picked up and require manual cache clean up

using file content is slow but right

use the right functions for local and remote program execution to play
well with tramp

Memacs-framebuffer.el | 10++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/emacs-framebuffer.el b/emacs-framebuffer.el @@ -136,14 +136,8 @@ (defun framebuffer-file-hash (file) (with-temp-buffer (if (file-remote-p file) - (let ((f (make-temp-file "emacs-framebuffer."))) - (unwind-protect - (progn - (with-temp-file f - (insert (expand-file-name file))) - (call-process "sha256sum" nil t nil (expand-file-name f))) - (delete-file f))) - (call-process "sha256sum" nil t nil (expand-file-name file))) + (process-file "sha256sum" file t) + (call-process "sha256sum" file t)) (buffer-substring (point-min) (+ (point-min) 64)))) (defun framebuffer-cache-remote (file)