Re: An academic journal entirely made in Org-Mode

2024-01-29 Thread tomas
On Mon, Jan 29, 2024 at 08:03:36PM +, Juan Manuel Macías wrote:
> Hi,
> 
> In last December, issue 23 of the "Revista de Estudios Latinos" (Journal
> of Latin Studies) was published, sponsored by the Spanish Society of
> Latin Studies. It is designed and produced by me using Org-Mode,
> Org-Publish and LuaTeX. If anyone is interested in the code I used for
> specific aspects of the publication, I can share it here :-).

Very nice, thanks :)

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: org-icalendar export problems

2024-01-29 Thread Jack Kamm
ypuntot  writes:

> Problem! Found 1 error
>
> Errors
> Lines not delimited by CRLF sequence near line # 1
> Reference: RFC 5545 3.1. Content Lines

Which version of Org are you using? (M-x org-version)

Org 9.7 (unreleased) contains some fixes for how ox-icalendar handles
newlines. If you are using a previous version of Org, please try out the
latest main branch and see if it fixes the problem.



Re: org-icalendar export problems

2024-01-29 Thread ypuntot
The validator says as follows:

Results
File Size: 19544 lines, 434248 bytes
Number of events found: 103
Number of to-do's found: 541
Problem! Found 10 warnings

Warnings
Blank line detected, specification does not address the use of blank lines near 
line # 9
Blank line detected, specification does not address the use of blank lines near 
line # 11
Blank line detected, specification does not address the use of blank lines near 
line # 13
Blank line detected, specification does not address the use of blank lines near 
line # 15
Blank line detected, specification does not address the use of blank lines near 
line # 17
Blank line detected, specification does not address the use of blank lines near 
line # 19
Blank line detected, specification does not address the use of blank lines near 
line # 21
Blank line detected, specification does not address the use of blank lines near 
line # 23
Blank line detected, specification does not address the use of blank lines near 
line # 26
Blank line detected, specification does not address the use of blank lines near 
line # 28

Problem! Found 1 error

Errors
Lines not delimited by CRLF sequence near line # 1
Reference: RFC 5545 3.1. Content Lines

Jan 30, 2024 04:30:10 Jack Kamm :

> Ihor Radchenko  writes:
> 
>> CCing ox-icalendar maintainer.
>> 
>> ypuntot  writes:
>> 
>>> I am trying to create an android calendar based on the agenda, and the 
>>> first problem I am finding it's that I can't import it into android 
>>> (ICSx^5). I am receiving these errors when trying to do it:
>>> 
>>> Couldn't parse iCalendar ...
>> 
>> May you be able to share the problematic icalendar file?
> 
> If you're not comfortable sharing the icalendar file on a public mail
> list, you could also try out the iCalendar validator, which may help to
> identify the issue with the ics file:
> 
> https://icalendar.org/validator.html
> 
> FWIW, I did try out ICSx5 with the exported ics from a simple Org file,
> and it worked. So we'll need more specific information to fix the
> problem.



Re: bug#68687: [PATCH] Use text/org media type

2024-01-29 Thread Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > I think Richard lacks the broader context: that text/org is supposed
  > to appear in the Content-Type header in email messages, and the MUA is
  > supposed to display this content in received email messages according
  > to user expectations, which generally follow how Org buffers display
  > text.

Thanks/ I had a feeling that it was something along roughtly those
lines, but I was not sure.  Now I know.

I am concerned that the actions described above would tend to embed
Org format and Org mode more deeply into Emacs usage.

Suppose A and B are Org users.  If A knows this, and mails B a message
which contains text labaled as text/org, that won't make anyone
unhappy.  No one would have a reason to complain.

But what if C mails a message to D with text labeled as text/org and D
is not an Org user?  Will that cause Emacs to load Org?  It should
not.

What will Gnus do when the user readss a message with text labaled as
text/org?  What will Rmail do?  What will MH-E do?

These are crucial questions because the answers would determine
whether this feature pressures people to use Org mode or not.  We need
concrete answers because only that would enable us to see cleary now
whether the feature would do that if in use.

Max Nikulin  wrote:

Received or fetched Org 
  > files must be treated with some precautions, but it is another story.

I was not aware of this issue.  Let's look at it concretely now so we
can determine what its implications are.  Have people already written
a list of these precautions?  If so, I'd like to see it.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





Re: org-icalendar export problems

2024-01-29 Thread Jack Kamm
Ihor Radchenko  writes:

> CCing ox-icalendar maintainer.
>
> ypuntot  writes:
>
>> I am trying to create an android calendar based on the agenda, and the first 
>> problem I am finding it's that I can't import it into android (ICSx^5). I am 
>> receiving these errors when trying to do it:
>>
>> Couldn't parse iCalendar ...
>
> May you be able to share the problematic icalendar file?

If you're not comfortable sharing the icalendar file on a public mail
list, you could also try out the iCalendar validator, which may help to
identify the issue with the ics file:

https://icalendar.org/validator.html

FWIW, I did try out ICSx5 with the exported ics from a simple Org file,
and it worked. So we'll need more specific information to fix the
problem.



Re: [PATCH v2] org-id: allow using parent's existing id in links to headlines

2024-01-29 Thread Samuel Wales
On 1/29/24, Ihor Radchenko  wrote:
> You mentioned this feature request in the past. It is not forgotten.

thank you.

> May you please elaborate what you want to add to the manual and where?

had been merely thinking mentioning non-brittleness for newcomers.

in handling links.

but MAYBE also org-id could be slightly more integrated in org, such
as not having to load the library.  9.6 info (info "(org) Handling
Links") has context of org buffers.  in future, i'd like to link to
org-id in non-org files.  (info "(org) Include Files") does not
mention whether org-id works.  could eliminate the need to specify
file.



Re: An academic journal made entirely in Org-Mode

2024-01-29 Thread William Denton
On Monday, January 29th, 2024 at 15:05, Juan Manuel Macías 
 wrote:

> In last December, issue 23 of the "Revista de Estudios Latinos" (Journal
> of Latin Studies) was published, sponsored by the Spanish Society of
> Latin Studies. It is designed and produced by me using Org-Mode,
> Org-Publish and LuaTeX. If anyone is interested in the code I used for
> specific aspects of the publication, I can share it here :-).

