Re: [O] Bug: Group tag filters repeated per org-file [9.1.13 (release_9.1.13-751-g9dcc52 @ c:/D-Drive/bin/org-mode/lisp/)]

2019-01-02 Thread Josiah Schwab
Hello,

I recently upgraded to org 9.2 (release_9.2-4-g284799) and just wanted
to note that I am still seeing this cosmetic issue that Bernt reported.

Josiah



[O] [Patch] [Feature request] Add option to natively fontify latex snippets and environment

2019-01-02 Thread Carlos Pita
This patch adds a fourth 'native value to
org-highlight-latex-and-related. It matches the same structures than
'latex but it calls org-src-font-lock-fontify-block instead.

It's a simple change that brings full latex fontification by building
on top of org-src. I'm using it (implemented as an advice) since a few
weeks ago and haven't noticed any problem.

Hope you like the idea.

Best regards
--
Carlos
From 3dbbf0f9c04003a5a0f0027c581a2ed6aa9fb892 Mon Sep 17 00:00:00 2001
From: memeplex 
Date: Wed, 2 Jan 2019 19:43:21 -0300
Subject: [PATCH] Add option to natively fontify latex snippets and
 environments

---
 lisp/org.el | 24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 2e63a65..3c9a5dc 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4138,6 +4138,7 @@ org-level-* faces."
   "Non-nil means highlight LaTeX related syntax in the buffer.
 When non nil, the value should be a list containing any of the
 following symbols:
+  `native'   Highlight LaTeX snippets and environments natively.
   `latex'Highlight LaTeX snippets and environments.
   `script'   Highlight subscript and superscript.
   `entities' Highlight entities."
