* orgmode add-on that implements links to eshell buffers
@ 2011-01-03 12:07 Konrad Hinsen
2011-01-04 12:26 ` Carsten Dominik
0 siblings, 1 reply; 5+ messages in thread
From: Konrad Hinsen @ 2011-01-03 12:07 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 578 bytes --]
The attached file implements a new link type "eshell". An eshell link consists of an optional buffer name followed by a colon, and of an eshell command line. Opening the link switches to the indicated buffer, creating it if necessary, or to the default *eshell* buffer, and executes the command line exactly as if it were entered from the keyboard. Inside an eshell buffer, org-store-link stores a link that switches back to the same buffer and does a cd to the current working directory.
I'd be happy to contribute this file to org-mode if there is interest.
Konrad.
[-- Attachment #2: org-eshell.el --]
[-- Type: application/octet-stream, Size: 2410 bytes --]
;;; org-eshell.el - Support for links to working directories in eshell
;; Copyright (C) 2011 Free Software Foundation, Inc.
;;
;; Author: Konrad Hinsen <konrad.hinsen AT fastmail.net>
;; Version: 0.1
;;
;; This file is not part of GNU Emacs.
;;
;; Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'org)
(require 'eshell)
(require 'esh-mode)
(org-add-link-type "eshell" 'org-eshell-open)
(add-hook 'org-store-link-functions 'org-eshell-store-link)
(defun org-eshell-open (link)
"Switch to am eshell buffer and execute a command line.
The link can be just a command line (executed in the default
eshell buffer) or a command line prefixed by a buffer name
followed by a colon."
(let* ((buffer-and-command
(if (string-match "\\([A-Za-z0-9-+*]+\\):\\(.*\\)" link)
(list (match-string 1 link)
(match-string 2 link))
(list eshell-buffer-name link)))
(eshell-buffer-name (car buffer-and-command))
(command (cadr buffer-and-command)))
(if (get-buffer eshell-buffer-name)
(switch-to-buffer eshell-buffer-name)
(eshell))
(end-of-buffer)
(eshell-kill-input)
(insert command)
(eshell-send-input)))
(defun org-eshell-store-link ()
"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))
(link (concat (buffer-name) ":" command)))
(org-store-link-props
:link (org-make-link "eshell:" link)
:description command))))
(provide 'org-eshell)
;;; org-eshell.el ends here
[-- Attachment #3: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: orgmode add-on that implements links to eshell buffers
2011-01-03 12:07 orgmode add-on that implements links to eshell buffers Konrad Hinsen
@ 2011-01-04 12:26 ` Carsten Dominik
2011-01-04 14:44 ` Konrad Hinsen
0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2011-01-04 12:26 UTC (permalink / raw)
To: Konrad Hinsen; +Cc: emacs-orgmode
Hi Konrad, this looks good.
Have you signed papers with the FSF, or do we have to make this a
contributed file?
- Carsten
On Jan 3, 2011, at 1:07 PM, Konrad Hinsen wrote:
> The attached file implements a new link type "eshell". An eshell
> link consists of an optional buffer name followed by a colon, and of
> an eshell command line. Opening the link switches to the indicated
> buffer, creating it if necessary, or to the default *eshell* buffer,
> and executes the command line exactly as if it were entered from the
> keyboard. Inside an eshell buffer, org-store-link stores a link that
> switches back to the same buffer and does a cd to the current
> working directory.
>
> I'd be happy to contribute this file to org-mode if there is interest.
>
> Konrad.
>
> <org-eshell.el>_______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: orgmode add-on that implements links to eshell buffers
2011-01-04 12:26 ` Carsten Dominik
@ 2011-01-04 14:44 ` Konrad Hinsen
2011-01-04 15:02 ` Carsten Dominik
0 siblings, 1 reply; 5+ messages in thread
From: Konrad Hinsen @ 2011-01-04 14:44 UTC (permalink / raw)
To: Carsten Dominik; +Cc: emacs-orgmode
Hi Carsten,
> Hi Konrad, this looks good.
>
> Have you signed papers with the FSF, or do we have to make this a contributed file?
I have started the FSF process in december, and got a message yesterday that the papers to be signed are on the way to me. I have no idea how long this will take, unfortunately.
Konrad.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: orgmode add-on that implements links to eshell buffers
2011-01-04 14:44 ` Konrad Hinsen
@ 2011-01-04 15:02 ` Carsten Dominik
2011-01-06 10:33 ` Carsten Dominik
0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2011-01-04 15:02 UTC (permalink / raw)
To: Konrad Hinsen; +Cc: emacs-orgmode
Hi Konrad,
I suggest then that we install this as a contrib package - and once
you have the assignment finished, we can move it.
- Carsten
On Jan 4, 2011, at 3:44 PM, Konrad Hinsen wrote:
> Hi Carsten,
>
>> Hi Konrad, this looks good.
>>
>> Have you signed papers with the FSF, or do we have to make this a
>> contributed file?
>
> I have started the FSF process in december, and got a message
> yesterday that the papers to be signed are on the way to me. I have
> no idea how long this will take, unfortunately.
>
> Konrad.
- Carsten
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: orgmode add-on that implements links to eshell buffers
2011-01-04 15:02 ` Carsten Dominik
@ 2011-01-06 10:33 ` Carsten Dominik
0 siblings, 0 replies; 5+ messages in thread
From: Carsten Dominik @ 2011-01-06 10:33 UTC (permalink / raw)
To: Carsten Dominik; +Cc: Konrad Hinsen, emacs-orgmode
This has been done now - eshell links can be activated through org-
modules.
- Carsten
On Jan 4, 2011, at 4:02 PM, Carsten Dominik wrote:
> Hi Konrad,
>
> I suggest then that we install this as a contrib package - and once
> you have the assignment finished, we can move it.
>
> - Carsten
>
> On Jan 4, 2011, at 3:44 PM, Konrad Hinsen wrote:
>
>> Hi Carsten,
>>
>>> Hi Konrad, this looks good.
>>>
>>> Have you signed papers with the FSF, or do we have to make this a
>>> contributed file?
>>
>> I have started the FSF process in december, and got a message
>> yesterday that the papers to be signed are on the way to me. I have
>> no idea how long this will take, unfortunately.
>>
>> Konrad.
>
> - Carsten
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-01-06 11:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-03 12:07 orgmode add-on that implements links to eshell buffers Konrad Hinsen
2011-01-04 12:26 ` Carsten Dominik
2011-01-04 14:44 ` Konrad Hinsen
2011-01-04 15:02 ` Carsten Dominik
2011-01-06 10:33 ` Carsten Dominik
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).