[O] Dynamic Org-capture Templates

2017-11-03 Thread Eric Thomas
Does anyone know how to approach creating dynamic Org-capture
templates? I'm looking for IDO/Helm type of completion after a
template has been selected. If string does not exist, it is created
and added to future completions, similar to new files in emacs.

Example:

C-c c
"a" (activity)
Activity: math   (<--need completion here)
Topic: multiplication   (<--need completion here)
Date: 2017-09-11   (<--need default to todays date)
Start time: 07:00 AM  (<--need to define AM/PM easily)
Duration: 20   (<--easier way to capture time?)
Unit: mins

And

C-c c
"a" (activity)
Activity: physical education (<--again, completion starts as "ph.." is typed)
Type: Yoga (<--completion)
Class: Level 2 flow  (<--completion)
Date: 2017-09-11 (<--date picker of some kind)
Start time: 07:00 AM   (<--define AM/PM easily)
Duration: 90(<--easy method for capturing time)
Unit: mins


Maybe Org-capture templates are not the correct way to approach this?
Any direction is appreciated.

Thanks



Re: [O] [PATCH] org-capture: cannot abort cleanly after inserting at end of buffer

2017-11-03 Thread Nicolas Goaziou
Hello,

Xavier Martinez-Hidalgo  writes:

> After the following steps:
>
> - Start a capture.
> - Move to end of capture buffer (M->).
> - Type some text.
> - Abort capture (C-c C-k).
>
> the capture is aborted but its contents are not removed from the
> target buffer and the following message is shown:
>
>   "Capture process aborted, but target buffer could not be cleaned up
>   correctly"
>
> I am a attaching a patch that adds a test case showing up the problem
> and includes a proposed fix (setting the capture kill end marker
> insertion type).

Applied, with a slight twist. Thank you!

Regards,

-- 
Nicolas Goaziou



Re: [O] ``make test'' failure

2017-11-03 Thread Nicolas Goaziou
Hello,

Nick Dokos  writes:

> Yes, indeed: the test passes here with the patch.

I merged the updated test in master branch. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug? Encoding trouble in org-id-locations-load

2017-11-03 Thread Jorge Morais Neto
On 3 November 2017 at 12:11, Anders Johansson  wrote:
> I use org-id and got some surprising reports of duplicate IDs. It seems that
> the issue is that one of my files containing IDs has a filename consisting
> of some non-ascii characters (a Swedish ä).

This may be related to two problems I had with
~org-icalendar-combine-agenda-files~.  When I invoked that command,
Emacs created some duplicates of buffers for Org files with names
containing non-ASCII Latin-1 characters.  In the names of the
duplicates, each non-ASCII Latin-1 character was replaced by two octal
escape sequences (probably the character code in UTF-8).

The second problem was Emacs interrupting the export to ask me which
character encoding to use for certain "problematic characters".
Strangely, the "problematic characters" were octal escape sequences
which I verified to be correct UTF-8 codes of non-ASCII Latin-1
characters.  Emacs was apparently trying to "reencode" "text" that was
actually UTF-8 code.  Each time I invoked
~org-icalendar-combine-agenda-files~ and Emacs asked that, I chose raw
text encoding so the UTF-8 codes would be left as is.

I finally decided to investigate and traced both problems to some id
links pointing to headlines in files with names containing non-ASCII
Latin-1 characters.  I worked around by setting Org Mode not to export
those links.

Regards

-- 
- I am Brazilian.  I hope my English is correct and I welcome feedback
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z
- Free (as in free speech) software for Android: https://f-droid.org/



Re: [O] org-set-tags-command and org-agenda-set-tags not displaying minibuffer with org-tag-alist options

2017-11-03 Thread Adrian Bradd
​After further investigation this issue disappeared.​ Checked out and
built b5f075aa05244b and had no issues.

Sorry for the noise,

Adrian

On 3 November 2017 at 10:11, Adrian Bradd  wrote:

> Hello,
>
> When updating from commit 2567fee3c90 to HEAD on maint I noticed that the
> minibuffer that displays `org-tag-alist' shortcuts when running
> `org-set-tags-command' or `org-agenda-set-tags' doesn't show up anymore.
>
> Instead I get a prompt with a list of tags below it.
>
> I haven't had a chance to isolate the actual commit that caused the change
> yet. Once I have some time I'll take a closer look.
>
> Cheers,
>
> Adrian
>


Re: [O] MathJax beyond org-html-mathjax-options?

2017-11-03 Thread Rasmus
Lawrence Bottorff  writes:

> Bottom line: we can't expand org-html-mathjax-options to add in MathJax's
> cancel.js, etc.

