Re: Adaptive Org faces in headings?

2020-09-12 Thread Protesilaos Stavrou
Bastien  [2020-09-09, 10:49 +0200]:

> Protesilaos Stavrou  writes:
>
>> Diego Zamboni  [2020-09-05, 23:39 +0200]:
>>
>>> I had seen the same in my setup. I recently started using Doom Emacs
>>> (https://github.com/hlissner/doom-emacs/) and was pleasantly surprised
>>> to discover that todo and tag faces scale according to the headline in
>>> which they are. I don't know precisely how this is done, but there are
>>> some hints here, you might use it as a starting point:
>>> https://github.com/hlissner/doom-emacs/blob/develop/modules/lang/org/config.el#L146-L175
>>
>> I noticed that the doom-themes have some extra code to fontify Org.[0]
>> It also has some opinionated extras that do not belong to the issue I
>> raised.  I am curious whether this was ever shared/discussed on this
>> mailing list.
>
> I can't remember any such discussion.
>
> (In general, it would be good if downstream enhancements like these
> could be shared upstream, we are generally quite grateful for help!)
>
> In any case, thanks for reporting this issue, I confirm we should
> work on it for a future release.
>
> Patches welcome,

Hello again!

I am not sure I can help with the patch, but at least I can share some
more user feedback.

Please see the attached screenshots that could help improve our
understanding of the issue.  The gist is that Org already has working
code that adapts some faces to the underlying heading style (in this
case font height and weight).

To reproduce this demo on emacs -Q:

+ Open an org-mode file, e.g. C-x C-f /tmp/test.org
+ Insert a level 1 heading:

  * TODO [#A] Do they adapt ~test-heading-faces~ and =another-test=?

+ Evaluate each of the expressions in the code block and notice how the
  heading's faces adapt to it:

#+begin_src emacs-lisp
(set-face-attribute 'org-level-1 nil :height 3.0 :weight 'normal)
(set-face-attribute 'org-level-1 nil :weight 'bold)
#+end_src

This is in addition to what I noted in a previous message:
https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/msg00331.html

Best regards,
Protesilaos

-- 
Protesilaos Stavrou
protesilaos.com



Re: idea for capture anywhere in x

2020-09-12 Thread Nick Econopouly
Just chiming in here, you are correct that org-protocol is 
unnecessary. Regular org-capture templates plus a call to 
emacsclient -e will do the trick. I happened to recently see a 
workflow like this in a blog post: 
https://yiufung.net/post/anki-org/




Re: org-babel support for haxe

2020-09-12 Thread ian martins
Thanks for the feedback. There's no special reason for the external test
data file or repeated executable-find calls. I was following the convention
from ob-C. I'll make those changes.

ob-haxe and ob-java both involve a few changes to ob-core to allow temp
directories instead of just temp files. Should I submit that as a separate
patch?

On Sun, Sep 6, 2020 at 11:24 AM Kyle Meyer  wrote:

> Hi ian,
>
> It looks like this library is instead going to be available through an
> ELPA, but FWIW here are a couple of comments on the tests.
>
> ian martins writes:
>
> > diff --git a/testing/examples/ob-haxe-test.org b/testing/examples/
> ob-haxe-test.org
> > new file mode 100644
> > index 0..ba9119d58
> > --- /dev/null
> > +++ b/testing/examples/ob-haxe-test.org
> > @@ -0,0 +1,247 @@
> > +#+Title: a collection of examples for ob-haxe tests
> > +#+OPTIONS: ^:nil
> > +* Simple
> > +  :PROPERTIES:
> > +  :ID:   966875e9-d10e-406c-9211-449555e3d3b2
> > +  :END:
> > +#+name: simple
> > +#+begin_src haxe :results output silent
> > +  Sys.print(42);
> > +#+end_src
>
> I know some other babel tests use a separate .org file, but I find this
> setup harder to follow compared to having the Org content within the
> test (e.g. using org-test-with-temp-text or
> org-test-with-temp-text-in-file).  Perhaps I'm missing why it's needed
> in this case though.
>
> > diff --git a/testing/lisp/test-ob-haxe.el b/testing/lisp/test-ob-haxe.el
> [...]
> > +;;; Code:
> > +(org-test-for-executable "haxe")
> > +(unless (featurep 'ob-haxe)
> > +  (signal 'missing-test-dependency "Support for haxe code blocks"))
> > +
> > +(ert-deftest ob-haxe/simple ()
> > +  "Hello world program."
> > +  (if (executable-find org-babel-haxe-command)
>
> I think you can avoid the executable-find here and in all the other
> tests because you have (org-test-for-executable "haxe") at the beginning
> of the file.
>


RFE: Capture: property prompt: default completion

2020-09-12 Thread Phil Hudson
I'd like us to add the ability to provide a default completion value
for a property prompt in a capture template, as already exists for a
non-property prompt.

So where at the moment we can have:

%^{prompt|default|completion2|completion3|...}

I want, by analogy:

%^{prop|default}p

with the remaining completions provided by the #+prop_ALL in-buffer
setting, and with the implied constraint that "default" is a member of
that set.



[O] babel bash :var tables - change from associative to index arrays

2020-09-12 Thread Ken Mankoff
Hi Org List,

I'd like to submit a patch so that all bash babel arrays are indexed. Are there 
cons to this that I'm not seeing? It might break some existing code that 
expects associative arrays. Could this be a breaking change that is included in 
Org 5.0? I'd like to check on the likely acceptance of such a patch before I 
take the time to code it.

Currently Org Babel uses associative arrays for multi-column bash :var inputs, 
and indexed arrays if single column. Put differently, for 1D tables the array 
is indexed [0,1,...,n] and for 2D arrays it is indexed using the first column. 
Example at the bottom of this email.

There are some drawbacks to this method: 1) It drops rows if the first column 
is not unique (I have tables where the first three columns make a unique index 
from "|year|month|day|value") and 2) associative arrays do not maintain order, 
so the code cannot rely on the order of the rows (see example below where 
"foo2,bar2" order is swapped).

If all arrays are indexed, these two issues would go away.

  -k.


#+NAME: tbl1D
| foo1  |
| bar1  |

#+NAME: tbl2D
| foo2  | 42 |
| bar2  | 24 |

#+NAME: print_tbl
#+BEGIN_SRC bash :var tbl=tbl1D
for key in "${!tbl[@]}"; do
  row=${tbl[$key]}
  echo $key $row
done
#+END_SRC

#+CALL: print_tbl(tbl=tbl1D)

#+RESULTS:
| 0 | foo1 |
| 1 | bar1 |

#+CALL: print_tbl(tbl=tbl2D)

#+RESULTS:
| bar2 | 24 |
| foo2 | 42 |



Javascript Syntax Highlighting

2020-09-12 Thread CRSHCMDR
Is it possible to use js2-mode instead of js-mode for the syntax highlighting 
of code blocks in org-mode? The reason that I ask is that the current js-mode 
syntax highlighting leaves something to be desired, and is from my perspective 
broken. For instance after declaring a variable, the usage of that variable is 
no longer highlighted. You can see the difference here 
https://imgur.com/a/4b2LyhE.

I have tried using the ‘org-src-lang-modes, but I’m either not setting it 
correctly, or I’m barking up the wrong tree.

Very Respectfully,
Brandon


JS2 Syntax Highlighting for Source Blocks

2020-09-12 Thread CRSHCMDR
Is it possible to use js2-mode instead of js-mode for the syntax highlighting 
of code blocks in org-mode? The reason that I ask is that the current js-mode 
syntax highlighting leaves something to be desired, and is from my perspective 
broken. For instance after declaring a variable, the usage of that variable is 
no longer highlighted. You can see the difference here 
https://imgur.com/a/4b2LyhE.

I have tried using the ‘org-src-lang-modes, but I’m either not setting it 
correctly, or I’m barking up the wrong tree.

Very Respectfully,
Brandon


Bug: org-table-import fails to import xlxs files

2020-09-12 Thread swedebugia
Hi

Thanks for a making this fantastic program!

I think I found a bug.

When trying to import a xslx table into org-mode I get a lot of binary
data instead of a table back.

I would rather either get an error saying it is not supported yet or an
org-table.

Recoll supports xlsx files it seems, so it should be possible
with python 3 at least to make this work also in org-mode. See
https://www.lesbonscomptes.com/recoll/pages/features.html

I found this in Arch:
$ pacman -Ss xlsx
community/python-openpyxl 3.0.5-1
A Python library to read/write Excel 2007 xlsx/xlsm files

Other ones written in python:
https://github.com/dilshod/xlsx2csv (not that active)
https://github.com/wireservice/csvkit (active)

Also gnumeric can convert it:
The Gnumeric spreadsheet application comes with a command line utility
called ssconvert that can convert between a variety of spreadsheet
formats:

$ ssconvert Book1.xlsx newfile.csv
Unfortunately it is only available with the gnumeric GUI currently
which is ~14MB bloat. 
See
http://stackoverflow.com/questions/10557360/ddg#10580741
Source here https://gitlab.gnome.org/GNOME/gnumeric (active)

Cheers
swedebugia



Re: Possible conflict with outline-magic

2020-09-12 Thread John Haman

Well, I was able to fix my issue using the configuration on EmacsWiki

(use-package outline-magic
  :ensure t
  :config
  (eval-after-load 'outline
    '(progn
   (require 'outline-magic)
   (define-key outline-minor-mode-map (kbd "") 
'outline-cycle


But I'm not sure why this should work while the configuration that comes 
with outline-magic interacts with org-capture.


-John

On 9/12/20 9:52 AM, John Haman wrote:
Hello, I would like to use the outline-magic package to cycle headings 
in outline-mode. I installed outline magic, and put the recommended 
configuration in my init file.


(use-package outline-magic
  :ensure t
  :config
  (add-hook 'outline-mode-hook
    (lambda ()
  (require 'outline-cycle

The package works great! I can easily cycle visibility of headings in 
outline-mode with TAB. No further configuration.


After installing outline-magic, my org-capture stopped working. I have 
a very benign capture configuration.


(use-package org-capture
  :after org
  :hook
  (org-capture-mode . evil-insert-state)
  :custom
  (org-capture-templates ...  ... ))

When I call org-capture now, I get an error:

Template key:
File mode specification error: (file-missing Cannot open load file No 
such file or directory outline-cycle)
org-capture: Capture abort: (file-missing Cannot open load file No 
such file or directory outline-cycle)


How do I prevent this strange interaction between outline-magic and 
org-capture?


What I tried:

- Loading outline-magic after org-mode.

- Deleting Elpa folder and reinstalling all packages.

No luck so far.

(Note: I cannot switch from outline-mode to markdown-mode because 
markdown-mode has fontificiation issues on the files I edit)


Thanks all, any help here is greatly appreciated.

John





Possible conflict with outline-magic

2020-09-12 Thread John Haman
Hello, I would like to use the outline-magic package to cycle headings 
in outline-mode. I installed outline magic, and put the recommended 
configuration in my init file.


(use-package outline-magic
  :ensure t
  :config
  (add-hook 'outline-mode-hook
    (lambda ()
  (require 'outline-cycle

The package works great! I can easily cycle visibility of headings in 
outline-mode with TAB. No further configuration.


After installing outline-magic, my org-capture stopped working. I have a 
very benign capture configuration.


(use-package org-capture
  :after org
  :hook
  (org-capture-mode . evil-insert-state)
  :custom
  (org-capture-templates ...  ... ))

When I call org-capture now, I get an error:

Template key:
File mode specification error: (file-missing Cannot open load file No 
such file or directory outline-cycle)
org-capture: Capture abort: (file-missing Cannot open load file No such 
file or directory outline-cycle)


How do I prevent this strange interaction between outline-magic and 
org-capture?


What I tried:

- Loading outline-magic after org-mode.

- Deleting Elpa folder and reinstalling all packages.

No luck so far.

(Note: I cannot switch from outline-mode to markdown-mode because 
markdown-mode has fontificiation issues on the files I edit)


Thanks all, any help here is greatly appreciated.

John




#+ATTR_HTML examples uses old syntax

2020-09-12 Thread Nick Dokos
The attached patch fixes an example in the "Tables in HTML export"
section of the manual that uses the old `border="3"' syntax instead
of `:border 3' etc.

>From 52be0b5b1fe492b3ff44e6ccd6dbfaed1eb88537 Mon Sep 17 00:00:00 2001
From: Nick Dokos 
Date: Sat, 12 Sep 2020 17:47:29 -0400
Subject: [PATCH] Fix syntax of #+ATTR_HTML

The example in the "Tables in HTML export" section of the manual
uses the old syntax: `border="2"' etc.

Change it to use `:border 2' etc.
---
 doc/org-manual.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 46498bd22..be60d99f6 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -12817,7 +12817,7 @@ following lines before the table in the Org file:
 #+cindex: @samp{ATTR_HTML}, keyword
 #+begin_example
 ,#+CAPTION: This is a table with lines around and between cells
-,#+ATTR_HTML: border="2" rules="all" frame="border"
+,#+ATTR_HTML: :border 2 :rules all :frame border
 #+end_example
 
 The HTML export back-end preserves column groupings in Org tables (see
-- 
2.25.4


-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler


Re: JS2 Syntax Highlighting for Source Blocks

2020-09-12 Thread Tim Cross


CRSHCMDR  writes:

> Is it possible to use js2-mode instead of js-mode for the syntax highlighting 
> of code blocks in org-mode? The reason that I ask is that the current js-mode 
> syntax highlighting leaves something to be desired, and is from my 
> perspective broken. For instance after declaring a variable, the usage of 
> that variable is no longer highlighted. You can see the difference here 
> https://imgur.com/a/4b2LyhE.
>
> I have tried using the ‘org-src-lang-modes, but I’m either not setting it 
> correctly, or I’m barking up the wrong tree.
>

What happens if you just use 'js2' as the language in the source block
header instead of javascript?


-- 
Tim Cross



Re: JS2 Syntax Highlighting for Source Blocks

2020-09-12 Thread CRSHCMDR
If I use js2 I lose all syntax highlighting, if I use js or javascript I get 
the same syntax highlighting.

Also sorry for the duplicate emails, that was not intentional.

Thanks,
Brandon
On Sep 12, 2020, 9:44 PM -0400, Tim Cross , wrote:
>
> CRSHCMDR  writes:
>
> > Is it possible to use js2-mode instead of js-mode for the syntax 
> > highlighting of code blocks in org-mode? The reason that I ask is that the 
> > current js-mode syntax highlighting leaves something to be desired, and is 
> > from my perspective broken. For instance after declaring a variable, the 
> > usage of that variable is no longer highlighted. You can see the difference 
> > here https://imgur.com/a/4b2LyhE.
> >
> > I have tried using the ‘org-src-lang-modes, but I’m either not setting it 
> > correctly, or I’m barking up the wrong tree.
> >
>
> What happens if you just use 'js2' as the language in the source block
> header instead of javascript?
>
>
> --
> Tim Cross


Getting Org-Crypt to work (doc bug?)

2020-09-12 Thread David Masterson
I'm trying to get org-crypt to work, but I'm missing something.
Following the Org-Crypt Info page, I've set it up for symmetric
encryption and added a :crypt: tag to a header.  When I try to save the
file, it reports that no key was specified, so it will do symmetric
encryption.  And then it freezes.  C-g will unfreeze, but the buffer is
slightly messed up like it started working on something, but waited for
an external command? GPG is installed.  What am I missing?

-- 
David Masterson



Re: Possible conflict with outline-magic

2020-09-12 Thread Ihor Radchenko
> But I'm not sure why this should work while the configuration that comes 
> with outline-magic interacts with org-capture.

org-mode is derived mode based on outline-mode. "Derived" in Emacs means
that outline-mode-hook also runs in org-mode.

org-capture-mode is derived mode based on org-mode. So, it runs
org-capture-mode-hook, org-mode-hook, and outline-mode-hook.

The first version of the code you used is not valid:

>> (use-package outline-magic
>> ...
>>   (require 'outline-cycle

There is no 'outline-cycle feature provided by outline-magic package.
Hence, when you run org-capture, it is trying to run outline-magic-hook
that runs (require 'outline-cycle), which does not exist. Hence, the
error you observed.

I believe that the code you used (and copied from Example section of
outline-magic package) is carried out from the times when outline-magic
was called outline-cycle. You might consider reporting this as a bug in
outline-magic github page.

Best,
Ihor



John Haman  writes:

> Well, I was able to fix my issue using the configuration on EmacsWiki
>
> (use-package outline-magic
>    :ensure t
>    :config
>    (eval-after-load 'outline
>      '(progn
>     (require 'outline-magic)
>     (define-key outline-minor-mode-map (kbd "") 
> 'outline-cycle
>
> But I'm not sure why this should work while the configuration that comes 
> with outline-magic interacts with org-capture.
>
> -John
>
> On 9/12/20 9:52 AM, John Haman wrote:
>> Hello, I would like to use the outline-magic package to cycle headings 
>> in outline-mode. I installed outline magic, and put the recommended 
>> configuration in my init file.
>>
>> (use-package outline-magic
>>   :ensure t
>>   :config
>>   (add-hook 'outline-mode-hook
>>     (lambda ()
>>   (require 'outline-cycle
>>
>> The package works great! I can easily cycle visibility of headings in 
>> outline-mode with TAB. No further configuration.
>>
>> After installing outline-magic, my org-capture stopped working. I have 
>> a very benign capture configuration.
>>
>> (use-package org-capture
>>   :after org
>>   :hook
>>   (org-capture-mode . evil-insert-state)
>>   :custom
>>   (org-capture-templates ...  ... ))
>>
>> When I call org-capture now, I get an error:
>>
>> Template key:
>> File mode specification error: (file-missing Cannot open load file No 
>> such file or directory outline-cycle)
>> org-capture: Capture abort: (file-missing Cannot open load file No 
>> such file or directory outline-cycle)
>>
>> How do I prevent this strange interaction between outline-magic and 
>> org-capture?
>>
>> What I tried:
>>
>> - Loading outline-magic after org-mode.
>>
>> - Deleting Elpa folder and reinstalling all packages.
>>
>> No luck so far.
>>
>> (Note: I cannot switch from outline-mode to markdown-mode because 
>> markdown-mode has fontificiation issues on the files I edit)
>>
>> Thanks all, any help here is greatly appreciated.
>>
>> John
>>



Bug: Typo in archive location example in manual [9.3.7 (release_9.3.7-807-gf1363d @ /home/yantar92/.emacs.d/straight/build/org/)]

2020-09-12 Thread Ihor Radchenko

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


Archive location example in 16.7 Summary of In-Buffer Settings section
of the manual is not valid. Patch attached.

Best,
Ihor

>From f1363d0b27494afcff4ab6a96d31d3e05c235f71 Mon Sep 17 00:00:00 2001
From: Ihor Radchenko 
Date: Sun, 13 Sep 2020 11:51:01 +0800
Subject: [PATCH] Fix example of in-buffer setting of archive location in
 manual

The provided example '%s_done' is not valid syntax for archive
location. Should be '%s_done::'.
---
 doc/org-manual.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 46498bd22..117e691e8 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -18854,7 +18854,7 @@ Closing and reopening the Org file in Emacs also activates the
 changes.
 
 #+attr_texinfo: :sep ,
-- =#+ARCHIVE: %s_done= ::
+- =#+ARCHIVE: %s_done::= ::
 
   #+cindex: @samp{ARCHIVE}, keyword
   #+vindex: org-archive-location
-- 
2.26.2



Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, 
cairo version 1.16.0)
 of 2020-08-15
Package: Org mode version 9.3.7 (release_9.3.7-807-gf1363d @ 
/home/yantar92/.emacs.d/straight/build/org/)


Re: Bug: Typo in archive location example in manual [9.3.7 (release_9.3.7-807-gf1363d @ /home/yantar92/.emacs.d/straight/build/org/)]

2020-09-12 Thread Kyle Meyer
Ihor Radchenko writes:

> Archive location example in 16.7 Summary of In-Buffer Settings section
> of the manual is not valid. Patch attached.

> Subject: [PATCH] Fix example of in-buffer setting of archive location in
>  manual
>
> The provided example '%s_done' is not valid syntax for archive
> location. Should be '%s_done::'.

Thanks for spotting that.  Applied in 8efec3d4c, adding a changelog
entry to the message.



Re: #+ATTR_HTML examples uses old syntax

2020-09-12 Thread Kyle Meyer
Nick Dokos writes:

> The attached patch fixes an example in the "Tables in HTML export"
> section of the manual that uses the old `border="3"' syntax instead
> of `:border 3' etc.

> Subject: [PATCH] Fix syntax of #+ATTR_HTML
>
> The example in the "Tables in HTML export" section of the manual
> uses the old syntax: `border="2"' etc.
>
> Change it to use `:border 2' etc.

Thanks.  Applied (b567445fc), adding a changelog entry to the message.



Re: how to remove automatically an intermediate odt-File

2020-09-12 Thread Kyle Meyer
Rainer Thiel writes:

> I have set org-odt-preferred-output-format to docx, which works fine.
> How can I have the intermediate odt-file removed automatically after
> the docx-file is created?

Here's one (lightly tested) option:

(advice-add :after #'org-odt-convert
(lambda (&optional in-file &rest _)
  (when in-file
(delete-file in-file)))
'((name . "org-odt-convert--delete-odt")))



Re: Bug: Typo in archive location example in manual [9.3.7 (release_9.3.7-807-gf1363d @ /home/yantar92/.emacs.d/straight/build/org/)]

2020-09-12 Thread Ihor Radchenko
> Thanks for spotting that.  Applied in 8efec3d4c, adding a changelog
> entry to the message.

Thanks!

By the way, do you know how to automatically format changelog entries in
magit. The suggestion from contribute page seems outdated (or I miss
something):

> If you are using magit.el in Emacs, the ChangeLog for such entries are
> easily produced by pressing C in the diff listing.

Best,
Ihor

Kyle Meyer  writes:

> Ihor Radchenko writes:
>
>> Archive location example in 16.7 Summary of In-Buffer Settings section
>> of the manual is not valid. Patch attached.
>
>> Subject: [PATCH] Fix example of in-buffer setting of archive location in
>>  manual
>>
>> The provided example '%s_done' is not valid syntax for archive
>> location. Should be '%s_done::'.
>
> Thanks for spotting that.  Applied in 8efec3d4c, adding a changelog
> entry to the message.