branch: master
commit ec7da3fd20a2652b38d8a5241ef8fa7acf72887f
Author: Oleh Krehel <ohwoeo...@gmail.com>
Commit: Oleh Krehel <ohwoeo...@gmail.com>

    ivy.el (ivy-help-file): Improve location
    
    Fixes #379
---
 ivy.el |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/ivy.el b/ivy.el
index 3b1e9fa..4a17bbf 100644
--- 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 ()

Reply via email to