Re: [PATCH 1/2] lisp/org-clock.el: Make switching states on clock-in/-out easier

2022-10-30 Thread Ihor Radchenko
"Samuel W. Flint"  writes:

> * lisp/org-clock.el (org-clock-in-next-state,
> org-clock-out-next-state): Define and document customizeable variables
> to describe the "next state" on clock-in/-out.
>
> (org-clock-in-switch-to-state, org-clock-out-switch-to-state): Add
> options to use the `org-clock-{in,out}-next-state' variables to change
> on clock-in/-out.
>
> (org-clock-in-next-state-function, org-clock-out-next-state-function):
> Define functions which can be used to select the next TODO state on
> clock-in/-out.
> ---
>  lisp/org-clock.el | 48 +--
>  1 file changed, 46 insertions(+), 2 deletions(-)

Cancelled
See new version of the patch in 
https://list.orgmode.org/orgmode/87eduud4ap@flintfam.org/

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org table proposal: merge and split cells in org-tables

2022-10-30 Thread Jean Louis
* Ihor Radchenko  [2022-10-30 12:27]:
> Jean Louis  writes:
> 
> > To solve that problem personally, I use Asciidoctor, see how it is
> > done there:
> >
> > Example 76. Table with formatted, aligned and merged cells:
> > https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/#ex-cell-format
> 
> I am sorry, but this looks unreadable. I would avoid re-using such
> syntax ideas.

You have got an extreme reference on what can be done. Other people
and other projects have faced same issues as you are facing in Org
mode, and have resolved it. To understand anything one cannot just
read simple reference, but better understand the surrounding meanings,
the context.

Org tables are nothing harder or simpler than tables in other
lightweight markup languages.

What appears "unreadable" to you is readable to other
person. In fact, there is no single char in the extreme example of
Asciidoc table below that you can't read. The meaning of
"unreadable" is most probably "not understandable". That is why I
said, one has to inspect the context and look for definitions.

[cols="e,m,^,>s",width="25%"]
|===
|1 >s|2 |3 |4
^|5 2.2+^.^|6 .3+<.>m|7
^|8
|9 2+>|10nnp
|===

In fact, looking into functionality of other lightweigh markup
languages may only be helpful for Org development.

For [cols="e,m,^p,>s",width="25%"] look here:
https://docs.asciidoctor.org/asciidoc/latest/tables/format-column-content/

Thus `e' before first comma, means emphasized (I guess) and in fact on
the original demonstration one can see that first column is
emphasized. 

The fact that one may "describe" column's font style in Asciidoc(tor)  could
be adopted as well in Org mode.

`m' after first comma says that text of that column shall be in
monospaced font, which I find very useful for table columns.

`^' signifies centered column in `[cols="e,m,^,>s",width="25%"]'

and `>s' means right centered, bold column;

`width=25%' tells about table width.

I would like it if Org mode could provide such functionality for
tables, to specify various attributes for columns. It does provide,
though I am not sure if it can provide so many.

And in that extreme example then we have following lines:

|===
for begin of the table

|1 >s|2 |3 |4
the second `|' has attribute `>s' or complete `>s|' which specifically
formats number "2" to be bold and right centered. 

^|5 2.2+^.^|6 .3+<.>m|7

It is good to read about span factor:
https://docs.asciidoctor.org/asciidoc/latest/tables/span-cells/

2.2+^.^|6 -- talks about spanning 2 columns, two rows and its alignment.

while .3+<.>m|7 talks about spanning 3 rows, that is where number 7 comes.

|===
for end of the table

It is surely good to try to make visual tables with merged cells as
general Org functionality. 

It is also very useful to look how other people implement various
functionalities and try to see if such could be useful in Org as well.

But when you don't have the functionality yet, due to the Babel and
inclusion of other files, one may achieve the final result by
including HTML directly, or by using external tools.

Org is integrator of almost anything. Babel and integration of, to the
Org external tools, allows user to include almost any value or results
from outside the file.

I do agree that it is "hard" to understand at once what it is, but it
is a solution for reason that Org allows external tools' values to be
included in the Org file. In this case it is the HTML output from
Asciidoctor. 

This elaboration is for opening the mind of Org user, it is to
understand that extensibility, due to Babel and inclusion of any
external tools has no limits at any point of time.

One need not wait for that feature X to be implemented in Org, while
there is plenty of available options to reach the purpose of feature
X.