@@ -4147,6 +4148,7 @@ following symbols:
   :type '(choice
 	  (const :tag "No highlighting" nil)
 	  (set :greedy t :tag "Highlight"
+	   (const :tag "LaTeX snippets and environments (native)" native)
 	   (const :tag "LaTeX snippets and environments" latex)
 	   (const :tag "Subscript and superscript" script)
 	   (const :tag "Entities" entities
@@ -6093,7 +6095,8 @@ Result depends on variable `org-highlight-latex-and-related'."
 		(list org-match-substring-with-braces-regexp))
 	   (org-use-sub-superscripts (list org-match-substring-regexp
 	(re-latex
-	 (when (memq 'latex org-highlight-latex-and-related)
+	 (when (or (memq 'latex org-highlight-latex-and-related)
+		   (memq 'native org-highlight-latex-and-related))
 	   (let ((matchers (plist-get org-format-latex-options :matchers)))
 	 (delq nil
 		   (mapcar (lambda (x)
@@ -6117,17 +6120,20 @@ highlighting was done, nil otherwise."
   (while (re-search-forward org-latex-and-related-regexp
 nil t) ;; on purpose, we ignore LIMIT
 	(unless (cl-some (lambda (f) (memq f '(org-code org-verbatim underline
-		   org-special-keyword)))
+			org-special-keyword)))
 			 (save-excursion
 			   (goto-char (1+ (match-beginning 0)))
 			   (face-at-point nil t)))
-	  (let ((offset (if (memq (char-after (1+ (match-beginning 0)))
-  '(?_ ?^))
-			1
-			  0)))
-	(font-lock-prepend-text-property
-	 (+ offset (match-beginning 0)) (match-end 0)
-	 'face 'org-latex-and-related)
+	  (let* ((offset (if (memq (char-after (1+ (match-beginning 0)))
+   '(?_ ?^))
+			 1
+			   0))
+		 (start (+ offset (match-beginning 0)))
+		 (end (match-end 0)))
+	(if (memq 'native org-highlight-latex-and-related)
+		(org-src-font-lock-fontify-block "latex" start end)
+	  (font-lock-prepend-text-property start end
+	   'face 'org-latex-and-related))
 	(add-text-properties (+ offset (match-beginning 0)) (match-end 0)
  '(font-lock-multiline t)))
 	  (throw 'found t)))
-- 
2.19.2



Re: [O] Bug: Latex preview fg color w/tikz (known problem, fix suggested) [9.1.9 (release_9.1.9-65-g5e4542 @ /home/carlos/local/stow/emacs-26/share/emacs/26.1.90/lisp/org/)]

2019-01-02 Thread Carlos Pita
Here is a patch. It removes quite a few LOC.

> I think option 3 is better. Is there any use case left for :use-xcolor?

Every other previewer has :use-xcolor t. I assume it's safe to simply
ignore :use-xcolor if it's there except that some user has configured
a converter that for some reason requires the color command line args,
in which case he will get an error (because of the color placeholders
left untouched in the command line template).

> Thank you for taking care of this.

Well, thank you for taking care of everything else ;)

Best regards
--
Carlos
From 9beda785e60c791bc6524b996b60e9db00f858b7 Mon Sep 17 00:00:00 2001
From: memeplex 
Date: Wed, 2 Jan 2019 19:05:26 -0300
Subject: [PATCH] Use xcolor for all latex preview converters

---
 lisp/org.el | 63 -
 1 file changed, 19 insertions(+), 44 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 0e541cd..2e63a65 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3813,12 +3813,11 @@ All available processes and theirs documents can be found in
  :image-output-type "png"
  :image-size-adjust (1.0 . 1.0)
  :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
- :image-converter ("dvipng -fg %F -bg %B -D %D -T tight -o %O %f"))
+ :image-converter ("dvipng -D %D -T tight -o %O %f"))
 (dvisvgm
  :programs ("latex" "dvisvgm")
  :description "dvi > svg"
  :message "you need to install the programs: latex and dvisvgm."
- :use-xcolor t
  :image-input-type "dvi"
  :image-output-type "svg"
  :image-size-adjust (1.7 . 1.5)
@@ -3828,7 +3827,6 @@ All available processes and theirs documents can be found in
  :programs ("latex" "convert")
  :description "pdf > png"
  :message "you need to install the programs: latex and imagemagick."
- :use-xcolor t
  :image-input-type "pdf"
  :image-output-type "png"
  :image-size-adjust (1.0 . 1.0)
@@ -3848,11 +3846,6 @@ PROPERTIES accepts the following attributes:
   :messagestring, message it when required programs cannot be found.
   :image-input-type   string, input file type of image converter (e.g., \"dvi\").
   :image-output-type  string, output file type of image converter (e.g., \"png\").
-  :use-xcolor boolean, when non-nil, LaTeX \"xcolor\" macro is used to
-  deal with background and foreground color of image.
-  Otherwise, dvipng style background and foreground color
-  format are generated.  You may then refer to them in
-  command options with \"%F\" and \"%B\".
   :image-size-adjust  cons of numbers, the car element is used to adjust LaTeX
   image size showed in buffer and the cdr element is for
   HTML file.  This option is only useful for process
@@ -3884,8 +3877,6 @@ Place-holders used by `:image-converter' and `:latex-compiler':
 
 Place-holders only used by `:image-converter':
 
-  %Fforeground of image
-  %Bbackground of image
   %Ddpi, which is used to adjust image size by some processing commands.
   %Sthe image size scale ratio, which is used to adjust image size by some
 processing commands."
@@ -18339,7 +18330,6 @@ a HTML file."
 	  (cdr (assq processing-type org-preview-latex-process-alist)))
 	 (programs (plist-get processing-info :programs))
 	 (error-message (or (plist-get processing-info :message) ""))
-	 (use-xcolor (plist-get processing-info :use-xcolor))
 	 (image-input-type (plist-get processing-info :image-input-type))
 	 (image-output-type (plist-get processing-info :image-output-type))
 	 (post-clean (or (plist-get processing-info :post-clean)
@@ -18370,36 +18360,23 @@ a HTML file."
 	 (resize-mini-windows nil)) ;Fix Emacs flicker when creating image.
 (dolist (program programs)
   (org-check-external-command program error-message))
-(if use-xcolor
-	(progn (if (eq fg 'default)
-		   (setq fg (org-latex-color :foreground))
-		 (setq fg (org-latex-color-format fg)))
-	   (if (eq bg 'default)
-		   (setq bg (org-latex-color :background))
-		 (setq bg (org-latex-color-format
-			   (if (string= bg "Transparent") "white" bg
-	   (with-temp-file texfile
-		 (insert latex-header)
-		 (insert "\n\\begin{document}\n"
-			 "\\definecolor{fg}{rgb}{" fg "}\n"
-			 "\\definecolor{bg}{rgb}{" bg "}\n"
-			 "\n\\pagecolor{bg}\n"
-			 "\n{\\color{fg}\n"
-			 string
-			 "\n}\n"
-			 "\n\\end{document}\n")))
-  (if (eq fg 'default)
-	  (setq fg (org-dvipng-color :foreground))
-	(unless (string= fg "Transparent")
-	  (setq fg (org-dvipng-color-format fg
-  (if (eq bg 'default)
-	  (setq bg (org-dvipng-color :background))
-	(unless (string= bg "Transparent")
-	  (setq bg (org-dvipng-color-format bg
-  (with-temp-file texfile
-	(insert latex-header)
-	(insert "\n\\begin{document}\n" string "\n\\end{document}\n")))
-
+(if (eq fg 'default)
+	(setq fg 

Re: [O] Bug: Secondary smart quotes are exported as apostrophes. [9.1.14 (9.1.14-1-g4931fc-elpa @ /home/coleman/.emacs.d/elpa/org-9.1.14/)]

2019-01-02 Thread Coleman Gariety
Nicolas,

Thank you for your response. I now see that I had misunderstood the
documentation.

Also, it occurs to me that one can make use of single quotation marks as
primary quotes when mentioning a word without using it. Moreover, when
italics and double quotation marks are also present, the use of single
quotations as primary is necessary. For example:

'GNU' is an acronym for the phrase "GNU's Not Unix!" but GNU is an
> operating system and *not *an acronym.


Is it feasible to add an option to treat single quotation marks as primary
pairs on export?

Thanks,
Coleman Gariety

On Tue, Jan 1, 2019 at 7:46 AM Nicolas Goaziou 
wrote:

> Hello,
>
> Coleman Gariety  writes:
>
> > According to documentation (org-export-with-smart-quotes) should treat
> > "pairs of single quotes as secondary quotes." This text:
>
> Only within primary quotes! If there are no primary quotes around, you
> don't need a second level of quotation, and single quotes are not
> special.
>
> 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/)]

2019-01-02 Thread Arne Babenhauserheide

Nicolas Goaziou  writes:
>> 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
>
> `org-footnote-action' does nothing. 

In my setup, it deletes footnote [fn:2].

Damn, I missed one important part in the ECM: Set

  org-footnote-section

to nil. Does it still leave them untouched?

> However this will probably not export as you would expect. Indeed,
> footnotes in included file are independent, so you cannot reference
> footnotes between included files.

It does not reference between included files, but references from
included files to the main file actually work.

What I would expect is that the footnotes get moved to the end of the
section with the last #+include: which uses the footnote.

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


signature.asc
Description: PGP signature


Re: [O] how do I search state change dates?

2019-01-02 Thread Michael Welle
Hello,

"Christopher W. Ryan"  writes:

> I try to keep track of books I want to read, and when I eventually read
> them.  I use TODO keyword for books I intend to read, and I change the
> state to READING and then DONE, as appropriate. Each state change gets a
> date/time stamp.
at [0] you will find a bit of code (org-task-dump-logs.el) that
retrieves all the log data for a given task. Maybe that is helpful if
you extend it with a loop that iterates over all tasks of a file.

Regards
hmw

[0] https://www.c0t0d0s0.de/otdl/otdl.html



Re: [O] Org-drill edit feature request

2019-01-02 Thread John Kitchin
My experience with this is that you have to get the word by some means
(e.g. it is a property, or it is selected some how) and then send it to
a platform specific speech program. It is easy on a mac as there is a
command line tool called "say". So, something like this

(shell-command "say \"Hello\")

will say the word Hello out loud. I guess there are windows and linux
equivalents.



stardiviner  writes:

> Leu Zhe  writes:
>
> I want org-drill can add a feature to auto pronounce the word. That's
> standard functionality in word-drill Apps.
>
>> Hi,
>>
>> Making drill editing seems be very painful by the current way
>> org-drill offers.
>> I make a lot of notes on most of the drilled entries, as for now,
>> 1). press e (or other key to reveal the collapsed headlines) , e
>> twice to go back to the original buffer.
>> 2) add notes. (Even more keys pressing: if i collapsed the headlines
>> before calling org-drill, i need to press tab to show all the
>> contents at current headline.)
>> 3) call org-drill-resume to go back.
>>
>> I would like to consider more intuitive ways to edit the drill
>> entries. How do you think the workflow below?
>> 1) press e to switch to edit mode like "helm-swoop", which keeps
>> exactly same narrow, child headline showing as before.
>> 2) add the notes.
>> 3) Ctrl-c Ctrl-s to resume.
>>
>> Do you think my workflow is more reasonable?
>> And i would like to hear more advices about the idea above. Thanks.
>>
>> LLCC


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] headline and a table

