[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-contacts c386c16802 1/2: (org-contacts) Don't try t
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-contacts c386c16802 1/2: (org-contacts) Don't try to store link above first heading |
Date: |
Thu, 20 Jul 2023 21:58:54 -0400 (EDT) |
branch: externals/org-contacts
commit c386c16802839c01edbc843e700fe0d8214e0b15
Author: Joseph Turner <joseph@breatheoutbreathe.in>
Commit: stardiviner <numbchild@gmail.com>
(org-contacts) Don't try to store link above first heading
Hi,
Here's a small patch for org-contacts.el.
Be well,
Joseph
From 80365905c9fd342e25ac529dcf0849e4cf90af8c Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sun, 16 Jul 2023 16:13:14 -0700
Subject: [PATCH] Fix: Don't try to store link above first heading
Previously, org-contacts-link-store attempted to store a link when
point was above the first heading, but signalled an error after
(org-get-heading t t t t)
returned nil. Now, org-contacts-link-store does not attempt to handle
storing links above the first heading.
---
org-contacts.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/org-contacts.el b/org-contacts.el
index 65bcdc55ef..c2dd195577 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -1273,7 +1273,8 @@ are effectively trimmed). If nil, all zero-length
substrings are retained."
"Store the contact in `org-contacts-files' with a link."
(when (and (eq major-mode 'org-mode)
(member (buffer-file-name)
- (mapcar #'expand-file-name (org-contacts-files))))
+ (mapcar #'expand-file-name (org-contacts-files)))
+ (not (org-before-first-heading-p)))
(if (bound-and-true-p org-id-link-to-org-use-id)
(org-id-store-link)
(let ((headline-str (substring-no-properties (org-get-heading t t t t))))