Re: [O] Org Mode - Organize Your Life In Plain Text!

2018-12-16 Thread David Masterson
Bernt Hansen  writes:

> Hi David,
>
> Sorry my website on org-mode is stale and I don't currently have time to
> update it.  I stopped updating it in 2015 after changing jobs and moving
> to the windows platform (at work).  My main issue is lack of free time
> to spend on this project.
>
> The downloadable org file is actually the result of publishing the org
> source from my very out-of-date Linux workstation.  The original org
> file (all versions) is available in the git repository.
>
> I'd be happy to answer any questions you have related to the site or my
> current use of org-mode.  I still work in a similar way described on
> http://doc.norang.ca/org-mode.html but my agenda and some workflows have
> evolved a bit from what is described in the document.
>
> Regards,
> Bernt

Thank you for replying.  I'll just ask a few questions and maybe expand
upon them later.

1. Are you still working with Emacs/Org from 2015 or have you updated
(but not updated your paper)?

2. If you've updated to Org v9+, did you find significant changes from
what you documented in your paper?  In other words, will running your
paper through tangle and trying to use the results with latest Emacs and
Org be likely to work?  Particularly agendas...

3. Can you suggest a more detailed manual on the setup and use of
Agendas?  The agenda manual with Org is not really clear to me.

--
David



Re: [O] Org Mode - Organize Your Life In Plain Text!

2018-12-16 Thread Bernt Hansen
David Masterson  writes:

> I've been reading Bernt Hansen's excellent paper on setting up Org-Mode,
> but I noticed that it is rather dated and was wondering if Bernt is
> watching and plans to update the paper.  In particular, the last version
> of the paper on his website has a couple of things that I think should
> be fixed even if he doesn't do anything further with the paper.
>
> 1. Update the stale screen shots to match the rest of the paper so that
> people can see what you're talking about directly -- they would be very
> helpful.
>
> 2. Embed the version numbers in the paper so that when people download
> the paper, they don't lose the version/date of the paper they
> downloaded.  If I read it right, the paper calls a function which gets
> the version from git.  That won't work if I just download the org file.
>
> Is Bernt watching?

Hi David,

Sorry my website on org-mode is stale and I don't currently have time to
update it.  I stopped updating it in 2015 after changing jobs and moving
to the windows platform (at work).  My main issue is lack of free time
to spend on this project.

The downloadable org file is actually the result of publishing the org
source from my very out-of-date Linux workstation.  The original org
file (all versions) is available in the git repository.

I'd be happy to answer any questions you have related to the site or my
current use of org-mode.  I still work in a similar way described on
http://doc.norang.ca/org-mode.html but my agenda and some workflows have
evolved a bit from what is described in the document.

Regards,
Bernt





Re: [O] cannot export to beamer.

2018-12-16 Thread Eric S Fraga
On Sunday, 16 Dec 2018 at 19:16, Uwe Brauer wrote:
 "Eric" == Eric S Fraga  writes:
>
>> Can you be explicit about how you are exporting to beamer 
>
> Either 
>
> C-c C-e l l
>
> Or 
>
> C-c C-e l o

And here is the problem.  These are not the export directives to use for
beamer.  Use C-c C-e l b to generate beamer LaTeX code or C-c C-e l O to
open the PDF.
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.14-1035-gfeb442



Re: [O] cannot export to beamer.

2018-12-16 Thread Tim Cross


I suspect that the recent changes in how Emacs runs initialisation may
well expose a few edge cases for the customise interface. The custimise
interface is fairly basic and makes a few assumptions which may not hold
once you start altering the order of initialisation and package
loading. While it all works fine 80% of the time, it may fail for more
complex situations and the reality is, Org is large and complex.

Strictly speaking, I don't think it is a bug. The problem is getting the
right balance of what to load and what to leave for the user to decide
to load. If you never use beamer, then having all the beamer stuff
loaded by default is only going to slow down start up (though I do think
people are way too obsessed with startup time these days! I start emacs
about once per week and only that often because I shutdown my laptop on
the weekend when I leave work!). If beamer is not loaded when you
customise org-latex-classes, then it won't be in the variable and if it
isn't in the variable, it cannot be saved into the custom block. If you
then later decide to load it and it is loaded before your customisation
is loaded, then the value it adds to org-latex-classes is lost. If on
the other hand we 'hard code' it into the variable so it doesn't depend
on whether ox-beamer is loaded, then a definition will exist which won't
work when the user tries to use it as ox-beamer is not
loaded. Previously, I think custom blocks were loaded at the start of
your init, so before org was loaded, so this was less of an issue. No
with the early init stuff, things are not quite the same (a lot of guess
work here!).

