Re: [O] Replace EMAIL keyword by some LaTeX command

2013-10-15 Thread Xavier Garrido

Hi Rasmus,

It works like a charm ! Thanks a lot for the trick and for your help.

Xavier

Le 15/10/2013 02:11, Rasmus a écrit :


#+BEGIN_SRC Org
#+TITLE:  LaTeX test
#+AUTHOR: toto
#+EMAIL:  t...@toto.org
#+LATEX_HEADER: \usepackage{nopkg}
#+OPTIONS: with-email: t
Note that
   1. email is inserted after other =latex_headers=
   2. with-email is ignored and only the presence of email matters.
  - You could add a check to =(plist-get options :with-email)= in
the =(and ...)= statement below and remove the =\thanks{.}= in
a final output filter.

#+begin_src emacs-lisp
   (defun rasmus/force-insert-email (options backend)
 Insert EMAIL as \email{EMAIL} in the latex backend when EMAIL is present.
 (when (and (org-export-derived-backend-p backend 'latex)
(plist-get options :email))
   (plist-put options :latex-header
  (mapconcat 'identity
 (remove nil
 (list
  (plist-get options :latex-header)
  (format \\email{%s}
  (plist-get options :email
 \n))
   ;; don't insert email in \thanks{.}
   (plist-put options :with-email nil))
 options)

   (add-to-list 'org-export-filter-options-functions 'rasmus/force-insert-email)
#+end_src
#+END_SRC






Re: [O] Dynsite: easier configuration of projects, with config.or instead of emacs lisp and dynamic relative paths

2013-10-15 Thread Sebastien Vauban
Hello John,

John Kitchin wrote:
 I implemented a version of elisp links to dynamically generated content at
 export time here:
 http://jkitchin.github.io/blog/2013/10/14/Lisp-links-in-org-mode-to-dynamically-generated-content/

 I am not sure it was you are thinking about, but maybe it could give you
 some ideas.

In this case, instead of special link handling, I'd have used something which
already exists:

--8---cut here---start-8---
This file was exported on src_emacs-lisp{(format-time-string %Y-%m-%d at %H:%m 
%p)}.

The answer to 2 + 3 is src_emacs-lisp{(+ 2 3)}.
--8---cut here---end---8---

Or is there a reason for doing it with links?

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] How to collect status of all checkboxes in lower subtrees

2013-10-15 Thread Eric S Fraga
Rainer Stengele rainer.steng...@online.de writes:

[...]

 Thank you Eric,
 until now TODOs for me always seemed to be a bit heavyweight because of the 
 headline needed.
 I wonder how people are working.
 Do you use checkboxes a lot or prefer TODOs even for simple subtasks?

Yes, I use headlines for all tasks, no matter how small.  However, I do
group them under more general headlines in some cases.

But there are many different uses out there, I'm sure!

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.2.1-86-gbe3dad




Re: [O] [bug] cannot export with babel function calls

2013-10-15 Thread Eric S Fraga
Eric Schulte schulte.e...@gmail.com writes:

[...]

 I actually get a different error [1], namely that the call line can't be
 parsed because we're using a regex to grab call lines and regular
 expressions can't count parens.

Ah, okay, this makes sense.  My example was contrived so this is not a
problem for me.

 Exporting a slightly changed file (attached [2]) works for me w/o error.

Doesn't for me.  I get 

  Marker points into wrong buffer: #marker in no buffer

when I try to export.

 I'm using the following Emacs version [3].  I may have to wait until the
 cause of this error hits the Emacs in the Arch Linux package system to
 debug further.

Yes, I do think it's a subtle change in recent Emacs versions.  No
worries!

thanks,
eric
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.2.1-86-gbe3dad




Re: [O] org-grep, and problems

2013-10-15 Thread Suvayu Ali
On Mon, Oct 14, 2013 at 07:50:36PM -0400, François Pinard wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 
   No matter what I search for, I get 0 results!
  I'm on Linux.
 
 Hmph!  As it works nicely for me, I thought it would be useful to
 others.  I'm saddened it does not work for you.  How could we proceed so
 I try to help on this one?  Write me privately if you feel like it (yet
 my replies may lag sometimes, I'm not always available).

The library seemed interesting, so I was trying it out.  I usually use a
custom shell script from the terminal to search.  I can try debugging
org-grep, but I don't know where I should start.

-- 
Suvayu

Open source is the future. It sets us free.



[O] Killing the tag search window

2013-10-15 Thread Chris Henderson
I use C-c a m to search tags. How do I close this window when I'm done? At
the moment, I'm using C-x k to kill this window, C-c o to jump to my org
file and then C-x 1 make the window full screen.

Is there any other way to close the tags window?

Thanks.


Re: [O] Killing the tag search window

2013-10-15 Thread Rasmus
Chris Henderson henders...@gmail.com writes:

 I use C-c a m to search tags. How do I close this window when I'm done? At
 the moment, I'm using C-x k to kill this window, C-c o to jump to my org
 file and then C-x 1 make the window full screen.

 Is there any other way to close the tags window?

Will 'q' work?

–Rasmus

-- 
Hvor meget poesi tror De kommer ud af et glas isvand?




Re: [O] Dynsite: easier configuration of projects, with config.or instead of emacs lisp and dynamic relative paths

2013-10-15 Thread John Kitchin
On Tue, Oct 15, 2013 at 4:04 AM, Sebastien Vauban
sva-n...@mygooglest.comwrote:



That is a nice feature I had forgotten about!

When I export your snippet to html I get this:
p
This file was exported on .
/p

p
The answer to 2 + 3 is ./p
/div

Is there some trick to make them evaluate? Probably I have set a variable
in org-mode to not evaluate code on export, because I usually do not want
that.

I could type C-cC-c on the src, which puts the result next to it like =5=,
which then is exported to the html.

The links are clickable, show the output in the minibuffer, and are
evaluated at export time.  These are two slightly different ways to solve
the problem. Also, you could do fancier things with the filter approach
like make tooltips with the original code snippet, etc...

John

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


Re: [O] [PATCH] org-table-transpose-table-at-point: Preserve indentation and point

2013-10-15 Thread Michael Brand
Hi Carsten, Bastien and Nicolas

On Tue, Oct 8, 2013 at 9:40 AM, Michael Brand
michael.ch.br...@gmail.com wrote:
 On Mon, Sep 30, 2013 at 8:35 PM, Michael Brand
 michael.ch.br...@gmail.com wrote:
 For the use case of org-table-transpose-table-at-point there, I made a
 patch for org-table-transpose-table-at-point to preserve indentation
 and point after transposition.

 I would like to remind to review and apply the previously attached patch.

I would like to remind to review and apply the patch attached on
[2013-09-30 Mon] to this thread.

Michael



[O] C-S-up and C-S-down throws an error

2013-10-15 Thread Oleh
Hi all,

Pressing these key-chords just gives:

user-error: To use shift-selection with Org-mode, customize
`org-support-shift-select'

I don't think that it's very productive to occupy a key binding with a
function that
just says to me that I made an error. Or is it an advertisement for
shift-selection:)?

I've got global windmove bindings on C- arrows, and buffer-move on C-S-
arrows,
so now I have to set specifically:

(define-key org-mode-map [(control shift right)] nil)
(define-key org-mode-map [(control shift left)] nil)
(define-key org-mode-map [(control shift up)] nil)
(define-key org-mode-map [(control shift down)] nil)

I don't feel bad about the other two bindings, because they were actually
doing something
useful, but these two...

I think a way out of this is either enabling `org-support-shift-select' by
default,
or not to bind these key chords. But that's just my opinion.

regards,
Oleh


[O] [bug] [exporter] Frame labels cause allowframebreaks option to fail

2013-10-15 Thread Eric S Fraga
Hello,

technically, I guess this is a bug in beamer and not in org's
exporter.  However, if I specify the =allowframebreaks= option for a
frame, the exporter generates the following LaTeX code on beamer export:

  \begin{frame}[allowframebreaks,label=sec-1-1-1]{Some definitions}

The label=sec-1-1-1 seems to make beamer ignore the allowframebreaks
option.  If I remove the label= directive from the options, everything
works fine.  Otherwise, the frame contents to not break over multiple
frames.

The question is: how can I tell the exporter to *not* generate label=
directives?  I have no need for these and, at the moment, I am having to
edit the LaTeX source to get my slides done.

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.2.1-100-gfb5003




Re: [O] Full org-mode on unrooted Android

2013-10-15 Thread Carsten Dominik

On 8.10.2013, at 12:36, Scot Becker scot.bec...@gmail.com wrote:

 Just a quick note to say that it's possible to get a full Emacs+org-mode on 
 (unrooted) Android using an app called 'zshaolin'.  You can either download 
 the app from the Google Play store for approx $3 or download the toolchain 
 and source from their website and compile it yourself (which I haven't tried).
 
 https://play.google.com/store/apps/details?id=org.dyne.zshaolinhl=en
 
 http://www.dyne.org/software/zshaolin/
 (for source, follow links to their FTP site, about 2/3 down the page)
 
 Emacs is version 24.1.50.  


I just tried it, and when I start emacs I get an error message that the 
directory /sdcard/emacs/etc is not present.  Emacs seems to look there for a 
file called charsets.  Does anyone know what I am missing here?

Thanks

- Carsten

 
 The following needs to be added to the .zshrc for org-mode to work:
 
 export TMPDIR=${HOME}/tmp
 
 
 They only claim 'barebone' Emacs, and I haven't tested extensively to see 
 what that means, but so far it works for me.  
 
 I have no affiliation with the people at dyne.org, just happy to have working 
 portable, org-mode. I use a Bluetooth keyboard with a 7 tablet on Android 
 4.3.
 
 It looks like compiling in this case may not be for the faint of heart, but 
 if someone tries it, perhaps they can post any notes to the list here. 
 
 Cheers,
 Scot
 



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [O] [bug] [exporter] Frame labels cause allowframebreaks option to fail

2013-10-15 Thread Eric S Fraga
Eric S Fraga e.fr...@ucl.ac.uk writes:

[...]

 The question is: how can I tell the exporter to *not* generate label=
 directives?  I have no need for these and, at the moment, I am having to
 edit the LaTeX source to get my slides done.

I found some time to look at the code and it appears that the automatic
creation of labels for frames happens always.  There is no customisation
possible.  As this problem is stopping me from generating the slides I
need for my lectures *now*, I have removed the automatic label
generation, leaving the possibility of user specified labels.  A patch
is attached in case this is of more general interest. 

A better solution would be to have a variable to be able to customise
this behaviour, I imagine.

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.2.1-86-gbe3dad
From 8e841c8caa79707e098d691a44a90c9d9faff073 Mon Sep 17 00:00:00 2001
From: Eric S Fraga e.fr...@ucl.ac.uk
Date: Tue, 15 Oct 2013 17:39:40 +0100
Subject: [PATCH] Removed automatic creation of labels for frames in beamer
 export

* lisp/ox-beamer.el (org-beamer--format-frame) The options passed to
the frame command will include only labels defined explicitly in the
org file.  Automatic labels will not be generated.  It seems that
labels prevent beamer from processing other options, allowframebreaks
in particular.
---
 lisp/ox-beamer.el | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 74d99ed..6410615 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -507,14 +507,7 @@ used as a communication channel.
 			   ;; them.
 			   (and (string-match ^\\[?\\(.*\\)\\]?$ beamer-opt)
 (match-string 1 beamer-opt))
-			   ,))
-		 ;; Provide an automatic label for the frame
-		 ;; unless the user specified one.
-		 (unless (and beamer-opt
-  (string-match \\(^\\|,\\)label= beamer-opt))
-		   (list
-			(format label=%s
-(org-beamer--get-label headline info)))
+			   ,)
 	  ;; Change options list into a string.
 	  (org-beamer--normalize-argument
 	   (mapconcat
-- 
1.8.1.2



Re: [O] [bug] [exporter] Frame labels cause allowframebreaks option to fail

2013-10-15 Thread Rasmus
Eric S Fraga e.fr...@ucl.ac.uk writes:

 Hello,

 technically, I guess this is a bug in beamer and not in org's
 exporter.  However, if I specify the =allowframebreaks= option for a
 frame, the exporter generates the following LaTeX code on beamer export:

   \begin{frame}[allowframebreaks,label=sec-1-1-1]{Some definitions}

Interesting (I can reproduce here).  Perhaps you should fill a bug
report:

https://bitbucket.org/rivanvx/beamer/wiki/Home

(I couldn't find any references to this problem, but I didn't look
very hard)

 The label=sec-1-1-1 seems to make beamer ignore the allowframebreaks
 option.  If I remove the label= directive from the options, everything
 works fine.  Otherwise, the frame contents to not break over multiple
 frames.



 The question is: how can I tell the exporter to *not* generate label=
 directives?  I have no need for these and, at the moment, I am having to
 edit the LaTeX source to get my slides done.

From a quick skim through ox-beamer I don't think you can disable it.
I don't know that it generally makes sense to do this.

You could use a regexp filter.  Perhaps
org-export-filter-headline-functions like this quick-and-dirty
solution.

* test 
   :PROPERTIES:
   :BEAMER_opt: allowframebreaks
   :END:  
  hest
  

#+begin_src emacs-lisp
  (defun rasmus/condtionally-remove-label (headline backend info)
condtionally remove label
(if (and 
 (org-export-derived-backend-p backend 'beamer)
 (string-match [.*?allowframebreaks.*?] headline))
(replace-regexp-in-string ,? ?label=[-sec0-9]+  headline)
  headline))
  
  (add-to-list 'org-export-filter-headline-functions 
   'rasmus/condtionally-remove-label)
#+end_src





-- 
El Rey ha muerto. ¡Larga vida al Rey!



Re: [O] [bug] [exporter] Frame labels cause allowframebreaks option to fail

2013-10-15 Thread Rasmus
Eric S Fraga e.fr...@ucl.ac.uk writes:

 A better solution would be to have a variable to be able to customise
 this behaviour, I imagine.

Why?  Labels are /usually/ completely harmless.  Please open a bug
report at Beamer's Bitbucket.

–Rasmus

-- 
I hear there's rumors on the, uh, Internets. . .




Re: [O] org-caldav and repeat entries

2013-10-15 Thread Eric S Fraga
Rasmus ras...@gmx.us writes:

 Hi Org-list,

 How do you guys manage repeated irregular entries when using
 org-caldav?

I use a different heading for each event so I never have multiple
timestamps within a given section.  So I can't help you directly with
your problem.

However, note that MobileOrg also does Google calendar synchronisation
on Android phones.  I currently use org-caldav but I was happily using
MobileOrg's sync capability a while ago and I assume it still works
well.  I stopped using it only because I ended up with a Symbian phone
for work (long story) and so moved to org-caldav when that appeared.  I
am now back on Android but haven't moved back completely to MobileOrg as
org-caldav works very well for me (it ain't broke so...).

HTH,
eric
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.2.1-86-gbe3dad




Re: [O] [bug] [exporter] Frame labels cause allowframebreaks option to fail

2013-10-15 Thread Rasmus
Rasmus ras...@gmx.us writes:
 #+begin_src emacs-lisp
   (defun rasmus/condtionally-remove-label (headline backend info)
 condtionally remove label
 (if (and 
  (org-export-derived-backend-p backend 'beamer)
  (string-match [.*?allowframebreaks.*?] headline))
 (replace-regexp-in-string ,? ?label=[-sec0-9]+  headline)
   headline))
   
   (add-to-list 'org-export-filter-headline-functions 
'rasmus/condtionally-remove-label)
 #+end_src


That's pretty unstable, it turns out.  Headlines encompass more in
ox-beamer than how I remember them from ox-latex.  Here's a better one
as long as you don't use newlines (\n) in your headings.  Are '\\'
stil used for denoting subtitles in ox-beamer?

* test 
   :PROPERTIES:
   :BEAMER_opt: allowframebreaks
   :END:  
  horses like allowframebreaks 

* on allowframebreaks
  cows

#+begin_src emacs-lisp
  (defun rasmus/condtionally-remove-label (headline backend info)
condtionally remove label
(let* ((h (string-match \n headline))
   (head (substring headline 0 h)))
  (if (and 
   (org-export-derived-backend-p backend 'beamer)
   (string-match \\[.*?allowframebreaks.*?\\].*? head))
  (concat (replace-regexp-in-string ,? ?label=[-sec0-9]+  head) 
  \n (substring headline (1+ h)))
headline)))

  (add-to-list 'org-export-filter-headline-functions 
   'rasmus/condtionally-remove-label)
#+end_src

–Rasmus

-- 
The Kids call him Billy the Saint




Re: [O] org-caldav and repeat entries

2013-10-15 Thread Rasmus
Eric,

Eric S Fraga e.fr...@ucl.ac.uk writes:

 Rasmus ras...@gmx.us writes:

 Hi Org-list,

 How do you guys manage repeated irregular entries when using
 org-caldav?

 I use a different heading for each event so I never have multiple
 timestamps within a given section.  So I can't help you directly with
 your problem.

OK.

 However, note that MobileOrg also does Google calendar synchronisation
 on Android phones.  I currently use org-caldav but I was happily using
 MobileOrg's sync capability a while ago and I assume it still works
 well.  I stopped using it only because I ended up with a Symbian phone
 for work (long story) and so moved to org-caldav when that appeared.  I
 am now back on Android but haven't moved back completely to MobileOrg as
 org-caldav works very well for me (it ain't broke so...).

I used to use MobileOrg.  But currently I use a SabreDAV server to
sync.  I haven't got the Google Calc, but I've got normal CalDAV.

–Rasmus

-- 
Vote for proprietary math!




Re: [O] Killing the tag search window

2013-10-15 Thread Carsten Dominik
Both q and x do this.  q just buries the buffer, x will also kill the 
buffer.

- Carste

On Oct 15, 2013, at 1:15 PM, Chris Henderson henders...@gmail.com wrote:

 I use C-c a m to search tags. How do I close this window when I'm done? At 
 the moment, I'm using C-x k to kill this window, C-c o to jump to my org file 
 and then C-x 1 make the window full screen.
 
 Is there any other way to close the tags window?
 
 Thanks.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [O] [PATCH] org-table-transpose-table-at-point: Preserve indentation and point

2013-10-15 Thread Carsten Dominik
Hi Michael,

thank you for the reminder, sorry for the delay.

The patch has been applied now.

- Carsten

On Oct 15, 2013, at 4:46 PM, Michael Brand michael.ch.br...@gmail.com wrote:

 Hi Carsten, Bastien and Nicolas
 
 On Tue, Oct 8, 2013 at 9:40 AM, Michael Brand
 michael.ch.br...@gmail.com wrote:
 On Mon, Sep 30, 2013 at 8:35 PM, Michael Brand
 michael.ch.br...@gmail.com wrote:
 For the use case of org-table-transpose-table-at-point there, I made a
 patch for org-table-transpose-table-at-point to preserve indentation
 and point after transposition.
 
 I would like to remind to review and apply the previously attached patch.
 
 I would like to remind to review and apply the patch attached on
 [2013-09-30 Mon] to this thread.
 
 Michael



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [O] Replace EMAIL keyword by some LaTeX command

2013-10-15 Thread Marcin Borkowski
Dnia 2013-10-15, o godz. 02:11:53
Rasmus ras...@gmx.us napisał(a):

 Hi Xavier,
 
 Xavier Garrido xavier.garr...@gmail.com writes:
 
 But you have to be certain that this command is present.
 
 You could use etoolbox to test it.  That brings in another dependency,
 tho.

Not really.

\providecommand{\email}[1]{whatever you like}

works like \newcommand, but if \email is defined, it doesn't change
it's definition.

Just my 2c.

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



Re: [O] Killing the tag search window

2013-10-15 Thread Chris Henderson
Thanks! That's a huge productivity gain for me.

Although, I don't see q buries it in the buffer.


On Tue, Oct 15, 2013 at 10:35 PM, Carsten Dominik
drostekirs...@gmail.comwrote:

 Both q and x do this.  q just buries the buffer, x will also kill
 the buffer.

 - Carste

 On Oct 15, 2013, at 1:15 PM, Chris Henderson henders...@gmail.com wrote:

  I use C-c a m to search tags. How do I close this window when I'm done?
 At the moment, I'm using C-x k to kill this window, C-c o to jump to my org
 file and then C-x 1 make the window full screen.
 
  Is there any other way to close the tags window?
 
  Thanks.




[O] Full org-mode on unrooted Android

2013-10-15 Thread Jaromil

hi all,

apologies for breaking the threading as I just subscribed to the list

and thanks for trying out ZShaolin :^)

I am happy to see some of the experts here find it useful.  The Emacs
included in my APK is experimental and so far comes without elisp
files, which you can add from your own collection, inside /sdcard/Emacs.
then Emacs in Zshaolin should work without problems and with all loaded
extensions (one could also simply install the Emacs for Android app
which provides them).

I'm trying to find the time to update the app and include a working
Emacs out of the box, so far without much success because of lack of
time and other priorities: ZShaolin includes a lot more software and
currently  I am working on a modular install system, sort of package
based, somehow minimal enough to fit the style of the app. There are
also other priorities like UTF8 support in the terminal (which is an
older version of JackPal's)...

Overall ZShaolin is not complete and still somehow far from 1.0, however
for using Emacs and Orgmode should be enough to add that directory in
the sdcard, I use such a setup myself, with some difficulties because of
the Esc key in Android and such things as the software keyboard popping
up which was mentioned, for which installing the null keyboard app is
a possible solution.

I'll keep in touch via this mailinglist, so welcome troubles :^) and
suggestions. And many thanks Carsten and all devs for orgmode: rocks.

ciao

-- 
http://jaromil.dyne.org
GPG: 6113 D89C A825 C5CE DD02  C872 73B3 5DA5 4ACB 7D10
NEW! superseeding old key C2B68E39 due to expiration date
signature and revokation history on pgp.mit.edu - plz upd



pgpE_HQ1yP54F.pgp
Description: PGP signature


Re: [O] org-grep, and problems

2013-10-15 Thread François Pinard
James Harkins jamshar...@gmail.com writes:

 I don't want to drag it out much further as it's well off topic,

I'm sorry that my little grammar question, in the P.S. of the original
message, generated all that traffic.  I did not know the answers were so
debatable, and was rather expecting a quick and conclusive reply from
any English guy (or girl) around.

Another notable point is that nobody replied to the Org questions in the
original message, yet I quite understand that chasing bugs in someone
else code is not an especially attractive activity :-).

Keep happy all!

François

P.S. Who just upgraded Ubuntu to [...]  Oops!  No more P.S.'es :-)



[O] Org mode export to HTML not working correctly with code blocks if block is after an item (-) and its delimiters are indented

2013-10-15 Thread Omid
Hello All,

When exporting to HTML (Org mode version 8.2.1 ELPA; GNU Emacs version
24.3.1) I see the a strange behavior which can be reproduced with the
following minimal example:

This exports correctly
  #+BEGIN_SRC sh
ls
  #+END_SRC

- This also exports correctly
#+BEGIN_SRC sh
ls
#+END_SRC

- This does NOT export correctly (code block is not detected)
  #+BEGIN_SRC sh
ls
  #+END_SRC

Is there any way around this behavior without removing the indentation
for the code block delimiters?

Thanks,

-- 
Omid

Sent from my Emacs



Re: [O] org-grep, and problems

2013-10-15 Thread François Pinard
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 I can try debugging org-grep, but I don't know where I should start.

I would either step through org-grep (using C-u C-M-x first over any
line of the org-grep definition within org-grep.el, or add (message ...)
lines within the function before to later check the *Messages* buffer,
and after calling org-grep the normal way to trigger the trace, pay
special attention to the argument given to shell-command.

That command, repeated in a mere shell outside Emacs, should find hits
in your Org files.  If not, I would play with that command to see how it
should have been written to be successful, then amend org-grep so it
generates the proper command.

If everything that should be found gets found, then I'd suspect the code
after shell-command which reformats the output, and step through it to
find where it does it wrong.

The code is small, so the bug does not have much room to hide :-).

François



Re: [O] Org mode export to HTML not working correctly with code blocks if block is after an item (-) and its delimiters are indented

2013-10-15 Thread Thorsten Jolitz
Omid omidl...@gmail.com writes:

 - This does NOT export correctly (code block is not detected)
   #+BEGIN_SRC sh
 ls
   #+END_SRC

 Is there any way around this behavior without removing the indentation
 for the code block delimiters?

I think the 'official'regexp to detect a src-block starts like this

,--
| ^\\([ \t]*\\)#\\+begin_src [...]
`--

so I would guess that this should work, and its a bug if it doesn't.

Inside a list like this

 - First item

   #+begin_src emacs-lisp :exports both
(+ 3 4)
   #+end_src

 - Second Item

   Some text

it should work too, lets test:

#+begin_src emacs-lisp :exports value
   (with-current-buffer
   (current-buffer)
 (org-export-as 'ascii))
#+end_src

,---
| #+results:
|_
|
|   427
|
| Thorsten Jolitz
|_
|
|
|
|
|
| 1 --text follows this line--
| 
|
|   Omid omidl...@gmail.com writes:
|
|- This does NOT export correctly (code block is not detected)
|#+BEGIN_SRC sh ls #+END_SRC Is there any way around this behavior
|without removing the indentation for the code block delimiters?
|
|   I think the 'official'regexp to detect a src-block starts like this
|
|   ,--
|   ^\\([ \t]*\\)#\\+begin_src [...]
|   `--
|
|   so I would guess that this should work, and its a bug if it doesn't.
|
|   Inside a list like like this
|
|   - First item
|
| ,
| | (+ 3 4)
| `
|
|   ,
|   | 7
|   `
|
|
|   - Second Item
|
| Some text
|
|   it should work too, lets test:
|
|   ,
|   | (with-current-buffer
|   | (current-buffer)
|   |   (org-export-as 'ascii))
|   `
|
|
|   -- cheers, Thorsten
`---

looks as if it works for me ...

--
cheers,
Thorsten




Re: [O] Org mode export to HTML not working correctly with code blocks if block is after an item (-) and its delimiters are indented

2013-10-15 Thread Thorsten Jolitz

PS: 

Omid omidl...@gmail.com writes:

 When exporting to HTML (Org mode version 8.2.1 ELPA; GNU Emacs version
 24.3.1) I see the a strange behavior which can be reproduced with the
 following minimal example:

 This exports correctly
   #+BEGIN_SRC sh
 ls
   #+END_SRC

 - This also exports correctly
 #+BEGIN_SRC sh
 ls
 #+END_SRC

 - This does NOT export correctly (code block is not detected)
   #+BEGIN_SRC sh
 ls
   #+END_SRC

 Is there any way around this behavior without removing the indentation
 for the code block delimiters?

 This exports correctly
#+BEGIN_SRC sh
 ls
#+END_SRC

 - This also exports correctly
#+BEGIN_SRC sh
 ls
#+END_SRC

 - This does NOT export correctly (code block is not detected)
#+BEGIN_SRC sh
 ls
#+END_SRC


#+begin_src emacs-lisp :exports value
   (with-current-buffer
   (current-buffer)
 (org-export-as 'html))
#+end_src

#+results:
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
[...]
This exports correctly
/p
div class=org-src-container

pre class=src src-shls
/pre
/div

ul class=org-ul
liThis also exports correctly
/li
/ul
div class=org-src-container

pre class=src src-shls
/pre
/div

ul class=org-ul
liThis does NOT export correctly (code block is not detected)
p
#+BEGIN_SRC sh
/p
/li
/ul
p
ls
/p
p
#+END_SRC
/p

with html export, the last case does look quite different from the other ones.

-- 
cheers,
Thorsten




Re: [O] Org mode export to HTML not working correctly with code blocks if block is after an item (-) and its delimiters are indented

2013-10-15 Thread Omid
Thank you for your quick reply, Thorsten.

Yes, as I mentioned, and as you noticed, the HTML export does not seem
to work correctly for the last case. The #BEGIN_SRC and #END_SRC
delimiters are exported literally.

--
Omid

Sent from my Emacs

On 10/15/2013 10:53 PM, Thorsten Jolitz wrote:
 
 PS: 
 
 Omid omidl...@gmail.com writes:
 
 When exporting to HTML (Org mode version 8.2.1 ELPA; GNU Emacs version
 24.3.1) I see the a strange behavior which can be reproduced with the
 following minimal example:

 This exports correctly
   #+BEGIN_SRC sh
 ls
   #+END_SRC

 - This also exports correctly
 #+BEGIN_SRC sh
 ls
 #+END_SRC

 - This does NOT export correctly (code block is not detected)
   #+BEGIN_SRC sh
 ls
   #+END_SRC

 Is there any way around this behavior without removing the indentation
 for the code block delimiters?
 
  This exports correctly
 #+BEGIN_SRC sh
  ls
 #+END_SRC
 
  - This also exports correctly
 #+BEGIN_SRC sh
  ls
 #+END_SRC
 
  - This does NOT export correctly (code block is not detected)
 #+BEGIN_SRC sh
  ls
 #+END_SRC
 
 
 #+begin_src emacs-lisp :exports value
(with-current-buffer
(current-buffer)
  (org-export-as 'html))
 #+end_src
 
 #+results:
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
 [...]
 This exports correctly
 /p
 div class=org-src-container
 
 pre class=src src-shls
 /pre
 /div
 
 ul class=org-ul
 liThis also exports correctly
 /li
 /ul
 div class=org-src-container
 
 pre class=src src-shls
 /pre
 /div
 
 ul class=org-ul
 liThis does NOT export correctly (code block is not detected)
 p
 #+BEGIN_SRC sh
 /p
 /li
 /ul
 p
 ls
 /p
 p
 #+END_SRC
 /p
 
 with html export, the last case does look quite different from the other ones.