Replies: 1 comment 5 replies
-
I tried to extend (keys (mapcar #'(lambda (k) (if (string-match-p "/" k)
(downcase (car (last (split-string k "/"))))
k))
keys))) However, does not work, although the resulting regexp should match. I assume, this is rooted in the way Since I am looking for easy and future-proof solution, I thought I might just add the (defun citar-file--get-note-filename (key dirs extensions)
"Return existing or new filename for KEY in DIRS with extension in EXTENSIONS.
This is for use in a note function where notes are one-per-file,
with citekey as filename.
Returns the filename whether or not the file exists, to support a
function that will open a new file if the note is not present."
(let ((files (citar-file--directory-files dirs (list key) extensions
citar-file-additional-files-separator))
(key (if (string-match-p "/" key)
(car (last (split-string key "/")))
key)))
(or (car (gethash key files))
(when-let ((dir (car dirs))
(ext (car extensions)))
(expand-file-name (concat key "." ext) dir))))) Problematic is here that the function |
Beta Was this translation helpful? Give feedback.
-
Dear @bdarcus,
dear citar-users,
I have a question regarding the handling of special chars like slashes in bibliography-keys which are commonly used by the big bibliography databases, e.g. DBLP.
I would like to leave the keys which were given by those services, i.e. untouched and implement a custom mangling for files and notes to transform a key like
DBLP:journals/ijim/AlmogbelA22
toalmogbel2022.{pdf,org}
.I thought of overriding
citar-file--make-filename-regexp (keys extensions &optional additional-sep)
.Has somebody done something similar before and is willing to share some code or do you not see any need for keeping those precise bib-keys? If you have any tips regarding this issue, I would be glad to hear them.
Best regards,
jgru
Beta Was this translation helpful? Give feedback.
All reactions