[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org c231e93b56 1/2: ol-docview: Throw an error when try
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org c231e93b56 1/2: ol-docview: Throw an error when trying to open non-existing file |
Date: |
Mon, 11 Jul 2022 01:57:49 -0400 (EDT) |
branch: externals/org
commit c231e93b56a462bb21e0abfbb99d532d53c4fa6e
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
ol-docview: Throw an error when trying to open non-existing file
* lisp/ol-docview.el (org-docview-open): Throw an error when file does
not exist. Creating an empty document buffer is not useful here.
Fixes https://orgmode.org/list/87zgklmd0g.fsf@localhost
---
lisp/ol-docview.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/ol-docview.el b/lisp/ol-docview.el
index a5f74ce90f..864f9e0429 100644
--- a/lisp/ol-docview.el
+++ b/lisp/ol-docview.el
@@ -75,7 +75,9 @@
(string-to-number (match-string 2 link)))))
;; Let Org mode open the file (in-emacs = 1) to ensure
;; org-link-frame-setup is respected.
- (org-open-file path 1)
+ (if (file-exists-p path)
+ (org-open-file path 1)
+ (error "No such file: %s" path))
(when page (doc-view-goto-page page))))
(defun org-docview-store-link ()