all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* customizing C-l (inserting link with file:) for dual-boot
@ 2006-09-27 22:00 Patrick Drechsler
  2006-09-28 12:10 ` Carsten Dominik
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Drechsler @ 2006-09-27 22:00 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I've been using Org-Mode for a while now and would like to know how to 
configure the `C-l'-command (inserting a link) to work on a dual boot 
system.

Here is what I am trying to accomplish:

Inserting a link to file works fine using the command `C-l'. But off 
course it makes a difference which OS I use.

I have a working Emacs-Snapshot on a dual boot machine (both similar 
versions 22.0.50.1).

For Org-Mode (and its agenda files) I use the following configuration:

-------------------------
(cond
  ((file-directory-p "C:/Programme")
   ; do Windows stuff:
   (setq org-directory "F:\org-stuff")
   (setq org-remember-templates
	'((?t "* TODO %?\n  %i\n  %a" "F:/org-stuff/TODO.org")
	  (?j "* %U %?\n\n  %i\n  %a" "F:/org-stuff/JOURNAL.org")))
   (setq org-agenda-files (quote ("f:/org-stuff/computerstuff.org" 
"f:/org-stuff/heinzerling.org" "f:/org-stuff/THESIS.org" 
"f:/org-stuff/privat.org" "f:/org-stuff/TODO.org" 
"f:/org-stuff/JOURNAL.org")))
   )
  ((file-directory-p "/home/patrick/")
   ; do GNU/Linux stuff
   (setq org-directory "~/data/org-stuff")
   (setq org-remember-templates
	'((?t "* TODO %?\n  %i\n  %a" "~/data//org-stuff/TODO.org")
	  (?j "* %U %?\n\n  %i\n  %a" "~/data//org-stuff/JOURNAL.org")))
   (setq org-agenda-files (quote ("~/data/org-stuff/computerstuff.org" 
"~/data/org-stuff/heinzerling.org" "~/data/org-stuff/THESIS.org" 
"~/data/org-stuff/privat.org" "~/data/org-stuff/TODO.org" 
"~/data/org-stuff/JOURNAL.org")))
   )
)
-------------------------

What would be a simple way to adopt this feature when using `C-l'?
My GNU/Linux partition is: ~/data
My WindowsXPSP2 is:        f:/

They both reach the same directory.

I'd like `C-l' to think the same way.

Can I store the variables "/home/patrick/data/org-stuff" (for GNU/Linux) 
and "F:\org-stuff" (Windows) in a variable?

Any ideas?

Regards

Patrick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: customizing C-l (inserting link with file:) for dual-boot
  2006-09-27 22:00 customizing C-l (inserting link with file:) for dual-boot Patrick Drechsler
@ 2006-09-28 12:10 ` Carsten Dominik
  2006-09-28 13:29   ` Patrick Drechsler
  0 siblings, 1 reply; 4+ messages in thread
From: Carsten Dominik @ 2006-09-28 12:10 UTC (permalink / raw)
  To: Patrick Drechsler; +Cc: emacs-orgmode

If you store file names relative to your home directory, then org-mode 
should be able to use ~/....   filenames which would be general.  Is F: 
your home directory?

- Carsten

On Sep 28, 2006, at 0:00, Patrick Drechsler wrote:

