[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote ddbbe549b6 283/355: Use function to test if file
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote ddbbe549b6 283/355: Use function to test if file likely is a note |
Date: |
Sun, 26 Jun 2022 23:58:33 -0400 (EDT) |
branch: externals/denote
commit ddbbe549b6826eb59c4eb5a98002e1ab4c7f2625
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Use function to test if file likely is a note
---
denote-link.el | 5 +----
denote.el | 6 ++++++
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/denote-link.el b/denote-link.el
index 85cbc5f64f..68c55be8d6 100644
--- a/denote-link.el
+++ b/denote-link.el
@@ -254,10 +254,7 @@ Add this to `find-file-hook' (it will not do anything in
DEVELOPMENT NOTE: This is experimental and subject to review
before the release of version 0.1.0. Please test it and/or share
your thoughts about it."
- (when (and (not (derived-mode-p 'org-mode))
- ;; A crude check to test if this is a note
- (or (string-match-p denote--id-regexp (buffer-file-name))
- (string= (expand-file-name default-directory)
(denote-directory))))
+ (when (and (not (derived-mode-p 'org-mode)) (denote--current-file-is-note-p))
(save-excursion
(goto-char (point-min))
(while (re-search-forward denote--id-regexp nil t)
diff --git a/denote.el b/denote.el
index 80231854ca..3cd2b2ac1d 100644
--- a/denote.el
+++ b/denote.el
@@ -296,6 +296,12 @@ FILE is relative to the variable `denote-directory'."
(string-match-p (concat "\\b" denote--id-regexp) file)
(not (string-match-p "[#~]\\'" file))))
+(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= (expand-file-name default-directory) (denote-directory))))
+
;;;; Keywords
(defun denote--directory-files (&optional absolute)
- [elpa] externals/denote 6a254238f9 296/355: Mark buttonization task as done, (continued)
- [elpa] externals/denote 6a254238f9 296/355: Mark buttonization task as done, ELPA Syncer, 2022/06/26
- [elpa] externals/denote aab484d617 258/355: Sort grep output with string-lessp, ELPA Syncer, 2022/06/26
- [elpa] externals/denote 5be48c4186 286/355: Expand the FAQ section, ELPA Syncer, 2022/06/26
- [elpa] externals/denote 1b9a6a12a0 290/355: Add autoload cookie for buttonization function, ELPA Syncer, 2022/06/26
- [elpa] externals/denote bb296d35a1 254/355: Tweak some statements in the manual, ELPA Syncer, 2022/06/26
- [elpa] externals/denote 85b5290e8b 229/355: Fix bug where Unicode chars are not encoded, ELPA Syncer, 2022/06/26
- [elpa] externals/denote 1f87a456c5 353/355: denote--punctuation-regexp: Forbid usage of slash in filenames, ELPA Syncer, 2022/06/26
- [elpa] externals/denote fe8042e302 337/355: Account for target file when formatting link, ELPA Syncer, 2022/06/26
- [elpa] externals/denote d304e3556f 281/355: Add regexp for plain link format, ELPA Syncer, 2022/06/26
- [elpa] externals/denote 987854d96c 298/355: Add missing findex directive for denote-dired-mode, ELPA Syncer, 2022/06/26
- [elpa] externals/denote ddbbe549b6 283/355: Use function to test if file likely is a note,
ELPA Syncer <=
- [elpa] externals/denote 62e7adfbdb 269/355: Replace superfluous 'let*' with 'let', ELPA Syncer, 2022/06/26
- [elpa] externals/denote 618eff9807 312/355: Make a couple of minor tweaks to the manual, ELPA Syncer, 2022/06/26
- [elpa] externals/denote a5986742be 315/355: Note the features of filenames for search/filter, ELPA Syncer, 2022/06/26
- [elpa] externals/denote 9888c7087f 348/355: Add check mark to task of using id: links, ELPA Syncer, 2022/06/26
- [elpa] externals/denote d56913b055 349/355: Clarify wording of FAQ entries, ELPA Syncer, 2022/06/26
- [elpa] externals/denote 31e5eb3af8 346/355: Update documentation about links, ELPA Syncer, 2022/06/26
- [elpa] externals/denote 019cccfb1f 015/355: Create denote-directory if absent, ELPA Syncer, 2022/06/26
- [elpa] externals/denote 813004ea53 032/355: Make outline more consistent and informative, ELPA Syncer, 2022/06/26
- [elpa] externals/denote 387ac0c030 033/355: Add denote--file-empty-p, ELPA Syncer, 2022/06/26
- [elpa] externals/denote 9d8748c382 022/355: Add proof-of-concept backlink (lots of TODO), ELPA Syncer, 2022/06/26