emacs-unoffice

Emacs library to reclaim text from office documents (abw, odt, docx).
Log | Files | Refs

commit 87ed4f79cbf3bcb84878245558db836b5ce1a97f
parent 4d72b020258816bdf5052a4d127d935597fc41d1
Author: Tomas Hlavaty <tom@logand.com>
Date:   Sun, 31 Jan 2021 22:21:11 +0100

make some functions private

Diffstat:
Memacs-unoffice.el | 20+++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/emacs-unoffice.el b/emacs-unoffice.el @@ -35,26 +35,26 @@ :type 'string :group 'unoffice) -(defun unoffice-local-cache-directory () +(defun unoffice--local-cache-directory () (let ((z (or unoffice-cache-directory temporary-file-directory))) (if (file-remote-p z) (error "unoffice-cache-directory is remote %s" z) z))) -(defun unoffice-local-cache-file (name extension) - (concat (unoffice-local-cache-directory) "/" name "." extension)) +(defun unoffice--local-cache-file (name extension) + (concat (unoffice--local-cache-directory) "/" name "." extension)) -(defun unoffice-file-hash (file) +(defun unoffice--file-hash (file) (with-temp-buffer (if (file-remote-p file) (process-file "sha256sum" file t) (call-process "sha256sum" file t)) (buffer-substring (point-min) (+ (point-min) 64)))) -(defun unoffice-cache-remote (file) +(defun unoffice--cache-remote (file) (if (file-remote-p file) - (let ((z (unoffice-local-cache-file (unoffice-file-hash file) - (file-name-extension file)))) + (let ((z (unoffice--local-cache-file (unoffice--file-hash file) + (file-name-extension file)))) (unless (file-readable-p z) (copy-file file z)) z) @@ -88,8 +88,7 @@ (text:p (mapc #'rec (cddr x)) (insert "\n")) (t (mapc #'rec (cddr x)))))))) (rec - (let ((f buffer-file-name)) - (setq f (unoffice-cache-remote f)) + (let ((f (unoffice--cache-remote buffer-file-name))) (with-temp-buffer (when (zerop (archive-zip-extract f "content.xml")) (car (xml-parse-region)))))))) @@ -183,8 +182,7 @@ (ins "\t"))) (t (mapc #'rec (cddr x))))))) (rec - (let ((f buffer-file-name)) - (setq f (unoffice-cache-remote f)) + (let ((f (unoffice--cache-remote buffer-file-name))) (with-temp-buffer (when (or (zerop (archive-zip-extract f "word/document.xml")) (zerop (archive-zip-extract f "document.xml")))