From 37c77d8e563428dcc44c69fa4cd377639730734f Mon Sep 17 00:00:00 2001
From: Abhishek Chandratre <abhishek.chandratre@gmail.com>
Date: Tue, 20 Aug 2019 22:26:30 -0700
Subject: [PATCH] ol-eshell.el: Fix org-store-link for eshell

lisp/ol-eshell.el (org-eshell-store-link): Replace `dired-directory'
variable with `eshell/pwd' function to find current directory.

During org-store-link `dired-directory' variable returns nil.
Thus replacing it with (eshell/pwd), which returns pwd.

TINYCHANGE
---
 lisp/ol-eshell.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ol-eshell.el b/lisp/ol-eshell.el
index 4de657461..a9a72a534 100644
--- a/lisp/ol-eshell.el
+++ b/lisp/ol-eshell.el
@@ -55,7 +55,7 @@
   "Store a link that, when opened, switches back to the current eshell buffer
    and the current working directory."
   (when (eq major-mode 'eshell-mode)
-    (let* ((command (concat "cd " dired-directory))
+    (let* ((command (concat "cd " (eshell/pwd)))
            (link  (concat (buffer-name) ":" command)))
       (org-link-store-props
        :link (concat "eshell:" link)
-- 
2.20.1 (Apple Git-117)

