Re: [O] Bug: C-u M-x org-footnote-action sort deletes footnotes used in #+include:’d files [8.2.10 (release_8.2.10 @ /usr/share/emacs/25.3/lisp/org/)]

2018-12-28 Thread Nicolas Goaziou
Hello,

Arne Babenhauserheide  writes:

> When a file uses #+include: X.org to structure an org-file and the
> included files use footnotes defined in the master file, export works
> without problems, but sorting the footnotes by reference with
> : C-u M-x org-footnote-action s
> removes the footnotes used in the included files.

Could you,

1. test it with the latest Org release (9.2)?
2. and, if that still fails, provide an ECM demonstrating your issue?

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: C-u M-x org-footnote-action sort deletes footnotes used in #+include:’d files [8.2.10 (release_8.2.10 @ /usr/share/emacs/25.3/lisp/org/)]

2018-12-28 Thread Arne Babenhauserheide
Hi Nicolas,

Thank you for your answer!

Nicolas Goaziou  writes:
>> When a file uses #+include: X.org to structure an org-file and the
>> included files use footnotes defined in the master file, export works
>> without problems, but sorting the footnotes by reference with
>> : C-u M-x org-footnote-action s
>> removes the footnotes used in the included files.

> 1. test it with the latest Org release (9.2)?

I cannot easily test with the latest release, but

> 2. and, if that still fails, provide an ECM demonstrating your issue?

here’s a minimal release. Add it into an org-file, then create main.org
and sub.org with M-x org-babel-tangle. Finally run the code-block in
main.org.

#+BEGIN_SRC org :tangle main.org
  ,#+include: sub.org

  Here is a footnote[fn:1]

  run the following code block with C-c C-c and answer with =s=
  ,#+BEGIN_SRC elisp
  (org-footnote-action t)
  ,#+END_SRC

  ,* Footnotes

  [fn:1] footnote referenced in main

  [fn:2] footnote referenced in sub

#+END_SRC

#+BEGIN_SRC org :tangle sub.org
  This footnote will get lost[fn:2]
#+END_SRC

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken


signature.asc
Description: PGP signature


[O] default value for org-capture-templates

2018-12-28 Thread Tyler Smith
Hi,

A question came up on StackOverflow asking about how to use the default capture 
template (`Task`) in combination with user-defined templates: 
https://emacs.stackexchange.com/questions/46794/where-is-default-org-mode-capture-template-for-tasks-located

The default Task template is actually stored in the function 
`org-capture-select-template`. This is a bit surprising, and requires the user 
to manually transfer it to the the variable `org-capture-templates` if they 
want to keep it as one of their options. 

Is there a reason not to set this built-in `Task` template as the default value 
of `org-capture-templates`? That would provide the user with a transparent way 
of keeping it as an option, modifying it, or removing it, as they prefer, 
through the usual customize interface.

I can put together a patch to do this if I haven't overlooked a problem this 
would create.

Best,

Tyler 

-- 
plantarum.ca



[O] combine two (or more) org tables to one

2018-12-28 Thread Uwe Brauer


Hi


I have to generate a table with 18 columns. Even with
org-table-toggle-column-width this is difficult to display.

So I thought to divide the table into 2 or three, edit them separately
and then combine them to the final one. I thought of using orgtbl-join
but there seems a bug which I have to report to the author.

Any other suggestion?

Uwe Brauer 





[O] [PATCH 2/2] org-parse-time-string: Describe time stamp matching behavior

2018-12-28 Thread Kyle Meyer
* lisp/org-macs.el (org-parse-time-string): Document matching of
-MM-DD substring.

