[O] shift-return no longer increments dates?

2017-09-13 Thread Alan Schmitt
Hello,

I just updated emacs and org-mode, and I am having a small issue. When I
hit shift-return on a date field, it simply copies it and no longer
increments it.

I do have `org-table-copy-increment' set to t:

> org-table-copy-increment is a variable defined in ‘org-table.el’.
> Its value is t

> Documentation:
> Non-nil means increment when copying current field with ‘M-x 
> org-table-copy-down’.

> You can customize this variable.

> This variable was introduced, or its default value was changed, in
> version 26.1 of Emacs.

(I don't know why it's talking about 26.1, I have this version of emacs:
GNU Emacs 25.3.1 (x86_64-apple-darwin16.7.0, Carbon Version 157 AppKit
1504.83) of 2017-09-13)

I'm using this version of org:
Org mode version 9.1 (9.1-20-ga4f139-elpaplus @ 
/Users/schmitta/.emacs.d/elpa/org-plus-contrib-20170911/)

Is this a known bug?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-08: 405.07, 2016-08: 402.25


signature.asc
Description: PGP signature


Re: [O] Bug in ox.el

2017-09-13 Thread Eric S Fraga
On Wednesday, 13 Sep 2017 at 09:26, Qiang Fang wrote:
> The original issue is at
> https://github.com/kjambunathan/org-mode-ox-odt/issues/25
>
> "org-export-table-cell-alignment uses org-export-data to infer cookies
> of some columns. I think, it should use other mechanisms like
> org-element-interpret-data (may be)."
>
> The odt exporter is really useful, it replaces latex in most cases for
> me. How can I help in getting it into the main org repo?
>

IIRC, quite some time ago now, there were issues with copyright
etc. with this particular branch of the ODT exporter.  There is an ODT
exporter in the standard version of org.

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-573-g09e612


signature.asc
Description: PGP signature


Re: [O] Bug in ox.el

2017-09-13 Thread Qiang Fang
The standard version of org has a lot of limitations. Is it possible that the
author of ox-odt gives his repos as a gift to me, and let me deal with the
copyright stuff? I am living in China, a quasi-communist country, :<.

In case you won't check the issue because of it not copy right. The complete bug
report is:

"Lisp nesting exceeds ‘max-lisp-eval-depth’" exceeded, when using
cookies with List Tables.
org-export-table-cell-alignment uses org-export-data to infer cookies of some
columns. I think, it should use other mechanisms like org-element-interpret-data
(may be).


On 9/13/17, Eric S Fraga  wrote:
> On Wednesday, 13 Sep 2017 at 09:26, Qiang Fang wrote:
>> The original issue is at
>> https://github.com/kjambunathan/org-mode-ox-odt/issues/25
>>
>> "org-export-table-cell-alignment uses org-export-data to infer cookies
>> of some columns. I think, it should use other mechanisms like
>> org-element-interpret-data (may be)."
>>
>> The odt exporter is really useful, it replaces latex in most cases for
>> me. How can I help in getting it into the main org repo?
>>
>
> IIRC, quite some time ago now, there were issues with copyright
> etc. with this particular branch of the ODT exporter.  There is an ODT
> exporter in the standard version of org.
>
> --
> : Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-573-g09e612
>



[O] Babel: filtering code to produce another block

2017-09-13 Thread Jarmo Hurri

Greetings.

This question can again be described shortly and in more detail.

1. Short form: what would be a convenient way to filter the source
   code in a Babel source code block so that the output would be the
   source code in another block?

2. Then the long form. I need to emulate the very basics of one
   programming language, namely Processing

   https://processing.org/

   with another, namely Asymptote

   http://asymptote.sourceforge.net/

   This is to be done within Org. I need to do this to illustrate on
   paper the visual output of simple, static (no animation) Processing
   programs.

   Making this work roughly isn't too difficult, because these two
   languages have very similar syntaxes. For example, provided that a
   function rect() has been implemented in Asymptote, the following
   code is legit in both Processing and Asymptote:

   #+name: pic
   #+BEGIN_SRC asymptote
 size (800, 600);
 for (int i = 0; i < 10; i += 2)
   rect (i * 10, i * 20, 30, 10);
   #+END_SRC

   After this block has been defined I can show it as "Processing
   code" and draw a picture with Asymptote, using noweb if need be. It
   is also easy to use transforms so that the coordinate systems of
   the two languages match. Furthermore, typedef can be used to align
   some variable type differences.

   However, my current issue is dealing with 'final' in Asymptote. The
   following is not legit Asymptote code:
   #+BEGIN_SRC asymptote
 size (800, 600);
 final int S = 20;
 rect (100, 100, S, S);
   #+END_SRC
   
   It would be legit if the word 'final' were simply removed. Which
   brings me to the question: what would be an easy way to filter this
   block to produce another block? The header arguments of the two
   blocks would be different from each other.

Thanks in advance,

Jarmo




Re: [O] Bug in ox.el

2017-09-13 Thread Nicolas Goaziou
Hello,

Qiang Fang  writes:

> The standard version of org has a lot of limitations.

Please report them, and, if possible, help fixing them.

> In case you won't check the issue because of it not copy right. The complete 
> bug
> report is:
>
> "Lisp nesting exceeds ‘max-lisp-eval-depth’" exceeded, when using
> cookies with List Tables.

Does this issue happen with "ox-odt.el" bundled with Org? If so, could
you provide an ECM?

> org-export-table-cell-alignment uses org-export-data to infer cookies of some
> columns. I think, it should use other mechanisms like 
> org-element-interpret-data
> (may be).

I disagree. For example

  | @@html:text 1.2 |

doesn't express a number with `org-element-interpret-data', although it
is a number when exporting, i.e., to LaTeX.

