]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el (ivy-help-file): Improve location
authorOleh Krehel <ohwoeowho@gmail.com>
Sun, 7 Feb 2016 10:29:29 +0000 (11:29 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Sun, 7 Feb 2016 10:29:29 +0000 (11:29 +0100)
Fixes #379

ivy.el

diff --git a/ivy.el b/ivy.el
index 3b1e9fa6a4d758e5bc6403d253e566a4d8390eab..4a17bbfbd3553f849b4803b24d3434209e52e480 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -2718,9 +2718,14 @@ EVENT gives the mouse position."
               (run-at-time 0.5 nil 'swiper--cleanup))
           (pulse-momentary-highlight-one-line (point)))))))
 
-(defvar ivy-help-file (expand-file-name
-                       "doc/ivy-help.org"
-                       (file-name-directory load-file-name))
+(defvar ivy-help-file (let ((default-directory
+                             (if load-file-name
+                                 (file-name-directory load-file-name)
+                               default-directory)))
+                        (if (file-exists-p "ivy-help.org")
+                            (expand-file-name "ivy-help.org")
+                          (if (file-exists-p "doc/ivy-help.org")
+                              (expand-file-name "doc/ivy-help.org"))))
   "The file for `ivy-help'.")
 
 (defun ivy-help ()