emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] Working dir incorrect
@ 2017-03-13 14:32 Loris Bennett
  2017-03-13 15:42 ` Nick Dokos
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Loris Bennett @ 2017-03-13 14:32 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

In a file that used to work, when I now try to run some R code which
generates an image, I get the error:

  cannot open file './usage_users_historical_facet.pdf'

If I check the working directory for the R session I see

  getwd()
  [1] "/usr/share/emacs/site-lisp/ess"

instead of the directory in which my org file is located.

I am now running Org 9.0.5 on Emacs 25.1.1.  The last time things worked
I was definitely using an older version of Org and possibly Emacs 24.

Any thoughts?

Cheers,

Loris

-- 
This signature is currently under construction.

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

* Re: [babel] Working dir incorrect
  2017-03-13 14:32 [babel] Working dir incorrect Loris Bennett
@ 2017-03-13 15:42 ` Nick Dokos
  2017-03-14  2:40 ` John Hendy
       [not found] ` <d1f9ebc6d2e9433f896d45bf93ac2016@DB5PR01MB1895.eurprd01.prod.exchangelabs.com>
  2 siblings, 0 replies; 7+ messages in thread
From: Nick Dokos @ 2017-03-13 15:42 UTC (permalink / raw)
  To: emacs-orgmode

"Loris Bennett" <loris.bennett@fu-berlin.de> writes:

> Hi,
>
> In a file that used to work, when I now try to run some R code which
> generates an image, I get the error:
>
>   cannot open file './usage_users_historical_facet.pdf'
>
> If I check the working directory for the R session I see
>
>   getwd()
>   [1] "/usr/share/emacs/site-lisp/ess"
>
> instead of the directory in which my org file is located.
>
> I am now running Org 9.0.5 on Emacs 25.1.1.  The last time things worked
> I was definitely using an older version of Org and possibly Emacs 24.
>
> Any thoughts?
>

Can I make a plea for an ECM? If you provide one, I can spend five
minutes testing it, but without it I'll have to do real work to get an
example together and that's much more unlikely to happen.

-- 
Nick

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

* Re: [babel] Working dir incorrect
  2017-03-13 14:32 [babel] Working dir incorrect Loris Bennett
  2017-03-13 15:42 ` Nick Dokos
@ 2017-03-14  2:40 ` John Hendy
  2017-03-14  8:31   ` Loris Bennett
       [not found] ` <d1f9ebc6d2e9433f896d45bf93ac2016@DB5PR01MB1895.eurprd01.prod.exchangelabs.com>
  2 siblings, 1 reply; 7+ messages in thread
From: John Hendy @ 2017-03-14  2:40 UTC (permalink / raw)
  To: Loris Bennett; +Cc: emacs-orgmode

On Mon, Mar 13, 2017 at 9:32 AM, Loris Bennett
<loris.bennett@fu-berlin.de> wrote:
> Hi,
>
> In a file that used to work, when I now try to run some R code which
> generates an image, I get the error:
>
>   cannot open file './usage_users_historical_facet.pdf'
>
> If I check the working directory for the R session I see
>
>   getwd()
>   [1] "/usr/share/emacs/site-lisp/ess"
>
> instead of the directory in which my org file is located.
>
> I am now running Org 9.0.5 on Emacs 25.1.1.  The last time things worked
> I was definitely using an older version of Org and possibly Emacs 24.
>
> Any thoughts?

I agree with Nick on an ECM. Just to start the ball rolling:

M-x org-version
Org mode version 9.0.5 (release_9.0.5-288-g4caad0 @
/home/jwhendy/.elisp/org/lisp/)

$ emacs --version
GNU Emacs 25.1.1

#+begin_src min-config