There is only one way to know if the cell is going to be a number during
export: effectively exporting it.

Regards,

-- 
Nicolas Goaziou



Re: [O] jumping from Agenda/Timeline to .org source file

2017-09-13 Thread Nicolas Goaziou
Hello,

use...@internet.lu writes:

> I've been using org mode for several months now on my Mac without
> problems. Since most of what I do is for work I've tried using it on
> our company Windows 7 machines, using the official GNU Emacs 25.1
> for Windows. Unfortunately, I've had a nagging issue both with the september 
> and the november version:
>
> When I jump from the Agenda-Timeline view to the source .org file,

FWIW, Timeline feature was removed in Org 9.1.

Regards,

-- 
Nicolas Goaziou



[O] Unable to open some files in emacs with emacs 25.3.

2017-09-13 Thread Sharon Kimble

Ever since updating to emacs 25.3 yesterday I find that I cannot open
some of my files in emacs. This is the case in point -

--8<---cut here---start->8---
 [[~/cron/boudiccas.crontab]] 
--8<---cut here---end--->8---

On Monday that link would open the file in emacs, today, it doesn't and
the only change is the new emacs version.

So how do I fix it or get round it please?

To avoid cross-posting I'm going to send this email separately to the
'help-gun-emacs' list.

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk  
Debian 9.0, fluxbox 1.3.5-2, emacs 25.3.1, org-mode 9.1





signature.asc
Description: PGP signature


[O] Is it possible to repeat tasks only a certain amount of times?

2017-09-13 Thread Göktuğ Kayaalp
Hi,

I have a task with the following timestamp:

<2017-09-18 Pzt 14:25-18:40 +1w>

