Re: [PATCH] ox-latex.el: `org-latex-language-alist' improved

2022-08-06 Thread Juan Manuel Macías
Ihor Radchenko writes:

> FYI, there is display-fill-column-indicator-mode, which is useful to
> guide the docstring in Elisp. Just need to set fill-column to 80.
>
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=e47bcb02133608e37bc4c532aec4d4723f8eeca8

Thanks a lot for the suggestion, Ihor. With this I also realize that 90%
of my functions have the first line of the docstring too long...

Best regards,

Juan Manuel 


--
--
--
Juan Manuel Macías

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com



Bug: Folding problem with markdown source block

2022-08-06 Thread Jack Kamm
Hello,

I found that Org entries containing markdown source blocks don't get
properly folded on the main development branch, when markdown-mode is
also loaded.

To reproduce:

1. Download markdown-mode from MELPA or Github. [1]
2. Fix the paths in the attached init.el.
3. emacs -Q -l init.el test.org
4. Shift-tab to collapse the visibility

Output should look like this:

* Headline 1...

But instead I observe this:

* Headline 1... ```
... ```
...

If markdown-mode isn't loaded, then the problem goes away. I think the
problem might have to do with the fontification that markdown-mode
applies to the back-quoted code block.

Versions:
GNU Emacs 28.1 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.17.6, 
Xaw3d scroll bars) of 2022-07-10
Org mode version 9.5.4 (release_9.5.4-717-g9cc60d @ 
/home/jack/dev/org-mode/lisp/)

[1] https://github.com/jrblevin/markdown-mode


(add-to-list 'load-path "~/.emacs.d/elpa/markdown-mode-20220708.6")
(require 'markdown-mode)

(add-to-list 'load-path "~/dev/org-mode/lisp")

* Headline 1
** Headline 1a

#+begin_src markdown
  Some source code:

  ```
  echo hello world
  ```

  A list:

  ,* Item 1
  ,* Item 2
#+end_src

** Headline 1b

Lorem ipsum.


how obtain automatic row numbers in a table starting after the second hline?

2022-08-06 Thread Uwe Brauer


Hi

I would like to obtain 
#+begin_src 

|  Nr |
|-|
| |
|-|
| 574 |
| 575 |
|  .. |
| 680 |
#+end_src

I tried 
#+begin_src 

| Nr |
||
|  1 |
||
|  1 |
|  2 |
#+TBLFM: $1=vlen(@II$1..0);EN
#+end_src

or
#+begin_src 

|  Nr |
|-|
| 573 |
|-|
| 574 |
| 575 |
#+TBLFM: $1=@#-1+572
#+end_src

None worked, any ideas?

thanks

Uwe Brauer 
-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 




org-latex preview on Windows

2022-08-06 Thread Jeremie Juste
Hello everyone,

I have had difficulties using  org-latex-preview to run properly on Windows.
The main issue seems to be that the user name on windows gets abbreviated
with ~. As far as I understand this generate problems as the temporary
folder cannot be found.

see for instance these posts
https://emacs.stackexchange.com/a/70119

and an old post from Vincente Vera
https://list.orgmode.org/CAMfbzvDPLS1eqXJ=7tzh1035z3vq4q4-yjmqsvbcgxzp8kd...@mail.gmail.com/

Vincente, suggests altering the temporary environment variable
(setenv "TEMP" "C:\Temp"). I have tried this option and place it in my
.init file but the Temporary file in org-mode uses does not change. 


As a work around I modified the function org-compile-file in lisp/org/
org-macs.el
by adding altering the source variable as such

 (let* ((source (replace-regexp-in-string "JEREMI~1" "JeremieJuste"
source))

This is obviously not an ideal solution but I cannot find any other
solution immediately. Have someone else come across the same issue on
Windows? Do you have any suggestions?

Best regards,
Jeremie
Org mode version 9.5.4
GNU Emacs 28.1 




Re: [PATCH v3] lisp/ob-plantuml.el: Insert results in buffer

2022-08-06 Thread Joseph Turner
You're very welcome! Thank you for your guidance. I learned quite a lot of 
Elisp during this process.

On August 6, 2022 1:24:46 AM PDT, Ihor Radchenko  wrote:
>Joseph Turner  writes:
>
>> When :results header arg is set to a value that doesn't include
>> "file", insert txt output in buffer below src block.
>>
>> TINYCHANGE
>> ---
>>  etc/ORG-NEWS|  7 +++
>>  lisp/ob-plantuml.el | 12 +---
>>  2 files changed, 16 insertions(+), 3 deletions(-)
>
>Thanks!
>Applied onto main via 9cc60dee4.
>https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=9cc60dee48851756dd95af46b37b7adc172952e2
>
>-- 
>Ihor Radchenko,
>Org mode contributor,
>Learn more about Org mode at https://orgmode.org/.
>Support Org development at https://liberapay.com/org-mode,
>or support my work at https://liberapay.com/yantar92


Re: [PATCH] org-contrib/babel/languages/ob-doc-plantuml.org: ASCII output

2022-08-06 Thread Ihor Radchenko
Joseph Turner  writes:

> Document the new functionality of ob-plantuml to insert ASCII diagrams
> directly in the buffer.

Thanks!

> -=PlantUML= requires a working [[https://www.java.com/en/download/][Java]] 
> installation and access to the
> -=plantuml.jar= component.  A working [[https://graphviz.org/][GraphViz]] 
> installation is required
> -for many diagrams.
> +=PlantUML= blocks can be executed in one of three ways, requiring either
> +
> +- a working [[https://www.java.com/en/download/][Java]] installation and 
> access to the =plantuml.jar= component or
> +- the =plantuml= executable available from your distribution's package 
> manager or
> +- a connection to a remote 
> [[https://github.com/plantuml/plantuml-server][PlantUML server]]

I do not think that ob-plantuml.el supports server connections. We may
need to clarify that server part and plantuml-* variables have nothing
to do with ob-plantuml per se.

Otherwise, the patch looks good.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Suggestion with footnotes when toggling headlines into plain lists

2022-08-06 Thread Ypo
When turning headlines into plain lists ~(org-ctrl-c-minus)~, I think 
footnotes should be moved to the bottom of the main headline.


Example; Original headlines:

* Main headline
** Headline 1
 [fn:1]

[fn:1] 
* Headline 2


~C-c -~ turns that into a list where footnotes definitions can't be 
found. It gives, for example, problems when exporting or when more 
footnotes are added:


* Main headline
- Headline 1
   [fn:1]

  [fn:1] 
- Headline 2


The desired outcome, could be something like this:

* Main headline
- Headline 1
   [fn:1]
- Headline 2
[fn:1] 




Re: [PATCH v3] lisp/ob-plantuml.el: Insert results in buffer

2022-08-06 Thread Ihor Radchenko
Joseph Turner  writes:

> When :results header arg is set to a value that doesn't include
> "file", insert txt output in buffer below src block.
>
> TINYCHANGE
> ---
>  etc/ORG-NEWS|  7 +++
>  lisp/ob-plantuml.el | 12 +---
>  2 files changed, 16 insertions(+), 3 deletions(-)

Thanks!
Applied onto main via 9cc60dee4.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=9cc60dee48851756dd95af46b37b7adc172952e2

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: [PATCH v2] lisp/ob-plantuml.el: Insert results in buffer

2022-08-06 Thread Ihor Radchenko
Joseph Turner  writes:

> Ihor Radchenko  writes:
>
>> Let's take this opportunity and fix another omission in ob-plantuml.
>> :results may generally contain Elisp sexps to be evaluated and the whole
>> split-string busyness is not accurate. Please use :result-params list
>> instead of :results.
>
> Good catch! I will submit a v3 patch. Is this still a TINYCHANGE or
> shall I do a copyright assignment?

WORG does not have the copyright requirement.
As long as your contribution to Org core does not exceed 15LOC, you are
good to go with TINYCHANGE. Of course, having copyright assignment will
be good to have if you plan to submit more patches.


-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: [External] : Re: missing a character / font in agenda?

2022-08-06 Thread Ihor Radchenko
Max Nikulin  writes:

> Another approach would be assuming reasonable set of modern fonts and 
> providing some defcustom to switch to legacy compatibility mode.

This whole thread is about a single defcustom already.
I do not see much point providing yet another defcustom on top.
`char-displayable-p' check should be good enough in most cases, except
some strange font mapping settings. In the latter cases, users can
always customize org-agenda-current-time-string manually.

