Open deen1 opened 4 months ago
... needs to change to prompt the user to either overwrite the existing file (
y
), or add the new file with an appended filename (a
), or cancel (c
/q
/n
).If the user chooses to add with an appended filename, then
citar
should check if the-1
,-2
...-n
. versions of the filename are in use, before adding the file with filename{cite_key}_{cite_year}-{n+1}.ext
.
This makes sense to me, so suggest whoever gets to this start here.
The only amendment I would make is this should only work like this if the file separator variable is set.
While setting the
citar-file-additional-files-separator
variable to non-nil allows a library item to have multiple associated files under the same cite-key -- e.g.{cite-key}_{cite-year}.pdf
,{cite-key}_{cite-year}-1.pdf
,{cite-key}_{cite-year}-2.pdf
-- it is currently only possible to add an additional file to an item only by renaming the file and moving it to the directory manually. Otherwise, runningM-x citar-add-file-to-library
will produce theFile ... exists, overwrite? (y or n)
prompt in the minibuffer, and answering will either overwrite the existing file (y
) or cancel the operation (n
).Via @bdarcus in https://github.com/emacs-citar/citar/discussions/820#discussioncomment-8635275_, the following code needs to change:
https://github.com/emacs-citar/citar/blob/885b86f6733fd70f42c32dd7791d3447f93db990/citar.el#L1337-L1360
I would say that
needs to change to prompt the user to either overwrite the existing file (
y
), or add the new file with an appended filename (a
), or cancel (c
/q
/n
).If the user chooses to add with an appended filename, then
citar
should check if the-1
,-2
...-n
. versions of the filename are in use, before adding the file with filename{cite_key}_{cite_year}-{n+1}.ext
.