org-clock-special-range used to pass in <-50001-11-30 Tue 00:00> with
the expectation that the year would be parsed as -50001, not 0001.
Mention this -MM-DD format assumption in the docstring to help
avoid such cases.
---
 lisp/org-macs.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 6da69c75d..9a65360ff 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -1112,7 +1112,9 @@ (defun org-parse-time-string (s &optional nodefault)
 If time is not given, defaults to 0:00.  However, with optional
 NODEFAULT, hour and minute fields are nil if not given.
 
-Throw an error if S in not a valid Org time string.
+Throw an error if S does not contain a valid Org time string.
+Note that the first match for -MM-DD will be used (e.g.,
+\"-52000-02-03\" will be taken as \"2000-02-03\").
 
 This should be a lot faster than the `parse-time-string'."
   (unless (string-match org-ts-regexp0 s)
-- 
2.20.0




Re: [O] [PATCH] Suggestion to self-link headlines exported to HTML

2018-12-28 Thread Toon Claes
Thanks Nicolas for taking time to have look at my patch.

I'm a attaching a second version of the patch. Please have another look.

-- Toon

From 094576d4c082fc384aa56bf2f4ec2749fec540a7 Mon Sep 17 00:00:00 2001
From: Toon Claes 
Date: Sun, 16 Dec 2018 21:55:40 +0100
Subject: [PATCH] ox-html: Make it possible to self link headlines

* lisp/ox-html.el (org-html-self-link-headlines): New variable.
(org-html-headline): Create a hyperlink on headlines
when :html-self-link-headlines is set.
---
 doc/org-manual.org | 16 
 etc/ORG-NEWS   |  5 +
 lisp/ox-html.el| 18 +++---
 3 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 59e31d8b3..884975d8f 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -12495,6 +12495,21 @@ For larger raw HTML code blocks, use these HTML export code blocks:
 ,#+END_EXPORT
 #+end_example
 
+*** Headlines in HTML export
+:PROPERTIES:
+:DESCRIPTION: Formatting headlines.
+:END:
+#+cindex: headlines, in HTML export
+
+Headlines are exported to ~~, ~~, etc.  Each headline will get
+the ~id~ attribute from =CUSTOM_ID= property, or a unique generated
+value, see [[*Internal Links]].
+
+#+vindex: org-html-self-link-headlines
+When ~org-html-self-link-headlines~ is set to a non-~nil~ value, the
+text of the headlines is also wrapped in ~~ tags.  These tags have
+a ~href~ attribute making the headlines link to the headline itself.
+
 *** Links in HTML export
 :PROPERTIES:
 :DESCRIPTION: Inserting and formatting links.
@@ -15610,6 +15625,7 @@ Settings]]), however, override everything.
 | ~:html-postamble~  | ~org-html-postamble~  |
 | ~:html-preamble-format~| ~org-html-preamble-format~|
 | ~:html-preamble~   | ~org-html-preamble~   |
+| ~:html-self-link-headlines~| ~org-html-self-link-headlines~|
 | ~:html-table-align-individual-field~   | ~de{org-html-table-align-individual-fields~   |
 | ~:html-table-attributes~   | ~org-html-table-default-attributes~   |
 | ~:html-table-caption-above~| ~org-html-table-caption-above~|
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 811e98147..817d6eacc 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -312,6 +312,11 @@ beginning of a headline when using Org speed commands.  Now, if there
 is already a restriction at point, hitting =<= again (or =C-x C-x <=) will
 remove it.
 
+*** Headlines can now link to themselves in HTML export
+
+When enabling ~org-html-self-link-headlines~ the headlines exported to
+HTML contain a hyperlink to themselves.
+
 ** New commands and functions
 
 *** ~org-insert-structure-template~
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index b4ec25786..728e156f1 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -152,6 +152,7 @@
 (:html-metadata-timestamp-format nil nil org-html-metadata-timestamp-format)
 (:html-postamble-format nil nil org-html-postamble-format)
 (:html-preamble-format nil nil org-html-preamble-format)
+(:html-self-link-headlines nil nil org-html-self-link-headlines)
 (:html-table-align-individual-fields
  nil nil org-html-table-align-individual-fields)
 (:html-table-caption-above nil nil org-html-table-caption-above)
@@ -802,6 +803,13 @@ but without \"name\" attribute."
   :package-version '(Org . "8.0")
   :type 'boolean)
 
+(defcustom org-html-self-link-headlines nil
+  "When non-nil, the headlines contain a hyperlink to themselves."
+  :group 'org-export-html
+  :package-version '(Org . "9.3")
+  :type 'boolean
+  :safe #'booleanp)
+
  Inlinetasks
 
 (defcustom org-html-format-inlinetask-function
@@ -2592,7 +2600,11 @@ holding contextual information."
todo todo-type priority text tags info))
(contents (or contents ""))
 	   (id (or (org-element-property :CUSTOM_ID headline)
-		   (org-export-get-reference headline info
+		   (org-export-get-reference headline info)))
+	   (formatted-text
+	(if (plist-get info :html-self-link-headlines)
+		(format "%s" id full-text)
+	  full-text)))
   (if (org-export-low-level-p headline info)
   ;; This is a deep sub-tree: export it as a list item.
   (let* ((html-type (if numberedp "ol" "ul")))
@@ -2603,7 +2615,7 @@ holding contextual information."
 	 (org-html-format-list-item
 	  contents (if numberedp 'ordered 'unordered)
 	  nil info nil
-	  (concat (org-html--anchor id nil nil info) full-text)) "\n"
+	  (concat (org-html--anchor id nil nil info) formatted-text)) "\n"
 	 (and (org-export-last-sibling-p headline info)
 		  (format "\n" html-type
 	;; Standard headline.  Export it as a section.
@@ -2625,7 +2637,7 @@ holding contextual information."

[O] [PATCH 1/2] org-clock: Simplify `untilnow' range logic

2018-12-28 Thread Kyle Meyer
* lisp/org-clock.el (org-clock-special-range): Use nil to represent
`untilnow'.

For `untilnow', org-clock-special-range sets the start to
"<-50001-11-30 Tue 00:00>", but org-parse-time-string actually assumes
a -MM-DD format and parses the year as 0001.  By chance, this is
still a really old date, so no one noticed.  However, with the port of
Emacs's fde99c729c (Port recent org-clock fix to POSIX time_t,
2018-03-28), test-org-clock/clocktable/ranges would fail if the system
supports the oldest date tried, "<-67715-09-22 Tue 17:51>".

But this "encode-time -> format-time-string -> org-parse-time-string"
dance is unnecessary.  All the current callers of
org-clock-special-range in Org's codebase (1) explicitly check if the
starting time is nil, (2) don't use the starting time, or (3) pass it
directly to org-clock-sum, which handles nil values.  And
org-clock-sum executes the same codepath when nil is passed instead of
"really old date".
---
 lisp/org-clock.el | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 494423e4e..2c24b04fb 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2126,7 +2126,8 @@ (defun org-clock-special-range (key &optional time 
as-strings wstart mstart)
 the beginning of the range and one for its end, like the ones
 returned by `current-time' or `encode-time' and a string used to
 display information.  If AS-STRINGS is non-nil, the returned
-times will be formatted strings.
+times will be formatted strings.  Note that the first element is
+always nil when KEY is `untilnow'.
 
 If WSTART is non-nil, use this number to specify the starting day
 of a week (monday is 1).  If MSTART is non-nil, use this number
@@ -2243,9 +2244,7 @@ (defun org-clock-special-range (key &optional time 
as-strings wstart mstart)
 ;; Format start and end times according to AS-STRINGS.
 (let* ((start (pcase key
(`interactive (org-read-date nil t nil "Range start? "))
-;; In theory, all clocks started after the dawn of
-;; humanity.
-   (`untilnow (encode-time 0 0 0 0 0 -5))
+   (`untilnow nil)
(_ (encode-time 0 m h d month y
   (end (pcase key
  (`interactive (org-read-date nil t nil "Range end? "))
@@ -2269,7 +2268,7 @@ (defun org-clock-special-range (key &optional time 
as-strings wstart mstart)
  (`untilnow "now"
   (if (not as-strings) (list start end text)
(let ((f (cdr org-time-stamp-formats)))
- (list (format-time-string f start)
+ (list (and start (format-time-string f start))
(format-time-string f end)
text))
 
-- 
2.20.0




[O] [PATCH 0/2] org-clock: Simplify `untilnow' range logic

2018-12-28 Thread Kyle Meyer
Hello,

For the clock table `untilnow' behavior, we set the starting point to
a really old date, but that falls outside the -MM-DD that
org-parse-time-string was designed to handle.  I've reworked
org-clock-special-range to use nil to represent the starting bound for
`untilnow' and updated org-parse-time-string to mention the -MM-DD
assumption.

Please let me know if you have any objections.  Otherwise, I'll apply
the following commits to maint in a few days.

  org-clock: Simplify `untilnow' range logic
  org-parse-time-string: Describe time stamp matching behavior

 lisp/org-clock.el | 9 -
 lisp/org-macs.el  | 4 +++-
 2 files changed, 7 insertions(+), 6 deletions(-)

-- 
2.20.0




Re: [O] Release 9.2

2018-12-28 Thread Scott Randby
On 12/27/18 4:41 AM, Bastien wrote:
> Hi all,
> 
> Org 9.2 is out: https://orgmode.org
> 

Greetings Org users,

I installed Org 9.2 and I'm enjoying some of the new features.

The new structure template mechanism is really nice because now I only have to 
remember C-c C-,.

The ability to dynamically narrow and widen table columns makes it a lot easier 
to work with tables which have a large number of columns.

Being able to exclude unnumbered headlines from the table of contents solves a 
problem I've struggled with for awhile.

The best new feature for me is the attachment of the new variable 
org-toggle-narrow-to-subtree to the "s" speed key. I narrow to subtrees 
constantly, and this new feature means I will soon forget the old cumbersome 
way without regret.

Like previous releases, Org 9.2 is a superb release. Everyone who worked to 
make this release happen has my appreciation and thanks.

Scott Randby



[O] Org mode at 34C3: my demo + request for help

2018-12-28 Thread Karl Voit
Hi!

It's my first time at a CCC Congress[1].

There is an Emacs assembly: [2] by https://chaos.social/@Drops

Since there was no Emacs talk at all and almost nothing going on on
the Emacs assembly, I decided to do a basic Org mode demo to explain
the universe of advantages to non-Emacs users: [3]

This is no offiziel 35C3 talk and no recording. It's a
self-organized event which is made possible by the assembly called
Komona.

In my opinion, almost everybody who is on the 35C3 should be able to
profit from it on a daily basis and almost nobody has a clue what
she/he is missing out.

Unfortunately, I got a bit sick today. It would be very cool if
somebody could help me (a) with doing some advertisement in order to
reach as many Org newbies or even Emacs-sceptics as possible and (b)
with some simple statistics:

My assumption is that the size of the Org mode community is
comparable or even(?) larger than the GNU Emacs community.
Therefore, can somebody do a quick statistics on the number of
unique posters (email addresses) per reasonable time-frame
(November?) from a (the?) GNU Emacs mailing list and from this
mailing list?

If this supports my assumption, it would emphasise my argument, that
Org mode is not just about editing[4] in order to address vim-users
like myself.

Thanks for your support!

PS: Besides my blog post [3] I already did promote the event on
Mastodon[5][6] and Twitter[7] and printed some A4 posters which I
mounted on nice places.

[1] https://karl-voit.at/2018/12/28/35c3-day1/
[2] https://signup.c3assemblies.de/assembly/56152a8a-d1c8-4b96-8a26-cf5f05ab8ee6
[3] https://karl-voit.at/2018/12/28/35C3-orgmode-demo-announcement/
[4] https://karl-voit.at/2015/10/23/Emacs-is-not-just-an-editor
[5] https://mastodon.social/@publicvoit/101319442456868601
[6] https://mastodon.social/@publicvoit/101319450781745345
[7] https://twitter.com/novoid

-- 
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <
Personal Information Management > http://Karl-Voit.at/tags/pim/
Emacs-related > http://Karl-Voit.at/tags/emacs/




[O] New "next" branch has issue on LaTeX block fontify

2018-12-28 Thread stardiviner

I'm using the "next" branch version Org Mode, but found the LaTeX block has 
fontify issue.

You can see in the attachment screenshot:



-- 
[ stardiviner ]
   I try to make every word tell the meaning what I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
  


Re: [O] Org mode at 34C3: my demo + request for help

2018-12-28 Thread stardiviner


I'd like to see a statistics of Org Mode and Emacs users too.

How about use Org Mode to organize the project source code and publish
as Org file?

--
[ stardiviner ]
   I try to make every word tell the meaning what I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3