diff --git a/ChangeLog b/ChangeLog index 90b3800..8736b0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,24 +1,28 @@ - * project setup add github action - * dired-annotator.el: add basic testing - complete logging - add capability to do testing +2023-11-21 Gunther Bachmann + version 0.0.7 + * project setup add github action + add Makefile + * dired-annotator.el: add basic testing + complete logging + add capability to do testing + allow annotating directories 2022-11-03 Gunther Bachmann - version 0.0.6 - * dired-annotator.el: add basic logging - make initial note content configurable - ignore errors when using `dired-get-filename` - add function to collect/report configuration data - * README.org: add basic use cases - add description for retrieving additional data for issue reporting - add note to adjust load-path and default folder in complex configuration + version 0.0.6 + * dired-annotator.el: add basic logging + make initial note content configurable + ignore errors when using `dired-get-filename` + add function to collect/report configuration data + * README.org: add basic use cases + add description for retrieving additional data for issue reporting + add note to adjust load-path and default folder in complex configuration 2022-11-02 Gunther Bachmann - version 0.0.5 - * dired-annotator.el: use shell-quote-argument to pass filenames to shell commands - early init of some hash maps - fix some issues when natively compiling - * README.org: make sure to point out that the default folder for annotations should be set + version 0.0.5 + * dired-annotator.el: use shell-quote-argument to pass filenames to shell commands + early init of some hash maps + fix some issues when natively compiling + * README.org: make sure to point out that the default folder for annotations should be set 2022-02-04 Gunther Bachmann version 0.0.4 diff --git a/Makefile b/Makefile index be32002..be00296 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ compile: pkg_uuid pkg_dash_el test: compile @echo "test:" - emacs -q -l init.test.el --batch --eval "(ert-run-tests-batch)" | tee test.out.txt + emacs -q -l init.test.el --batch --eval "(ert-run-tests-batch)" 2>&1 | tee test.out.txt clean: rm build/ -rf diff --git a/dired-annotator.el b/dired-annotator.el index d9bb189..09da6cf 100644 --- a/dired-annotator.el +++ b/dired-annotator.el @@ -131,7 +131,7 @@ only valid if integration with dired narrow is activated" ;; -------------------------------------------------------------------------------- internal only (defvar dired-annotator-hashing-shell-command - "head -c 16384 %s | md5sum | sed -e 's/ *-//g'" + "if [ -d \"%s\" ]; then echo \"%s\"; else head -c 16384 \"%s\"; fi | md5sum | sed -e 's/ *-//g'" "shell command to md5 hash the first 16k of the file") (defvar dired-annotator-read-file-information-from-annotations @@ -247,7 +247,8 @@ this allows for trigger show/hide behaviour if the same command is repeated.") (defun dired-annotator--head16kmd5 (file-name) "get md5sum of the given FILE-NAME, taking the first SIZE bytes of the file" - (let* ((cmd (format dired-annotator-hashing-shell-command (shell-quote-argument file-name))) + (let* ((qfname (shell-quote-argument file-name)) + (cmd (format dired-annotator-hashing-shell-command qfname qfname qfname)) (result (string-trim (shell-command-to-string cmd)))) (log-message 3 "shell-command: %s" cmd) (log-message 3 "result: %s" result) @@ -483,7 +484,6 @@ ABSOLUTE-FILE-NAME is the absolute file name of the annotated file" (cl-incf file-count) (ignore-errors (when-let* ((file (dired-get-filename)) - (not-directory (not (file-directory-p file))) (file-regular-p file) (visible (not (get-text-property (line-beginning-position) 'invisible))) (annotation (dired-annotator--get-annotation-for file)))