[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote b8d4c362c3 03/15: Add helper to test that dir is
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote b8d4c362c3 03/15: Add helper to test that dir is part of denote |
Date: |
Wed, 10 Aug 2022 02:57:34 -0400 (EDT) |
branch: externals/denote
commit b8d4c362c3e1825ea8387fcb78f4c058993e2fe2
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add helper to test that dir is part of denote
This is done to avoid duplication in the code.
---
denote.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/denote.el b/denote.el
index dcdd1b8239..42a09701e6 100644
--- a/denote.el
+++ b/denote.el
@@ -446,11 +446,16 @@ FILE must be an absolute path."
((string-prefix-p dir file-name)))
(substring-no-properties file-name (length dir))))
+(defun denote--default-dir-has-denote-prefix ()
+ "Test `default-directory' for variable `denote-directory' prefix."
+ (string-prefix-p (denote-directory)
+ (expand-file-name default-directory)))
+
(defun denote--current-file-is-note-p ()
"Return non-nil if current file likely is a Denote note."
(and (or (string-match-p denote--id-regexp (buffer-file-name))
(string-match-p denote--id-regexp (buffer-name)))
- (string-prefix-p (denote-directory) (expand-file-name
default-directory))))
+ (denote--default-dir-has-denote-prefix)))
(defun denote--directory-files ()
"List expanded note files."
@@ -1108,8 +1113,7 @@ The return value is for `denote--format-front-matter'."
(lambda (buf)
(with-current-buffer buf
(when (and (eq major-mode 'dired-mode)
- (string-prefix-p (denote-directory)
- (expand-file-name default-directory)))
+ (denote--default-dir-has-denote-prefix))
(revert-buffer))))
(buffer-list)))
- [elpa] externals/denote updated (b401e249e9 -> 10646db649), ELPA Syncer, 2022/08/10
- [elpa] externals/denote b8d4c362c3 03/15: Add helper to test that dir is part of denote,
ELPA Syncer <=
- [elpa] externals/denote 3adf83fea2 08/15: Clarify denote-dired-mode docstring, ELPA Syncer, 2022/08/10
- [elpa] externals/denote 10646db649 15/15: Remove needless 'declare-function', ELPA Syncer, 2022/08/10
- [elpa] externals/denote 0d896b5495 13/15: Add TODO about "backlink" and "backlinks" inconsistency, ELPA Syncer, 2022/08/10
- [elpa] externals/denote 80fd25336c 06/15: Tweak format of faces for consistency, ELPA Syncer, 2022/08/10
- [elpa] externals/denote 4e2f0c8d9e 01/15: Reword statement in docstring, ELPA Syncer, 2022/08/10
- [elpa] externals/denote f10e80fb5e 11/15: Add comment to clarify format of specifiers, ELPA Syncer, 2022/08/10
- [elpa] externals/denote d75a0c2ac2 10/15: Add :info link to denote-link-fontify-backlinks, ELPA Syncer, 2022/08/10
- [elpa] externals/denote 48d8caee12 12/15: Tweak format of function for stylistic consistency, ELPA Syncer, 2022/08/10
- [elpa] externals/denote 4477a24b74 02/15: Add comment about rationale of completion table, ELPA Syncer, 2022/08/10
- [elpa] externals/denote 0f4dbbdf0b 04/15: Rename private function for clarity, ELPA Syncer, 2022/08/10