> Hi,
>
> I've been using Org-Mode for a while now and would like to know how to 
> configure the `C-l'-command (inserting a link) to work on a dual boot 
> system.
>
> Here is what I am trying to accomplish:
>
> Inserting a link to file works fine using the command `C-l'. But off 
> course it makes a difference which OS I use.
>
> I have a working Emacs-Snapshot on a dual boot machine (both similar 
> versions 22.0.50.1).
>
> For Org-Mode (and its agenda files) I use the following configuration:
>
> -------------------------
> (cond
>  ((file-directory-p "C:/Programme")
>   ; do Windows stuff:
>   (setq org-directory "F:\org-stuff")
>   (setq org-remember-templates
> 	'((?t "* TODO %?\n  %i\n  %a" "F:/org-stuff/TODO.org")
> 	  (?j "* %U %?\n\n  %i\n  %a" "F:/org-stuff/JOURNAL.org")))
>   (setq org-agenda-files (quote ("f:/org-stuff/computerstuff.org" 
> "f:/org-stuff/heinzerling.org" "f:/org-stuff/THESIS.org" 
> "f:/org-stuff/privat.org" "f:/org-stuff/TODO.org" 
> "f:/org-stuff/JOURNAL.org")))
>   )
>  ((file-directory-p "/home/patrick/")
>   ; do GNU/Linux stuff
>   (setq org-directory "~/data/org-stuff")
>   (setq org-remember-templates
> 	'((?t "* TODO %?\n  %i\n  %a" "~/data//org-stuff/TODO.org")
> 	  (?j "* %U %?\n\n  %i\n  %a" "~/data//org-stuff/JOURNAL.org")))
>   (setq org-agenda-files (quote ("~/data/org-stuff/computerstuff.org" 
> "~/data/org-stuff/heinzerling.org" "~/data/org-stuff/THESIS.org" 
> "~/data/org-stuff/privat.org" "~/data/org-stuff/TODO.org" 
> "~/data/org-stuff/JOURNAL.org")))
>   )
> )
> -------------------------
>
> What would be a simple way to adopt this feature when using `C-l'?
> My GNU/Linux partition is: ~/data
> My WindowsXPSP2 is:        f:/
>
> They both reach the same directory.
>
> I'd like `C-l' to think the same way.
>
> Can I store the variables "/home/patrick/data/org-stuff" (for 
> GNU/Linux) and "F:\org-stuff" (Windows) in a variable?
>
> Any ideas?
>
> Regards
>
> Patrick
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: customizing C-l (inserting link with file:) for dual-boot
  2006-09-28 12:10 ` Carsten Dominik
@ 2006-09-28 13:29   ` Patrick Drechsler
  2006-09-28 17:33     ` Carsten Dominik
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Drechsler @ 2006-09-28 13:29 UTC (permalink / raw)
  To: emacs-orgmode

Hi Carsten,

Carsten Dominik wrote:
> If you store file names relative to your home directory, then org-mode 
> should be able to use ~/....   filenames which would be general.  Is F: 
> your home directory?

I do not have my org-files in my home directory (neither on GNU/Linux 
nor on Windows). That is why the expansion of "~" does not seem to help 
here.

Just to clear things up a bit: "F:\" is not my home directory. My home 
directory under Cygwin is "C:\cygwin\home\home\pduser". "F:\" is a fat32 
partition I use to share my data between Windows and GNU/Linux. From 
GNU/Linux this partition is called "~/data/".

Tim O Callaghan was so kind to give me a tip off-list using the setenv 
variable. Since the paths I'm using are not the same in relation to my 
different home directories this might be a feasible solution.

My approach so far doesn't work (probably just my bad lisp):


-------------------------
(cond
   ((file-directory-p "C:/Programme")
    ; do Windows stuff:
    (setenv "DATA_HOME" (expand-file-name "F:/"))
    )
   ((file-directory-p "/home/patrick/")
    ; do GNU/Linux stuff
    (setenv "DATA_HOME" (expand-file-name "~/data"))
    )
)
(setq org-directory (concat (getenv "DATA_HOME") "/org-stuff"))
(setq org-remember-templates
        '((?t "* TODO %?\n  %i\n  %a" (concat (getenv "DATA_HOME")
"/org-stuff/TODO.org")
	(?j "* %U %?\n\n  %i\n  %a" (concat (getenv "DATA_HOME")
"/org-stuff/JOURNAL.org")))))
(setq org-agenda-files (quote ((concat (getenv "DATA_HOME")
"/org-stuff/computerstuff.org")
  			       (concat (getenv "DATA_HOME") "/org-stuff/heinzerling.org" )
  			       (concat (getenv "DATA_HOME") "/org-stuff/THESIS.org" )
  			       (concat (getenv "DATA_HOME") "/org-stuff/privat.org" )
  			       (concat (getenv "DATA_HOME") "/org-stuff/TODO.org" )
  			       (concat (getenv "DATA_HOME") "/org-stuff/JOURNAL.org"))))
-------------------------

I receive following error message when trying to invoke the agenda from
an org file:
-------------------------
org-check-agenda-file: Wrong type argument: stringp, (concat (getenv
"DATA_HOME") "/org-stuff/computerstuff.org")
-------------------------

TIA

Patrick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: customizing C-l (inserting link with file:) for dual-boot
  2006-09-28 13:29   ` Patrick Drechsler
