From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andrew Hyatt" Subject: Re: using org-mode and screen Date: Sun, 3 Feb 2008 15:20:19 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0404506799==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JLlKF-0003bA-Sz for emacs-orgmode@gnu.org; Sun, 03 Feb 2008 15:20:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JLlKD-0003ak-9q for emacs-orgmode@gnu.org; Sun, 03 Feb 2008 15:20:26 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JLlKD-0003ah-43 for emacs-orgmode@gnu.org; Sun, 03 Feb 2008 15:20:25 -0500 Received: from wa-out-1112.google.com ([209.85.146.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JLlKA-0000uq-QW for emacs-orgmode@gnu.org; Sun, 03 Feb 2008 15:20:24 -0500 Received: by wa-out-1112.google.com with SMTP id k34so1909322wah.10 for ; Sun, 03 Feb 2008 12:20:19 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org --===============0404506799== Content-Type: multipart/alternative; boundary="----=_Part_1791_19835586.1202070019346" ------=_Part_1791_19835586.1202070019346 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Cool. I'll send something along to you when I package it up... On Feb 3, 2008 3:22 AM, Carsten Dominik wrote: > Well, Andrew, > if you write an extension, I will put it into the CONTRIB directory of the > distribution. > > - Carsten > > On Jan 28, 2008, at 12:41 AM, Andrew Hyatt wrote: > > Hi everyone, > I use org-mode religiously these days. I blogged about my use here ( > http://technical-dresese.blogspot.com/2007/08/org-mode.html) (please > excuse the fact that when I wrote this I didn't know about the existing > org-mode functionality to jump to the current clock). > > I generally have a problem of integrating the work I do in the shell with > the tasks in org-mode. Plus, I often need access to the shells at home I > started from work. I thought I'd combine these problems into a little > org-mode extension that ties screen and org-mode together, via ansi-term. > > For these to work, you have to load ansi-term, which my hack is based on. > > > If there's enough interest, I'll make a real .el file out of this. > > The general idea is that you start a task in which all the work will take > place in a shell. This usually is not a leaf-task for me, but usually the > parent of a leaf task. From a task in your org-file, M-x ash-org-screen > will prompt for the name of a session. Give it a name, and it will insert a > link. Open the link at any time to go the screen session containing your > work! > > It works pretty well for me. The only problem is that I often run emacs > in a screen session itself, and I can never get scrolling to work right in > screen-in-screen. > > (defun ash-org-screen-buffer-name (name) > > "Returns the buffer name corresponding to the screen name given." > > (concat "*screen " name "*")) > > > > (defun ash-org-screen-helper (name arg) > > ;; Pick the name of the new buffer. > > (let ((term-ansi-buffer-name (generate-new-buffer-name > (ash-org-screen-buffer-name name)))) > (setq term-ansi-buffer-name > > (term-ansi-make-term term-ansi-buffer-name "/usr/bin/screen" nil > > arg name)) > > > > (set-buffer term-ansi-buffer-name) > > (term-mode) > > (term-char-mode) > > > > (term-set-escape-char ?\C-x) > > term-ansi-buffer-name)) > > > > (defun ash-org-screen (name) > > "Start a screen session with name" > > (interactive "MScreen name: ") > > > > (save-excursion > > (ash-org-screen-helper name "-S")) > > (insert-string (concat "[[screen:" name "]]"))) > > And don't forget to add ("screen" . "elisp:(ash-org-goto-screen \"%s\")") > to org-link-abbrev-alist. > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > ------=_Part_1791_19835586.1202070019346 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Cool.  I'll send something along to you when I package it up...

On Feb 3, 2008 3:22 AM, Carsten Dominik <dominik@science.uva.nl> wrote:
Well, Andrew,

if you write an extension, I will put it into the CONTRIB directory of the distribution.

- Carsten

On Jan 28, 2008, at 12:41 AM, Andrew Hyatt wrote:

Hi everyone,

I use org-mode religiously these days.  I blogged about my use here (http://technical-dresese.blogspot.com/2007/08/org-mode.html) (please excuse the fact that when I wrote this I didn't know about the existing org-mode functionality to jump to the current clock).

I generally have a problem of integrating the work I do in the shell with the tasks in org-mode.   Plus, I often need access to the shells at home I started from work.  I thought I'd combine these problems into a little org-mode extension that ties screen and org-mode together, via ansi-term.

For these to work, you have to load ansi-term, which my hack is based on.  

If there's enough interest, I'll make a real .el file out of this.

The general idea is that you start a task in which all the work will take place in a shell.  This usually is not a leaf-task for me, but usually the parent of a leaf task.  From a task in your org-file, M-x ash-org-screen will prompt for the name of a session.  Give it a name, and it will insert a link.  Open the link at any time to go the screen session containing your work!

It works pretty well for me.  The only problem is that I often run emacs in a screen session itself, and I can never get scrolling to work right in screen-in-screen.

(defun ash-org-screen-buffer-name (name)                                                            
  "Returns the buffer name corresponding to the screen name given."                                 
  (concat "*screen " name "*"))                                                                     
                                                                                                    
(defun ash-org-screen-helper (name arg)                                                             
  ;; Pick the name of the new buffer.                                                               
  (let ((term-ansi-buffer-name (generate-new-buffer-name (ash-org-screen-buffer-name name))))       
    (setq term-ansi-buffer-name                                                                     
          (term-ansi-make-term term-ansi-buffer-name "/usr/bin/screen" nil                          
                               arg name))                                                           
                                                                                                    
    (set-buffer term-ansi-buffer-name)                                                              
    (term-mode)                                                                                     
    (term-char-mode)                                                                                
                                                                                                    
    (term-set-escape-char ?\C-x)                                                                    
    term-ansi-buffer-name))                                                                         
                                                                                                    
(defun ash-org-screen (name)                                                                        
  "Start a screen session with name"                                                                
  (interactive "MScreen name: ")                                                                    
                                                                                                    
  (save-excursion                                                                                   
    (ash-org-screen-helper name "-S"))                                                              
  (insert-string (concat "[[screen:" name "]]")))        

And don't forget to add ("screen" . "elisp:(ash-org-goto-screen \"%s\")") to org-link-abbrev-alist.
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


------=_Part_1791_19835586.1202070019346-- --===============0404506799== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0404506799==--