Re: [O] org-today broken

2019-01-31 Thread Kyle Meyer
Samuel Wales  writes:

> recent versions of maint and probably master have nil instead of
> current time in org-today.
>
> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>   time-subtract(nil (0 0 0))
>   org-today()
>   (message "org today is %s" (org-today))

Thanks for the report.  I introduced this and a handful of other related
incompatibilities with my port of Emacs's c75f505de.  I've reverted the
problematic spots.

-- 
Kyle



Re: [O] [PATCH] Add feature to org-drill to auto pronounce word

2019-01-31 Thread stardiviner
Nicolas Goaziou  writes:

> Hello,
>
> stardiviner  writes:
>
>> Oh, sorry, seems yes.
>
> OK. A couple of comments if you don't mind.
>> +(defcustom org-drill-pronounce-command ""
>> +  "Org-drill pronounce command."
>> +  :type 'string
>> +  :safe #'stringp
>> +  :group 'org-drill)
>
> This is clearly not a safe command. You can remove the :safe keyword, or
> put :safe nil

Ok, I removed it. (I misunderstand it's functionality..)

>
>> +(defun org-drill-pronounce-word ()
>> +  "Pronounce word after querying."
>> +  (when org-drill-auto-pronounce
>> +(shell-command-to-string
>> + (format "%s %s %s &"
>> + org-drill-pronounce-command org-drill-pronounce-command-args
>> + (shell-quote-argument
>> +  (substring-no-properties
>> +   (org-get-heading 'no-tags 'no-todo 'no-priority 
>> 'no-comment)))
>
> Is there any reason to use `shell-command-to-string'? You don't seem to
> need the returned string anyway. Why not calling `start-process', or at
> least `async-shell-command'?

Changed to `start-process' now.

>
> Regards,

Also I add some new functionality, which can pronounce at anytime when
press the key [p] not just at start time.

I almost forgot my patch. I pressed [C-g] to interrupt it.

>From 73acb5177526f7bf5d621f45ca979ee7119c Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Sun, 27 Jan 2019 10:43:37 +0800
Subject: [PATCH] org-drill.el: Add feature let org-drill auto pronounce

* contrib/lisp/org-drill.el (org-drill-entry,
  org-drill-entry-before-hook, org-drill-entry-after-hook): Add two
  hooks around ~org-drill-entry~.
  (org-drill-auto-pronounce): option to toggle this functionality.
  (org-drill-pronounce-command,org-drill-pronounce-command-args): option
  to specify the pronounce command and arguments.
  (org-drill-pronounce-word): The real function to pronounce word.
  (org-drill-hide-subheadings-if): fix issue in Org 9.2 version.
---
 contrib/lisp/org-drill.el | 79 ---
 1 file changed, 66 insertions(+), 13 deletions(-)

diff --git a/contrib/lisp/org-drill.el b/contrib/lisp/org-drill.el
index c7f509bff..70d0dee4b 100644
--- a/contrib/lisp/org-drill.el
+++ b/contrib/lisp/org-drill.el
@@ -269,6 +269,9 @@ item.")
 (defvar org-drill--tags-key ?t
   "If this character is pressed during a drill session, edit the tags for
 the current item.")
+(defvar org-drill--pronounce-key ?p
+  "If this character is pressed during a drill session, pronounce for
+the current item.")
 
 
 (defcustom org-drill-card-type-alist
@@ -532,6 +535,35 @@ exponential effect on inter-repetition spacing."
   :type 'float)
 
 
+(defcustom org-drill-entry-before-hook nil
+  "A hook to run functions when every org-drill entry."
+  :type 'hook
+  :group 'org-drill)
+
+(defcustom org-drill-entry-after-hook nil
+  "A hook to run functions when every org-drill entry."
+  :type 'hook
+  :group 'org-drill)
+
+(defcustom org-drill-auto-pronounce t
+  "Auto pronounce org-drill word if non-nil."
+  :type 'boolean
+  :safe #'booleanp
+  :group 'org-drill)
+
+(defcustom org-drill-pronounce-command (executable-find "espeak")
+  "Org-drill pronounce command."
+  :type 'string
+  :group 'org-drill)
+
+(defcustom org-drill-pronounce-command-args
+  (if (string= org-drill-pronounce-command "/usr/bin/espeak")
+  "-v en")
+  "Org-drill pronounce command arguments."
+  :type 'string
+  :group 'org-drill)
+
+
 (defvar drill-answer nil
   "Global variable that can be bound to a correct answer when an
 item is being presented. If this variable is non-nil, the default
@@ -1364,8 +1396,9 @@ of QUALITY."
   (let ((ch nil)
 (input nil)
 (next-review-dates (org-drill-hypothetical-next-review-dates))
-(key-prompt (format "(0-5, %c=help, %c=edit, %c=tags, %c=quit)"
+(key-prompt (format "(0-5, %c=help, %c=pronounce, %c=edit, %c=tags, %c=quit)"
 org-drill--help-key
+			org-drill--pronounce-key
 org-drill--edit-key
 org-drill--tags-key
 org-drill--quit-key)))
@@ -1391,7 +1424,9 @@ How well did you do? %s"
  (round (nth 4 next-review-dates))
  (round (nth 5 next-review-dates))
  key-prompt)
-   (format "How well did you do? %s" key-prompt
+   (format "How well did you do? %s" key-prompt))
+		 (if (eq ch org-drill--pronounce-key)
+			 (org-drill-pronounce-word
 (cond
  ((stringp input)
   (setq ch (elt input 0)))
@@ -1486,7 +1521,7 @@ the current topic."
 (funcall test))
  (hide-subtree))
(push (point) drill-sections)))
-   "" 'tree))
+   nil 'tree))
 (reverse drill-sections)))
 
 
@@ -1511,7 +1546,8 @@ the current topic."
  (first fmt-and-args)
  (rest 

[O] org-today broken

2019-01-31 Thread Samuel Wales
recent versions of maint and probably master have nil instead of
current time in org-today.

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  time-subtract(nil (0 0 0))
  org-today()
  (message "org today is %s" (org-today))

(time-subtract nil (list 0 (* 3600 org-extend-today-until) 0)).

i am running 24.

org-news says "From now on, Org expects at least Emacs 24.3, although
Emacs 24.4 or above is suggested.".  the newer notes don't mentioning
dropping emacs 24.  there is also no crash that says "your emacs is
too old, luddite!".

thanks.

-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] please read: bug when marking tasks done

2019-01-31 Thread Samuel Wales
sounds like a reasonable fix.



Re: [O] [RFC] Org Num library

2019-01-31 Thread Marco Wahl
Hi Nicolas and all,

@Nicolas: Thanks for org-num-mode.

> A few weeks ago, I posted on this ML a proof of concept about dynamic
> numbering of headlines in an Org buffer. Since then, I worked on it more
> seriously, improved it, and threw in some features. Here is an excerpt
> of its commentary section:
>
> This library provides dynamic numbering for Org headlines.  Use
>
> 
>
> to toggle it.
>
> You can select what is numbered according to level, tags, COMMENT
> keyword, or UNNUMBERED property.  You can also skip footnotes
> sections.  See `org-num-max-level', `org-num-skip-tags',
> `org-num-skip-commented', `org-num-skip-unnumbered', and
> `org-skip-footnotes' for details.
>
> You can also control how the numbering is displayed by setting
>`org-num-face' and `org-num-format-function'.
>
> I tested it a bit, even in relatively large documents like the Org
> manual, without problem. I also wrote a test suite for that library.
>
> Since it is very much Org-specific, and a basic feature you could expect
> from Org, I'd like to add it in core. So, if there is no strong
> objection to it, it can go in Org 9.3.
>
> I attach the library for further testing, suggestions, remarks… Let me
> know what you think.

For some days I turned on org-num-mode for every Org file automatically
with the setting

(add-hook 'org-mode-hook #'org-num-mode)

in my init file.  org-num-mode worked fine for me.

Just one idea came to my mind.  What about adding an option to restart
the numbering at 1 for the first heading in the case when narrowing is
in effect?


Ciao,  Marco




Re: [O] "org-link-set-parameters" get parent properties

2019-01-31 Thread John Kitchin
One way is through a filter. In the filter function you get an info
argument that contains the information you want. I hacked this together and
it does add a tooltip to the link, but it is not elegant or obvious, and it
does not do any checking for the type of link, whether an attr exists, etc.

The gist is that it looks like you can get the parent from the parse-tree
info, and get the attr_html info from that (which is a list of strings).
Then you have to modify the "data" in the filter function which is the
html. It is easy here to just replace the http://kitchingroup.cheme.cmu.edu



On Thu, Jan 31, 2019 at 5:36 AM Tarjei Bærland 
wrote:

> Hi!
>
> I have a custom function for exporting image links in org-mode (I have my
> html exported to the parent folder of my .org files, and I just want to
> keep one copy of the image files).
>
> How can I get the "attr_html" of the link for a custom
> org-set-link-parameters function? As far as I can tell, the :export wants a
> function taking (path desc backend), and I do not know how to extract the
> parent of the link from this.
>
> Thanks in advance!
>
> Regards,
> Tarjei
>


[O] [PATCH] Use regexp-opt in org-set-tag-faces

2019-01-31 Thread Anders Johansson
I just noticed a place where it would be appropriate to use 
regexp-opt instead of doing:

(concat ":\\(" (mapconcat 'car value "\\|") "\\):"

regexp-opt promises to be more efficient.


--
Anders Johansson
>From 2a70a709dcbdb1ff7d00b20de8410935d725ac70 Mon Sep 17 00:00:00 2001
From: Anders Johansson 
Date: Thu, 31 Jan 2019 15:04:30 +0100
Subject: [PATCH] org-faces.el: Use regexp-opt in org-set-tag-faces

* org-faces.el (org-set-tag-faces): Use appropriate call to regexp-opt

TINYCHANGE
---
 lisp/org-faces.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index 1ba5b5e..1b9118f 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -311,7 +311,7 @@ determines if it is a foreground or a background color."
   (if (not value)
   (setq org-tags-special-faces-re nil)
 (setq org-tags-special-faces-re
-	  (concat ":\\(" (mapconcat 'car value "\\|") "\\):"
+	  (concat ":" (regexp-opt (mapcar 'car value) t) ":"
 
 (defface org-checkbox '((t :inherit bold))
   "Face for checkboxes."
-- 
2.20.1



Re: [O] Dual document export slides and lecture notes title slide issue

2019-01-31 Thread Joseph Vidal-Rosset
Sorry, the quotation of the file content beamer-fr.org missed. Here is:

#+TITLE:
#+DATE:
#+OPTIONS: H:2 toc:nil author:t
#+LATEX_CLASS: beamer-ahp-ul
#+LANGUAGE:fr




**
:PROPERTIES:
 :BEAMER_opt: allowframebreaks,label=
:END:
bibliography:/home/joseph/MEGA/org/reforg.bib
bibliographystyle:apalike
Best wishes,

Jo.


Le jeu. 31 janv. 2019 à 12:08, Joseph Vidal-Rosset <
joseph.vidal.ros...@gmail.com> a écrit :

> Hello Johanna,
>
> I am using scimax from John Kitchin https://github.com/jkitchin/scimax
> and I recommend it to you warmly.
>
> In my /user/user.el, here is what is about beamer :
>
> (add-to-list 'org-latex-classes
>  '("beamer-ahp-ul"
>"\\documentclass\[10pt,svgnames,fragile]\{beamer\} 
>[NO-DEFAULT-PACKAGES][PACKAGES]
> [NO-EXTRA]\\theoremstyle{plain}% 
> default\\newtheorem{thm}{Theorem}[section]\\newtheorem{theo}{Théorème}[section]\\newtheorem{lem}[thm]{Lemma}\\newtheorem{prop}[thm]{Proposition}\\newtheorem*{cor}{Corollary}\\theoremstyle{definition}\\newtheorem{defi}{Definition}[section]\\newtheorem{rema}[thm]{Remarque}\\newtheorem{Conjecture}[theorem]{Conjecture}\\newtheorem{exa}{Example}[section]\\newtheorem{exem}{Exemple}[section]\\\hypersetup{colorlinks,citecolor=blue,linkcolor=.,menucolor=white,filecolor=pink,
>
> anchorcolor=yellow}\\AtBeginSection\[\]\{\\begin\{frame\}\\frametitle\{\}\\tableofcontents\[currentsection,hideothersubsections\]\\end\{frame\}\}\\subtitle\{\}\\institute\[Université
>  de Lorraine\]\{Département de philosophie  Archives Henri Poincaré - UMR 
> 7117 du CNRS  Université de Lorraine  91 bd Libération, 54000 Nancy 
>  France 
> \}\\titlegraphic\{\\includegraphics\[height=1cm\]\{ahp\}\\includegraphics\[height=1cm\]\{udl\}\\includegraphics\[height=1cm\]\{cnrs\}\}\\usetheme\{CambridgeUS\}\\usepackage\{beamer_udl_theme\}\\setbeamertemplate\{navigation
>  symbols\}{%%insertslidenavigationsymbol%
> %insertframenavigationsymbol%%insertsubsectionnavigationsymbol%   
>  %insertsectionnavigationsymbol%%insertdocnavigationsymbol%
> %insertbackfindforwardnavigationsymbol%}\\setbeamertemplate{theorems}[numbered]"
>("\\section\{%s\}" . "\\section*\{%s\}")
>("\\subsection\{%s\}" . "\\subsection*\{%s\}")
>("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
>
> (require 'autoinsert)
> (auto-insert-mode)  ;;; Adds hook to find-files-hook
> (setq auto-insert-directory "~/MEGA/org/my_org-templates/") ;;; Or use 
> custom, *NOTE* Trailing slash important
> (setq auto-insert-query nil) ;;; If you don't want to be prompted before 
> insertion
> (define-auto-insert "\.beamer-fr.org" "beamer-fr.org")
>
>
> in my folder ~/MEGA/org/my_org-templates/ there is the file
> beamer-fr.org:
>
> #+BEGIN_SRC lisp
>
> /home/joseph/MEGA/org/reforg.bib
>
> #+END_SRC
>
> I have also defined a theme that corresponds to my institution and
> that is located in
> /home/joseph/texmf/tex/latex/local/beamer_udl_theme.sty
>
> Now, as soon as I write a file that ends with the expression
> « beamer-fr.org », it is immediately with this template and the export
> beamer works smoothly.
>
> I have nothing with notes, but I hope it helps.
>
> Best wishes,
>
> Jo.
>


Re: [O] Dual document export slides and lecture notes title slide issue

2019-01-31 Thread Joseph Vidal-Rosset
Hello Johanna, 

I am using scimax from John Kitchin [[https://github.com/jkitchin/scimax
]]and I recommend it to you warmly. 

In my /user/user.el,  here is what is about beamer : 

#+BEGIN_SRC lisp

(add-to-list 'org-latex-classes
 '("beamer-ahp-ul"
   "\\documentclass\[10pt,svgnames,fragile]\{beamer\}
[NO-DEFAULT-PACKAGES]
[PACKAGES]
[NO-EXTRA]
\\theoremstyle{plain}% default
\\newtheorem{thm}{Theorem}[section]
\\newtheorem{theo}{Théorème}[section]
\\newtheorem{lem}[thm]{Lemma}
\\newtheorem{prop}[thm]{Proposition}
\\newtheorem*{cor}{Corollary}
\\theoremstyle{definition}
\\newtheorem{defi}{Definition}[section]
\\newtheorem{rema}[thm]{Remarque}
\\newtheorem{Conjecture}[theorem]{Conjecture}
\\newtheorem{exa}{Example}[section]
\\newtheorem{exem}{Exemple}[section]
\\\hypersetup{colorlinks,
citecolor=blue,
linkcolor=.,
menucolor=white,
filecolor=pink,   
anchorcolor=yellow
}
\\AtBeginSection\[\]\{\\begin\{frame\}\\frametitle\{\}\\tableofcontents\[currentsection,hideothersubsections\]\\end\{frame\}\}
\\subtitle\{\}
\\institute\[Université de Lorraine\]\{Département de philosophie  Archives 
Henri Poincaré - UMR 7117 du CNRS  Université de Lorraine  91 bd 
Libération, 54000 Nancy  France \}
\\titlegraphic\{\\includegraphics\[height=1cm\]\{ahp\}\\includegraphics\[height=1cm\]\{udl\}\\includegraphics\[height=1cm\]\{cnrs\}\}
\\usetheme\{CambridgeUS\}
\\usepackage\{beamer_udl_theme\}
\\setbeamertemplate\{navigation symbols\}{%
%insertslidenavigationsymbol%
%insertframenavigationsymbol%
%insertsubsectionnavigationsymbol%
%insertsectionnavigationsymbol%
%insertdocnavigationsymbol%
%insertbackfindforwardnavigationsymbol%
}
\\setbeamertemplate{theorems}[numbered]
"
   ("\\section\{%s\}" . "\\section*\{%s\}")
   ("\\subsection\{%s\}" . "\\subsection*\{%s\}")
   ("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))

(require 'autoinsert)
(auto-insert-mode)  ;;; Adds hook to find-files-hook
(setq auto-insert-directory "~/MEGA/org/my_org-templates/") ;;; Or use 
custom, *NOTE* Trailing slash important
(setq auto-insert-query nil) ;;; If you don't want to be prompted before 
insertion
(define-auto-insert "\.beamer-fr.org" "beamer-fr.org")

#+END_SRC

in   my  folder   ~/MEGA/org/my_org-templates/  there   is  the   file
beamer-fr.org:

#+BEGIN_SRC lisp
#+TITLE: 
#+DATE:
#+OPTIONS: H:2 toc:nil author:t
#+LATEX_CLASS: beamer-ahp-ul
#+LANGUAGE:fr



** 
:PROPERTIES:
 :BEAMER_opt: allowframebreaks,label=
:END:
bibliography:/home/joseph/MEGA/org/reforg.bib
bibliographystyle:apalike

#+END_SRC

I have  also defined a  theme that  corresponds to my  institution and
that  is   located  in
/home/joseph/texmf/tex/latex/local/beamer_udl_theme.sty 

Now,  as  soon  as I  write  a  file  that  ends with  the  expression
"beamer-fr.org", it is  immediately with this template  and the export
beamer works smoothly.

I have nothing with notes, but I hope it helps. 

Best wishes, 

Jo. 


[O] "org-link-set-parameters" get parent properties

2019-01-31 Thread Tarjei Bærland
Hi!

I have a custom function for exporting image links in org-mode (I have my
html exported to the parent folder of my .org files, and I just want to
keep one copy of the image files).

How can I get the "attr_html" of the link for a custom
org-set-link-parameters function? As far as I can tell, the :export wants a
function taking (path desc backend), and I do not know how to extract the
parent of the link from this.

Thanks in advance!

Regards,
Tarjei


Re: [O] please read: bug when marking tasks done

2019-01-31 Thread cesar mena
hello,

Nicolas Goaziou  writes:

> Hello,
>
> cesar mena  writes:
>
>> Nicolas Goaziou  writes:
>>> However, we still need to move forward. So, I suggest to revert the
>>> change about inactive timestamps. Inactive timestamps cannot be
>>> repeated. This is less disruptive than the current situation. 
>>
>> yes, agreed.
>
> Done in maint.

looks good here. 

thanks nicolas.

best,
-cesar



[O] Dual document export slides and lecture notes title slide issue

2019-01-31 Thread johanna . may

Dear org-mode community,

I'm a noob, started using org-mode about probably only 9 months ago. 
However, I'd say my latex knowledge is intermediate, so that helps.


I followed some of the instruction in 
https://orgmode.org/worg/exporters/beamer/beamer-dual-format.html in 
order to get dual beamer and scrrprt document export. In this link the 
author mentions the following:


    "In my environment, I used a hack that assumes Beamer has been 
added to |org-latex-classes| under the exact string "beamer." This is 
not ideal, because a user might have added a custom class under a 
different name. Nicolas Goaziou proposed an alternate approach using 
regular expressions, but I didn't implement it in my environment."


Since in my set-up (probably newer than this 2014 instruction) I cannot 
find ox-beamer.el as a separate file - and this hack seems fishy to me - 
I tried to find Nicolas Goaziou's regexp instructions of how to include 
the titlepage in the beamer presentation in spite of the 
ignorenonframetext option. However, I could not find anything that was 
related by him in my searches.


So, my question is: Could I add this titlepage by making some sort of 
copy of the beamer class (something like mybeamer, similar to myscrartcl 
in https://www.suenkler.info/notes/emacs-config/) in my dotemacs, just 
adding a few lines there? And what would I add there? Or the other 
option would be to switch on the ignorenonframetext option later in the 
document, i.e. after the title slide - how could I get that done? 
Something like :beamer_opt: ignorenonframetext in every section's 
property drawer? I don't really care about elegance, I'm interested in 
stable function.


It would be great if you could just point me at well documented examples 
of other people who are making dual documents for both teaching (slides) 
and for students to recap with notes (lecture notes) based on the same 
diagrams. I also am considering using html instead of pdf for the 
slides, but I haven't so far because I haven't come across any tablet 
annotating possibility for browser pages: In some slides I want to leave 
blank spaces in order to demonstrate the calculations live.


So, thank you very much for your ideas in advance. I subscribed to the 
digest, not the single emails, so I probably won't read your answers 
before this evening (and also not reply to questions about clarification 
of my issue).


I have to say, that I really like what org-mode, and org-babel can do. 
And I want to thank all of you who are contributing on this. At some 
point of time I also want to start a blog and share my working examples 
so that others can profit. But I first need to re-make my lecture notes 
in a more sustainable and reproducible way.


Cheers,

J. M.



[O] Hiding empty lines when collapsing lists

2019-01-31 Thread Willi Schiegel

Hello,

is there some configuration setting where empty lines in lists get folded?

Here is what I would like to have.

List item 1 with some text and an empty line at the end to separate the 
text from List item 2


- List item 1

  Text on first line
  Text on second line

- List item 2
- List item 3

When collapsed it should look like

- List item 1
- List item 2
- List item 3

At the moment I would have

- List item 1

- List item 2
- List item 3

This works perfect with headings but not with lists. I found two or 
three discussions about this but nothing worked for me.


Thank you,
Willi