Re: [O] Importing from Oddmuse?

2013-10-30 Thread Marcin Borkowski
Dnia 2013-10-30, o godz. 18:44:53
Peter Davis  napisał(a):

> On Thu, Oct 31, 2013 at 02:38:48AM +0530, Jambunathan K wrote:
> > Peter Davis  writes:
> > 
> > > I've used Oddmuse for years to maintain my own personal Wiki, but
> > > now I'm looking to move to Org mode.
> > 
> > I am in the process of adding Org-mode markup support to the Oddmuse
> 
> That would be great. I'd love to use the same markup everywhere.

+1

> 
> Thanks,
> -pd
> 
> 
> > One can also look at the churnings happening here:
> > 
> >http://repo.or.cz/w/orgmuse.git
> 



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



[O] Setting org-insert-heading-hook while in a minor mode

2013-10-30 Thread Matt Price
Hi everyone,

I am trying to write a minor mode that will help me write a little
more efficiently.

While I'm in that mode, I want to insert a properties drawer every
time I create a new heading.  So I would like to temporarily change
"org-insert-heading-hook" when the minor mode is active.  It's not
obvious to me that there's a way to set a file-local variable while in
a minor-mode -- does anyone know if there is, and I'm just missing it?

Also, I would like if possible for the properties drawer to be
pre-populated with certain properties  Is that also possible?

Thanks,

Matt



Re: [O] org-agenda moves point in all org agenda buffers

2013-10-30 Thread Samuel Wales
Is anybody familiar enough with the code to have guesses why this bug occurs?


On 10/28/13, Samuel Wales  wrote:
> Point is moved to beginning of buffer in every agenda file when I run
> the agenda.
>
> emacs -Q with a minimal test case and (setq org-agenda-window-setup
> 'current-window) has the bug.
>
> Same thing without it does not.
>
> Thanks.
>
> Samuel
>


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

The disease DOES progress.  MANY people have died from it.  ANYBODY can get it.

Denmark: free Karina Hansen NOW.



Re: [O] Only display hours and minutes, not seconds

2013-10-30 Thread Nick Dokos
Cecil Westerhof  writes:

> I have the following table:
> |--|
> | Duration |
> |--|
> | 2@ 15    |
> | 2@ 30    |
> | 2@ 30    |
> | 0@ 45    |
> |--|
> | 8@ 0' 0" |
> |--|
> #+TBLFM: @>$1=vsum(@2..@-1)
>
> I would like the total be displayed like:
>     8@ 00'
> instead of:
>     8@ 0' 0"
>
> Is this possible?
>

You can get close by setting org-calc-default-modes as follows:

(setq org-calc-default-modes '(calc-internal-prec 12
   calc-float-format (float 8)
   calc-angle-mode deg
   calc-prefer-frac nil
   calc-symbolic-mode nil
   calc-date-format ( "-" MM "-" DD " " Www (" 
" hh ":" mm))
   calc-display-working-message t
   calc-hms-format "%s@ %02s'"))

This is the default setting except for calc-hms-format. It does not
quite do what you want, but it's close (I expected the %02s to zero-fill
on the left, but apparently it does not for the %s format):

|--|
| Duration |
|--|
| 2@ 15|
| 2@ 30|
| 2@ 30|
| 0@ 45|
|--|
| 8@  0'   |
|--|
#+TBLFM: @>$1=vsum(@2..@-1)

-- 
Nick




Re: [O] Setup for switching between 2 org-mode configurations (demo/productive)?

2013-10-30 Thread Alexander Baier
M  writes:

> Hi,
>
> I'd like to set up org-mode in a way to separate my personal data from my
> gerenal settings.
>
> Why?
> I'd like to be able to quickly and easily create tutorials or minimal
> examples with sample data without having to worry about publishing
> private/personal information anywhere.
> So I'm searching for a way to "disable" all personal data with one command
> and easily re-enable them later.
>
> I assume that some of you already have something like that or can recommend
> a way for doing so?
> I'm using Mercurial for versioning my org-mode files (but honestly I have no
> ideas about the advanced features of version control like branching,
> merging, etc., I'm just abusing it for regularly storing backups of my setup
> and data and making a diff, if something got messed up or accidently
> deleted).
>
> Kind regards
>
> Martin

You might want to watch Cask.el [1] as you might be able to configure a
little emacs instace with only those things that you need for that demo
fairly easily. There are certainly some interesting things there.


Regards,
  Alex

___
[1]  https://github.com/cask/cask





[O] org-odt-export-to-odt, tables bug in OO

2013-10-30 Thread Uwe Brauer

OO and Libre Office have a langstanding bug 

https://issues.apache.org/ooo/show_bug.cgi?id=7747

The select all function does not work in a  document which starts with a
table there is a workaround but this workaround does not work for odt
files generated by the org converter.

