Re: [O] if we operate on a subtree, perhaps we could adjust levels

2014-06-08 Thread Achim Gratz
Samuel Wales writes:
> you will notice that the decrypted subtree is actually at a higher
> level than its parent.  this is a violation of org structure.
>
> in consequence, it can silently swallow the entire rest of the file.
>
> this is not desired.
>
> is there a way to fix it?

There's two ways I can think of:

1. Record the subtree level in a property before doing the encryption
and compare that to the level after decryption.  If there's no match,
then promote or demote as appropriate.

2. Demote the whole subtree to toplevel before encryption and promote
into the correct level on decryption, (much in the same way that
includes are handled).


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




Re: [O] (require 'org-publish) causes downgrade in org-version

2014-06-08 Thread Achim Gratz
psycho_punch writes:
> I have just upgraded org-mode to the latest available in ELPA.
> According to the official documentation, the installation has to be
> done in fresh emacs session where no org-related scripts/files have
> been loaded. The installation is successful, and org-version reports
> that I have updated to 8.2.6 (from 7.9.3f). However, as soon as I put
> back my old org-related scripts, and reload emacs, I'd get 7.9.3f when
> I run org-version. To track what's causing it I retrace my steps by
> adding my org-related scripts one by one. I found out that when I add
> back (require 'org-publish), the version downgrades to the built-in
> one. I don't know why this is happening.

You need to replace this with (require 'ox-publish).  As to why this is
happening, you're sending Emacs down the wrong rabbit hole to search for
Org and the autoload stuff will do the rest.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves




[O] babel setup

2014-06-08 Thread Shiyuan
Hi all,
  I am using Emacs 24.3.9 + org-mode 8.2.6(from ELPA)
  I followed this instruction
http://orgmode.org/worg/org-contrib/babel/languages.html#configure

and added the following to my .emacs file.

(org-babel-do-load-languages
  'org-babel-load-languages
  '((python . t)
(emacs-lisp . t)))

After that, org-mode mysteriously switched back to the old version 7.9.
 Another problem is that export command C-c C-e no longer works and
generates error: Symbol's function definition is void: org-defvaralias. Is
there any step I missed? Thanks.

Shiyuan


Re: [O] if we operate on a subtree, perhaps we could adjust levels

2014-06-08 Thread Samuel Wales
hi bastien,

On 4/17/14, Bastien  wrote:
> Then I didn't understand what you suggested.  Can you restate
> it again?  Thanks,

will try.

On 3/26/14, Samuel Wales  wrote:
> in maint, if you encrypt with org-crypt on an entry with children, then
> demote, then decrypt, the subtree levels do not match up.
> for example, the children can end up as uncle/aunt nodes.

1 take a subtree, go to the top level of that subtree, encrypt.

2 this encrypts the entire subtree as a frozen-in-time unit.

3 when you subsequently decrypt, it decrypts the entire subtree.

4 so far so good.

5 notice the levels on the subtree.  they are identical to the levels
that existed at the time of encryption.  so far so good.

now do exactly as above, but between steps 2 and 3, move the encrypted entry.

move it to a very demoted place.

much more demoted than the original subtree was.

so far so good.

now decrypt.

you will notice that the decrypted subtree is actually at a higher
level than its parent.  this is a violation of org structure.

in consequence, it can silently swallow the entire rest of the file.

this is not desired.

is there a way to fix it?

let's find out.

> maybe something like these are possibilities:
>
>   1) optionally adjust subtree levels to match the location
>  of the header at time of decryption.  this is similar
>  to how org-yank behaves.  it would have to re-encrypt
>  if you encrypt, demote, decrypt, encrypt.

there is nothing special here.  all it does is demote the contents
properly upon decryption.  however, it is dwim.

please do c-h v org-yank-adjusted-subtrees for more information.

>
>   2) optionally put the subtree in an org source block so
>  that it is no longer an active subtree (can't search
>  headlines in agenda, they are not where they belong, can't export
> as part of parent, have to edit with c-c ')

this works around it.  however, i don't like those drawbacks.

>
>   3) restrict the function to only operate on body text
>  (can't do subtrees).

this is the hardass fix.

>
>   4) status quo (allow outline corruption at user's risk).

i don't like this one.

>
>   5) a combination.
>
> maybe there are more possibilities.
>
> comments?