Ideally, we need to find a more reliable alternative to
`char-displayable-p'.

Best,
Ihor

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: Odd characters in the fast tags selection interface

2022-08-06 Thread Ihor Radchenko
Hanno  writes:

>>> - after "a..z" runs out, '{', '|' and '}' are being used which seems
>>>   reasonable -- but after that, I get '\200' and similar before reaching
>>>   '©'...
>>
>>This is indeed true, but what can we do? There are only that many
>>characters in the keyboard. We may instead start using two-key
>>combinations for tags beyond #26, similar to org-capture. Patches are
>>welcome!
>
> Thanks for the fast reply and fully agreed! I would indeed argue that 
> automatically generated keys are not useful beyond a certain number (N=26?) 
> as they could change with new tags and thus are hard to memorize. And taking 
> in >N random choices every time is hardly "fast select" anymore.
>
> In fact, the docstring for =org-fast-tag-selection= says that only a-z would 
> be automatically assigned. That sounds reasonable to me (otherwise one can 
> define more keys via =org-tag-persistent-alist=). Maybe this is a bug after 
> all? If more than 26 choices are desired, maybe A-Z (i.e. capital letters) 
> could extend the list before more unusual characters?
>
> What do you think?
>
> I am not at my computer right now but could try to come up with a patch later.

I am not sure. Omitting (random) part of the tags sounds awkward - some
tags will be assigned keys and some not. I guess something that will
improve the current situation would be simply not printing chars beyond
a-z, while still listing all the tags - it will be less awkward compared
to current situation when a key is printed but cannot be used anyway.

Or we may provide "paging" approach that will re-assign a-z keys when
user presses C-n/C-p. Though I do not like this idea too much because we
have a more universal menu backend in works at
https://orgmode.org/list/87zgisvuu5.fsf@localhost Adding new feature to
tag menu does not feel like a good direction to go. If we decide to go
this way at the end, we may, at least, also need to update
org-fast-todo-selection along similar lines.

Finally, we may simply not list tags with keys beyond "z" at all only
indicating that there are more by showing some text at the end of the
menu.

>>> - when defining my own keys, they are not displayed in the top; instead
>>>   their characters are missing in the 'a'..'z' range leaving more room
>>>   for odd and very difficult-to-type characters
>>I think that it would make sense to have `org-tag-persistent-alist`
>>staff being shown on top. Unless there are objections I can merge this
>>trivial change.
>
> Thanks, that already improves the usability a lot!

Done on main via a0b21e3f1.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a0b21e3f1c131bc6ee6398e2d3dda20944d6b358

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: [PATCH] ox-latex.el: `org-latex-language-alist' improved

