ソースを参照

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 年 前
コミット
c57f12b707
1 ファイル変更3 行追加1 行削除
  1. 3 1
      lisp/ol-eshell.el

+ 3 - 1
lisp/ol-eshell.el

@@ -27,6 +27,8 @@
 (require 'esh-mode)
 (require 'esh-mode)
 (require 'ol)
 (require 'ol)
 
 
+(declare-function eshell/pwd "em-dirs.el" (&rest args))
+
 (org-link-set-parameters "eshell"
 (org-link-set-parameters "eshell"
 			 :follow #'org-eshell-open
 			 :follow #'org-eshell-open
 			 :store #'org-eshell-store-link)
 			 :store #'org-eshell-store-link)
@@ -55,7 +57,7 @@
   "Store a link that, when opened, switches back to the current eshell buffer
   "Store a link that, when opened, switches back to the current eshell buffer
    and the current working directory."
    and the current working directory."
   (when (eq major-mode 'eshell-mode)
   (when (eq major-mode 'eshell-mode)
-    (let* ((command (concat "cd " dired-directory))
+    (let* ((command (concat "cd " (eshell/pwd)))
            (link  (concat (buffer-name) ":" command)))
            (link  (concat (buffer-name) ":" command)))
       (org-link-store-props
       (org-link-store-props
        :link (concat "eshell:" link)
        :link (concat "eshell:" link)