i suggest 3 by default but you can enable 1.

samuel



Re: [O] Is

2014-06-08 Thread Nick Dokos
Grant Rettke  writes:

> Hi,
>
> When I type
>
> 
> it is expanded into
>
> #+BEGIN_SRC
>
> #+END_SRC
>
> Is supposed to expand into upper case letters?
>
> For some reason, my system won't tangle blocks that are all upper
> case, instead only all lower case is tangled.
>

All the discussion has been about changing the expansion to lower case,
but that misses the point: why does tangling not work? AFAIK, things
are supposed to work whether or not source blocks are demarcated with
upper-, lower-, or mixed-case. So if it's not working for you, it's
either a bug or it's some problem in your setup. Can you please post
a minimal example so we can try it out and determine whether it is a
bug?


Thanks,
-- 
Nick





Re: [O] Bug: Italics support fails after non-breaking space [8.2.6 (8.2.6-67-g9e09b2-elpa @ /home/crculver/.emacs.d/elpa/org-20140602/)]

2014-06-08 Thread Eric Abrahamsen
Christopher Culver  writes:

> Remember to cover the basics, that is, what you expected to happen and
> what in fact did happen.  You don't know how to make a good report?  See
>
>  http://orgmode.org/manual/Feedback.html#Feedback
>
> Your bug report will be posted to the Org-mode mailing list.
> 
>
> The code for changing the font face to italics assumes that the opening
> slash in text surrounded by /.../ will be preceded by a plain
> space. However, authors preparing documents with LaTeX or HTML output in
> mind may employ a non-breaking space before the text in italics (the
> Unicode character U+00A0 NO-BREAK SPACE).
>
> I encountered this bug with the text "Fi. /mennä/", where the only space
> is a non-breaking space (as it must be in any output to a typesetter for
> my needs). Emacs keeps the text within slashes in the normal font face
> instead of changing it to italics.

Check the variable org-emphasis-regexp-components -- the first two
elements specify what characters are allowed before and after an
emphasis delimiter. You could add the non-breaking space to both of
those elements, and it ought to work. I can't speak to potental gotchas
that might arise because of this, or whether this ought to be part of
the default value...

Hope that helps,
Eric




[O] org version check on start

2014-06-08 Thread Grant Rettke
Good afternoon,

Yesterday I was fiddling with getting tangling working in a Makefile.
My humanity caught up with me
and I wasn't super vigilant about the order of my command line
arguments to Emacs. Basically, I asked
it to do some work before the correct version of org-mode was loaded.
Now, Emacs and org wouldn't
complain, because 7.9 and 8.x are close enough, at least for my
system. Still, that was a bad idea and
not my intent.

Knowing that I am human though, I had already added this code long ago:

(when (not (string-equal (org-version) "8.2.6"))
  (display-warning
   'org-mode
   (concat
"Insufficient requirements. Expected 8.2.6. Found " (org-version))
   :emergency))

Just wanted to share that. Everybody who wants to be using a
particular version ought to paste that
into their init somewhere... bound to prevent headaches and save some time.

Kind regards,

Grant Rettke | AAAS, ACM, ASA, FSF, IEEE, SIAM, Sigma Xi
g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson



Re: [O] How to create non-inheritable properties?

2014-06-08 Thread Grant Rettke
On Sun, Jun 8, 2014 at 4:45 PM, Charles Berry  wrote:
> Just guessing at this, but ...
>
> I suspect Grant's file has noweb chunks and that
> `org-babel-use-quick-and-dirty-noweb-expansion' is set to nil.

Exactly. Have been using it quite extensively.

> If the :noweb-ref feature is not used, setting that variable to t will
> make a time difference of a couple of orders of magnitude.

Good to be reminded.

I've relied quite heavily upon the noweb-ref property inheritance.

Glad to know at least that this is expected.



Re: [O] How to create non-inheritable properties?

2014-06-08 Thread Grant Rettke
On Sun, Jun 8, 2014 at 4:24 PM, Thorsten Jolitz  wrote:
> I don't know *how* big your file is, but instead of waiting 8 min for
> tangling you could as well install outshine.el and outorg.el and then
> use
>
> ,---
> | M-: outorg-convert-org-to-outshine
> `---