Fantastic work!  Congratulations.  Open scholarship in every sense of the word. 
 I'd love to see how you handled the publishing of such a complex project.  
(And what citation style is used by that journal?)

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada




Search and replace excluding code blocks?

2024-01-29 Thread Vikas Rawal
Hi all,

Is it possible to search and replace a regex/string in an org file
excluding the code blocks from its scope?

Say, I want to replace all opening quotes (") by backticks(``) in the text
but not in the code blocks. Is there a way one could achieve that?

Thanks,

Vikas


Re: An academic journal entirely made in Org-Mode

2024-01-29 Thread Dr. Arne Babenhauserheide
Hi,

Juan Manuel Macías  writes:

> Org-Publish and LuaTeX. If anyone is interested in the code I used for
> specific aspects of the publication, I can share it here :-).

That sounds very interesting! I’m writing roleplaying books and my
website with org-mode and since there are many small pieces I found over
the years, I expect that the solved problems for a journal will be very
educational!

> https://recyt.fecyt.es/index.php/rel/issue/view/4327/948

One small thing: the boxes for the abstract look pretty nice! How to
create the complex tables on page 109ff would also be great to know.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de


signature.asc
Description: PGP signature


Re: [BUG] beamer export

2024-01-29 Thread Leo Butler
On Fri, Jan 26 2024, Leo Butler  wrote:

> On Fri, Jan 26 2024, Ihor Radchenko  wrote:
>
>> Leo Butler  writes:
>>
 Apparently, LaTeX has really hard time processing verbatim code inside
 beamer frames.
>>>
>>> I looked again at the solution here:
>>> https://tex.stackexchange.com/questions/140719/verbatim-in-beamer-showing-error-file-ended-while-scanning-use-of-xverbatim
>>>
>>> and it errors out with a recent version of pdflatex:
>>>
>>>This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) 
>>> (preloaded format=pdflatex)
>>>
>>> This is, apparently, a known problem:
>>>
>>> https://github.com/josephwright/beamer/issues/360
>>>
>>> The end of that issue report includes a work-around that we might apply
>>> in org. I have attached a patch for your feedback. The example that
>>> stimulated this discussion compiles with the patch and the testsuite
>>> shows no errors related to it.
>>
>> Thanks!
>> I have concerns about your approach though.
>>
>> You are replacing all the frame environments with custom environment
>> unconditionally. However, custom environment has downsides. For example,
>> \againframe will stop working, as pointed earlier in the linked beamer
>> thread
>> https://github.com/josephwright/beamer/issues/360#issuecomment-708705250
>
> The comment that you are citing shows how to define the custom
> environment so that \againframe works correctly. See the attachment
> `beamer-example-againframe.tex' and pdf. You can see that \againframe
> works with the custom environment.
>
>>
>> Since the problem appears only when the frame contents contains
>> \end{frame}, it may be sufficient to replace the standard frame
>> environment with the workaround only in such scenario.
>
> Yes, that might be true. But my feeling is that it would be simpler and
> more robust to use the custom frame environment in most cases.

Replying to self: Attached is a patch that adds a property,
BEAMER_FRAME, that lets the frame environment name be set on a
frame-by-frame basis. In addition, it typesets any fragile frame in the
`orgframe' environment. I am not sure if the latter is really needed,
given the former.

Comments?

Leo

From d0117ca35405654c6adc003252eff5a1f629b67a Mon Sep 17 00:00:00 2001
From: Leo Butler 
Date: Thu, 25 Jan 2024 09:48:20 -0600
Subject: [PATCH] lisp/ox-beamer.el:  customize the beamer frame environment
 name

* lisp/ox-beamer.el (org-beamer-frame-environment): A new customize
variable that contains the name of an environment that serves as an
alias for the beamer frame environment.

(org-beamer--format-frame): Introduce the new property, :BEAMER_FRAME.
If set in the headline, use that as name of the frame environment.
Otherwise, in frames marked as fragile, the name of the frame
environment is taken from `org-beamer--frame-environment'.  In all
other frames, the default name is frame.  Unless the frame name is
"frame", the name is added to the list
`org-beamer--frame-environments'.

(org-beamer--frame-environments): New variable and function.  The
variable holds a list of names of frame environments found while
formatting frames.  The function generates the LaTeX code to define
each new frame environment.