which represents an event that's going to repeat every week during a
certain period (it's not a TODO item).  With this timestamp however in
my agenda it repeats forever until when I'll finally archive it.
Ideally I'd have sth like the following:

<2017-09-18 Pzt 14:25-18:40 +1w #9>

where the final ‘#9’ means that the event will only repeat _8 times_
(i.e. 9 times with the initial instance).  Is this somehow already
possible, or else would it be plausible to implement this mainstream (I
could try to generate a patch in the coming weeks for this, tho it would
take a while as I'm not very familiar with org's innards and I wont have
lots of free time)?

I have tried the following:

<2017-09-18 Pzt 14:25-18:40 +1w>--

but then the entry appears (unsurprisingly) on my agenda every day,
instead of only on Monday, which I dont want at all (these are lessons
that repeat every certain day of each week of a certain period, and they
are many).

Thanks in advance,

   Göktuğ.

-- 
İ. Göktuğ Kayaalp   http://www.gkayaalp.com/index.html


signature.asc
Description: PGP signature


Re: [O] shift-return no longer increments dates?

2017-09-13 Thread Nicolas Goaziou
Hello,

Alan Schmitt  writes:

> I just updated emacs and org-mode, and I am having a small issue. When I
> hit shift-return on a date field, it simply copies it and no longer
> increments it.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Unable to open some files in emacs with emacs 25.3.

2017-09-13 Thread Nicolas Goaziou
Hello,

Sharon Kimble  writes:

> Ever since updating to emacs 25.3 yesterday I find that I cannot open
> some of my files in emacs. This is the case in point -
>
>  [[~/cron/boudiccas.crontab]]
>
> On Monday that link would open the file in emacs, today, it doesn't and
> the only change is the new emacs version.
>
> So how do I fix it or get round it please?

- What is the error message, if any?

- Is it specific to this file? Have you tried with another one?

- What happens if you insert the "file:" prefix, i.e,
  [[file:~/cron/boudiccas.crontab]]?

- How do you "open" the file? Is it with C-c C-o, RET, or something
  else? What happens if you call directly `M-x org-open-at-point'?

Regards,

-- 
Nicolas Goaziou



[O] Announce: Audio presentations with reveal.js from Org mode

2017-09-13 Thread Jens Lechtenboerger
Hi there,

you may be aware of Org-Reveal [1] to generate reveal.js [2]
presentations, which are HTML presentations, from Org mode.
I extended Org-Reveal to generate presentations with embedded audio
and bundled that along with some reveal.js plugins and necessary
configuration in the GitLab repository emacs-reveal [3].  Sample
presentations are available at [4].

I use the result for talks and teaching and believe it to be
particularly well-suited for presentations in the spirit of Open
Educational Resources (OER) [5], for the following reasons:
- Self-contained presentations, usable on lots of (including mobile
  and offline) devices with free software
- Separation of layout and content for ease of creation
- Text format for diff and merge for ease of collaboration

I hope this to be useful for your talks or teaching as well.
Feedback is highly appreciated.

Best wishes
Jens

[1] https://github.com/yjwen/org-reveal/
[2] http://lab.hakim.se/reveal-js/
[3] https://gitlab.com/oer/emacs-reveal
[4] https://oer.gitlab.io/OS/
[5] https://en.wikipedia.org/wiki/Open_educational_resources



Re: [O] Strange latex symbol behavior on html export

2017-09-13 Thread Nicolas Goaziou
Hello,

Lawrence Bottorff  writes:

> Consider this markup:
>
> 
> * MATHEMATICS AUXILIARY
>
> ** deriving sines and cosines
>
> #+caption: Right triangle with two $\pi\big/4$ angles.
> [[file:images/45-45-triangle.png]]
>
> $\big/$
> 
>
> If I remove the second $\big/$, the first latex, $\pi\big/4$, in the
> caption will not properly render on export to html. Include it and both
> render just fine. Without the second, the first looks like this:
>
> Figure 1: Right triangle with two \(\pi\big/4\) angles.
>
> Is this a bug?

If you use

  #+options: tex:dvipng

the symbol in the caption is correctly rendered. It may be a bug in Mathjax.

Regards,

-- 
Nicolas Goaziou



[O] [RFC] New "kbd" macro?

2017-09-13 Thread Nicolas Goaziou
Hello,

I would like to submit a new minor macro for integration within Org: the
"kbd" macro.

The "kbd" macro focuses on normalizing keybinding during export. For
example, during Texinfo export, {{{kbd(v SPC)}}} becomes 

  @kbd{v @key{SPC}}

whereas in another back-end, it becomes

  v 

More specifically:

  Within {{{kbd(...)}}}, the following case-sensitive keys are wrapped
  within angle brackets: SPC, RET, LFD, TAB, BS, ESC, DELETE, SHIFT,
  CTRL, META, up, down, left, right.

With an optional argument, it can wrap the key-binding within verbatim
or code markup:

  {{{kbd(v SPC,code)}}}  =>  ~v ~

  {{{kbd(v SPC,verbatim)}}}  =>  =v =

Other markup is not implemented because, in that case, you can wrap
appropriate characters around the macro.

Granted, this is probably only useful for Texinfo export, but defining
it as a global macro makes Org documents a bit more portable across
export back-ends.

If there is any interest in it, I will add tests and documentation.
I attach a proof of concept.

WDYT?


Regards,

-- 
Nicolas Goaziou0x80A93738
>From be6192293c41a3d252572a0fdbed7ac5b7a0c6bd Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Wed, 13 Sep 2017 13:01:59 +0200
Subject: [PATCH] org-macro: Implement kbd macro

* lisp/org-macro.el (org-macro--special-keys-re): New variable.
(org-macro--kbd): New function.
(org-macro-initialize-templates): Use new function.
---
 lisp/org-macro.el | 41 +++--
 1 file changed, 39 insertions(+), 2 deletions(-)

diff --git a/lisp/org-macro.el b/lisp/org-macro.el
index 3453e5e07..cad38cdd2 100644
--- a/lisp/org-macro.el
+++ b/lisp/org-macro.el
@@ -64,6 +64,8 @@
 (declare-function vc-call "vc-hooks" (fun file &rest args) t)
 (declare-function vc-exec-after "vc-dispatcher" (code))
 
+(defvar org-export-current-backend)
+
 ;;; Variables
 
 (defvar-local org-macro-templates nil
@@ -164,6 +166,9 @@ function installs the following ones: \"property\",
 (org-macro--counter-initialize)
 (funcall update-templates
 	 (cons "n" "(eval (org-macro--counter-increment \"$1\" \"$2\"))"))
+;; Install "kbd" macro.
+(funcall update-templates
+	 (cons "kbd" "(eval (org-macro--kbd \"$1\" \"$2\"))"))
 (setq org-macro-templates templates)))
 
 (defun org-macro-expand (macro templates)
@@ -294,6 +299,15 @@ Return a list of arguments, as strings.  This is the opposite of
 
 ;;; Helper functions and variables for internal macros
 
+(defvar org-macro--counter-table nil
+  "Hash table containing counter value per name.")
+
+(defconst org-macro--special-keys-re
+  (regexp-opt
+   '("SPC" "RET" "LFD" "TAB" "BS" "ESC" "DELETE" "SHIFT" "CTRL" "META"
+ "up" "left" "right" "down"))
+  "Regexp matching special keyboard keys.")
+
 (defun org-macro--vc-modified-time (file)
   (save-window-excursion
 (when (vc-backend file)
@@ -318,8 +332,31 @@ Return a list of arguments, as strings.  This is the opposite of
 	  (kill-buffer buf))
 	date
 
-(defvar org-macro--counter-table nil
-  "Hash table containing counter value per name.")
+(defun org-macro--kbd (kbd wrap)
+  "Return normalized keyboard sequence KBD.
+
+KBD is a string.  Within KBD, the following case-sensitive keys
+are wrapped within angle brackets: SPC, RET, LFD, TAB, BS, ESC,
+DELETE, SHIFT, CTRL, META, up, down, left, right.
+
+When WRAP is \"code\", the whole sequence is surrounded with
+\"~\" markers.  If WRAP is \"verbatim\", the sequence is
+surrounded with \"=\" markers."
+  (let* ((case-fold-search nil)
+	 (template
+	  (pcase wrap
+	("code" "~%s~")
+	("verbatim" "=%s=")
+	(_ "%s"
+(format template
+	(pcase org-export-current-backend
+	  (`texinfo
+	   (format "@@texinfo:@kbd{%s}@@"
+		   (replace-regexp-in-string
+			org-macro--special-keys-re "@key{\\&}" kbd t)))
+	  (_
+	   (replace-regexp-in-string
+		org-macro--special-keys-re "<\\&>" kbd t))
 
 (defun org-macro--counter-initialize ()
   "Initialize `org-macro--counter-table'."
-- 
2.14.1



Re: [O] LaTeX > PDF blocked by extender chars in filename

2017-09-13 Thread Adonay Felipe Nogueira
You're welcome! :)

Eduardo Mercovich  writes:

> Aló Felipe.
>
>
> I usually do it from the export menu: C-c C-e l p (export, latex,
> pdf). 
>
>
> I still never customized that export, thanks a lot for the information
> (emacs and orgmode depth and power never cease to amaze me).
> I will investigate the difference between the standard 3 runs of latex
> and latexmk. Of course, any experience about this will be gratefully
> enjoyed. :)
>
> Best regards...