Interesting, thanks!



Re: [O] Is

2014-06-08 Thread Grant Rettke
On Sun, Jun 8, 2014 at 4:29 PM, Thorsten Jolitz  wrote:
> Thats of course much cooler than the pedestrian version. Only downside
> might be if you search your init file for #+begin_src or so one day
> because your forgot about org-structure-template-alist you won't find it
> ;)

Cool had nothing to do with it; I'm lazy and kind of dumb is all! :)

Joking aside, I like this snippet because it will always work for any
mapping changes, and, it doesn't stomp on anything, just restart Emacs
without the snippet and you are back to original values.

Perhaps that would be the right way to do it... make a copy and do
*not* stomp on the values like I did...



Re: [O] set TO as a property on a heading

2014-06-08 Thread John Kitchin
Yes! That (C-j) is exactly what does it. and it is ido enabled. Thanks,
it was driving me crazy!


Rasmus  writes:

> John Kitchin  writes:
>
>> I feel a little silly asking this, but I cannot figure out how to do
>> it. I want to create a property called TO. 
>>
>> Normally I type C-c C-x p to set a property. When I type TO, the
>> minibuffer tries to autocomplete to many things other than TO, and I
>> cannot figure out how to cancel the rest and use TO. In file completion
>> it is something like C-f, is there something similar for this scenario?
>
> I'm kind of guessing this is with ido enabled?
>
> Does C-j do what you want?  The full sequence on a heading would be
>
>  C-c C-x p to C-j value RET.
>
> ―Rasmus

-- 
---
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



Re: [O] set TO as a property on a heading

2014-06-08 Thread John Kitchin
Aaron Ecay  writes:

Interesting! Thanks for the tip.

> Hi John,
>
> You can use C-c C-x P (with a capital 'p') to enter both the property
> name and value in a free text prompt (no completion). In your case,
> you'd enter "TO: " followed by your desired value.
>
> Aaron
>

-- 
---
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



[O] (require 'org-publish) causes downgrade in org-version

2014-06-08 Thread psycho_punch
I have posted this question on StackOverflow

but in case you don't want to visit the page, I've pasted the contents in
this email.

I have just upgraded org-mode to the latest available in ELPA. According to
the official documentation, the installation has to be done in fresh emacs
session where no org-related scripts/files have been loaded. The
installation is successful, and org-version reports that I have updated to
8.2.6 (from 7.9.3f). However, as soon as I put back my old org-related
scripts, and reload emacs, I'd get 7.9.3f when I run org-version. To track
what's causing it I retrace my steps by adding my org-related scripts one
by one. I found out that when I add back (require 'org-publish), the
version downgrades to the built-in one. I don't know why this is happening.

Thanks.


[O] Bug: Italics support fails after non-breaking space [8.2.6 (8.2.6-67-g9e09b2-elpa @ /home/crculver/.emacs.d/elpa/org-20140602/)]

2014-06-08 Thread Christopher Culver


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


The code for changing the font face to italics assumes that the opening
slash in text surrounded by /.../ will be preceded by a plain
space. However, authors preparing documents with LaTeX or HTML output in
mind may employ a non-breaking space before the text in italics (the
Unicode character U+00A0 NO-BREAK SPACE).

I encountered this bug with the text "Fi. /mennä/", where the only space
is a non-breaking space (as it must be in any output to a typesetter for
my needs). Emacs keeps the text within slashes in the normal font face
instead of changing it to italics.

Emacs  : GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.12.2)
 of 2014-06-06 on barber, modified by Debian
Package: Org-mode version 8.2.6 (8.2.6-67-g9e09b2-elpa @ 
/home/crculver/.emacs.d/elpa/org-20140602/)

current state:
==
(setq
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-log-done t
 org-confirm-shell-link-function 'yes-or-no-p
 org-default-notes-file "~/TODO.org"
 org-agenda-include-diary t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook org-show-block-all 
append local] 5]
 #[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook 