Now I generated by the org converter a document which I attach,
Please look at the following document, which has been generated by a
converter provided by org[.

It contains tables which whose text cannot be selected via select all.
If there is something wrong with the odt, please tell me and I will
report it on the org mailing list.

thanks

Uwe Brauer 
now johnny smith  told me:

,
| 
| notwithstanding dave's comment, the odt seems either defective or
| incompatible with aoo (which may be aoo's fault as well). more
| specifically, the tables are quite lonely within their sections. they
| have no text before them, nor after. such a document can't be created
| by usual means of aoo, and thus it isn't handled as expected. e.g.,
| you can't type anything after the second table or after the first one
| within its section, because there're no empty paragraphs after the
| tables to take your input. you can't even peform select-all operation
| manually (with a mouse rather than through ctrl+a). it seems that the
| select operation uses contents of the  elements to set
| boundaries of the selection. so, if there's no such element, then
| select-all doesn't work properly.
| 
| to fix this, i inserted the following two paragraphs into content.xml of your 
file:
| 
| some text after the first 
table
| some text after the second 
table
| 
| they follow the closing tags () of tables. there
| appeared to be no way to do it through gui.
| 
| after that select-all worked almost smoothly: it selected the cell on
| the first press, the table on the second one and everything on the
| third one. what was wrong is that it always started with the cell,
| even when the caret was outside table.
| 
| however, inserting a paragraph before each table fixed this. it didn't
| require editing content.xml. the final version of the file is
| attached, and i hope it won't be attenuated by antispam.
| 
| i can't say on which program's account this bug is. consulting odf
| specification may help answer this question
`

I attach both files:


Uwe Brauer 


testorg.odt
Description: application/vnd.oasis.opendocument.text


testorg-ok.odt
Description: application/vnd.oasis.opendocument.text


smime.p7s
Description: S/MIME cryptographic signature


[O] NOT SOLVED Re: RLT (hebrew) tables and org-odt-export-to-odt problems

2013-10-30 Thread Uwe Brauer
>> "Jambunathan" == Jambunathan K  writes:

   > In LibreOffice, 

   > Right click on the table->Table->Text Direction->Right-to-Left.

   > Now, does what you see seem right to you?

Sorry, my answer was premature.
Your solutions, converts the order of all rows, but this is not correct
in general, for example
if the first is hebrew R2L, but the second is L2R.

So your solutions solves the hebrew part but screws up the english part.

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] RLT (hebrew) tables and org-odt-export-to-odt problems

2013-10-30 Thread Uwe Brauer
>> "Jambunathan" == Jambunathan K  writes:

Strangely enough, I don't see your answer on gmane.
   > In LibreOffice, 

   > Right click on the table->Table->Text Direction->Right-to-Left.

Aha, 
   > Now, does what you see seem right to you?

Yes indeed it does!!

I fiddled around with a function which converts the order of the words,
not the letters in the row[1]. But this solution is better, it never
occurred to me to look for such a functionality in OO (I am using AOO,
because of a bug in LibreOffice concerning niqqud in hebrew)
 

   > As a side-note, the OrgOdtStyles.xml using a LibreOffice that uses en-GB
   > (IN).  So, there could be "issues" when it is used with "other"
   > languages.

   > You will be better of creating a .ott file that uses language and
   > country of your choice.

   > See Tools->Options->Language Settings->Languages->Default Languages for
   Documents-> Whatever.

   > I have seen recommendations of using CTL->Hebrew.


This I have activated of course, but this is for documents which are 
*generated* by OO.

   > 

   > As an experiment, look at your *Messages* buffer and see where the
   > exporter is loading OrgOdtStyles.xml from.  In the same directory, there
   > would be a OrgOdtContentTemplate.xml.  Look for the "OrgTable" style
   > spec.

There is a problem. 
I attach parts of the *Messages* buffer. It seems he does this in a
directory in /tmp/odt-1217v_I/
but the directory is already deleted, can this be?


,
| Debug (ox-odt): Searching for OpenDocument styles files...
| Debug (ox-odt): Trying /usr/share/emacs/etc/org/styles/... [2 times]
| Debug (ox-odt): Trying /home/oub/.emacs.d/etc/styles/...
| Debug (ox-odt): Trying /home/oub/.emacs.d/elpa/org-20130617/etc/styles/...
| Debug (ox-odt): Using styles under 
/home/oub/.emacs.d/elpa/org-20130617/etc/styles/
| Debug (ox-odt): Searching for OpenDocument schema files...
| Debug (ox-odt): Trying /usr/share/emacs/etc/org/schema/... [2 times]
| Debug (ox-odt): No OpenDocument schema files installed
| Using vacuous schema
| LaTeX to MathML converter not available.
| Formatting LaTeX using verbatim
| Wrote /tmp/odt-1217v_I/meta.xml
| Using vacuous schema [2 times]
| Saving file /tmp/odt-1217v_I/styles.xml...
| Wrote /tmp/odt-1217v_I/styles.xml
| Wrote /tmp/odt-1217v_I/mimetype
| Using vacuous schema
| Saving file /tmp/odt-1217v_I/META-INF/manifest.xml...
| Wrote /tmp/odt-1217v_I/META-INF/manifest.xml
| Saving file /tmp/odt-1217v_I/content.xml...
| Wrote /tmp/odt-1217v_I/content.xml
| (No changes need to be saved)
| Creating ODT file...
| Running zip -mX0 tabler2l.odt mimetype
| Running zip -rmTq tabler2l.odt .
`



   > Now re-export.  See whether things are OK.

I am keen to test this, but right now I am stacked since I don't know
where to find these style files.


BTW there is another problem with table export which I will report in a
different message.

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] Importing from Oddmuse?

2013-10-30 Thread Peter Davis
On Thu, Oct 31, 2013 at 02:38:48AM +0530, Jambunathan K wrote:
> Peter Davis  writes:
> 
> > I've used Oddmuse for years to maintain my own personal Wiki, but now
> > I'm looking to move to Org mode.
> 
> I am in the process of adding Org-mode markup support to the Oddmuse

That would be great. I'd love to use the same markup everywhere.

Thanks,
-pd


> One can also look at the churnings happening here:
> 
>http://repo.or.cz/w/orgmuse.git



Re: [O] [RFC] [PATCH] [parser] org-element.el: Handle block parameters

2013-10-30 Thread Aaron Ecay
Hi Nicolas,

2013ko urriak 30an, Nicolas Goaziou-ek idatzi zuen:
> IIRC, I already suggested a solution with Babel for this problem.
> There's no need to complicate core Org syntax for such a specific
> case.

And I already said why I disagree that your proposal is a solution.
Special blocks are “Containers targeted at export back-ends” (according
to the manual).  Is it appropriate for such containers to have metadata
attached?  As I explain below, I think so.  Whether you approve or
disapprove of the use to which someone puts that metadata in a specific
instance is a different question, as long as we agree that the metadata
is potentially useful for some things.

> 
>> I also think it would be nice for the org code following this paragraph
>> to be translated to output that makes sense for each backend, with the
>> quote’s author formatted nicely (on a new line preceded by a dash,
>> aligned to the right margin in text/html, using the csquotes package in
>> latex, etc.).  This patch would enable such a functionality.
>> 
>> #+begin_quote Chico Marx
>> Why a duck?
>> #+end_quote
> 
> Well actually, this kind of syntax is confusing at best. Something like
> the following could be used instead:
> 
>   #+begin_quote :author Chico Marx

That is a good idea.

> 
> Actually, there are two points to consider:
> 
>   1. Providing something like :author implies that all back-ends in core
>  and contrib and the manual have to be updated accordingly.

Yes, that is desirable eventually.  I guess whoever implements :author
for quotes (maybe it will be me) will need to think about all these
things.  (Though I’m not sure that all backends have to be updated in
one fell swoop.  The old behavior is still fine as a fall-back until all
backends catch up to the new standard.  I’m thinking specifically of
backends in contrib – certainly the core exporters for html, latex, and
plain text should move in tandem.  I’m not sure there is any single
person who knows the details of all the available export formats well
enough to make a change like this across all of them.)

> 
>   2. "parameters" is too vague to be useful. It needs to be parsed
>  further, which means that we must define explicitly use cases and
>  keywords. Thus, I don't think adding "parameters" to every block is
>  a good move if we don't know beforehand how they will be used.
> 
>  Though, it is possible to extend the syntax to well-defined
>  specific cases. :author may be one of them, there are certainly
>  others.

I have the opposite view.  The parser should provide a set of convenient
tools to elisp code, which are useful for extending org’s functionality
at the elisp level.  An “if you build it they will come” approach.  One
very successful recent example of this is the attr_backend syntax.  This
allows specifying data in a very open-ended format to export backends.
I think people (including me) have been able to take advantage of this
fact to incrementally improve export backends.

Importantly, it was not necessary to define beforehand what keys and
values are available in attr_backend lines.  There is just free-form
data, which anyone’s lisp code can hook into for whatever purpose.  If
such an addition is useful and general-purpose enough, it can be added
to the official export backend; otherwise it just lives in users’
configured export filters.

Aaron

(An alternative proposal which would work just as well – better even,
insofar as it applies to things other than special blocks – would be to
provide a backend-agnostic #+attr: syntax (maybe with a different name,
to avoid clashing with export-specific #+attr_foo).  The :author
information (for example) could then be put there.  But I shaped this
proposal based on what was already present in the documentation.)

-- 
Aaron Ecay



Re: [O] maintaining Org

2013-10-30 Thread Carsten Dominik
Hi David,

do you have FSF papers?  If so, write to Jason Dunsmore and send him your 
public key.
Thanks you!

- Carsten
On 30.10.2013, at 12:40, david...@riseup.net wrote:

> Hello,
> 
> I would like git permissions to maintain org-license.el and
> org-effectiveness.el from org-mode instead of worg.
> 
> Thanks in advance.
> 
>> Dear org community members,
>> 
>> I am sure you have noticed that I am not really able to put in
>> a lot of time as the maintainer of Org.  This is not good, but
>> right now we do not have another candidate who would be willing
>> to take over and do a better job.  Unfortunately my time constrains
>> only allow a limited amount of work I can do.  Fortunately
>> we have extremely good and active people around here.  I trust
>> them fully, and I am sure things will move ahead well.  I will
>> keep trying to answer to most important and strategic questions.
>> Feel free to remind me if I have not reacted to something critical
>> where my input is necessary.
>> 
>> - Carsten
>> 
>> 
> 
> 




Re: [O] Capture templates with "function" type

2013-10-30 Thread Alexander Baier
Brett Viren  writes:

> Hi,
>
> I'm trying to set up a capture template of type "function" in order to
> produce a daily log file named after today's date.
>
> It mostly works.  However, after doing the C-cC-c to close the capture
> buffer the window is left holding the daily log file which the capture
> just updated instead of going back to whatever buffer I was in when I
> initiated the capture.  This returning-to-previous-buffer behavior is
> what I see when I use the file+headline capture type.
>
> Can someone say how I might get this behavior for the "function" capture
> type as well?  Here is my setup:
>
> (defun bv-daily-log-file ()
>   (find-file (concat "~/org/web/notes/" 
>   (format-time-string "%Y-%m-%d") ".org"))
>   (goto-char (point-max))
>   (newline 2)
> )
> (setq org-capture-templates 
>  (quote 
>   (
>("n" "Note" entry
> (function bv-daily-log-file)
> "\* %U %^{title}\n  %a\n\n%?"
> :empty-lines 1)
>)))
>
>
> Thanks,
> -Brett.

Hello Bret,

I do not know, how the capture process works internally, but if I had to
guess I would say, that it stores the current window configuration, when
a capture template is invoked that is not of type funcion. This
configuration is restored after finishing or canceling the capture
process.  I would say, when using the function template type, you might
have to roll your own window-configuration management, if that is the
behaviour you want.


Regards,
  Alex




[O] Only display hours and minutes, not seconds

2013-10-30 Thread Cecil Westerhof
I have the following table:
|--|
| Duration |
|--|
| 2@ 15|
| 2@ 30|
| 2@ 30|
| 0@ 45|
|--|
| 8@ 0' 0" |
|--|
#+TBLFM: @>$1=vsum(@2..@-1)

I would like the total be displayed like:
8@ 00'
instead of:
8@ 0' 0"

Is this possible?

-- 
Cecil Westerhof


Re: [O] [PATCH 2/3] Mark some org-babel variables as safe locals under proper conditions

2013-10-30 Thread Eric Schulte
These look great, I've just applied them.  I had to make very minor
changes to appease the compiler (see ac9d801).

Thanks!

Aaron Ecay  writes:

> Hi Eric,
>
> Thanks for the feedback.  You are right that this could be more
> extensible.  I’m attaching a new version of patches #2 and 3 to this
> email, which should be an improvement on that front.  I also added
> docstrings, and a test.
>
> Aaron
>
> PS You were right about org-every vs. mapcar in your other message.

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



Re: [O] [PATCH] lisp/ob-C.el (org-babel-C-execute): turn on inhibit-lisp eval

2013-10-30 Thread Eric Schulte
Applied thanks.

Oleh  writes:

> Hi all,
>
> Here's a patch to turn this:
>
> #+begin_src C :results output
> puts("[1] 2 3 3");
> #+end_src
>
> #+RESULTS:
> : [1]
>
> into this:
>
> #+begin_src C :results output
> puts("[1] 2 3 3");
> #+end_src
>
> #+RESULTS:
> : [1] 2 3
>
> regards,
> Oleh
>
> From 3cde8ae1316762e106c2229a1661b31de56bc3f9 Mon Sep 17 00:00:00 2001
> From: Oleh Krehel 
> Date: Wed, 30 Oct 2013 08:50:33 +0100
> Subject: [PATCH] lisp/ob-C.el (org-babel-C-execute): turn on inhibit-lisp eval
>
> ---
>  lisp/ob-C.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/ob-C.el b/lisp/ob-C.el
> index e9eec93..c35b3d0 100644
> --- a/lisp/ob-C.el
> +++ b/lisp/ob-C.el
> @@ -106,7 +106,7 @@ or `org-babel-execute:C++'."
>  ((lambda (results)
> (org-babel-reassemble-table
>   (org-babel-result-cond (cdr (assoc :result-params params))
> -   (org-babel-read results)
> +   (org-babel-read results t)
> (let ((tmp-file (org-babel-temp-file "c-")))
>   (with-temp-file tmp-file (insert results))
>   (org-babel-import-elisp-from-file tmp-file)))

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



Re: [O] Help on spreadsheet/calc references and improvements

2013-10-30 Thread Michael Brand
Hi Carsten

On Fri, Oct 25, 2013 at 3:31 PM, Carsten Dominik
 wrote:
> On 24.10.2013, at 22:47, Michael Brand  wrote:
>> On Thu, Oct 24, 2013 at 8:18 AM, Carsten Dominik
>>  wrote:
>>> Applied, thanks.
>>
>> I can not see the commit, is it pushed?
>>
>>> Michael, would you like to have write access to the git repo?
>>
>> Thank you for the trust. As I would like anyway to have a review of my
>> patches before commit, I think it would not help when I would do the
>> commit myself. I hope that it is still ok when I prefer a review,
>> independent of the simplicity of the patch.
>
> Yes, reviews are always good!  But with write access you can still
> install a patch yourself after a review, or make small doc fixes
> without review etc.

Hi Carsten

Ok, I see that it would help when I "git push" those of my simple
changes that maybe don't need a review by a maintainer at any price to
the master branch myself. I already have write access to Worg, do you
still need my public key?

My question about the whereabouts of my patch
0001-Improve-manual-for-table-formulas.patch.txt that is already
"applied" has been overlooked and if I understand correct it is in
your repo but not yet in the main repo. Since the main repo changed
meanwhile, I assume it will create push conflicts on your side. If
this is correct then please get rid of the patch in your repo and I
will take care of the rest.

Michael



Re: [O] [Refile] Make agenda-files and current file targets

2013-10-30 Thread Alexander Baier
Hello, it's me again,

I figured out, what was wrong with the original code.  I had gotten the
parentheses  of the lambda wrong, which messed all this up.

I modified the code and refactored the lambda out into a proper
function, as you can see below:


(defun dl-org-refile-targets ()
  (unless (member (buffer-file-name) org-agenda-files)
(buffer-file-name)))

(setq org-refile-targets
  (quote ((org-agenda-files  :maxlevel . 4)
  (dl-org-refile-targets :regexp . ".*"


This does not throw any error anymore.  I have, however, come upon
another problem that manifests itself when calling org-refile with the
cursor upon a heading in a file that is not a member of
org-agenda-files: I see "Getting targets..." in the modeline, which
takes a long time (I canceled it after ~2 minutes).

What exactly does :regexp . ".*" do? I thought it would simply take
_all_ headlines in the file indicated by dl-org-refile-targets.  The
file I testet this with has less than 100 headlines and I have no
idea why this takes so long.

After changing the contraint to :maxlevel 4 as you can the below, it
works just fine.  (Note: The file in question has only headlines with
levels <= 2)


#+begin_src emacs-lisp
  (defun dl-org-refile-targets ()
(unless (member (buffer-file-name) org-agenda-files)
  (buffer-file-name)))
  
  (setq org-refile-targets
(quote ((org-agenda-files  :maxlevel . 4)
(dl-org-refile-targets :maxlevel . 4


What did I miss here? Any help is appreciated.


Regards,
  Alex




Re: [O] [PATCH] Longtable continuation strings customizable

2013-10-30 Thread Thomas S. Dye
Nicolas Goaziou  writes:

>> An example filter?
>
>   (defun my-personal-table-continuation-strings (row backend info)
> (when (org-export-derived-backend-p 'latex)
>   (replace-regexp-in-string
>"multicolumn{[0-9]+}{l}{\\(.*\\)}" "String 1"
>(replace-regexp-in-string
> "multicolumn{[0-9]+}{r}{\\(.*\\)}" "String 2"
> row nil nil 1)
>nil nil 1)))
>   (add-to-list 'org-export-filter-table-row-functions
>'my-personal-table-continuation-strings)
>
> Untested.

I can't get this to work :(

I have this, based on the example above:

#+name: tsd-continuation-strings
#+begin_src emacs-lisp
  (defun my-personal-table-continuation-strings (row backend info)
(when (org-export-derived-backend-p 'latex)
  (replace-regexp-in-string
   "multicolumn{[0-9]+}{l}{\\(.*\\)}" "\\ldots\\ continued from previous 
page"
   row nil nil 1)
   (replace-regexp-in-string
"multicolumn{[0-9]+}{r}{\\(.*\\)}" "continued on next page \\ldots"
   row nil nil 1)))
  (add-to-list 'org-export-filter-table-row-functions
   'my-personal-table-continuation-strings)
#+end_src

I also tried 'org-export-filter-table-functions without success.  I
always get the default continuation strings.  I've looked around for an
error message, but there doesn't appear to be one, at least that I can
find. The asynchronous export runs through to completion.

All the best,
Tom

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



Re: [O] make new links show as figures?

2013-10-30 Thread Rick Frankel

On 2013-10-26 08:10, John Kitchin wrote:

Other than having to repeat yourself, wouldn't the
[[custom:file.ext][file:file.png]] syntax allow for most/all of the
use cases mentioned?

rick

Yes, I think [[custom:file.ext][file:file.png]] would cover all
those cases.


So it turns out that this is a REALLY simple patch (two characters):

--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18853,7 +18853,7 @@ BEG and END default to the buffer boundaries."
(widen)
(setq beg (or beg (point-min)) end (or end (point-max)))
(goto-char beg)
-   (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
+   (let ((re (concat 
"\\[.*\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"

(substring (org-image-file-name-regexp) 0 -2)
"\\)\\]" (if include-linked "" "\\]")))
(case-fold-search t)

This seems to work in all cases I can think of (see test file below).
Let me know if this works for you and i will apply to master when i
get home and have git push access.

rick
- 8< 
* Setup (babel me)
#+BEGIN_SRC dot :file "image1.png"
digraph { one }
#+END_SRC

#+BEGIN_SRC sh
echo "digraph { one }" > image1.dot
#+END_SRC

#+RESULTS:
[[file:image1.png]]

#+BEGIN_SRC dot :file "image2.png"
digraph { two }
#+END_SRC

#+RESULTS:
[[file:image2.png]]
* Tests
** file link
- with  path (=./=)
[[file:./image1.png]]
- without path
[[file:image1.png]]
** no uri link
- with path ( =./=)
[[./image1.png]]
- without path (this does not expand as an image)
[[image1.png]]
** with description
Note: this does not expand as an image unless
`org-display-inline-images' is called with =include-linked=  true.
[[file:./image1.png][an image]]
** image in description
[[./image1.dot][./image1.png]]
** in both
This will always display the image in the description regardless of
the value of the =include-linked= argument to
`org-display-inline-images' (but open the image in the link).

[[./image1.png][./image2.png]]





Re: [O] [PATCH] Table continuation strings

2013-10-30 Thread Thomas S. Dye
Nicolas Goaziou  writes:

> Hello,
>
> t...@tsdye.com (Thomas S. Dye) writes:
>
>> Patch includes table continuation strings for several languages.
>> Translations all from the internet.  Caveat emptor.
>
> Applied. Thank you.
>
>> + ("ja" :utf-8 "前ページから続く")
>
> [...]
>
>> + ("ja" :utf-8 "次ページに続く")
>
> These will not be very helpful, though, as `latex' back-end (the only
> one to use this string so far) relies on :latex or :default properties,
> never on :utf-8.

