Re: [BUG] ox-odt file: links are not pointing to the real files (was: [BUG] ox-odt fails for org-id links (e.g., from org-roam v2) [9.5.2 (9.5.2-gfbff08 @ /home/moritz/.emacs.d/elpa/27.2/develop/org-9

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

> It seems org-id.el should be extended to handle some features common to 
> all formats such as custom suffix instead of ".org"

Could you please elaborate?

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



org-export: How to handle links to the exported file? (was: [BUG] ox-odt file: links are not pointing to the real files (was: [BUG] ox-odt fails for org-id links (e.g., from org-roam v2) [9.5.2 (9.5.2

2022-10-31 Thread Ihor Radchenko


TLDR: If we have and Org file with a link point to the same Org file,
how should we export it?

Max Nikulin  writes:

> A couple of other notes.
>
> In HTML top or #top works as a link to the beginning of 
> the document. I am curious if ODF has a similar feature. I mean ID at 
> the top of the same file that generates file.org link instead of 
> internal one for both HTML and ODF formats.

Currently, we have no convention.

In Org mode:
- [[file:/path/to/self]] links will do nothing, or follow org-file-apps.
- [[if:document-property-drawer-id]] links will move point to the top

What about export?
- Should we treat links as file links to the original Org file?
  (One can argue that it is a good default is one wants to write
  something like: "This document has been generated from
  file:/link/to/source.org"
- Should we treat them as "jump to top", similar to our id: link
  behaviour in Org?

I'd say that retaining the current behaviour will be the most reasonable.
I do not see much utility to linking to exported document itself, while
I do see a utility to link to the original file.

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



Re: [BUG] ox-odt file: links are not pointing to the real files (was: [BUG] ox-odt fails for org-id links (e.g., from org-roam v2) [9.5.2 (9.5.2-gfbff08 @ /home/moritz/.emacs.d/elpa/27.2/develop/org-9

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

> [[file:~/examples/org/odt-id/file-b.org]] link is exported as 
> ./file:///home/user/examples/org/odt-id/file-b.org

Thanks!
See the attached new version of the patch.

>From 8ee8528366bbf31ed8510f005e032176711d15b9 Mon Sep 17 00:00:00 2001
Message-Id: <8ee8528366bbf31ed8510f005e032176711d15b9.1667280462.git.yanta...@posteo.net>
From: Ihor Radchenko 
Date: Mon, 31 Oct 2022 14:11:19 +0800
Subject: [PATCH v2] org-odt-link: Fix relative file links

* lisp/ox-odt.el (org-odt-link): Append an extra "../" to relative
links.  This is needed to conform with OpenOffice convention to treat
base path inside the odt archive.  The path containing the odt file is
thus "../".

Reported-by: Ihor Radchenko 
Link: https://orgmode.org/list/87ilkc30wd.fsf@localhost
---
 lisp/ox-odt.el | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 15a9cf2de..e4fb7eb84 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -2688,7 +2688,16 @@ (defun org-odt-link (link desc info)
 		((member type '("http" "https" "ftp" "mailto"))
 		 (concat type ":" raw-path))
 		((string= type "file")
-		 (org-export-file-uri raw-path))
+ (pcase (org-export-file-uri raw-path)
+   (`(and (pred #'file-name-absolute-p) ,path)
+path)
+   (path
+(if (string-prefix-p "file://" path)
+path
+  ;; OpenOffice treats base directory inside the odt
+  ;; archive.  The directory containing the odt file
+  ;; is "../".
+  (concat "../" path)
 		(t raw-path)))
 	 ;; Convert & to  for correct XML representation
 	 (path (replace-regexp-in-string "&" "" path)))
-- 
2.35.1


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


[BUG] ob-python: async session evaluation does not support python-mode.el [9.6-pre (release_9.5.5-2661-g2d040b.dirty @ /home/yantar92/.emacs.d/straight/build/org/)]

2022-10-31 Thread Ihor Radchenko
Hi,

Commit 53fd5b774 introduced async session support in Python src blocks:

ob-comint.el, ob-python.el: Async session evaluation

Adds functionality to ob-comint.el to implement async session eval on
a per-language basis.  Adds a reference implementation for ob-python.

However, async evaluation fails when org-babel-python-mode is set to
'python-mode.

MWE:

Executing

#+begin_src python :session :async yes :results output
import time
time.sleep(.1)
print('Yep!')
#+end_src

will never yield.

This is because org-babel-python-async-evaluate-session assumes that
built-in python.el is used to initiate the python session, which is not
the case when org-babel-python-mode is set to 'python-mode.

See org-babel-python-initiate-session-by-key.

Emacs  : GNU Emacs 28.1.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, 
cairo version 1.16.0)
 of 2022-07-17
Package: Org mode version 9.6-pre (release_9.5.5-2661-g2d040b.dirty @ 
/home/yantar92/.emacs.d/straight/build/org/)
-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org-sbe recent changes?

2022-10-31 Thread Ihor Radchenko
Alan Schmitt  writes:

> Of course, sorry I did not do it. Here is a minimal example:
>
> #+name: foo
> #+begin_src emacs-lisp
> 3
> #+end_src
>
> | Name  | Test |
> |---+--|
> | Hello |  |
> #+TBLFM: @2$2..@>$2='(org-sbe foo)
>
>
> When I evaluate the formula, I get #ERROR instead of 3 in the cell. This
> is with org 9.6. I have another emacs setup with 9.5.5 and there I have
> the correct result.

Thanks!
Fixed on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=9987451252fa64af65d0a0a014f41812f4402c02

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



Re: ob-lilypond.el doesn't generate midi files

2022-10-31 Thread Ihor Radchenko
Jonathan Gregory  writes:

>> Yep, that's it. Modified ob-lilypond.el and recompiled it. 
>> Timidity works as helper, couldn't get vlc to work. Maybe the 
>> file ending should be modifiable via org-babel-lilypond-commands 
>> as well, or make ob-lilypond.el look for *.mid or *.midi. I'm 
>> pretty confident *.mid is the default setting for lilypond on 
>> win, and not my doing.
>
> I attached a patch to use a different suffix on Windows. Thanks 
> for your help.

Can someone with Windows check if this issue with lilypond using
different extension is still present?

If so, we can merge the patch.

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



Re: [PATCH] ob-sql: Respect database param when using dbconnection

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

> Hi,
>
> sorry for replying to a 2 year old thread.
> Attached is a new patch with the change from Kyle and
> I also added a news entry.
> Not sure if the text for the news entry is any good,
> or if there should be an example etc.
> Feedback welcome.
>
> Otherwise, the patch itself is not much and I use it daily.

Thanks!
Applied onto main with minor amendments to the commit message (I added
"." at the end of the sentences).
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=fbbc8b55cf3a39c85f8576321ec560baf4d2331a

P.S. ob-sql currently have no maintainer. Do you want to volunteer?

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



Re: Line breaks and brackets in LaTeX export

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

> On 22/10/2022 12:15, Ihor Radchenko wrote:
>> as long as the next line does not match
>> "^[ \t]*\\["
>
> Verse package defines \\! and \\>.
>
> The only precaution that search pattern should ignore \\\[0pt]\] that is 
> a display equation "0pt]"

Can you please elaborate?

>> 2. Modify org-latex-template to replace unnecessary occurrences of
>> "\\[0pt]" in CONTENTS when org-latex-compact-latex (you may propose
>> other defcustom names) is non-nil.
>
> I believe, it is better to introduce a list of filter functions that may 
> perform such optimizing.

I don't think so. Users can already define filters. What we discuss here
is a built-in filter. It should be separate from user customization and
only expose on/off options.

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



Re: [PATCH] [BUG] org.el: Fix first call of `org-paste-subtree'

2022-10-31 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Max Nikulin  writes:
>
>>> The main problem the old code solves is working around user error when
>>> kill-ring is empty. We do not really want to err in such cases; just
>>> handle empty kill ring specially.
>>
>>  From my point of view "kill ring is empty" user error clearly describes 
>> what happens in such case, so I do not see any point to spit suggestion 
>> to try simple yank instead.
>
>>> I agree that (and kill-ring ...) condition misses the system clipboard.
>>> The proper way to handle this issue is explicitly catching "Kill ring is
>>> empty" error thrown by `current-kill' (i.e. `condition-case').

Since I have no objections to the original patch, applied now.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=57abbd4b928752f2770898b09bbac8126b9d0eb3

I also reviewed the usage of (current-kill 0) in the code and applied
two additional improvements:
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=33cbb11d5a522c82dfd9730a0e028a9c3df11518
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5dc8ea0abee10a787160456f74672da6ff3c3b40

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



Re: org-assert-version considered harmful

2022-10-31 Thread Tim Cross


"Cook, Malcolm"  writes:

> Hello,
>
> I found this recent thread researching why my strategy for staying abreast 
> with org head had started failing with invalid-function
> "org-assert-version"
>
> My strategy had been to build org initially with
>
> ` cd ~/.emacs.d && git clone 
> https://git.savannah.gnu.org/git/emacs/org-mode.git &&   cd org-mode && make 
> autoloads && make
> ` 
> and ensure this clone of org was picked up in my "~/.emacs.d/org-mode/lisp by 
> including the following in my .init.el very early
> (right after bootstrapping the package system and use-package):
>
> (use-package 
>
>   :pin manual 
>
>   :load-path "~/.emacs.d/org-mode/lisp"
>
> )
>
> Then, when I occasionally wished to update org, I would
>
> `cd ~/.emacs.d/org-mode && git pull && make autoloads && make`
>
> Recently I started getting errors invalid-function "org-assert-version".
>
> Upon cursory reading of this thread I guessed that I could fix them by adding 
> a `make clean` to my update mantra.
>
> It worked.
>
> Am I advised to do otherwise?  Is there a best/better practice?
>

I think it is good practice to always do make clean for any code you
build from sources yourself. There is a reason most Makefiles have a
'clean' target and when it comes to building software, starting from a
known clean state is critical. This can make the build slower, but for
small packages like org mode, the difference is insignificant. Always
safer to do make clean before make. Alternative approaches really only
necessary in larger and more complex source trees where there can be
significant time differences between full and incremental builds
(i.e. Emacs source tree has 4 different 'clean' targets; clean,
extraclean, distclean and bootstrap).





Re: [correction]

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

> Don't worry, for the moment _@@  is fine for me

I think with font-lock-add-keywords it should work. I have put another
overlay on the tags, so that they are seen inside a box, separated by
":".

(defun overlay-dired-filetags ( lim)
  (when
  (re-search-forward "\\(_ftag_\\)\\(.+\\)" lim t)
(let
((ov (make-overlay (match-beginning 1) (match-end 1)))
 (tag (propertize " ⚜ " 'face 'bold))
 (ov-2 (make-overlay (match-beginning 2) (match-end 2)))
 (tags (propertize (replace-regexp-in-string
"_"
":"
(match-string 2))
   'font-lock-face
   '(:foreground "red" :box t
  (overlay-put ov 'overlay-tag t)
  (overlay-put ov 'display tag)
  (overlay-put ov-2 'overlay-tag-2 t)
  (overlay-put ov-2 'display tags

(font-lock-add-keywords
 'dired-mode
 '((overlay-dired-filetags (0  'font-lock-keyword-face t)))
 t)



RE: [External] : RE: org-assert-version considered harmful

2022-10-31 Thread Cook, Malcolm
> Malcolm,
> I also ran into troubles which are similar, apparently due to mixed org-mode 
> versions; we've got to load org-mode before emacs tries to do it for us or we 
> get mixed stuff.

Thanks Daniel, yes, I understand the need to load org early, and am sure that 
my approach succeeds in doing so (without the need to re-make emacs-master).

Nonetheless, I recently found that that the addition of a  `make clean` on 
org-mode was necessary to delete the compiled .elc files in which (apparently?) 
used macros whose definition had changed in the interim.

Cheers
> 
> My resolution was to load the org-mode path first in my init.el file and then 
> require org:
> (add-to-list 'load-path "/home/dortmann/src/git-org-mode/lisp")
> (require 'org)
> And then I build with something like this:
> dortmann@ddo-linux:src$ cd ~/src/git-org-contrib/ && git pull && cd 
> ~/src/git-org-mode/ && git pull && make all && make autoloads && cd 
> ~/src/git-emacs-master/ && git pull && make all && sudo -H make install && cd 
> ..
> 
> Then only an occasional 'make bootstrap' is required in the emacs build dir.
> 
> 
> 
> On 10/31/22 09:11, Cook, Malcolm wrote:
> Hello,
>  
> I found this recent thread researching why my strategy for staying abreast 
> with org head had started failing with invalid-function "org-assert-version"
>  
> My strategy had been to build org initially with
>  
>  
>` cd ~/.emacs.d && git clone 
> https://urldefense.com/v3/__https://git.savannah.gnu.org/git/emacs/org-mode.git__;!!ACWV5N9M2RV99hQ!NJTKsXYcJrTb8d5ZN-S1HlVfATQrUIHtWtEz4qZmvjlGuMcS-6MG89rA3dDSBwxECGJw1YoNopf635M$
>  &&   cd org-mode && make autoloads && make` 
>  
> and ensure this clone of org was picked up in my "~/.emacs.d/org-mode/lisp by 
> including the following in my .init.el very early (right after bootstrapping 
> the package system and use-package):
>  
> (use-package 
>   :pin manual 
>   :load-path "~/.emacs.d/org-mode/lisp"
> )
>  
> Then, when I occasionally wished to update org, I would
>  
>`cd ~/.emacs.d/org-mode && git pull && make autoloads && make`
> 
> Recently I started getting errors invalid-function "org-assert-version".
>  
> Upon cursory reading of this thread I guessed that I could fix them by adding 
> a `make clean` to my update mantra.
>  
> It worked.
>  
> Am I advised to do otherwise?  Is there a best/better practice?
>  
> Thanks,
>  
> ~Malcolm
> 
> 


Re: [External] : RE: org-assert-version considered harmful

2022-10-31 Thread Daniel Ortmann

Malcolm,
I also ran into troubles which are similar, apparently due to mixed 
org-mode versions; we've got to load org-mode before emacs tries to do 
it for us or we get mixed stuff.


My resolution was to load the org-mode path first in my init.el file and 
then require org:


   (add-to-list 'load-path "/home/dortmann/src/git-org-mode/lisp")
   (require 'org)

And then I build with something like this:

   dortmann@ddo-linux:src$ cd ~/src/git-org-contrib/ && git pull && cd
   ~/src/git-org-mode/ && git pull && make all && make autoloads && cd
   ~/src/git-emacs-master/ && git pull && make all && sudo -H make
   install && cd ..


Then only an occasional 'make bootstrap' is required in the emacs build dir.




On 10/31/22 09:11, Cook, Malcolm wrote:


Hello,

I found this recent thread researching why my strategy for staying 
abreast with org head had started failing with invalid-function 
"org-assert-version"


My strategy had been to build org initially with

` cd ~/.emacs.d && git clone 
https://git.savannah.gnu.org/git/emacs/org-mode.git 
 
& org-mode && make autoloads && make`


and ensure this clone of org was picked up in my 
"~/.emacs.d/org-mode/lisp by including the following in my .init.el 
very early (right after bootstrapping the package system and use-package):


(use-package

:pin manual

:load-path "~/.emacs.d/org-mode/lisp"

)

Then, when I occasionally wished to update org, I would

`cd ~/.emacs.d/org-mode && git pull && make autoloads && make`

Recently I started getting errors invalid-function "org-assert-version".

Upon cursory reading of this thread I guessed that I could fix them by 
adding a `make clean` to my update mantra.


It worked.

Am I advised to do otherwise?Is there a best/better practice?

Thanks,

~Malcolm



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

2022-10-31 Thread Joseph Turner
No worries!!

Have a good day :)

On October 30, 2022 11:02:18 PM PDT, Ihor Radchenko  wrote:
>Ihor Radchenko  writes:
>
>>> Good catch! I will submit a v3 patch.
>>
>> Did you have a chance to work on the patch?
>
>Oops. I missed that you did and I even merged it. :facepalm:
>Sorry for the noise.
>
>-- 
>Ihor Radchenko // yantar92,
>Org mode contributor,
>Learn more about Org mode at .
>Support Org development at ,
>or support my work at 


Something don't work

2022-10-31 Thread Renato Pontefice
I have done this line on my renato.org file:

** TODO  prova di domenica <2022-10-31 Mon 19:35>

So for today at 19:35 I should have an entry in agenda. Isn’t it?

But, If I press C-a a
I receive this agenda:

Week-agenda (W44):
Monday 31 October 2022 W44
Tuesday 1 November 2022
Wednesday   2 November 2022
Thursday3 November 2022
Friday  4 November 2022
Saturday5 November 2022
Sunday  6 November 2022


With nothing on 31 October.
I’m wondering: where do my init.el must reside to let emacs read it?
Because on my Mac, I have on .emacs.d folder an nit.el here 
Users//.emacs.d/
With that entry:
;;-- file utilizzati  per TODO list in Agenda
(setq org-agenda-files
  '( "/Volumes/renato07/renato.org"
 ))

Is not that the file that emacs read?

TIA


Renato


How to set folder where to find files to look for Agenda

2022-10-31 Thread Renato Pontefice
Hi,
With this expression on my init.el, I would set that Agenda view, looks for 
this folder and sub folder that reside on a cloud to look for informarion that 
need to be shown on Agenda view.

(setq org-agenda-files
  '( "\Volumes\renato07"
 ))
———

But it seems it does not happens

In the folder renato 07 I have many .org file that can be part of Agenda, but 
if I press C-a a I see an empty agenda, like if the files are not considerate

Do I need a final / (slash)?

Thank you

Renato


Re: [correction]

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

> Uwe Brauer writes:
>> Still gets displayed as 
>> my-auctex-init_ftag_emacs.el
>> 
>> What do I miss?

> You're right, sorry. I'm afraid I was too hasty and the code from the
> other message, as I put it, will never work :-).

> You can test how it looks, however, if you evaluate the function in a
> dired buffer, but the moment you revert the buffer the overlay is lost,
> as expected.

Right, that I can confirm


> That has to be solved in another way. Perhaps some code from the
> all-the-icons-dired package can be reused.


Don't worry, for the moment _@@  is fine for me
> 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: [correction]

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

> Still gets displayed as 
> my-auctex-init_ftag_emacs.el
>
> What do I miss?

You're right, sorry. I'm afraid I was too hasty and the code from the
other message, as I put it, will never work :-).

You can test how it looks, however, if you evaluate the function in a
dired buffer, but the moment you revert the buffer the overlay is lost,
as expected.

That has to be solved in another way. Perhaps some code from the
all-the-icons-dired package can be reused.

Best regards,

Juan Manuel 



Re: [correction]

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

> Uwe Brauer writes:
>> %% does not work for auctex, so I think I try @@, I hope it does not collide 
>> with anything fancy..

> You can also set a text string, like _ftags_, and to hide it when you're
> in Dired, add a function to the dired-mode-hook that displays an overlay
> instead of that string, with some fancy unicode symbol separated by
> spaces. Something like this:

> (defun overlay-dired-filetags ()
>   (save-excursion
> (goto-char (point-min))
> (while
>   (re-search-forward "\\(_ftag_\\)" nil t)
>   (let
> ((ov (make-overlay (match-beginning 1) (match-end 1)))
>  (tag (propertize " ⚜ " 'face 'bold)))
>   (overlay-put ov 'overlay-tag t)
>   (overlay-put ov 'display tag)

> However, in large directories I don't know how that would affect
> performance.


Hm I tried out 

(defun overlay-dired-filetags ()
  (save-excursion
(goto-char (point-min))
(while
(re-search-forward "\\(_ftag_\\)" nil t)
  (let
  ((ov (make-overlay (match-beginning 1) (match-end 1)))
   (tag (propertize " ⚜ " 'face 'bold)))
(overlay-put ov 'overlay-tag t)
(overlay-put ov 'display tag)


(add-hook 'dired-mode-hook 'overlay-dired-filetags)

But 
my-auctex-init_ftag_emacs.el

Still gets displayed as 
my-auctex-init_ftag_emacs.el

What do I miss?


smime.p7s
Description: S/MIME cryptographic signature


Re: [correction]

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

> Uwe Brauer writes:
>> %% does not work for auctex, so I think I try @@, I hope it does not collide 
>> with anything fancy..

> You can also set a text string, like _ftags_, and to hide it when you're
> in Dired, add a function to the dired-mode-hook that displays an overlay
> instead of that string, with some fancy unicode symbol separated by
> spaces. Something like this:

> (defun overlay-dired-filetags ()
>   (save-excursion
> (goto-char (point-min))
> (while
>   (re-search-forward "\\(_ftag_\\)" nil t)
>   (let
> ((ov (make-overlay (match-beginning 1) (match-end 1)))
>  (tag (propertize " ⚜ " 'face 'bold)))
>   (overlay-put ov 'overlay-tag t)
>   (overlay-put ov 'display tag)

Very nice thanks, I might try that out later


smime.p7s
Description: S/MIME cryptographic signature


Re: [correction]

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

> %% does not work for auctex, so I think I try @@, I hope it does not collide 
> with anything fancy..

You can also set a text string, like _ftags_, and to hide it when you're
in Dired, add a function to the dired-mode-hook that displays an overlay
instead of that string, with some fancy unicode symbol separated by
spaces. Something like this:

(defun overlay-dired-filetags ()
  (save-excursion
(goto-char (point-min))
(while
(re-search-forward "\\(_ftag_\\)" nil t)
  (let
  ((ov (make-overlay (match-beginning 1) (match-end 1)))
   (tag (propertize " ⚜ " 'face 'bold)))
(overlay-put ov 'overlay-tag t)
(overlay-put ov 'display tag)

However, in large directories I don't know how that would affect
performance.

Best regards,

Juan Manuel 



Re: [correction]

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

> Uwe Brauer writes:
>> - "_&&_" seems to be ok but I am not entirely sure about it

> "&&" will give you trouble if you manipulate the file in a shell,
> because it will be understood as the '&&' operator. You would have to
> use escape characters.

> Maybe "@@" or "%%" are safer choices. Look at this screenshot:


%% does not work for auctex, so I think I try @@, I hope it does not collide 
with anything fancy..
> https://i.imgur.com/eGXepU3.png

> 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: [correction]

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

>- "_&&_" seems to be ok but I am not entirely sure about it

"&&" will give you trouble if you manipulate the file in a shell,
because it will be understood as the '&&' operator. You would have to
use escape characters.

Maybe "@@" or "%%" are safer choices. Look at this screenshot:

https://i.imgur.com/eGXepU3.png

Best regards,

Juan Manuel 



Re: [BUG] ox-odt file: links are not pointing to the real files (was: [BUG] ox-odt fails for org-id links (e.g., from org-roam v2) [9.5.2 (9.5.2-gfbff08 @ /home/moritz/.emacs.d/elpa/27.2/develop/org-9

2022-10-31 Thread Max Nikulin

On 31/10/2022 13:13, Ihor Radchenko wrote:



You are right. file.odt is a virtual folder representing ZIP container,
so relative links to external files should be prefixed with "../".


Thanks for checking!
See the attached tentative patch.

-(org-export-file-uri raw-path))
+ (pcase (org-export-file-uri raw-path)


[[file:~/examples/org/odt-id/file-b.org]] link is exported as 
./file:///home/user/examples/org/odt-id/file-b.org



+   (`(and (pred #'file-name-absolute-p) ,path)
+path)
+   (path
+;; OpenOffice treats base directory inside the odt
+;; archive.  The directory containing the odt file
+;; is "../".
+(concat "../" path


A couple of other notes.

In HTML top or #top works as a link to the beginning of 
the document. I am curious if ODF has a similar feature. I mean ID at 
the top of the same file that generates file.org link instead of 
internal one for both HTML and ODF formats.


It seems org-id.el should be extended to handle some features common to 
all formats such as custom suffix instead of ".org"






RE: org-assert-version considered harmful

2022-10-31 Thread Cook, Malcolm
Hello,

I found this recent thread researching why my strategy for staying abreast with 
org head had started failing with invalid-function "org-assert-version"

My strategy had been to build org initially with


` cd ~/.emacs.d && git clone 
https://git.savannah.gnu.org/git/emacs/org-mode.git &&   cd org-mode && make 
autoloads && make`

and ensure this clone of org was picked up in my "~/.emacs.d/org-mode/lisp by 
including the following in my .init.el very early (right after bootstrapping 
the package system and use-package):

(use-package
  :pin manual
  :load-path "~/.emacs.d/org-mode/lisp"
)

Then, when I occasionally wished to update org, I would

`cd ~/.emacs.d/org-mode && git pull && make autoloads && make`

Recently I started getting errors invalid-function "org-assert-version".

Upon cursory reading of this thread I guessed that I could fix them by adding a 
`make clean` to my update mantra.

It worked.

Am I advised to do otherwise?  Is there a best/better practice?

Thanks,

~Malcolm


Re: [correction]

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

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

> I haven't looked at the code, but I imagine that the information is
> stored in the variables I mentioned before, when you use a controlled
> vocabulary for the tags. You can also store them in a .filetags file.
> See: https://github.com/DerBeutlin/filetags.el#usage


Thanks, just some comments. 

I played bit with the format of the separators.

1. I don't want space in my file names, so I set
   (setq filetags-delimiter-between-tags "_")

2. I want filetags-delimiter-between-filename-and-tags to be

   - Clearly visiable

   - Easily to find

   - not in conflict with other programs.

   - So I tried (setq filetags-delimiter-between-filename-and-tags
 "_**_")  not good for searching

   - "_::_" is not very visiable

   - "_##_" is in conflict with the latexviewers when you have
 forward and backward search on in pdf files.

   - "_&&_" seems to be ok but I am not entirely sure about it


Any comments?

Regards

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: [correction]

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

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

I haven't looked at the code, but I imagine that the information is
stored in the variables I mentioned before, when you use a controlled
vocabulary for the tags. You can also store them in a .filetags file.
See: https://github.com/DerBeutlin/filetags.el#usage

Best regards,

Juan Manuel 



Re: [off-topic] E-readers and Org-Mode

2022-10-31 Thread Juan Manuel Macías
Max Nikulin writes:

> P.S. Concerning free PDF annotation tool, I have not tested if it is
> convenient and available on Android, but Firefox-106 release notes
> have the following entry:
>
>> It is now possible to edit PDFs: including writing text, drawing,
>   and adding signatures.
>
> Almost certainly "edit" in their parlance in namely annotations, not
> real changes of PDF structure.

Interesting, I'll take a look at it. I haven't used firefox as my
default browser in a while. On desktop and laptop I use a combination of
Eww and Qutebrowser, which is more keyboard oriented. I have Firefox
almost relegated to negotiations with the Spanish government, such as
taxes and little else. On mobile I use Brave browser. And lately I've
noticed that it's not as hard as I thought to navigate with Eww-mode in
Termux/Emacs by touch! :-)

BTW, I have found another free app to annotate PDF on Android, KOReader:
https://f-droid.org/en/packages/org.koreader.launcher.fdroid/ It is
mainly intended for e-ink screen e-readers. It's under active
development as well (https://github.com/koreader), and even offers
builds and tutorials for installing it on specific non-Android devices
(Kobo, reMarkable, etc.).

I have tried to make some annotations on a PDF to open it later on the
desktop pc. Annotations are correctly read by pdf-tools, Atril, Evince,
Okular, etc. And they are also exported correctly to Org via the
org-noter function org-noter-create-skeleton, which I didn't know about
and is tremendously useful.

Best regards,

Juan Manuel 



Re: One thing each 3 days but maximum 10

2022-10-31 Thread Quiliro Ordóñez
El 2022-10-30 23:57, Jean Louis escribió:
> * 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>


Isn't it much easier to copy the first one and change the day, instead
of going through the learning curve of database administration?  Of
course that, if you have a bazooka, you can even write a love letter
with it.  But would it be right tool?



Re: LIterate programming with calc (help)

2022-10-31 Thread Fraga, Eric
On Monday, 31 Oct 2022 at 09:23, Ihor Radchenko wrote:
> I looked into ob-calc and it looks like the way to define variables is
> via :var header argument.

Indeed.  Something like :var a="300 m" does work.

> I guess that the main problem is that calc is tightly integrated with
> interactive commands. Maybe ob-calc could be extended to somehow
> indicate the commands to be executed in addition to inputting stack
> entries.
>
> Not sure if there is much interest in such feature though.

Thinking out loud, what would be better, but I have no idea how feasible
it would be, would be to have ob-calc make use of the embedded calc
functionality and syntax, so that you could write something like this:

#+begin_src calc
a := 300 m
b := 2 a =>
#+end_src

which would output the result of any line with => on it.

-- 
: Eric S Fraga, with org release_9.5.5-1028-gcd835d in Emacs 29.0.50


Re: indent-tabs-mode in org

2022-10-31 Thread Bastien Guerry
Hi Daniel and Ihor,

Daniel Kraus  writes:

> So that clarifies it for me and I do NOT indent with tabs in the
> future :)

We can progressively replace tab chars with spaces, thus re-indenting
correctly all files in the repository.

The Emacs convention is to *not* commit space-only changes as they may
create merge conflicts.

For files that do not have pending patches, we can do the replacement
with the next code-related change.

2 cts,

-- 
 Bastien



Re: LIterate programming with calc (help)

2022-10-31 Thread Ihor Radchenko
Ypo  writes:

> Would it be something like this?
>
> #+begin_src calc
>    a = 300 m
>    b = 300 m
>    Area = a*b
>    cost = 1 ($/m^2)
>    A*c
>
> #+end_src

I looked into ob-calc and it looks like the way to define variables is
via :var header argument.

Other than that, ob-calc simply does what calc would do if you type the
above into calc stack. Which would also yield nothing.

I guess that the main problem is that calc is tightly integrated with
interactive commands. Maybe ob-calc could be extended to somehow
indicate the commands to be executed in addition to inputting stack
entries.

Not sure if there is much interest in such feature though.

-- 
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-31 Thread Ihor Radchenko
Jean Louis  writes:

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

Indeed. I was expecting a link describing the concepts. What your
provided was not very helpful.

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

Somewhat harder. Somewhat simpler. We do not support some features
ASCIIDOC supports. ASCIIDOC does not support spreadsheet features of Org
tables. That's why we need context. We cannot blindly copy from
ASCIIDOC.

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

Sure. But we have different proposals in the previous emails. Compared
to the existing proposals, this looks unreadable. (which does not mean
that it is worse - maybe ASCIIDOC has more flexibility; but less
readable compared to other proposals for sure).

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

Thanks for the link! This specific link is out of scope of this
discussion (I do not think that we need to specify formatting for the
whole column), but another link nearby looks more useful:
https://docs.asciidoctor.org/asciidoc/latest/tables/span-cells/

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

Please open a discussion about other attributes in a separate thread.
Let's stay on the topic of merging cells and columns in this thread.
It is already difficult enough.

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

I think a slightly more clear example is (from the link; they also
provide how html export of the below table looks like)

|===
|Column 1, header row |Column 2, header row |Column 3, header row |Column 4, 
header row

|Cell in column 1, row 2
2.3+|This cell spans columns 2 and 3 and rows 2, 3, and 4 because its specifier 
contains a span of `2.3+`
|Cell in column 4, row 2

|Cell in column 1, row 3
|Cell in column 4, row 3

|Cell in column 1, row 4
|Cell in column 4, row 4
|===

I can see the idea here. For columns, it is similar to Timothy's ,
but uses a number. For rows, I'm afraid that we cannot use the same
approach because of conceptually different table structure.

Takeaway:
TEC's:
|   Sales  |
can become
|2+|Sales  |

> 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%\"]
> ...
> |===
> " | asciidoctor -e -o - -
>
> #+END_SRC

Indeed. But it is not what we are discussing here.
We are discussing concrete ideas to implement feature X. X being merged
table cells. Let's not sidestep into other topics.

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



Re: Option that prevents Org to add \lstset{language=⟨language⟩,...} when code blocks are exported to LaTeX

2022-10-31 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Denis Bitouzé  writes:
>
>> Otherwise, all the options specified by `\lstset` can be applied as an
>> option of the `lstlisting` environment:
>>
>>   ┌
>>   │ \begin{lstlisting}[language=⟨language⟩,...]
>>   └
>
> This should be the safest and the least verbose.
>
> I implemented the suggestion in the attached patch.

Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=6ef33b6dd6e61d5e8bccb5b086f9f09500e81fab

Fixed.

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



Re: org-sbe recent changes?

2022-10-31 Thread Alan Schmitt
Hello,

On 2022-10-31 01:24, Ihor Radchenko  writes:

> 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

Of course, sorry I did not do it. Here is a minimal example:

#+name: foo
#+begin_src emacs-lisp
3
#+end_src

| Name  | Test |
|---+--|
| Hello |  |
#+TBLFM: @2$2..@>$2='(org-sbe foo)


When I evaluate the formula, I get #ERROR instead of 3 in the cell. This
is with org 9.6. I have another emacs setup with 9.5.5 and there I have
the correct result.

Best,

Alan


signature.asc
Description: PGP signature


Re: [PATCH] ob-sql: Respect database param when using dbconnection

2022-10-31 Thread Daniel Kraus
Hi,

sorry for replying to a 2 year old thread.
Attached is a new patch with the change from Kyle and
I also added a news entry.
Not sure if the text for the news entry is any good,
or if there should be an example etc.
Feedback welcome.

Otherwise, the patch itself is not much and I use it daily.

Thanks,
  Daniel

>From cd170dd691ba12ec81ef5c71db2868b33cd63ddf Mon Sep 17 00:00:00 2001
From: Daniel Kraus 
Date: Mon, 31 Oct 2022 07:52:09 +0100
Subject: [PATCH] ob-sql.el: Respect all params when using dbconnection

* etc/ORG-NEWS (Miscellaneous): Document change
* lisp/ob-sql.el (org-babel-find-db-connection-param): Make it
possible to overwrite parameters that are set from :dbconnection
---
 etc/ORG-NEWS   | 14 ++
 lisp/ob-sql.el | 24 
 2 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 6e875deb6..b542da34b 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -457,6 +457,20 @@ The new variable name is =org-plantuml-args=.  It now applies to both
 jar PlantUML file and executable.
 
 ** Miscellaneous
+*** SQL Babel ~:dbconnection~ parameter can be mixed with other SQL Babel parameters
+
+Before you could either specify SQL parameters like ~:dbhost~,
+~:dbuser~, ~:database~, etc or a ~:dbconnection~ parameter which looks
+up all other parameters from the ~sql-connection-alist~ variable.  Now
+it's possible to specify a ~:dbconnection~ and additionally other
+parameters that will add or overwrite the parameters coming from
+~sql-connection-alist~.
+
+E.g. if you have a connection in your ~sql-connection-alist~ to a
+server that has many databases, you don't need an entry for every
+database but instead can just specify ~:database~ next to your
+~:dbconnection~ parameter.
+
 *** Post-processing code blocks can return an empty list
 
 When the result of a regular code block is nil, then that was already
diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index d1256bf83..626d595c9 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -222,18 +222,18 @@ then look for the parameter into the corresponding connection
 defined in `sql-connection-alist', otherwise look into PARAMS.
 See `sql-connection-alist' (part of SQL mode) for how to define
 database connections."
-  (if (assq :dbconnection params)
-  (let* ((dbconnection (cdr (assq :dbconnection params)))
- (name-mapping '((:dbhost . sql-server)
- (:dbport . sql-port)
- (:dbuser . sql-user)
- (:dbpassword . sql-password)
- (:dbinstance . sql-dbinstance)
- (:database . sql-database)))
- (mapped-name (cdr (assq name name-mapping
-(cadr (assq mapped-name
-(cdr (assoc dbconnection sql-connection-alist)
-(cdr (assq name params
+  (or (cdr (assq name params))
+  (and (assq :dbconnection params)
+   (let* ((dbconnection (cdr (assq :dbconnection params)))
+  (name-mapping '((:dbhost . sql-server)
+  (:dbport . sql-port)
+  (:dbuser . sql-user)
+  (:dbpassword . sql-password)
+  (:dbinstance . sql-dbinstance)
+  (:database . sql-database)))
+  (mapped-name (cdr (assq name name-mapping
+ (cadr (assq mapped-name
+ (cdr (assoc dbconnection sql-connection-alist
 
 (defun org-babel-execute:sql (body params)
   "Execute a block of Sql code with Babel.
-- 
2.38.1


Stefano Rodighiero  writes:

> On Mon, Jun 1, 2020 at 4:16 AM Kyle Meyer  wrote:
>
> Daniel Kraus writes:
>>
>> > I use ob-sql with the :dbconnection param so I don't have my username
>> and password in my org file.
>> > But often I don't want to use the default database from the dbconnection
>> alist but
>> > rather specify it explicitly with :database.
>> > Attached is a patch that fixes this.
>>
>
> Thank you @Daniel
>
>
>> […]
>> From what I can gather from your description, this looks reasonable.
>> I'm not an ob-sql user, so perhaps I missing something, but would it
>> make sense for any connection parameter to take precedence if explicitly
>> given in the source block header (i.e. something like the patch below)?
>> [+cc Stefano, who added the :dbconneciton feature.]
>>
>
> I think it makes sense.
>
> (I personally handle cases like those described by Daniel differently,
> keeping distinct sql-connection-alist entries for each DB
> param combination I might need, but I can imagine why someone
> would want to "override" the database or the host params.
> For port, user and password I have more difficulties imagining a
> case where combinations of those params would need override,
> but I think @Kyle's generic solution is better)
>
> s.


Re: One thing each 3 days but maximum 10

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

> If we ask Org documentation what is "repeater", then I get this
> information:
>
> Timestamp with repeater interval
>  A timestamp may contain a _repeater interval_, indicating that it
>  applies not only on the given date, but again and again after a
>  certain interval of N days (d), weeks (w), months (m), or years
>  (y).  The following shows up in the agenda every Wednesday:
>
>   * Pick up Sam at school
> <2007-05-16 Wed 12:30 +1w>
>
> And that excludes hours, unspoken of other intervals. 

Thanks for pointing this out!
Hours are, in fact, allowed.
Fixed the manual now.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5098404b19962042cd29ad86e11ccb43ac566953

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



Re: [BUG] ox-odt file: links are not pointing to the real files (was: [BUG] ox-odt fails for org-id links (e.g., from org-roam v2) [9.5.2 (9.5.2-gfbff08 @ /home/moritz/.emacs.d/elpa/27.2/develop/org-9

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

> On 22/10/2022 12:03, Ihor Radchenko wrote:
>> 
>> Probably, href=file.org is treated as a link to resource packed inside
>> .odt file.
>
> You are right. file.odt is a virtual folder representing ZIP container, 
> so relative links to external files should be prefixed with "../".

Thanks for checking!
See the attached tentative patch.

>From 17077b56b60a59b3b8c8d6a3634fe4ad532d114b Mon Sep 17 00:00:00 2001
Message-Id: <17077b56b60a59b3b8c8d6a3634fe4ad532d114b.1667196812.git.yanta...@posteo.net>
From: Ihor Radchenko 
Date: Mon, 31 Oct 2022 14:11:19 +0800
Subject: [PATCH] org-odt-link: Fix relative file links

* lisp/ox-odt.el (org-odt-link): Append an extra "../" to relative
links.  This is needed to conform with OpenOffice convention to treat
base path inside the odt archive.  The path containing the odt file is
thus "../".

Reported-by: Ihor Radchenko 
Link: https://orgmode.org/list/87ilkc30wd.fsf@localhost
---
 lisp/ox-odt.el | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 15a9cf2de..eac9cf82b 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -2688,7 +2688,14 @@ (defun org-odt-link (link desc info)
 		((member type '("http" "https" "ftp" "mailto"))
 		 (concat type ":" raw-path))
 		((string= type "file")
-		 (org-export-file-uri raw-path))
+ (pcase (org-export-file-uri raw-path)
+   (`(and (pred #'file-name-absolute-p) ,path)
+path)
+   (path
+;; OpenOffice treats base directory inside the odt
+;; archive.  The directory containing the odt file
+;; is "../".
+(concat "../" path
 		(t raw-path)))
 	 ;; Convert & to  for correct XML representation
 	 (path (replace-regexp-in-string "&" "" path)))
-- 
2.35.1



-- 
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-31 Thread Jean Louis
* Ihor Radchenko  [2022-10-31 08:15]:
> 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.

I am afraid you forgot the fact that prescriptions have variable time
periods. It is rather unusual to take pills every 3 days, and rather
common for many diseases to take pills every 8 or 12 hours.

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

If we ask Org documentation what is "repeater", then I get this
information:

Timestamp with repeater interval
 A timestamp may contain a _repeater interval_, indicating that it
 applies not only on the given date, but again and again after a
 certain interval of N days (d), weeks (w), months (m), or years
 (y).  The following shows up in the agenda every Wednesday:

  * Pick up Sam at school
<2007-05-16 Wed 12:30 +1w>

And that excludes hours, unspoken of other intervals. 

That renders the function `org-clone-subtree-with-time-shift' not
suitable for prescription notification.

In fact it is great health risk to recommend to people to use Org to
track one's medical treatment due to too many "bugs" involved.

And here is hours "repeater" by using external tool PostgreSQL:

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

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

** TODO Take pill again
  SCHEDULED: <2022-10-28 08:00:00+03>

** TODO Take pill again
  SCHEDULED: <2022-10-28 16:00:00+03>

** TODO Take pill again
  SCHEDULED: <2022-10-29 00:00:00+03>

** TODO Take pill again
  SCHEDULED: <2022-10-29 08:00:00+03>

** TODO Take pill again
  SCHEDULED: <2022-10-29 16:00:00+03>

** TODO Take pill again
  SCHEDULED: <2022-10-30 00:00:00+03>

** TODO Take pill again
  SCHEDULED: <2022-10-30 08:00:00+03>

** TODO Take pill again
  SCHEDULED: <2022-10-30 16:00:00+03>

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

** TODO Take pill again
  SCHEDULED: <2022-10-31 08:00:00+03>

** TODO Take pill again
  SCHEDULED: <2022-10-31 16:00:00+03>

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

** TODO Take pill again
  SCHEDULED: <2022-11-01 08:00:00+03>

** TODO Take pill again
  SCHEDULED: <2022-11-01 16:00:00+03>

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

** TODO Take pill again
  SCHEDULED: <2022-11-02 08:00:00+03>

** TODO Take pill again
  SCHEDULED: <2022-11-02 16:00:00+03>

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

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

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

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



-- 
Jean

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

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



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

2022-10-31 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> Good catch! I will submit a v3 patch.
>
> Did you have a chance to work on the patch?

Oops. I missed that you did and I even merged it. :facepalm:
Sorry for the noise.

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