Refine check for denote dir in dired revert

This pertains to the post-rename operation where relevant Dired buffers
are reverted.  The previous check would sometimes compare incompatible
file paths and thus return nil when it shouldn't.

Thanks to Sven Seebeck for reporting the problem in issue 17 over at the
GitHub mirror: <https://github.com/protesilaos/denote/issues/17>.
This commit is contained in:
Protesilaos Stavrou 2022-06-21 13:22:38 +03:00
parent a5986742be
commit ee4aed6376
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -261,7 +261,8 @@ ignores all its arguments."
(lambda (buf)
(with-current-buffer buf
(when (and (eq major-mode 'dired-mode)
(string-match-p (expand-file-name default-directory) (denote-directory)))
(string-match-p (expand-file-name default-directory)
(expand-file-name (denote-directory))))
(revert-buffer))))
(buffer-list)))