emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Leo Butler <Leo.Butler@umanitoba.ca>
Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: org-cite: how to force a reparsing of the .bib file
Date: Wed, 23 Aug 2023 09:13:41 +0000	[thread overview]
Message-ID: <87y1i26rzu.fsf@localhost> (raw)
In-Reply-To: <877cpmkds1.fsf@t14.reltub.ca>

[-- Attachment #1: Type: text/plain, Size: 192 bytes --]

Leo Butler <Leo.Butler@umanitoba.ca> writes:

> Does org-cite monitor contents or the timestamp?
> I am using a symlink to the bib file.

Timestamp.

Does the attached patch fix the problem?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-oc-basic-Fix-detecting-changes-in-symlinked-bibliogr.patch --]
[-- Type: text/x-patch, Size: 1266 bytes --]

From 39b503301fc7a3ea68733dfd9e4391e3f84efec8 Mon Sep 17 00:00:00 2001
Message-ID: <39b503301fc7a3ea68733dfd9e4391e3f84efec8.1692781998.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Wed, 23 Aug 2023 12:12:13 +0300
Subject: [PATCH] oc-basic: Fix detecting changes in symlinked bibliography

* lisp/oc-basic.el (org-cite-basic--parse-bibliography): Use
`file-truename' to follow symlinks first before checking bibliography
file change times.

Reported-by: Leo Butler <Leo.Butler@umanitoba.ca>
Link: https://orgmode.org/list/877cpmkds1.fsf@t14.reltub.ca
---
 lisp/oc-basic.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el
index 84d9492ea..c4468e5a8 100644
--- a/lisp/oc-basic.el
+++ b/lisp/oc-basic.el
@@ -272,6 +272,9 @@ (defun org-cite-basic--parse-bibliography (&optional info)
       (plist-get info :cite-basic/bibliography)
     (let ((results nil))
       (dolist (file (org-cite-list-bibliography-files))
+        ;; Follow symlinks, to look into modification time of the
+        ;; actual file, not its symlink.
+        (setq file (file-truename file))
         (when (file-readable-p file)
           (with-temp-buffer
             (when (or (org-file-has-changed-p file)
-- 
2.41.0


[-- Attachment #3: Type: text/plain, Size: 225 bytes --]



-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

  reply	other threads:[~2023-08-23  9:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 18:35 org-cite: how to force a reparsing of the .bib file Leo Butler
2023-08-22 18:48 ` Ihor Radchenko
2023-08-22 20:44   ` Leo Butler
2023-08-23  9:13     ` Ihor Radchenko [this message]
2023-08-23 16:47       ` Leo Butler
2023-08-24  7:22         ` Ihor Radchenko
2023-08-24 17:57           ` Leo Butler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1i26rzu.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=Leo.Butler@umanitoba.ca \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).