;; set load paths
(add-to-list 'load-path "~/.elisp/org.git/lisp/")
(add-to-list 'load-path "~/.elisp/org.git/contrib/lisp/")
(add-to-list 'load-path "~/.elisp/ess/lisp/")

(require 'ess-site)

;; setup babel languages
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))

#+end_src

method:
- emacs -Q
- M-x load-file /path/to/min-config
- C-c C-c on both of these blocks and get the results as shown

;;;;;;;; file: ~/Desktop/test.org ;;;;;;;;;

* heading

#+begin_src R

getwd()

#+end_src

#+RESULTS:
: /home/jwhendy/Desktop

#+begin_src R :session r

getwd()

#+end_src

#+RESULTS:
: /home/jwhendy/Desktop

;;;;;;;;;;;;;;;;;


How does this go for you?
John

>
> Cheers,
>
> Loris
>
> --
> This signature is currently under construction.
>
>

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

* Re: [babel] Working dir incorrect
       [not found] ` <d1f9ebc6d2e9433f896d45bf93ac2016@DB5PR01MB1895.eurprd01.prod.exchangelabs.com>
@ 2017-03-14  7:28   ` Eric S Fraga
  2017-03-15  1:17     ` numbchild
  0 siblings, 1 reply; 7+ messages in thread
From: Eric S Fraga @ 2017-03-14  7:28 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

On Monday, 13 Mar 2017 at 15:42, Nick Dokos wrote:

[...]

> Can I make a plea for an ECM? If you provide one, I can spend five
> minutes testing it, but without it I'll have to do real work to get an
> example together and that's much more unlikely to happen.

I've found that babel languages that start specific buffers that
persist (e.g. octave, gnuplot) will be started in a particular
directory based on a given org file.  If subsequently another org file,
in a different directory, is visited, babel won't change the directory
for existing babel buffers (and probably cannot easily do so in some
cases?).

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.4-242-g2c27b8

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: [babel] Working dir incorrect
  2017-03-14  2:40 ` John Hendy
@ 2017-03-14  8:31   ` Loris Bennett
  2017-04-20  9:24     ` Loris Bennett
  0 siblings, 1 reply; 7+ messages in thread
From: Loris Bennett @ 2017-03-14  8:31 UTC (permalink / raw)
  To: emacs-orgmode

Hi John,

John Hendy <jw.hendy@gmail.com> writes:

> On Mon, Mar 13, 2017 at 9:32 AM, Loris Bennett
> <loris.bennett@fu-berlin.de> wrote:
>> Hi,
>>
>> In a file that used to work, when I now try to run some R code which
>> generates an image, I get the error:
>>
>>   cannot open file './usage_users_historical_facet.pdf'
>>
>> If I check the working directory for the R session I see
>>
>>   getwd()
>>   [1] "/usr/share/emacs/site-lisp/ess"
>>
>> instead of the directory in which my org file is located.
>>
>> I am now running Org 9.0.5 on Emacs 25.1.1.  The last time things worked
>> I was definitely using an older version of Org and possibly Emacs 24.
>>
>> Any thoughts?
>
> I agree with Nick on an ECM. Just to start the ball rolling:
>
> M-x org-version
> Org mode version 9.0.5 (release_9.0.5-288-g4caad0 @
> /home/jwhendy/.elisp/org/lisp/)
>
> $ emacs --version
> GNU Emacs 25.1.1
>
> #+begin_src min-config
>
> ;; set load paths
> (add-to-list 'load-path "~/.elisp/org.git/lisp/")
> (add-to-list 'load-path "~/.elisp/org.git/contrib/lisp/")
> (add-to-list 'load-path "~/.elisp/ess/lisp/")
>
> (require 'ess-site)
>
> ;; setup babel languages
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((R . t)))
>
> #+end_src
>
>
> method:
> - emacs -Q
> - M-x load-file /path/to/min-config
> - C-c C-c on both of these blocks and get the results as shown
>
> ;;;;;;;; file: ~/Desktop/test.org ;;;;;;;;;
>
> * heading
>
> #+begin_src R
>
> getwd()
>
> #+end_src
>
>
> #+RESULTS:
> : /home/jwhendy/Desktop
>
> #+begin_src R :session r
>
> getwd()
>
> #+end_src
>
> #+RESULTS:
> : /home/jwhendy/Desktop
>
> ;;;;;;;;;;;;;;;;;
>
>
> How does this go for you?

Thanks for doing most of the work for me.  Unfortunately for me, the ECM
works fine, so I'm going to have to do some work myself and debug my
crufty old .emacs.

Thanks again,

Loris

-- 
This signature is currently under construction.

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

* Re: [babel] Working dir incorrect
  2017-03-14  7:28   ` Eric S Fraga
@ 2017-03-15  1:17     ` numbchild
  0 siblings, 0 replies; 7+ messages in thread
From: numbchild @ 2017-03-15  1:17 UTC (permalink / raw)
  To: Eric S Fraga, Org-mode

[-- Attachment #1: Type: text/plain, Size: 1173 bytes --]

Yes, it seems like this, I have a similar question at here:
https://lists.gnu.org/archive/html/emacs-orgmode/2017-03/msg00283.html

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Mar 14, 2017 at 3:28 PM, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:

> On Monday, 13 Mar 2017 at 15:42, Nick Dokos wrote:
>
> [...]
>
> > Can I make a plea for an ECM? If you provide one, I can spend five
> > minutes testing it, but without it I'll have to do real work to get an
> > example together and that's much more unlikely to happen.
>
> I've found that babel languages that start specific buffers that
> persist (e.g. octave, gnuplot) will be started in a particular
> directory based on a given org file.  If subsequently another org file,
> in a different directory, is visited, babel won't change the directory
> for existing babel buffers (and probably cannot easily do so in some
> cases?).
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.4-242-g2c27b8
>

[-- Attachment #2: Type: text/html, Size: 2061 bytes --]

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

* Re: [babel] Working dir incorrect
  2017-03-14  8:31   ` Loris Bennett
@ 2017-04-20  9:24     ` Loris Bennett
  0 siblings, 0 replies; 7+ messages in thread
From: Loris Bennett @ 2017-04-20  9:24 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

"Loris Bennett" <loris.bennett@fu-berlin.de> writes:

> Hi John,
>
> John Hendy <jw.hendy@gmail.com> writes:
>
>> On Mon, Mar 13, 2017 at 9:32 AM, Loris Bennett
>> <loris.bennett@fu-berlin.de> wrote:
>>> Hi,
>>>
>>> In a file that used to work, when I now try to run some R code which
>>> generates an image, I get the error:
>>>
>>>   cannot open file './usage_users_historical_facet.pdf'
>>>
>>> If I check the working directory for the R session I see
>>>
>>>   getwd()
>>>   [1] "/usr/share/emacs/site-lisp/ess"
>>>
>>> instead of the directory in which my org file is located.
>>>
>>> I am now running Org 9.0.5 on Emacs 25.1.1.  The last time things worked
>>> I was definitely using an older version of Org and possibly Emacs 24.
>>>
>>> Any thoughts?
>>
>> I agree with Nick on an ECM. Just to start the ball rolling:
>>
[snip (54 lines)]
>>
>> How does this go for you?
>
> Thanks for doing most of the work for me.  Unfortunately for me, the ECM
> works fine, so I'm going to have to do some work myself and debug my
> crufty old .emacs.

I finally got round to bisecting my .emacs and worked out the sequence
of events which lead me to shooting myself in the foot:

1. Installed Emacs 25 under /usr/local
2. Discovered that Emacs 25 couldn't find the ESS stuff
3. Defined a variable 'ess-directory' to be "/usr/share/emacs/site-lisp/ess/"
4. Used the variable in a function to add ESS to the load-path 

It turns out that variable 'ess-directory' already exists and is, according
to the documentation, "the directory ESS is run from".

Thus renaming the variable 'ess-directory' to
'non-in-the-foot-shooting-ess-directory' solves the problem.

Cheers,

Loris

-- 
This signature is currently under construction.

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

end of thread, other threads:[~2017-04-20  9:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-13 14:32 [babel] Working dir incorrect Loris Bennett
2017-03-13 15:42 ` Nick Dokos
2017-03-14  2:40 ` John Hendy
2017-03-14  8:31   ` Loris Bennett
2017-04-20  9:24     ` Loris Bennett
     [not found] ` <d1f9ebc6d2e9433f896d45bf93ac2016@DB5PR01MB1895.eurprd01.prod.exchangelabs.com>
2017-03-14  7:28   ` Eric S Fraga
2017-03-15  1:17     ` numbchild

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).