We'll need a Japanese-speaking LaTeX user to chime in here. I've never
typeset Japanese in LaTeX and don't speak or read the language.

All the best,
Tom

-- 
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



[O] [PATCH] hide inline-tasks in 'children visibility state

2013-10-30 Thread Jonas Hörsch
hej,

one more patch, which takes care of re-hiding inline-tasks
properly. finally it is possible to work with longer inline tasks
without them getting always in the way.

just bump me, if anything is not to your liking

cheers,
jonas

From 447d528263728ea56f390ae8dfdfa99880d6ccb4 Mon Sep 17 00:00:00 2001
From: Jonas Hoersch 
Date: Wed, 30 Oct 2013 15:39:33 +0100
Subject: [PATCH] org-inlinetask: hide inline tasks in 'children visibility
 state

* lisp/org.el (org-cycle-hide-inline-tasks): re-hide inline tasks when
  switching to 'children visibility state.

TINYCHANGE
---
 lisp/org.el | 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 4f3bf4b..b93f3f4 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7074,11 +7074,19 @@ open and agenda-wise Org files."
 	  (org-flag-drawer t))
 
 (defun org-cycle-hide-inline-tasks (state)
-  "Re-hide inline task when switching to 'contents visibility state."
-  (when (and (eq state 'contents)
-	 (boundp 'org-inlinetask-min-level)
-	 org-inlinetask-min-level)
-(hide-sublevels (1- org-inlinetask-min-level
+  "Re-hide inline tasks when switching to 'contents or 'children
+visibility state."
+  (cond ((eq state 'contents)
+	 (when (and (boundp 'org-inlinetask-min-level)
+		org-inlinetask-min-level)
+	   (hide-sublevels (1- org-inlinetask-min-level
+	((eq state 'children)
+	 (when (featurep 'org-inlinetask)
+	   (save-excursion
+	 (while (and (outline-next-heading)
+			 (org-inlinetask-at-task-p))
+	   (org-inlinetask-toggle-visibility)
+	   (org-inlinetask-goto-end)))
 
 (defun org-flag-drawer (flag)
   "When FLAG is non-nil, hide the drawer we are within.
-- 
1.8.4



pgpGN2vVjEvqP.pgp
Description: PGP signature


Re: [O] [RFC] Slight change to asynchronous export

2013-10-30 Thread Rick Frankel

On 2013-10-30 06:00, Nicolas Goaziou wrote:

Helo,
For reference, here is the suggested patch.

Is there any strong point against it?


looks great to me.

rick



Re: [O] Query about org-beamer-select-environment

2013-10-30 Thread Rasmus

Hi, 

Nicolas Goaziou  writes:

> John Hendy  writes:
>
>> I went to access the BEAMER_act property via C-c C-b and see it's not
>> listed in the minibuffer choices (attached) The manual describes this
>> function like so:[1]
>>
>> C-c C-b (org-beamer-select-environment)In org-beamer-mode, this
>> key offers fast selection of a Beamer environment or the BEAMER_COL
>> property.
>>
>> Looking at the options, this looks pretty accurate, though one might
>> say that BMCOL is more about a property of the resulting
>> environment/property than a specific environment itself. Just curious
>> about the possibility of adding the other possible beamer-specific
>> properties in such a handy picker, as I often forget and then need to
>> go look at the manual.
>>
>> It looks like BEAMER_act and BEAMER_opt are the only ones not in that list.
>
> Good idea. What binding do you suggest?
>
> I thought about "<" for BEAMER_ACT and "[" for BEAMER_OPT, but that may
> not be optimal.

Good suggestion, John.  I've been setting these via C-c C-x p.

On of my computers has a UK keyboard.  As I remember it '<' is
annoying to get to (shift-, I think).  '[' is annoying on a Danish
keyboards ("Right M"-8).

In any case, why not stick with a key that almost surely doesn't
require a modifier?  It's probably not as logically pleasing as your
suggestion, but still. . .

–Rasmus

-- 
A page of history is worth a volume of logic




Re: [O] [RFC] [export] synctex support for ox-latex

2013-10-30 Thread Rasmus
Hi Aaron,

Aaron Ecay  writes:

>> It doesn't work for me however.  Or perhaps I just don't get it.  I am
>> expecting it to work similarly to AUCTeX-synctex and other non-Emacs
>> editors supporting synctex.  E.g. a red box usually pops up,
>> highlighting the correct line and I'm able to jump back from the pdf
>> to the source.  Neither works.
>
> Indeed, the jump from emacs -> pdf is not implemented.  I’ve got some
> complicated dbus voodoo (attached to this email, in case it is useful
> for you or others) in my init.el to get that working with AucTeX – I am
> also using evince as the viewer).  So I will have to investigate how to
> add that feature.

For me it works out of the box.

The relevant bits to get Synctex in AUCTeX working for me are:

   (setq TeX-source-correlate-mode t
 TeX-source-correlate-method 'synctex)

using AUCTeX-git from May 27 this year.

> The jump from pdf viewer -> org should be working though, assuming it
> does for you in auctex.  (I also have some dbus arcana for that portion
> in my init.el file; I assume you do too).

No dbus stuff in my Emacs.  The only dbus thing I do is when I start
my window manager in xinitrc:

   exec dbus-launch --exit-with-session i3

Further, I run the following standard  Archlinux xinit stuff:

# launches a session dbus instance
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && type dbus-launch >/dev/null; then
  eval $(dbus-launch --sh-syntax --exit-with-session)
fi

That's it.

> Ideally, I think ox-synctex should eventually include the configurations
> for as many pdf viewers as possible, so that users do not need to
> configure this themselves.  (Ideally x 2, some external library would
> already provide this...)

I think AUCTeX is the reference here.  It works as well as TeXWorks
wrt. Synctex now.

>> I tested it with emacs -q.  
>> 
>> Note, there should probably be some require statement in the top of
>> your file.  ox-latex would work, but you might only need org-element.
>
> This is right; I added both just to be safe (and dired, which was also
> needed since I borrow a defcustom from there).

Something is still missing.  When running the following test from
emacs -q I get the
included error

#+BEGIN_SRC emacs-lisp
(load "~/.emacs.d/lisp/ox-synctex.el")
(setq org-latex-pdf-process 
  '("pdflatex -synctex=1 -interaction nonstopmode -output-directory %o %f"))
(ox-synctex-activate)
(org-latex-export-to-pdf)
#+END_SRC
* test
results in 
: ad-Advice-org-export-as: Invalid function: ((symbol-function (quote 
org-no-properties)) (lambda (s &optional _restricted) s))

It works with my normal Emacs.

> One thing I forgot to mention in my last email is that you need to
> customize your org-latex-pdf-process to make the latex compiler generate
> a synctex file.  (This is a command line switch, but it differs across
> (pdf/xe/lua)tex.)  So this could be why it does not work for you in
> emacs -q.  The following bit of code suffices, after M-x load-library
> ox-latex:
>
> (setq org-latex-pdf-process 
>   '("pdflatex -synctex=1 -interaction nonstopmode -output-directory %o 
> %f"))
>
> I attach another version of the patch, with the missing requires as well
> as some more logging code.  If it doesn’t work for you, could you
> perhaps send me the lines in *Messages* generated by the export?

I think I also added it yesterday when I tested it.

ox-synctex: active during latex compile
Processing LaTeX file ./test.tex...
Process completed.
ox-synctex: no concordance, not patching.
ox-synctex: done, hoorah!
Running evince /home/rasmus/download/tmp/test.pdf...done

I'm still not able to go to the source from Evince.

Perhaps I'll have time to do proper debugging over the weekend, but no
promises.

–Rasmus


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



[O] [Refile] Make agenda-files and current file targets

2013-10-30 Thread Alexander Baier
Hello,

I am trying to configure my refiling targets in a way, that allows me to
refile to any of the files in org-agenda-files, as well as to the file
displayed by the current buffer, if it is not included in
org-agenda-files.  Additionally, I want the headings in agenda-files to
be included up to level 4, but of current file every heading should be
considered a target.

This is what I came up with so far:


(setq org-refile-targets
  (quote ((org-agenda-files :maxlevel . 4)
  (#'(lambda ()
   (unless (member (buffer-file-name) org-agenda-files)
 (buffer-file-name)) :regexp . ".*")


The problem here is, that the lambda evaluates to nil when
(buffer-file-name) is a member of org-agenda-files. And this nil in turn
isn't anything org-refile understands (Upon C-c C-w I get "Bad refiling
target description nil").

Does anyone know how to go about this and can give me soem pointers?


Regards,
  Alex



Re: [O] [RFC] Simple cache mechanism for `org-element-at-point'

2013-10-30 Thread Eric Abrahamsen
Nicolas Goaziou  writes:

> Nicolas Goaziou  writes:
>
>> Here is a slight change to the second one, which will correctly reset
>> cache when some variables are customized or when a buffer is refreshed
>> (C-c C-c on a keyword).
>
> By the way, almost a month has passed since the first message in this
> thread. Is someone still testing, or reviewing, it? I know it is
> a non-trivial and quite sensitive change, so if one needs more time to
> evaluate it, I certainly can wait more.
>
> Otherwise, it might be better to simply apply it on master and cope with
> the bugs.

I wasn't expecting to report back anything meaningful on this issue
unless I saw a bug or problem. I've done quite a bit of day-to-day using
these patches -- editing, agenda stuff, and exporting -- with no
noticeable ill effects... so there's my report!

E




Re: [O] maintaining Org

2013-10-30 Thread davidam9
Hello,

I would like git permissions to maintain org-license.el and
org-effectiveness.el from org-mode instead of worg.

Thanks in advance.

> Dear org community members,
>
> I am sure you have noticed that I am not really able to put in
> a lot of time as the maintainer of Org.  This is not good, but
> right now we do not have another candidate who would be willing
> to take over and do a better job.  Unfortunately my time constrains
> only allow a limited amount of work I can do.  Fortunately
> we have extremely good and active people around here.  I trust
> them fully, and I am sure things will move ahead well.  I will
> keep trying to answer to most important and strategic questions.
> Feel free to remind me if I have not reacted to something critical
> where my input is necessary.
>
> - Carsten
>
>





Re: [O] [PATCH] Table continuation strings

2013-10-30 Thread Nicolas Goaziou
Hello,

t...@tsdye.com (Thomas S. Dye) writes:

> Patch includes table continuation strings for several languages.
> Translations all from the internet.  Caveat emptor.

Applied. Thank you.

> + ("ja" :utf-8 "前ページから続く")

[...]

> + ("ja" :utf-8 "次ページに続く")

These will not be very helpful, though, as `latex' back-end (the only
one to use this string so far) relies on :latex or :default properties,
never on :utf-8.


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Simple cache mechanism for `org-element-at-point'

2013-10-30 Thread Nicolas Goaziou
Nicolas Goaziou  writes:

> Here is a slight change to the second one, which will correctly reset
> cache when some variables are customized or when a buffer is refreshed
> (C-c C-c on a keyword).

By the way, almost a month has passed since the first message in this
thread. Is someone still testing, or reviewing, it? I know it is
a non-trivial and quite sensitive change, so if one needs more time to
evaluate it, I certainly can wait more.

Otherwise, it might be better to simply apply it on master and cope with
the bugs.

WDYT?


Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Slight change to asynchronous export

2013-10-30 Thread Nicolas Goaziou
Helo,

Rick Frankel  writes:

> On 2013-10-29 04:35, Nicolas Goaziou wrote:
>> Achim Gratz  writes:
>>
>> Nicolas Goaziou writes:
>> At the moment, by default, external emacs process for asynchronous
>> export is called with:
>>
>> /path/to/emacs -Q --batch -l org-export-async-init-file ... export
>> stuff...
>>
>> where `org-export-async-init-file' defaults to `user-init-file'. It is,
>> by default, not the same as calling "emacs", because of the "-Q".
>>
>> That's a good thing, I'd say.  There is a lot of stuff going on in init
>> files that you most likely don't want done when firing Emacs off in the
>> background.  That is especially true of some site-init files that you
>> typically have no control over.
>>
>> As I said, it wouldn't be worse than the current situation.
>>
>> If you don't make this the default then no harm is done, I guess.
>>
>> The whole point of this change is to change the default value. If
>> there's no interest in it, I won't bother making it.
>
> I'm all for it. The current default is, IMHO, the worst of both worlds
> since, by loading my init but leaving out site-lisp i end up w/ the
> wrong org loaded (the one from the default distribution, not
> site-lisp) unless I make explicit reference to the development org in
> site-lisp.

For reference, here is the suggested patch.

Is there any strong point against it?


Regards,

-- 
Nicolas Goaziou
>From 993105a2bdf70a146c302e10884da1f0de406a65 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Mon, 28 Oct 2013 18:56:04 +0100
Subject: [PATCH] ox: Change default asynchronous export setup

* lisp/ox.el (org-export-async-init-file): Change default value and
  allowed values.
(org-export-async-start): Apply change to the variable.
---
 lisp/ox.el | 37 +
 1 file changed, 25 insertions(+), 12 deletions(-)

diff --git a/lisp/ox.el b/lisp/ox.el
index 141abc4..20d7107 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -839,15 +839,23 @@ automatically.  But you can retrieve them with \\[org-export-stack]."
   :package-version '(Org . "8.0")
   :type 'boolean)
 
-(defcustom org-export-async-init-file user-init-file
+(defcustom org-export-async-init-file nil
   "File used to initialize external export process.
-Value must be an absolute file name.  It defaults to user's
-initialization file.  Though, a specific configuration makes the
-process faster and the export more portable."
+
+Value must be either nil or an absolute file name.  When nil, the
+external process is launched like a regular Emacs session,
+loading user's initialization file and any site specific
+configuration.  If a file is provided, it, and only it, is loaded
+at start-up.
+
+Therefore, using a specific configuration makes the process to
+load faster and the export more portable."
   :group 'org-export-general
   :version "24.4"
-  :package-version '(Org . "8.0")
-  :type '(file :must-match t))
+  :package-version '(Org . "8.3")
+  :type '(choice
+	  (const :tag "Regular startup" nil)
+	  (file :tag "Specific start-up file" :must-match t)))
 
 (defcustom org-export-dispatch-use-expert-ui nil
   "Non-nil means using a non-intrusive `org-export-dispatch'.
@@ -5552,12 +5560,17 @@ and `org-export-to-file' for more specialized functions."
  (let* ((process-connection-type nil)
 (,proc-buffer (generate-new-buffer-name "*Org Export Process*"))
 (,process
- (start-process
-  "org-export-process" ,proc-buffer
-  (expand-file-name invocation-name invocation-directory)
-  "-Q" "--batch"
-  "-l" org-export-async-init-file
-  "-l" ,temp-file)))
+		 (apply
+		  #'start-process
+		  (append
+		   (list "org-export-process"
+			 ,proc-buffer
+			 (expand-file-name invocation-name invocation-directory)
+			 "--batch")
+		   (if org-export-async-init-file
+		   (list "-Q" "-l" org-export-async-init-file)
+		 (list "-l" user-init-file))
+		   (list "-l" ,temp-file)
;; Register running process in stack.
(org-export-add-to-stack (get-buffer ,proc-buffer) nil ,process)
;; Set-up sentinel in order to catch results.
-- 
1.8.4.2



Re: [O] [PATCH 1/3] Mark ox-latex variables safe locals under proper conditions

2013-10-30 Thread Nicolas Goaziou
Hello,

Aaron Ecay  writes:

> 2013ko urriak 29an, Nicolas Goaziou-ek idatzi zuen:

>> Out of curiosity, why did you skip other variables (e.g.
>> org-latex-footnote-separator)?
>
> Because these variables insert arbitrary latex code into the export
> output, they could be put to nefarious purposes.  If I can trick you
> into compiling a latex document that I’ve inserted malicious code into,
> AND into passing a particular non-default command line flag to latex,
> then I can execute arbitrary shell commands on your machine with your
> privileges.

You are right. In my mind, "safe" meant safe Lisp-wise, not LaTeX-wise.

I applied your patch. Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Table continuation strings

2013-10-30 Thread Michael Strey
Hi Tom,

t...@tsdye.com writes:

> Patch includes table continuation strings for several languages.
> Translations all from the internet.  Caveat emptor.

The German strings are fine.

Best regards
-- 
Michael Strey
http://www.strey.biz



Re: [O] [RFC] Slight change to asynchronous export

2013-10-30 Thread Sebastien Vauban
Rick Frankel wrote:
> For Aaron and others concerned about e.g, `server-start', it's easy to
> check if emacs is not running in batch or, in the case of server
> start, if emacs is running in a multi-window environment.

The "server-start" thing was a question of mine, trying to see if using
emacsclient would be possible. It isn't. So, please forget about this.

The async process launches a new Emacs process, with no interaction whatsoever
with the Emacs you edit in.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Query about org-beamer-select-environment

2013-10-30 Thread Nicolas Goaziou
Hello,

John Hendy  writes:

> I went to access the BEAMER_act property via C-c C-b and see it's not
> listed in the minibuffer choices (attached) The manual describes this
> function like so:[1]
>
> C-c C-b (org-beamer-select-environment)In org-beamer-mode, this
> key offers fast selection of a Beamer environment or the BEAMER_COL
> property.
>
> Looking at the options, this looks pretty accurate, though one might
> say that BMCOL is more about a property of the resulting
> environment/property than a specific environment itself. Just curious
> about the possibility of adding the other possible beamer-specific
> properties in such a handy picker, as I often forget and then need to
> go look at the manual.
>
> It looks like BEAMER_act and BEAMER_opt are the only ones not in that list.

Good idea. What binding do you suggest?

I thought about "<" for BEAMER_ACT and "[" for BEAMER_OPT, but that may
not be optimal.


Regards,

-- 
Nicolas Goaziou



[O] [PATCH] lisp/ob-C.el (org-babel-C-execute): turn on inhibit-lisp eval

2013-10-30 Thread Oleh
Hi all,

Here's a patch to turn this:

#+begin_src C :results output
puts("[1] 2 3 3");
#+end_src

#+RESULTS:
: [1]

into this:

#+begin_src C :results output
puts("[1] 2 3 3");
#+end_src

#+RESULTS:
: [1] 2 3

regards,
Oleh
From 3cde8ae1316762e106c2229a1661b31de56bc3f9 Mon Sep 17 00:00:00 2001
From: Oleh Krehel 
Date: Wed, 30 Oct 2013 08:50:33 +0100
Subject: [PATCH] lisp/ob-C.el (org-babel-C-execute): turn on inhibit-lisp eval

---
 lisp/ob-C.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index e9eec93..c35b3d0 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -106,7 +106,7 @@ or `org-babel-execute:C++'."
 ((lambda (results)
(org-babel-reassemble-table
 	(org-babel-result-cond (cdr (assoc :result-params params))
-	  (org-babel-read results)
+	  (org-babel-read results t)
 	  (let ((tmp-file (org-babel-temp-file "c-")))
 	(with-temp-file tmp-file (insert results))
 	(org-babel-import-elisp-from-file tmp-file)))
-- 
1.8.4



Re: [O] [RFC] [PATCH] [parser] org-element.el: Handle block parameters

2013-10-30 Thread Nicolas Goaziou
Hello,

Aaron Ecay  writes:

> I have several export filters which translate special blocks into latex
> code (doing some tedious string munging in elisp, such that a simple
> latex block is not warranted; I also have the eventual goal of making
> them cross-backend, which will involve a different bit of tedious
> munging).  These filters take arguments in the #+begin_foo line.

IIRC, I already suggested a solution with Babel for this problem.
There's no need to complicate core Org syntax for such a specific case.

> I also think it would be nice for the org code following this paragraph
> to be translated to output that makes sense for each backend, with the
> quote’s author formatted nicely (on a new line preceded by a dash,
> aligned to the right margin in text/html, using the csquotes package in
> latex, etc.).  This patch would enable such a functionality.
>
> #+begin_quote Chico Marx
> Why a duck?
> #+end_quote

Well actually, this kind of syntax is confusing at best. Something like
the following could be used instead:

  #+begin_quote :author Chico Marx

Actually, there are two points to consider:

  1. Providing something like :author implies that all back-ends in core
 and contrib and the manual have to be updated accordingly.

  2. "parameters" is too vague to be useful. It needs to be parsed
 further, which means that we must define explicitly use cases and
 keywords. Thus, I don't think adding "parameters" to every block is
 a good move if we don't know beforehand how they will be used.

 Though, it is possible to extend the syntax to well-defined
 specific cases. :author may be one of them, there are certainly
 others.


Regards,

-- 
Nicolas Goaziou



[O] maintaining Org

2013-10-30 Thread Carsten Dominik
Dear org community members,

I am sure you have noticed that I am not really able to put in
a lot of time as the maintainer of Org.  This is not good, but
right now we do not have another candidate who would be willing
to take over and do a better job.  Unfortunately my time constrains
only allow a limited amount of work I can do.  Fortunately
we have extremely good and active people around here.  I trust
them fully, and I am sure things will move ahead well.  I will
keep trying to answer to most important and strategic questions.
Feel free to remind me if I have not reacted to something critical
where my input is necessary.

- Carsten