[O] Converting table to properties

2012-06-06 Thread Vikas Rawal
I have a table under each of several headlines in an org file. Each
table has a row of column labels and a row of data. I would like to
convert the table into properties, with labels coming from first row
and values of properties coming from the second row.

How should I do this?

Vikas



Re: [O] Converting table to properties

2012-06-06 Thread Juan Pechiar
On Wed, Jun 06, 2012 at 05:55:52PM +0530, Vikas Rawal wrote:
> I have a table under each of several headlines in an org file. Each
> table has a row of column labels and a row of data. I would like to
> convert the table into properties, with labels coming from first row
> and values of properties coming from the second row.
>
> How should I do this?

Hi Vikas,

This is a quick hack on org-table-transpose-table-at-point to print
out a property list instead of a table.

#+begin_src elisp

(defun vikas-convert ()
  "table to props"
  (interactive)
  (let ((contents
 (apply #'mapcar* #'list
;; remove 'hline from list
   (delq nil (mapcar (lambda (x) (when (listp x) x))
   (org-table-to-lisp))
(delete-region (org-table-begin) (org-table-end))
(insert "  :PROPERTIES:\n")
(insert (mapconcat (lambda(x) (concat "  :" (first x) ": " (second
x) "\n" ))
   contents ""))
(insert "  :END:\n\n")))

#+end_src

This transforms:

| PROP1 | PROP2 | PROP3 |
| 1 | 2 | 3 |

into

  :PROPERTIES:
  :PROP1: 1
  :PROP2: 2
  :PROP3: 3
  :END:

Hope it helps.
.j.



Re: [O] [GSoC] org-merge-driver weekly update

2012-06-06 Thread Andrew Young
Hi Robert Horn,

On Mon, Jun 4, 2012 at 11:30 AM, Robert Horn  wrote:
> Another area that would be nice to address is taking advantage of the
> information in date-trees so assist with merging.  This is similar to
> the logic around keeping headlines in order.  With date trees there is a
> date and sometimes time tag to help.
>
> In addition to the occurrence order, there is also an ordering constraint on 
> date trees that can be used to determine the proper delta.  You can use the 
> date and time information in the headlines to determine the proper sequencing.
>
> For example, the delta/merger for two files of the form:
> File 1:
> * Year
> ** Year-Month
> *** Year-Month-Day
>  Y-M-D-Time1 stuff1 ...
>  Y-M-D-Time2 stuff2 ...
>  Y-M-D-Time4 stuff4 ...
>  Y-M-D-Time5 stuff5 ...
>  Y-M-D-Time9 stuff9 ...
> File 2:
> * Year
> ** Year-Month
> *** Year-Month-Day
>  Y-M-D-Time1 stuff1 ...
>  Y-M-D-Time2 stuff2 ...
>  Y-M-D-Time3 stuff3 ...
>  Y-M-D-Time6 stuff6 ...
>  Y-M-D-Time7 stuff7 ...
>
> Should be:
> * Year
> ** Year-Month
> *** Year-Month-Day
>  Y-M-D-Time1 stuff1 ...
>  Y-M-D-Time2 stuff2 ...
>  Y-M-D-Time3 stuff3 ...
>  Y-M-D-Time4 stuff4 ...
>  Y-M-D-Time5 stuff5 ...
>  Y-M-D-Time6 stuff6 ...
>  Y-M-D-Time7 stuff7 ...
>  Y-M-D-Time9 stuff9 ...
>
> This time aware merge logic will apply similarly to all levels of the date 
> tree.
>
> Date trees are recognizable by the combination of headlines in this
> format.  A date tree can occur anywhere in an org file, but it will
> begin with a level one headline of the form "* ", etc.
>
> R Horn
> rjh...@alum.mit.edu

Thank you for the suggestion!  The program should support date trees.

I wonder if date trees specifically should be aggressively resorted
during the merge (reordering more headings than necessary, without
regards to the in-file ordering).  It is currently my opinion that the
program should try to retain the original ordering as much as
possible, only sorting the minimum number of headings necessary when
merging has made the ordering ambiguous.

Sincerely,
Andrew Young



Re: [O] [GSoC] org-merge-driver weekly update

2012-06-06 Thread Carsten Dominik

On 6.6.2012, at 15:50, Andrew Young wrote:

> Hi Robert Horn,
> 
> On Mon, Jun 4, 2012 at 11:30 AM, Robert Horn  wrote:
>> Another area that would be nice to address is taking advantage of the
>> information in date-trees so assist with merging.  This is similar to
>> the logic around keeping headlines in order.  With date trees there is a
>> date and sometimes time tag to help.
>> 
>> In addition to the occurrence order, there is also an ordering constraint on 
>> date trees that can be used to determine the proper delta.  You can use the 
>> date and time information in the headlines to determine the proper 
>> sequencing.
>> 
>> For example, the delta/merger for two files of the form:
>>File 1:
>>* Year
>>** Year-Month
>>*** Year-Month-Day
>> Y-M-D-Time1 stuff1 ...
>> Y-M-D-Time2 stuff2 ...
>> Y-M-D-Time4 stuff4 ...
>> Y-M-D-Time5 stuff5 ...
>> Y-M-D-Time9 stuff9 ...
>>File 2:
>>* Year
>>** Year-Month
>>*** Year-Month-Day
>> Y-M-D-Time1 stuff1 ...
>> Y-M-D-Time2 stuff2 ...
>> Y-M-D-Time3 stuff3 ...
>> Y-M-D-Time6 stuff6 ...
>> Y-M-D-Time7 stuff7 ...
>> 
>>Should be:
>>* Year
>>** Year-Month
>>*** Year-Month-Day
>> Y-M-D-Time1 stuff1 ...
>> Y-M-D-Time2 stuff2 ...
>> Y-M-D-Time3 stuff3 ...
>> Y-M-D-Time4 stuff4 ...
>> Y-M-D-Time5 stuff5 ...
>> Y-M-D-Time6 stuff6 ...
>> Y-M-D-Time7 stuff7 ...
>> Y-M-D-Time9 stuff9 ...
>> 
>> This time aware merge logic will apply similarly to all levels of the date 
>> tree.
>> 
>> Date trees are recognizable by the combination of headlines in this
>> format.  A date tree can occur anywhere in an org file, but it will
>> begin with a level one headline of the form "* ", etc.
>> 
>> R Horn
>> rjh...@alum.mit.edu
> 
> Thank you for the suggestion!  The program should support date trees.
> 
> I wonder if date trees specifically should be aggressively resorted
> during the merge (reordering more headings than necessary, without
> regards to the in-file ordering).  It is currently my opinion that the
> program should try to retain the original ordering as much as
> possible, only sorting the minimum number of headings necessary when
> merging has made the ordering ambiguous.

As a general remark, if you implement things like aggressive resorting,
I think it would be good to have such features optional, in some
way configurable.  Turning off all bells would then do a simple stable
outline tree inserting like you have in your prototype.  Increasing
complexity can and should be implemented, but I would like them optional
for users (opt-out is OK).

Greetings

- Carsten

> 
> Sincerely,
> Andrew Young




Re: [O] [GSoC] org-merge-driver weekly update

2012-06-06 Thread Robert Horn
Carsten Dominik  writes:

> On 6.6.2012, at 15:50, Andrew Young wrote:
> As a general remark, if you implement things like aggressive resorting,
> I think it would be good to have such features optional, in some
> way configurable.  Turning off all bells would then do a simple stable
> outline tree inserting like you have in your prototype.  Increasing
> complexity can and should be implemented, but I would like them optional
> for users (opt-out is OK).
>

I agree.  I'm thinking about a problem that I routinely have.  I work on
multiple computers capturing notes into journals that are date-trees.  I
resynchronize these journals using git, and git is often confused about
what to do when it sees the same base tree with different additions from
the different computers.

In my usage there are never deletes, and I would expect that the order
of headlines in the original versions would be preserved as the order of
those headlines in the merged version.  I don't get out of order
headlines because the capture function manages the date tree for me.

If I had an improperly ordered input I would prefer to have the merger
fail and ask for manual help.  If it's out of order that means either
something went wrong with the capture function, or I manually did
something that I might want preserved.  For instance, I might archive
the 2010 notes into some other file, and replace them with a link to
that file.  I would want to preserve this.  (Actually the issue of how
to manage such archival is one that I haven't given much thought, since
disk space is cheap and it's easy to collapse the old stuff.)

Robert Horn



Re: [O] python/babel inline images

2012-06-06 Thread henry atting
I don't think its a path problem. The code itself works flawlessly. So
the workaround which I already have used is to link to the resulting
image. The only drawback with this solution is that after every
evaluation I have to remove the empty `'Results:' but the heck with
it, I can live with it happily till the end of my days.
However I find that some inconsistency lies therein. Before
python/matplotlib I used gnuplot with which babel had no problem of
this type.


Cheers,
henry

-- 
http://literaturlatenight.de




Re: [O] Difficulty of using Org mode

2012-06-06 Thread Memnon Anon
suvayu ali  writes:

> The way I went about it was to get an overview of the capabilities from
> Worg and start using only the features I needed (in my case note taking
> and export). As I became more familiar, I delved into other features
> (like agenda, babel) and customisation of the already familiar features
> (e.g. custom export hooks, personalised colour theme etc).

And this is exactly what orgmode.org tells you from the start:

,[ http://www.orgmode.org ]
| Simplicity
| At its core, Org mode is a simple outliner for note-taking and list
| management. You can learn the basics for using it in five minutes.
| This may be all you need, and Org mode will not impose more complex
| features on you. 
`

with a link to
 http://orgmode.org/worg/org-tutorials/orgtutorial_dto.html

There is also the compact guide, which is the first link on the
documentation page:
 http://orgmode.org/guide/index.html

I don't know how hard org is (or is not) for emacs users; I came to
emacs because of org and started from there :). My first post to this
list is from mid 2008 (... that long already?) and it is getting more
and more complex; I could pick up new features along the way.

If you are new to org and/or emacs: Take it easy :). I know it is
tempting to try everything at once, but don't get frustrated while doing
so. 

IMHO & FWIW
Memnon





[O] shorter way of #+HTML:

2012-06-06 Thread Enda
When I prepare an org file to convert into html, I have to have a lot
of

#+HTML: 

to break lines without a full full line space between them, should
there be or is there is shorter way to doing this?, like having a dot
on a line by itself for the html converter could mean a newline
(without a full line space) like:

Org mode
.
Emacs

would be converted to:


Org mode

Emacs



Best wishes,

Enda


[O] *print 'Hello world'* is not bold

2012-06-06 Thread Enda
*print 'Hello world'* is not bold.


Best wishes,

Enda


[O] emacs --batch without calling all the .el scripts

2012-06-06 Thread Enda
When I call:
emacs --batch --visit=index.org --funcall org-export-as-html-batch

all the .el scripts in /etc/emacs/site-start.d/ get called which takes
time, since all of these are unnecessary except 50org-mode.el, is
there is way to only load 50org-mode.el


Best wishes,

Enda


Re: [O] Updating info files

2012-06-06 Thread Memnon Anon
Mike Fitzgerald  writes:

> C-h i still brings up the old info files.
>
> files are there:
>
> org.pdf
> rg.texi
> rgcard.pdf
> rgcard.tex
> rgcard_letter.pdf
> rgguide.pdf
> rgguide.texi

Mhh, are these all files in the doc dir?

Info doesn't use pdf, here is mine for comparison:

/home/xxx/tmp/bin/org-mode/doc
  dir
  -rw-r--r--  1 xxx xxx6.8k 2011-02-02  Documentation_Standards.org
  -rw-r--r--  1 xxx xxx1.9k 05-23 11:54 Makefile
  -rw-r--r--  1 xxx xxx  852.6k 05-27 05:49 org
  -rw-r--r--  1 xxx xxx 110 05-27 05:49 org-version.inc
  -rw-r--r--  1 xxx xxx1.3M 05-27 05:49 org.html
  -rw-r--r--  1 xxx xxx1.6M 05-27 05:50 org.pdf
  -rw-r--r--  1 xxx xxx  686.4k 05-26 17:48 org.texi
  -rw-r--r--  1 xxx xxx   23.2k 05-25 16:47 orgcard.tex
  -rw-r--r--  1 xxx xxx   21.7k 12-17 12:02 orgcard.txt
  -rw-r--r--  1 xxx xxx  363.4k 05-27 05:50 orgguide.pdf
  -rw-r--r--  1 xxx xxx   97.4k 05-23 11:54 orgguide.texi
  -rw-r--r--  1 xxx xxx1.3k 04-15 21:31 pdflayout.sty
  -rw-r--r--  1 xxx xxx  278.6k 01-04 00:10 texinfo.tex

Files relevant for info: "dir" and "org"




[O] org-icalendar-alarm-time in org file as an #+OPTION

2012-06-06 Thread Enda
Is there is way to have to have org-icalendar-alarm-time in an org file as an 
#+OPTION?


Best wishes,

Enda


[O] org-mode html5 converter option

2012-06-06 Thread Enda
Is there a way to convert from org-mode to html5?


Best wishes,

Enda


[O] white (hide)stars in black background terminal

2012-06-06 Thread Enda
When I open org-mode with hidestars in a TTY terminal I cannot see the
stars, however when I open them in a terminal emulator inside GNOME,
the stars that are supposed to be hidden are white (on a black
background).

Best wishes,

Enda


Re: [O] python/babel inline images

2012-06-06 Thread Eric Schulte
"Mikhail Titov"  writes:

>> -Original Message-
>> From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode-
>> bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte
>> Sent: Tuesday, June 05, 2012 9:57 AM
>> To: henry atting
>> Cc: emacs-orgmode@gnu.org
>> Subject: Re: [O] python/babel inline images
>> 
>> I'm not python expert, but the code block should be run in your current
>> directory, e.g., the following outputs the current working path expected
>> for me.
>> 
>> #+begin_src sh
>>   pwd
>> #+end_src
>> 
>> If you want to explicitly pass the current directory to your code block
>> as an argument, you could try something like the following
>> 
>> #+begin_src python :var mydir=(file-name-directory (buffer-file-name))
>>   return mydir
>> #+end_src
>> 
>
> I've noticed some inconsistency between various languages in this aspect.
> For instance, ob-R starts session in proper working directory, while all
> looks like everything (?) else does not.
>
> Should not it be somewhat standardized? I think it make sense to always cd
> to org doc folder.
>

Most languages should and (at least those I use regularly) do run in the
directory of the containing Org-mode file.  Which languages do not?

Thanks,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] shorter way of #+HTML:

2012-06-06 Thread Bernt Hansen
Enda  writes:

> When I prepare an org file to convert into html, I have to have a lot
> of
>
> #+HTML: 
>
> to break lines without a full full line space between them, should
> there be or is there is shorter way to doing this?, like having a dot
> on a line by itself for the html converter could mean a newline
> (without a full line space) like:
>
> Org mode
> .
> Emacs
>
> would be converted to:
>
> 
> Org mode
> 
> Emacs
> 
>
> Best wishes,
>
> Enda

This is what CSS is for.  Define the spacing you want between paragraphs
and you don't need any additional markup.

Regards,
Bernt



[O] [babel] session initialization (was RE: python/babel inline images)

2012-06-06 Thread Mikhail Titov
> -Original Message-
> From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode-
> bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte
> Sent: Wednesday, June 06, 2012 12:20 AM
> To: Mikhail Titov
> Cc: emacs-orgmode@gnu.org; 'henry atting'
> Subject: Re: [O] python/babel inline images
> 
> "Mikhail Titov"  writes:
> 
> >> -Original Message-
> >> From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode-
> >> bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte
> >> Sent: Tuesday, June 05, 2012 9:57 AM
> >> To: henry atting
> >> Cc: emacs-orgmode@gnu.org
> >> Subject: Re: [O] python/babel inline images
> >>
> >> I'm not python expert, but the code block should be run in your current
> >> directory, e.g., the following outputs the current working path
expected
> >> for me.
> >>
> >> #+begin_src sh
> >>   pwd
> >> #+end_src
> >>
> >> If you want to explicitly pass the current directory to your code block
> >> as an argument, you could try something like the following
> >>
> >> #+begin_src python :var mydir=(file-name-directory (buffer-file-name))
> >>   return mydir
> >> #+end_src
> >>
> >
> > I've noticed some inconsistency between various languages in this
aspect.
> > For instance, ob-R starts session in proper working directory, while all
> > looks like everything (?) else does not.
> >
> > Should not it be somewhat standardized? I think it make sense to always
cd
> > to org doc folder.
> >
> 
> Most languages should and (at least those I use regularly) do run in the
> directory of the containing Org-mode file.  Which languages do not?

I'm working on ob-octave.el which does not. So I'll fix it in this case.
Which leads me to another question I was about to ask. How to comint
commands in org-babel-XXX-initiate-session as session is not assigned yet?
Right now I have something like the following in that function

  (comint-send-string
   (get-buffer-process (current-buffer))
   "set(0, 'defaultfigurevisible', 'off');\n")

I do it there as it does not make sense to call for each block. I was about
to write that ob-R does show stuff but I believe it was in earlier versions
of ob-R.el or something as I've checked and indeed nothing appears on screen
as code being wrapped in a device output block.

Also IIRC ob-sh does not change directory though I tried it on Windows with
cmd.exe . Worth mentioning that it tangles into dot sh instead of dot bat or
dot cmd on that platform. It misses platform specific

(defvar org-babel-tangle-lang-exts) 
(if (string-equal system-type "windows-nt") 
  (add-to-list 'org-babel-tangle-lang-exts '("sh" . "bat"))
)

P.S. I feel like I'm hijacking the thread

M.




Re: [O] shorter way of #+HTML:

2012-06-06 Thread Enda
I want nearly all paragraphs to have one line of spacing, the #+HTML:  
(no line of spacing) is just for once-off occasions.

Best wishes,

Enda




 From: Bernt Hansen 
To: Enda  
Cc: "emacs-orgmode@gnu.org"  
Sent: Wednesday, June 6, 2012 6:28 PM
Subject: Re: shorter way of #+HTML: 
 
Enda  writes:

> When I prepare an org file to convert into html, I have to have a lot
> of
>
> #+HTML: 
>
> to break lines without a full full line space between them, should
> there be or is there is shorter way to doing this?, like having a dot
> on a line by itself for the html converter could mean a newline
> (without a full line space) like:
>
> Org mode
> .
> Emacs
>
> would be converted to:
>
> 
> Org mode
> 
> Emacs
> 
>
> Best wishes,
>
> Enda

This is what CSS is for.  Define the spacing you want between paragraphs
and you don't need any additional markup.

Regards,
Bernt

Re: [O] *print 'Hello world'* is not bold

2012-06-06 Thread Bastien
Hi Enda,

Enda  writes:

> *print 'Hello world'* is not bold.

See `org-emphasis-regexp-components' and its docstring.

HTH,

-- 
 Bastien



Re: [O] shorter way of #+HTML:

2012-06-06 Thread Bastien
Hi Enda,

Enda  writes:

> When I prepare an org file to convert into html, I have to have a lot
> of
>
> #+HTML: 
>
> to break lines without a full full line space between them, should
> there be or is there is shorter way to doing this?

Nope, sorry.  But you can easily insert it repeartedly by using
Emacs internals (registers etc.)

Best,

-- 
 Bastien



Re: [O] emacs --batch without calling all the .el scripts

2012-06-06 Thread Bastien
Enda  writes:

> emacs --batch --visit=index.org --funcall org-export-as-html-batch
>
> all the .el scripts in /etc/emacs/site-start.d/ get called which
> takes
> time, since all of these are unnecessary except 50org-mode.el, is
> there is way to only load 50org-mode.el

Untested:

emacs -Q --batch --visit=index.org -l \
/etc/emacs/site-start.d/50org-mode.el \
--funcall org-export-as-html-batch

HTH,

-- 
 Bastien



Re: [O] white (hide)stars in black background terminal

2012-06-06 Thread Bastien
Hi Enda,

Enda  writes:

> When I open org-mode with hidestars in a TTY terminal I cannot see
> the
> stars, however when I open them in a terminal emulator inside GNOME,
> the stars that are supposed to be hidden are white (on a black
> background).

Please share elements of your configuration that are relevant to this
issue.  Do you experience the same with emacs -Q (no configuration)?

-- 
 Bastien



Re: [O] org-icalendar-alarm-time in org file as an #+OPTION

2012-06-06 Thread Bastien
Hi Enda,

Enda  writes:

> Is there is way to have to have org-icalendar-alarm-time in an org
> file as an #+OPTION?

What would do `org-icalendar-alarm-time'?

-- 
 Bastien



Re: [O] org-mode html5 converter option

2012-06-06 Thread Bastien
Enda  writes:

> Is there a way to convert from org-mode to html5?

Not yet.

-- 
 Bastien



[O] refiling sets tags

2012-06-06 Thread Samuel Wales
In latest git, refiling a region seems to set tags.  Since you don't
want that, you ^G.  Then you are left with a duplicate set of entries
in the target location.  It is intermittent and goes away when you
edebug or select a default location using ido.

Maybe this code is related:

 ;; We don't use ARG and JUST-ALIGN here these args are not
 ;; useful when looping over headlines
 `(org-set-tags)

Also note the ` .

Thanks.

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com



Re: [O] [babel] session initialization (was RE: python/babel inline images)

2012-06-06 Thread Eric Schulte
>> 
>> Most languages should and (at least those I use regularly) do run in the
>> directory of the containing Org-mode file.  Which languages do not?
>
> I'm working on ob-octave.el which does not. So I'll fix it in this
> case.

Great, thanks.

> 
> Which leads me to another question I was about to ask. How to comint
> commands in org-babel-XXX-initiate-session as session is not assigned
> yet?

I don't understand.

> Right now I have something like the following in that function
>
> (comint-send-string
>  (get-buffer-process (current-buffer))
>  "set(0, 'defaultfigurevisible', 'off');\n")
>
> I do it there as it does not make sense to call for each block. I was about
> to write that ob-R does show stuff but I believe it was in earlier versions
> of ob-R.el or something as I've checked and indeed nothing appears on screen
> as code being wrapped in a device output block.
>

I'm not aware of a way to run code on the start of a session.  I do see
how this could be a useful addition.

>
> Also IIRC ob-sh does not change directory though I tried it on Windows with
> cmd.exe.

Granted I only run on linux, but (on linux) ob-sh *does* run in the
directory of the containing Org-mode file.

> Worth mentioning that it tangles into dot sh instead of dot bat or dot
> cmd on that platform. It misses platform specific
>
> (defvar org-babel-tangle-lang-exts) 
> (if (string-equal system-type "windows-nt") 
>   (add-to-list 'org-babel-tangle-lang-exts '("sh" . "bat"))
> )
>

OK, could you convert the above into a patch which we could apply to
ob-sh?

>
> P.S. I feel like I'm hijacking the thread
>
> M.
>

I am certainly not the OP, but I don't mind, these varied topics all
seem important.

Cheers,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] org-icalendar-alarm-time in org file as an #+OPTION

2012-06-06 Thread Enda
http://orgmode.org/manual/iCalendar-export.html

In Org options, I can set org-icalendar-alarm-time to '1' and when I export the 
org file as an ical file, and then import the ical file into a calendar 
application, I get notified by the alarm of the calendar application one minute 
before the event (which was in the org file). Is there a way of setting 
org-icalendar-alarm-time to '1' locally instead of globally.


Best wishes,

Enda





 From: Bastien 
To: Enda  
Cc: "emacs-orgmode@gnu.org"  
Sent: Wednesday, June 6, 2012 7:30 PM
Subject: Re: org-icalendar-alarm-time in org file as an #+OPTION
 
Hi Enda,

Enda  writes:

> Is there is way to have to have org-icalendar-alarm-time in an org
> file as an #+OPTION?

What would do `org-icalendar-alarm-time'?

-- 
Bastien

Re: [O] python/babel inline images

2012-06-06 Thread Mikhail Titov
> -Original Message-
> From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode-
> bounces+mlt=gmx...@gnu.org] On Behalf Of henry atting
> Sent: Wednesday, June 06, 2012 10:19 AM
> To: emacs-orgmode@gnu.org
> Subject: Re: [O] python/babel inline images
> 
> I don't think its a path problem.

Indeed

#+begin_src python :results output
import os
print(os.getcwd())
#+end_src

Shows location of my org doc.

> The code itself works flawlessly. So
> the workaround which I already have used is to link to the resulting
> image. The only drawback with this solution is that after every
> evaluation I have to remove the empty `'Results:'

You can use :results silent

> but the heck with
> it, I can live with it happily till the end of my days.
> However I find that some inconsistency lies therein. Before
> python/matplotlib I used gnuplot with which babel had no problem of
> this type.

Try using

... :file exp_csv.svg
...
plot.savefig(file=sys.stdout)


#+begin_src python :results output :file zzz.xxx
import os, sys
print(os.getcwd(), file=sys.stdout)
#+end_src

#+RESULTS:
[[file:zzz.xxx]]


Meanwhile I've noticed that I can't return back from editing python code in
a sub-editing buffer. C-c ' does not work and M-x org-edit-src-exit says
"This is not a sub-editing buffer, something is wrong".





Re: [O] python/babel inline images

2012-06-06 Thread Eric Schulte
"Mikhail Titov"  writes:

>
> Meanwhile I've noticed that I can't return back from editing python code in
> a sub-editing buffer. C-c ' does not work and M-x org-edit-src-exit says
> "This is not a sub-editing buffer, something is wrong".
>

This works on my system, perhaps the problem is due to something in your
configuration.  Do you still notice this problem when launching emacs
with the -Q option.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



Re: [O] python/babel inline images

2012-06-06 Thread Mikhail Titov
> -Original Message-
> From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode-
> bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte
> Sent: Wednesday, June 06, 2012 2:25 PM
> To: Mikhail Titov
> Cc: emacs-orgmode@gnu.org; 'henry atting'
> Subject: Re: [O] python/babel inline images
> 
> > Meanwhile I've noticed that I can't return back from editing python code
in
> > a sub-editing buffer. C-c ' does not work and M-x org-edit-src-exit says
> > "This is not a sub-editing buffer, something is wrong".
> >
> 
> This works on my system, perhaps the problem is due to something in your
> configuration.  Do you still notice this problem when launching emacs
> with the -Q option.

Huh... -Q solves it. I'm loading CEDET early in dot emacs for matlab-emacs
(as per manual) and it does something nasty that ruins normal behavior of
C-c '. Bummer.

Outdated eieio 1.3 shadowed to meet minimum version 1.4
Outdated semantic 2.0 shadowed to meet minimum version 2.1
Outdated srecode 1.0 shadowed to meet minimum version 1.1
Outdated ede 1.0 shadowed to meet minimum version 1.1
Outdated speedbar 1.0 shadowed to meet minimum version 1.0.4
Setting up CEDET packages...done

M.




Re: [O] [babel] session initialization (was RE: python/babel inline images)

2012-06-06 Thread Mikhail Titov
> -Original Message-
> From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode-
> bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte
> Sent: Wednesday, June 06, 2012 2:02 PM
> To: Mikhail Titov
> Cc: emacs-orgmode@gnu.org; 'henry atting'; 'Eric Schulte'
> Subject: Re: [O] [babel] session initialization (was RE: python/babel
inline
> images)
> 
> > Right now I have something like the following in that function
> >
> >   (comint-send-string
> >(get-buffer-process (current-buffer))
> >"set(0, 'defaultfigurevisible', 'off');\n")
> >
> > I do it there as it does not make sense to call for each block. I was
about
> > to write that ob-R does show stuff but I believe it was in earlier
versions
> > of ob-R.el or something as I've checked and indeed nothing appears on
screen
> > as code being wrapped in a device output block.
> >
> 
> I'm not aware of a way to run code on the start of a session.  I do see
> how this could be a useful addition.

So the fragment above does look legitimate to you? I just add

(format "cd('%s');\n" (file-name-directory (buffer-file-name)))

and problem solved? Well... for sessions. I don't know if it is common to
use non-session based calculations...

> > Also IIRC ob-sh does not change directory though I tried it on Windows
with
> > cmd.exe.
> 
> Granted I only run on linux, but (on linux) ob-sh *does* run in the
> directory of the containing Org-mode file.
> 
> > Worth mentioning that it tangles into dot sh instead of dot bat or dot
> > cmd on that platform. It misses platform specific
> >
> > (defvar org-babel-tangle-lang-exts)
> > (if (string-equal system-type "windows-nt")
> >   (add-to-list 'org-babel-tangle-lang-exts '("sh" . "bat"))
> > )
> >
> 
> OK, could you convert the above into a patch which we could apply to
> ob-sh?

I think there should be more than that. I do sometimes use bash from msys on
Win32 so I'd expect sh as a tangled file name extension in this case. I
believe it can be accomplished as with matlab / octave by adding a new
language cmd that will reuse most of sh. I'll see what I can do.

M.





Re: [O] [babel] session initialization (was RE: python/babel inline images)

2012-06-06 Thread Mikhail Titov
> -Original Message-
> From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode-
> bounces+mlt=gmx...@gnu.org] On Behalf Of Mikhail Titov
> Sent: Wednesday, June 06, 2012 2:42 PM
> To: 'Eric Schulte'
> Cc: emacs-orgmode@gnu.org
> Subject: Re: [O] [babel] session initialization (was RE: python/babel
inline
> images)
> 
> > -Original Message-
> > From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode-
> > bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte
> > Sent: Wednesday, June 06, 2012 2:02 PM
> > To: Mikhail Titov
> > Cc: emacs-orgmode@gnu.org; 'henry atting'; 'Eric Schulte'
> > Subject: Re: [O] [babel] session initialization (was RE: python/babel
> inline
> > images)
> >
> > > Right now I have something like the following in that function
> > >
> > > (comint-send-string
> > >  (get-buffer-process (current-buffer))
> > >  "set(0, 'defaultfigurevisible', 'off');\n")
> > >
> > > I do it there as it does not make sense to call for each block. I was
> about
> > > to write that ob-R does show stuff but I believe it was in earlier
> versions
> > > of ob-R.el or something as I've checked and indeed nothing appears on
> screen
> > > as code being wrapped in a device output block.
> > >
> >
> > I'm not aware of a way to run code on the start of a session.  I do see
> > how this could be a useful addition.
> 
> So the fragment above does look legitimate to you? I just add
> 
> (format "cd('%s');\n" (file-name-directory (buffer-file-name)))
> 
> and problem solved? Well... for sessions. I don't know if it is common to
> use non-session based calculations...

