[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote d09249d48f 253/355: Make 'default-directory' saf
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote d09249d48f 253/355: Make 'default-directory' safe for denote-directory |
Date: |
Sun, 26 Jun 2022 23:58:30 -0400 (EDT) |
branch: externals/denote
commit d09249d48fda688dfc65d3a44fedbe1213b2950b
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Make 'default-directory' safe for denote-directory
This relates to the example we cover in the manual, which was updated in
commit 47a9024.
Thanks to Sven Seebeck for reporting the bug in issue 16 over at the
GitHub mirror: <https://github.com/protesilaos/denote/issues/16>.
---
denote.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/denote.el b/denote.el
index 811d7f1ca3..f1e7b414f7 100644
--- a/denote.el
+++ b/denote.el
@@ -96,6 +96,8 @@ If you intend to reference this variable in Lisp, consider
using
the function `denote-directory' instead: it returns the path as a
directory."
:group 'denote
+ :safe (lambda (val)
+ (and (symbolp val) (eq val 'default-directory)))
:type 'directory)
(defcustom denote-known-keywords
@@ -230,7 +232,10 @@ We consider those characters illigal for our purposes.")
(defun denote-directory ()
"Return path of variable `denote-directory' as a proper directory."
- (let ((path denote-directory))
+ (let ((path (or (buffer-local-value 'denote-directory (current-buffer))
+ denote-directory)))
+ (when (and (symbolp path) (eq path 'default-directory))
+ (setq path (buffer-local-value 'default-directory (current-buffer))))
(unless (file-directory-p path)
(make-directory path t))
(file-name-as-directory path)))
- [elpa] externals/denote d6285c8c5a 182/355: Omit current file from backlinks, (continued)
- [elpa] externals/denote d6285c8c5a 182/355: Omit current file from backlinks, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 02507c6f0d 171/355: Rename private variable, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 340f9103fd 175/355: Fix typo in manual, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 5c400d80d9 191/355: Document regexp example for file extension, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 8a33364dc6 188/355: Add helper fn to filter files matching regexp, ELPA Syncer, 2022/06/27
- [elpa] externals/denote f2cfcd26ea 205/355: Refine denote-retrieve regular expressions, ELPA Syncer, 2022/06/27
- [elpa] externals/denote d46c8fec55 239/355: Add "Contributing" section to the manual, ELPA Syncer, 2022/06/27
- [elpa] externals/denote bcbd52a784 200/355: Use format specifiers for denote-link-add-links, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 443c687f05 248/355: Update denote-dired--edit-front-matter-p docstring, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 9b9a764e57 230/355: Fix typo about package name, ELPA Syncer, 2022/06/27
- [elpa] externals/denote d09249d48f 253/355: Make 'default-directory' safe for denote-directory,
ELPA Syncer <=
- [elpa] externals/denote 737c647957 246/355: Rename buffer post file rename, ELPA Syncer, 2022/06/27
- [elpa] externals/denote d0584c0e15 271/355: Refine denote--only-note-p conditions, ELPA Syncer, 2022/06/27
- [elpa] externals/denote dcf8739474 261/355: Improve valid note test (revise ecaaa6b, 8e5899d), ELPA Syncer, 2022/06/27
- [elpa] externals/denote 83d53afae4 245/355: Improve dired revert-buffer post rename, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 8e5899d90e 260/355: Match only files that start with ID in file search, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 341cd28b5a 266/355: Fix bug with 'default-directory' reset, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 0f149afba2 264/355: Simplify how temp buffer contents are returned, ELPA Syncer, 2022/06/27
- [elpa] externals/denote d8ef0a0c7c 282/355: EXPERIMENTAL Add buttonization for all links, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 843fb30dff 301/355: Answer FAQ about sorting files, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 47a9024b00 252/355: BREAKING update the .dir-locals.el sample, ELPA Syncer, 2022/06/27