2019-01-02 Thread Jude DaShiell
Great, thanks this worked perfectly!

On Wed, 2 Jan 2019, Eric S Fraga wrote:

> Date: Wed, 2 Jan 2019 09:51:15
> From: Eric S Fraga 
> To: Jude DaShiell 
> Cc: emacs-orgmode@gnu.org
> Subject: Re: [O] headline and a table
>
> On Saturday, 29 Dec 2018 at 09:41, Jude DaShiell wrote:
> > I have an orgmode table and a note in a headline and those two need to
> > stay together in the same file.  The table as is usual has headings.  What
> > I would like to know is if orgmode can do a boxed heading like this:
> > |--|---|
> > | date | notes |
> > |--|---|
>
> Yes, orgmode will definitely allow you to have:
>
> |--+---|
> | date | notes |
> |--+---|
>
> which you can achieve by typing
>
> "| date | notes C-u C-c - C-c -"
>
> (without the quotes, and there are other ways of achieving the same)
>
>

-- 




Re: [O] Bug: Latex preview fg color w/tikz (known problem, fix suggested) [9.1.9 (release_9.1.9-65-g5e4542 @ /home/carlos/local/stow/emacs-26/share/emacs/26.1.90/lisp/org/)]

2019-01-02 Thread Nicolas Goaziou
Hello,