Tim

Uwe Brauer  writes:

 "Tim" == Tim Cross  writes:
>
>> Just a shot in the dark here .
>
>> You mentioned you used custom to modify the org-latex-classes
>> variable. Does the code in the custom 'block' of your init file have
>> beamer as one of the classes? 
>
> No it does not and this turns out a problem, also I thought the
> ox-beamer code contains a add-to-list which should do add beamer, but it
> seems not to do it.
>
>
>> My suspicion is that when you added your exam class, for some
>> reason, beamer had not been loaded and was not yet in the variable
>> definition. When you edited it to add your exam class it has saved
>> a version without beamer as a class.
>
>> When you start emacs, with the new init and run order, the code
>
>>> (unless (assoc "beamer" org-latex-classes)
>>> (add-to-list 'org-latex-classes
>>> '("beamer"
>>> "\\documentclass[presentation]{beamer}"
>>> ("\\section{%s}" . "\\section*{%s}")
>>> ("\\subsection{%s}" . "\\subsection*{%s}")
>>> ("\\subsubsection{%s}" . "\\subsubsection*{%s}"
>
>> is executed and beamer is added, but then your custom settings are
>> evaluated and the variable is reset with the version you added the exam
>> class to, which has no beamer entry, is used to reset the variable and
>> the beamer setting is lost.
>
>
> What you say makes send but this seems to defy the whole idea of custom!
>
>
>> I would start by deleting the org-latex-classes customization and try
>> adding it again to see if that fixes the problem. This is one reason I
>> rarely use customise - I prefer to have the code in my own init file so
>> that I can see exactly when everything is run.
>
> Thanks! I will do that and you are very right about custom, it is very
> convenient but buggier than I thought.
>
> Uwe 


-- 
Tim Cross



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

2018-12-16 Thread Toon Claes
Hi,

Recently I wrote a blog post on making headlines clickable when Org mode
is exported to HTML:
https://writepermission.com/org-blogging-clickable-headlines.html

With this mail, I'd like to suggest a change to bring this feature to
the Org mode core.

It's my first contribution to Org mode, but I've already completed the
paperwork to contribute to Emacs core in the past.

Of course any comment is welcome.

-- Toon


From 5b279778326d844b6dd2895dba7eae2c096056cc 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 |  1 +
 etc/ORG-NEWS   |  5 +
 lisp/ox-html.el| 18 +++---
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 59e31d8b3..4f00655fa 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -15610,6 +15610,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..826d97a5d 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 set, the headlines contain a hyperlink to themselves."
+  :group 'org-export-html
+  :version "27.1"
+  :package-version '(Org . "9.2")
+  :type 'boolean)
+
  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 (and id (plist-get info :html-self-link-headlines))
+		(format "%s" id full-text)
+	  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."
  "%s "
  level
  (mapconcat #'number-to-string numbers ".")))
-   full-text)
+   formatted-text)
   level)
   ;; When there is no section, pretend there is an
   ;; empty one to get the correct 

signature.asc
Description: PGP signature


Re: [O] cannot export to beamer.

2018-12-16 Thread Uwe Brauer
>>> "Ken" == Ken Mankoff  writes:

   > On 2018-12-16 at 10:16 -0800, Uwe Brauer  wrote:
   >> So the problem is in my init file and I am quite sure that it has to
   >> do with the following lines in my custom- file
   >> 
   >> '(org-latex-classes

   > What is the full line here? Is this a "setq"?

No it is not a setq, it is a 
(custom-set-variables

Which I did not copy.


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] cannot export to beamer.

2018-12-16 Thread Uwe Brauer
>>> "Tim" == Tim Cross  writes:

   > Just a shot in the dark here .

   > You mentioned you used custom to modify the org-latex-classes
   > variable. Does the code in the custom 'block' of your init file have
   > beamer as one of the classes? 

No it does not and this turns out a problem, also I thought the
ox-beamer code contains a add-to-list which should do add beamer, but it
seems not to do it.


   > My suspicion is that when you added your exam class, for some
   > reason, beamer had not been loaded and was not yet in the variable
   > definition. When you edited it to add your exam class it has saved
   > a version without beamer as a class.

   > When you start emacs, with the new init and run order, the code

   >> (unless (assoc "beamer" org-latex-classes)
   >> (add-to-list 'org-latex-classes
   >> '("beamer"
   >> "\\documentclass[presentation]{beamer}"
   >> ("\\section{%s}" . "\\section*{%s}")
   >> ("\\subsection{%s}" . "\\subsection*{%s}")
   >> ("\\subsubsection{%s}" . "\\subsubsection*{%s}"

   > is executed and beamer is added, but then your custom settings are
   > evaluated and the variable is reset with the version you added the exam
   > class to, which has no beamer entry, is used to reset the variable and
   > the beamer setting is lost.


What you say makes send but this seems to defy the whole idea of custom!


   > I would start by deleting the org-latex-classes customization and try
   > adding it again to see if that fixes the problem. This is one reason I
   > rarely use customise - I prefer to have the code in my own init file so
   > that I can see exactly when everything is run.

Thanks! I will do that and you are very right about custom, it is very
convenient but buggier than I thought.

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] cannot export to beamer.

2018-12-16 Thread Ken Mankoff


On 2018-12-16 at 10:16 -0800, Uwe Brauer  wrote:
> So the problem is in my init file and I am quite sure that it has to
> do with the following lines in my custom- file
>
>  '(org-latex-classes

What is the full line here? Is this a "setq"?

I have:

(add-to-list 'org-latex-classes
   `("copernicus"
 "\\documentclass{copernicus}
   [NO-DEFAULT-PACKAGES]
   [NO-PACKAGES]...

At it doesn't damage the existing setup, juts adds to it...

  -k.




Re: [O] cannot export to beamer.

2018-12-16 Thread Tim Cross



Just a shot in the dark here .

You mentioned you used custom to modify the org-latex-classes
variable. Does the code in the custom 'block' of your init file have
beamer as one of the classes? My suspicion is that when you added your
exam class, for some reason, beamer had not been loaded and was not yet
in the variable definition. When you edited it to add your exam class it
has saved a version without beamer as a class.

When you start emacs, with the new init and run order, the code

> (unless (assoc "beamer" org-latex-classes)
>   (add-to-list 'org-latex-classes
>  '("beamer"
>"\\documentclass[presentation]{beamer}"
>("\\section{%s}" . "\\section*{%s}")
>("\\subsection{%s}" . "\\subsection*{%s}")
>("\\subsubsection{%s}" . "\\subsubsection*{%s}"

is executed and beamer is added, but then your custom settings are
evaluated and the variable is reset with the version you added the exam
class to, which has no beamer entry, is used to reset the variable and
the beamer setting is lost.

My guess is that at the time you customized the variable, beamer was not
loaded and so the beamer class was not added. Now, when you start emacs,
beamer is being loaded before your custom block is evaluated and your
customisation is overriding the value added by beamer when it is loaded.

There are numerous reasons why this might occur. It may simply be
something subtle arising from the new load order (for example,
previously, such a value may have been fine as your custom settings
would be loaded before the ox-beamer library, but now the library is
being loaded first and then custom settings?). This could be likely if
you are using a custom block saved with an earlier version of emacs. 

I would start by deleting the org-latex-classes customization and try
adding it again to see if that fixes the problem. This is one reason I
rarely use customise - I prefer to have the code in my own init file so
that I can see exactly when everything is run.

Tim


 "Eric" == Eric S Fraga  writes:
>
>> Can you be explicit about how you are exporting to beamer 
>
> Either 
>
> C-c C-e l l
>
> Or 
>
> C-c C-e l o
>
>> and what version of org you are using? 
>
> The latest master version 
> commit adec504d5ba3f2089cb689ce5a59692a8ebf6735
>> What happens if you start emacs with -Q?
>
> Then both commands do work (even I do not need 'ox-beamer)
>
> So the problem is in my init file and I am quite sure that it has to do
> with the following lines in my custom- file
>
>  '(org-latex-classes
>'(("article" "\\documentclass[12pt]{article}"
>   ("\\section{%s}" . "\\section*{%s}")
>   ("\\subsection{%s}" . "\\subsection*{%s}")
>   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>   ("\\paragraph{%s}" . "\\paragraph*{%s}")
>   ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
>  ("report" "\\documentclass[12pt]{report}"
>   ("\\part{%s}" . "\\part*{%s}")
>   ("\\chapter{%s}" . "\\chapter*{%s}")
>   ("\\section{%s}" . "\\section*{%s}")
>   ("\\subsection{%s}" . "\\subsection*{%s}")
>   ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
>  ("book" "\\documentclass[12pt]{book}"
>   ("\\part{%s}" . "\\part*{%s}")
>   ("\\chapter{%s}" . "\\chapter*{%s}")
>   ("\\section{%s}" . "\\section*{%s}")
>   ("\\subsection{%s}" . "\\subsection*{%s}")
>   ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
>  ("exam" "\\documentclass[12pt, addpoints, answers]{exam}"
>   ("\\begin{questions}%%%s" "\\end{questions}" "\\begin{questions}%%%s" 
> "\\end{questions}")
>   ("\\titledquestion{%s}" . "")
>   ("\\begin{parts}%%%s" "\\end{parts}" "\\begin{parts}%%%s" 
> "\\end{parts}")
>   ("\\part[%s] " . "")
>   ("\\begin{subparts}%%%s" "\\end{subparts}" "\\begin{subparts}%%%s" 
> "\\end{subparts}")
>   ("\\subpart[%s] " . "")
>   ("\\begin{solution}[%s]" "\\end{solution}" "\\begin{solution}[%s]"
>"\\end{solution}"
>
> I have them because I wanted to add the latex exam class and that is
> what custom is for. For some bizarre reason 
>
> The code 
> (unless (assoc "beamer" org-latex-classes)
>   (add-to-list 'org-latex-classes
>  '("beamer"
>"\\documentclass[presentation]{beamer}"
>("\\section{%s}" . "\\section*{%s}")
>("\\subsection{%s}" . "\\subsection*{%s}")
>("\\subsubsection{%s}" . "\\subsubsection*{%s}"
>
> In ox-beamer
>
> Is ignored. It looks like a bug to me.


-- 
Tim Cross



Re: [O] cannot export to beamer.

2018-12-16 Thread Uwe Brauer
>>> "Eric" == Eric S Fraga  writes:

   > Can you be explicit about how you are exporting to beamer 

Either 

C-c C-e l l

Or 

C-c C-e l o

   > and what version of org you are using? 

The latest master version 
commit adec504d5ba3f2089cb689ce5a59692a8ebf6735
   > What happens if you start emacs with -Q?

Then both commands do work (even I do not need 'ox-beamer)

So the problem is in my init file and I am quite sure that it has to do
with the following lines in my custom- file

 '(org-latex-classes
   '(("article" "\\documentclass[12pt]{article}"
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
  ("\\paragraph{%s}" . "\\paragraph*{%s}")
  ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
 ("report" "\\documentclass[12pt]{report}"
  ("\\part{%s}" . "\\part*{%s}")
  ("\\chapter{%s}" . "\\chapter*{%s}")
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
 ("book" "\\documentclass[12pt]{book}"
  ("\\part{%s}" . "\\part*{%s}")
  ("\\chapter{%s}" . "\\chapter*{%s}")
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
 ("exam" "\\documentclass[12pt, addpoints, answers]{exam}"
  ("\\begin{questions}%%%s" "\\end{questions}" "\\begin{questions}%%%s" 
"\\end{questions}")
  ("\\titledquestion{%s}" . "")
  ("\\begin{parts}%%%s" "\\end{parts}" "\\begin{parts}%%%s" "\\end{parts}")
  ("\\part[%s] " . "")
  ("\\begin{subparts}%%%s" "\\end{subparts}" "\\begin{subparts}%%%s" 
"\\end{subparts}")
  ("\\subpart[%s] " . "")
  ("\\begin{solution}[%s]" "\\end{solution}" "\\begin{solution}[%s]"
   "\\end{solution}"

I have them because I wanted to add the latex exam class and that is
what custom is for. For some bizarre reason 

The code 
(unless (assoc "beamer" org-latex-classes)
  (add-to-list 'org-latex-classes
   '("beamer"
 "\\documentclass[presentation]{beamer}"
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}"

In ox-beamer

Is ignored. It looks like a bug to me.


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] cannot export to beamer.

2018-12-16 Thread Eric S Fraga
Can you be explicit about how you are exporting to beamer and what
version of org you are using?  What happens if you start emacs with -Q?

For me, all I require is to have (require 'ox-beamer) and then I can
export with "C-c C-e l O", having started emacs with -Q.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.14-1035-gfeb442