Re: [O] Graphic files displayed in buffer?

2015-09-15 Thread Rasmus
Hello,

> OK, so I made the file self-contained by transferring to it all the code
> it uses in my library of Babel.

At least that's nice in itself...  (I now keep common config data in a git
submodule that I clone and load at export time with Make).

> Then, I opened with emacs -q, answered "yes" to all the questions about
> running code, and when that was done discovered that the images aren't
> displayed, which is what I want!

OK.

> When I open the same file in my usual emacs, the images are displayed
> inline.

Damn.

> So, it must be my configuration, right?

It would seem so.  Unless if you perhaps did not load your org-git version
in the "emacs -q" setup.  But at least on my system the recent Org is
loaded with "-q" (I keep org in the system-wide site-lisp).

> I use Eric Schulte's starter kit, so my configuration is spread out over
> several *.el files in two directories.  When I grep for "inline" or
> "overlay" in *.el I get no hits.  But grepping for "image" gets this:


> custom.el: '(emms-mode-line-icon-image-cache
> custom.el:(image :type xpm :ascent center :data "/* XPM */
> custom.el: '(gnus-mode-line-image-cache
> custom.el:(image :type xpm :ascent center :data "/* XPM */
> custom.el: '(mu4e-view-show-images nil)

This should be completely orthogonal.

> td.el:(setq mu4e-view-show-images t)
> td.el:(when (fboundp 'imagemagick-register-types)
> td.el:  (imagemagick-register-types))
> td.el::base-directory 
> "/Users/dk/org/tsdye/employees/software/images/"

Same...

> None of which looks too suspicious to me, though some of it is old and
> might be pruned away.  Does anything look suspicious to you?

Nope.

> Can you suggest some other terms I might grep?  I'm keen to get to the
> bottom of this.

Hmm, I'm thinking out loud here, but perhaps you could try deploy
something like the following to detect *where* org-display-inline-images
is called.

#+BEGIN_SRC emacs-lisp
  (defun a-pix-is-worth-a-1000-words (  args)
(with-temp-file "/tmp/backtrace.txt"
  (goto-char (point-max))
  (insert (format-time-string " %s \n"))
  (let ((standard-output (current-buffer))) (backtrace

  (add-function :before (symbol-function 'org-display-inline-images)
#'a-pix-is-worth-a-1000-words)
#+END_SRC

Rasmus

-- 
m-mm-mmm- bacon!




Re: [O] remote plot with local output?

2015-09-15 Thread Benda Xu
Hi Charles,

"Charles C. Berry"  writes:

> Untested, but try this :
>
> #+name: localize
> #+BEGIN_SRC emacs-lisp :var file="" srcinfo=(org-babel-get-src-block-info)
>(let* ((dir (cdr (assoc :dir (nth 2 srcinfo
>   (rfile (concat (file-name-as-directory dir) file))
>   (lfile (car (last (split-string rfile ":")
>  (copy-file rfile lfile 1)
>  lfile)
> #+END_SRC
>
> then use
>
> #+HEADER: :post localize(*this*)
>
> in your python src block.

It successfully extracts the :dir field.  Thanks!

Cheers,
Benda



[O] Displaying SVG inline in org-mode

2015-09-15 Thread Eduardo Mercovich
Dear all. 

Sorry if this is too simple, but I'm a newbie in the Emacs world. 

I have a few png inline images which are displayed fine in Org. 

OTOH I have some svg icons that are shown perfectly in their own
buffers, but when included inline -just like the pngs- are shown only as
a reference like "/home/edumerco/whatever.svg" instead of the
icon. iimage mode is on.

I searched the web but it seems I can't find the right keywords. Can
anyone point me to some references about how to show svg images inline?

Thank you very much... :)


-- 
eduardo mercovich 

 Donde se cruzan tus talentos 
 con las necesidades del mundo, 
 ahí está tu vocación. (Aristóteles)



Re: [O] Displaying SVG inline in org-mode

2015-09-15 Thread Rasmus
Hi Eduardo,

Eduardo Mercovich  writes:

> OTOH I have some svg icons that are shown perfectly in their own
> buffers, but when included inline -just like the pngs- are shown only as
> a reference like "/home/edumerco/whatever.svg" instead of the
> icon. iimage mode is on.

It works for me.

This is my test file


 
[[file:/usr/share/icons/Adwaita/scalable/actions/action-unavailable-symbolic.svg]]

I then do M-x org-toggle-inline-images RET (AKA C-c C-x C-v).  It should
show.

iimage-mode seems to a general Emacs mode.  It also works for me, but the
display is like

 "file:THE-ICON"

Make sure that you have (0) imagemagick; (1) Emacs configured to support
imagemagick.  This sentence is pure speculation; IOW I have not checked
correctness of this last sentence.

Hope it helps,
Rasmus

-- 
Got mashed potatoes. Ain't got no T-Bone. No T-Bone




Re: [O] babel stopping export after updating to org 8.3

2015-09-15 Thread Aviv
Robert Klein  roklein.de> writes:

> 
> Hi
> 
> Aviv wrote:
> 
> > Hi! 
> > 
> > I just upgraded to org 8.3 and am stuck with an export issue.
> > 
> > When I try to export a file with just "#+begin_src" and " "#+end_src" as 
> > the 
> > only lines, I get the error 
> > "user-error: No language for src block: (unnamed)". 
> > 
> > It seems like it is calling org-babel-exp-process-buffer -- but there is no 
> > reason that I can tell that is being called.  (org-export-babel-evaluate is 
> > definitely nil, thought other testing seems to indicate that shouldn't even 
> > matter)
> > 
> > I've tried this in a clean "emacs -q" emacs and there is no issue -- but I 
> > still have the issue with an empty init.el! 
> > 
> > Any idea what could be wrong?  Thanks!
> > 
> > 
> 
> You need to specify a language, e.g.
> 
> #+begin_src foo
> #+end_src
> 
> You can use any string for language.  However, if you export to latex
> you want to either
> 

Sorry, I should have clarified. I know that the error is a result of not 
specifying a language. But it wasn't necessary to specify one before, and it 
seems like it's better for it not to actually be required now either, unless 
I'm missing something -- should I also specify "pseudocode"? 

Also, if that was correct behavior, it should be described as a breaking 
change from 8.2 to 8.3, and it's not at http://orgmode.org/Changes.html .

--

So, I just checked the manual and it seems like "#+begin_src" does (now?) 
require a language block, but given that up until now this sort of export did 
not cause errors, it seems odd to require that all the sudden and break all 
exports that depend on it without alerting users. 

That said, I figured out the distinction between "emacs -q" and just using an
empty init.el file. It turns out that "-q" actually loads org version 8.2.10!
(while an empty init.el load 8.3.1) Though I'm not sure why that is either...




Re: [O] Bug: org-toggle-latex-fragment fails, example included [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/oub/.emacs.d/elpa/org-20150907/)]

2015-09-15 Thread Uwe Brauer
> "Charles" == Charles C Berry  writes:

> On Mon, 14 Sep 2015, Uwe Brauer wrote:
>> 
>> Hello
>> 
>> For the following example,
>> 
>> $$w∈ {C([0,T];H_{s,\delta} : \|w(0,\cdot )\|_{H_{s,\delta}} \leq  M_0,   
>> w(t,x)\leq 0}$$
>> 

> $$w\in {C([0,T];H_{s,\delta} : \|w(0,\cdot )\|_{H_{s,\delta}} \leq  M_0,   
> w(t,x)\leq 0}$$

You are right, the evil ∈! Since I have started to use prettify-symbol
mode it is difficult to distinguish two situations:

-   prettify-symbols, using overlays, *displays*  \in by  ∈

-  but also \in can be *replaced* by the UTF8  ∈


After replacing the UTF8 by its latex constructions everything works
fine.

Sorry

Uwe 




[O] Jekyll and Pygments

2015-09-15 Thread William Denton
Is there anyone on the list who uses Jekyll (the Ruby-based static site 
generator [1]) and has a way of writing in Org that works with the syntax 
highlighting done with Pygments [2]?


Bill

[1] http://jekyllrb.com/
[2] http://jekyllrb.com/docs/templates/

--
William Denton ↔  Toronto, Canada ↔  https://www.miskatonic.org/

Re: [O] Scheme code block gives false error message

2015-09-15 Thread Lawrence Bottorff
Ach, disregard that last bleating. Got it changed, and yes, it works -- for
both guile and chicken. Thanks a ton, ND.

But, yes, if there's a cool emacs way to take your diff and apply it I'd
like to know. . .

LB

On Tue, Sep 15, 2015 at 5:25 PM, Lawrence Bottorff 
wrote:

> . . . quick question, Nick (et al): how do I (enlightened beginner) apply
> the above patch? I'm using latest ELPA from org-mode repo.
>
> LB
>
>
>


Re: [O] Scheme code block gives false error message

2015-09-15 Thread Nick Dokos
Lawrence Bottorff  writes:

> . . . quick question, Nick (et al): how do I (enlightened beginner) apply the 
> above patch? I'm using
> latest ELPA from org-mode repo.
>

Save the patch in a file (say "ob-scheme.patch") in the top level
directory of your org-mode tree (the one that includes the lisp/
subdirectory), cd to that directory and (assuming you have the "patch"
executable on your system), say

 patch -p 1 < ob-scheme.patch

Alternatively, just edit .../lisp/ob-scheme.el, find the line that says

 (read result)

(line 175 in my version) and replace the "(read result)" with just
"result" - leave the rest of the parens alone.

Nick





Re: [O] remote plot with local output?

2015-09-15 Thread Benda Xu
Hi Suvayu,

Suvayu Ali  writes:

> Maybe, you could do all that in your python source block?  You could use
> the :file header to specify where the plot gets copied to on the local
> filesystem.
>
> WDYT?

I did think of putting the logic into python source block.  As I will
also have R block like this, having a language-neutral solution, like
:post, better suits.

BTW, how can one extract the string specified by :file inside a python
code block?

Benda



Re: [O] Bug: org-toggle-latex-fragment fails, example included [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/oub/.emacs.d/elpa/org-20150907/)]

2015-09-15 Thread Eric S Fraga
On Tuesday, 15 Sep 2015 at 09:50, Uwe Brauer wrote:

[...]

> You are right, the evil ∈! Since I have started to use prettify-symbol
> mode it is difficult to distinguish two situations:
>
> -   prettify-symbols, using overlays, *displays*  \in by  ∈
>
> -  but also \in can be *replaced* by the UTF8  ∈

I run into this problem quite frequently.  I often write with the tex
input method and later forget that I did so and ended up with UTF8
characters.

I wonder how difficult it would be to filter UTF8 characters that LaTeX
doesn't understand on export, e.g. converting ∈ to \in, maybe even using
the same org-entities table?  I'm sure a filter is straightforward in
emacs lisp, although beyond my capabilities unfortunately.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3.1-234-g8c85c9



Re: [O] remote plot with local output?

2015-09-15 Thread Benda Xu
Hi Charles,

"Charles C. Berry"  writes:

> Look at the :post header arg
>
>   (info "(org) post")
>
> You write a src block that extracts the remote file name from *this*,
> creates a local file name from it, copies the remote file to the local
> host, then substitutes the local file name in *this* and uses it as
> the return value.
>
> Use the name of that src block as the argument to :post

Thanks for your hint.  I come up with the following example:

   #+NAME: line
   | 1 |
   | 2 |
   | 3 |

   #+name: localize
   #+BEGIN_SRC emacs-lisp :var file="" dir=""
 (let ((rfile (concat (file-name-as-directory dir) file)))
   (let ((lfile (car (last (split-string rfile ":")
 (copy-file rfile lfile 1)
 lfile))
   #+END_SRC
   
   #+HEADER: :post localize(*this*, "/ipmuap02:/tmp")
   #+BEGIN_SRC python :results file :var dt=line :dir /ipmuap02:/tmp
 from matplotlib import pylab as plt
 plt.plot(dt)
 plt.savefig("line.png")
 return "line.png"
   #+END_SRC

   #+RESULTS:
   [[file:/tmp/line.png]]

*this* only returns the resulting file name, without :dir.  I have to
set the same remote directory again in the :post call.  Is there a
smarter way to achieve it without duplication?

Cheers,
Benda



Re: [O] babel stopping export after updating to org 8.3

2015-09-15 Thread Robert Klein
Hi

Aviv wrote:
> Robert Klein  roklein.de> writes:
> 
>>
>> Hi
>>
>> Aviv wrote:
>>
>>> Hi! 
>>>
>>> I just upgraded to org 8.3 and am stuck with an export issue.
>>>
>>> When I try to export a file with just "#+begin_src" and " "#+end_src" as 
>>> the 
>>> only lines, I get the error 
>>> "user-error: No language for src block: (unnamed)". 
>>>
>>> It seems like it is calling org-babel-exp-process-buffer -- but there is no 
>>> reason that I can tell that is being called.  (org-export-babel-evaluate is 
>>> definitely nil, thought other testing seems to indicate that shouldn't even 
>>> matter)
>>>
>>> I've tried this in a clean "emacs -q" emacs and there is no issue -- but I 
>>> still have the issue with an empty init.el! 
>>>
>>> Any idea what could be wrong?  Thanks!
>>>
>>>
>>
>> You need to specify a language, e.g.
>>
>> #+begin_src foo
>> #+end_src
>>
>> You can use any string for language.  However, if you export to latex
>> you want to either
>>
> 
> Sorry, I should have clarified. I know that the error is a result of not 
> specifying a language. But it wasn't necessary to specify one before, and it 
> seems like it's better for it not to actually be required now either, unless 
> I'm missing something -- should I also specify "pseudocode"? 
> 
> Also, if that was correct behavior, it should be described as a breaking 
> change from 8.2 to 8.3, and it's not at http://orgmode.org/Changes.html .

For me org version 7.9.3f (came with emacs 24.3) a source block without
language also fails with °Source block missing language specification"
as soon as the source block isn't empty -- on 8.3.1 it also fails on
empty source blocks, too.

Afaik only begin_example and end_example don't need a language
specification.

Note: I get fooled by the language specification regularly; either I
forget to specify the language on the begin_src line (where I think it
is Ok to get an error -- I might want to have syntax highlighting or
even get the code executed)  or I put the language on the end_src line,
too, which imho should be ignored by the exporter :)



> 
> --
> 
> So, I just checked the manual and it seems like "#+begin_src" does (now?) 
> require a language block, but given that up until now this sort of export did 
> not cause errors, it seems odd to require that all the sudden and break all 
> exports that depend on it without alerting users. 
> 
> That said, I figured out the distinction between "emacs -q" and just using an
> empty init.el file. It turns out that "-q" actually loads org version 8.2.10!
> (while an empty init.el load 8.3.1) Though I'm not sure why that is either...

Do you have a ~/.emacs or ~/_emacs.el file?  See
http://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html#Find-Init
and
http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html
for the details of emacs initialization.

Best regards
Robert



Re: [O] remote plot with local output?

2015-09-15 Thread Charles C. Berry

On Tue, 15 Sep 2015, Benda Xu wrote:


Hi Charles,

"Charles C. Berry"  writes:


Look at the :post header arg

(info "(org) post")

You write a src block that extracts the remote file name from *this*,
creates a local file name from it, copies the remote file to the local
host, then substitutes the local file name in *this* and uses it as
the return value.

Use the name of that src block as the argument to :post


Thanks for your hint.  I come up with the following example:

  #+NAME: line
  | 1 |
  | 2 |
  | 3 |

  #+name: localize
  #+BEGIN_SRC emacs-lisp :var file="" dir=""
(let ((rfile (concat (file-name-as-directory dir) file)))
  (let ((lfile (car (last (split-string rfile ":")
(copy-file rfile lfile 1)
lfile))
  #+END_SRC

  #+HEADER: :post localize(*this*, "/ipmuap02:/tmp")
  #+BEGIN_SRC python :results file :var dt=line :dir /ipmuap02:/tmp
from matplotlib import pylab as plt
plt.plot(dt)
plt.savefig("line.png")
return "line.png"
  #+END_SRC

  #+RESULTS:
  [[file:/tmp/line.png]]

*this* only returns the resulting file name, without :dir.  I have to
set the same remote directory again in the :post call.  Is there a
smarter way to achieve it without duplication?




Untested, but try this :

#+name: localize
#+BEGIN_SRC emacs-lisp :var file="" srcinfo=(org-babel-get-src-block-info)
  (let* ((dir (cdr (assoc :dir (nth 2 srcinfo
 (rfile (concat (file-name-as-directory dir) file))
 (lfile (car (last (split-string rfile ":")
(copy-file rfile lfile 1)
lfile)
#+END_SRC

then use

#+HEADER: :post localize(*this*)

in your python src block.

HTH,

Chuck



Re: [O] HTML export doesn't work when #+TITLE: is added

2015-09-15 Thread Lee Hinman

Lee Hinman writes:

> Hi Org-ML,
>
> I'm trying to resolve an issue similar to the one here:
> http://lists.gnu.org/archive/html/emacs-orgmode/2015-08/msg01195.html
>
> Where I cannot export a file with a #+TITLE in it with the latest
> org-mode release.

To follow-up on this, this was due to having in my init.el:

(setq package-enable-at-startup nil)

Which meant that packages were not initialized at the beginning of my
configuration, only at the end. Removing this line has fixed my issue.

-- 
;; Lee



Re: [O] Merge branch 'maint'

2015-09-15 Thread Nicolas Richard
Oleh Krehel  writes:
> Now, please check my facts again. Is it true that Emacs doesn't have
> maint and has instead a bunch of hanging branches for each release that
> aren't meant to have master merged into them on release?

In emacs, the current emacs24 branch will never be used for a release
unless there is a serious concern with emacs-24.5 that needs a
emacs-24.6 release. So it sees no commits, except for the few commits
that "really should go into 24.6 if it is ever released".

Before 24.5 was released, emacs-24 had more commits, and was regularly
merged backinto master.

> If so, what
> exactly is the advantage in applying a patch to a stable branch and then
> merging it into master, instead of applying to patch to master and
> cherry-picking it to the stable branch?

We don't want to create to distinct commits for a given change, because
they will not be related in the git sense (the « DAG ») and it will be
more difficult to e.g. list every branch that has a given change.

> I'm not saying that I'm a Git expert or anything, far from it. But I
> observe the Git history of Emacs and Org regularly, and both models seem
> to be working fine for the users, release-wise. But the master branch of
> Emacs looks a lot better than the master branch of Org, and I don't
> understand the trade-off that Org's model offers to compensate for that
> lack of prettiness.

IIUC Org has a similar model, except that maint is merged far more often
into master (basically after every commit to maint). Probably this is
done so that `master branch users' don't need to wait before seeing the
bugfixes that go to maint.

-- 
Nicolas



Re: [O] Scheme code block gives false error message

2015-09-15 Thread Lawrence Bottorff
. . . quick question, Nick (et al): how do I (enlightened beginner) apply
the above patch? I'm using latest ELPA from org-mode repo.

LB


Re: [O] Scheme code block gives false error message

2015-09-15 Thread Lawrence Bottorff
I've tried the Moebius workaround (see above). It seems to work, and

#+begin_src scheme
. . .

seems to call my MIT scheme and do results just fine. But it ignores the
idea of multiple sessions, which the geiser-based ob-scheme did so well and
just has one MIT scheme "session." However it does not start a normal
scheme REPL, rather, a "scratch"-like buffer that, in fact, seems to have
MIT scheme listening to it. That is, I can type in

(define (me x)
  (* x x x x))

and with C-x C-e everything is working, just like scratch and elisp do.

Will try to use your patch and get back to you

On Tue, Sep 15, 2015 at 12:48 AM, Nick Dokos  wrote:

> Nick Dokos  writes:
>
> > Nick Dokos  writes:
> >
> >> N.B. this is with guile: I have not tried chicken, MIT Scheme or any
> >> other scheme implementation.
> >>
> >
> > A comment on SO says that geiser (which is used by ob-scheme)
> > only supports guile and racket, so until that changes, chicken or MIT
> > Scheme won't work:
> >
> >
> http://stackoverflow.com/questions/26578152/use-mit-scheme-instead-of-guile-for-org-mode-code-block-evaluation
>
> Eh, I should have checked the geiser site: it says
>
>
> Racket 6.0 or better
> Guile 2.0.9 or better
> Chicken 4.8.0 or better
>
> are supported and there is work afoot to support scsh - no mention of
> MIT Scheme afaict.
>
> --
> Nick
>
>
>


Re: [O] Graphic files displayed in buffer?

2015-09-15 Thread Rasmus
Hi Tom,

> Thanks for looking into this.  Your file works here, too.
>
> I found that loading my file somehow sets this variable:
>
> org-inline-image-overlays is a variable defined in `org.el'.

This variable is only set from org-inline-image functions in org.el (I
didn't check contrib).  So your source block must directly or indirectly
be calling one of these functions.

Does it happen when you use emacs -q?

Rasmus

-- 
Need more coffee. . .



Re: [O] Jekyll and Pygments

2015-09-15 Thread Marcel van der Boom

> [William:] > Is there anyone on the list who uses Jekyll (the Ruby-based 
> static site 
> generator [1]) and has a way of writing in Org that works with the syntax 
> highlighting done with Pygments [2]?
> 

I wrote a little blog [1] about it earlier this year. Perhaps that will
be helpful to you.

marcel

 [1] https://mrblog.nl/2015/03/22/completing-orgmode-based-jekyll.html


-- 
Marcel van der Boom → mar...@hsdev.com
  +31·168·468·824
  xmpp:mar...@hsdev.com | http://telegram.me/marcel
  http://hsdev.com
 



Re: [O] Graphic files displayed in buffer?

2015-09-15 Thread Thomas S . Dye
Hi Rasmus,

Rasmus  writes:

> Hi Tom,
>
>> Thanks for looking into this.  Your file works here, too.
>>
>> I found that loading my file somehow sets this variable:
>>
>> org-inline-image-overlays is a variable defined in `org.el'.
>
> This variable is only set from org-inline-image functions in org.el (I
> didn't check contrib).  So your source block must directly or indirectly
> be calling one of these functions.
>
> Does it happen when you use emacs -q?

OK, so I made the file self-contained by transferring to it all the code
it uses in my library of Babel.  Then, I opened with emacs -q, answered
"yes" to all the questions about running code, and when that was done
discovered that the images aren't displayed, which is what I want!

When I open the same file in my usual emacs, the images are displayed
inline.

So, it must be my configuration, right?

I use Eric Schulte's starter kit, so my configuration is spread out over
several *.el files in two directories.  When I grep for "inline" or
"overlay" in *.el I get no hits.  But grepping for "image" gets this:

custom.el: '(emms-mode-line-icon-image-cache
custom.el:(image :type xpm :ascent center :data "/* XPM */
custom.el: '(gnus-mode-line-image-cache
custom.el:(image :type xpm :ascent center :data "/* XPM */
custom.el: '(mu4e-view-show-images nil)
td.el:(setq mu4e-view-show-images t)
td.el:(when (fboundp 'imagemagick-register-types)
td.el:  (imagemagick-register-types))
td.el::base-directory 
"/Users/dk/org/tsdye/employees/software/images/"

None of which looks too suspicious to me, though some of it is old and
might be pruned away.  Does anything look suspicious to you?

Can you suggest some other terms I might grep?  I'm keen to get to the
bottom of this.

Thanks for your help.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com