org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-hide-inline-tasks
  org-cycle-show-empty-lines 
org-optimize-window-after-visibility-change)
 org-modules '(org-bbdb org-bibtex org-crypt)
 org-agenda-span 'month
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-completion-use-ido t
 org-reveal-start-hook '(org-decrypt-entry)
 org-agenda-files '("~/TODO.org")
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )



Re: [O] babel C, C++, D enhancement

2014-06-08 Thread Eric Schulte
Thierry Banel  writes:

> Hi Eric, hi All
>
> Here is a new patch (do not apply the previous).
> I added a check in the test suite for the D compiler availability
> (and for the C++ compiler as well).
> It silently returns true when the compiler is not found.
>
> To run the test suite I did that:
> - start from an up-to-date org-mode/ GIT directory
> - create a GIT branch, checkout there
> - apply the patch : git am patch-file
> - make clean
> - make autoloads
> - make test-dirty
>
> Eric, this result you were getting is strange:
>   FAILED ob-C/inhomogeneous_table
> It is as though the NEW test suite was run against the OLD ob-C.el
> Maybe there was an old .elc compiled file hanging around ?
>  
> Anyway, it works fine for me.
> Could someone check and tell me if something goes wrong ?
>
> Have fun
> Thierry
>

Hi Theirry,

This new patch looks great, and the test suite passes locally.  I've
just applied it.

Thanks!
Eric

also, thanks for taking the time to flesh out the commit message

>
>
> Le 06/06/2014 18:31, Eric Schulte a écrit :
>> Hi Thierry,
>>
>> This looks wonderful, however after applying this patch I get the
>> following errors when running "make test-dirty".
>>
>>> 10 unexpected results:
>>>FAILED  ob-C/inhomogeneous_table
>>>FAILED  ob-D/inhomogeneous_table
>>>FAILED  ob-D/integer-var
>>>FAILED  ob-D/list-list-var
>>>FAILED  ob-D/list-var
>>>FAILED  ob-D/simple-program
>>>FAILED  ob-D/string-var
>>>FAILED  ob-D/table
>>>FAILED  ob-D/two-integer-var
>>>FAILED  ob-D/vector-var
>> Could you update the test suite so that the C tests pass, and the D
>> tests are not executed when D is not available?
>>
>> Also, could you flesh out the commit message so that it meets the Emacs
>> commit message guidelines (http://orgmode.org/worg/org-contribute.html)?
>>
>> Many Thanks,
>> Eric
>>
>>
>
>

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)



Re: [O] set TO as a property on a heading

2014-06-08 Thread Aaron Ecay
Hi John,

You can use C-c C-x P (with a capital 'p') to enter both the property name
and value in a free text prompt (no completion).  In your case, you'd enter
"TO: " followed by your desired value.

Aaron


Re: [O] set TO as a property on a heading

2014-06-08 Thread Rasmus
John Kitchin  writes:

> I feel a little silly asking this, but I cannot figure out how to do
> it. I want to create a property called TO. 
>
> Normally I type C-c C-x p to set a property. When I type TO, the
> minibuffer tries to autocomplete to many things other than TO, and I
> cannot figure out how to cancel the rest and use TO. In file completion
> it is something like C-f, is there something similar for this scenario?

I'm kind of guessing this is with ido enabled?

Does C-j do what you want?  The full sequence on a heading would be

 C-c C-x p to C-j value RET.

—Rasmus

-- 
This is the kind of tedious nonsense up with which I will not put




[O] set TO as a property on a heading

2014-06-08 Thread John Kitchin
I feel a little silly asking this, but I cannot figure out how to do
it. I want to create a property called TO. 

Normally I type C-c C-x p to set a property. When I type TO, the
minibuffer tries to autocomplete to many things other than TO, and I
cannot figure out how to cancel the rest and use TO. In file completion
it is something like C-f, is there something similar for this scenario?

Thanks,

-- 
---
John Kitchin




Re: [O] How to create non-inheritable properties?

2014-06-08 Thread Charles Berry
Thorsten Jolitz  gmail.com> writes:

