emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCHATTACHED] Fixing org-store-link for eshell
@ 2019-08-21  5:55 Abhishek Chandratre
  0 siblings, 0 replies; only message in thread
From: Abhishek Chandratre @ 2019-08-21  5:55 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 719 bytes --]

Hello all,
Thank you for supporting and maintaining org mode.

I wanted to use org-store-link for eshell, but it failed.
Looked like dired-directory was nil, I fixed it by calling (eshell/pwd) to
get pwd.
I tested with and without TRAMP, works like a charm.

The patch did not create new test case failures, but for master branch on
my machine I saw 6 test case failure (not related to patch).

6 unexpected results:
   FAILED  ob-sed-test/cmd-line-header-argument
   FAILED  ob-shell/bash-uses-assoc-arrays
   FAILED  ob-tangle/jump-to-org
   FAILED  test-ob-shell/session
   FAILED  test-org-attach/dir
   FAILED  test-org-table/sort-lines

I will try investigate and address them in another patch.
Thanks,
-Abhishek

[-- Attachment #1.2: Type: text/html, Size: 1090 bytes --]

[-- Attachment #2: 0001-ol-eshell.el-Fix-org-store-link-for-eshell.patch --]
[-- Type: application/octet-stream, Size: 1132 bytes --]

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)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-21  5:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-21  5:55 [PATCHATTACHED] Fixing org-store-link for eshell Abhishek Chandratre

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).