How would I reliably refer to the org doc buffer from where everything was
called? The following works just fine in session initialization code for
Matlab but not for Octave

(file-name-directory (buffer-file-name (other-buffer)))

At this point, (current-buffer) refers to the one with inferior process.

M.




[O] Clocking in emits an error

2012-06-06 Thread Avery Chan
I have a plain list with checkboxes. I am trying to set a clock in time using
`C-c C-x C-i`. This emits this type of an error:

byte-code: Before first headline at position 30 in buffer TODO.org

Here is the text of my org file:

---START FILE---
- [ ] Clean upstairs windows
- [ ] Lunch with Taylor
---END FILE---

How do I get the clock to start timing?

I get a similar error when I use `C-c C-x e` to set a time estimate.

org-mode version: 7.8.09
emacs version: 24.0.92.1
MacOS X 10.7.4




[O] org-e-html: Including ATTR_HTML: title="hover text"

2012-06-06 Thread William Crandall
Hello Jambunathan and Nicolas,

If org-mode source text is:

--
A paragraph about
#+ATTR_HTML: title="Link hover text"
[[http://orgmode.org]]
exalting new emacs mode...
--


"M-x org-export h" generates:

--

A paragraph about
http://orgmode.org"; title="Link hover text">http://orgmode.org
exalting new emacs mode…

--

which is grand.


"M-x org-export-dispatch h" generates:

--

A paragraph about


http://orgmode.org";>http://orgmode.org
exalting new emacs mode…

--

which is less grand.


I see two needed fixes, reading
http://orgmode.org/org.html#Links-in-HTML-export

1. A new  should not be inserted before
   lines starting #+ATTR_HTML.

2. The title attribute needs to go into the  link.


Thanks again!

-BC

Org-mode: 7.8.11 (release_7.8.11-52-g451191)
Emacs: 24.1.50.1
Windows 7



Re: [O] Clocking in emits an error

2012-06-06 Thread Nick Dokos
Avery Chan  wrote:

> I have a plain list with checkboxes. I am trying to set a clock in time using
> `C-c C-x C-i`. This emits this type of an error:
> 
> byte-code: Before first headline at position 30 in buffer TODO.org
> 
> Here is the text of my org file:
> 
> ---START FILE---
> - [ ] Clean upstairs windows
> - [ ] Lunch with Taylor
> ---END FILE---
> 
> How do I get the clock to start timing?
> 
> I get a similar error when I use `C-c C-x e` to set a time estimate.
> 
> org-mode version: 7.8.09
> emacs version: 24.0.92.1
> MacOS X 10.7.4
> 
> 

Does it go away if you add a headline?

---START FILE---
* Tasks for clocking
- [ ] Clean upstairs windows
- [ ] Lunch with Taylor
---END FILE---

Nick



Re: [O] Clocking in emits an error

2012-06-06 Thread Avery Chan
It /does/ go away if I add the headline. So I think you're saying:

1. Plain list checkbox items cannot have a time-estimate associated them.
2. Plain list checkbox items cannot track time.
3. Only headlines/TODO headlines can have these features.

I suppose that a TODO headline is effectively a checkbox; it would be nice, 
though, to be able to time separate checkboxes (though I suspect that 
responsibility would lay upon me to edit the appropriate org-mode file ).

Thanks for the clarification Nick.

Avery 

On Thursday, June 7, 2012 at 10:14 AM, Nick Dokos wrote:

> Avery Chan mailto:avery+gm...@ootbdev.com)> wrote:
> 
> > I have a plain list with checkboxes. I am trying to set a clock in time 
> > using
> > `C-c C-x C-i`. This emits this type of an error:
> > 
> > byte-code: Before first headline at position 30 in buffer TODO.org 
> > (http://TODO.org)
> > 
> > Here is the text of my org file:
> > 
> > ---START FILE---
> > - [ ] Clean upstairs windows
> > - [ ] Lunch with Taylor
> > ---END FILE---
> > 
> > How do I get the clock to start timing?
> > 
> > I get a similar error when I use `C-c C-x e` to set a time estimate.
> > 
> > org-mode version: 7.8.09
> > emacs version: 24.0.92.1
> > MacOS X 10.7.4
> > 
> 
> 
> Does it go away if you add a headline?
> 
> ---START FILE---
> * Tasks for clocking
> - [ ] Clean upstairs windows
> - [ ] Lunch with Taylor
> ---END FILE---
> 
> Nick 



Re: [O] org-e-html: Including ATTR_HTML: title="hover text"

2012-06-06 Thread William Crandall
Also, any chance of getting (parentheses) around a link
WITH a title, but without ( extra spaces )?


Org input:

--
A paragraph about a new mode (
#+ATTR_HTML: title="Link hover text"
[[./orgmode][org-mode]]
) that is really cool...
--


M-x org-export h, generates:

--
A paragraph about a new mode (
org-mode
) that is really cool…

--

which adds the title just fine,
but it renders: ( org-mode )
 ^^
* Putting the opening parentheses at the start of
  the #+ATTR_HTML line kills it.

* Putting the closing parentheses at the end of
  the link line:  ]])  kills the title attribute.



