Browse Source

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
Abhishek Chandratre 5 years ago
parent
commit
c57f12b707
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/ol-eshell.el

+ 3 - 1
lisp/ol-eshell.el

@@ -27,6 +27,8 @@
 (require 'esh-mode)
 (require 'ol)
 
+(declare-function eshell/pwd "em-dirs.el" (&rest args))
+
 (org-link-set-parameters "eshell"
 			 :follow #'org-eshell-open
 			 :store #'org-eshell-store-link)
@@ -55,7 +57,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)