[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 5dc7028d7f 6/6: org-id: Guard against unwarranted m
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 5dc7028d7f 6/6: org-id: Guard against unwarranted major-mode change when querying id |
Date: |
Sun, 22 Sep 2024 06:58:41 -0400 (EDT) |
branch: externals/org
commit 5dc7028d7fbda589962af6fdad8ed0ad6b48b231
Author: Visuwesh <visuweshm@gmail.com>
Commit: Ihor Radchenko <yantar92@posteo.net>
org-id: Guard against unwarranted major-mode change when querying id
* lisp/org-id.el (org-id-find-id-file): Only fallback to the
current-buffer filename when it is an org-mode buffer. This avoids
accidental change of the major-mode when querying a non-existent id
from a non-org-mode buffer.
Reported-by: Visuwesh <visuweshm@gmail.com>
Link: https://list.orgmode.org/87ikuuwmz4.fsf@gmail.com/
---
lisp/org-id.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lisp/org-id.el b/lisp/org-id.el
index e247fab1d8..17568ab314 100644
--- a/lisp/org-id.el
+++ b/lisp/org-id.el
@@ -705,8 +705,9 @@ This is to be able to write it to a file."
(hash-table-p org-id-locations)
(gethash id org-id-locations))
;; Fall back on current buffer
- (buffer-file-name (or (buffer-base-buffer (current-buffer))
- (current-buffer)))))
+ (when (derived-mode-p 'org-mode)
+ (buffer-file-name (or (buffer-base-buffer (current-buffer))
+ (current-buffer))))))
(defun org-id-find-id-in-file (id file &optional markerp)
"Return the position of the entry ID in FILE.
- [elpa] externals/org updated (9cbf0c99c3 -> 5dc7028d7f), ELPA Syncer, 2024/09/22
- [elpa] externals/org 8b8b61d277 1/6: Merge branch 'bugfix', ELPA Syncer, 2024/09/22
- [elpa] externals/org a8790ed09e 2/6: lisp/org-persist.el: Fix regression missed by 7fd8099, ELPA Syncer, 2024/09/22
- [elpa] externals/org 0b1a4bfc48 3/6: Merge branch 'bugfix', ELPA Syncer, 2024/09/22
- [elpa] externals/org 10adc2bbd7 5/6: Merge branch 'bugfix', ELPA Syncer, 2024/09/22
- [elpa] externals/org 5dc7028d7f 6/6: org-id: Guard against unwarranted major-mode change when querying id,
ELPA Syncer <=
- [elpa] externals/org c07028671d 4/6: ox-icalendar: Fix export of diary-style timestamps, ELPA Syncer, 2024/09/22