@ 2006-09-28 17:33     ` Carsten Dominik
  0 siblings, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2006-09-28 17:33 UTC (permalink / raw)
  To: Patrick Drechsler; +Cc: emacs-orgmode


On Sep 28, 2006, at 15:29, Patrick Drechsler wrote:

> Tim O Callaghan was so kind to give me a tip off-list using the setenv 
> variable. Since the paths I'm using are not the same in relation to my 
> different home directories this might be a feasible solution.
>
> My approach so far doesn't work (probably just my bad lisp):
>
>
> -------------------------
> (cond
>   ((file-directory-p "C:/Programme")
>    ; do Windows stuff:
>    (setenv "DATA_HOME" (expand-file-name "F:/"))
>    )
>   ((file-directory-p "/home/patrick/")
>    ; do GNU/Linux stuff
>    (setenv "DATA_HOME" (expand-file-name "~/data"))
>    )
> )
> (setq org-directory (concat (getenv "DATA_HOME") "/org-stuff"))
> (setq org-remember-templates
>        '((?t "* TODO %?\n  %i\n  %a" (concat (getenv "DATA_HOME")
> "/org-stuff/TODO.org")
> 	(?j "* %U %?\n\n  %i\n  %a" (concat (getenv "DATA_HOME")
> "/org-stuff/JOURNAL.org")))))
> (setq org-agenda-files (quote ((concat (getenv "DATA_HOME")
> "/org-stuff/computerstuff.org")
>  			       (concat (getenv "DATA_HOME") "/org-stuff/heinzerling.org" )
>  			       (concat (getenv "DATA_HOME") "/org-stuff/THESIS.org" )
>  			       (concat (getenv "DATA_HOME") "/org-stuff/privat.org" )
>  			       (concat (getenv "DATA_HOME") "/org-stuff/TODO.org" )
>  			       (concat (getenv "DATA_HOME") "/org-stuff/JOURNAL.org"))))
> -------------------------
>

Quote prevents evaulation of concat. You need to do

(setq org-agenda-files
	(list (concat  (getenv "DATA_HOME") "/org-stuff/computerstuff.org")
	       (concat (getenv "DATA_HOME") "/org-stuff/heinzerling.org" )
	       (concat (getenv "DATA_HOME") "/org-stuff/THESIS.org" )
	       (concat (getenv "DATA_HOME") "/org-stuff/privat.org" )
	       (concat (getenv "DATA_HOME") "/org-stuff/TODO.org" )
	       (concat (getenv "DATA_HOME") "/org-stuff/JOURNAL.org")))



> I receive following error message when trying to invoke the agenda from
> an org file:
> -------------------------
> org-check-agenda-file: Wrong type argument: stringp, (concat (getenv
> "DATA_HOME") "/org-stuff/computerstuff.org")
> -------------------------
>
> TIA
>
> Patrick
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-09-28 17:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-27 22:00 customizing C-l (inserting link with file:) for dual-boot Patrick Drechsler
2006-09-28 12:10 ` Carsten Dominik
2006-09-28 13:29   ` Patrick Drechsler
2006-09-28 17:33     ` Carsten Dominik

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.