#+BEGIN_SRC shell :results raw
echo "
[cols=\"e,m,^,>s\",width=\"25%\"]
|===
|1 >s|2 |3 |4
^|5 2.2+^.^|6 .3+<.>m|7
^|8
|9 2+>|10nnp
|===
" | asciidoctor -e -o - -

#+END_SRC

#+RESULTS:









1
2
3
4


5
6
7


8


9
10nnp




-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Re: [PATCH] lisp/org-capture.el: Add hook & hook options to org-capture

2022-10-30 Thread Ihor Radchenko
Valentin Herrmann  writes:

> * lisp/org-capture.el:
> (org-capture-templates): Document the new template options.
> (org-capture-before-view-hook): Add new hook for parity with the
> template options.
> (org-capture): Implement the new template options.
> (org-capture-finalize): Implement the new template options.
> (org-capture-kill): Remove unneeded line.
> * doc/org-manual.org (Template elements): Document the new template options
>
> This change comes from my personal config, where I use e.g. the option
> `:before-finalize-hook' to capture an task automatically, whenever I
> capture using a certain template.

An equivalent patch has been applied in
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7f3a6cf6e72fe9968c6ef32211c754b7fe0172b6

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] lisp/org-capture.el: Add hook & hook options to org-capture

2022-10-30 Thread Ihor Radchenko
Valentin Herrmann  writes:

> * lisp/org-capture.el:
> (org-capture-templates): Document the new template options.
> (org-capture-before-view-hook): Add new hook for parity with the
> template options.
> (org-capture): Implement the new template options.
> (org-capture-finalize): Implement the new template options.
> (org-capture-kill): Remove unneeded line.
> * doc/org-manual.org (Template elements): Document the new template options

An equivalent patch has been applied in
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7f3a6cf6e72fe9968c6ef32211c754b7fe0172b6

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: One thing each 3 days but maximum 10

2022-10-30 Thread Ihor Radchenko
Jean Louis  writes:

> * Renato Pontefice  [2022-10-30 19:11]:
>> I have to take a pill each 3 days, but for max 10 times.
>> So I set a TODO pill >2022-10-28 +3d> and each 3 days my calendar tell me 
>> that I have to take the pill. But is possible to say 1/10; 2/10; 3/10 etc?
>> I nean to show how many pill I have already take?
>
> Use PostgreSQL to give you schedule:
>
> #+BEGIN_SRC sql :engine postgresql :results value raw 
> SELECT '** TODO Take pill again
>   SCHEDULED: <' || generate_series('2022-10-28', '2022-11-26', '3 
> day'::interval)::date || E'>\n' 
>   AS "* My treatement";
> #+END_SRC
>
> #+RESULTS:
> * My treatement
> ** TODO Take pill again
>   SCHEDULED: <2022-10-28>
>
> ** TODO Take pill again
>   SCHEDULED: <2022-10-31>

This is not a good idea for pills.
Without SQL, one could also use org-clone-subtree-with-time-shift, but
AFAIK, the whole idea behind schedule of taking pills is to retain
certain concentration of medicine in the blood flow. Hence .+3d repeater
(3d from the last time taking the pill) is more suitable.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: One thing each 3 days but maximum 10

2022-10-30 Thread Jean Louis
* Renato Pontefice  [2022-10-30 19:11]:
> I have to take a pill each 3 days, but for max 10 times.
> So I set a TODO pill >2022-10-28 +3d> and each 3 days my calendar tell me 
> that I have to take the pill. But is possible to say 1/10; 2/10; 3/10 etc?
> I nean to show how many pill I have already take?

Use PostgreSQL to give you schedule:

#+BEGIN_SRC sql :engine postgresql :results value raw 
SELECT '** TODO Take pill again
  SCHEDULED: <' || generate_series('2022-10-28', '2022-11-26', '3 
day'::interval)::date || E'>\n' 
  AS "* My treatement";
#+END_SRC

#+RESULTS:
* My treatement
** TODO Take pill again
  SCHEDULED: <2022-10-28>

** TODO Take pill again
  SCHEDULED: <2022-10-31>

** TODO Take pill again
  SCHEDULED: <2022-11-03>

** TODO Take pill again
  SCHEDULED: <2022-11-06>

** TODO Take pill again
  SCHEDULED: <2022-11-09>

** TODO Take pill again
  SCHEDULED: <2022-11-12>

** TODO Take pill again
  SCHEDULED: <2022-11-15>

** TODO Take pill again
  SCHEDULED: <2022-11-18>

** TODO Take pill again
  SCHEDULED: <2022-11-21>

** TODO Take pill again
  SCHEDULED: <2022-11-24>

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Re: One thing each 3 days but maximum 10

2022-10-30 Thread Ihor Radchenko
Renato Pontefice  writes:

> I have to take a pill each 3 days, but for max 10 times.
> So I set a TODO pill >2022-10-28 +3d> and each 3 days my calendar tell me 
> that I have to take the pill. But is possible to say 1/10; 2/10; 3/10 etc?
> I nean to show how many pill I have already take?

Try

* TODO take pills [3/10]
SCHEDULED: <2022-10-31 Mon .+3d>
- [X] take 1
- [X] take 2
- [X] take 3
- [ ] take 4
- [ ] take 5
- [ ] take 6
- [ ] take 7
- [ ] take 8
- [ ] take 9
- [ ] take 10

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Things marked to happen on Sunday does not appear on calendar

2022-10-30 Thread Ihor Radchenko
Renato Pontefice  writes:

> I have this .org:
> That if I press C-a a to show the agenda, I see that
>
> I mean, nothing oh Sunday where do I should have prova.
> I’m wondering why. I notice that on Sunday does not appear nothing. Is this 
> some setting? And where do I change it?

What is the value of your org-agenda-files?
See https://orgmode.org/manual/Agenda-Files.html

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-30 Thread Timothy
Hi Ihor,

> #+name: setup
> #+begin_src bash
>
> cd /path/to/tests
> #+end_src
>
> #+begin_src bash :noweb strip-tangle
> 
> make test1
> #+end_src
>
> #+begin_src bash :noweb strip-tangle
> 
> make test2
> #+end_src
>
> Then, one can interactively run individual tests from Org and then
> tangle the whole file into batch test script.

Ah, this makes sense to me now. Thanks for the example!

All the best,
Timothy

-- 
Timothy (‘tecosaur’/‘TEC’), Org mode contributor.
Learn more about Org mode at .
Support Org development at ,
or support my work at .


Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-30 Thread Ihor Radchenko
Timothy  writes:

> Hi Daniel,
>
>> Add a “strip-tangle” noweb option to strip the noweb tags when tangling, but
>> keep and expand them otherwise.
>
> I must admit I can’t see the point of this — would you mind providing an
> example of when this would be useful?

#+name: setup
#+begin_src bash
cd /path/to/tests
#+end_src

#+begin_src bash :noweb strip-tangle
<>
make test1
#+end_src

#+begin_src bash :noweb strip-tangle
<>
make test2
#+end_src

Then, one can interactively run individual tests from Org and then
tangle the whole file into batch test script.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Org babel API (was: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions))

2022-10-30 Thread Ihor Radchenko
Tim Cross  writes:

>>> The 2 big questions I see are "What should be defaults be?" and "How do
>>> we handle the options without adding lots of new switches or suffering
>>> an option permutation blow out?".
>>
>> I am sorry, but I do not fully understand what you are talking about.
>> Which defaults are you referring to?
>
> In general, all the defaults for babel blocks, but morfe specifically
> here, deffault handling for stderr.

stdout is the current default. And I'd say that it is expected default.
Sorry, I still do not understand the concrete problem you are trying to
highlight.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Setting org-todo-keywords through directory-local variables

2022-10-30 Thread Ihor Radchenko
Kévin Le Gouguec  writes:

>> Maybe the hook approach can work better. But I'd prefer to discuss all
>> the possible caveats first.
>
> My reasoning for keeping the current initialization code untouched and
> _re_computing stuff in hack-local-variables-hook hinged on…

I would avoid re-computing staff. Some variables define Org parser setup
and re-computing is expensive when we need to reset the parser state. In
particular, it will make parser cache persistence useless.

> This patch might have been my first foray into Org's init code, so it
> felt too risky to go with any approach other than "keep the
> implementation for the established features _exactly_ _as_ _now_; stuff
> all the experimental stuff in hack-local-variables-hook".

I'd say that it is too early to consider local variable hooks.
Especially given that Emacs devs just suggested a better approach and
discouraged using hack-local-variables-hook. See
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57003#108

What we can do wrt this patch is extract the part that marks some
variables as :safe. It will be a useful addition in any case.

For handling local variables, let's wait for the discussion with Emacs
devs to resolve.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Change default value of org-clock-x11-idle-program-name (was: org-x11idle-exists-p with emacs --daemon)

2022-10-30 Thread Ihor Radchenko
Max Nikulin  writes:

> x11idle as `org-clock-x11idle-program-name' default is questionable as 
> well. Debian, Arch, Gentoo have xprintidle packages and this tool have 
> some additional code.

AFAIU, x11idle was a very old hard-coded default. Later, this variable
had been introduced without changing the default.

What we can do is check if xprintidle executable is available and use
it. Otherwise, fall back to x11idle to retain backwards compatibility on
systems that do no have xprintidle installed.

WDYT?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org-x11idle-exists-p with emacs --daemon

2022-10-30 Thread Ihor Radchenko
Max Nikulin  writes:

> Ihor, what I do not like in your patch is that an external process is 
> unconditionally executed during load time. Earlier there was a (failed) 
> attempt to limit it to X11.
>
> - Unsure if Windows builds of Emacs may connect to X servers.
> - MacOS does not use x11idle, it calls ioreg and perl instead.

We can test `sytem-type' to be in '(gnu gnu/linux gnu/kfreebsd).

> In above cases, there might be a point to execute x11idle if a user is 
> running remote Emacs session on a Windows or a MacOS machine (e.g. 
> through ssh) from local X server. Unsure if somebody has ever tried it. 
> The reason to try x11idle should be a test if current frame is 
> associated with X.

This is a trade-off. If we want to consider individual frames running on
remote X server, `org-user-idle-seconds' will need to check the command
availability on every call. That is - we will try to run shell command
every 60 seconds (`org-resolve-clocks-if-idle''s default timer). I'd say
that it is not a good idea considering how rare such situation is.

> A side note. I am aware that the following comment existed before your 
> commit.
>>   (and (eq 0 (call-process-shell-command
>>   (format "command -v %s" org-clock-x11idle-program-name)))
>>;; Check that x11idle can retrieve the idle time
>>;; FIXME: Why "..-shell-command" rather than just `call-process'?
>>(eq 0 (call-process-shell-command org-clock-x11idle-program-name
>
> `call-process' can not be used here because "command" is a shell 
> built-in, not a real executable. I have another question. Why 
> `locate-file' is not used instead?
>
>  (locate-file command exec-path exec-suffixes 1))
>
> https://emacs.stackexchange.com/questions/332/how-can-i-find-the-path-to-an-executable-with-emacs-lisp

Not idea. Maybe even `executable-find'?

> On 30/10/2022 08:33, Ihor Radchenko wrote:
>> Max Nikulin writes:
>> 
>>> In server.el I found
>>>
>>>   (frame-parameter frame 'display)
> ..
>> 
>> I do not understand.
>
> echo "$DISPLAY"
> :0
> emacs -Q --daemon
> emacsclient -nw
>
> window-system
> nil
> (frame-parameter nil 'display)
> ":0"
> (call-process "xterm")
>
> So formally a tty frame has access to X11 server.

Can we reliably distinguish between X and Wayland this way?

> My summary:
> - To be really flexible (e.g. to support Wayland) 
> `org-user-idle-seconds' should have an extension point allowing to 
> specify elisp function.

Could you prepare a patch?

> - x11idle availability should be checked when X connection is detected, 
> not at startup time and perhaps `locate-file' is better than "command" 
> shell built-in.

Again, patches welcome.
It will be a marginal improvement.

> - (frame-parameter nil 'display) might be more accurate in addition to 
> `window-system' check.

Do you mean (or ..)?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Org babel API (was: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions))

2022-10-30 Thread Tim Cross


Ihor Radchenko  writes:

> Tim Cross  writes:
>
>> For me, this is another symptom of our need to define a clearer model
>> for babel processes so that we can get some consistency across the
>> board. Such a model would likely also make it easier for people to
>> develop new babel back ends. We may even need 2 models, one for
>> interactive/repl based back ends and one for non-interactive/scripted
>> back ends. 
>
> We do have two models already.
> We have some small bits documented in
> https://orgmode.org/worg/org-contrib/babel/languages/index.html
>
> Generally, the defaults are implemented in ob-core.el.
> Session API is in ob-comint.el. Shell command API is in ob-eval.el.
>
>> The 2 big questions I see are "What should be defaults be?" and "How do
>> we handle the options without adding lots of new switches or suffering
>> an option permutation blow out?".
>
> I am sorry, but I do not fully understand what you are talking about.
> Which defaults are you referring to?

In general, all the defaults for babel blocks, but morfe specifically
here, deffault handling for stderr.



Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-10-30 Thread Tim Cross


Ihor Radchenko  writes:

> Tim Cross  writes:
>
>> What probably needs clarifying is
>>
>> 1. mention the string option in the manual
>
> It is documented in the manual: 13.9.4 HTML preamble and postamble
>

You snipped out the relevant paragraph I copied from the manual. If you
look at it, you will see that it does not mention string as an option
for org-html-postamble. Furthermore, the previous paragraph, which talks
about org-html-preamble, which does mention string, states that if the
string matches the name of a function, it will be called 9and expected
to return a string). This is not mentioned at all in the doc string for
org-html-postamble.

Therefore, I still think there is inconsistency between what the doc
string of the variable states and what the manual states. There is no
mention of function matching against strings in the cod string of the
variable. There is no mention of string as an option in the paragraph
referring to org-html-postamble in the manual. 


>> 2. If spaces are not allowed in the string, clearly document
>> that. Currently, the doc string just says that if set to a string, use
>> that string as the postamble, which I think implies spaces are OK. 
>
> They are allowed. It is just #+OPTIONS keyword that does not allow
> strings as values. I have no idea why.

This is all an aside to the actual bug, so please don't miss that
(unless it has been fixed) i.e. a org-html-postamble string with a space
in it does not work.




Re: Auto detect ob-clojure backend (was: [PATCH] Fix ob-clojure handling source block variable's value is a org-mode table or list)

2022-10-30 Thread Christopher M. Miles

Daniel Kraus  writes:

> Ihor Radchenko  writes:
>
>> Daniel Kraus  writes:
>>
>>> +(defcustom org-babel-clojure-backend (cond
>>> +  ((executable-find "bb") 'babashka)
>>> +  ((executable-find "nbb") 'nbb)
>>> +  ((featurep 'cider) 'cider)
>>> +  ((featurep 'inf-clojure) 
>>> 'inf-clojure)
>>> +  ((featurep 'slime) 'slime)
>>> + (t nil))
>>
>> What if users have, say, cider installed and also babashka executable?
>> Will it be expected to use babashka?
>
> Yes. The only thing that makes me slightly hesitant is that e.g.
> someone doesn't have `bb` installed. Executes clojure source blocks
> which are then evaluated in, let's say cider.
> Then they install `bb` and the next time they start Emacs, the same
> source block on re-evaluation would be executed with babashka.
>
> I think this is still the best out of the box experience as it
> "just works" for most users without having to customise something
> and if they want it fixed, they can pin it to a certain backend.
>
> What's your opinion?
>
> Cheers,
>   Daniel

I vote for use Clojure CLI like bb as default backend. Keeping defcustom
option for user to setting default backend is fine.

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


Re: org-sbe recent changes?

2022-10-30 Thread Ihor Radchenko
alan.schm...@polytechnique.org writes:

> Basically I define a function like this (I added the message part for 
> debugging):
> ...
> #+name: call_ledger
> ...
> Then I call it in a table that looks like this (removing a lot of stuff
> for privacy reasons):
>
> | Bucket | Planned | Remaining |
> |+-+---+
> | Achat Maison   |1000 | #ERROR|
> |+-+---+
> | Total  |1000 | #ERROR|
> #+TBLFM: @2$3..@>>$3='(org-sbe call_ledger (bucket $$1) (prefix 
> "\"Bucket:Expenses:\""))

May you simplify your example to demonstrate the problem reproducibly
(not only on your system with your files)?
See https://orgmode.org/manual/Feedback.html#Feedback

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-10-30 Thread Ihor Radchenko
Tim Cross  writes:

> What probably needs clarifying is
>
> 1. mention the string option in the manual

It is documented in the manual: 13.9.4 HTML preamble and postamble

> 2. If spaces are not allowed in the string, clearly document
> that. Currently, the doc string just says that if set to a string, use
> that string as the postamble, which I think implies spaces are OK. 

They are allowed. It is just #+OPTIONS keyword that does not allow
strings as values. I have no idea why.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Org babel API (was: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions))

2022-10-30 Thread Ihor Radchenko
Tim Cross  writes:

> For me, this is another symptom of our need to define a clearer model
> for babel processes so that we can get some consistency across the
> board. Such a model would likely also make it easier for people to
> develop new babel back ends. We may even need 2 models, one for
> interactive/repl based back ends and one for non-interactive/scripted
> back ends. 

We do have two models already.
We have some small bits documented in
https://orgmode.org/worg/org-contrib/babel/languages/index.html

Generally, the defaults are implemented in ob-core.el.
Session API is in ob-comint.el. Shell command API is in ob-eval.el.

> The 2 big questions I see are "What should be defaults be?" and "How do
> we handle the options without adding lots of new switches or suffering
> an option permutation blow out?".

I am sorry, but I do not fully understand what you are talking about.
Which defaults are you referring to?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Bug: html-postamble string does not allow space [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/27.2/lisp/org/)]

2022-10-30 Thread Tim Cross


Ihor Radchenko  writes:

> Tim Cross  writes:
>
>> Confirm.
>>
>> I am able to reproduce this issue with 
>
> I might be missing something, but does
> `org-export--parse-option-keyword' even support spaces inside values?
>
>> I also feel the manual page could be improved as it doesn't actually
>> mention setting the html-postamble to a string (that is only mentioned
>> in the variable docstring).
>
> The manual does even mention the "html-postamble" option. Just the
> variable. I am confused. Was it removed at some point? (I do not see any
> commits doing so)

Sorry for late response. Only just noticed this amongst all the items in
my org mailbox.

It was a while ago. I do recall I was able to reproduce the issue, so
there was a bug here. Either it is a code bug or a documentation bug.

My error was in omitting the leading org- for the variable name. Correct
name is org-html-postamble. Apologies. 

With regards to the documentation, the section in the manual is

   The default value for ‘org-html-postamble’ is ‘auto’, which makes the
HTML exporter build a postamble from looking up author’s name, email
address, creator’s name, and date.  Set ‘org-html-postamble’ to ‘t’ to
insert the postamble in the format specified in the
‘org-html-postamble-format’ variable.  The HTML exporter does not insert
a postamble if ‘org-html-postamble’ is set to ‘nil’.

Note no mention of string, although the previous paragraph talking about
org-html-preamble does mention string.

and the doc string for the variable is

Non-nil means insert a postamble in HTML export.

When set to ‘auto’, check against the
‘org-export-with-author/email/creator/date’ variables to set the
content of the postamble.  When set to a string, use this string
as the postamble.  When t, insert a string as defined by the
formatting string in ‘org-html-postamble-format’.

When set to a function, apply this function and insert the
returned string.  The function takes the property list of export
options as its only argument.

Setting :html-postamble in publishing projects will take
precedence over this variable.

What probably needs clarifying is

1. mention the string option in the manual

2. If spaces are not allowed in the string, clearly document
that. Currently, the doc string just says that if set to a string, use
that string as the postamble, which I think implies spaces are OK. 




Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)

2022-10-30 Thread Tim Cross


Ihor Radchenko  writes:

> Rudolf Adamkovič  writes:
>
>> Ihor Radchenko  writes:
>>
>>> I do not think that it make sense to display that buffer when the code
>>> finishes successfully. I can see this kind of behaviour
>>> breaking/spamming automated scripts or export---code working in the
>>> past may throw error output into unsuspecting users.
>>
>> But the exit code has nothing to do with the standard error.
>>
>> Unix programs can, and often do, halt with non-zero exit codes while
>> producing error output containing important information, such as
>> deprecation warnings.  Further, many programs use error output as the
>> alternative "anything but the result" stream.
>>
>> Preserving user data, instead of trashing it, data does not count as
>> "spamming ... unsuspected users".  On the contrary!
>>
>> For example, I use a program for work that uploads data to a certain
>> 3rd-party server.  It exits with a zero code but also shows extremely
>> important notices on error output.  As an "unsuspecting user", if I used
>> Babel to run the program, I would end up in a trouble.
>>
>> So, we should never implicitly trash user-generated data, let alone
>> based on a "completely made up" belief that a non-zero exit code somehow
>> implies "no important error output".  It does not.
>>
>> (I speak only about Unix-like systems here.  Perhaps on other operating
>> systems, things work differently.)
>
> Dear All,
>
> As explained in the above quote, it may be reasonable to display stderr
> in the shell (and possibly other) src blocks upon execution.
>
> + Stderr may contain important information even if the code block
>   succeeds
> - Displaying stderr will raise *Error* buffer, which may or may not be
>   expected or desired.
>
> What do you think?

I think this is perhaps the tip of a more complex iceberg. Not sure if
we can address bits individually. Suspect we are better off
clarifying the basic babel model and then look at specific language
exceptions/limits and adjusting the model or documenting where back ends
need to diverge from the basic model.

Part of the challenge here is that the relevance/importance of stderr is
somewhat dependent on the language. Same holds true for handling of
error/return codes and to 'results' output.

For me, this is another symptom of our need to define a clearer model
for babel processes so that we can get some consistency across the
board. Such a model would likely also make it easier for people to
develop new babel back ends. We may even need 2 models, one for
interactive/repl based back ends and one for non-interactive/scripted
back ends. 

The 2 big questions I see are "What should be defaults be?" and "How do
we handle the options without adding lots of new switches or suffering
an option permutation blow out?".

I do agree with the other posts regarding the importance of stderr.



Re: [correction]

2022-10-30 Thread Uwe Brauer
>>> "JMM" == Juan Manuel Macías  writes:

> Uwe Brauer writes:
>> But not not -- which is the 
>> (setq filetags-delimiter-between-filename-and-tags " -- ") 
>> 
>> orginal setting, hm, not sure why this is so

> I think locate can't look for things like " -- "; Also, it's too
> generic. It is safer to use alphanumeric characters. For example, if you
> prefer something shorter, you can do:

> (setq filetags-delimiter-between-filename-and-tags " @@ ")

I see, thanks. Last most likely trivial question, where, in which file
does filetags save the relevant information, i.e tags

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: Auto detect ob-clojure backend (was: [PATCH] Fix ob-clojure handling source block variable's value is a org-mode table or list)

2022-10-30 Thread Daniel Kraus


Tim Cross  writes:

> I think bb is a much better solution from a babel perspective and would
> love to see it as the default, even when you have both bb and cider
> installed.

I just installed the patch. So if you have `bb` in your path, ob-clojure
should use babashka as default and only fall back to cider when it's not.

Currently it looks for bb, and then next `nbb` before cider.
Now I realise that nbb shouldn't even be in that list at all but instead
should be the default for `org-babel-execute:clojurescript`.

> I stopped using clojure in org because it was way too fragile -
> depending heavily on cider features which often changed. However, now we
> have babashka and nbb, I'm thinking about using org again with
> clojure.

Happy to hear feedback if you have any :)

> I recall looking at the babel code for clojure some time back to see if
> it could be made simpler and more reliable. However, there wasn't much
> that could be improved on given the design of cider and its focus on
> interactive clojure development.

I agree, cider is a pretty heavy library.
And I feel that if you have already "jacked in" in cider, you simply
eval straight from you clj(s) code instead of using org babel.
(Maybe in combination with clerk or something if you want it more literal)

> I then thought using something like the
> Clojure CLI tools might be the way to go.

I think I'll add a backend for the Clojure CLI tools.
Should be similar simple as bb and nbb with slower startup time,
but you would get a JVM Clojure for it.

> Now I feel that babashka for clojure and nbb for clojurescript
> might be the right answer.

Agree. bb default for Clojure and nbb for ClojureScript.

Thanks,
  Daniel



Re: Auto detect ob-clojure backend (was: [PATCH] Fix ob-clojure handling source block variable's value is a org-mode table or list)

2022-10-30 Thread Tim Cross


Daniel Kraus  writes:

> Ihor Radchenko  writes:
>
>> Daniel Kraus  writes:
>>
>>> +(defcustom org-babel-clojure-backend (cond
>>> +  ((executable-find "bb") 'babashka)
>>> +  ((executable-find "nbb") 'nbb)
>>> +  ((featurep 'cider) 'cider)
>>> +  ((featurep 'inf-clojure) 
>>> 'inf-clojure)
>>> +  ((featurep 'slime) 'slime)
>>> + (t nil))
>>
>> What if users have, say, cider installed and also babashka executable?
>> Will it be expected to use babashka?
>
> Yes. The only thing that makes me slightly hesitant is that e.g.
> someone doesn't have `bb` installed. Executes clojure source blocks
> which are then evaluated in, let's say cider.
> Then they install `bb` and the next time they start Emacs, the same
> source block on re-evaluation would be executed with babashka.
>
> I think this is still the best out of the box experience as it
> "just works" for most users without having to customise something
> and if they want it fixed, they can pin it to a certain backend.
>
> What's your opinion?
>
> Cheers,
>   Daniel

Just chime in with my 2 cents.

I think bb is a much better solution from a babel perspective and would
love to see it as the default, even when you have both bb and cider
installed.

I stopped using clojure in org because it was way too fragile -
depending heavily on cider features which often changed. However, now we
have babashka and nbb, I'm thinking about using org again with clojure.

I recall looking at the babel code for clojure some time back to see if
it could be made simpler and more reliable. However, there wasn't much
that could be improved on given the design of cider and its focus on
interactive clojure development. I then thought using something like the
Clojure CLI tools might be the way to go. Now I feel that babashka for
clojure and nbb for clojurescript might be the right answer. 



Re: [correction]

2022-10-30 Thread Juan Manuel Macías
Uwe Brauer writes:

> But not not -- which is the 
> (setq filetags-delimiter-between-filename-and-tags " -- ") 
>
> orginal setting, hm, not sure why this is so

I think locate can't look for things like " -- "; Also, it's too
generic. It is safer to use alphanumeric characters. For example, if you
prefer something shorter, you can do:

(setq filetags-delimiter-between-filename-and-tags " @@ ")

That should be found by locate.

Regarding the updatedb issue, it seems that in Ubuntu you have to do it
manually. You would have to edit the crontab file. See:

https://askubuntu.com/questions/203597/how-do-i-run-updatedb-everyday

Best regards,

Juan Manuel 



Re: org-sbe recent changes?

2022-10-30 Thread Alan Schmitt
If it matters, everything works with org version 9.5.5, but it break
with org 9.6.

Alan


signature.asc
Description: PGP signature


[correction] (was: org-fstree.el overview over directories (but no comments are possible))

2022-10-30 Thread Uwe Brauer






> Ah, well I have installed locate (mlocate to be precise, I am using
> Ubuntu)

> And I have used locate in the past, nevertheless

>  helm-locate keeps failing and giving me the screenshot I attached in my
>  earlier message, so some sort of bug in helm-locate for Ubuntu?

I tried it again, 

Maybe the fact that run sudo updatedb
made the difference, it seems that the update is not done automatically.

Be it as it may

 helm-locate finds %ftag_

But not not -- which is the 
(setq filetags-delimiter-between-filename-and-tags " -- ") 

orginal setting, hm, not sure why this is so


-- 
Warning: Content may be disturbing to some audiences
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. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: org-fstree.el overview over directories (but no comments are possible)

2022-10-30 Thread Uwe Brauer
>>> "JMM" == Juan Manuel Macías  writes:

> Uwe Brauer writes:
>> I have a file called bio-hoja4%ftag_EDO Uwe.pdf
>> 
>> I use helm-locate and type %ftag_
>> but I receive nothing found see the screenshot.
>> 
>> 
>> helm-min  
>> 
>> And typing %ftag  also does not work,
>> 
>> What do I miss?

> Ah, sorry, I thought you used helm-locate before. helm-locate depends on
> the GNU/Linux 'locate' program. You have to install it. I don't know
> what distro you use, but the package is usually called mlocate or
> plocate (these are two different implementations of locate). I have
> mlocate installed on Arch Linux. According to the Arch wiki:

> 
> - mlocate (Merging Locate) is a more secure version of the locate utility,
> that only shows files accessible to the user.

> - plocate (Posting Locate) is a locate based on posting lists, consuming
> mlocates database ahead-of-time and making a much faster (and smaller)
> index out of it.
> 

> Generally, when you install locate it is automatically configured so
> that the database is updated every time you start a session. If you want
> to update it in the middle of a session, you must execute the updatedb
> command with sudo in the terminal.

Ah, well I have installed locate (mlocate to be precise, I am using
Ubuntu)

And I have used locate in the past, nevertheless

 helm-locate keeps failing and giving me the screenshot I attached in my
 earlier message, so some sort of bug in helm-locate for Ubuntu?

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: org-fstree.el overview over directories (but no comments are possible)

2022-10-30 Thread Juan Manuel Macías
Uwe Brauer writes:

> I have a file called bio-hoja4%ftag_EDO Uwe.pdf
>
> I use helm-locate and type %ftag_
> but I receive nothing found see the screenshot.
>
>
>  helm-min  
>
> And typing %ftag  also does not work,
>
> What do I miss?

Ah, sorry, I thought you used helm-locate before. helm-locate depends on
the GNU/Linux 'locate' program. You have to install it. I don't know
what distro you use, but the package is usually called mlocate or
plocate (these are two different implementations of locate). I have
mlocate installed on Arch Linux. According to the Arch wiki:


- mlocate (Merging Locate) is a more secure version of the locate utility,
that only shows files accessible to the user.

- plocate (Posting Locate) is a locate based on posting lists, consuming
mlocates database ahead-of-time and making a much faster (and smaller)
index out of it.


Generally, when you install locate it is automatically configured so
that the database is updated every time you start a session. If you want
to update it in the middle of a session, you must execute the updatedb
command with sudo in the terminal.

Best regards,

Juan Manuel 



Things marked to happen on Sunday does not appear on calendar

2022-10-30 Thread Renato Pontefice
Hi,
I have this .org:
That if I press C-a a to show the agenda, I see that


I mean, nothing oh Sunday where do I should have prova.
I’m wondering why. I notice that on Sunday does not appear nothing. Is this 
some setting? And where do I change it?

Thank you

Renato

Re: org-fstree.el overview over directories (but no comments are possible)

2022-10-30 Thread Juan Manuel Macías
Uwe Brauer writes:

> Hm I played around with filetags and it is quite nice, I think, thanks
> for pointing it out to me.
>
> I would be extremely interested how you use helm-locate in that context,
> and you give me an example, please?
>
> For example I have the following tags added to a specific directory 
> bio-hoja4 -- EDO Uwe.tex
> and
> h1A_ECM_n -- analysis1.tex
>
> How would I use helm-locate to search those tags?

At first I used a controlled vocabulary for the tags, setting the
variables filetags-enforce-controlled-vocabulary and
filetags-controlled-vocabulary. But I was getting some false positives.
So it occurred to me to configure this other variable like this:

(setq filetags-delimiter-between-filename-and-tags "%ftag_")

This way, if I start typing in helm-locate %ftag_ I already start
getting more accurate results. Like I said, it's not a panacea, but it
more or less does the trick :-)

BTW, i don't use helm-locate directly but helm-mini with a number of
sources related to buffers, markers, and files:

(setq helm-mini-default-sources '(helm-source-buffers-list
  helm-source-recentf
  helm-source-buffer-not-found
  helm-source-bookmarks
  helm-source-bookmark-set
  helm-source-locate))

So with a single call to helm-mini I can get information about open
buffers, recent files, bookmarks, and locate.

Best regards,

Juan Manuel 




org-sbe recent changes?

2022-10-30 Thread alan . schmitt
Hello,

I’ve been using ledger and an org-mode table to track my finances for a
long time, and today it broke: when I evaluate a table macro, I get an
#ERROR instead of the computed value.

The code I’m using is still the one from here:
https://alan.petitepomme.net/tips/ledger_and_org.html

Basically I define a function like this (I added the message part for 
debugging):

#+name: call_ledger
#+begin_src emacs-lisp :var lcmd="bal" :var bucket="Quotidien" :var 
prefix="Expenses:" :var period=()
  (let* ((name (org-trim bucket))
 (bname (concat "'^" prefix name "'"))
 (ledger "ledger -f ~/Documents/Org/mescomptes.ledger")
 (parg (when period (concat " -p '" period "'")))
 (cutcmd "tail -1 | cut -d ' ' -f 2")
 (cmd
  (concat ledger " -J " parg " " lcmd " " bname " | " cutcmd))
 (res (org-trim (shell-command-to-string cmd
(message res)
(if (equal res "") 0 res))
#+end_src

Then I call it in a table that looks like this (removing a lot of stuff
for privacy reasons):

| Bucket | Planned | Remaining |
|+-+---+
| Achat Maison   |1000 | #ERROR|
|+-+---+
| Total  |1000 | #ERROR|
#+TBLFM: @2$3..@>>$3='(org-sbe call_ledger (bucket $$1) (prefix 
"\"Bucket:Expenses:\""))

It used to work, but now I get an #ERROR. The strange thing is that the
correct value is printed with the message call. Did something change
recently regarding org-sbe and table? How can I find out what the
value is causing the #ERROR to be printed?

Thanks,

Alan


signature.asc
Description: PGP signature


Re: org-fstree.el overview over directories (but no comments are possible)

2022-10-30 Thread Uwe Brauer

Hi 
> Uwe Brauer writes:

> I see. It's not exactly what you're looking for, but I often use
> filetags.el (https://github.com/DerBeutlin/filetags.el) which allows you
> to add tags to files and directories in Dired. You can add multiple
> tags, remove or update them. It's not a panacea, because the tags are
> added directly to the file/directory name (as part of the name, I mean),
> but in general it's enough for me when I want to have a file tagged in
> some way. I can then locate this files by tag names using helm-locate.

Hm I played around with filetags and it is quite nice, I think, thanks
for pointing it out to me.

I would be extremely interested how you use helm-locate in that context,
and you give me an example, please?

For example I have the following tags added to a specific directory 
bio-hoja4 -- EDO Uwe.tex
and
h1A_ECM_n -- analysis1.tex

How would I use helm-locate to search those tags?

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: org-fstree.el overview over directories (but no comments are possible)

2022-10-30 Thread Uwe Brauer
>>> "JMM" == Juan Manuel Macías  writes:

> Uwe Brauer writes:
>> Thanks I will give it a try, meanwhile I am trying filetree (in Melpa)
>> that allows you to add notes to files, but it seems you have to open the
>> files in order to add the notes, which is not what I am looking for

> Interesting package, I didn't know about it... Have you ever tried it? I
> just installed it, but M-x filetree-load-cmd-menu returns a 'Wrong type
> argument: number-or-marker-p, list'. When I run toggle-debug-on-error It
> seems it's a transient related problem...

Hm it works for me (emacs master git may), 

> hmm, I think the notes functionality that this package includes is more
> in the league of org-remark or org-noter, i.e. to add notes to the file
> content, but not a comment to the file itself, which I think is more
> what you search. But I am not sure.

I think you are right, I will open an issue on the authors github page.

BTW I played a bit with filetags. It is ok, but I would like to add some
more information, usually a line or so a tag is a bit sparse I must say.
Hm 

> Best regards,

> Juan Manuel 

-- 
Warning: Content may be disturbing to some audiences
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. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


One thing each 3 days but maximum 10

2022-10-30 Thread Renato Pontefice
I have to take a pill each 3 days, but for max 10 times.
So I set a TODO pill >2022-10-28 +3d> and each 3 days my calendar tell me that 
I have to take the pill. But is possible to say 1/10; 2/10; 3/10 etc?
I nean to show how many pill I have already take?

Thank you

Renato


Re: org-fstree.el overview over directories (but no comments are possible)

2022-10-30 Thread Juan Manuel Macías
Uwe Brauer writes:

> Thanks I will give it a try, meanwhile I am trying filetree (in Melpa)
> that allows you to add notes to files, but it seems you have to open the
> files in order to add the notes, which is not what I am looking for

Interesting package, I didn't know about it... Have you ever tried it? I
just installed it, but M-x filetree-load-cmd-menu returns a 'Wrong type
argument: number-or-marker-p, list'. When I run toggle-debug-on-error It
seems it's a transient related problem...

hmm, I think the notes functionality that this package includes is more
in the league of org-remark or org-noter, i.e. to add notes to the file
content, but not a comment to the file itself, which I think is more
what you search. But I am not sure.

Best regards,

Juan Manuel 



How to start searching from a predefined path

2022-10-30 Thread Renato Pontefice
I’ve added a WEBDAV service that I can use with my phone (by orgzly)
How can I set, on my pc to start search from this point when I press C-x C-f
This is a pain that stay before any directory (it is another entry point…)

I don’t know if I was clear enough
Renato


Re: Setting org-todo-keywords through directory-local variables

2022-10-30 Thread Kévin Le Gouguec
Ihor Radchenko  writes:

> [sending to Org ML in-reply to the relevant thread]

[Thanks!]

> Kévin Le Gouguec  writes:
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57003
> 28.1.90; Can local variables be loaded before loading major mode?
>
>> … reminded me of a patch I submitted to the Org ML… some time ago 
>> (sorry for not following up) to set TODO keywords via .dir-locals.el:
>>
>> https://list.orgmode.org/87a70stkmv@gmail.com/
>
> Your patch is not listed on https://updates.orgmode.org/
> It is also not in my records (I am only following patches closely since
> the beginning of this year).
> So, it slipped through the cracks.

(Right, that's entirely on me, I posted it knowing that an Org release
was pending and figuring I'd come back later…  well, better late than
never)

>> * could do so piecemeal, adding support for variables one at a time as
>>   people chime in the ML to express a need.
>
>> E.g. my patch only added support for org-todo-keywords and
>> org-todo-keyword-faces, but it laid the foundation for adding support
>> for other variables later.
>
> I'd prefer to solve it once and for all. I tried early loading of
> file-local variables in the past, but had to revert the commit because
> of major issues. See
> https://list.orgmode.org/87r11wkmew@ucl.ac.uk/T/#mab6359ed2107d5515c6bb6b266551f0c5049ceca
>
> Maybe the hook approach can work better. But I'd prefer to discuss all
> the possible caveats first.

My reasoning for keeping the current initialization code untouched and
_re_computing stuff in hack-local-variables-hook hinged on…

* refactoring being fraught; since Org already has a "blessed" way to do
  more or less what file/dir-locals do (SETUPFILEs), I figured it wasn't
  worth rocking everyone's boat for the benefit of the few,

* the prior art in other markup modes (markdown-handle-local-variables,
  font-latex-after-hacking-local-variables).

>> Also to try to reduce the risk of breakage, it went for "compute Org
>> settings normally; then selectively recompute some if relevant variables
>> are found in dir/file-locals".  That way "regular" Org users who rely
>> rather on SETUPFILEs wouldn't be impacted, only "early adopters" of
>> dir/file-locals might shoot themselves in the foot.
>
> I am not sure what is the problem with SETUPFILE.
> We can simply load it in the hook. 

I wasn't suggesting there's a problem with SETUPFILEs; my point was that
I considered two categories of users:

* those who are happy with SETUPFILEs: my implementation goal was to
  "guarantee" that my patch would have zero impact on them,

* those who want to play with dir/file-locals (): conversely, I wanted
  to make sure that only them would get to "pick up the pieces" when
  something would inevitably break.

This patch might have been my first foray into Org's init code, so it
felt too risky to go with any approach other than "keep the
implementation for the established features _exactly_ _as_ _now_; stuff
all the experimental stuff in hack-local-variables-hook".

>Though the priority of SETUPFILE vs.
> local variables should be discussed. Probably, local variables should
> take precedence to keep things consistent with the rest of Emacs.

No strong opinions there.  I'm not even sure how my patch handled that?
樂

> +(defun org--process-local-variables ()
> +  "Refresh settings affected by file-local or directory-local variables."
> +  (when
> +  (let ((local-vars (mapcar #'car file-local-variables-alist)))
> + (or (memq 'org-todo-keywords local-vars)
> + (memq 'org-todo-keyword-faces local-vars)))
> +(org-set-regexps-and-options)
> +(org-set-font-lock-defaults)))

IIUC the logic goes org-set-regexps-and-options ⇒ org-collect-keywords ⇒
org--collect-keywords-1, and that's where SETUPFILE is processed?  So
currently the SETUPFILE would have priority  (unless I'm misreading
the code)



Re: Auto detect ob-clojure backend

2022-10-30 Thread Bastien Guerry
Ihor Radchenko  writes:

>> What's your opinion?
>
> I agree.

+1 (FWIW)

-- 
 Bastien



Re: org-fstree.el overview over directories (but no comments are possible)

2022-10-30 Thread Uwe Brauer

> Uwe Brauer writes:

> I see. It's not exactly what you're looking for, but I often use
> filetags.el (https://github.com/DerBeutlin/filetags.el) which allows you
> to add tags to files and directories in Dired. You can add multiple
> tags, remove or update them. It's not a panacea, because the tags are
> added directly to the file/directory name (as part of the name, I mean),
> but in general it's enough for me when I want to have a file tagged in
> some way. I can then locate this files by tag names using helm-locate.

> Perhaps a kind of ''dired-org-view'' could be interesting, to display a
> dired directory as an Org buffer, where you could add (persistent) TODO
> states, notes and tags. Well, it's a sudden occurrence, I don't know to
> what extent it is feasible, but in case someone feels inspired... :-)

> You also have this package (haven't tried it):
> https://github.com/Boruch-Baum/emacs-diredc Adds a lot of functionality
> to Dired, including file preview.

> Best regards,


Thanks I will give it a try, meanwhile I am trying filetree (in Melpa)
that allows you to add notes to files, but it seems you have to open the
files in order to add the notes, which is not what I am looking for, but
maybe I miss something.

> Juan Manuel 

-- 
Warning: Content may be disturbing to some audiences
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. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: org-fstree.el overview over directories (but no comments are possible)

2022-10-30 Thread Juan Manuel Macías
Uwe Brauer writes:

> Well, since I tend to forget things, and it is very time consuming to
> open files and see what is the basic content, I thought of adding to
> each directory (with subdirectories if necessary) I find useful a
> README.org file, that contains a 
>
> 1. Tree of the directory and 
>
> 1. a short description of the content of each file
>
> I use bookmarks.el but that is an entirely different  workflow, since I
> there only save files that I find useful, but sometimes I stumble across
> a directory  I created  some time ago and don't recall the content of
> each file.

I see. It's not exactly what you're looking for, but I often use
filetags.el (https://github.com/DerBeutlin/filetags.el) which allows you
to add tags to files and directories in Dired. You can add multiple
tags, remove or update them. It's not a panacea, because the tags are
added directly to the file/directory name (as part of the name, I mean),
but in general it's enough for me when I want to have a file tagged in
some way. I can then locate this files by tag names using helm-locate.

Perhaps a kind of ''dired-org-view'' could be interesting, to display a
dired directory as an Org buffer, where you could add (persistent) TODO
states, notes and tags. Well, it's a sudden occurrence, I don't know to
what extent it is feasible, but in case someone feels inspired... :-)

You also have this package (haven't tried it):
https://github.com/Boruch-Baum/emacs-diredc Adds a lot of functionality
to Dired, including file preview.

Best regards,

Juan Manuel 



Re: Auto detect ob-clojure backend (was: [PATCH] Fix ob-clojure handling source block variable's value is a org-mode table or list)

2022-10-30 Thread Ihor Radchenko
Daniel Kraus  writes:

>> What if users have, say, cider installed and also babashka executable?
>> Will it be expected to use babashka?
>
> Yes. The only thing that makes me slightly hesitant is that e.g.
> someone doesn't have `bb` installed. Executes clojure source blocks
> which are then evaluated in, let's say cider.
> Then they install `bb` and the next time they start Emacs, the same
> source block on re-evaluation would be executed with babashka.
>
> I think this is still the best out of the box experience as it
> "just works" for most users without having to customise something
> and if they want it fixed, they can pin it to a certain backend.
>
> What's your opinion?

I agree.

Though if you want to go really fancy, you can utilize org-persist to
store the customization value in persistent cache (org-persist-register),
load it back (org-persist-read), and re-use when the cached backend can
be enabled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org-fstree.el overview over directories (but no comments are possible)

2022-10-30 Thread Uwe Brauer
>>> "JMM" == Juan Manuel Macías  writes:
Hi Juan,


> Uwe Brauer writes:
>> The only problem is one cannot add comments in the sense when the tree
>> is updated everything gets replaced
>> as indicated:
>> 
>> ;;   - when triggering an update (by pressing "C-c C-c" while in the line 
>> mentioned above)
>> ;; the COMPLETE REGION BETWEEN "#+BEGIN_FSTREE" AND "#+END_FSTREE" IS 
>> REPLACED.
>> ;;   - speed  
>> 
>> 
>> So I am wondering. Is there any new package or an update I am not aware
>> of that would allow adding comments?

> Hi Uwe,

> I tried this package a long time ago, and I found the problems you
> mention. I noticed also that in large directories it took a eternity to
> create the Org nodes. The idea of the package is not bad, but I did not
> find a practical use for it. I currently have dired-subtree-toggle
> installed, which allows expanding and collapsing dired directories, and
> assigned these keyboard shortcuts to it:

>   (with-eval-after-load 'dired
> (define-key dired-mode-map (kbd "") 'dired-subtree-toggle)
> (define-key dired-mode-map (kbd "C-") 'dired-subtree-cycle))

> As to whether there is any new package that does the same thing as
> org-fstree, AFAIK I don't think so. 

Well I found one 
https://github.com/ScriptDevil/org-fs-tree

But again I cannot add comments, nor seems there be a update function.



> Out of curiosity, what use case would you give to such a package?

Well, since I tend to forget things, and it is very time consuming to
open files and see what is the basic content, I thought of adding to
each directory (with subdirectories if necessary) I find useful a
README.org file, that contains a 

1. Tree of the directory and 

1. a short description of the content of each file

I use bookmarks.el but that is an entirely different  workflow, since I
there only save files that I find useful, but sometimes I stumble across
a directory  I created  some time ago and don't recall the content of
each file.






> Best regards,

> Juan Manuel 



-- 
Warning: Content may be disturbing to some audiences
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. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: Auto detect ob-clojure backend (was: [PATCH] Fix ob-clojure handling source block variable's value is a org-mode table or list)

2022-10-30 Thread Daniel Kraus


Ihor Radchenko  writes:

> Daniel Kraus  writes:
>
>> +(defcustom org-babel-clojure-backend (cond
>> +  ((executable-find "bb") 'babashka)
>> +  ((executable-find "nbb") 'nbb)
>> +  ((featurep 'cider) 'cider)
>> +  ((featurep 'inf-clojure) 'inf-clojure)
>> +  ((featurep 'slime) 'slime)
>> +  (t nil))
>
> What if users have, say, cider installed and also babashka executable?
> Will it be expected to use babashka?

Yes. The only thing that makes me slightly hesitant is that e.g.
someone doesn't have `bb` installed. Executes clojure source blocks
which are then evaluated in, let's say cider.
Then they install `bb` and the next time they start Emacs, the same
source block on re-evaluation would be executed with babashka.

I think this is still the best out of the box experience as it
"just works" for most users without having to customise something
and if they want it fixed, they can pin it to a certain backend.

What's your opinion?

Cheers,
  Daniel



Re: org-fstree.el overview over directories (but no comments are possible)

2022-10-30 Thread Juan Manuel Macías
Uwe Brauer writes:

> The only problem is one cannot add comments in the sense when the tree
> is updated everything gets replaced
> as indicated:
>
> ;;   - when triggering an update (by pressing "C-c C-c" while in the line 
> mentioned above)
> ;; the COMPLETE REGION BETWEEN "#+BEGIN_FSTREE" AND "#+END_FSTREE" IS 
> REPLACED.
> ;;   - speed  
>
>
> So I am wondering. Is there any new package or an update I am not aware
> of that would allow adding comments?

Hi Uwe,

I tried this package a long time ago, and I found the problems you
mention. I noticed also that in large directories it took a eternity to
create the Org nodes. The idea of the package is not bad, but I did not
find a practical use for it. I currently have dired-subtree-toggle
installed, which allows expanding and collapsing dired directories, and
assigned these keyboard shortcuts to it:

  (with-eval-after-load 'dired
(define-key dired-mode-map (kbd "") 'dired-subtree-toggle)
(define-key dired-mode-map (kbd "C-") 'dired-subtree-cycle))

As to whether there is any new package that does the same thing as
org-fstree, AFAIK I don't think so. Out of curiosity, what use case
would you give to such a package?

Best regards,

Juan Manuel 



Re: ob-clojure session support (was: ob-clojure eval error when has comment at end of code line)

2022-10-30 Thread Ihor Radchenko
Daniel Kraus  writes:

>> Let me know if you need any help with the fix.
>
> I feel adding session support for babashka and nbb (and maybe a future 
> clojure-cli backend)
> makes most sense.
> Relying on `inf-clojure` would make this task simpler but this is also the
> package the least amount of people will have installed, as cider is much more 
> popular.

Ideally, we want to support all the backends, but just cider (popular) +
easy ones will also do.

> Is there a good (and simple) example of another babel package that implements
> session support but doesn't depend on an external inf-xxx package?
> Then I could use code from there.

I'd say that ob-gnuplot is the simplest way. Given that we have an
equivalent of `gnuplot-send-buffer-to-gnuplot' command.

For more direct comint sessions, we have ob-comint.el library
implementing generic interactive sessions.
You can check out the usage of, say, `org-babel-comint-with-output', by
different babel backends.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Would know where my emacs reside and wich init.el read

2022-10-30 Thread Ihor Radchenko
Renato Pontefice  writes:

> If I open a termine windowed and run emacs, it run and open a buffer with 
> empty week.
>
> I would like to know where does it takes emacs (is will be on a PATH 
> directory of course and wich init.el does it read
>
> How can I do that?

C-h v user-init-file 
or
M-: user-init-file 

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Would know where my emacs reside and wich init.el read

2022-10-30 Thread Renato Pontefice
If I open a termine windowed and run emacs, it run and open a buffer with empty 
week.

I would like to know where does it takes emacs (is will be on a PATH directory 
of course and wich init.el does it read

How can I do that?

Thank you

Renato


Re: Auto detect ob-clojure backend (was: [PATCH] Fix ob-clojure handling source block variable's value is a org-mode table or list)

2022-10-30 Thread Ihor Radchenko
Daniel Kraus  writes:

> Bastien  writes:
>
>> Daniel Kraus  writes:
>>
>>> I think I'll go with the big `cond` above to auto-detect what's
>>> installed. That's probably the best out-of-the-box experience.
>> Indeed, thank you!
>
> I would push the attached patch.

> +(defcustom org-babel-clojure-backend (cond
> +  ((executable-find "bb") 'babashka)
> +  ((executable-find "nbb") 'nbb)
> +  ((featurep 'cider) 'cider)
> +  ((featurep 'inf-clojure) 'inf-clojure)
> +  ((featurep 'slime) 'slime)
> +   (t nil))

What if users have, say, cider installed and also babashka executable? 
Will it be expected to use babashka?

> I'm not sure about the `:package-version` keyword in defcustom.
> I want to say that the default value changed.
> Should I do it this way? Is `(Org . "9.6")` correct as it's unreleased?

Yes. 9.6 is the next release - our main branch is labeled Org 9.6-pre.
So, using 9.6 is correct.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: ob-clojure session support (was: ob-clojure eval error when has comment at end of code line)

2022-10-30 Thread Daniel Kraus


Ihor Radchenko  writes:
>
> If Bastien removed session support, and you do not see any justification,
> it was most likely an oversight. We generally avoid feature regressions:
> https://bzg.fr/en/the-software-maintainers-pledge/
>
> So, if sessions are currently not supported, it should be considered a
> bug and fixed. Let me know if you need any help with the fix.

I agree that session support would be nice.
The cider backend (and maybe slime and inf-clojure, which I haven't 
installed/tried)
opens a connection and then all source blocks are evaled in this one session,
but you can't specify multiple.
For babashka, nbb, it's simply running the cli with the code from the source
block.

> Let me know if you need any help with the fix.

I feel adding session support for babashka and nbb (and maybe a future 
clojure-cli backend)
makes most sense.
Relying on `inf-clojure` would make this task simpler but this is also the
package the least amount of people will have installed, as cider is much more 
popular.

Is there a good (and simple) example of another babel package that implements
session support but doesn't depend on an external inf-xxx package?
Then I could use code from there.

Thanks,
  Daniel



Auto detect ob-clojure backend (was: [PATCH] Fix ob-clojure handling source block variable's value is a org-mode table or list)

2022-10-30 Thread Daniel Kraus

Bastien  writes:

> Daniel Kraus  writes:
>
>> I think I'll go with the big `cond` above to auto-detect what's
>> installed. That's probably the best out-of-the-box experience.
> Indeed, thank you!

I would push the attached patch.
I'm not sure about the `:package-version` keyword in defcustom.
I want to say that the default value changed.
Should I do it this way? Is `(Org . "9.6")` correct as it's unreleased?

Thanks,
  Daniel
>From bd68ece99ce411439db87cd19e44ffbc49677ae3 Mon Sep 17 00:00:00 2001
From: Daniel Kraus 
Date: Sat, 29 Oct 2022 23:20:06 +0200
Subject: [PATCH] ob-clojure.el: Auto detect backend

* lisp/ob-clojure.el (org-babel-clojure-backend): Set the backend
to an available cli program or elisp package.
---
 lisp/ob-clojure.el | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el
index 5654d5208..25f1c78a6 100644
--- a/lisp/ob-clojure.el
+++ b/lisp/ob-clojure.el
@@ -76,9 +76,16 @@
 (defvar org-babel-default-header-args:clojurescript '())
 (defvar org-babel-header-args:clojurescript '((package . :any)))
 
-(defcustom org-babel-clojure-backend nil
+(defcustom org-babel-clojure-backend (cond
+  ((executable-find "bb") 'babashka)
+  ((executable-find "nbb") 'nbb)
+  ((featurep 'cider) 'cider)
+  ((featurep 'inf-clojure) 'inf-clojure)
+  ((featurep 'slime) 'slime)
+  (t nil))
   "Backend used to evaluate Clojure code blocks."
   :group 'org-babel
+  :package-version '(Org . "9.6")
   :type '(choice
 	  (const :tag "inf-clojure" inf-clojure)
 	  (const :tag "cider" cider)
-- 
2.38.1



Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-30 Thread Daniel Ziltener


Am 30.10.22 um 05:12 schrieb Ihor Radchenko:

Daniel Ziltener  writes:


From: Daniel Ziltener 

* lisp/ob-tangle.el (org-babel-tangle-single-block): strip noweb tags
from block if :noweb has been set to strip-tangle.
* lisp/ob-core.el (org-babel-common-header-args-w-values): add
"strip-tangle" as new allowed value.
* testing/lisp/test-ob-tangle.el (ob-tangle/strip-tangle): add new test
case for strip-tangle.
* doc/org-manual.org (Noweb Reference Syntax): adjust documentation for
the noweb header argument.
* etc/ORG-NEWS: add entry for new header argument value.

This patch adds the "strip-tangle" option for the :noweb header
argument. This strips the noweb tags before tangling the block. This can
be useful for e.g. testing purposes where one wants to use a block as
test case that can be both run inline as well as tangled into a file for
automated testing.

Thanks, but it looks like your PGP signature corrupted the email patch.
Could you please create a separate patch file and attach it in the
reply?
Sure, here's the patch attached, as generated by "git format-patch 
origin/main".
From 0133162ef78e007fe4918016a4aabf8bc3734488 Mon Sep 17 00:00:00 2001
From: Daniel Ziltener 
Date: Sun, 30 Oct 2022 01:20:53 +0200
Subject: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle

* lisp/ob-tangle.el (org-babel-tangle-single-block): strip noweb tags
from block if :noweb has been set to strip-tangle.
* lisp/ob-core.el (org-babel-common-header-args-w-values): add
"strip-tangle" as new allowed value.
* testing/lisp/test-ob-tangle.el (ob-tangle/strip-tangle): add new test
case for strip-tangle.
* doc/org-manual.org (Noweb Reference Syntax): adjust documentation for
the noweb header argument.
* etc/ORG-NEWS: add entry for new header argument value.

This patch adds the "strip-tangle" option for the :noweb header
argument. This strips the noweb tags before tangling the block. This can
be useful for e.g. testing purposes where one wants to use a block as
test case that can be both run inline as well as tangled into a file for
automated testing.
---
 doc/org-manual.org |  6 ++
 etc/ORG-NEWS   |  5 +
 lisp/ob-core.el|  2 +-
 lisp/ob-tangle.el  |  4 +++-
 testing/lisp/test-ob-tangle.el | 26 ++
 5 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 18a050069..064d51bcd 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -18993,6 +18993,12 @@ tangled, or exported.
   Expansion of noweb syntax references in the body of the code block
   when tangling.  No expansion when evaluating or exporting.
 
+- =strip-tangle= ::
+
+  Expansion of noweb syntax references in the body of the code block
+  when evaluating or exporting.  Removes noweb syntax references
+  when exporting.
+
 - =no-export= ::
 
   Expansion of noweb syntax references in the body of the code block
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 6e875deb6..2c66d2e45 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -228,6 +228,11 @@ commands.
 =:noweb-prefix= can be set to =no= to prevent the prefix characters
 from being repeated when expanding a multiline noweb reference.
 
+*** New =:noweb= babel header argument value =strip-tangle=
+
+=:noweb= can be set to =strip-tangle= to strip the noweb syntax references
+before tangling.
+
 *** New LaTeX source block backend using =engraved-faces-latex=
 
 When ~org-latex-src-block-backend~ is set to ~engraved~,
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 518831ec6..c52f113b4 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -414,7 +414,7 @@ then run `org-babel-switch-to-session'."
 (mkdirp	. ((yes no)))
 (no-expand)
 (noeval)
-(noweb	. ((yes no tangle no-export strip-export)))
+(noweb	. ((yes no tangle strip-tangle no-export strip-export)))
 (noweb-ref	. :any)
 (noweb-sep  . :any)
 (noweb-prefix . ((no yes)))
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 2da92efaf..d9d847195 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -536,7 +536,9 @@ non-nil, return the full association list to be used by
 	 (body
 	  ;; Run the tangle-body-hook.
   (let ((body (if (org-babel-noweb-p params :tangle)
-			  (org-babel-expand-noweb-references info)
+  (if (string= "strip-tangle" (cdr (assq :noweb (nth 2 info
+  (replace-regexp-in-string (org-babel-noweb-wrap) "" (nth 1 info))
+			(org-babel-expand-noweb-references info))
 			(nth 1 info
 	(with-temp-buffer
 	  (insert
diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el
index a0003ee40..af2a72682 100644
--- a/testing/lisp/test-ob-tangle.el
+++ b/testing/lisp/test-ob-tangle.el
@@ -510,6 +510,32 @@ another block
 		(org-split-string (buffer-string
 	  (delete-file file))
 
+(ert-deftest ob-tangle/strip-tangle ()
+  "Test if strip-tangle works 

org-fstree.el overview over directories (but no comments are possible)

2022-10-30 Thread Uwe Brauer


Hi


This 
 

seems to be quite old code
but the following still produces a nice overview over the directory
structure in and org file
#+begin_src 
#+begin_fstree: /home/oub/tmp/Example-tree :non-recursive nil

** | | [[file:/home/oub/tmp/Example-tree/README.org][README.org]]   
   
** |D| [[file:/home/oub/tmp/Example-tree/Sheet1][Sheet1]]   
   
*** | | [[file:/home/oub/tmp/Example-tree/Sheet1/test.org][test.org]]   
   
** |D| [[file:/home/oub/tmp/Example-tree/Sheet2][Sheet2]]   
   
** |D| [[file:/home/oub/tmp/Example-tree/Sheet3][Sheet3]]   
   


#+end_fstree:
#+end_src


The only problem is one cannot add comments in the sense when the tree
is updated everything gets replaced
as indicated:

;;   - when triggering an update (by pressing "C-c C-c" while in the line 
mentioned above)
;; the COMPLETE REGION BETWEEN "#+BEGIN_FSTREE" AND "#+END_FSTREE" IS 
REPLACED.
;;   - speed  


So I am wondering. Is there any new package or an update I am not aware
of that would allow adding comments?

Regards

Uwe Brauer 



-- 
Warning: Content may be disturbing to some audiences
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. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/




Re: org table proposal: merge and split cells in org-tables

2022-10-30 Thread Timothy
Hi Uwe and Ihor,

> This subject is brought up regularly.
>
> In a conversation with Ihor Radchenko it was considered as being helpful
> to provide a table in which cells are merged and split.

This reminds me of a proposal I made in 2020 on this very matter:
.

I won’t re-hash it here, but if I am to apply that proposed syntax to the
example table it would look like this:

┌
│ |   Sales  |
│ | Region |-+---+---+---|
│ ||| Q1 ||   Q2 ||   Q3 ||   Q4 |
│ || foo   | bar | foo | bar | foo | bar | foo | bar |
│ |+---+-+-+-+-+-+-+-|
│ | North  | 350   |  46 | 253 |  34 | 234 |  42 | 382 |  68 |
│ | South  | 462   |  84 | 511 |  78 | 435 |  45 | 534 |  89 |
└

All the best,
Timothy

-- 
Timothy (‘tecosaur’/‘TEC’), Org mode contributor.
Learn more about Org mode at .
Support Org development at ,
or support my work at .


Re: [BUG] cant normally edit tables created with table-insert [9.5.2 (release_9.5.2-25-gaf6f12 @ c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/org/)]

2022-10-30 Thread Mati




Try

|--++--|
| this | is | test |
|1 |  2 |3 |
|--++--|

Works, but I must somehow hack it to look normally with valign then. Thanks.



Re: org table proposal: merge and split cells in org-tables

2022-10-30 Thread Ihor Radchenko
Jean Louis  writes:

> To solve that problem personally, I use Asciidoctor, see how it is
> done there:
>
> Example 76. Table with formatted, aligned and merged cells:
> https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/#ex-cell-format

I am sorry, but this looks unreadable. I would avoid re-using such
syntax ideas.

> Org has Babel, for purposes of HTML output, Org file could use Bable
> to get HTML return from Babel containing Asciidoc and embed it in Org
> HTML.

Sure. And we do use pretty much the same approach to export table.el
tables, which are supported by Org natively (up to a limit). But this
proposal is about bringing cell merging into native Org tables.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org table proposal: merge and split cells in org-tables

2022-10-30 Thread Jean Louis
To solve that problem personally, I use Asciidoctor, see how it is
done there:

Example 76. Table with formatted, aligned and merged cells:
https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/#ex-cell-format

Org has Babel, for purposes of HTML output, Org file could use Bable
to get HTML return from Babel containing Asciidoc and embed it in Org
HTML.

That solution is definitely not general solution, it may be personal one.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Re: org table proposal: merge and split cells in org-tables

2022-10-30 Thread Timothy
Hi Ihor,

> Timothy  writes:
>
>> This reminds me that ages ago I made a proposal about multi-row/column 
>> cells, it
>> might be worth reviving that at some point?
>
> , which is the
> exact discussion herein.

Ah, I’ll move there. I suppose this is a downside to taking a LIFO approach to
my inbox .

All the best,
Timothy

-- 
Timothy (‘tecosaur’/‘TEC’), Org mode contributor.
Learn more about Org mode at .
Support Org development at ,
or support my work at .


Re: org table proposal: merge and split cells in org-tables

2022-10-30 Thread Ihor Radchenko
Timothy  writes:

> This reminds me that ages ago I made a proposal about multi-row/column cells, 
> it
> might be worth reviving that at some point?

https://orgmode.org/list/878rkyarvm.fsf@localhost, which is the
exact discussion herein.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] cant normally edit tables created with table-insert [9.5.2 (release_9.5.2-25-gaf6f12 @ c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/org/)]

2022-10-30 Thread Ihor Radchenko
Mati  writes:

>> Could you please provide a concrete example on what you want to achieve?
>
> +-+-+ at top and bottom of table creates top and bottom border 
> and doesn't break table.

Org export for table.el tables relies on export capabilities of
table.el. We may hack into the export to add border (say, according to
#+ATTR_HTML attribute), but it will be fragile wrt changes in table.el
export.

So, I do not think that it is a good idea to add such kind of feature to
Org. table.el support is limited as long is it is not a part of actual
Org syntax and not supported fully in org-table.el.

In terms of Org development, we should probably focus more on improving
built-in tables, as discussed in
https://orgmode.org/list/878rkyarvm.fsf@localhost

On personal level, you may use org-export-filter-table-functions to add
the borders as needed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org table proposal: merge and split cells in org-tables

2022-10-30 Thread Timothy
Hi Ihor,

> While cell-mode () is a nice idea, but
> it is not plain text. I doubt that we can get much inspiration from
> there.

This reminds me that ages ago I made a proposal about multi-row/column cells, it
might be worth reviving that at some point?

All the best,
Timothy

-- 
Timothy (‘tecosaur’/‘TEC’), Org mode contributor.
Learn more about Org mode at .
Support Org development at ,
or support my work at .


Re: org table proposal: merge and split cells in org-tables

2022-10-30 Thread Ihor Radchenko
Mati  writes:

> I don't know is this helpful, but on reddit some people mentioned that 
> cell-mode is very promising for tables. Maybe it can ease table 
> development. I'm not into programming at all so I can't evaluate.

While cell-mode (https://gitlab.com/dto/cell-mode) is a nice idea, but
it is not plain text. I doubt that we can get much inspiration from
there.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org table proposal: merge and split cells in org-tables

2022-10-30 Thread Mati
I don't know is this helpful, but on reddit some people mentioned that 
cell-mode is very promising for tables. Maybe it can ease table 
development. I'm not into programming at all so I can't evaluate.





Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)

2022-10-30 Thread tomas
On Sun, Oct 30, 2022 at 07:09:30AM +, Ihor Radchenko wrote:
> to...@tuxteam.de writes:
> 
> >> If you need it, feel free to open a separate feature request for extra
> >> :results options in ob-shell. Possibly providing more details how you
> >> envision this header argument to work.
> >
> > I'll mull over it. Perhaps I come up with some (patch) proposal.
> 
> Thinking more about it in the context of the current feature request,
> displaying the stderr buffer unconditionally may be undesired when the
> script already does 2>&1 or, potentially, uses imaginary :results stderr
> header argument.

Definitely. It's not for everyone.

> >> > And thanks for your incredible work on Org. Do you ever sleep?

[...]

> I use Org mode and Org agenda to manage the maintenance 

Still genuinely impressed.

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: [BUG] cant normally edit tables created with table-insert [9.5.2 (release_9.5.2-25-gaf6f12 @ c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/org/)]

2022-10-30 Thread Mati

Could you please provide a concrete example on what you want to achieve?


+-+-+ at top and bottom of table creates top and bottom border 
and doesn't break table.





Re: [BUG] cant normally edit tables created with table-insert [9.5.2 (release_9.5.2-25-gaf6f12 @ c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/org/)]

2022-10-30 Thread Ihor Radchenko
Mati  writes:

> So, you mean that those aren't hlines but cell boundaries?

Yes.

> Simplifying, 
> I think the problem is lack of table top and bottom border support, no 
> matter how it will be created.

Could you please provide a concrete example on what you want to achieve?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] cant normally edit tables created with table-insert [9.5.2 (release_9.5.2-25-gaf6f12 @ c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/org/)]

2022-10-30 Thread Mati
So, you mean that those aren't hlines but cell boundaries? Simplifying, 
I think the problem is lack of table top and bottom border support, no 
matter how it will be created.


On 30.10.2022 08:47, Ihor Radchenko wrote:

I am sorry, but I don't understand.
In the reply to the linked conversation I explained that table.el tables
do not have any notion of hlines.




Re: [BUG] cant normally edit tables created with table-insert [9.5.2 (release_9.5.2-25-gaf6f12 @ c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/org/)]

2022-10-30 Thread Ihor Radchenko
Mati  writes:

> I saw a similar topic created about hlines. So, it would be rather a 
> feature request to add hlines rather than bug. Here is fragment of 
> conversation I am talking about for reference:

I am sorry, but I don't understand.
In the reply to the linked conversation I explained that table.el tables
do not have any notion of hlines.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] cant normally edit tables created with table-insert [9.5.2 (release_9.5.2-25-gaf6f12 @ c:/Program Files/Emacs/emacs-28.1/share/emacs/28.1/lisp/org/)]

2022-10-30 Thread Mati
I saw a similar topic created about hlines. So, it would be rather a 
feature request to add hlines rather than bug. Here is fragment of 
conversation I am talking about for reference:



/I start with /



/| Example | Text | Dates | other |/
/|-+-+--+-|/
/| this | comment | <2022-01-28 vie> | nothing |/


/That is converted to /



/+-+-+--+-+/
/| Example | Text | Dates | other |/
/+-+-+--+-+/
/| this | comment | <2022-01-28 vie> | nothing |/
/+-+-+--+-+/


/And is converted back to /


/| Example | Text | Dates | other |/
/| this | comment | <2022-01-28 vie> | nothing |/


/Couldn't in the last step the hlines be respected?/

That would not make sense.
AFAIK, table.el has no notion of hlines. The +---+ separators in
table.el tables mark cell boundaries, not hlines.


Re: org table proposal: merge and split cells in org-tables

2022-10-30 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>> In a conversation with Ihor Radchenko it was considered as being helpful
>> to provide a table in which cells are merged and split.

> We should consider this idea seriously as this and related features are
> being requested frequently in the community. I recall the following
> contexts:

> - Support merging cells when exporting to LaTeX tables
> - Text filling inside tables

I would suggest that filling, might be the point to start, since this
the lack of this feature is one of the inconvenience of org-tables.

I am sometimes running org-table-wrap 
found in 
https://github.com/analyticd/org-table-wrap-functions.git 

It is nice but takes a long long time to finish.


>> Here is one
>> 
>> ++-+
>> | Region |  Sales  |
>> |+-+---+---+---+
>> ||  Q1 |Q2 |Q3 |Q4 |
>> |+---+-+-+-+-+-+-+-+
>> || foo   | bar | foo | bar | foo | bar | foo | bar |
>> ++---+-+-+-+-+-+-+-+
>> | North  | 350   |  46 | 253 |  34 | 234 |  42 | 382 |  68 |
>> ++---+-+-+-+-+-+-+-+
>> | South  | 462   |  84 | 511 |  78 | 435 |  45 | 534 |  89 |
>> ++---+-+-+-+-+-+-+-+

> This essentially suggests supporting table.el syntax natively. Or maybe
> extending it by mixing with native Org tables.

> In terms of syntax, adding cell boundary support might be simply a
> question of allowing ++ in Org tables. It will not break anything as
> we already parse +-+ as table.el tables.

> At lower level of org-element representation, we do not need to change
> much either. table-row elements are already not tied to a fixed number
> of cells in every row. And we may extend table-row 'rule type to define
> the "++   +   +---+--+" cell boundaries.

> However, in order to support merging cells, one needs to rework Org in a
> number of places. At least:

> 1. org-element parser and interpreter
> 2. org-table.el in its totality
> 3. export backends
> 4. table formulas; in particular, cell references
> 5. update syntax document

Or would leave 4 and 5 out for the moment, since it sounds like a headache
>> Or better

>> 
>> | Region |  Sales  |
>> |---
>> ||  Q1 |Q2 |Q3 |Q4 |
>> |---
>> || foo   | bar | foo | bar | foo | bar | foo | bar |
>> 
>> | North  | 350   |  46 | 253 |  34 | 234 |  42 | 382 |  68 |
>> 
>> | South  | 462   |  84 | 511 |  78 | 435 |  45 | 534 |  89 |
>> 

> This will clash with horizontal-rule syntax. Not acceptable. Also,
> parsing this kind of table will be significantly harder programatically.


Ok.


-- 
Warning: Content may be disturbing to some audiences
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. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)

2022-10-30 Thread Ihor Radchenko
to...@tuxteam.de writes:

>> If you need it, feel free to open a separate feature request for extra
>> :results options in ob-shell. Possibly providing more details how you
>> envision this header argument to work.
>
> I'll mull over it. Perhaps I come up with some (patch) proposal.

Thinking more about it in the context of the current feature request,
displaying the stderr buffer unconditionally may be undesired when the
script already does 2>&1 or, potentially, uses imaginary :results stderr
header argument.

>> > And thanks for your incredible work on Org. Do you ever sleep?
>> 
>> Remember that we may have radically different time zones. What appears
>> to be nightly emails may not necessarily be sent at night. 
>
> I'm aware of that. My awe is more directed at your bandwidth than at
> your timings.

I use Org mode and Org agenda to manage the maintenance 

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: @string abbreviation in bib file not honored in (basic) org-cite

2022-10-30 Thread Ihor Radchenko
Joost  writes:

> On Thu, 28 Jul 2022, at 14:12, Ihor Radchenko wrote:
>> Did you manage to get the copyright form from FSF?
>> They are supposed to respond within 5 working days.
>
> Yeah, I have the form. I signed it and scanned it, just haven't sent it off 
> yet...

May I know if there is any update on the copyright assignment situation?
If you need any help, we can provide it.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



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

2022-10-30 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.

Did you have a chance to work on the patch?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org-x11idle-exists-p with emacs --daemon

2022-10-30 Thread Max Nikulin
Ihor, what I do not like in your patch is that an external process is 
unconditionally executed during load time. Earlier there was a (failed) 
attempt to limit it to X11.


- Unsure if Windows builds of Emacs may connect to X servers.
- MacOS does not use x11idle, it calls ioreg and perl instead.

In above cases, there might be a point to execute x11idle if a user is 
running remote Emacs session on a Windows or a MacOS machine (e.g. 
through ssh) from local X server. Unsure if somebody has ever tried it. 
The reason to try x11idle should be a test if current frame is 
associated with X.


A side note. I am aware that the following comment existed before your 
commit.

  (and (eq 0 (call-process-shell-command
  (format "command -v %s" org-clock-x11idle-program-name)))
   ;; Check that x11idle can retrieve the idle time
   ;; FIXME: Why "..-shell-command" rather than just `call-process'?
   (eq 0 (call-process-shell-command org-clock-x11idle-program-name


`call-process' can not be used here because "command" is a shell 
built-in, not a real executable. I have another question. Why 
`locate-file' is not used instead?


(locate-file command exec-path exec-suffixes 1))

https://emacs.stackexchange.com/questions/332/how-can-i-find-the-path-to-an-executable-with-emacs-lisp

On 30/10/2022 08:33, Ihor Radchenko wrote:

Max Nikulin writes:


In server.el I found

  (frame-parameter frame 'display)

..


I do not understand.


echo "$DISPLAY"
:0
emacs -Q --daemon
emacsclient -nw

window-system
nil
(frame-parameter nil 'display)
":0"
(call-process "xterm")

So formally a tty frame has access to X11 server.


Multiple X connection means non-deterministic idle time. Each individual
X server will have its own idle time. The current approach with running
`org-x11-idle-seconds' in current frame is the most reasonable in such
scenario, IMHO.


I would say that minimal value should be used. However such case is 
rarely used and will be almost untested.


From my point of view `org-clock-x11idle-program-name' approach is a 
bit fragile. I do not like "%s" substitutions while formatting shell 
commands. On the other hand it allows a complex command instead of 
executable, e.g.


dbus-send --print-reply --dest=org.gnome.Mutter.IdleMonitor 
/org/gnome/Mutter/IdleMonitor/Core org.gnome.Mutter.IdleMonitor.GetIdletime


for Wayland, see 
https://unix.stackexchange.com/questions/396911/how-can-i-tell-if-a-user-is-idle-in-wayland/492328

Perhaps, using Emacs D-BUS API would be even better.

x11idle as `org-clock-x11idle-program-name' default is questionable as 
well. Debian, Arch, Gentoo have xprintidle packages and this tool have 
some additional code.


My summary:
- To be really flexible (e.g. to support Wayland) 
`org-user-idle-seconds' should have an extension point allowing to 
specify elisp function.
- x11idle availability should be checked when X connection is detected, 
not at startup time and perhaps `locate-file' is better than "command" 
shell built-in.
- (frame-parameter nil 'display) might be more accurate in addition to 
`window-system' check.

- xprintidle should be either the default or an alternative during the test.
- I can not figure out how to detect --display argument of "emacs 
--daemon", but perhaps there is no point of time logging in the case of 
a headless process.
- There are tricky cases like remote Emacs or multihead Emacs. Custom 
idle function will allow to postpone their discussion till actual request.






Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)

2022-10-30 Thread tomas
On Sun, Oct 30, 2022 at 03:31:32AM +, Ihor Radchenko wrote:
> to...@tuxteam.de writes:
> 
> >> What you are describing would better fit into a new :results option.
> >
> > Oh, I missed the popup part. Sounds useful for yet another profile,
> > yes.
> 
> If you need it, feel free to open a separate feature request for extra
> :results options in ob-shell. Possibly providing more details how you
> envision this header argument to work.

I'll mull over it. Perhaps I come up with some (patch) proposal.

> > And thanks for your incredible work on Org. Do you ever sleep?
> 
> Remember that we may have radically different time zones. What appears
> to be nightly emails may not necessarily be sent at night. 

I'm aware of that. My awe is more directed at your bandwidth than at
your timings.

Cheers
-- 
t


signature.asc
Description: PGP signature