Re: Org table: emphasizing calculated cell

2021-08-26 Thread Jarmo Hurri


Greetings Norwid.

Norwid Behrnd  writes:

> try extending the format of the table formula with asterisks, i.e.
>
> ```
> | quantity |  value |
> |--+|
> | A|  1 |
> | B|  3 |
> |--+|
> | *C*  | *0.33* |
>
> #+TBLFM:  @4$2=@-2/@-1; *%.2f*
> ```
>
> Subsequently, issue the call ```C-c *``` for an update while the
> cursor is within the table.  This approach works well enough for me
> (equally for emphasis with enclosing forward slashes, or underscores)
> in Emacs' native display (backed by elpa-org 9.4.0) as well as for a
> subsequent export into .html and display (e.g., in Firefox), or .tex.

Excellent, this is a working solution for the basic case. Much
appreciated!

This solution seems to change the contents of a cell, not only its
formatting. So the following, where I try to increase the value of "C"
by one, leads to an error:

```
| quantity | value  |
|--+|
| A| 1  |
| B| 3  |
|--+|
| *C*  | *0.33* |
| D| #ERROR |
#+TBLFM: @4$2=@-2/@-1; *%.2f*::@5$2=@-1+1
```

I wonder if there is a way around this effect?

Jarmo




bug#48199: 28.0.50; Org mode surprisingly usurps Calendar key binding

2021-08-26 Thread Lars Ingebrigtsen
Yuchen Pei  writes:

>> This bug seems to be still around, as it just happened to me. Steps
>> to
>> reproduce:
>>
>> - Build a recent version e.g. commit efaed29f3d with `make`
>> - ./src/emacs
>> - M-x calendar RET
>> - i
>>
>> results in "command-execute: Wrong type argument: commandp,
>> org-agenda-diary-entry".  Can anyone else reproduce it?

I can't reproduce this with "emacs -Q", or after visiting etc/ORG-NEWS,
with the current Emacs trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Re: how to get multi-line author in ODT export?

2021-08-26 Thread Juan Manuel Macías
Hi John,

you're welcome. I realized that in these lines of the meta.xml file:

 ... 
 ... 