(org-beamer-template): Add a call to `org-beamer--frame-environments'
to insert the environment definitions into the beamer document.

Rationale: Code with \begin{frame} or \end{frame} cannot be embedded
in a verbatim environment inside a beamer frame due to a design
decision made by the beamer developers [1].  As suggested in that
report, defining an alias for the beamer frame environment will allow
such verbatim examples to compile correctly [2].  Since the frame
environment name is customize-able, beamer code generated by ox-beamer
can be included inside the verbatim environment, simply by changing
the frame environment name via the :BEAMER_FRAME property.

This solution also works with instances of \againframe.

Refs:
[1] https://github.com/josephwright/beamer/issues/360
[2] https://github.com/josephwright/beamer/issues/360#issuecomment-708705250
[3] https://list.orgmode.org/orgmode/87le8eg1hs.fsf@localhost/T/
---
 lisp/ox-beamer.el | 44 +---
 1 file changed, 37 insertions(+), 7 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 82c8841aa..4a1e09b85 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -149,9 +149,17 @@ which is replaced with the subtitle."
   :package-version '(Org . "8.3")
   :type '(string :tag "Format string"))
 
+(defcustom org-beamer-frame-environment "orgframe"
+  "Name of the beamer frame environment."
+  :group 'org-export-beamer
+  :type '(string :tag "Beamer frame"))
+
 
 ;;; Internal Variables
 
+(defvar org-beamer--frame-environments '()
+  "List of beamer frame environments.")
+
 (defconst org-beamer-column-widths
   "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.0 :ETC"
   "The column widths that should be installed as allowed property values.")
@@ -409,12 +417,17 @@ used 

Re: An academic journal entirely made in Org-Mode

2024-01-29 Thread Daniel Ortmann

Yes, please!

--
Daniel Ortmann
https://www.linkedin.com/in/danieldeanortmann/
https://ieee-collabratec.ieee.org/app/p/DanielDeanOrtmann/
612-518-3147 m

On 1/29/24 14:03, Juan Manuel Macías wrote:

Hi,

In last December, issue 23 of the "Revista de Estudios Latinos" (Journal
of Latin Studies) was published, sponsored by the Spanish Society of
Latin Studies. It is designed and produced by me using Org-Mode,
Org-Publish and LuaTeX. If anyone is interested in the code I used for
specific aspects of the publication, I can share it here :-).

Link to the journal in PDF version:

https://recyt.fecyt.es/index.php/rel/issue/view/4327/948

And a screenshot of the making-off:

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

Best regards,

Juan Manuel








Re: org-open-at-point while on "normal" text

2024-01-29 Thread Rainer Dunker
Am 28.01.2024 um 19:48:16 schrieb Ihor Radchenko:
> > Recently there was an Org Mode upgrade from version 9.4.4 to 9.6.6 on my 
> > machine, and since then, C-c C-o on "normal" text behaves differently: 
> > Instead of raising the no link error, it opens the "Select link to open" 
> > menu. As I understand, this behaviour should occur when point is on the 
> > section's headline, but not when it's just somewhere within the section.
> >
> > I tracked this down to a changed behaviour of the org-element-at-point 
> > function. Suppose I have a buffer in Org Mode containing these two lines:
> >
> >* headline
> >text
> 
> I am unable to reproduce the problem on the latest stable version of Org
> mode - 9.6.17.
> 
> May you upgrade Org mode and let us know if you are still experiencing
> the problem?

Of course. I did a test install of release_9.6.17-1108-gf490c15, and yes--the 
unepected behaviour persists. The result of the test expression is not 
completely identical to that of version 9.6.6, though; instead of ...

   (headline (:raw-value "heading" :begin 1 :end 16 :pre-blank 0
   :contents-begin 11 :contents-end 16 ...

... it starts with:

   (headline (:standard-properties [1 1 11 16 16 0 (:title) first-section
   element t nil 13 ...

But nevertheless, it's still not nil. Thus, I'm afraid, the upgrade did not 
solve the issue.

Thanks for the superfast reply and for any further help,

Rainer



Re: Connecting to an Already Running Scheme REPL with org-babel

2024-01-29 Thread Hunter Jozwiak
On Mon, Jan 29, 2024 at 8:15 AM Ihor Radchenko  wrote:

> Hunter Jozwiak  writes:
>
> >   Here is a patch that provides this functionality.
>
> Thank you!
>
> > Subject: [PATCH] org-mode: allow ob-scheme to accept a remote connection.
> >
> > * lisp/org/ob-scheme.el (org-babel-scheme-get-repl): introduce two
> > optional variables  host  and port. If there are not given, just run
>^ arguments
>
> > * lisp/org/ob-scheme (org-babel-scheme-execute-with-geiser,
> > org-babel-execute:scheme): take these  optional arguments into
> > account.
>
> ... and add two new optional arguments.
>
> > @@ -231,6 +235,8 @@ org-babel-execute:scheme
> >  geiser-scheme-implementation
> >  geiser-default-implementation
> >  (car geiser-active-implementations)))
> > + (host (cdr (assq :host params)))
> > + (port (cdr (assq :port params)))
>
> Please declare these new scheme-specific header argument in
> `org-babel-header-args:scheme'.
> See `org-babel-header-args:C' for an example.
> This is necessary for header argument completion to work.
>
> Also, please document the new header argument in the ob-scheme
> documentation at
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-scheme.html
> (you can submit a patch against
>
> https://git.sr.ht/~bzg/worg/tree/master/item/org-contrib/babel/languages/ob-doc-scheme.org
> )
> Here is the worg patch.
> > -(and (not (string= session "none")) session ; session
> > +(and (not (string= session "none")) session)  host port)))
> ; session
>
> This does not look right. Your change will disable session support
> completely when host and port are not provided.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>
From 2dc78a7edbbe38614a5f7fafa2c295f52528f04d Mon Sep 17 00:00:00 2001
From: Hunter Jozwiak 
Date: Mon, 29 Jan 2024 12:48:41 -0500
Subject: [PATCH] ob-scheme: document  the new header arguments.

* org-contrib/babel/languages/ob-doc-scheme.org (header-arguments):
note the  new options :host and :port.
---
 org-contrib/babel/languages/ob-doc-scheme.org | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/org-contrib/babel/languages/ob-doc-scheme.org b/org-contrib/babel/languages/ob-doc-scheme.org
index 46315d82..8f7ef52a 100644
--- a/org-contrib/babel/languages/ob-doc-scheme.org
+++ b/org-contrib/babel/languages/ob-doc-scheme.org
@@ -71,7 +71,9 @@ pair to =org-babel-load-languages=:
 There are no language-specific default values for header arguments to
 Scheme code blocks.
 
-There are no language-specific header arguments for Scheme code blocks.
+The following two options are available for Scheme code blocks:
+- :host :: the host of a remotely running Scheme process.
+- :port :: the port of the remotely running Scheme process.
 
 ** Sessions
 
-- 
2.43.0



Re: [PATCH] ob-tangle: Add flag to optionally remove files before writing

2024-01-29 Thread Olivier Lischer

Ihor Radchenko  writes:

> Olivier Lischer  writes:
>
>>> Thanks for the patch, but may you please explain why introducing such
>>> variable is useful?
>>
>> Sure.
>>
>> I configure all my .dotfiles in an Org mode file and tangle the
>> configuration in the right places. The tangled files are all
>> read-only to prevent accidentally editing of the "right" configuration
>> file. With the current tangling mechanism, this results in a "Permission
>> denied" error because the function writes to a read-only file. In a
>> earlier version this use case was possible because the file was
>> recreated before writing to it.
>
> Thanks for the explanation!
>
> I suggest changing your patch, setting the default value of
> `org-babel-tangle-remove-file-before-write' to 'auto.
> This will keep the current behaviour but fall back to delete + write new
> file when the tangle target is read-only.
> That will avoid feature regression.

I changed the path as you proposed.

