From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: DiTAA graph not in local directory Date: Mon, 09 Nov 2009 09:37:54 -0500 Message-ID: <87eio7ojb1.fsf@gollum.intra.norang.ca> References: <87iqdnzpw7.fsf@mundaneum.com> <87vdhnr8ua.fsf@gollum.intra.norang.ca> <87fx8oqbxd.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7VNl-0002Bc-A2 for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 09:38:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7VNg-00029T-O6 for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 09:38:12 -0500 Received: from [199.232.76.173] (port=47287 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7VNg-00029K-CY for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 09:38:08 -0500 Received: from plane.gmane.org ([80.91.229.3]:43608) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N7VNf-0007Ch-Qb for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 09:38:08 -0500 Received: from public by plane.gmane.org with local (Exim 4.63) (envelope-from ) id 1N7VNc-0006M6-Pv for emacs-orgmode@gnu.org; Mon, 09 Nov 2009 15:38:04 +0100 In-Reply-To: <87fx8oqbxd.fsf@mundaneum.com> (=?utf-8?Q?=22S=C3=A9bastien?= Vauban"'s message of "Mon\, 09 Nov 2009 10\:34\:22 +0100") 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: =?utf-8?Q?S=C3=A9bastien?= Vauban Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org S=C3=A9bastien Vauban writes: > Hi Bernt & Carsten, > > Carsten wrote: >> Bernt Hansen wrote: >>> S=C3=A9bastien Vauban writes: >>> >>>> I try to generate the following DiTAA graph for LaTeX inclusion. >>>> >>>> It's in my Org file `~/dir1/dir2/ecm.org': >>>> >>>> --8<---------------cut here---------------start------------->8--- >>>> * Context >>>> >>>> This comes from norang.ca. >>>> >>>> #+begin_ditaa communication.png -r -s 0.8 >>>> +-----------+ +---------+ >>>> | PLC | | | >>>> | Network +<------>+ PLC + >>>> | cRED | | c707 | >>>> +-----------+ +----+----+ >>>> #+end_ditaa >>>> --8<---------------cut here---------------end--------------->8--- >>>> >>>> When exporting to LaTeX, the image is well generated, but in my `~/' >>>> directory. Not in `~/dir1/dir2/', hence not found by LaTeX. >>> >>> That's not how my version of org-mode works. My exported communication.= png >>> is local to the org file. I just created your example in >>> ~/nobackup/tmp/foo.org and exported to latex and it creates >>> communication.png in ~/nobackup/tmp/communication.png > > You're more lucky than I am=C2=A0;-) > > >>> Org-mode version 6.32trans (release_6.32b.122.g41496) >>> GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11) of 2008-11-09 >>> on raven, modified by Debian > > `M-x version' gives: "Org-mode version 6.32trans". I think I got it on la= st > Thu or Fri morning. > > >>> Now if I change the working directory with M-x cd and enter ~ >>> then export it does what you see. Maybe your default directory is not >>> the location of your org file? > > I have, since long, the following chunk in my `.emacs', for setting the > `default-directory': > > --8<---------------cut here---------------start------------->8--- > ;; change the default directory (if it exists) > ;; (it is also the default directory when attaching files to mails) > (let ((my-default-directory "~/")) > (setq default-directory > (if (file-directory-p my-default-directory) > my-default-directory > (getenv "HOME")))) > --8<---------------cut here---------------end--------------->8--- I think this function is the cause of your problems. I think you are changing the default directory for whatever buffer is active when you execute that. If that buffer happens to be the org file you want to export you are changing where the resulting export files go. > When looking for the current value of that variable, I have: > > --8<---------------cut here---------------start------------->8--- > default-directory is a variable defined in `C source code'. > Its value is "~/" > Local in buffer *followup to Bernt Hansen on gmane.emacs.orgmode*; global= value is nil > > Automatically becomes buffer-local when set in any fashion. > This variable is safe as a file local variable if its value > satisfies the predicate `stringp'. > > Documentation: > Name of default directory of current buffer. Should end with slash. > To interactively change the default directory, use command `cd'. > --8<---------------cut here---------------end--------------->8--- > > Note that I am a bit puzzled, now, by the fact that variable has a > buffer-local value, and that its global value is nil. Maybe I should do > `setq-default' instead of `setq'? > > Anyway, I don't remember exactly why I did set that, but I think it's for= easy > opening of files (right prefix when `C-x C-f'). I just use C-x C-f ~/ and whatever current directory was active is dropped. I don't think you need your setq default-directory at all - you just need to teach your fingers to add ~/ after C-x C-f -Bernt