Skip to content

Commit

Permalink
Use list of functions in `bibtex-actions-file-parser-function(s)'
Browse files Browse the repository at this point in the history
  • Loading branch information
thisirs committed Sep 14, 2021
1 parent c4f0588 commit f04a4f7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions bibtex-actions-file.el
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ use 'orb-edit-note' for this value."
:group 'bibtex-actions
:type '(function))

(defcustom bibtex-actions-file-parser-function
'bibtex-actions-file-parser-default
"Function to parse file field."
(defcustom bibtex-actions-file-parser-functions
'(bibtex-actions-file-parser-default)
"List of functions to parse file field."
:group 'bibtex-actions
:type '(function))
:type '(repeat function))

(defcustom bibtex-actions-file-extensions '("pdf" "org" "md")
"A list of file extensions to recognize for related files."
Expand Down Expand Up @@ -107,7 +107,11 @@ use 'orb-edit-note' for this value."
(file-field (bibtex-actions-get-value
bibtex-actions-file-variable entry))
(results-file
(when file-field (funcall bibtex-actions-file-parser-function dirs file-field))))
(when file-field
(seq-mapcat
(lambda (func)
(funcall func dirs file-field))
bibtex-actions-file-parser-functions))))
(append results-key results-file))))

(defun bibtex-actions-file--files-for-entry (entry dirs extensions)
Expand Down

0 comments on commit f04a4f7

Please sign in to comment.