>From a464592f622ba42732a5449d2c4db51f1975444a Mon Sep 17 00:00:00 2001
From: Olivier Lischer 
Date: Tue, 23 Jan 2024 21:02:20 +0100
Subject: [PATCH] ob-tangle: Add flag to optionally remove files before writing

* lisp/ob-tangle.el: Add variable
`org-babel-tangle-remove-file-before-write'.
(org-babel-tangle): Remove file before writing when
`org-babel-tangle-remove-file-before-write' is set.

The variable `org-babel-tangle-remove-file-before-write' adds support
for the current and old behaviour of `org-babel-tangle'.

TINYCHANGE
---
 etc/ORG-NEWS  |  4 
 lisp/ob-tangle.el | 14 ++
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index f537486d4..c7c3ee264 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -800,6 +800,10 @@ Completion is enabled for links to man pages added using ~org-insert-link~:
 =C-c C-l man RET emacscl TAB= to get =emacsclient=.  Of course, the ~ol-man~
 library should be loaded first.
 
+*** =ob-tangle.el=: Add flag to optionally remove files before writing
+
+When ~org-babel-tangle-remove-file-before-write~ is set to ~t~ the file is removed before writing.
+
 ** New functions and changes in function arguments
 *** New API functions to store data within ~org-element-cache~
 
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 72089a9a5..64b7c2cf8 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -141,7 +141,7 @@ controlled by the :comments header argument."
   :version "24.1"
   :type 'string)
 
-(defcustom org-babel-tangle-uncomment-comments nil
+(defcustom org-babel-tangle-uncomment-comments 'auto
   "Inhibits automatic commenting and addition of trailing newline
 of tangle comments.  Use `org-babel-tangle-comment-format-beg'
 and `org-babel-tangle-comment-format-end' to customize the format
@@ -166,6 +166,12 @@ read-write permissions for the user, read-only for everyone else."
   :package-version '(Org . "9.6")
   :type 'integer)
 
+(defcustom org-babel-tangle-remove-file-before-write nil
+  "Prevents the deletion of an existing file before tangle"
+  :group 'org-babel-tangle
+  :package-version '(Org . "9.7")
+  :type 'boolean)
+
 (defun org-babel-find-file-noselect-refresh (file)
   "Find file ensuring that the latest changes on disk are
 represented in the file."
@@ -313,9 +319,9 @@ matching a regular expression."
   (compare-buffer-substrings
nil nil nil
tangle-buf nil nil)))
- ;; We do not erase, but overwrite previous file
- ;; to preserve any existing symlinks.
-		 (write-region nil nil file-name)
+ (when (and (file-exists-p file-name) org-babel-tangle-remove-file-before-write)
+   (delete-file file-name))
+ (write-region nil nil file-name)
 		 (mapc (lambda (mode) (set-file-modes file-name mode)) modes))
(push file-name path-collector))
 	 (if (equal arg '(4))
-- 
2.43.0



Re: Suggested manual changes - section 7.2 Special Properties

2024-01-29 Thread Matt
Ihor, I think this would be a good topic to go over in the monthly meet up, 
especially if no one is able to follow up further on this by then.

  On Mon, 29 Jan 2024 04:37:33 +0100  Tommy Kelly  wrote --- 

 > It’s here: https://www.reddit.com/r/orgmode/s/3viPfF78Lr
 > In a nutshell, I was trying to understand how to have one of the columns in 
 > column mode be the creation date of each headline. I thought that because I 
 > almost always insert a clock entry when I create (using org-capture) a new 
 > item then I already had the required timestamp — the first one in the clock 
 > entry. However, it turns out that timestamp isn’t usable, and so the thread 
 > was me looking for help in figuring out the best way to do it.

Thank you very much.  

Unfortunately, my knowledge of this part of Org isn't enough to give meaningful 
feedback at the moment.

I should also say that I appreciate the effort and thoughtfulness you've put 
into this.  Definite bonus points :)  If I'm able to find the time to read up 
on this part of Org, I'd be happy  to work with you further on this.

--
Matt Trzcinski
Emacs Org contributor (ob-shell)
Learn more about Org mode at https://orgmode.org
Support Org development at https://liberapay.com/org-mode




Re: Connecting to an Already Running Scheme REPL with org-babel

2024-01-29 Thread Hunter Jozwiak
Ihor Radchenko  writes:

> Hunter Jozwiak  writes:
>
>>   Here is a patch that provides this functionality.
>
> Thank you!
>
>> Subject: [PATCH] org-mode: allow ob-scheme to accept a remote connection.
>>
>> * lisp/org/ob-scheme.el (org-babel-scheme-get-repl): introduce two
>> optional variables  host  and port. If there are not given, just run
>^ arguments
>
>> * lisp/org/ob-scheme (org-babel-scheme-execute-with-geiser,
>> org-babel-execute:scheme): take these  optional arguments into
>> account.
>
> ... and add two new optional arguments.
>
>> @@ -231,6 +235,8 @@ org-babel-execute:scheme
>> geiser-scheme-implementation
>> geiser-default-implementation
>> (car geiser-active-implementations)))
>> + (host (cdr (assq :host params)))
>> + (port (cdr (assq :port params)))
>
> Please declare these new scheme-specific header argument in
> `org-babel-header-args:scheme'.
> See `org-babel-header-args:C' for an example.
> This is necessary for header argument completion to work.
>
Okay. Is there a way to tighten these inputs further? I have them set to
:any for the moment, but I wonder if there is a way to leverage the
values for `geiser-repl-default-host` and `geiser-repl-default-port`.
> Also, please document the new header argument in the ob-scheme
> documentation at
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-scheme.html
> (you can submit a patch against
> https://git.sr.ht/~bzg/worg/tree/master/item/org-contrib/babel/languages/ob-doc-scheme.org
>  )
>
Sure thing; I can do that after I finish this message.
>> -   (and (not (string= session "none")) session ; session
>> +   (and (not (string= session "none")) session)  host port))) ; 
>> session
>
> This does not look right. Your change will disable session support
> completely when host and port are not provided.
Is there a way to test this and pinpoint the problem? I'm not familiar with 
using :sessions. Here is what I tested so far:
#+begin_example
#+begin_src scheme :scheme guile :host localhost :port 37146 :session *image*
  (use-modules (gnu)
   (guix)
   (guix gexp))