line breaks can be achieved simply by adding a new line without marks (as
discussed in this thread:
https://stackoverflow.com/questions/10917555/adding-a-new-line-break-tag-in-xml/10923392)

Best regards,

Juan Manuel

John Kitchin writes:

> That is really nice, thanks for sharing it!
> John
>
> ---
> Professor John Kitchin (he/him/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
> On Thu, Aug 26, 2021 at 12:55 PM Juan Manuel Macías
>  wrote:
>
> Hi again,
>
> Another simpler approach, with a filter:
>
> #+TITLE: The kessel run in 12 parsecs
> #+AUTHOR: Han Solo !!! Chewbacca !!! Lando Calrissian
>
> #+BIND: org-export-filter-plain-text-functions (author-lb-filter)
> #+begin_src emacs-lisp :exports results :results none
>   (defun author-lb-filter (text backend info)
> (cond ((org-export-derived-backend-p backend 'odt)
>(replace-regexp-in-string "!!!" "\n" text))
>   ((org-export-derived-backend-p backend 'latex)
>(replace-regexp-in-string "!!!" "" text
> #+end_src
>
> Content...
>
> Best regards,
>
> Juan Manuel
>
> Juan Manuel Macías writes:
>
> > Hi Eric,
> >
> > I think the problem is in this two lines of `org-odt-template',
> that
> > creates the meta.xml file inside the odt file:
> >
> > (format "%s\n" author)
> > (format "%s\n"
> author)
> >
> > Perhaps, modifying them like this:
> >
> > (format "\n"
> (replace-regexp-in-string "" "\n" author))
> > (format "\n" (replace-regexp-in-string
> "" "\n" author))
> >
> > We could do this in our documents:
> >
> > #+AUTHOR: Han Solo \\ Chewbacca
> >
> > (little tested)
> >
> > Best regards,
> >
> > Juan Manuel
> >
> > Eric S Fraga writes:
> >
> >> So, as usual, I answer my own question, sort of.
> >>
> >> The problem is that org exports the author text enclosed within
> a
> >> special directives, specifically:
> >>
> >>  (format "%s"
> author))
> >>
> >> New line directives are not allowed within this declaration, it
> >> seems.  Removing (manually) the initial-creator directive then
> works.
> >>
> >> So, my question would be: is this text:initial-creator tagging
> >> necessary?  If not, can we remove it?  The OpenDocument schema
> is vague
> >> about whether this is necessary.  If we cannot remove it, i.e
> if
> >> initial-creator is required in the document, could it be put in
> >> separately (as a meta:initial-creator tag) so that the author
> field can
> >> be more general?
> >>
> >> I am *not* an ODT expert of any sort.  But it is my route to
> Word
> >> documents when the need arises (which is luckily seldom).
> >>
> >> Anyway, no panic: I can simply manually edit the odt file just
> before
> >> the final processing...
> >>
> >> Thank you,
> >> eric
> >
> >
>



Re: ob-lilypond.el doesn't generate midi files

2021-08-26 Thread Nick Dokos
Michael Maurer  writes:

> On Thu, 26 Aug 2021 at 15:03, Jonathan Gregory  wrote:
>>
>> Hi
>>
>> On 26 Aug 2021, Michael Maurer wrote:
>>
>> > I've installed lilypond and customized ob-lilypond to use the
>> > appropriate helper programs, but although it generates & shows
>> > pdfs just fine, generating a midi file it does not. I execute
>> > tangle on the codeblock, and all I get is "No midi file
>> > generated so can't play!". org-version 9.4.6 emacs 27.2 Win 10
>>
>> Can you also send a MWE of the code you're using to generate the
>> score?
>>
>
> I used a test file I copied over from Frescobaldi
>
> #+begin_src lilypond :file test.pdf
> \version "2.18.2"
> \score {
> \drums {
>   \time 2/4
>   sn16 sn8 sn16 sn8 sn8:32 ~
>   sn8 sn8 sn4:32 ~
>   sn4 sn8 sn16 sn16
>   sn4 r4
> }
>   \layout { }
>   \midi { }
> }
> #+end_src
>
> In Frescobaldi this gets me both midi-output and pdf. In Emacs with
> org it does say "Midi output to test.midi", but then there's that "no
> midi file generated" message.
>

What happens if you save the contents of the source block into a file
and run lilypond on the file from the command line?

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: how to get multi-line author in ODT export?

2021-08-26 Thread John Kitchin
That is really nice, thanks for sharing it!
John

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



On Thu, Aug 26, 2021 at 12:55 PM Juan Manuel Macías 
wrote:

> Hi again,
>
> Another simpler approach, with a filter:
>
> #+TITLE: The kessel run in 12 parsecs
> #+AUTHOR: Han Solo !!! Chewbacca !!! Lando Calrissian
>
> #+BIND: org-export-filter-plain-text-functions (author-lb-filter)
> #+begin_src emacs-lisp :exports results :results none
>   (defun author-lb-filter (text backend info)
> (cond ((org-export-derived-backend-p backend 'odt)
>(replace-regexp-in-string "!!!" "\n" text))
>   ((org-export-derived-backend-p backend 'latex)
>(replace-regexp-in-string "!!!" "" text
> #+end_src
>
> Content...
>
> Best regards,
>
> Juan Manuel
>
> Juan Manuel Macías writes:
>
> > Hi Eric,
> >
> > I think the problem is in this two lines of `org-odt-template', that
> > creates the meta.xml file inside the odt file:
> >
> > (format "%s\n" author)
> > (format "%s\n" author)
> >
> > Perhaps, modifying them like this:
> >
> > (format "\n"
> (replace-regexp-in-string "" "\n" author))
> > (format "\n"
> (replace-regexp-in-string "" "\n" author))
> >
> > We could do this in our documents:
> >
> > #+AUTHOR: Han Solo \\ Chewbacca
> >
> > (little tested)
> >
> > Best regards,
> >
> > Juan Manuel
> >
> > Eric S Fraga writes:
> >
> >> So, as usual, I answer my own question, sort of.
> >>
> >> The problem is that org exports the author text enclosed within a
> >> special directives, specifically:
> >>
> >>  (format "%s" author))
> >>
> >> New line directives are not allowed within this declaration, it
> >> seems.  Removing (manually) the initial-creator directive then works.
> >>
> >> So, my question would be: is this text:initial-creator tagging
> >> necessary?  If not, can we remove it?  The OpenDocument schema is vague
> >> about whether this is necessary.  If we cannot remove it, i.e if
> >> initial-creator is required in the document, could it be put in
> >> separately (as a meta:initial-creator tag) so that the author field can
> >> be more general?
> >>
> >> I am *not* an ODT expert of any sort.  But it is my route to Word
> >> documents when the need arises (which is luckily seldom).
> >>
> >> Anyway, no panic: I can simply manually edit the odt file just before
> >> the final processing...
> >>
> >> Thank you,
> >> eric
> >
> >
>
>


[BUG] [BUG] inconsistent behavior when reading multiple tags [9.4.6 (9.4.6-g366444 @ /home/n/.emacs.d/straight/build/org/)]

2021-08-26 Thread No Wayman


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


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

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


622f9fa76c8ee0766b15945c013b0950d703b955 ("org: Use crm for 
completing tags")
lexically binds crm-separator to ":" while prompting for multiple 
tags in

org-set-tags-command and org-capture-fill-template.

org-set-tags-command correctly parses the tags when using a comma 
(the default
crm-separator) to separate them, but completion is broken unless 
":" is used as

the separator.
org-capture-fill-template incorrectly parses this.

Reproducible from emacs -Q:

org-set-tags-command:
1. Insert a new Org entry in the a buffer 
2. M-x org-set-tags-command 
3. At the prompt enter "one,two,three"
4. Entry's tags are correctly set to :one:two:three: 


org-capture-fill-template:
1. evaluate (org-capture-fill-template "%^g")
2. At the prompt enter "one,two,three"
3. String returned is incorrect: ":one,two,three:"


I can think of a couple ways we could improve this and make the 
behavior consistent.
We could introduce a defcustom which allows the user to choose 
whether or not
Org will rebind crm-separator during commands/functions which 
utilize

completing-read-multiple.
e.g.

#+begin_src emacs-lisp :lexical t
(defcustom org-contextual-crm-separator t
 "Use contextual binding of crm-separator during Org commands.
For example, when setting tags, \":\" is used as the separator.
If nil, `crm-separator' is used.")
#+end_src

Alternatively, we could change the lexical binding we're using 
during these commands/functions.
Instead of binding the separator explicitly to "[ \t]*:[ \t]*", we 
could instead use a regexp
which will match any character not described by org-tag-re. The 
benefit of
this is that completing-read-multiple completion will work for any 
separator
that doesn't match org-tag-re transparently and the results should 
be
consistent between org-set-tags-command and 
org-capture-fill-template.


The attached patch implements that change, which seems to do the 
right thing
from my testing. I can polish it, but I wanted to get opinions on 
the solution first.


Note this does not change the case of org-todo-list, which binds
crm-separator to "|". I chose not to touch that because I'm not 
fully aware 
of what the restrictions on characters for todo-keywords are, if 
any.
org-todo-list also does the right thing by mentioning the 
separator in the prompt.


We could also combine the approaches:

- Introduce a defcustom that determines if we're going to 
 contextually rebind crm-separator

- Use a broader regexp when contextually binding crm-separator
- Mention the separator in the prompt when rebound

Thoughts?


Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ 
Version 3.24.30, cairo version 1.17.4)

of 2021-08-02
Package: Org mode version 9.4.6 (9.4.6-g366444 @ 
/home/n/.emacs.d/straight/build/org/)


>From 2ec28b530eb28cf788c38556ec3cb97f3bacd4af Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer 
Date: Thu, 26 Aug 2021 12:51:27 -0400
Subject: [PATCH] RFC: broader regexp for lexically bound crm-separator

For testing purposes. Ammended commit message pending.
---
 lisp/org-capture.el | 2 +-
 lisp/org.el | 5 -
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index c51744680..47b47c3ca 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1740,7 +1740,7 @@ The template may still contain \"%?\" for cursor positioning."
 			(org-add-colon-after-tag-completion t)
 			(ins (mapconcat
   #'identity
-  (let ((crm-separator "[ \t]*:[ \t]*"))
+  (let ((crm-separator org-tag-crm-separator))
 (completing-read-multiple
  (if prompt (concat prompt ": ") "Tags: ")
  org-last-tags-completion-table nil nil nil
diff --git a/lisp/org.el b/lisp/org.el
index ce68f4692..f5e396cba 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -602,6 +602,9 @@ not contribute to the agenda listings.")
 (defconst org-tag-re "[[:alnum:]_@#%]+"
   "Regexp matching a single tag.")
 
+(defconst org-tag-crm-separator "[ \t]*[^[:alnum:]_@#%][ \t]*"
+  "Regexp used to determine `crm-separator' when reading multiple tags.")
+
 (defconst org-tag-group-re "[ \t]+\\(:\\([[:alnum:]_@#%:]+\\):\\)[ \t]*$"
   "Regexp matching the tag group at the end of a line, with leading spaces.
 Tags are stored in match group 1.  Match group 2 stores the tags
@@ -12066,7 +12069,7 @@ in Lisp code use `org-set-tags' instead."
 		  table
 		  (and org-fast-tag-selection-include-todo org-todo-key-alist))
 		   (let ((org-add-colon-after-tag-completion (< 1 (length table)))
- (crm-separator "[ \t]*:[ \t]*"))
+ (crm-separator 

Re: how to get multi-line author in ODT export?

2021-08-26 Thread Juan Manuel Macías
Hi again,

Another simpler approach, with a filter:

#+TITLE: The kessel run in 12 parsecs
#+AUTHOR: Han Solo !!! Chewbacca !!! Lando Calrissian

#+BIND: org-export-filter-plain-text-functions (author-lb-filter)
#+begin_src emacs-lisp :exports results :results none
  (defun author-lb-filter (text backend info)
(cond ((org-export-derived-backend-p backend 'odt)
   (replace-regexp-in-string "!!!" "\n" text))
  ((org-export-derived-backend-p backend 'latex)
   (replace-regexp-in-string "!!!" "" text
#+end_src

Content...

Best regards,

Juan Manuel

Juan Manuel Macías writes:

> Hi Eric,
>
> I think the problem is in this two lines of `org-odt-template', that
> creates the meta.xml file inside the odt file:
>
> (format "%s\n" author)
> (format "%s\n" author)
>
> Perhaps, modifying them like this:
>
> (format "\n" (replace-regexp-in-string 
> "" "\n" author))
> (format "\n" 
> (replace-regexp-in-string "" "\n" author))
>
> We could do this in our documents:
>
> #+AUTHOR: Han Solo \\ Chewbacca
>
> (little tested)
>
> Best regards,
>
> Juan Manuel
>
> Eric S Fraga writes:
>
>> So, as usual, I answer my own question, sort of.
>>
>> The problem is that org exports the author text enclosed within a
>> special directives, specifically:
>>
>>  (format "%s" author))
>>
>> New line directives are not allowed within this declaration, it
>> seems.  Removing (manually) the initial-creator directive then works.
>>
>> So, my question would be: is this text:initial-creator tagging
>> necessary?  If not, can we remove it?  The OpenDocument schema is vague
>> about whether this is necessary.  If we cannot remove it, i.e if
>> initial-creator is required in the document, could it be put in
>> separately (as a meta:initial-creator tag) so that the author field can
>> be more general?
>>
>> I am *not* an ODT expert of any sort.  But it is my route to Word
>> documents when the need arises (which is luckily seldom).
>>
>> Anyway, no panic: I can simply manually edit the odt file just before
>> the final processing...
>>
>> Thank you,
>> eric
>
>



Re: how to get multi-line author in ODT export?

2021-08-26 Thread Juan Manuel Macías
Hi Eric,

I think the problem is in this two lines of `org-odt-template', that
creates the meta.xml file inside the odt file:

(format "%s\n" author)
(format "%s\n" author)

Perhaps, modifying them like this:

(format "\n" (replace-regexp-in-string 
"" "\n" author))
(format "\n" 
(replace-regexp-in-string "" "\n" author))

We could do this in our documents:

#+AUTHOR: Han Solo \\ Chewbacca

(little tested)

Best regards,

Juan Manuel 

Eric S Fraga writes:

> So, as usual, I answer my own question, sort of.
>
> The problem is that org exports the author text enclosed within a
> special directives, specifically:
>
>  (format "%s" author))
>  
> New line directives are not allowed within this declaration, it
> seems.  Removing (manually) the initial-creator directive then works.
>
> So, my question would be: is this text:initial-creator tagging
> necessary?  If not, can we remove it?  The OpenDocument schema is vague
> about whether this is necessary.  If we cannot remove it, i.e if
> initial-creator is required in the document, could it be put in
> separately (as a meta:initial-creator tag) so that the author field can
> be more general?
>
> I am *not* an ODT expert of any sort.  But it is my route to Word
> documents when the need arises (which is luckily seldom).
>
> Anyway, no panic: I can simply manually edit the odt file just before
> the final processing...
>
> Thank you,
> eric




Re: ob-lilypond.el doesn't generate midi files

2021-08-26 Thread Michael Maurer
On Thu, 26 Aug 2021 at 15:03, Jonathan Gregory  wrote:
>
> Hi
>
> On 26 Aug 2021, Michael Maurer wrote:
>
> > I've installed lilypond and customized ob-lilypond to use the
> > appropriate helper programs, but although it generates & shows
> > pdfs just fine, generating a midi file it does not. I execute
> > tangle on the codeblock, and all I get is "No midi file
> > generated so can't play!". org-version 9.4.6 emacs 27.2 Win 10
>
> Can you also send a MWE of the code you're using to generate the
> score?
>

I used a test file I copied over from Frescobaldi

#+begin_src lilypond :file test.pdf
\version "2.18.2"
\score {
\drums {
  \time 2/4
  sn16 sn8 sn16 sn8 sn8:32 ~
  sn8 sn8 sn4:32 ~
  sn4 sn8 sn16 sn16
  sn4 r4
}
  \layout { }
  \midi { }
}
#+end_src

In Frescobaldi this gets me both midi-output and pdf. In Emacs with
org it does say "Midi output to test.midi", but then there's that "no
midi file generated" message.



Re: ob-lilypond.el doesn't generate midi files

2021-08-26 Thread Michael Maurer
On Thu, 26 Aug 2021 at 15:03, Jonathan Gregory  wrote:
>
> Hi
>
> On 26 Aug 2021, Michael Maurer wrote:
>
> > I've installed lilypond and customized ob-lilypond to use the
> > appropriate helper programs, but although it generates & shows
> > pdfs just fine, generating a midi file it does not. I execute
> > tangle on the codeblock, and all I get is "No midi file
> > generated so can't play!". org-version 9.4.6 emacs 27.2 Win 10
>
> Can you also send a MWE of the code you're using to generate the
> score?
>

It's just the example from the org-mode website



Re: how to get multi-line author in ODT export?

2021-08-26 Thread Eric S Fraga
Hi John,

On Thursday, 26 Aug 2021 at 10:50, John Kitchin wrote:
> Does something like this work for you:

Yes, thank you, hand crafting the author field directly would do the
job indeed!

Thanks again,
eric

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-628-g366444
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: how to get multi-line author in ODT export?

2021-08-26 Thread John Kitchin
Does something like this work for you:

#+options: author:nil
#+author: Test author - not shown in export

@@odt:First author
lineSecond
line@@

Testing with content

This exports to ODT like this for me:
[image: image.png]

John

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



On Thu, Aug 26, 2021 at 10:24 AM Eric S Fraga  wrote:

> So, as usual, I answer my own question, sort of.
>
> The problem is that org exports the author text enclosed within a
> special directives, specifically:
>
>  (format "%s" author))
>
> New line directives are not allowed within this declaration, it
> seems.  Removing (manually) the initial-creator directive then works.
>
> So, my question would be: is this text:initial-creator tagging
> necessary?  If not, can we remove it?  The OpenDocument schema is vague
> about whether this is necessary.  If we cannot remove it, i.e if
> initial-creator is required in the document, could it be put in
> separately (as a meta:initial-creator tag) so that the author field can
> be more general?
>
> I am *not* an ODT expert of any sort.  But it is my route to Word
> documents when the need arises (which is luckily seldom).
>
> Anyway, no panic: I can simply manually edit the odt file just before
> the final processing...
>
> Thank you,
> eric
>
> --
> : Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-628-g366444
> : Latest paper written in org: https://arxiv.org/abs/2106.05096
>
>


Re: how to get multi-line author in ODT export?

2021-08-26 Thread Eric S Fraga
So, as usual, I answer my own question, sort of.

The problem is that org exports the author text enclosed within a
special directives, specifically:

 (format "%s" author))
 
New line directives are not allowed within this declaration, it
seems.  Removing (manually) the initial-creator directive then works.

So, my question would be: is this text:initial-creator tagging
necessary?  If not, can we remove it?  The OpenDocument schema is vague
about whether this is necessary.  If we cannot remove it, i.e if
initial-creator is required in the document, could it be put in
separately (as a meta:initial-creator tag) so that the author field can
be more general?

I am *not* an ODT expert of any sort.  But it is my route to Word
documents when the need arises (which is luckily seldom).

Anyway, no panic: I can simply manually edit the odt file just before
the final processing...

Thank you,
eric

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-628-g366444
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: org-capture config broken

2021-08-26 Thread Maxim Nikulin

On 26/08/2021 16:48, Orm Finnendahl wrote:


Am Mittwoch, den 25. August 2021 um 18:16:15 Uhr (+0200) schrieb Maxim
Nikulin:


Unfortunately you did not specify version of Org you are currently using.


Sorry, it's 9.4.4.


The changes, I were writing about, landed in 9.4.6. If you were using 
the latest version, perhaps you would not experience a problem with 
old-style URI.



$ emacsclient org-protocol:/capture?template=m?url=URL=TITLE=BODY
Waiting for Emacs...
*ERROR*: No capture template referred to by "m?url" keys

Thanks for the hint! If this example is still in the master branch
maybe that should get fixed (or the code if it should work with a
question mark).


I just took the example from the manual at the web site. Then I realized 
that it looked strange and fixed it. Unfortunately I missed one question 
mark. The example in master and maint branches is correct. Thank you for 
drawing attention to this issue.






Re: Manual on web site is not the latest version

2021-08-26 Thread Maxim Nikulin

On 28/04/2021 12:35, Bastien wrote:

Do you still see differences between the doc/org-manual.org and the
one published on https://orgmode.org/manual/ ?

If so, please point at one or two differences.  Thanks!


curl -I https://orgmode.org/manual/The-capture-protocol.html
date: Thu, 26 Aug 2021 13:54:39 GMT
last-modified: Wed, 24 Mar 2021 08:04:13 GMT

emacsclient org-protocol://capture?template=X?url=URL?title=TITLE?body=BODY

git show release_9.4.6:doc/org-manual.org | grep template=
: emacsclient 
"org-protocol://capture?template=X=URL=TITLE=BODY"






how to get multi-line author in ODT export?

2021-08-26 Thread Eric S Fraga
Hello all,

I am trying to generate a multi-line author for a report exported to
ODT.  In LaTeX, I would simply put \\ between lines in a single
#+author: entry, i.e. using @@latex:\\@@ in org.

In normal text, a \\ translates to  in the ODT export
but this doesn't work in an ODT sub-title entry, for some reason.  This
is somewhat beyond my odt-foo unfortunately.

Can anybody help?

Thank you,
eric

PS -I still do not understand why we cannot use \\ in an AUTHOR field
when it is fine in text...  but I'm sure there's a reasonable
explanation so no worries. :-)

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-628-g366444
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: ob-lilypond.el doesn't generate midi files

2021-08-26 Thread Jonathan Gregory

Hi

On 26 Aug 2021, Michael Maurer wrote:

I've installed lilypond and customized ob-lilypond to use the 
appropriate helper programs, but although it generates & shows 
pdfs just fine, generating a midi file it does not. I execute 
tangle on the codeblock, and all I get is "No midi file 
generated so can't play!". org-version 9.4.6 emacs 27.2 Win 10


Can you also send a MWE of the code you're using to generate the 
score?


--
Jonathan



org-cite: enable inserting citation (org-cite-insert) after list bullet [9.5 (9.5-7c78aca @ /home/yuu/.config/emacs/straight/build/org/)]

2021-08-26 Thread Yuu Yin
** Expected behavior

Invoking ~org-cite-insert~ after list bullets (e.g. ~-~ and ~1.~ ) works.

*** Why

Being able to insert citations in lists is useful when the user wants to list 
works without text surround it, for instance a list akin to the ~Further 
reading~ section on Wikipedia (e.g. 
https://en.wikipedia.org/wiki/Wikipedia#Further_reading). Thus, current 
behavior is too strict.

** Actual behavior
Invoking ~org-cite-insert~ after list bullets (e.g. ~-~ and ~1.~ ) doesn't work.

#+begin_src emacs-lisp
org-cite-insert: Cannot insert a citation here
#+end_src

** Reproduce

1. Install Emacs master, and add to =~/.config/emacs/init.el=
#+begin_src emacs-lisp
(require 'package)

(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" 
user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el;
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))

(straight-use-package 'use-package)

(setq straight-use-package-by-default t)

(defun my-call-process (command  args)
"Execute COMMAND with ARGS synchronously.

Returns (STATUS . OUTPUT) when it is done, where STATUS is the returned error
code of the process and OUTPUT is its stdout output."
(with-temp-buffer
(cons (or (apply #'call-process command nil t nil (remq nil args))
-1)
(string-trim (buffer-string)

(use-package org
:straight '(:type git :host github :repo "emacs-straight/org"
:build t
:pre-build
(with-temp-file "org-version.el"
(insert "(defun org-release () \"9.5\")\n"
(format "(defun org-git-version ( _) \"9.5-%s\")\n"
(cdr (my-call-process "git" "rev-parse" "--short" "HEAD")))
"(provide 'org-version)\n")))
:config
(require 'oc-basic))
#+end_src

2. Create bibtex file =org/test.bib= with
#+begin_src bibtex
@book{test-2021-test,
title = {Test},
author = {{Test}},
year = {2021},
}
#+end_src

3. Create org-mode file =org/test.org=
#+begin_src org
,#+TITLE: Test
,#+BIBLIOGRAPHY: test.bib

,* Test

-
+
-
,*

1.
a.
b.
2.
a)
b)
3.
-
+
4.
1)
#+end_src

4. Put cursor after any of the list bullets and ~org-cite-insert~

5. See message buffer ~Cannot insert a citation here~

** System information
Emacs : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, 
cairo version 1.16.0)
Package: Org mode version 9.5 (9.5-7c78aca @ 
/home/yuu/.config/emacs/straight/build/org/)

current state:
==
(setq
org-link-elisp-confirm-function 'yes-or-no-p
org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
org-export-before-parsing-hook '(org-attach-expand-links)
org-archive-hook '(org-attach-archive-delete-maybe)
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
org-optimize-window-after-visibility-change)
org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-show-all append local] 5]
#[0 "\300\301\302\303\304$\207"
[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-confirm-shell-link-function 'yes-or-no-p
org-reveal-start-hook '(org-decrypt-entry)
outline-isearch-open-invisible-function 'outline-isearch-open-invisible
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
org-confirm-elisp-link-function 'yes-or-no-p
org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
org-link-shell-confirm-function 'yes-or-no-p
org-babel-pre-tangle-hook '(save-buffer)
org-agenda-loop-over-headlines-in-active-region nil
org-occur-hook '(org-first-headline-recenter)
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-link-parameters '(("attachment" :follow org-attach-follow :complete 
org-attach-complete-link)
("id" :follow org-id-open) ("eww" :follow org-eww-open :store 
org-eww-store-link)
("rmail" :follow org-rmail-open :store org-rmail-store-link)
("mhe" :follow org-mhe-open :store org-mhe-store-link)
("irc" :follow org-irc-visit :store org-irc-store-link :export org-irc-export)
("info" :follow org-info-open :export org-info-export :store 
org-info-store-link)
("gnus" :follow org-gnus-open :store org-gnus-store-link)
("docview" :follow org-docview-open :export org-docview-export :store
org-docview-store-link)
("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete 
org-bbdb-complete-link
:store org-bbdb-store-link)
("w3m" :store org-w3m-store-link)
("doi" :follow org-link-doi-open :export org-link-doi-export) ("file+sys") 
("file+emacs")
("shell" :follow org-link--open-shell)
("news" :follow
#[514 

ob-lilypond.el doesn't generate midi files

2021-08-26 Thread Michael Maurer
I've installed lilypond and customized ob-lilypond to use the
appropriate helper programs, but although it generates & shows pdfs
just fine, generating a midi file it does not. I execute tangle
on the codeblock, and all I get is "No midi file generated so can't play!".
org-version 9.4.6
emacs 27.2
Win 10



Re: org-capture config broken

2021-08-26 Thread Orm Finnendahl
Hi,

Am Mittwoch, den 25. August 2021 um 18:16:15 Uhr (+0200) schrieb Maxim
Nikulin:
> 
> Unfortunately you did not specify version of Org you are currently using.

Sorry, it's 9.4.4.

> This the old style of Org protocol URI. See
> https://orgmode.org/manual/The-capture-protocol.html for an example
> of modern variant (it has typos fixed in master branch, some "?"
> should be "&"). I am unsure concerning order of parameters in
> old-style URLs.

Thanks, that helped! In my version the following (which I had tried
before following the org manual page you mention) throws an error, as
it seems to expect an ampersand after the template name:

$ emacsclient org-protocol:/capture?template=m?url=URL=TITLE=BODY
Waiting for Emacs...
*ERROR*: No capture template referred to by "m?url" keys

This works:

emacsclient org-protocol:/capture?template=m=URL=TITLE=BODY

Thanks for the hint! If this example is still in the master branch
maybe that should get fixed (or the code if it should work with a
question mark).

Best,
Orm



New source block results option for attaching file to node

2021-08-26 Thread Ryan Scott
An additional option for use with ":results file" that moves the returned
path to the node attachment directory (as returned by org-attach-dir),
creating it if necessary.

First time submitting a patch. Any feedback is appreciated.

-ryan


0001-ob-core-Added-option-for-attaching-file-from-babel-s.patch
Description: Binary data


Bug: Unintended column added to table [9.4.6 (9.4.6-gab9f2a @ /home/user/.emacs.d/elpa/org-9.4.6/)]

2021-08-26 Thread spectria
In a preexisting org table, hitting  can add a new, unintended column

To reproduce the behavior:

1) Create foo.org containing:
   
   | Type |
   | foo  |
   |  |
   
2) emacs -Q
3) M-x package-initialize
4) C-x C-f foo.org
5) Repeat:
   1) Put cursor at end of line containing foo
   2) 

Bug: After the 2nd iteration, org adds a unintended new column. Further 
iteration adds more columns.


==

Emacs  : GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5)
 of 2021-01-30, modified by Debian
Package: Org mode version 9.4.6 (9.4.6-gab9f2a @ 
/home/user/.emacs.d/elpa/org-9.4.6/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-reveal-start-hook '(org-decrypt-entry)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-show-all append local] 5]
 #[0 "\300\301\302\303\304$\207" [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-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("attachment" :follow org-attach-follow :complete 
org-attach-complete-link) ("id" :follow org-id-open)
   ("eww" :follow org-eww-open :store org-eww-store-link) 
("rmail" :follow org-rmail-open :store org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link 
:export org-irc-export)
   ("info" :follow org-info-open :export org-info-export 
:store org-info-store-link)
   ("gnus" :follow org-gnus-open :store org-gnus-store-link)
   ("docview" :follow org-docview-open :export 
org-docview-export :store org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store 
org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export 
:complete org-bbdb-complete-link :store org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("file+sys") 
("file+emacs") ("shell" :follow org-link--open-shell)
   ("news" :follow #[514 "\301\300\302Q\"\207" ["news" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("mailto" :follow #[514 "\301\300\302Q\"\207" 
["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("https" :follow #[514 "\301\300\302Q\"\207" ["https" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("http" :follow #[514 "\301\300\302Q\"\207" ["http" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("ftp" :follow #[514 "\301\300\302Q\"\207" ["ftp" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("help" :follow org-link--open-help) ("file" :complete 
org-link-complete-file) ("elisp" :follow org-link--open-elisp)
   ("doi" :follow org-link--open-doi))
 org-link-elisp-confirm-function 'yes-or-no-p
 )







Re: [PATCH] org-cite: prevent ' from being an active char in LaTeX export

2021-08-26 Thread Timothy
Heyo,

> This is a band-aid over the issue raised in
> .

As this actually fixes a real annoyance, and is a trivial change, I’m pushing
this as a3ba79cd3a.

All the best,
Timothy


Re: [PATCH] org-cite: define \citeprocitem for LaTeX export

2021-08-26 Thread Timothy
Heyo,

As it’s been a few days, given the prior consultation with citeproc-el, and that
this is a very small change, I’m pushing this as 818bec57eb. We can always
revert/patch over in case I’m walking on someone’s (nickolas’?) toes :)

All the best,
Timothy