Carlos Pita  writes:

> Considering the above, do you still want me to write a patch for this?
>
> Some options:
>
> 1. Add the above as a remark in the user guide or the wiki.
>
> 2. Add a variant of the dvipng backend, say dvipng-xcolor, as explained.
>
> 3. Remove the dvipng cli color code and (maybe just deprecate or ignore)
> the use-xcolor option altogether and make xcolor the default for every
> backend.
>
> 4. Do nothing.
>
> What do you think?

I think option 3 is better. Is there any use case left for :use-xcolor?

Thank you for taking care of this.

Regards,

-- 
Nicolas Goaziou



Re: [O] how do I search state change dates?

2019-01-02 Thread Eric S Fraga
On Tuesday,  1 Jan 2019 at 14:16, Christopher W. Ryan wrote:
> I try to keep track of books I want to read, and when I eventually read
> them.  I use TODO keyword for books I intend to read, and I change the
> state to READING and then DONE, as appropriate. Each state change gets a
> date/time stamp.

[...]

> How can I retrieve all the entries for the books I've read in 2018? In
> other words, all those that changed state to DONE in 2018?

Well, a start would be to use the agenda view on that file and ask for a
full log view (v L in the default dispatcher).

Alternatively, remember that org files are simply text so you could use
"M-x occur RET" on your file with a suitable pattern.  This seems to
work for me:

