Skip to content

Commit

Permalink
allow annotating directories
Browse files Browse the repository at this point in the history
  • Loading branch information
gunther-bachmann committed Nov 21, 2023
1 parent cb9918d commit 7ab83bf
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
38 changes: 21 additions & 17 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
version 0.0.4
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dired-annotator.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit 7ab83bf

Please sign in to comment.