emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jarmo Hurri <jarmo.hurri@iki.fi>
To: emacs-orgmode@gnu.org
Subject: Re: Babel questions for finalising Processing support
Date: Sat, 07 Mar 2015 20:00:52 +0200	[thread overview]
Message-ID: <87ioecznzf.fsf@iki.fi> (raw)
In-Reply-To: 87sidgn9u1.fsf@gmail.com


Aaron Ecay <aaronecay@gmail.com> writes:

>> 3. In ob-processing.el I (require 'ob). However, to avoid a compiler
>>    warning about a free variable I still need to declare
>> 
>>    (eval-when-compile (defvar org-babel-temporary-directory))
>> 
>>    Is this ok?
>
> This looks bogus.  The defvar for org-babel-temporary-directory is not
> evaluated when noninteractive is true.  I think the defvar should be
> unconditional, but I also don’t understand why the code is like that in
> the first place, so let’s see if someone knows why before changing it.

Ok. On hold.

>> 4. Processing support in Babel will depend on processing2-emacs
>>    module, which contains the function processing-sketch-run. Again,
>>    to avoid compiler warnings, I am declaring this by
>> 
>>    (declare-function processing-sketch-run "processing-mode.el" nil)
>> 
>>    Is this ok?
>
> Are you not doing (require 'processing-mode)?  If you do that, I don’t
> understand why the declare-function is also needed.

I am trying to be unselfish. :-) I have processing-mode.el in my system,
but an average org mode user, who will byte compile org, will not have
processing-mode.el in their system. A require would result in an error
for this average user during the byte compilation of org. I can program,
but I am no elisp expert, so this is just my understanding.

Should I do something like:

(if (null (require 'processing-mode nil :noerror))
  (declare-function processing-sketch-run "processing-mode.el" nil))

>> 1. When editing Processing code with C-c ' I get an error from
>>    processing-mode. Editing with C-c ' works just fine, but the error
>>    is annoying. It seems to me the error is caused by the fact that
>>    processing-mode refers to buffer-file-name, which is not valid in
>>    a temporary buffer. Any ideas on how to fix this inside org?
>>    (Wouldn't want to get involved with processing-mode if it can be
>>    avoided.)
>
> Why not?  It sounds like their code is causing the problem.

Ahem. After some greps I found out today that I had myself specified a
java hook which the processing hook inherited, and the reference to
buffer-file-name was there. Issue solved.

Jarmo

      reply	other threads:[~2015-03-07 18:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06 10:29 Babel questions for finalising Processing support Jarmo Hurri
2015-03-07 14:47 ` Aaron Ecay
2015-03-07 18:00   ` Jarmo Hurri [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ioecznzf.fsf@iki.fi \
    --to=jarmo.hurri@iki.fi \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).