2022-08-06 Thread Ihor Radchenko
Juan Manuel Macías  writes:

> I am attaching a new fixed version of the patch. If everything is ok, I
> get down to work with the Manual and NEWS. I think it would be nice to
> add a few usage examples, and some links to the Babel and Polyglossia
> documentation.

Applied onto main via e47bcb021 with minor amendments: I fixed a typo
"polyglosia" and shortened the first line of a docstring to less than 80
chars.

FYI, there is display-fill-column-indicator-mode, which is useful to
guide the docstring in Elisp. Just need to set fill-column to 80.

https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=e47bcb02133608e37bc4c532aec4d4723f8eeca8

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: [PATCH] ol-info: Enable :insert-description feature

2022-08-06 Thread Ihor Radchenko
Max Nikulin  writes:

> To get impression of the new feature in action, I modified ol-info.el. 
> First patch does not depend on :insert-description and might be useful 
> per se. Second one just enables the feature.

Thanks! The patches look useful.
You should also add an entry to ORG-NEWS. Otherwise, I just have two
minor comments.

> +(defun org-info-description-as-command (link desc)
> +  "Info link description that can be pasted as command.
> +
> +For the folloing LINK

  ^following

> +
> +\"info:elisp::Non-ASCII in Strings\"
> +
> +the result is
> +
> +info \"(elisp) Non-ASCII in Strings\"
> +
> +that may be executed as a shell command or evaluated by
> +\\[eval-expression] (wrapped with parenthesis) to read the manual
> +in Emacs.
> +
> +Calling convention is similar to `org-link-make-description-function'.
> +DESC has higher priority and returned when it is not nil.
> +If LINK is not an info link then DESC is returned."
> +  (or (org-string-nw-p desc)
> +  (let* ((file-node (org-info-link-file-node link))
> + (file (car file-node))
> + (node (cadr file-node)))

pcase-let would be shorter here.


-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: [PATCH v9] ol.el: add description format parameter to org-link-parameters

2022-08-06 Thread Ihor Radchenko
Hugo Heagren  writes:

> Hugo
> From 039c2131462f5454f2804e809e085a055b5bf552 Mon Sep 17 00:00:00 2001
> From: Hugo Heagren 
> Date: Mon, 28 Mar 2022 23:18:45 +0100
> Subject: [PATCH 1/2] ol.el: add description format parameter to
>  org-link-parameters
> ...
> From 708916f8d4f31af1e786e87154b5a4479d0ed1b8 Mon Sep 17 00:00:00 2001
> From: Hugo Heagren 
> Date: Sat, 16 Jul 2022 19:50:15 +0100
> Subject: [PATCH 2/2] test-ol: tests for insert-description param when
>  inserting links

I have addressed the further comments (mine and Max's) myself after applying 
your patch.
Applied onto main via 2bbb92a72 and e3a05d09b.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=e3a05d09b7398b46e8ef724ae7609eeb8a35346e
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=2bbb92a72d4a1be8e56acd41a9c94f5f0023fb28

You are now officially a contributor ;) 

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92