> 
> Grant Rettke  wisdomandwonder.com> writes:
> 
> > Hi,
> >
> > My org file has a lot of text in it. It really needs to be in the same
> > file though, so it is a big file.
> >
> > When I org-babel-tangle, I would like to speed it up as it takes 8 minutes.
> 
> 8 minutes? wow ...
> 

Just guessing at this, but ...

I suspect Grant's file has noweb chunks and that 
`org-babel-use-quick-and-dirty-noweb-expansion' is set to nil.

If the :noweb-ref feature is not used, setting that variable to t will
make a time difference of a couple of orders of magnitude.

HTH,

Chuck




Re: [O] Is

2014-06-08 Thread Thorsten Jolitz
Grant Rettke  writes:

> Just added this to my init file to do that work:
>
> (mapc (lambda (asc)
> (let ((org-sce-dc (downcase (nth 1 asc
>   (setf (nth 1 asc) org-sce-dc)))
>   org-structure-template-alist)

Thats of course much cooler than the pedestrian version. Only downside
might be if you search your init file for #+begin_src or so one day
because your forgot about org-structure-template-alist you won't find it
;)

> Grant Rettke | AAAS, ACM, ASA, FSF, IEEE, SIAM, Sigma Xi
> g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
> “Wisdom begins in wonder.” --Socrates
> ((λ (x) (x x)) (λ (x) (x x)))
> “Life has become immeasurably better since I have been forced to stop
> taking it seriously.” --Thompson
>
>
> On Sat, Jun 7, 2014 at 4:44 PM, Grant Rettke  wrote:
>> Thank you Thorsten.
>> Grant Rettke | AAAS, ACM, ASA, FSF, IEEE, SIAM, Sigma Xi
>> g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
>> “Wisdom begins in wonder.” --Socrates
>> ((λ (x) (x x)) (λ (x) (x x)))
>> “Life has become immeasurably better since I have been forced to stop
>> taking it seriously.” --Thompson
>>
>>
>> On Sat, Jun 7, 2014 at 3:39 PM, Thorsten Jolitz 
>> wrote:
>>> Grant Rettke  writes:
>>>
>>>
 #+BEGIN_SRC

 #+END_SRC

 Is supposed to expand into upper case letters?
>>>
>>> or put this in your init.el:
>>>
>>> #+BEGIN_SRC emacs-lisp
>>> (setq org-structure-template-alist
>>>   (quote (("s" "#+begin_src ?\n\n#+end_src"
>>>"\n\n")
>>>   ("e" "#+begin_example\n?\n#+end_example"
>>>"\n?\n")
>>>   ("q" "#+begin_quote\n?\n#+end_quote"
>>>"\n?\n")
>>>   ("v" "#+begin_verse\n?\n#+end_verse"
>>>"\n?\n/verse>")
>>>   ("c" "#+begin_center\n?\n#+end_center"
>>>"\n?\n/center>")
>>>   ("l" "#+begin_latex\n?\n#+end_latex"
>>>"\n?\n")
>>>   ("L" "#+latex:"
>>>"?")
>>>   ("h" "#+begin_html\n?\n#+end_html"
>>>"\n?\n")
>>>   ("H" "#+html:"
>>>"?")
>>>   ("a" "#+begin_ascii\n?\n#+end_ascii")
>>>   ("A" "#+ascii:")
>>>   ("i" "#+index:?" "#+index: ?")
>>>   ("I" "#+include%file ?"
>>>""
>>> #+END_SRC
>>>
>>>
>>> --
>>> cheers,
>>> Thorsten
>>>
>>>
>
>

-- 
cheers,
Thorsten




Re: [O] How to create non-inheritable properties?

2014-06-08 Thread Thorsten Jolitz
Grant Rettke  writes:

> Hi,
>
> My org file has a lot of text in it. It really needs to be in the same
> file though, so it is a big file.
>
> When I org-babel-tangle, I would like to speed it up as it takes 8 minutes.

8 minutes? wow ...

when I convert my former big init.el with 7272 lines to org-mode with

,---
| M-x outorg-edit-as-org
`---

like this