#+end_src

#+begin_src scheme :host localhost :port 37146 :session *image*
  (use-service-modules sound)
  (use-package-modules linux)
#+end_src

#+begin_src scheme :scheme guile :session *other*
  (use-srfis '(26)) 
#+end_src
#+end_example
This particular test gave me two REPLS. In the =*image*= REPL, I have access to 
the packages and services I would need to build part of the current project I 
am working on. The other REPL  gives me access to the `cut` and `cute` macros, 
and there isn't any plution between the two. Is there something else I'm 
missing here?



signature.asc
Description: PGP signature


Re: Agenda clocktable & archive issue

2024-01-29 Thread Ihor Radchenko
Andrew Hyatt  writes:

> Thanks for the pointers; it's been years since my last contribution.
> I've attached the latest patch.

Thanks!
Applied, onto main, with amendments.
I have edited the commit message, quoting the Elisp symbols with `...'
and changed the first line a bit. I also fixed #+vindex entry (you
copy-pasted a wrong variable name) and :type specification
(org-agenda-archives-mode can be set to 'tree symbol, not just boolean).
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f490c1548

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



Re: Agenda clocktable & archive issue

2024-01-29 Thread Andrew Hyatt
Ihor Radchenko  writes:

> Andrew Hyatt  writes:
>
>>> Still, I do not mind adding customization to enable it during startup,
>>> similar to the existing customizations:
>>> `org-agenda-start-with-log-mode',
>>> `org-agenda-start-with-entry-text-mode',
>>> `org-agenda-start-with-follow-mode', etc.
>>
>> Thank you, that makes sense.  I've attached the patch.
>
> Thank you!
>
>> From 4eee33856af687564a522ab40ebed4ba5d848cf4 Mon Sep 17 00:00:00 2001
>> From: Andrew Hyatt 
>> Date: Sun, 28 Jan 2024 21:33:20 -0400
>> Subject: [PATCH] Add org-agenda-start-with-archives-mode
>
> May you please also add a proper commit message? See
> https://orgmode.org/worg/org-contribute.html#commit-messages
>
>> +(defcustom org-agenda-start-with-archives-mode nil
>> +  "Initial value of archive-mode in a newly created agenda window."
>> +  :group 'org-agenda-startup
>> +  :type 'boolean)
>
> Please add :package-version '(Org . "9.7") keyword to indicate when the
> new option is added.
>
> Also, please add an entry in etc/ORG_NEWS file and document the new
> option in the manual (11.5 Commands in the Agenda Buffer display section)

Thanks for the pointers; it's been years since my last contribution.
I've attached the latest patch.

>From 4798f9b7fadc078a914cd399e797084c166fd1b0 Mon Sep 17 00:00:00 2001
From: Andrew Hyatt 
Date: Sun, 28 Jan 2024 21:33:20 -0400
Subject: [PATCH] lisp/org-agenda.el Add org-agenda-start-with-archives-mode

* lisp/org-agenda.el: Add org-agenda-start-with-archives-mode.
(org-agenda-mode): Set value of org-agenda-archive-mode according to
value of new variable org-agenda-start-with-archives-mode.

* doc/org-manual.org: Note new variable in documentation of
org-agenda-archives.mode.

* etc/ORG-NEWS: Note change to add org-agenda-start-with-archives-mode.
---
 doc/org-manual.org |  6 +-
 etc/ORG-NEWS   |  5 +
 lisp/org-agenda.el | 11 ++-
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index ffb025c93..86008164e 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -10077,9 +10077,13 @@ the other commands, point needs to be in the desired line.
 
   #+kindex: v a
   #+findex: org-agenda-archives-mode
+  #+vindex: org-agenda-start-with-clockreport-mode
   Toggle Archives mode.  In Archives mode, trees that are archived
   (see [[*Internal archiving]]) are also scanned when producing the
-  agenda.  To exit archives mode, press {{{kbd(v a)}}} again.
+  agenda.  To exit archives mode, press {{{kbd(v a)}}} again.  The
+  initial setting for this mode in new agenda buffers can set with the
+  variable ~org-agenda-start-with-archives-mode~, which can be set
+  with the same values as ~org-agenda-archives-mode~.
 
 - {{{kbd(v A)}}} ::
 
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index f4e98d78b..82090df32 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -686,6 +686,11 @@ manner with ~run-python~.
 
 This allows to run functions after ~org-indent~ intializes a buffer to
 enrich its properties.
+*** New option ~org-agenda-start-with-archives-mode~
+
+This option starts the agenda to automatically include archives,
+propagating the value for this variable to ~org-agenda-archives-mode~.
+For acceptable values and their meaning, see the value of that variable.
 
 ** New features
 *** =ob-plantuml.el=: Support tikz file format output
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 20da364b5..7fe482f30 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1102,6 +1102,14 @@ removed from entry text before it is shown in the agenda."
   :group 'org-agenda
   :type 'string)
 
+(defcustom org-agenda-start-with-archives-mode nil
+  "Initial value of archive-mode in a newly created agenda window.
+See `org-agenda-archives-mode' for acceptable values and their
+meaning."
+  :group 'org-agenda-startup
+  :package-version '(Org . "9.7")
+  :type 'boolean)
+
 (defvar org-agenda-entry-text-cleanup-hook nil
   "Hook that is run after basic cleanup of entry text to be shown in agenda.
 This cleanup is done in a temporary buffer, so the function may inspect and
@@ -2372,7 +2380,8 @@ The following commands are available:
 (setq org-agenda-follow-mode org-agenda-start-with-follow-mode
 	  org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode
 	  org-agenda-show-log org-agenda-start-with-log-mode
-	  org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode))
+	  org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode
+  org-agenda-archives-mode org-agenda-start-with-archives-mode))
   (add-to-invisibility-spec '(org-filtered))
   (org-fold-core-initialize `(,org-link--description-folding-spec
   ,org-link--link-folding-spec))
-- 
2.39.3 (Apple Git-145)



Re: org-icalendar export problems

2024-01-29 Thread Ihor Radchenko
CCing ox-icalendar maintainer.

ypuntot  writes:

> I am trying to create an android calendar based on the agenda, and the first 
> problem I am finding it's that I can't import it into android (ICSx^5). I am 
> receiving these errors when trying to do it:
>
> Couldn't parse iCalendar ...

May you be able to share the problematic icalendar file?

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



org-icalendar export problems

2024-01-29 Thread ypuntot
I am trying to create an android calendar based on the agenda, and the first 
problem I am finding it's that I can't import it into android (ICSx^5). I am 
receiving these errors when trying to do it:

Couldn't parse iCalendar  at.bitfire.ical4android.InvalidCalendarException: 
Couldn't parse iCalendar at 
at.bitfire.ical4android.ICalendar$Companion.fromReader(ICalendar.kt:91) at 
at.bitfire.ical4android.Event$Companion.eventsFromReader(Event.kt:79) at 
at.bitfire.icsdroid.ui.AddCalendarValidationFragment$ValidationModel$validate$downloader$1.onSuccess(AddCalendarValidationFragment.kt:126)
 at 
at.bitfire.icsdroid.CalendarFetcher.fetchLocal$icsx5_72_2_1_1_standardRelease(CalendarFetcher.kt:115)
 at at.bitfire.icsdroid.CalendarFetcher.fetch(CalendarFetcher.kt:49) at 
at.bitfire.icsdroid.ui.AddCalendarValidationFragment$ValidationModel.validate(AddCalendarValidationFragment.kt:168)
 at 
at.bitfire.icsdroid.ui.AddCalendarValidationFragment$ValidationModel.access$validate(AddCalendarValidationFragment.kt:103)
 at 
at.bitfire.icsdroid.ui.AddCalendarValidationFragment$ValidationModel$4.invokeSuspend(AddCalendarValidationFragment.kt:114)
 at 
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
 at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at 
kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
 at 
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
 at 
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
 at 
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
 Caused by: net.fortuna.ical4j.data.ParserException: Error at line 
1.893:Expected [61], read [10] at 
net.fortuna.ical4j.data.CalendarParserImpl.assertToken(CalendarParserImpl.java:486)
 at 
net.fortuna.ical4j.data.CalendarParserImpl.access$700(CalendarParserImpl.java:56)
 at 
net.fortuna.ical4j.data.CalendarParserImpl$ParameterParser.parse(CalendarParserImpl.java:357)
 at 
net.fortuna.ical4j.data.CalendarParserImpl$ParameterParser.access$2000(CalendarParserImpl.java:335)
 at 
net.fortuna.ical4j.data.CalendarParserImpl$ParameterListParser.parse(CalendarParserImpl.java:330)
 at 
net.fortuna.ical4j.data.CalendarParserImpl$PropertyParser.parse(CalendarParserImpl.java:266)
 at 
net.fortuna.ical4j.data.CalendarParserImpl$PropertyParser.access$1100(CalendarParserImpl.java:241)
 at 
net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:226)
 at 
net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.parse(CalendarParserImpl.java:446)
 at 
net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.access$900(CalendarParserImpl.java:422)
 at 
net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:224)
 at 