It would be great, though perhaps tricky, for
org-e-html to be able to generate a titled link,
inside parentheses, WITHOUT extra spaces.

But that may be a bridge too far.

Thanks for giving it a try!

-BC

Org-mode: 7.8.11 (release_7.8.11-52-g451191)
Emacs: 24.1.50.1
Windows 7



On Wed, Jun 6, 2012 at 7:08 PM, William Crandall  wrote:
> Hello Jambunathan and Nicolas,
>
> If org-mode source text is:
>
> --
> A paragraph about
> #+ATTR_HTML: title="Link hover text"
> [[http://orgmode.org]]
> exalting new emacs mode...
> --
>



Re: [O] Embed images in formats best suited for HTML and LaTeX export and inline viewing

2012-06-06 Thread Avdi Grimm
I'm interested in this as well. At present I plan on handling it externally
to org-mode with some preprocessing before final org-export; but it would
be cool to have it be a built-in feature. Obviously it can be accomplished
manually with #+LaTeX: and #+HTML: sections, but some syntax sugar for it
would be great.

On Wed, May 30, 2012 at 9:26 AM, Brett Viren  wrote:

> Hi,
>
> How can I tell org-mode to use different file formats for an image for
> different purposes?
>
> What I really want is a scalable format to embed "line art" type images
> (plots) into org-mode documents so that they can display inline and in
> both HTML and LaTeX exports.  SVG seems good for the first two but LaTeX
> doesn't accept it.  Likewise, LaTeX wants PDF but inline and HTML export
> do not.
>
> Anyway to eat my cake?
>
> Thanks,
> -Brett.
>


[O] JavaScript and babel

2012-06-06 Thread Alan Schmitt
Hello,

I'm writing a presentation about JavaScript and I was trying to get some code 
to run. Unfortunately whatever I try, I get "undefined" as the results, as in 
the following:

#+begin_src js
1;
#+end_src

#+RESULTS:
: undefined

Could someone give an example of the syntax to use?

Thanks a lot,

Alan


Re: [O] JavaScript and babel

2012-06-06 Thread Alan Schmitt
On 7 juin 2012, at 07:25, Alan Schmitt wrote:

> Hello,
> 
> I'm writing a presentation about JavaScript and I was trying to get some code 
> to run. Unfortunately whatever I try, I get "undefined" as the results, as in 
> the following:
> 
> #+begin_src js
> 1;
> #+end_src
> 
> #+RESULTS:
> : undefined
> 
> Could someone give an example of the syntax to use?

I found out I need to use "console.log" to get information out.

Alan