- State "DONE".*\[2018

Of course, if your book entries are intermixed with other entries in the
same file, you may need to be a bit more creating (e.g. include
"READING" in your pattern).

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



Re: [O] [Feature Request] Add an dispatcher command (keybinding) for inserting dynamic blocks

2019-01-02 Thread Nicolas Goaziou
Hello,

stardiviner  writes:

> As always, add patch as attachment.

Thank you! I applied your patch, with minor tweaks.

Regards,

-- 
Nicolas Goaziou



Re: [O] Exporting description list without description

2019-01-02 Thread Eric S Fraga
On Sunday, 30 Dec 2018 at 00:32, Yasushi SHOJI wrote:
> Hi,
>
> I'm not sure this is a bug or something else.  But the following two
> list behave differently when exported.  The fist one inserts a newline
> between one and two.

What export target?  I don't see any difference when exporting to LaTeX.

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



Re: [O] headline and a table

2019-01-02 Thread Eric S Fraga
On Saturday, 29 Dec 2018 at 09:41, Jude DaShiell wrote:
> I have an orgmode table and a note in a headline and those two need to
> stay together in the same file.  The table as is usual has headings.  What
> I would like to know is if orgmode can do a boxed heading like this:
> |--|---|
> | date | notes |
> |--|---|

Yes, orgmode will definitely allow you to have:

|--+---|
| date | notes |
|--+---|

which you can achieve by typing

"| date | notes C-u C-c - C-c -"

(without the quotes, and there are other ways of achieving the same)

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



Re: [O] How about Org Mode invalid link handling strategy for exporting?

2019-01-02 Thread John Kitchin
Can you (setq org-export-with-broken-links t) to address some of these?

It looks like (setq org-export-with-broken-links 'mark)

will change them to [BROKEN LINK: path].

According to the docs:

This option can also be set with the OPTIONS keyword, e.g.,
"broken-links:mark".

stardiviner  writes:

> When I use package "ox-epub" to export current Org buffer to EPUB file,
> it is based on "ox-html", I got some issues. One issue is about the
> external file resource link which can't add into EPUB, or internal link
> but invalid (I use narrow to subtree to debug Org buffer when using
> ox-epub, so some internal links to other headlines will be invalid).
>
> I hope Org Mode can enhance this invalid link handling strategy to not
> interrupt user exporting process. Just display warning to user. Or add
> an option to controlled by user?
>
> Because I'm exporting a big Clojure language reference to EPUB, so
> really hard to handling those invalid links.
>
> About the handling strategy, I have some ideas:
>
> - raise warning about invalid links no matter internal links or external
>   links.
>
> - don't interrupt process when meet invalid links.
>
> - keep link description part as link part. Replace the original link
>   part with an empty link.
>
> Do you any ideas?


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] How about Org Mode invalid link handling strategy for exporting?

2019-01-02 Thread Nicolas Goaziou
Hello,

stardiviner  writes:

> When I use package "ox-epub" to export current Org buffer to EPUB file,
> it is based on "ox-html", I got some issues. One issue is about the
> external file resource link which can't add into EPUB, or internal link
> but invalid (I use narrow to subtree to debug Org buffer when using
> ox-epub, so some internal links to other headlines will be invalid).
>
> I hope Org Mode can enhance this invalid link handling strategy to not
> interrupt user exporting process. Just display warning to user. Or add
> an option to controlled by user?

See `org-export-with-broken-links'.

Regards,

-- 
Nicolas Goaziou