net.fortuna.ical4j.data.CalendarParserImpl.parseCalendar(CalendarParserImpl.java:128)
 at 
net.fortuna.ical4j.data.CalendarParserImpl.parseCalendarList(CalendarParserImpl.java:194)
 at 
net.fortuna.ical4j.data.CalendarParserImpl.parse(CalendarParserImpl.java:163) 
at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:197) at 
net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:185) at 
at.bitfire.ical4android.ICalendar$Companion.fromReader(ICalendar.kt:89) ... 13 
more


Re: [PATCH] lisp/org-src.el: complete `org-src-preserve-indentation' docstring

2024-01-29 Thread Ihor Radchenko
gerard.vermeu...@posteo.net writes:

> I have found by trial and error that `org-indent-block' honors
> `org-preserve-indentation' which is missing from its docstring.
>
> The attached patch contains a proposal to add this fact to the 
> docstring.

Thanks!
Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=813614cff

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



bug#50218: 28.0.50; org-babel-tangle-file tangles code blocks starting with #+begin_src :tangle no

2024-01-29 Thread Ihor Radchenko
Ihor Radchenko  writes:

> On Org side, we may catch such scenarios in org-lint.
> M-x org-lint currently reports no problem with the above block.

org-lint does catch such problem.
Not a bug.
Closing.

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





Re: bizarre: checkbox in properties, counting does not work with subheadings

2024-01-29 Thread Ihor Radchenko
Uwe Brauer  writes:

> * Everything [3/4]
> ...
> *** DONE Books
> ...
> ** DONE Car
> ...
> ** DONE Food
> ...
> *** WAIT  Computer
> ...
> ... The expected behavior should be 
>
> #+BEGIN: columnview :maxlevel 2 :skip-empty-rows t :hlines 1 :indent nil  
> :format "%5TODO(Status) %5Nr(Nr) %5Comp1(Comp1){X/} %5Comp2(Comp2){X/}"
> | Status | Nr | Comp1 | Comp2 |
> |++---+---|
> ||| [1/2] | [2/2] |
> | DONE   |  2 | [X]   | [X]   |
> | DONE   |  3 | [ ]   | [X]   |
> #+END:

I am not sure if it is expected.

Why doesn't "DONE Books" contribute to the summary? It is also under
"Everything" headline and has a checkbox.

With the attached patch, the result would be the following:

#+BEGIN: columnview :maxlevel 2 :skip-empty-rows t :hlines 1 :indent nil  
:format "%5TODO(Status) %5Nr(Nr)%5Comp1(Comp1){X/} %5Comp2(Comp2){X/}"
| Status | Nr | Comp1 | Comp2 |
|++---+---|
||| [3/3] | [2/3] |
| DONE   |  2 | [X]   | [X]   |
| DONE   |  3 | [1/1] | [0/1] |
#+END:

>From a4927f9ea530db180efdaea6bb01511c03bb1051 Mon Sep 17 00:00:00 2001
Message-ID: 
From: Ihor Radchenko 
Date: Mon, 29 Jan 2024 16:09:29 +0100
Subject: [PATCH] lisp/org-colview.el: Fix computing summary with low-level
 first child

* lisp/org-colview.el (org-columns--compute-spec): Do not assume that
all the children of an entry have the same LAST-LEVEL.  Handle
situation when the first child has lower level:

* Heading
** Child 1
** Child 2
** Child 3

Reported-by: Uwe Brauer 
Link: https://orgmode.org/list/87wn8yj2i5.fsf@localhost
---
 lisp/org-colview.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index b1b79257b..39ca01502 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1244,9 +1244,9 @@ (defun org-columns--compute-spec (spec  update)
 	   ;; property `org-summaries', in alist whose key is SPEC.
 	   (let* ((summary
 		   (and summarize
-			(let ((values (append (and (/= last-level inminlevel)
-		   (aref lvals last-level))
-	  (aref lvals inminlevel
+			(let ((values
+   (cl-loop for l from (1+ level) to lmax
+append (aref lvals l
 			  (and values (funcall summarize values printf))
 	 ;; Leaf values are not summaries: do not mark them.
 	 (when summary
-- 
2.43.0


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


Re: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-29 Thread Pedro Andres Aranda Gutierrez
OK, fine with me...
/PA

On Mon, 29 Jan 2024 at 15:47, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > Awesome, thanks! Could we back-port that to the emacs-sync tree? The
> sooner
> > we have it emacs for
> > people to use, the better
>
> I do not view this as a trivial or critical change. Hence, for next
> release only.
> See https://orgmode.org/worg/org-maintenance.html#branches
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet


Re: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-29 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  writes:

> Awesome, thanks! Could we back-port that to the emacs-sync tree? The sooner
> we have it emacs for
> people to use, the better

I do not view this as a trivial or critical change. Hence, for next
release only.
See https://orgmode.org/worg/org-maintenance.html#branches

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



Re: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-29 Thread Pedro Andres Aranda Gutierrez
Awesome, thanks! Could we back-port that to the emacs-sync tree? The sooner
we have it emacs for
people to use, the better

On Mon, 29 Jan 2024 at 14:25, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > From: "Pedro A. Aranda Gutierrez" 
> > Date: Sun, 28 Jan 2024 17:51:23 +0100
> > Subject: [PATCH] Refine packages for font management
>
> Thanks!
> Applied, onto main. I cleaned up irrelevant whitespace changes and
> amended the commit message, adding double space between sentences,
> fixing the changelog entry, and indicating what part of Org the patch
> changes in the first line.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a4a880d1f
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet


Re: [PATCH] Set Python shell in Org edit buffer

2024-01-29 Thread Ihor Radchenko
Jack Kamm  writes:

>> Now, after amending `org-src-associate-babel-session' to execute even
>> when no session is active, we can use
>> `org-babel-python-associate-session'.
>>
>> Attaching tentative patch that should be equivalent to yours.
>
> Thanks Ihor. I tested the patch and it seems to work well.

Thanks for testing!
Applied, onto main, adding Liu Hui as co-author.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=107cbc74a

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



Re: New try at multi-lingual export to latex/pdf using pdflatex and babel

2024-01-29 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  writes:

> From: "Pedro A. Aranda Gutierrez" 
> Date: Sun, 28 Jan 2024 17:51:23 +0100
> Subject: [PATCH] Refine packages for font management

Thanks!
Applied, onto main. I cleaned up irrelevant whitespace changes and
amended the commit message, adding double space between sentences,
fixing the changelog entry, and indicating what part of Org the patch
changes in the first line.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a4a880d1f

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



Re: Connecting to an Already Running Scheme REPL with org-babel

2024-01-29 Thread Ihor Radchenko
Hunter Jozwiak  writes:

>   Here is a patch that provides this functionality.

Thank you!

> Subject: [PATCH] org-mode: allow ob-scheme to accept a remote connection.
>
> * lisp/org/ob-scheme.el (org-babel-scheme-get-repl): introduce two
> optional variables  host  and port. If there are not given, just run
   ^ arguments

> * lisp/org/ob-scheme (org-babel-scheme-execute-with-geiser,
> org-babel-execute:scheme): take these  optional arguments into
> account.

... and add two new optional arguments.

> @@ -231,6 +235,8 @@ org-babel-execute:scheme
>  geiser-scheme-implementation
>  geiser-default-implementation
>  (car geiser-active-implementations)))
> + (host (cdr (assq :host params)))
> + (port (cdr (assq :port params)))

Please declare these new scheme-specific header argument in
`org-babel-header-args:scheme'.
See `org-babel-header-args:C' for an example.
This is necessary for header argument completion to work.

Also, please document the new header argument in the ob-scheme
documentation at
https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-scheme.html
(you can submit a patch against
https://git.sr.ht/~bzg/worg/tree/master/item/org-contrib/babel/languages/ob-doc-scheme.org
 )

> -(and (not (string= session "none")) session ; session
> +(and (not (string= session "none")) session)  host port))) ; 
> session

This does not look right. Your change will disable session support
completely when host and port are not provided.

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



Re: Agenda clocktable & archive issue

2024-01-29 Thread Ihor Radchenko
Andrew Hyatt  writes:

>> Still, I do not mind adding customization to enable it during startup,
>> similar to the existing customizations:
>> `org-agenda-start-with-log-mode',
>> `org-agenda-start-with-entry-text-mode',
>> `org-agenda-start-with-follow-mode', etc.
>
> Thank you, that makes sense.  I've attached the patch.

Thank you!

> From 4eee33856af687564a522ab40ebed4ba5d848cf4 Mon Sep 17 00:00:00 2001
> From: Andrew Hyatt 
> Date: Sun, 28 Jan 2024 21:33:20 -0400
> Subject: [PATCH] Add org-agenda-start-with-archives-mode

May you please also add a proper commit message? See
https://orgmode.org/worg/org-contribute.html#commit-messages

> +(defcustom org-agenda-start-with-archives-mode nil
> +  "Initial value of archive-mode in a newly created agenda window."
> +  :group 'org-agenda-startup
> +  :type 'boolean)

Please add :package-version '(Org . "9.7") keyword to indicate when the
new option is added.

Also, please add an entry in etc/ORG_NEWS file and document the new
option in the manual (11.5 Commands in the Agenda Buffer display section)

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



Re: [PATCH v2] org-id: allow using parent's existing id in links to headlines

2024-01-29 Thread Ihor Radchenko
Samuel Wales  writes:

> my experiene is that context, search, and file links typically break
> for me, as i change headers, refile, fix typos, change paths, etc.  so
> i stick with just org-id and, for export, custom id where possible.

That's why we have `org-id-link-to-org-use-id'.

> however, i would DEFINITELY also use org id link targets that are
> puttable in various locations [e.g. id markers].

You mentioned this feature request in the past. It is not forgotten.

> what i am pointing out is probably obvious, but might be worth
> pointing out in a sentence in manual, or for setting defaults?

May you please elaborate what you want to add to the manual and where?

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



Re: [PATCH v2] org-id: allow using parent's existing id in links to headlines

2024-01-29 Thread Ihor Radchenko
"Rick Lupton"  writes:

> Thanks for trying it out.  Updated patches attached, comments below.

Thanks!

>> 3. Consider
>>(setq org-id-link-consider-parent-id t)
>>(setq org-id-link-to-org-use-id t)
>>
>>Then, create a new empty Org file
>>M-x org-store-link with create a top-level properties drawer with ID
>>and store the link. However, that link will not be a simple ID link,
>>but also have ::PROPERTIES search string, which is not expected.
>
> This is because it is trying to link to the current line of the file, which 
> contains the text "PROPERTIES".  On main, with (setq 
> org-id-link-to-org-use-id nil), you see the equivalent behaviour (a link to 
> [[file:test.org:::PROPERTIES:]]) when point is before the first heading.  So, 
> this seems consistent with non-org-id links?

No. Do note that my instructions start from _empty_ file. With
org-id-link-to-org-use-id, PROPERTIES drawer is not created. This is
different from what happens with your patch - it is unexpected in your
patch that the search string is added for text that did not exist in the
buffer previously.

> (these links don't actually work with the default value of
> `org-link-search-must-match-exact-headline', but I think that's a
> separate issue).

That's a good catch.
The fact that links stored via `org-store-link' cannot be open with
default settings is not good.
Also, your patch disregards this setting - it should not match
non-headline search strings with the default value of
`org-link-search-must-match-exact-headline'.

Probably, changing the default value of
`org-link-search-must-match-exact-headline' to nil is due.

> Subject: [PATCH 2/2] org-id.el: Extend links with search strings, inherit
>  parent IDs

I ran make test, and it looks like one test is failing with your patch:

1 unexpected results:
   FAILED  test-org-link/id-store-link-using-parent  ((should (equal '("id:abc" 
"H1") (test-ol-stored-link-with-text "* H1\n:PROPERTIES:\n:ID: abc\n:END:\n** 
H2\n" (org-id-store-link :form (equal ("id:abc" "H1") 
("id:88e0c8d7-90a6-4628-b35a-cea989e3561b" "H2")) :value nil :explanation 
(list-elt 0 (arrays-of-different-length 6 39 "id:abc" 
"id:88e0c8d7-90a6-4628-b35a-cea989e3561b" first-mismatch-at 3)))

> +  #+vindex: org-id-link-consider-parent-id
> +  When ~org-id-link-consider-parent-id~ is ~t~ (and
> +  ~org-context-in-file-links~ and ~org-id-link-use-context~ are both

`org-context-in-file-links' is an obsolete name. Use
`org-link-context-for-files'.

Also, please add `org-id-link-use-context' to #+vindex.

> + =org-link= store functions are passed an ~interactive?~ argument
> +
> +The ~:store:~ functions set for link types using
> +~org-link-set-parameters~ are now passed an ~interactive?~ argument,
> +indicating whether ~org-store-link~ was called interactively.
> +
> +Existing store functions will continue to work.

Please update the docstring of `org-store-link-functions' to specify
that an argument is passed to :store functions.

(org-link-parameters docstring says

:store

  Function responsible for storing the link.  See the function
  org-store-link-functions for a description of the expected
  arguments.
)

> -  (org-insert-heading nil t t)
> +  ;; Find appropriate level for new heading
> +  (let ((level (save-excursion
> + (goto-char (point-min))
> + (+ 1 (or (org-current-level) 0)

This is fragile. You assume that `point-min' always contains a heading.
That may or may not be the case - `org-link-search' may be called by
third-party code that does not care about setting narrowing in certain
ways.

It is more reliable to do something like (while (org-up-heading-safe)
...) to find the lowest-level ancestor.

> +(defun org-link-precise-link-target ( relative-to)
> +  "Determine search string and description for storing a link.
> +
> +If a search string (see 'org-link-search') is found, return cons

Quoting: `org-link-search'.

> +   (let* ((element (org-element-at-point))
> +  (name (org-element-property :name element))
> +  (heading (org-element-lineage element 'headline t))

What about inlinetasks?

> +  (custom-id (org-entry-get nil "CUSTOM_ID")))

May as well pass HEADING as the first argument of `org-entry-get'. It
will be slightly more efficient.

> +(org-link--add-to-stored-links link desc)
> +;; In org buffers, store an additional "human-readable" link
> +;; using custom id, if available.
> +(when (and (buffer-file-name (buffer-base-buffer))
> +   (derived-mode-p 'org-mode)
> +   (org-entry-get nil "CUSTOM_ID"))
> +  (setq link (concat "file:"
> + (abbreviate-file-name
> +  (buffer-file-name (buffer-base-buffer)))
> + "::#" (org-entry-get nil "CUSTOM_ID")))

This is fragile - you are relying upon the exact code used 

[PATCH] lisp/org-src.el: complete `org-src-preserve-indentation' docstring

2024-01-29 Thread gerard . vermeulen

Hi,

I have found by trial and error that `org-indent-block' honors
`org-preserve-indentation' which is missing from its docstring.

The attached patch contains a proposal to add this fact to the 
docstring.


Regards -- Gerard



0001-lisp-org-src.el-complete-org-src-preserve-indentatio.patch
Description: Binary data