I did not say that.  With the current version, you could do it yourself by
adding (extensions "ext1.js, ..., extn.js") to org-html-mathjax-options
and changing org-html-mathjax-template to load the extensions at the right
place.  Once extensions is added to org-html-mathjax-options you should
also be able to set it in files via the #+html_mathjax keyword, but you
might have to be careful how you write it (I’m not sure space would go).
I hope this is clear enough.

> Yes, your first "quick-and-dirty" worked just fine.

> Q: How did you know how to format #+html: \(\require{cancel}\) ?

it’s in the mathjax manual,


http://docs.mathjax.org/en/latest/tex.html?highlight=cancel#tex-and-latex-extensions

> Also, how does the org world know that we're talking about loading
>MathJax's cancel.js?

It doesn’t really.  But content after "#+html:" is only added to html
output.  From there mathjax takes over.

> As you all know I'm not a "developer-class" poster here, so my questions
> often look dull-witted.

This is a community for all Org users.  There’s mostly no numb questions.
This one certainly wasn’t.  I’d no knowledge about mathjax extensions
before reading your mail.

> Will try the patch once I learn a bit more diff in Emacs lore. . . .

Thanks.

Rasmus

-- 
And when I’m finished thinking, I have to die a lot



Re: [O] MathJax beyond org-html-mathjax-options?

2017-11-03 Thread Lawrence Bottorff
Bottom line: we can't expand org-html-mathjax-options to add in MathJax's
cancel.js, etc. Yes, your first "quick-and-dirty" worked just fine. Q: How
did you know how to format #+html: \(\require{cancel}\) ? Also, how does
the org world know that we're talking about loading MathJax's cancel.js? As
you all know I'm not a "developer-class" poster here, so my questions often
look dull-witted. Will try the patch once I learn a bit more diff in Emacs
lore. . . .

On Thu, Nov 2, 2017 at 9:12 AM, Rasmus  wrote:

> Lawrence Bottorff  writes:
>
> > I'm trying to get a typical Latex strikethrough with MathJax in an HTML
> > export, i.e., \cancel{thing} puts line through "thing". This
> >  tells me how. But I
> > don't know how to include this MathJax markup in an org file for HTML
> > export. If I forego MathJax -- i.e., #+OPTIONS: tex:dvipng instead
> > of #+OPTIONS: tex:t -- \cancel works, but I need to use MathJax. It
> doesn't
> > look like orhg-html-mathjax-options is expandable. . . .
>
> For now this works for me:
>
> #+html: \(\require{cancel}\)
> \begin{equation}
> \cancel{x = 1}
> \end{equation}
>
> Cf. http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-extensions
> You could also autoload the extension, cf. https://github.com/mathjax/
> MathJax/blob/master/test/sample-autoload.html
>
>
> That being said, I don’t think extensions were available at the time
> #+HTML_MATHJAX was introduced.  We could add extension support, but the
> questions would be whether to add them to #+HTML_MATHJAX or make a new
> keyword, e.g.
>
> #+HTML_MATHJAX_EXTENSIONS: ext1 ext2 ... extN
>
> I guess it would default to the "autoload-all" extension.
>
> One issue is that some of them have configuration options, like "noError".
>
> If you want, you can try the attached patch.
>
> Rasmus
>
> --
> Vote for proprietary math!
>


[O] Bug? Encoding trouble in org-id-locations-load

2017-11-03 Thread Anders Johansson

Hi,
I use org-id and got some surprising reports of duplicate IDs. It 
seems that the issue is that one of my files containing IDs has a 
filename consisting of some non-ascii characters (a Swedish ä). 
When this filename is read in from ~org-id-locations-file~ in 
~org-id-locations-load~ the ä is interpreted as “\303\244”.
But ~org-id-files~ and ~org-id-locations~ is also populated from 
currently open files, so I usually get that file represented twice 
as two different files in ~org-id-files~. So I get both 
“j-allmänt.org” and j-allm\303\244nt.org“. Both seem to be scanned 
correctly by ~org-id-update-id-locations~ and this results in 
duplicate IDs.


I tried changing the call to ~insert-file-contents-literally~ in 
~org-id-locations-load~ to just ~insert-file-contents~ and this 
seemed to fix the behaviour (as correct decoding is done then?). I 
don’t know if there are other unwanted effects from using 
~insert-file-contents~, but otherwise this seems to me to be a 
more correct solution.


Cheers,
Anders Johansson



[O] org-set-tags-command and org-agenda-set-tags not displaying minibuffer with org-tag-alist options

2017-11-03 Thread Adrian Bradd
Hello,

When updating from commit 2567fee3c90 to HEAD on maint I noticed that the
minibuffer that displays `org-tag-alist' shortcuts when running
`org-set-tags-command' or `org-agenda-set-tags' doesn't show up anymore.

Instead I get a prompt with a list of tags below it.

I haven't had a chance to isolate the actual commit that caused the change
yet. Once I have some time I'll take a closer look.

Cheers,

Adrian