Re: [O] [RFC] New "kbd" macro?

2017-09-13 Thread Kaushal Modi
On Wed, Sep 13, 2017 at 9:23 AM Nicolas Goaziou 
wrote:

> Hello,
>
> I would like to submit a new minor macro for integration within Org: the
> "kbd" macro.
>

Awesome!


> The "kbd" macro focuses on normalizing keybinding during export. For
> example, during Texinfo export, {{{kbd(v SPC)}}} becomes
>
>   @kbd{v @key{SPC}}
>
> whereas in another back-end, it becomes
>
>   v 
>

Can we have {{{kbd(v SPC)}}} export to below for HTML?

v SPC

It will be tremendously useful for blog posts. At the moment, I use this
hack[1] in ox-hugo.el.

*Also stuff within angle brackets will hide in HTML if you choose to leave
the export as "v " for HTML too!*

More specifically:
>
>   Within {{{kbd(...)}}}, the following case-sensitive keys are wrapped
>   within angle brackets: SPC, RET, LFD, TAB, BS, ESC, DELETE, SHIFT,
>   CTRL, META, up, down, left, right.
>
> With an optional argument, it can wrap the key-binding within verbatim
> or code markup:
>
>   {{{kbd(v SPC,code)}}}  =>  ~v ~
>
>   {{{kbd(v SPC,verbatim)}}}  =>  =v =
>

Looks good.

Granted, this is probably only useful for Texinfo export, but defining
> it as a global macro makes Org documents a bit more portable across
> export back-ends.
>

For HTML too! :)

If there is any interest in it, I will add tests and documentation.
> I attach a proof of concept.
>

+1

Copying Oleh, as I believe he would also have some interest in this.
-- 

Kaushal Modi


Re: [O] [RFC] New "kbd" macro?

2017-09-13 Thread Kaushal Modi
Oh, and the reference to [1] that I forgot to paste..

[1]:
https://github.com/kaushalmodi/ox-hugo/blob/a486141e4e2c3f9f67e799e20af150611d77f850/ox-hugo.el#L535-L542

On Wed, Sep 13, 2017 at 10:03 AM Kaushal Modi 
wrote:

> On Wed, Sep 13, 2017 at 9:23 AM Nicolas Goaziou 
> wrote:
>
>>
>> The "kbd" macro focuses on normalizing keybinding during export. For
>> example, during Texinfo export, {{{kbd(v SPC)}}} becomes
>>
>>   @kbd{v @key{SPC}}
>>
>> whereas in another back-end, it becomes
>>
>>   v 
>>
>
> Can we have {{{kbd(v SPC)}}} export to below for HTML?
>
> v SPC
>
> It will be tremendously useful for blog posts. At the moment, I use this
> hack[1] in ox-hugo.el.
>
-- 

Kaushal Modi


Re: [O] shift-return no longer increments dates?

