[O] Link "bracket-types"

2018-05-09 Thread Michael Brand
Hi all

For the four different Org link "bracket-types" shown below I would
like to have four different faces to be able to distinguish them at
first sight. What is the recommended way to do this?

The four Org link bracket-types by example:

Buffer raw content (or visible-mode):
: 1) 
[[https://en.wikipedia.org/wiki/Filter#References][https://en.wikipedia.org/wiki/Filter]]
: 2) https://en.wikipedia.org/wiki/Filter
: 3) [[https://en.wikipedia.org/wiki/Filter]]
: 4) [[https://en.wikipedia.org/wiki/Filter_(higher-order_function)]]

(To try them out copy the above into an Org buffer and remove the colons.)

Currently rendered all with the same face as:
: 1) https://en.wikipedia.org/wiki/Filter
: 2) https://en.wikipedia.org/wiki/Filter
: 3) https://en.wikipedia.org/wiki/Filter
: 4) https://en.wikipedia.org/wiki/Filter_(higher-order_function)

As you know and can see above 1) to 3) can not be distinguished when
rendered with the default of org-descriptive-links t.

The brackets for 3) are optional as 2) opens the same URL.

The brackets for 4) are mandatory because without them
"_(higher-order_function)" is not fontified and not recognized by
org-open-at-point as part of the Org link any more. I think 4) can be
distinguished from 3) by comparing the bracket content with the part
fontified and/or recognized as Org link when the bracket content
without the brackets is matched/parsed again stand-alone.

org-descriptive-links permanently nil does not seem to be an
alternative as it disturbs text flow and org-fill-paragraph.
org-toggle-link-display does not seem to be an alternative as it would
have to be toggled forth and back on every new window scroll view.

Michael



Re: [O] [org-contacts] How to show avatar image on org headings?

2018-05-09 Thread stardiviner
Thanks, Kitchin!

I tried code in Emacs minimal config. But the image is
not shown. I tried to toggle Edebug on function
`org-contacts-icon-property-image-overlay`. But it is not triggered.
Don't understand why. Because `(font-lock-add-keywords ..)` not correct?
I tried to change `nil` into `'org-mode`. But still does not work.

Possible reasons:

- In your code, seems don't need KEYWORDS for`font-lock-add-keywords`.
- font-lock can't enabled on org-property because it is already
  font-locked? (don't know this neither)

I'm considering might can change a thinking direction (This is an
optional solution). Because Org-mode support inline image display for
file link:

,
| [[file:image.png]]
`

So I tried to use this in Org property like this:

,
| * Name
| :PROPERTY:
| :ICON: [[file:image.png]]
| :END:
`

But Org inline image can't display on property value. (Because inline
image require a single line, invalid in org property value position?)

WDYT?

--
[ stardiviner ] don't need to convince with trends.
   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: [O] Localized org-mode

2018-05-09 Thread Jean-Christophe Helary


> On May 10, 2018, at 0:41, Diego Zamboni  wrote:
> 
> 
> On Wed, May 9, 2018 at 3:48 PM, Jean-Christophe Helary  > wrote:
> You misquoted me. I was talking about design constraints when C and Lisp were 
> created, which kept language creators from "inventing" proper language 
> localization. I was specifically replying to Diego Zamboni regarding that.
> 
> I don't think it was only those constraints. Imagine if C and LISP had been 
> designed with "keywords in your own language" in mind.

That was not physically possible at the time. It is now. And as I wrote, Scheme 
can do that easily. But that's not the topic of the current thread. Sorry for 
that.

Jean-Christophe Helary
---
http://mac4translators.blogspot.com @brandelune




Re: [O] Localized org-mode

2018-05-09 Thread Kaushal Modi
Hello,

On Wed, May 9, 2018 at 8:44 AM Jean-Christophe Helary 
wrote:

>
> Genuine question: how many 3rd party tools do support the org format ?
>

Few that I know:

- Orgzly app on Android
- Beorg app on iOS
- Org parser used on Github: https://github.com/wallyqs/org-ruby

- Org parser in Node.js: https://github.com/daitangio/org-mode-parser
- Another Org parser in JS: https://github.com/mooz/org-js
- .. in Clojure: https://github.com/gmorpheme/organum
- .. in Go: https://github.com/chaseadamsio/goorgeous
- . in Java: https://github.com/orgzly/org-java
- Python-based Org parser to generate blog:
https://github.com/novoid/lazyblorg
- many more:
https://github.com/search?utf8=%E2%9C%93&q=org+mode+parser&type=
-- 

Kaushal Modi


Re: [O] Org beamer async export fails

2018-05-09 Thread Nicolas Goaziou
Jeremie Juste  writes:

