[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/4] emacs: Allow to choose 'find-file' function.
From: |
Alex Kost |
Subject: |
[PATCH 3/4] emacs: Allow to choose 'find-file' function. |
Date: |
Mon, 31 Aug 2015 00:04:25 +0300 |
* emacs/guix-utils.el (guix-find-file-function): New variable.
(guix-find-file): Use it.
---
emacs/guix-utils.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/emacs/guix-utils.el b/emacs/guix-utils.el
index 78ea354..c1ce954 100644
--- a/emacs/guix-utils.el
+++ b/emacs/guix-utils.el
@@ -193,10 +193,19 @@ Return time value."
(require 'org)
(org-read-date nil t nil prompt))
+(defcustom guix-find-file-function #'find-file
+ "Function used to find a file.
+The function is called by `guix-find-file' with a file name as a
+single argument."
+ :type '(choice (function-item find-file)
+ (function-item org-open-file)
+ (function :tag "Other function"))
+ :group 'guix)
+
(defun guix-find-file (file)
"Find FILE if it exists."
(if (file-exists-p file)
- (find-file file)
+ (funcall guix-find-file-function file)
(message "File '%s' does not exist." file)))
(defmacro guix-while-search (regexp &rest body)
--
2.4.3