[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape 57919480ad 1/3: cape-file: Improve org file link h
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape 57919480ad 1/3: cape-file: Improve org file link handling |
Date: |
Mon, 6 Jun 2022 07:57:20 -0400 (EDT) |
branch: externals/cape
commit 57919480ad3301eeb96fe61c652a29163e90c3ad
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
cape-file: Improve org file link handling
---
cape.el | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/cape.el b/cape.el
index 3caec45bd7..d017b643ff 100644
--- a/cape.el
+++ b/cape.el
@@ -247,13 +247,18 @@ If INTERACTIVE is nil the function acts like a Capf."
(_ (funcall cape-file-directory))))
(bounds (cape--bounds 'filename))
(non-essential t)
- (file (buffer-substring (car bounds) (cdr bounds))))
- (when (or (not cape-file-directory-must-exist)
- (and (string-match-p "/" file) (file-exists-p
(file-name-directory file))))
+ (file (buffer-substring (car bounds) (cdr bounds)))
+ (org (and (derived-mode-p 'org-mode)
+ (string-prefix-p "file:" file))))
+ (when org (setf (car bounds) (+ 5 (car bounds))))
+ (when (or org
+ (not cape-file-directory-must-exist)
+ (and (string-match-p "/" file)
+ (file-exists-p (file-name-directory file))))
`(,(car bounds) ,(cdr bounds)
,(cape--nonessential-table #'read-file-name-internal)
- ,@(and (not (equal file "/")) (string-suffix-p "/" file)
- '(:company-prefix-length t))
+ ,@(when (or org (and (not (equal file "/")) (string-suffix-p "/"
file)))
+ '(:company-prefix-length t))
,@cape--file-properties)))))
;;;;; cape-symbol