> I manage to set up the  org-export-async-init-file as follows
>
> (require 'org) ;; loads from site lisp
> (require 'ox)
> (require 'cl)  ;; stupid bug in one of the org-packages?

I'm not sure what you mean here, but this shouldn't be necessary in Org.

> (setq org-export-async-debug t)
> (require 'ox-beamer)
>
> but when I try org-beamer-export-to-pdf with async.
>
> I get the following results
>
> 1beamer   0:08   /tmp/test.tex
>
> So it export only to latex and don't compile tex file.

It may be a LaTeX error. Can you compile "test.tex" manually ?



Re: [O] Org beamer async export fails

2018-05-09 Thread Jeremie Juste

Hello

Many thanks for the info.

I manage to set up the  org-export-async-init-file as follows

(require 'org) ;; loads from site lisp
(require 'ox)
(require 'cl)  ;; stupid bug in one of the org-packages? 
(setq org-export-async-debug t)
(require 'ox-beamer)

but when I try org-beamer-export-to-pdf with async.

I get the following results

1beamer   0:08   /tmp/test.tex

So it export only to latex and don't compile tex file.

Best regards,
Jeremie


> Hello,
>
> Jeremie Juste  writes:
>
>> I noticed that async export using org-beamer-export fails. For instance
>>
>>  on test.org (see below)
>>
>> yield
>>
>> <>
>
> `org-export-async-init-file' may not (require 'ox-beamer).
>






Re: [O] Bug: Empty Priorities Are Displayed As "B" In An Agenda Using The Column View [9.1.13 (9.1.13-elpa @ /home/tom/.emacs.d/elpa/org-9.1.13/)]

2018-05-09 Thread Nicolas Goaziou
Tom Purl  writes:

> Thank you for your quick response Nicholas. I read that help page but
> I still think this may be a bug. In the 8.2 version of Org the
> Priority column in the column view showed an empty priority if the
> TODO didn't have a priority. Those TODO's where then *sorted* as if
> they had the default priority (which in this case would be B). But
> I don't see why the agenda in column view would show a bogus priority
> value.

This is not a bogus priority. For Org, there is no difference between
"no priority" and "default priority". The priority on these headlines is
really "B".

OTOH, I understand that it looks odd to see a priority even though you
added none to the headlines: it makes sense to not display it. OTOH, by
all means, there _is_ an implied property and you're requesting to see
priorities through `org-agenda-overriding-columns-format'. So it makes
sense to display it. Ah well.

I'm not arguing the current state is better than the previous one, but
it is not clear to me that this qualifies as a bug. Anyway, I do not
have any strong opinion on the subject.

I would be curious to hear more feedback about this.



Re: [O] [RFC] Dog food, anyone?

2018-05-09 Thread Nicolas Goaziou
Hello,

Gregor Zattler  writes:

> I found that org-float instead of diary-float is documented in
> org-manual.org although ORG-NEWS says to use diary-float instead:

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Dog food, anyone?

2018-05-09 Thread Gregor Zattler
Hi Nicolas, Org mode developers,
* Nicolas Goaziou  [2018-05-09; 02:30]:
> Bastien  writes:
>
>> it would be nice to make the switch to org-manual.org for Org 9.2,
>> and to delete org.texi entirely from the master branch.
>
> Done.
>
>> I guess we need to add some Makefile rules so that "make pdf" first
>> exports .org => .texi then exports .texi to .pdf... is that so?
>
> Done (or so I think).

Hurray!

I found that org-float instead of diary-float is documented in
org-manual.org although ORG-NEWS says to use diary-float instead:

~/src/org-mode$ rgrep  org-float
etc/ORG-NEWS:** =org-float= is now obsolete, use =diary-float= instead
Binary file lisp/org-compat.elc matches
lisp/org-compat.el:(define-obsolete-function-alias 'org-float-time 'float-time 
"Org 9.0")
testing/lisp/test-org.el:   (org-test-with-temp-text "<%%(org-float t 4 2)>"
testing/lisp/test-org.el:   (equal "<%%(org-float t 4 2)>"
testing/lisp/test-org.el: (org-test-with-temp-text "<%%(org-float t 4 
2)>"
doc/org.texi:  <%%(org-float t 4 2)>
doc/org.texi:<%%(org-float t 42)>
doc/org-manual.org:   <%%(org-float t 4 2)>
doc/org-manual.org:: <%%(org-float t 42)>
doc/org:<%%(org-float t 4 2)>
doc/org: <%%(org-float t 42)>
doc/org.html:  <%%(org-float t 4 2)>
doc/org.html:<%%(org-float t 42)>


~/src/org-mode$ rgrep  diary-float
etc/ORG-NEWS:** =org-float= is now obsolete, use =diary-float= instead
testing/lisp/test-org-element.el:  (should (equal (org-test-parse-and-interpret 
"<%%diary-float t 4 2>")
testing/lisp/test-org-element.el:"<%%diary-float t 4 2>\n"))
doc/orgguide.texi:  <%%(diary-float t 4 2)>

org-guide.texi is already up to date with respect to
diary-float.

I made a very simple patch for org-manual.org but none for
test-org.el or test-org-element.el since I do not understand
them.  When reading about documentation standards I found that
Org manuals filename and directory wasn't up to date, so I fixed
this.  I assume that the parts of doc/Documentation_Standards.org
which deal with texinfo formatting are also out of date but do
not know how to rewrite them.

>From b45739a23b093e1ee54ae09be8172720fa611628 Mon Sep 17 00:00:00 2001
From: Gregor Zattler 
Date: Wed, 9 May 2018 19:51:51 +0200
Subject: [PATCH] ; Tiny doc fixes

* doc/org-manual.org (Dates and Times) (Timestamps, Deadlines and
  Scheduling): Document "diary-float" instead of obsolete "org-float".
* doc/Documentation_Standards.org (org-manual.org specific
  conventions): Fix file name and directory of Org manual.

Copyright-paperwork-exempt: yes
TINYCHANGE
---
 doc/Documentation_Standards.org | 4 ++--
 doc/org-manual.org  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/Documentation_Standards.org b/doc/Documentation_Standards.org
index 9d8f19fe6..c4dd862db 100644
--- a/doc/Documentation_Standards.org
+++ b/doc/Documentation_Standards.org
@@ -94,10 +94,10 @@ I have made them up of course).
 - Entries in the concept index are normally all lower case unless some
   other rule dictates otherwise.
 
-* orgmanual.org specific conventions
+* org-manual.org specific conventions
 
 Org git repository comes with an .org version of the manual in the
-=contrib/= directory.  Here are indications that are specific to this
+=doc/= directory.  Here are indications that are specific to this
 version of the manual.
 
 - Five of the standard Texinfo indexes are used in the Org manual:
diff --git a/doc/org-manual.org b/doc/org-manual.org
index eb6c96fb2..d9e95b1ee 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -5779,7 +5779,7 @@ the agenda (see [[*Weekly/daily agenda]]).  We distinguish:
 
  #+begin_example
  ,* 22:00-23:00 The nerd meeting on every 2nd Thursday of the month
-   <%%(org-float t 4 2)>
+   <%%(diary-float t 4 2)>
  #+end_example
 
 - Time/Date range ::
@@ -6158,7 +6158,7 @@ entries.  Org mode issues early and late warnings based on the
 assumption that the timestamp represents the /nearest instance/ of the
 repeater.  However, the use of diary S-exp entries like
 
-: <%%(org-float t 42)>
+: <%%(diary-float t 42)>
 
 #+texinfo: @noindent
 in scheduling and deadline timestamps is limited.  Org mode does not
-- 
2.11.0


I'm not sure if "org-float" is the right way to quote this kind
of symbol in a commit message.  Please fix if not.

HTH a tiny bit, Gregor



Re: [O] [RFC] Dog food, anyone?

2018-05-09 Thread Jon Snader
This is excellent. I love that, as Nicolas says, we're eating our 
own

dog food. Perhaps this will put to rest the doubts expressed on
Emacs-Devel a year or two ago in the thread about replacing 
TeXinfo as

to whether Org mode was up to the task.



Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Joseph Vidal-Rosset
It works also for me. Many thanks!

Jo.

2018-05-09 18:01 GMT+02:00 Thomas Shannon :

> Works like a charm, auctex and all.  Very nice!  Thanks.
>
> Tom S.
>
> > On May 9, 2018, at 10:27 AM, Russell Adams 
> wrote:
> >
> > On Wed, May 09, 2018 at 09:22:35AM -0500, Thomas Shannon wrote:
> >> HI, Joseph.
> >>
> >> Its not the most elegant solution but if I’m doing extensive latex
> editing I usually just enter latex mode (esc-x latex-mode).  This allows me
> to use auctex as well.
> >>
> >> Of course, you have to switch back to org-mode after editing.  So its
> not a great solution if you are switching back and forth a lot.
> >
> > If you use C-c ' to enter the block, it opens a sub-buffer in latex
> mode. You
> > can actually switch back and forth to edit org and latex in the same
> file across
> > buffers. It might be an elegant solution.
> >
> >
> >
> > --
> > Russell Adamsrlad...@adamsinfoserv.com
> >
> > PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/
> >
> > Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
> >
>
>
>


Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Thomas Shannon
Works like a charm, auctex and all.  Very nice!  Thanks.

Tom S.

> On May 9, 2018, at 10:27 AM, Russell Adams  wrote:
> 
> On Wed, May 09, 2018 at 09:22:35AM -0500, Thomas Shannon wrote:
>> HI, Joseph.
>> 
>> Its not the most elegant solution but if I’m doing extensive latex editing I 
>> usually just enter latex mode (esc-x latex-mode).  This allows me to use 
>> auctex as well.
>> 
>> Of course, you have to switch back to org-mode after editing.  So its not a 
>> great solution if you are switching back and forth a lot.
> 
> If you use C-c ' to enter the block, it opens a sub-buffer in latex mode. You
> can actually switch back and forth to edit org and latex in the same file 
> across
> buffers. It might be an elegant solution.
> 
> 
> 
> --
> Russell Adamsrlad...@adamsinfoserv.com
> 
> PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/
> 
> Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
> 




Re: [O] Org beamer async export fails

2018-05-09 Thread Nicolas Goaziou
Hello,

Jeremie Juste  writes:

> I noticed that async export using org-beamer-export fails. For instance
>
>  on test.org (see below)
>
> yield
>
> <>

`org-export-async-init-file' may not (require 'ox-beamer).

Regards,

-- 
Nicolas Goaziou



Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Eric S Fraga
On Wednesday,  9 May 2018 at 17:16, Joseph Vidal-Rosset wrote:
> Thanks Eric and Tom.
>
> At the moment, I do not know what is the most convenient solution.
>
> this one:
>
> #+BEGIN_LaTeX latex
>
> #+END_LaTeX

What version of org are you using?  This is probably not what you want
if you are using version > 8.

In any case, I use both LaTeX snippets, especially maths inline, but
also export LaTeX blocks for more complex material, mostly long
equations and tikz pictures.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-591-gee336b


signature.asc
Description: PGP signature


Re: [O] Localized org-mode

2018-05-09 Thread Diego Zamboni
On Wed, May 9, 2018 at 3:48 PM, Jean-Christophe Helary  wrote:

> You misquoted me. I was talking about design constraints when C and Lisp
> were created, which kept language creators from "inventing" proper language
> localization. I was specifically replying to Diego Zamboni regarding that.
>

I don't think it was only those constraints. Imagine if C and LISP had been
designed with "keywords in your own language" in mind. I'm pretty surre
that would have largely impeded the proliferation of compilers/interpreters
that made possible the explosion of those, and many other, languages.

I fully agree with Nicolas that in this context, localization should be a
display problem and not involve modifying the source. Take for example the
educational language Scratch (https://scratch.mit.edu/), in which you can
localize the language (i.e. the blocks with which you build your programs).
However, if you download the source for your program (it's a JSON file),
it's always the same, no matter in which language you have the interface.

As a first step, you can already configure Emacs so that the markup is
minimally visible. Look at this screenshot, for example:
http://zzamboni.org/post/beautifying-org-mode-in-emacs/emacs-init-propfonts.png.
Most of the formatting is visually communicated, you can only see a few
keywords (properties, begin_src, etc.). It really is very non-intrusive in
my opinion.

--Diego


Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Russell Adams
On Wed, May 09, 2018 at 09:22:35AM -0500, Thomas Shannon wrote:
> HI, Joseph.
>
> Its not the most elegant solution but if I’m doing extensive latex editing I 
> usually just enter latex mode (esc-x latex-mode).  This allows me to use 
> auctex as well.
>
> Of course, you have to switch back to org-mode after editing.  So its not a 
> great solution if you are switching back and forth a lot.

If you use C-c ' to enter the block, it opens a sub-buffer in latex mode. You
can actually switch back and forth to edit org and latex in the same file across
buffers. It might be an elegant solution.



--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



[O] Org beamer async export fails

2018-05-09 Thread Jeremie Juste

Hello,

I noticed that async export using org-beamer-export fails. For instance

 on test.org (see below)

yield

<>



I'm using Org mode version 9.1.13

Best regards,
Jeremie

content of test.org

#+TITLE: Example Presentation
#+AUTHOR: Carsten Dominik
#+OPTIONS: H:2 toc:t num:t
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation]
#+BEAMER_THEME: Madrid
#+COLUMNS: %45ITEM %10BEAMER_ENV(Env) %10BEAMER_ACT(Act) %4BEAMER_COL(Col) 
%8BEAMER_OPT(Opt)

* This is the first structural section test

** Frame 1
*** Thanks to Eric Fraga   :B_block:
:PROPERTIES:
:BEAMER_COL: 0.48
:BEAMER_ENV: block
:END:
for the first viable Beamer setup in Org
*** Thanks to everyone else:B_block:
:PROPERTIES:
:BEAMER_COL: 0.48
:BEAMER_ACT: <2->
:BEAMER_ENV: block
:END:
for contributing to the discussion
 This will be formatted as a beamer note   :B_note:
 :PROPERTIES:
 :BEAMER_env: note
 :END:
** Frame 2 (where we will not use columns)
*** Request
Please test this stuff!




Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Joseph Vidal-Rosset
Thanks Eric and Tom.

At the moment, I do not know what is the most convenient solution.

this one:

#+BEGIN_LaTeX latex

#+END_LaTeX

when the latex export works prints the \LaTeX logo on the file. 

I've tried Tom's solution. With keybindings  it seems to me that it is
not a bad option. 

Best wishes and again, my thanks to all. 

-- 
Joseph 



Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Eric S Fraga
On Wednesday,  9 May 2018 at 16:04, Joseph Vidal-Rosset wrote:

[...]

> and it seems that is the best option for me, but sometimes I meet error
> with the export into the latex file. But the highlightings works.

For snippets etc., not export blocks, you can also have org display
those snippets as processed latex.  Default binding is C-c C-x C-l
(org-toggle-latex-fragment).
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.7-475-g3ffc7d


signature.asc
Description: PGP signature


Re: [O] Bug: Empty Priorities Are Displayed As "B" In An Agenda Using The Column View [9.1.13 (9.1.13-elpa @ /home/tom/.emacs.d/elpa/org-9.1.13/)]

2018-05-09 Thread Tom Purl
‐‐‐ Original Message ‐‐‐

On May 9, 2018 7:32 AM, Nicolas Goaziou  wrote:

> Hello,
> 
> Tom Purl t...@tompurl.com writes:
> 
> > I like to use column view with my org agenda. One of the custom
> > 
> > properties that I like to view is the priority. Here's what I do to make
> > 
> > that happen:
> > 
> > (setq org-agenda-overriding-columns-format "%TODO %4PRIORITY(Pri.)
> > %50ITEM(Task)")
> > 
> > 
> > Using Org 8.2 I was able to view the priority in the column
> > 
> > view. However, since I've upgraded to the latest stable version of Org
> > 
> > I now see "B" when the priority is empty.
> 
> See `org-default-priority'.
> 

Thank you for your quick response Nicholas. I read that help page but I still 
think this may be a bug. In the 8.2 version of Org the Priority column in the 
column view showed an empty priority if the TODO didn't have a priority. Those 
TODO's where then *sorted* as if they had the default priority (which in this 
case would be B). But I don't see why the agenda in column view would show a 
bogus priority value. 

Thanks again!

Tom Purl



Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Thomas Shannon
HI, Joseph.

Its not the most elegant solution but if I’m doing extensive latex editing I 
usually just enter latex mode (esc-x latex-mode).  This allows me to use auctex 
as well.  

Of course, you have to switch back to org-mode after editing.  So its not a 
great solution if you are switching back and forth a lot.

Tom S.

> On May 9, 2018, at 9:04 AM, Joseph Vidal-Rosset 
>  wrote:
> 
> Yes, I have just tried this solution: 
> 
> https://emacs.stackexchange.com/questions/27866/syntax-highlighting-in-org-mode-begin-latex-block/27891
>  
> 
> 
> i.e.  
> 
> #+BEGIN_LaTeX latex
> 
> 
> #+END_LaTeX
> 
> and it seems that is the best option for me, but sometimes I meet error with 
> the export into the latex file. But the highlightings works. 
> 
> Thanks !
> 
> Best wishes 
> 
> 2018-05-09 14:05 GMT+02:00 Russell Adams  >:
> On Wed, May 09, 2018 at 01:31:51PM +0200, Joseph Vidal-Rosset wrote:
> > But nothing works for highlighting latex.
> 
> Have you considered making a latex block, and editing it? It'll have full 
> latex
> syntax highlighting while in the block.
> 
> --
> Russell Adamsrlad...@adamsinfoserv.com
> 
> PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/ 
> 
> 
> Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
> 
> 



Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Joseph Vidal-Rosset
Yes, I have just tried this solution:

https://emacs.stackexchange.com/questions/27866/syntax-highlighting-in-org-mode-begin-latex-block/27891

i.e.

#+BEGIN_LaTeX latex


#+END_LaTeX


and it seems that is the best option for me, but sometimes I meet error
with the export into the latex file. But the highlightings works.

Thanks !

Best wishes

2018-05-09 14:05 GMT+02:00 Russell Adams :

> On Wed, May 09, 2018 at 01:31:51PM +0200, Joseph Vidal-Rosset wrote:
> > But nothing works for highlighting latex.
>
> Have you considered making a latex block, and editing it? It'll have full
> latex
> syntax highlighting while in the block.
>
> --
> Russell Adamsrlad...@adamsinfoserv.com
>
> PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/
>
> Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>
>


Re: [O] [org-contacts] How to show avatar image on org headings?

2018-05-09 Thread John Kitchin
there are a couple of typos in your code, and the regexp doesn't seem to
match the property you want for some reason.

This seems to do what you want.

#+begin_src emacs-lisp
(defun org-contacts-icon-property-image-overlay (&optional limit)
  (when (re-search-forward org-heading-regexp limit t)
(let ((beg (match-beginning 0))
  (end (match-end 0))
  (image-file (org-entry-get nil "ICON"))
  org-contacts-icon-property-image
  org-contacts-icon-property-image-overlay)
  (when (and (not (ov-at beg)) (file-exists-p image-file))
(setq org-contacts-icon-property-image (create-image
(expand-file-name image-file)
 'imagemagick nil :width 100))
(setq org-contacts-icon-property-image-overlay (make-overlay beg (+
1 beg)))
(overlay-put org-contacts-icon-property-image-overlay 'before-string
(propertize " "
'display org-contacts-icon-property-image))
(overlay-put org-contacts-icon-property-image-overlay
'org-image-overlay t)
(overlay-put org-contacts-icon-property-image-overlay
'modification-hooks
 (list 'org-display-inline-remove-overlay))

(font-lock-add-keywords
 nil
 '((org-contacts-icon-property-image-overlay (0 'font-lock-keyword-face t)))
 t)
#+END_SRC

John

---
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


On Mon, May 7, 2018 at 7:57 PM, John Kitchin 
wrote:

> you might find this
> http://kitchingroup.cheme.cmu.edu/blog/2016/03/21/
> Displaying-image-overlays-on-image-filenames-in-Emacs/
> potentially useful for what you want.
>
> stardiviner writes:
>
> > I want to show org-contacts avatar image on org-headings.
> > Use overlay, or there is other better methods?
> >
> > A sample org-contacts snippet looks like this:
> >
> > * [] John KK
> > :PROPERTIES:
> > :AVATAR: john kk.jpg []
> > :END:
> >
> > I want to display the image at [] on heading, or replace "john kk.jpg"
> > with [] image.
> >
> > BTW, another question, how to get property's value? and how to iterate
> > on all heading elements then auto display image when open Contacts.org
> > file?
>
>
> --
> 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] Localized org-mode

2018-05-09 Thread Jean-Christophe Helary
You misquoted me. I was talking about design constraints when C and Lisp were 
created, which kept language creators from "inventing" proper language 
localization. I was specifically replying to Diego Zamboni regarding that.

> On May 9, 2018, at 22:25, Nicolas Goaziou  wrote:
> 
> Hello,
> 
> Jean-Christophe Helary  writes:
> 
>> There are no practical reasons why that should not be possible.
> 
> Yet, I gave some already. Consider the following three documents:


Jean-Christophe Helary
---
http://mac4translators.blogspot.com @brandelune




Re: [O] [org-contacts] How to show avatar image on org headings?

2018-05-09 Thread stardiviner
Hi, Kitchin, thanks for your sharing. Following your code example, I did
small modification to use on my case.

Here is my code:

#+begin_src emacs-lisp
(defvar image-overlay-re (concat
  ":ICON:"
  "\\(?3:'\\|\"\\)\\(?1:.*\\."
  (regexp-opt '("png" "PNG"
"jpg" "jpeg" "JPG" "JPEG"
"gif" "GIF"
"eps" "EPS"))
  "\\)\\(?:\\3\\)")
  "Regexp to match image filenames in quotes")

(defun org-contacts-icon-property-image-overlay (&optional limit)
  (when (re-search-forward image-overlay-re limit t)
(let ((beg (match-beginning 0))
  (end (match-end 0))
  (image-file (match-string 1)))
  (when (file-exists-p image-file)
(setq org-contacts-icon-property-iimage (create-image (expand-file-name 
image-file)
  'imagemagick nil 
:width 300))
(setq org-contacts-icon-property-image-overlay (make-overlay beg end))
(overlay-put org-contacts-icon-property-image-overlay 'display image)
(overlay-put org-contacts-icon-property-image-overlay 'face 'default)
(overlay-put org-contacts-icon-property-image-overlay 
'org-image-overlay t)
(overlay-put org-contacts-icon-property-image-overlay 
'modification-hooks
 (list 'org-display-inline-remove-overlay))

(font-lock-add-keywords
 nil
 '((org-contacts-icon-property-image-overlay (0 'font-lock-keyword-face t)))
 t)
#+end_src

But when I evaluate upper code, and re-enable org-mode on Contacts.org
file. The :ICON: property value "John.png" is not displayed as image. Is
there something wrong?

I choose to use overlay to auto display image when open org-contacts
file.

--
[ stardiviner ] don't need to convince with trends.
   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: [O] Localized org-mode

2018-05-09 Thread Nicolas Goaziou
Hello,

Jean-Christophe Helary  writes:

> There are no practical reasons why that should not be possible.

Yet, I gave some already. Consider the following three documents:

* Headline
:PROPERTIES:
foo
:END:

and

* Headline
:PROPERTIES:
:foo:
:END:

Paragraph.

:PROPERTIES:
bar
:END:

and

* Headline
:PROPRIÉTÉS:
:foo:
:FIN:

How would you translate them into, say, French? Can you do this without
knowing what is a properties drawer, including the "PROPERTIES" name?

> The current state of affairs is only due to design constraints when
> the languages were conceived.

So, this is a practical reason: design constraints.

> In Scheme, for ex. you can actually redefine all the language keywords
> very easily without any impact on the interpreter.

Note that Org syntax is more complicated than Scheme's. In both cases,
you need to recognize syntax data before translating them. You do not
really change syntax, you add a layer on top of it.

> What matters is that users find org easy to use in their language. But
> emacs (the main org user) is so far behind in that respect compared to
> the rest of the FLOSS ecosystem that even having one mode that
> implements some sort of l10n would be huge. Although, it would be nice
> to have that work nicely with already existing l10n processes.

These are orthogonal issues. You can do l10n without modifying syntax.
The export framework already does that, and I gave a POC to handle this
in Emacs.

I have no solution outside of Emacs.

Regards,

-- 
Nicolas Goaziou



Re: [O] Localized org-mode

2018-05-09 Thread Jean-Christophe Helary


> On May 9, 2018, at 21:07, Kaushal Modi  wrote:
> 
> Hello all,
> 
> On Wed, May 9, 2018, 8:01 AM Diego Zamboni  > wrote:
> I really don't see the point of trying to localize org keywords. To me, they 
> are like the keywords in any programming language - part of the language. 
> Would you consider translating C or LISP keywords?

There are no practical reasons why that should not be possible. The current 
state of affairs is only due to design constraints when the languages were 
conceived.

In Scheme, for ex. you can actually redefine all the language keywords very 
easily without any impact on the interpreter.

> In addition to the trouble of supporting something like this within Emacs, 
> think of the growing ecosystem of tools which support org mode - they would 
> all need to be aware of these localizations. It would be a nightmare to 
> maintain.

Localization, when properly done is never a nightmare to maintain.

> So much +1 on that! Supporting multi-language keywords will make it difficult 
> for 3rd party Org parsers to adopt them too, resulting in even lesser Org 
> adoption.

Genuine question: how many 3rd party tools do support the org format ?

> I like Nicolas' idea where display properties are used to replace the English 
> keywords with the translation; that way the actual Org source remains 
> untouched. 

What matters is that users find org easy to use in their language. But emacs 
(the main org user) is so far behind in that respect compared to the rest of 
the FLOSS ecosystem that even having one mode that implements some sort of l10n 
would be huge. Although, it would be nice to have that work nicely with already 
existing l10n processes. 


Jean-Christophe Helary
---
http://mac4translators.blogspot.com @brandelune




Re: [O] Moving from Jekyll to Orgmode

2018-05-09 Thread ST
> >
> > Is the difficulty to setup ox-publish the sole disadvantage vis.
> > ox-hugo/ox-jekyll/etc.? Is the functionality the same 
> > more_or_less?
> >
> > What ox-hugo devs/users have to say on this?
> 
> I enjoy the hugo server.  Make a change to the org mode file, 
> export with ox-hugo, and then look at the web browser to see the 
> effect of the change.  It makes the work much easier, IMHO.
> 

Jekyll also has a built-in web server. It is indeed useful. I didn't
check but I thought there must be similar standard command line Linux
tool for this, so you could immediately see the results of ox-publish
exported website. Is anybody aware of such a tool?




Re: [O] Localized org-mode

2018-05-09 Thread ST
On Wed, 2018-05-09 at 13:36 +0200, Diego Zamboni wrote:
> I really don't see the point of trying to localize org keywords. To
> me, they are like the keywords in any programming language - part of
> the language. Would you consider translating C or LISP keywords?

I see org, first of all, as an excellent lightweight markup syntax for
creating documents and not as a programming language, i.e. it should be
readable in raw plain text. Thus it would be more elegant to have native
keywords. Just an idea...

> 
> On Wed, May 9, 2018 at 10:19 AM, Nicolas Goaziou
>  wrote:
> Hello,
> 
> ST  writes:
> 
> > So how do you solve this problem now for English
> ":PROPERTIES:"?
> 
> Simple. Org does not replace anything arbitrarily. This is
> less
> error-prone.
> 
> > Anyway if somebody runs into it he could have at least to
> options:
> >
> > 1. write local .emacs.d/.org-de-vocabulary which will
> override the
> > default one (or parts of it) with a synonym, like:
> > PROPERTIES -> ATTRIBUTEN
> > or
> > PROPERTIES -> ORG_EIGENSCHAFTEN
> > and then you can replace blindly before parsing.
> 
> Again, I'm not particularly fond of having conditional syntax
> like this.
> 
> > I don't know lisp :(
> 
> You may want to look at `org-display-custom-time'.
> 
> Basically, you search for the regexp "^[ \t]*:\\(PROPERTIES\
> \):", and
> use `put-text-property' to change the text between
> (match-beginning 1)
> and (match-end 1), e.g.,
> 
> (defun my-properties-translate ()
>   (org-with-point-at 1
> (while (re-search-forward "^[ \t]*:\\(PROPERTIES\\):"
> nil t)
>   (put-text-property (match-beginning 1) (match-end 1)
> 'display "ATTRIBUTEN"
> 
> You need to add this function to, e.g. `org-mode-hook'. Of
> course this
> is really basic and can be improved.
> 
> Regards,
> 




Re: [O] Bug: Empty Priorities Are Displayed As "B" In An Agenda Using The Column View [9.1.13 (9.1.13-elpa @ /home/tom/.emacs.d/elpa/org-9.1.13/)]

2018-05-09 Thread Nicolas Goaziou
Hello,

Tom Purl  writes:

> I like to use column view with my org agenda. One of the custom
> properties that I like to view is the priority. Here's what I do to make
> that happen:
>
> (setq org-agenda-overriding-columns-format "%TODO %4PRIORITY(Pri.)
> %50ITEM(Task)")
>
> Using Org 8.2 I was able to view the priority in the column
> view. However, since I've upgraded to the latest stable version of Org
> I now see "B" when the priority is empty.

See `org-default-priority'.

Regards,

Regards,

-- 
Nicolas Goaziou



Re: [O] Moving from Jekyll to Orgmode

2018-05-09 Thread Kaushal Modi
Hello,

On Wed, May 9, 2018, 3:36 AM ST  wrote:

>
> Is the difficulty to setup ox-publish the sole disadvantage vis.
> ox-hugo/ox-jekyll/etc.?


ox-publish is not *that* difficult to set up. Once you have it set up once,
you just reuse that with minor tweaks for different projects. The Org
manual has nice examples of simple and complex ox-publish configs; try them
out.

For me, personally, ox-publish didn't turn out to be the right tool for
blogging, especially where I want to have a single Org file to hold
multiple posts. I do use it though for applications like batch-exporting an
Org file or a directory of Org files to multiple formats.

Talking about comparing it with ox-hugo/ox-jekyll, etc... they don't
compare apples to apples.

Ox-publish is an inbuilt Org utility that works with *any* Org exporter
backend that has hooks for ox-publish (ox-hugo hasn't done that; read
further for more).

Whereas, ox-hugo is an Org exporter backend that exports to Markdown
(mostly standard Markdown + some Hugo specific syntax + bits and pieces of
HTML where necessary) + Hugo front-matter + fine-tuned "ox-publishy"
functionality.

Is the functionality the same more_or_less?
>

Again, not apples to apples..

>
Here's a coarse way to explain the function of ox-publish.. it takes the
Org files from the specified dir, exports them using an
ox-publish-supporting exporter, and puts them in some destination dir.

Ox-hugo does this:

- Exports the current Org file as a single post, or loops through subtrees
(using an interesting logic) in the current file and exports them as
individual posts. (Ox-publish does not allow exporting subtrees from a
single Org file.)
- The destination for exported Markdown files is decided based on
Hugo-specific Org keywords like HUGO_BASE_DIR, HUGO_SECTION, HUGO_BUNDLE.
Here's where ox-hugo works sort of like ox-publish.

What ox-hugo devs/users have to say on this?
>

Hope that helps clarify the differences.

Kaushal

> --

Kaushal Modi


[O] Bug: Empty Priorities Are Displayed As "B" In An Agenda Using The Column View [9.1.13 (9.1.13-elpa @ /home/tom/.emacs.d/elpa/org-9.1.13/)]

2018-05-09 Thread Tom Purl
I like to use column view with my org agenda. One of the custom
properties that I like to view is the priority. Here's what I do to make
that happen:

(setq org-agenda-overriding-columns-format "%TODO %4PRIORITY(Pri.)
%50ITEM(Task)")

Using Org 8.2 I was able to view the priority in the column
view. However, since I've upgraded to the latest stable version of Org
I now see "B" when the priority is empty.

Emacs  : GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
of 2017-09-12 on hullmann, modified by Debian
Package: Org mode version 9.1.13 (9.1.13-elpa @ 
/home/tom/.emacs.d/elpa/org-9.1.13/)

current state:
==
(setq
org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
org-occur-hook '(org-first-headline-recenter)
org-metaup-hook '(org-babel-load-in-session-maybe)
org-confirm-shell-link-function 'yes-or-no-p
org-agenda-custom-commands '(("." "Simple agenda view" ((tags "+today" 
((org-agenda-span (quote day (agenda ""
org-after-todo-state-change-hook '(org-clock-out-if-current)
org-from-is-user-regexp "\\"
org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-babel-pre-tangle-hook '(save-buffer)
org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-show-block-all append local] 5 "\n\n(fn)"]
#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook 
org-babel-show-result-all append local] 5 "\n\n(fn)"]
org-babel-result-hide-spec org-babel-hide-all-hashes)
org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
org-archive-hook '(org-attach-archive-delete-maybe)
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
org-agenda-view-columns-initially t
org-agenda-span 1
org-confirm-elisp-link-function 'yes-or-no-p
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-link-parameters '(("id" :follow org-id-open) ("rmail" :follow 
org-rmail-open :store org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link) ("irc" :follow 
org-irc-visit :store org-irc-store-link)
   ("info" :follow org-info-open :export org-info-export :store 
org-info-store-link)
   ("gnus" :follow org-gnus-open :store org-gnus-store-link)
   ("docview" :follow org-docview-open :export org-docview-export :store 
org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete 
org-bbdb-complete-link :store org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs") ("doi" 
:follow org--open-doi-link)
   ("elisp" :follow org--open-elisp-link) ("file" :complete 
org-file-complete-link)
   ("ftp" :follow (lambda (path) (browse-url (concat "ftp:" path 
("help" :follow org--open-help-link)
   ("http" :follow (lambda (path) (browse-url (concat "http:" path
   ("https" :follow (lambda (path) (browse-url (concat "https:" path
   ("mailto" :follow (lambda (path) (browse-url (concat "mailto:"; path
   ("news" :follow (lambda (path) (browse-url (concat "news:"; path 
("shell" :follow org--open-shell-link))
org-agenda-files '("/tmp/org-test/test.org")
org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
)

Re: [O] Localized org-mode

2018-05-09 Thread Kaushal Modi
Hello all,

On Wed, May 9, 2018, 8:01 AM Diego Zamboni  wrote:

> I really don't see the point of trying to localize org keywords. To me,
> they are like the keywords in any programming language - part of the
> language. Would you consider translating C or LISP keywords?
>
> In addition to the trouble of supporting something like this within Emacs,
> think of the growing ecosystem of tools which support org mode - they would
> all need to be aware of these localizations. It would be a nightmare to
> maintain.
>

So much +1 on that! Supporting multi-language keywords will make it
difficult for 3rd party Org parsers to adopt them too, resulting in even
lesser Org adoption.

I like Nicolas' idea where display properties are used to replace the
English keywords with the translation; that way the actual Org source
remains untouched.

> --

Kaushal Modi


Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Russell Adams
On Wed, May 09, 2018 at 01:31:51PM +0200, Joseph Vidal-Rosset wrote:
> But nothing works for highlighting latex.

Have you considered making a latex block, and editing it? It'll have full latex
syntax highlighting while in the block.

--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Re: [O] Localized org-mode

2018-05-09 Thread Diego Zamboni
I really don't see the point of trying to localize org keywords. To me,
they are like the keywords in any programming language - part of the
language. Would you consider translating C or LISP keywords?

In addition to the trouble of supporting something like this within Emacs,
think of the growing ecosystem of tools which support org mode - they would
all need to be aware of these localizations. It would be a nightmare to
maintain.

--Diego

On Wed, May 9, 2018 at 10:19 AM, Nicolas Goaziou 
wrote:

> Hello,
>
> ST  writes:
>
> > So how do you solve this problem now for English ":PROPERTIES:"?
>
> Simple. Org does not replace anything arbitrarily. This is less
> error-prone.
>
> > Anyway if somebody runs into it he could have at least to options:
> >
> > 1. write local .emacs.d/.org-de-vocabulary which will override the
> > default one (or parts of it) with a synonym, like:
> > PROPERTIES -> ATTRIBUTEN
> > or
> > PROPERTIES -> ORG_EIGENSCHAFTEN
> > and then you can replace blindly before parsing.
>
> Again, I'm not particularly fond of having conditional syntax like this.
>
> > I don't know lisp :(
>
> You may want to look at `org-display-custom-time'.
>
> Basically, you search for the regexp "^[ \t]*:\\(PROPERTIES\\):", and
> use `put-text-property' to change the text between (match-beginning 1)
> and (match-end 1), e.g.,
>
> (defun my-properties-translate ()
>   (org-with-point-at 1
> (while (re-search-forward "^[ \t]*:\\(PROPERTIES\\):" nil t)
>   (put-text-property (match-beginning 1) (match-end 1) 'display
> "ATTRIBUTEN"
>
> You need to add this function to, e.g. `org-mode-hook'. Of course this
> is really basic and can be improved.
>
> Regards,
>
> --
> Nicolas Goaziou0x80A93738
>
>


Re: [O] Moving from Jekyll to Orgmode

2018-05-09 Thread Diego Zamboni
>
>
> Is the difficulty to setup ox-publish the sole disadvantage vis.
> ox-hugo/ox-jekyll/etc.? Is the functionality the same more_or_less?
>
> What ox-hugo devs/users have to say on this?


I have never used ox-publish, but getting started with ox-hugo is really
easy. I think the main difference might be that ox-hugo is tailored
specifically for Hugo, which influences its expected directory structure,
file output format, etc. Ox-publish might be more generic and customizable
for arbitrary output formats.

--Diego


Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Joseph Vidal-Rosset
Thanks for your help. At the moment I have in my init.el  (in fact my
user.el because I am using scimax with -q -l options):

(require 'ox-latex)
(setq org-src-fontify-natively t)
(setq org-highlight-latex-and-related '(latex))
(setq org-highlight-latex-and-related '(latex script entities))

But nothing works for highlighting latex.

Best wishes,


Jo.

2018-05-09 13:21 GMT+02:00 Eric S Fraga :

> On Wednesday,  9 May 2018 at 11:59, Nicolas Goaziou wrote:
> > Eric S Fraga  writes:
> >
> >> Okay.  But I have this variable set, to (latex), and it does
> >> nothing.  The regex remains nil.  Is there some other configuration
> >> setting that we have to set to get LaTeX snippets etc. highlighted?
> >
> > You may need to reload Org mode in the current buffer.
>
> But I have this set from the start and also tried with
> custom-set-variable... and I have tried reloading org.  All to no
> avail.
>
> The highlighting works if I try emacs -Q so obviously something else is
> affecting this setting.  U time to dive into my customization of
> org.  Any hints as to what could be affecting the actual highlighting
> would be welcome, of course!
>
> thanks,
> eric
>
> --
> Eric S Fraga via Emacs 27.0.50, Org release_9.1.11-620-ga548e4
>


Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Eric S Fraga
On Wednesday,  9 May 2018 at 11:59, Nicolas Goaziou wrote:
> Eric S Fraga  writes:
>
>> Okay.  But I have this variable set, to (latex), and it does
>> nothing.  The regex remains nil.  Is there some other configuration
>> setting that we have to set to get LaTeX snippets etc. highlighted?
>
> You may need to reload Org mode in the current buffer.

But I have this set from the start and also tried with
custom-set-variable... and I have tried reloading org.  All to no
avail.

The highlighting works if I try emacs -Q so obviously something else is
affecting this setting.  U time to dive into my customization of
org.  Any hints as to what could be affecting the actual highlighting
would be welcome, of course!

thanks,
eric

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.11-620-ga548e4


signature.asc
Description: PGP signature


Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Nicolas Goaziou
Eric S Fraga  writes:

> Okay.  But I have this variable set, to (latex), and it does
> nothing.  The regex remains nil.  Is there some other configuration
> setting that we have to set to get LaTeX snippets etc. highlighted?

You may need to reload Org mode in the current buffer.



Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Eric S Fraga
On Wednesday,  9 May 2018 at 10:41, Nicolas Goaziou wrote:

[...]

> This is an internal variable. The OP should tweak
> `org-highlight-latex-and-related' instead.

Okay.  But I have this variable set, to (latex), and it does
nothing.  The regex remains nil.  Is there some other configuration
setting that we have to set to get LaTeX snippets etc. highlighted?

Thanks,
eric

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.11-620-ga548e4


signature.asc
Description: PGP signature


Re: [O] Localized org-mode

2018-05-09 Thread Nicolas Goaziou
Hello,

ST  writes:

> So how do you solve this problem now for English ":PROPERTIES:"?

Simple. Org does not replace anything arbitrarily. This is less
error-prone.

> Anyway if somebody runs into it he could have at least to options:
>
> 1. write local .emacs.d/.org-de-vocabulary which will override the
> default one (or parts of it) with a synonym, like:
> PROPERTIES -> ATTRIBUTEN
> or
> PROPERTIES -> ORG_EIGENSCHAFTEN
> and then you can replace blindly before parsing.

Again, I'm not particularly fond of having conditional syntax like this.

> I don't know lisp :(

You may want to look at `org-display-custom-time'.

Basically, you search for the regexp "^[ \t]*:\\(PROPERTIES\\):", and
use `put-text-property' to change the text between (match-beginning 1)
and (match-end 1), e.g.,

(defun my-properties-translate ()
  (org-with-point-at 1
(while (re-search-forward "^[ \t]*:\\(PROPERTIES\\):" nil t)
  (put-text-property (match-beginning 1) (match-end 1) 'display 
"ATTRIBUTEN"

You need to add this function to, e.g. `org-mode-hook'. Of course this
is really basic and can be improved.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Nicolas Goaziou
Hello,

Eric S Fraga  writes:

> On Wednesday,  9 May 2018 at 10:17, Joseph Vidal-Rosset wrote:
>> Hello,
>>
>> I would be happy to highlight latex code in org-mode, but nothing works. It
>> is a pity because this lack of highlighting latex code in org-mode entails
>> troubles in exporting in latex and I have always to correct my source
>> files.
>
> There appears to be support for font-lock for LaTeX expressions in org
> but the regex that is used to determine LaTeX snippets is nil:
>
> org-latex-and-related-regexp is a variable defined in ‘org.el’.
> Its value is nil
>
> Documentation:
> Regular expression for highlighting LaTeX, entities and sub/superscript.
>
> Maybe play around with this?

This is an internal variable. The OP should tweak
`org-highlight-latex-and-related' instead.

Regards,

-- 
Nicolas Goaziou



Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Eric S Fraga
On Wednesday,  9 May 2018 at 10:17, Joseph Vidal-Rosset wrote:
> Hello,
>
> I would be happy to highlight latex code in org-mode, but nothing works. It
> is a pity because this lack of highlighting latex code in org-mode entails
> troubles in exporting in latex and I have always to correct my source
> files.

Actually, reading the code further, it would appear that there is a
function which should define the variable I mentioned in my previous
response: org-compute-latex-and-related-regexp
but I am not sure how and when this is invoked.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.7-475-g3ffc7d


signature.asc
Description: PGP signature


Re: [O] highlighting latex code in org-mode

2018-05-09 Thread Eric S Fraga
On Wednesday,  9 May 2018 at 10:17, Joseph Vidal-Rosset wrote:
> Hello,
>
> I would be happy to highlight latex code in org-mode, but nothing works. It
> is a pity because this lack of highlighting latex code in org-mode entails
> troubles in exporting in latex and I have always to correct my source
> files.

There appears to be support for font-lock for LaTeX expressions in org
but the regex that is used to determine LaTeX snippets is nil:

org-latex-and-related-regexp is a variable defined in ‘org.el’.
Its value is nil

Documentation:
Regular expression for highlighting LaTeX, entities and sub/superscript.

Maybe play around with this?

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.7-475-g3ffc7d


signature.asc
Description: PGP signature


[O] highlighting latex code in org-mode

2018-05-09 Thread Joseph Vidal-Rosset
Hello,

I would be happy to highlight latex code in org-mode, but nothing works. It
is a pity because this lack of highlighting latex code in org-mode entails
troubles in exporting in latex and I have always to correct my source
files.

Help would be very welcome.

Best wishes,

Jo.


Re: [O] Moving from Jekyll to Orgmode

2018-05-09 Thread Thomas S. Dye

Aloha ST,

ST writes:


Is the difficulty to setup ox-publish the sole disadvantage vis.
ox-hugo/ox-jekyll/etc.? Is the functionality the same 
more_or_less?


What ox-hugo devs/users have to say on this?


I enjoy the hugo server.  Make a change to the org mode file, 
export with ox-hugo, and then look at the web browser to see the 
effect of the change.  It makes the work much easier, IMHO.


All the best,
Tom

--
Thomas S. Dye
http://www.tsdye.com



Re: [O] Localized org-mode

2018-05-09 Thread ST
On Tue, 2018-05-08 at 20:21 +0200, Nicolas Goaziou wrote:
> ST  writes:
> 
> > Why? Run "detranslator" before you start parsing. I.e. based on your
> > 1-to-1 vocabulary "detranslator" will substitute all :EIGENSCHAFTEN: and
> > all other org syntax back to English :PROPERTIES: etc.. Then apply
> > parser as usual.
> 
> You cannot blindly replace all ":EIGENSCHAFTEN:" with ":PROPERTIES:"
> because some of them could be real ":EIGENSCHAFTEN:", which is valid
> syntax. IOW, you need to parse the buffer to know what ":EIGENSCHAFTEN:"
> ought to be replaced, so you're running in circles.

So how do you solve this problem now for English ":PROPERTIES:"?

Anyway if somebody runs into it he could have at least to options:

1. write local .emacs.d/.org-de-vocabulary which will override the
default one (or parts of it) with a synonym, like:
PROPERTIES -> ATTRIBUTEN
or
PROPERTIES -> ORG_EIGENSCHAFTEN
and then you can replace blindly before parsing.

2. just go back to using English org-vocabulary as it is done now.


> > Writing is only a half of the problem. Imagine Cyrillic or Chinese text
> > mixed with Latin letters. Org is not html (that hides its syntax once
> > rendered) and it is supposed to be smoothly readable in raw plain texta
> > form. Even worth - imagine right-to-left texts like Hebrew or Persian
> > mixed up with left-to-right Latin letters. It's not aesthetical.
> 
> If that's an aesthetic issue, we could fix it on the aesthetic side.
> 
> For example, you can localize timestamps with `org-display-custom-times'
> and `org-time-stamp-custom-formats'. It could be possible to do
> something similar, i.e., to use overlays, e.g., on top of properties
> drawers. Of course, this wouldn't change the underlying appearance, but
> the solution is much less invasive than what you suggest.
> 
> Do you want to propose a patch?

I don't know lisp :(




Re: [O] Moving from Jekyll to Orgmode

2018-05-09 Thread ST
On Tue, 2018-05-08 at 00:21 +0200, Rasmus wrote:
> ST  writes:
> 
> >> > 2. how can one create "prettified" links, i.e. /features/ instead
> >> > of /features.html ? Basically during the website generation for the file
> >
> >> > features.org a directory `features` needs to be created and the html
> >> > file placed into `features/index.html` ... Is there a tutorial on how to
> >> > do that?
> >> 
> >> You make a wrapper around org-html-publish-to-html that creates folders
> >> and from filename and save file as index in the folder.  The wrapper
> >> function is then used as the :publishing-function in
> >> org-publish-project-alist.
> >> 
> >> Something like this (untested).
> >> 
> >> (lambda (plist filename pub-dir)
> >>   (let ((dir (make-directory (file-name-as-directory (file-name-base 
> >> filename))
> >>  pub-dir)))
> >> (org-latex-publish-to-html plist filename dir)
> >> (rename-file (concat dir (file-name-base filename) ".html")
> >>  (concat dir "index.html"
> >> 
> >> 
> >> You could also move around your source files before publishing via the
> >> :preparation-function.
> >
> > Thank you very much! Unfortunately I don't know lisp, so I have to learn
> > it first to understand your solution... but now I have something to
> > start with. I wish org html export will become a real static site
> > generator, like jekyll, hugo, etc..
> 
> I *think* that is what ox-publish is, but indeed, it’s a bit hairy to set
> up.

Is the difficulty to setup ox-publish the sole disadvantage vis.
ox-hugo/ox-jekyll/etc.? Is the functionality the same more_or_less?

What ox-hugo devs/users have to say on this?