2017-09-13 Thread Alan Schmitt
On 2017-09-13 14:17, Nicolas Goaziou  writes:

>> I just updated emacs and org-mode, and I am having a small issue. When I
>> hit shift-return on a date field, it simply copies it and no longer
>> increments it.
>
> Fixed. Thank you.

Thanks!

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-08: 405.07, 2016-08: 402.25


signature.asc
Description: PGP signature


Re: [O] [Feature request] LaTeX blocks preview

2017-09-13 Thread edgar

On 2017-08-19 08:57, Nicolas Goaziou wrote:

to be previewed in the same way as

 \begin{align}
   I_{0}
   & > \max{(\lambda_{f}^{2})}
   \\
   & > 2^{2}
   \\
   I_{0} & > 4
 \end{align}


It is not possible in the general case. The export block is not
guaranteed to contain a complete environment; it isn't necessarily
displayable either.



I am guessing that I missed this in the documentation or that it is 
conveniently unexpected behaviour, but I can do C-' to org-edit-special 
with \begin{align} ... \end{align} alone (as shown above; without the 
#+BEGIN_ ... #+END_).



- Related ::
   - org-edit-latex-mode
 There is org-edit-latex-mode, but it requires  some extra work:
 1. org-edit-special (C-')
 2. org-edit-latex-preview-at-point (C-c C-p C-p)
 3. org-edit-src-exit (C-')

 Besides, the preview does not stay in the original Org-mode 
buffer,

but it's lost with step 3.


I beg to keep it as it is; it's not a bug, but a feature in my opinion. 
I just want to leave this for future reference to others. Thanks!


-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



Re: [O] Git repo for org-odt-export

2017-09-13 Thread Nick Dokos
Qiang Fang  writes:

> Anyone trying to hack ox-odt can definitely get help here:
> https://github.com/kjambunathan/org-mode-ox-odt/
>

You need to be aware of some history. At the very least, read the "Some context"
section of this LWN article:

https://lwn.net/Articles/543339/

It is higly unlikely that, given the history, any contributions from this
individual will be accepted.

> James Harkins  writes:
>
>>   On Sat, 09 Sep 2017 05:06:24 -0400 James Harkins  
>> wrote 
>> I guess next I'm going to try to hack ox-odt.el...
>
>

-- 
Nick




Re: [O] Is it possible to repeat tasks only a certain amount of times?

2017-09-13 Thread Eric S Fraga
On Wednesday, 13 Sep 2017 at 14:01, Göktuğ Kayaalp wrote:
> I have tried the following:
>
> <2017-09-18 Pzt 14:25-18:40 +1w>--

I think this is discussed in the FAQ on the org mode web site but, in
any case, no, you cannot do what you want.  You may wish to look at 
,
| org-clone-subtree-with-time-shift is an interactive compiled Lisp
| function in ‘org.el’.
| 
| (org-clone-subtree-with-time-shift N &optional SHIFT)
| 
| Clone the task (subtree) at point N times.
| The clones will be inserted as siblings.
| 
| In interactive use, the user will be prompted for the number of
| clones to be produced.  If the entry has a timestamp, the user
| will also be prompted for a time shift, which may be a repeater
| as used in time stamps, for example ‘+3d’.  To disable this,
| you can call the function with a universal prefix argument.
| 
| When a valid repeater is given and the entry contains any time
| stamps, the clones will become a sequence in time, with time
| stamps in the subtree shifted for each clone produced.  If SHIFT
| is nil or the empty string, time stamps will be left alone.  The
| ID property of the original subtree is removed.
| 
| In each clone, all the CLOCK entries will be removed.  This
| prevents Org from considering that the clocked times overlap.
| 
| If the original subtree did contain time stamps with a repeater,
| the following will happen:
| - the repeater will be removed in each clone
| - an additional clone will be produced, with the current, unshifted
|   date(s) in the entry.
| - the original entry will be placed *after* all the clones, with
|   repeater intact.
| - the start days in the repeater in the original entry will be shifted
|   to past the last clone.
| In this way you can spell out a number of instances of a repeating task,
| and still retain the repeater to cover future instances of the task.
| 
| As described above, N+1 clones are produced when the original
| subtree has a repeater.  Setting N to 0, then, can be used to
| remove the repeater from a subtree and create a shifted clone
| with the original repeater.
`

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-573-g09e612


signature.asc
Description: PGP signature


Re: [O] [RFC] New "kbd" macro?

2017-09-13 Thread Eric S Fraga
On Wednesday, 13 Sep 2017 at 15:22, Nicolas Goaziou wrote:
> Hello,
>
> I would like to submit a new minor macro for integration within Org: the
> "kbd" macro.

My first inclination was to say that something like this belongs in
org-contrib (or on Worg, I guess) but if there is a need for this for
the texinfo exporter, why not include it?  It has no impact on anything
else as far as I can tell?  And it seems that others would find it
useful in any case.

eric

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-573-g09e612


signature.asc
Description: PGP signature


Re: [O] [RFC] New "kbd" macro?

2017-09-13 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> Can we have {{{kbd(v SPC)}}} export to below for HTML?
>
> v SPC

Good idea. New patch follows.

> *Also stuff within angle brackets will hide in HTML if you choose to leave
> the export as "v " for HTML too!*

Indeed. This is fixed per the change above.

Regards,

-- 
Nicolas Goaziou
>From 7caa7028ac496354fbe8a20eb98f63e306b9e021 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Wed, 13 Sep 2017 13:01:59 +0200
Subject: [PATCH] org-macro: Implement kbd macro

* lisp/org-macro.el (org-macro--special-keys-re): New variable.
(org-macro--kbd): New function.
(org-macro-initialize-templates): Use new function.
---
 lisp/org-macro.el | 47 +--
 1 file changed, 45 insertions(+), 2 deletions(-)

diff --git a/lisp/org-macro.el b/lisp/org-macro.el
index 3453e5e07..3da09910a 100644
--- a/lisp/org-macro.el
+++ b/lisp/org-macro.el
@@ -64,6 +64,8 @@
 (declare-function vc-call "vc-hooks" (fun file &rest args) t)
 (declare-function vc-exec-after "vc-dispatcher" (code))
 
+(defvar org-export-current-backend)
+
 ;;; Variables
 
 (defvar-local org-macro-templates nil
@@ -164,6 +166,9 @@ function installs the following ones: \"property\",
 (org-macro--counter-initialize)
 (funcall update-templates
 	 (cons "n" "(eval (org-macro--counter-increment \"$1\" \"$2\"))"))
+;; Install "kbd" macro.
+(funcall update-templates
+	 (cons "kbd" "(eval (org-macro--kbd \"$1\" \"$2\"))"))
 (setq org-macro-templates templates)))
 
 (defun org-macro-expand (macro templates)
@@ -294,6 +299,16 @@ Return a list of arguments, as strings.  This is the opposite of
 
 ;;; Helper functions and variables for internal macros
 
+(defvar org-macro--counter-table nil
+  "Hash table containing counter value per name.")
+
+(defconst org-macro--special-keys-re
+  (regexp-opt
+   '("SPC" "RET" "LFD" "TAB" "BS" "ESC" "DELETE" "SHIFT" "CTRL" "META"
+ "up" "left" "right" "down")
+   'words)
+  "Regexp matching special keyboard keys.")
+
 (defun org-macro--vc-modified-time (file)
   (save-window-excursion
 (when (vc-backend file)
@@ -318,8 +333,36 @@ Return a list of arguments, as strings.  This is the opposite of
 	  (kill-buffer buf))
 	date
 
-(defvar org-macro--counter-table nil
-  "Hash table containing counter value per name.")
+(defun org-macro--kbd (kbd wrap)
+  "Return normalized keyboard sequence KBD.
+
+KBD is a string.  Within KBD, the following case-sensitive keys
+are wrapped within angle brackets: SPC, RET, LFD, TAB, BS, ESC,
+DELETE, SHIFT, CTRL, META, up, down, left, right.
+
+When WRAP is \"code\", the whole sequence is surrounded with
+\"~\" markers.  If WRAP is \"verbatim\", the sequence is
+surrounded with \"=\" markers."
+  (let* ((case-fold-search nil)
+	 (template
+	  (pcase (org-trim wrap)
+	("code" "~%s~")
+	("verbatim" "=%s=")
+	(_ "%s"
+(format template
+	(cond
+	 ((org-export-derived-backend-p org-export-current-backend 'texinfo)
+	  (format "@@texinfo:@kbd{%s}@@"
+		  (replace-regexp-in-string
+		   org-macro--special-keys-re "@key{\\&}" kbd t)))
+	 ((org-export-derived-backend-p org-export-current-backend 'html)
+	  (format "@@html:%s@@"
+		  (replace-regexp-in-string
+		   org-macro--special-keys-re
+		   "\\&" kbd t)))
+	 (t
+	  (replace-regexp-in-string
+	   org-macro--special-keys-re "<\\&>" kbd t))
 
 (defun org-macro--counter-initialize ()
   "Initialize `org-macro--counter-table'."
-- 
2.14.1



Re: [O] Strange latex symbol behavior on html export

2017-09-13 Thread Nick Dokos
Nicolas Goaziou  writes:

> Hello,
>
> Lawrence Bottorff  writes:
>
>> Consider this markup:
>>
>> 
>> * MATHEMATICS AUXILIARY
>>
>> ** deriving sines and cosines
>>
>> #+caption: Right triangle with two $\pi\big/4$ angles.
>> [[file:images/45-45-triangle.png]]
>>
>> $\big/$
>> 
>>
>> If I remove the second $\big/$, the first latex, $\pi\big/4$, in the
>> caption will not properly render on export to html. Include it and both
>> render just fine. Without the second, the first looks like this:
>>
>> Figure 1: Right triangle with two \(\pi\big/4\) angles.
>>
>> Is this a bug?
>
> If you use
>
>   #+options: tex:dvipng
>
> the symbol in the caption is correctly rendered. It may be a bug in Mathjax.
>

I looked at the diff between html files produced with and without the $\big/$ 
addition.
The one without does not include any of the mathjax configuration code at all. 
Is that
code included conditionally perhaps when a latex construct is seen? Maybe the 
latex construct
in the caption does not trigger the inclusion?

-- 
Nick




[O] Bug: Setting org-export-use-babel to nil causes exporting to ignore :exports header

2017-09-13 Thread Richard Stanton

Emacs  : GNU Emacs 25.2.1 (x86_64-apple-darwin16.7.0, Carbon Version 157 AppKit 
1504.83)
 of 2017-08-28
Package: Org mode version 9.1 (9.1-20-ga4f139-elpa @ 
/Users/stanton/.emacs.d/elpa/org-20170911/)

I typically set org-export-use-babel to nil, to prevent all the code
cells being executed on export. However, if this variable is set, org
export both code and results for each cell, regardless of the setting of
the :exports header option. Withoput this variable being set, exporting
correctly obeys the :exports directives in the cell headers.

Richard Stanton




Re: [O] Is it possible to repeat tasks only a certain amount of times?

2017-09-13 Thread Jorge Morais Neto
How about a diary-style sexp entry, with org-class?  That is, something
like ~<%%(org-class 2017 7 31 2018 3 23 1)>~.  That example would appear
on the agenda on every Monday between 2017-07-31 and 2018-03-23.

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] Strange latex symbol behavior on html export

2017-09-13 Thread Lawrence Bottorff
#+options: tex:dvipng is not good because it turns all your latex symbol
markup into images, which are inserted into the web page as images, i.e.,
it's not doing MathJax. Also bad because they don't really fit the text
lines, either. I use

# this makes MathJax work
#+OPTIONS: tex:t

I just now found this caption weirdness because I started a new .org file
with no latex symbol markup besides in the caption. Quite bizarre that when
my file sees other latex symbols, the caption symbols then render
correctly.

BTW: What does

executing Scheme code block (square)...
=> #
org-babel-script-escape: ‘org-babel-script-escape’ expects a string

mean? I'm suddenly getting this in an org file which has scheme babel code
blocks, images, and lots of latex symbol markup. It first popped up when I
tried to C-c C-c a scheme code block.






On Wed, Sep 13, 2017 at 6:55 PM, Nick Dokos  wrote:

> Nicolas Goaziou  writes:
>
> > Hello,
> >
> > Lawrence Bottorff  writes:
> >
> >> Consider this markup:
> >>
> >> 
> >> * MATHEMATICS AUXILIARY
> >>
> >> ** deriving sines and cosines
> >>
> >> #+caption: Right triangle with two $\pi\big/4$ angles.
> >> [[file:images/45-45-triangle.png]]
> >>
> >> $\big/$
> >> 
> >>
> >> If I remove the second $\big/$, the first latex, $\pi\big/4$, in the
> >> caption will not properly render on export to html. Include it and both
> >> render just fine. Without the second, the first looks like this:
> >>
> >> Figure 1: Right triangle with two \(\pi\big/4\) angles.
> >>
> >> Is this a bug?
> >
> > If you use
> >
> >   #+options: tex:dvipng
> >
> > the symbol in the caption is correctly rendered. It may be a bug in
> Mathjax.
> >
>
> I looked at the diff between html files produced with and without the
> $\big/$ addition.
> The one without does not include any of the mathjax configuration code at
> all. Is that
> code included conditionally perhaps when a latex construct is seen? Maybe
> the latex construct
> in the caption does not trigger the inclusion?
>
> --
> Nick
>
>
>


Re: [O] Bug in ox.el

2017-09-13 Thread Qiang Fang
>> Does this issue happen with "ox-odt.el" bundled with Org? If so, could
>> you provide an ECM?

The issue happen with list-table in the unofficial ox-odt, list-table enables
list in tables, it's very cool.

>> The standard version of org has a lot of limitations.
> Please report them, and, if possible, help fixing them.

Most problem I reported are fixed in this repo:
https://github.com/kjambunathan/org-mode-ox-odt

And I think there is no one more capable and willing to fix issues related to
ox-odt than the original author.

It will benifit more people if we can include it in the official org-mode.

Can anyone tell me whether if my approach will work:
The author of ox-odt gives me his code as a gift, and it becomes mine, the I can
do everything with it, right?

On 9/13/17, Nicolas Goaziou  wrote:
> Hello,
>
> Qiang Fang  writes:
>
>> The standard version of org has a lot of limitations.
>
> Please report them, and, if possible, help fixing them.
>
>> In case you won't check the issue because of it not copy right. The
>> complete bug
>> report is:
>>
>> "Lisp nesting exceeds ‘max-lisp-eval-depth’" exceeded, when using
>> cookies with List Tables.
>
> Does this issue happen with "ox-odt.el" bundled with Org? If so, could
> you provide an ECM?
>
>> org-export-table-cell-alignment uses org-export-data to infer cookies of
>> some
>> columns. I think, it should use other mechanisms like
>> org-element-interpret-data
>> (may be).
>
> I disagree. For example
>
>   | @@html:text 1.2 |
>
> doesn't express a number with `org-element-interpret-data', although it
> is a number when exporting, i.e., to LaTeX.
>
> There is only one way to know if the cell is going to be a number during
> export: effectively exporting it.
>
> Regards,
>
> --
> Nicolas Goaziou
>



Re: [O] Strange latex symbol behavior on html export

2017-09-13 Thread Nick Dokos
Lawrence Bottorff  writes:

> ... I use
>
> # this makes MathJax work
> #+OPTIONS: tex:t
>
> I just now found this caption weirdness because I started a new .org
> file with no latex symbol markup besides in the caption. Quite
> bizarre that when my file sees other latex symbols, the caption
> symbols then render correctly. 
>

> On Wed, Sep 13, 2017 at 6:55 PM, Nick Dokos  wrote:
>
> Nicolas Goaziou  writes:
>
> > Hello,
> >
> > Lawrence Bottorff  writes:
> >
> >> Consider this markup:
> >>
> >> 
> >> * MATHEMATICS AUXILIARY
> >>
> >> ** deriving sines and cosines
> >>
> >> #+caption: Right triangle with two $\pi\big/4$ angles.
> >> [[file:images/45-45-triangle.png]]
> >>
> >> $\big/$
> >> 
> >>
> >> If I remove the second $\big/$, the first latex, $\pi\big/4$, in the
> >> caption will not properly render on export to html. Include it and both
> >> render just fine. Without the second, the first looks like this:
> >>
> >> Figure 1: Right triangle with two \(\pi\big/4\) angles.
> >>
> >> Is this a bug?
> >
> > If you use
> >
> >   #+options: tex:dvipng
> >
> > the symbol in the caption is correctly rendered. It may be a bug in 
> Mathjax.
> >
>
> I looked at the diff between html files produced with and without the 
> $\big/$ addition.
> The one without does not include any of the mathjax configuration code at 
> all. Is that
> code included conditionally perhaps when a latex construct is seen? Maybe 
> the latex construct
> in the caption does not trigger the inclusion?
>
> --
> Nick
>

org-html--build-mathjax-config includes the mathjax code only if

  (and (memq (plist-get info :with-latex) '(mathjax t))
   (org-element-map (plist-get info :parse-tree)
 '(latex-fragment latex-environment) 'identity info t))

is true. So if there is latex markup in the file (other than the caption) the 
org-element-map
call finds it and returns non-nil, but it apparently does not look inside the 
caption.

-- 
Nick




Re: [O] Bug in ox.el

2017-09-13 Thread Nick Dokos
Qiang Fang  writes:

> Can anyone tell me whether if my approach will work:
> The author of ox-odt gives me his code as a gift, and it becomes mine, the I 
> can
> do everything with it, right?
>

No. You can use it for your own personal purposes in accordance with
the terms of its license. That's all.

Please read the context section in the article that I pointed out to you 
earlier.

-- 
Nick




Re: [O] [RFC] New "kbd" macro?

2017-09-13 Thread Marcin Borkowski

On 2017-09-13, at 16:03, Kaushal Modi  wrote:

> On Wed, Sep 13, 2017 at 9:23 AM Nicolas Goaziou 
> wrote:
>
>> Hello,
>>
>> I would like to submit a new minor macro for integration within Org: the
>> "kbd" macro.
>>
>
> Awesome!

+1, I really missed such a feature!!!

> It will be tremendously useful for blog posts.

And technical writing.

> Granted, this is probably only useful for Texinfo export, but defining
>> it as a global macro makes Org documents a bit more portable across
>> export back-ends.
>
> For HTML too! :)

Don't forget about LaTeX!!!  It could use the menukeys package
(https://ctan.org/pkg/menukeys).

I could actually add some code to support that, do you want me to start
working on it?

Thanks a lot,

-- 
Marcin Borkowski



[O] Table format error

2017-09-13 Thread Cecil Westerhof
I think I found a table format error.
I created a table and after formatting it looks like:
​|---+---+---|
| 1 | Text  | 2 |
|---+---+---|
| Some text | Some more | And even more |
|---+---+---|

Then I copy the last row:
|---+---+---|
| 1 | Text  | 2 |
|---+---+---|
| Some text | Some more | And even more |
| Some text | Some more | And even more |
|---+---+---|

But when I then format the table,
the last heading goes from right aligned to left aligned:
|---+---+---|
| 1 | Text  | 2 |
|---+---+---|
| Some text | Some more | And even more |
| Some text | Some more | And even more |
|---+---+---|

​What is happening here?

I​ am using: Org-mode version 8.2.10.

-- 
Cecil Westerhof