,--
| (benchmark-run (outorg-edit-as-org '(4)))
`--

the result is

,---
| (3.551239904 8 0.736149203001)
`---

i.e. 4 seconds.

Converting it back to emacs-lisp-mode with

,-
| (benchmark-run (outorg-copy-edits-and-exit))
`-

takes 

,
| (0.107002176 1 0.0977563640032)
`

i.e. 0.1 sec.

I don't know *how* big your file is, but instead of waiting 8 min for
tangling you could as well install outshine.el and outorg.el and then
use

,---
| M-: outorg-convert-org-to-outshine
`---

to convert your org-file to an (org-style) structured emacs-lisp
file. Then you don't need any tangling anymore since you are in
emacs-lisp-mode anyway, and whenever you want to edit (comment-)text you
use outorg to temporarily convert the subtree or the whole buffer to
org-mode for editing.

-- 
cheers,
Thorsten




Re: [O] babel C, C++, D enhancement

2014-06-08 Thread Thierry Banel
Hi Eric, hi All

Here is a new patch (do not apply the previous).
I added a check in the test suite for the D compiler availability
(and for the C++ compiler as well).
It silently returns true when the compiler is not found.

To run the test suite I did that:
- start from an up-to-date org-mode/ GIT directory
- create a GIT branch, checkout there
- apply the patch : git am patch-file
- make clean
- make autoloads
- make test-dirty

Eric, this result you were getting is strange:
  FAILED ob-C/inhomogeneous_table
It is as though the NEW test suite was run against the OLD ob-C.el
Maybe there was an old .elc compiled file hanging around ?
 
Anyway, it works fine for me.
Could someone check and tell me if something goes wrong ?

Have fun
Thierry


Le 06/06/2014 18:31, Eric Schulte a écrit :
> Hi Thierry,
>
> This looks wonderful, however after applying this patch I get the
> following errors when running "make test-dirty".
>
>> 10 unexpected results:
>>FAILED  ob-C/inhomogeneous_table
>>FAILED  ob-D/inhomogeneous_table
>>FAILED  ob-D/integer-var
>>FAILED  ob-D/list-list-var
>>FAILED  ob-D/list-var
>>FAILED  ob-D/simple-program
>>FAILED  ob-D/string-var
>>FAILED  ob-D/table
>>FAILED  ob-D/two-integer-var
>>FAILED  ob-D/vector-var
> Could you update the test suite so that the C tests pass, and the D
> tests are not executed when D is not available?
>
> Also, could you flesh out the commit message so that it meets the Emacs
> commit message guidelines (http://orgmode.org/worg/org-contribute.html)?
>
> Many Thanks,
> Eric
>
>

>From 06996e7af7c24b8b6adc16b13c183dcc46b5362c Mon Sep 17 00:00:00 2001
From: Thierry Banel 
Date: Sun, 8 Jun 2014 22:01:56 +0200
Subject: [PATCH] Babel C, C++, D support for non-homogeneous input
 tables

* ob-C.el: handling of non-homogeneous tables,
support for table header,
support for iterating over table cells.
(org-babel-expand-body:C++): uncomment
(org-babel-C-execute): cosmetic changes
(org-babel-C-expand-C): add support for table columns names,
add support for table dimensions,
add standard includes
(org-babel-C-val-to-C-type): rewrite to support non-homogeneous
tables cells
(org-babel-C-table-sizes-to-C): new function to gain access
to the table dimensions
(org-babel-C-utility-header-to-C):
(org-babel-C-header-to-C): new functions to generate
support for table header.

* ob-C-test.org: added D sibling tests similar to C++,
added non-homogeneous table example for C++ and D

* test-ob-C.el: new tests for D and non-homogeneous tables
(ob-C/simple-program):
(ob-C/simple-program):
(ob-D/simple-program):
(ob-C/integer-var):
(ob-D/integer-var):
(ob-C/two-integer-var):
(ob-D/two-integer-var):
(ob-C/string-var):
(ob-D/string-var):
(ob-C/preprocessor):
(ob-C/table):
(ob-D/table):
(ob-C/list-var):
(ob-D/list-var):
(ob-C/vector-var):
(ob-D/vector-var):
(ob-C/list-list-var):
(ob-D/list-list-var):
(ob-C/inhomogeneous_table):
(ob-D/inhomogeneous_table): add compiler availability check
(ob-D/simple-program):
(ob-D/integer-var):
(ob-D/two-integer-var):
(ob-D/string-var):
(ob-D/table):
(ob-D/list-var):
(ob-D/vector-var):
(ob-D/list-list-var):
(ob-D/inhomogeneous_table): add D unit tests
(ob-C/inhomogeneous_table):
(ob-D/inhomogeneous_table): add non-homogeneous table
unit tests
---
 lisp/ob-C.el   |  292 +++-
 testing/examples/ob-C-test.org |   88 
 testing/lisp/test-ob-C.el  |  161 +-
 3 files changed, 416 insertions(+), 125 deletions(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index 793981a..dd03fa7 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -34,8 +34,6 @@
   (require 'cl))
 (require 'ob)
 (require 'cc-mode)
-(eval-when-compile
-  (require 'cl))
 
 (declare-function org-entry-get "org"
 		  (pom property &optional inherit literal-nil))
@@ -72,40 +70,40 @@ This function calls `org-babel-execute:C++'."
 This function is called by `org-babel-execute-src-block'."
   (let ((org-babel-c-variant 'cpp)) (org-babel-C-execute body params)))
 
-;;(defun org-babel-expand-body:C++ (body params) ;; unused
-;;  "Expand a block of C++ code with org-babel according to it's
-;;header arguments (calls `org-babel-C-expand')."
-;;  (let ((org-babel-c-variant 'cpp)) (org-babel-C-expand body params)))
+(defun org-babel-expand-body:C++ (body params)
+  "Expand a block of C++ code with org-babel according to it's
+header arguments."
+  (let ((org-babel-c-variant 'cpp)) (org-babel-C-expand-C++ body params)))
 
 (defun org-babel-execute:D (body params)
   "Execute a block of D code with org-b

Re: [O] Is

2014-06-08 Thread Grant Rettke
Just added this to my init file to do that work:

(mapc (lambda (asc)
(let ((org-sce-dc (downcase (nth 1 asc
  (setf (nth 1 asc) org-sce-dc)))
  org-structure-template-alist)
Grant Rettke | AAAS, ACM, ASA, FSF, IEEE, SIAM, Sigma Xi
g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Sat, Jun 7, 2014 at 4:44 PM, Grant Rettke  wrote:
> Thank you Thorsten.
> Grant Rettke | AAAS, ACM, ASA, FSF, IEEE, SIAM, Sigma Xi
> g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
> “Wisdom begins in wonder.” --Socrates
> ((λ (x) (x x)) (λ (x) (x x)))
> “Life has become immeasurably better since I have been forced to stop
> taking it seriously.” --Thompson
>
>
> On Sat, Jun 7, 2014 at 3:39 PM, Thorsten Jolitz  wrote:
>> Grant Rettke  writes:
>>
>>
>>> #+BEGIN_SRC
>>>
>>> #+END_SRC
>>>
>>> Is supposed to expand into upper case letters?
>>
>> or put this in your init.el:
>>
>> #+BEGIN_SRC emacs-lisp
>> (setq org-structure-template-alist
>>   (quote (("s" "#+begin_src ?\n\n#+end_src"
>>"\n\n")
>>   ("e" "#+begin_example\n?\n#+end_example"
>>"\n?\n")
>>   ("q" "#+begin_quote\n?\n#+end_quote"
>>"\n?\n")
>>   ("v" "#+begin_verse\n?\n#+end_verse"
>>"\n?\n/verse>")
>>   ("c" "#+begin_center\n?\n#+end_center"
>>"\n?\n/center>")
>>   ("l" "#+begin_latex\n?\n#+end_latex"
>>"\n?\n")
>>   ("L" "#+latex:"
>>"?")
>>   ("h" "#+begin_html\n?\n#+end_html"
>>"\n?\n")
>>   ("H" "#+html:"
>>"?")
>>   ("a" "#+begin_ascii\n?\n#+end_ascii")
>>   ("A" "#+ascii:")
>>   ("i" "#+index:?" "#+index: ?")
>>   ("I" "#+include%file ?"
>>""
>> #+END_SRC
>>
>>
>> --
>> cheers,
>> Thorsten
>>
>>



Re: [O] Can this table formula be done more efficient

2014-06-08 Thread Eric Schulte
Nick Dokos  writes:

> Cecil Westerhof  writes:
>
>> At the moment I am using the following formula:
>>     #+TBLFM: @<<$4..@>>$4 = $2 - $3 :: @>$2=vsum(@<<$2..@>>$2) ::
>> @>$3=vsum(@<<$3..@>>$3) :: @>$4=vsum(@<<$4..@>>$4)
>>
>> This does what I want, but there are two things that could be improved.
>>
>> - The second, third and fourth formula do exactly the same, only on
>> different columns. Could this be rewritten to one formula?
>>
>
> --8<---cut here---start->8---
> #+TBLFM: @<<$4..@>>$4 = $2 - $3 :: @>$2..$4=vsum(@<<$0..@>>$0)
> --8<---cut here---end--->8---
>
> See (info "(org) References")
>
>> - The line becomes long and hard to evaluate for a person. Is there
>> a possibility to put the formulas below each-other?
>>
>
> I don't believe so but my belief may be out of date. It has been
> discussed before: check the list archives.

Sort of but not really.  See "Using multiple #+TBLFM lines" in the
manual.

,
| Using multiple #+TBLFM lines
| 
| 
| You may apply the formula temporarily.  This is useful when you switch
| the formula.  Place multiple ‘#+TBLFM’ lines right after the table, and
| then press ‘C-c C-c’ on the formula to apply.  Here is an example:
| 
|  | x | y |
|  |---+---|
|  | 1 |   |
|  | 2 |   |
|  #+TBLFM: $2=$1*1
|  #+TBLFM: $2=$1*2
| 
| Pressing ‘C-c C-c’ in the line of ‘#+TBLFM: $2=$1*2’ yields:
| 
|  | x | y |
|  |---+---|
|  | 1 | 2 |
|  | 2 | 4 |
|  #+TBLFM: $2=$1*1
|  #+TBLFM: $2=$1*2
| 
| Note: If you recalculate this table (with ‘C-u C-c *’, for example), you
| will get the following result of applying only the first ‘#+TBLFM’ line.
| 
|  | x | y |
|  |---+---|
|  | 1 | 1 |
|  | 2 | 2 |
|  #+TBLFM: $2=$1*1
|  #+TBLFM: $2=$1*2
`


-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)



Re: [O] Can this table formula be done more efficient

2014-06-08 Thread Nick Dokos
Cecil Westerhof  writes:

> At the moment I am using the following formula:
>     #+TBLFM: @<<$4..@>>$4 = $2 - $3 :: @>$2=vsum(@<<$2..@>>$2) :: 
> @>$3=vsum(@<<$3..@>>$3) :: @>$4=vsum(@<<$4..@>>$4)
>
> This does what I want, but there are two things that could be improved.
>
> - The second, third and fourth formula do exactly the same, only on different 
> columns. Could this be rewritten to one formula?
>

--8<---cut here---start->8---
#+TBLFM: @<<$4..@>>$4 = $2 - $3 :: @>$2..$4=vsum(@<<$0..@>>$0)
--8<---cut here---end--->8---

See (info "(org) References")

> - The line becomes long and hard to evaluate for a person. Is there a 
> possibility to put the formulas below each-other?
>

I don't believe so but my belief may be out of date. It has been
discussed before: check the list archives.

-- 
Nick




[O] Can this table formula be done more efficient

2014-06-08 Thread Cecil Westerhof
At the moment I am using the following formula:
#+TBLFM: @<<$4..@>>$4 = $2 - $3 :: @>$2=vsum(@<<$2..@>>$2) ::
@>$3=vsum(@<<$3..@>>$3) :: @>$4=vsum(@<<$4..@>>$4)

This does what I want, but there are two things that could be improved.

- The second, third and fourth formula do exactly the same, only on
different columns. Could this be rewritten to one formula?

- The line becomes long and hard to evaluate for a person. Is there a
possibility to put the formulas below each-other?

-- 
Cecil Westerhof