Re: org-encrypt-entries is slow (was: org-crypt leaking data when encryption password is not entered twice (was: Please document the caching and its user options))

2024-07-25 Thread Ihor Radchenko
Daniel Clemente  writes:

>> There is no such thing as "inline block" in Org syntax.
>
> I meant "inline task", sorry. I remembered "display: inline-block" from CSS…
> I don't think we need support for encrypted #+BEGIN_…/#+END… blocks.

I did not mean this.

>> > ** this is an inline block  :crypt:
>> > Content.

In the above, "Content." does not belong to the inlinetask.
Only inlinetasks with  END can have non-empty contents.

The fact that it is encrypted anyway is simply a bug in org-crypt.

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



Re: Fwd: 30.0.60; org--image-yank-media-handler asks for coding system when saving image

2024-07-25 Thread Ihor Radchenko
Daan Ro  writes:

> (I forward this bug report from bug-gnu-em...@gnu.org 
> (https://link.getmailspring.com/link/11a5bd1b-98f2-4b53-a61c-a93a367eb...@getmailspring.com/0?redirect=mailto%3Abug-gnu-emacs%40gnu.org=ZW1hY3Mtb3JnbW9kZUBnbnUub3Jn)
>  list.)

Thanks for reporting!
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=ec6307224

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



Re: multipage html output

2024-07-25 Thread Ihor Radchenko
Orm Finnendahl  writes:

> org-export--write-ouput inserts the output string into a temp-buffer
> before writing it to file. When exporting to multipage I found out
> that this imposes a pretty significant performance hit. That's why I
> write the output string directly to file in my own code.
>
> Is it sensitive to set an optional argument to circumvent the buffer
> insert (or circumvent it altogether)?

There is no particular reason why we use temporary buffer to write to
file. However, I am surprised that it produces performance hit -
`with-temp-buffer' should disable all kinds of hooks, except in
distributions like Doom that abuse advices and hook into buffer creation
unconditionally.

Do you know the source of the performance problem? Are you sure that it
is creating the buffer and is not related to the packages you have installed?

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



Re: multipage html output

2024-07-25 Thread Ihor Radchenko
Orm Finnendahl  writes:

> Am Mittwoch, den 24. Juli 2024 um 10:20:16 Uhr (+) schrieb Ihor Radchenko:
>> 
>> 1. org-data will be transcoded using `org-export-transcode-org-data',
>>which can be overridden by setting org-data transcoders in the
>>individual backends.
>
> Just for clarification: In the html backend there would be a
> definition for an org-data transcoder, which checks for the multipage
> case and either returns a list of output strings with additional
> information or just calls `org-export-transcode-org-data' for the
> single-page case, right?

Yes.

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



Re: org-encrypt-entries is slow (was: org-crypt leaking data when encryption password is not entered twice (was: Please document the caching and its user options))

2024-07-25 Thread Ihor Radchenko
Daniel Clemente  writes:

> I found minor but unrelated issues, e.g. if you have an empty section like 
> this:
>
> * abc2:crypt:
> * def
>
> … if you rename the abc2 header, e.g. to abc, it will ask the
> encryption password again, even when the contents (an empty header)
> didn't change.
>
> Another minor and weird bug: inline blocks. The part about showing the
> unencrypted contents while keeping the disk contents encrypted doesn't
> seem to work with encrypted inline blocks: they're saved encrypted,
> but they're displayed encrypted. In fact they can't be displayed
> unencrypted even if you call org-decrypt-contents. Maybe inline
> encrypted blocks aren't supported.
> To test this:
> * section
> ** this is an inline block
>  :crypt:
> Content.
>
> If you want you can split this to other threads or just ignore these
> edge cases for now.

There is no such thing as "inline block" in Org syntax.
The current behavior of org-crypt is because it mishandles inlinetasks
in specific way.

I can add support for proper inlinetasks delimited by END line, but not
for what you call "blocks" - that one is actually a bug when org-crypt
encrypts everything spanning between one-line inlinetask down to the
next heading.

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



Re: [BUG] Capital-letter options from dangling clock don't clock out [9.8-pre (release_9.7.7-106-g114c76 @ /home/rens/Projects/org/org-mode/lisp/)]

2024-07-24 Thread Ihor Radchenko
Rens Oliemans  writes:

> Ihor Radchenko  writes:
>
>> May you please provide more details?
>> What exactly did you try to do, step by step?
>
> I clocked in ('org-clock-in') in a headline with a dangling clock. I got the 
> Clock
> Resolution popup menu, and pressed an uppercase letter, which according to 
> the popup menu
> should leave me clocked out:
>
>For all these options, using uppercase makes your final state to be 
> CLOCKED OUT.
>
> I know that I clocked /in/, and that it might make sense to end up clocked 
> in, but if that
> is the case I think that the popup menu is very misleading and might be 
> improved. In fact,
> if that is the case, I believe that there is no difference in the lowercase 
> and uppercase
> options at all.

Confirmed.
This is because that menu was designed for automatic clock
resolution on idle.
It indeed does not make much sense when clocking in, where clock
resolution is simply called to avoid dangling clocks.

> In that case, please let me know how I'm mistaken and I am happy to try to 
> improve the
> popup menu text to clarify this.
> ...
> The reason why I clock in and expect to end up clocked out (albeit with the 
> Clock
> Resolution) is perhaps a bit strange. I do this because I sync my Org files 
> between my
> computers, and this leaves me with a dangling clock once in a while. Clocking 
> out to fix
> this doesn't work ("No active clock"), and the way I fix this is by clocking 
> in, since the
> Clock Resolution Command is very helpful in fixing idle minutes. Then, I 
> cancel the
> current clock so that I end up clocked-out. However, the wording of the popup 
> menu
> suggests that the uppercase letters should do this already.

You can resolve clocks via M-x org-clock-resolve-clocks

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



Re: [BUG] org-plot/gnuplot with dates in brackets does not work anymore [9.8-pre (release_9.7.6-97-g90d4ae @ /home/ck/.emacs.d/straight/build/org/)]

2024-07-24 Thread Ihor Radchenko
Chris Keschnat  writes:

> Hello,
> after e0924db3, =org-plot/gnuplot= does not work with dates in brackets 
> anymore.
> I am unsure if this syntax is supported, but it was working before.
>
> Example table:
> ...
> ~C-c C-c~ on the PLOT line results in:
> #+begin_src conf
>   Debugger entered--Lisp error: (wrong-type-argument stringp nil)
> format-time-string(nil (26272 10208))

Thanks for reporting!
Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=2a4fdffac

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



Re: [BUG] Capital-letter options from dangling clock don't clock out [9.8-pre (release_9.7.7-106-g114c76 @ /home/rens/Projects/org/org-mode/lisp/)]

2024-07-24 Thread Ihor Radchenko
Rens Oliemans  writes:

> When I clock into an item with a dangling clock, the "Resolving Idle Time" 
> menu pops up.
> When I then press an option with a capital letter, however, I end up 
> clocked-in, in the
> identical state as the lowercase option. On my machine this does not happen 
> when resolving
> idle times, only when clocking in from a dangling clock.
>
> Also present with 'make vanilla'.

May you please provide more details?
What exactly did you try to do, step by step?

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



Re: multipage html output

2024-07-24 Thread Ihor Radchenko
Orm Finnendahl  writes:

> To recapitulate: In my code, org-export-as calls process-multipage in
> the backend. This function:
>
> - collects and adds information necessary for org-multipage to do its
>   job, splitting the document into different parts, etc. and
>
> - then calls org-export-data on the subtrees and exports each returned
>   string to an individual file.
>
> - It finally issues a done string and executes a browser open/visit
>   file or simply exits nil.

Currently, org-export-as does the following:

1. Compute global export attributes, according to the selected export backend
2. Copy original buffer into working copy
3. Process and parse the copy, generating AST
4. Do the actual export

You plugged your multipage processing into (4), but what it actually
does involves (3), (4), and also a new kind of post-processing.
I do not think that it is a good design from the point of view of ox.el.
I prefer to reuse or extend the existing mechanisms if at all possible -
this makes new features less confusing for users and backend developers.

> - collects and adds information necessary for org-multipage to do its
>   job, splitting the document into different parts, etc. and

What you describe here is more or less what :filter-parse-tree filters
do - they can rearrange the parse tree before passing it to the
transcoders. Why not reusing it for multipage export?

> - then calls org-export-data on the subtrees and exports each returned
>   string to an individual file.

And you simply call `org-export-transcode-page' for this, followed by
writing the returned string to file.

The first part can fit within `org-export-as', but writing to file is
going a step beyond, duplicating what `org-export-to-file' does.

> - It finally issues a done string and executes a browser open/visit
>   file or simply exits nil.

... which again steps beyond `org-export-as' scope - post-processing is
currently done as a part of `org-export-to-file'/`org-export-to-buffer'.



Let me propose the following changes to ox.el:

1. org-data will be transcoded using `org-export-transcode-org-data',
   which can be overridden by setting org-data transcoders in the
   individual backends.

2. org-export-as will understand transcoded output to be a list of
   strings and will transfer INFO plist as text property in the return
   values

3. org-export-to-file will make use of the text properties to retrieve
   the file name to write.  This way, export backend itself can assign
   the file names where each exporter string should go.

I believe that my changes should allow you to implement multipage export
in the following way:

1. You can use :filter-parse-tree in ox-html backend to replace the
   original (org-data ...) AST with a list of
   ((org-page ...) (org-page ...) ...) pseudo-elements and populate INFO
   channel with auxiliary information you now compute in 
`org-html-process-multipage'

2. You can define org-page transcoder to render individual pages as
needed

3. You can assign :output-file text property to the returned org-page
   strings and use org-export-to-file to generate the multipage output
   on disk

4. You can handle opening exported files by augmenting POST-PROCESS
   argument in `org-html-export-to-multipage-html' and calling
   `org-export-file' instead of `org-export-as'.

The tentative patches (against Org mode main branch) implementing my
changes are attached.

>From 540c8ef21c26df79cf48f58afb4e88130985e2f7 Mon Sep 17 00:00:00 2001
Message-ID: <540c8ef21c26df79cf48f58afb4e88130985e2f7.1721815865.git.yanta...@posteo.net>
From: Ihor Radchenko 
Date: Wed, 24 Jul 2024 11:40:57 +0200
Subject: [PATCH 1/3] ox: Factor out org-data transcoding into dedicated
 overrideable transcoder

* lisp/ox.el (org-export-transcode-org-data): New function serving as
the default transcoder for org-data export.
(org-export-transcoder): Use `org-export-transcode-org-data' when no
org-data transcoder is defined.
(org-export-as): Rely upon org-data transcoder to do its job.
---
 lisp/ox.el | 55 +-
 1 file changed, 30 insertions(+), 25 deletions(-)

diff --git a/lisp/ox.el b/lisp/ox.el
index fbd9bb0df..bdee71082 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -1883,9 +1883,11 @@ (defun org-export-transcoder (blob info)
 INFO is a plist containing export directives."
   (let ((type (org-element-type blob)))
 ;; Return contents only for complete parse trees.
-(if (eq type 'org-data) (lambda (_datum contents _info) contents)
-  (let ((transcoder (cdr (assq type (plist-get info :translate-alist)
-	(and (functionp transcoder) transcoder)
+(let ((transcoder (cdr (assq type (plist-get info :translate-alist)
+  (cond
+   ((functionp transcoder) transcoder)
+   ;; Use default org-data transcoder unless specified.
+   ((eq type 'org-data) #'org-export-transcode-org-data)
 
 (defun

Re: multipage html output

2024-07-23 Thread Ihor Radchenko
Orm Finnendahl  writes:

>> If you think that multipage export should use a different set of
>> options, we need to implement it differently.
>
> Is that a semantic problem so we need to implement an option like
> :always-collect-headline-numbering instead of :multipage in
> org-export-numbered-headline-p? If on the other hand we define a
> replacement of org-export--collect-headline-numbering, we also have to
> do so for all functions up the stack, like org-export--annotate-info
> and org-export--collect-tree-properties. Or what did you have in mind?

What I had in mind if using backend-specific :filter-options.
If a backends needs to enable headline numbering unconditionally, when
:multipage is used, it can install :filter-options filter that will set
:section-numbers to t.

Does it make sense?

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



Re: multipage html output

2024-07-23 Thread Ihor Radchenko
[ Adding the mailing list back to CC ]

Orm Finnendahl  writes:

> Let me recapitulate to make sure I understand you completely:
>
> 1. Replace the call to org-export-transcode-page at the end of
>ord-export-as by a call to org-export-data

Yes.

> 2. If a transcoder for org-data is defined, call that and return nil
>from org-export-date.
>
>Otherwise return the transcoded string.

> 3. In case a string is returned, process it as it is done in
>org-export-transcode-page (only that the output string will be
>supplied in place of the headline and we will find a better name for
>org-export-transcode-page as it is called *after* the transcoding.

No.

If a transcoder for org-data is defined, call it and return whatever it
returns. Otherwise, call `org-export-transcode-page' (adjusted to follow
transcoder arguments).

> 1. org-export-data has to be modified to catch the case of
>org-export-transcoder being called on org-data in the
>multipage-case (after ;; Element/Object with contents.). This seems
>a bit complicated as there is memoization going on in
>:exported-data of info further down in org-export-data which
>probably should get circumvented in the multipage case (e.g. by
>checking the value of results).

I do not fully understand the problem you are describing here, but hope
that my clarification above resolved it.

> 2. The code has to define/provide a transcoding function in the
>multipage case but should *not* provide such a function in the
>single page case, which means (in the multipage case) to modify the
>alist of the backend on-the-fly before calling org-export-as.

I propose to allow custom org-data transcoder for single page case as well.
If there is no need to have custom transcoder for single page, the
custom transcoder can check :multipage property and fall back to
calling `org-export-transcode-page' if it is nil.

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



Re: multipage html output

2024-07-23 Thread Ihor Radchenko
Orm Finnendahl  writes:

>> `org-export--collect-headline-numbering' is evaluated unconditionally,
>> regardless of num:t or num:nil settings.
>
> Are you sure? org-export--collect-headline-numbering has this in its
> body:
>
> (org-element-map data 'headline
>   (lambda (headline)
> (when (and (org-export-numbered-headline-p headline options)
>  (not (org-element-property :footnote-section-p headline)))
>...)))
>
> If num:nil headline numbers don't get collected, or am I missing
> something?

You are right.
However, changing `org-export-numbered-headline-p' to use :multipage is
not the right approach to achieve what you need.

If you think that multipage export should use a different set of
options, we need to implement it differently.

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



Re: multipage html output

2024-07-23 Thread Ihor Radchenko
Orm Finnendahl  writes:

>> > - added :multipage case to `org-export-as', calling :process-multipage
>> >   callback submitted in info. In the multipage case, org-export-as
>> >   returns nil relying on :process-multipage to do the exporting, while
>> >   in the single page case it returns the transcoded string to the
>> >   caller from the backend.
>> 
>> Does it mean that you do not want page splitting to be controlled
>> globally, in ox.el, as we discussed?
>
> Not for now (I mention that later in the mail when I talk about
> section-filenames and future generalizations, where this definitely
> has to be done). In the html multipage export are many peculiarities
> which don't apply to other backends, so ox.el wouldn't be the place
> for it, so we will need some callback mechanism anyway.
>
> Right now this gets accomplished with a small branch in org-export-as
> in order to change as little as possible. It'll be easy to change if
> we find a good way to get this done using a more general approach. But
> I'm open for suggestions, if you have an idea how to already do it
> now.

Then, a more natural way to achieve custom document-wide transcoder will
be introducing "org-data" transcoder into `org-export-transcoder':

(defun org-export-transcoder (blob info)
  "Return appropriate transcoder for BLOB.
INFO is a plist containing export directives."
  (let ((type (org-element-type blob)))
;; Return contents only for complete parse trees.
(if (eq type 'org-data) (lambda (_datum contents _info) contents) ; 
<=--
  (let ((transcoder (cdr (assq type (plist-get info :translate-alist)
(and (functionp transcoder) transcoder)

For now, we have a hard-coded identity CONTENTS -> CONTENTS transcoder
when exporting the whole document, followed by applying inner/outer
templates. We may instead allow the export backends to introduce
"org-data" transcoder as a part of exporter definition. When non-nil, it
will be used instead of what you extracted into
`org-export-transcode-page'. And `org-export-transcode-page' will be
used as the fallback.

WDYT?

>> > - changed that `org-export-numbered-headline-p' always returns t for
>> >   headlines in the multipage case to ensure headline numbering is
>> >   collected.
>> 
>> >   NOTE: The single-page case will be handled like before, but it might
>> >   be a better idea to change the behaviour and do it the same way as
>> >   in the multipage case: Always collect the headline-numbering and
>> >   only decide at the transcoding stage whether the headline should be
>> >   numbered in the output.
>> 
>> Why? What if one wants headlines to be not numbered?
>
> Just set num:nil in the options.

But your code ignores num:nil, does it not?

(defun org-export-numbered-headline-p (headline info)
  "Return a non-nil value if HEADLINE element should be numbered.
INFO is a plist used as a communication channel."
  (unless (org-not-nil (org-export-get-node-property :UNNUMBERED headline t))
(let ((sec-num (or (plist-get info :section-numbers)
   (plist-get info :multipage))) ; <-- overrides num:nil
  (level (org-export-get-relative-level headline info)))
  (if (wholenump sec-num) (<= level sec-num) sec-num


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



Re: multipage html output

2024-07-23 Thread Ihor Radchenko
Orm Finnendahl  writes:

> ... I think printing
> headline numbers should get handled in the transcoding stage of the
> backend and not before.

I am confused here.
What do you mean by "printing"?

> ... Multipage export behind the scenes is
> completely dependant on headline numbering, even if headlines aren't
> displayed, so the code in ox.el first proceeds, as if headline
> numbering is turned on and moves the check for headline numbering to
> the transcoding stage. I didn't change the behaviour in the
> single-page html situation. Although I think that it might make sense
> that headline-numbering in general only gets checked at the
> transcoding stage that would affect all backends, so I didn't change
> anything.

I am again confused.
There are three main functions handling headline numbering:
1. `org-export--collect-headline-numbering'
2. `org-export-get-headline-number'
3. `org-export-numbered-headline-p'

`org-export--collect-headline-numbering' is evaluated unconditionally,
regardless of num:t or num:nil settings.

`org-export-get-headline-number' and `org-export-numbered-headline-p'
are API functions that get called by the individual backends as needed.
If they deem it necessary to ignore :section-numbers setting, they are
free to.

What is wrong with these three functions? 

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



Re: multipage html output

2024-07-23 Thread Ihor Radchenko
Orm Finnendahl  writes:

> Thanks also for the info regarding how to contribute. It'd be nice if
> you could gibe me a go in case you approve the proposal.

May you please elaborate?

All you need to do is cloning/forking Org mode repository, making edits
there, and sharing the link to your branch.

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



Re: Cannot yank media when image come from Gnome screenshot

2024-07-23 Thread Ihor Radchenko
Sébastien Gendre  writes:

> Thank you for your reply.
>
> I use the Emacs version provided on Fedora 40.
> I will look how to compile a more recent version of Emacs and test it.

You can try to report as is first. Emacs devs might identify what might
be wrong just from looking at the backtrace.

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



Re: Cannot yank media when image come from Gnome screenshot

2024-07-23 Thread Ihor Radchenko
Sébastien Gendre  writes:

> Here is the full backtrace:
>
>
> Debugger entered--Lisp error: (wrong-type-argument sequencep image/png)
>   mapc(#f(compiled-function (elt) #) image/png)
>   seq-do(#f(compiled-function (elt) #) image/png)
>   #f(compiled-function #'sequence # 0x19945316743f723a>)(#f(compiled-function (elt) # 0x94038afefa059ab>) image/png)
>   apply(#f(compiled-function #'sequence #) 
> #f(compiled-function (elt) #) image/png nil)
>   seq-map(#f(compiled-function (elt) #) image/png)
>   seq-filter(#f(compiled-function (type) #) 
> image/png)

The error is originating from Emacs itself, not from Org mode.
May you try newer version of Emacs? If you still see the error, please
report it as Emacs bug.

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



Re: multipage html output

2024-07-23 Thread Ihor Radchenko
Orm Finnendahl  writes:

>  I managed to get the proposal for the multipage output done. Please
> review it and let me know what you think/would prefer to change. I'm
> pretty open about it.
>
> You can find it here:
>
> https://github.com/ormf/ox-html-multipage
>
> The code is intended to replace ox.el and ox-html.el. The repository
> contains a pretty exhaustive CHANGELOG.txt to show what I did.

Thanks!
I will first focus on reviewing changes to ox.el.

> ox.el
> 
> - added `org-export-collect-tree-info', and

And it is not used anywhere... What is the purpose?

>   org-export-transcode-headline, extracted from `org-export-as'

How does it have anything to do with "headline"? Maybe 
`org-export-transcode-page'?
 
> - added :multipage case to `org-export-as', calling :process-multipage
>   callback submitted in info. In the multipage case, org-export-as
>   returns nil relying on :process-multipage to do the exporting, while
>   in the single page case it returns the transcoded string to the
>   caller from the backend.

Does it mean that you do not want page splitting to be controlled
globally, in ox.el, as we discussed?
 
> - changed `org-export-collect-footnote-definitions' to get its
>   numbering using `org-export-get-footnote-number' rather than always
>   counting from 1 as before. This should always work for single-page
>   and multipage export.

This looks reasonable. Maybe even as a separate patch we can merge earlier.
 
> - changed that `org-export-numbered-headline-p' always returns t for
>   headlines in the multipage case to ensure headline numbering is
>   collected.

>   NOTE: The single-page case will be handled like before, but it might
>   be a better idea to change the behaviour and do it the same way as
>   in the multipage case: Always collect the headline-numbering and
>   only decide at the transcoding stage whether the headline should be
>   numbered in the output.

Why? What if one wants headlines to be not numbered?

> If the code gets reviewed and accepted I have some questions regarding
> final submittal:
>
> 1. How do I provide the code? Is there a mechanism like issuing a
>merge-request or how is it normally done?

https://orgmode.org/worg/org-contribute.html#orge044121

You need to clone Org mode repository and modify it on a public
branch. Then, just share it. Also, please make sure that you track the
latest main branch. Your version of ox.el already diverged from the
latest main.

> 2. How do I add documentation to the org manual?

Edit doc/org-manual.org in the Org repository.

> 3. Should there be test functions for the code added and are there
>recommendations how to do that?

Yes, ideally.
See testing/README, testing/lisp/test-ox.el, and
testing/lisp/text-ox-html.el files in the Org repo.

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



Re: Cannot yank media when image come from Gnome screenshot

2024-07-23 Thread Ihor Radchenko
Sébastien Gendre  writes:

> I got a bug when I try to yank a screenshot made with Gnome-shell.
> I don't know yet if it's a bug with Org-mode handling the media, or the
> yank-media function or the Gnome-shell screenshot feature.

Thanks for reporting!

> What I get:
>
> * In the mini-buffer, I get the error message:
>   "Wrong type argument: sequencep, image/png"
>
> * If I go into the "*Messages*" buffer, the full error message is:
>   "seq-do: Wrong type argument: sequencep, image/png"

May you please enable debug-on-error (M-x toggle-debug-on-error) and
share the full backtrace displayed when you trigger the error?

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



Re: [ANN] lisp/ob-tangle-sync.el

2024-07-23 Thread Ihor Radchenko
João Pedro  writes:

> I'd like to ask if I could contribute to this. I have followed the
> discussion to a point, but would be more than happy to try and
> contribute to this so it gets merged for the next Org major version, as
> I've been waiting for this for quite a while now. It solves the major
> gripe I had with your original org-tangle-sync.el package, which is the
> ability to sync blocks that aren't whole files.

It has been a while since the last message in this thread.
João, may I know if you are still interested to work on this patch?

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



Re: org-cite-insert function docstring and documentation don't tell how to validate

2024-07-23 Thread Ihor Radchenko
Sébastien Gendre  writes:

> Yes, but how this information tell me that I have to do a special key
> binding to validate my citation selection and to have the
> citation link inserted into my org-mode document ?

It does not. It is completely up to the completion flavor you are using.
By default, pressing  in the minibuffer when you do not enter
anything will send empty input. But third-party completion packages
sometimes change it. You need to know the completion package you are using.

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



Re: org-cite-insert function docstring and documentation don't tell how to validate

2024-07-23 Thread Ihor Radchenko
Sébastien Gendre  writes:

> What do you mean ?

When a prompt is displayed in Emacs, you enter something in the minibuffer.
You can type some text there (with completion) or you can type nothing.
If you type nothing, your input is empty.

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



Re: org-cite-insert function docstring and documentation don't tell how to validate

2024-07-23 Thread Ihor Radchenko
Sébastien Gendre  writes:

> You mean that the mini-buffer is empty ?

I mean that what you type in the minibuffer is empty.

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



Re: org-cite-insert function docstring and documentation don't tell how to validate

2024-07-23 Thread Ihor Radchenko
Sébastien Gendre  writes:

> What does "empty input exists" mean ?

Empty minibuffer input.

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



Re: org-cite-insert function docstring and documentation don't tell how to validate

2024-07-23 Thread Ihor Radchenko
Sébastien Gendre  writes:

> I have found that on Vanilla Emacs, it's "C-j".
>
> And with Vertico, it's "Alt-Enter".
>
> I wonder if we need to document it. In the docstring of
> "org-cite-insert" and in the documentation. Of course, not mentioning
> every possible shortcut. But at least telling how the command
> "org-cite-insert" behave. And the general idea of how user can stop the
> reference selection.

The minibuffer prompt in `org-cite-insert' says: "empty input exits"
IMHO, it is more than enough. In fact, better than shelving it deep into
the manual/docstring.

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



Re: [PATCH] [BUG] Support attr_html in source code and fixed-width blocks

2024-07-22 Thread Ihor Radchenko
Suhail Singh  writes:

> Given that I already have some contributions in Org mode and I don't, at
> present, intend to do the copyright assignment to FSF, could you please
> confirm:
>
> 1. How many lines worth of changes I can still introduce without going
>over the limit?

I do not see any commits under "suhailsingh...@gmail.com" or under
"Suhail Singh".

Commits under similar names are:

Suhail 96eb9f0b4 * piem/s/org-lint-add-function-to-removeJun6 org-lint: Add 
function to remove checker(s)
Suhail Shergill 3b2abfce7 * bugfix: fix `org-babel-execute-src-block' on remote 
hosts
Suhail Shergill 28582bfa0 * org-html.el: Make footnotes unique to an entry
Utkarsh Singh e62618508 * org-table.el: Fix usage of user-error
Utkarsh Singh 7c99d1555 * org-table.el: Allow to import files with no .txt, 
.tsv or .csv

I assume that 96eb9f0b4 is yours.
It has 9 LOC.

~6LOC remaining until aproximate 15LOC limit we can accept without
copyright assignment.

> 2. When implementing such refactoring changes, which lines are counted?

More or less all lines, except things like blank lines, query replace,
or copy-pasted code (or, in other words, trivial changes)

> From a feasibility perspective, I suspect it might be better for you (or
> someone else who's signed the FSF copyright assignment paperwork) to
> take on the work of applying changes that are similar in spirit to the
> patch.

Maybe, but that's a subject of my time and priorities.
This particular bug/feature request will not be high in the priority
list. Unless we get more users jumping to this thread and asking for
#+ATTR_HTML support.

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



Re: [PATCH] [BUG] Support attr_html in source code and fixed-width blocks

2024-07-22 Thread Ihor Radchenko
Suhail Singh  writes:

>> So, if we start allowing arbitrary attributes in more blocks, may as
>> well include specially handled attributes like :textarea.
>
> Yes, it is possible to address my concern while also extending support
> for non-HTML attributes like :textarea.  However, they still are
> distinct things.  For instance, it's possible that extending support for
> :textarea is considered a feature request (as opposed to a bug), and
> thus that support is added to the main branch as opposed to bugfix.

FYI, regardless how we categorize this (bug or feature), it is not for
bugfix because we are changing the existing behavior. Some users might
have #+ATTR_HTML being present and ignored. Not ignoring them, even if
it is a bug fix, is not acceptable for bugfix branch - it is not a
_trivial_ bug fix. So, it has to go on main.

>> Since we do not promise it anywhere, it is not necessarily a bug.
>
> We also don't, as far as I am aware, mention that support for
> #+ATTR_HTML is ONLY available for some AST nodes and NOT others.  Given
> that for the treatment of :textarea we are very clear on this point, the
> fact that we don't for #+ATTR_HTML suggested to me that this was a bug.
> I suppose it's debatable, however, whether it's a bug in the
> documentation or the code.  But, given most (all?) HTML elements support
> attributes, it would be odd if the intent of ox-html was to provide a
> way to support it via #+ATTR_HTML while simultaneously /intentionally/
> restricting its use to only a few nodes. Since `:textarea' is a "custom"
> attribute with special signifance, it makes sense that support for it
> may be limited in scope.
>
> Do you still consider this to be a feature request instead of a bug?

AFAIU, your main point is that you want the patch to land on bugfix. It
will not, regardless whether we add :textarea support or not.

Next, if you are not interested in adding :textarea support, it is
OK. Adding #+ATTR_HTML support for code blocks and fixed width elements
will still be a welcome improvement (I was just hoping to push you to
contribute a bit more ;))

Now, back to your original patch.
May you please factor out adding attributes into a separate function, so
that we avoid duplicating the code? And please announce the change in
the news - people aware of the current behavior might need to know about
the change.

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



Re: [PATCH] [BUG] Support attr_html in source code and fixed-width blocks

2024-07-22 Thread Ihor Radchenko
Suhail Singh  writes:

>> Please address my concern about :textarea attribute. I do not see why
>> we should ignore it here.
>
> I don't understand your concern.  Could you please elaborate on what you
> mean by "why we should ignore it here"?  What is the "it" and what is
> the "here"?

Your request, in its core, is asking to make treatment of verbatim blocks
more regular in ox-html.

So, if we start allowing arbitrary attributes in more blocks, may as
well include specially handled attributes like :textarea.

As a bonus, it will be possible to factor out common code handling
attributes (including :textarea) into a new internal function that can
then be reused.

>> I am not sure if we want to add all the attributes to every transcoded
>> element. At least in some cases, we do discard them
>> (`org-html--textarea-block').
>
> From the manual:
>
> #+CAPTION: [[info:org#Text areas in HTML export][org#Text areas in HTML 
> export]]
> #+begin_quote
>  The HTML export backend can create such text areas.  It requires an
>   ‘#+ATTR_HTML’ line as shown in the example below with the ‘:textarea’
>   option.  This must be followed by either an example or a source code
>   block.  Other Org block types do not honor the ‘:textarea’ option.
> #+end_quote
>
> The current processing of :textarea does special handling for width and
> height attributes and discards the rest (based on my understanding of
> the code in `org-html--textarea-block').  Said support for :textarea
> attribute exists in `org-html-src-block' and `org-html-example-block'
> which is consistent with the manual.

Yup. But since you are asking to add new features to ox-html, we may as
well do it in full (support all attributes, including special attributes).

> In order to make the code more robust, one may wish to remove :textarea
> from the list of attributes (or issue a user-error or warning if it's
> present) in blocks that were never intended to support it (such as
> `org-html-fixed-width').  I do not have any opinion on this matter.

My opinion here is not to remove :textarea, but to treat it as we do in
other places.

> There is an open question regarding what attributes to support in
> `org-html--textarea-block' (i.e., in the presence of `:textarea'
> option).  I believe the "correct" thing would be to filter out `:width'
> and `:height' (since, if present, they are translated into `rows' and
> `cols' attributes in the generated HTML) and include the rest "as is" in
> the generated HTML

+1

> Regardless of the specifics above regd. :textarea, I believe support for
> #+ATTR_HTML ought to be added for most blocks to allow for CSS class
> and/or inline style to be specified when exporting to HTML.

+1

> Additionally, I consider the absence of such support to be a bug.

Since we do not promise it anywhere, it is not necessarily a bug.
But it would make sense to support setting arbitrary attributes, yes.

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



Re: [BUG] Org table alighment distorted with dates in links to headlines [9.7.7 (9.7.7-1ee080 @ /home/exot/Desktop/emacs-test/elpa/org-9.7.7/)]

2024-07-22 Thread Ihor Radchenko
Daniel via "General discussions about Org-mode." 
writes:

> Summary: Alignment of Org tables seems to be distorted when including
> links to items with dates in it.
> ...
> | [[file:/home/exot/Desktop/test.org::*Headline with some date: \[2024-07-22 
> Mon\]][Headline with some date: [2024-07-22 Mon]​]] |   1:01 |

This is because Org automatically inserts zero width space in ]​] to
escape ] in the link description.
Zero width space is displayed by Emacs as 1 pixel-wide space.
Then, Org mode rounds the width of the table cell up, leading to the
observed misalignment.

So, it is not exactly a bug, but I improved the width calculation to use
rounding instead of ceiling.

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=190f47222

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



Re: How to fully control parsing of Org mode links during export

2024-07-22 Thread Ihor Radchenko
Robert Weiner  writes:

> I could really use some help from Org export experts.  I have
> been trying to tweak export link parsing to do what I want
> without any success.  Here is a summary of the issues and related
> questions I have.

You generally should not need to modify the _parser_.
What you may need to do is modifying the exporter.
For example, by defining a custom export backend. Or export filter.
See "13.17 Advanced Export Configuration" section of the manual.

> 3. When exporting from an Org file and I have defined the html export
>syntax for mytype: to html, I want this:
>  [[mytype:MyLink]]
>  [[Testing]]
>to be converted into this:
>  MyLink
>  Testing
>but instead Org export produces:
>  MyLink.html">mytype: href="Testing.html">Testing

This has nothing to do with Org mode exporter. What is produced for
custom link types totally depends on the custom :export function you
defined for your link.

> 2. How can I get the exporter to run in my current Emacs process and
>spawn a new Emacs so that I can easily debug in-process?  I think I have
>turned off the async export option but it still runs async and I can't
>step through the exporter functions.

Async is disabled by default. So, something in your config enables
it.

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



Re: [PATCH] [BUG] Support attr_html in source code and fixed-width blocks

2024-07-22 Thread Ihor Radchenko
Suhail Singh  writes:

>>> The attached patches are a straight-forward copy-paste of relevant code
>>> from org-html-example-block.  It may be better to refactor this logic
>>> and ensure that it is applied on all relevant AST nodes (others are
>>> probably affected as well).
>>
>> Sounds reasonable.
>> Timothy, may you have a look?
>
> Any updates on this?

No comments from TEC.
Please address my concern about :textarea attribute. I do not see why we
should ignore it here.

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



Re: Documentation request

2024-07-22 Thread Ihor Radchenko
Peter Mao  writes:

> The docstrings for org-metadown and org-metaup (and maybe other
> context-dependent commands) should reference the corresponding hooks,
> org-metadown-hook and org-metaup-hook.

But they do?

org-metadown is an interactive and natively compiled function defined
in org-edit-special.el.

Signature
(org-metadown  ARG)

Documentation
...

This function runs the functions in org-metadown-hook one by
one as a first step, and exits immediately if a function from the
hook returns non-nil.  In the absence of a specific context, the
function runs org-metadown-final-hook using the same logic.

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



Re: [BUG] Warning on executing keyboard macro that inserts time-stamp [9.6.27 ( @ /home/punit/.emacs.d/elpa/org-9.6.27/)]

2024-07-22 Thread Ihor Radchenko
Punit Arya  writes:

> Yes, I've installed org-9.7.7 from ELPA and the issue persists.  I get 
> this error text now when running the shell command:

Please try to provide a detailed reproducer using Org git repository,
starting from make repro. See https://orgmode.org/manual/Feedback.html#Feedback

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



Re: [BUG] Warning on executing keyboard macro that inserts time-stamp [9.6.27 ( @ /home/punit/.emacs.d/elpa/org-9.6.27/)]

2024-07-22 Thread Ihor Radchenko
Punit Arya  writes:

> Alright, I'll check it out when I upgrade to the latest version 9.7 from 
> the ELPA repo.

It has been over a month. Have you had a chance to try the latest Org mode?

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



Re: [PATCH v3.2] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2024-07-22 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

>> Then, for backward compatibility, we may treat any non-nil, non-list
>> (like '(4), '(16), '(64)), non-number (like 1, 11) value as
>> INCLUDE-LINKED. This way, the existing calls like
>> (org-toggle-inline-images t) will not be broken.
> ...
> I prefer this compromise result.
> I updated the patch, Please review it whether it's correct.

I think that C-u C-u unconditionally including linked images is
confusing.

What about using my idea with M-1/M-11 to be interpreted as INCLUDE-LINKED=t?

Also, you did not document in the docstring what happens if ARG is
something like t.

> I did a source code statistics researching of using the function 
> org-toggle-inline-images at two places:
>
> - GitHub: 
> https://github.com/search?q=org-toggle-inline-images=opensearch=code=3
> (Only package scimax incoke this function with INCLUDE-LINKED argument t)
> - My installed Emacs packages, NO package invoke this function with argument 
> INCLUDE-LINKED.
>
> So lucky this change will not affect lot.

I have found user configs using the argument:

https://github.com/search?q=%22%28org-toggle-inline-images+t%29%22=code
https://github.com/search?q=%22%28org-toggle-inline-images+%27%22=code

So, please do as I advised - treat non-special ARG values as INCLUDE-LINKED.

Also, looking at the proposed prefix arguments, I feel that it might not
necessarily be the best idea to copy over what org-latex-preview does
exactly. org-latex-preview is not a "toggle", unlike org-toggle-inline-images

What about the following treatment of ARG:

1. No argument, no region selected :: toggle (display or hide dwim) images in 
current section 
2. No argument, region selected: toggle images in region
3. C-u argument :: toggle images in the whole buffer
4. C-u C-u argument, no region selected :: unconditionally hide images in the 
buffer
5. M-1 argument, no region selected :: display images in current section with 
INCLUDE-LINKED
6. M-1 argument, region selected :: ... in region ...
7. M-11 argument :: ... in the whole buffer ...
8. Any other argument :: treat as INCLUDE-LINKED = t

And please document all the new arguments in the manual and etc/ORG-NEWS file.

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



Re: [PATCH] Highlight ANSI sequences in the whole buffer (was [PATCH] ANSI color on example blocks and fixed width elements)

2024-07-20 Thread Ihor Radchenko
Nathaniel Nicandro  writes:

>> Let's drop the part with modifications/visibility changes. It should not
>> be a job for fontification function, so let's not complicate things (as
>> I mentioned above). I believe that 'org-ansi may no longer be needed
>> once we drop this.
>>
>
> You want me to remove the code that is responsible for keeping the
> sequences visible according to `org-fold-show-set-visibility` and
> according to whether or not the sequence is currently being edited
> then?

Yes.

> What should I do instead? If I remove the code for the modification
> changes, then it would be difficult to edit the sequences when
> `org-ansi-hide-sequences` is t since they would remain invisible while
> editing.

For now, let's default `org-ansi-hide-sequences' to nil.

For the value of t, we should use a more general solution.
For example, I can, in the future, implement a clone of hl-line-mode that
will reveal markup on the current line. It will be an easy an effective
solution to edit hidden markup like convoluted links, emphasis, and ANSI
markup.

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



Re: org-encrypt-entries is slow (was: org-crypt leaking data when encryption password is not entered twice (was: Please document the caching and its user options))

2024-07-20 Thread Ihor Radchenko
Daniel Clemente  writes:

> But org-crypt still feels strange. For instance, I decrypt a header,
> add a space somewhere else and save. It's saved, but the header is
> still visibly unencrypted in Emacs; that's unexpected, because
> org-crypt-use-before-save-magic promised to „automatically encrypt
> entries before a file is saved to disk“.
> I checked the file from outside Emacs and I see that the header is
> actually encrypted, so technically it did what it promised to do
> though I don't see it in Emacs.
> So there's a discordance between what I see and what is saved. Maybe
> it's feature, not a bug: „you still see the decrypted contents but you
> can trust that when they're saved they'll be saved encrypted“. This
> may be clarified in the docstring. If it's a feature, I think it may
> be useful; I just don't like having to trust that the silent
> background-auto-encryption is working (I'll often want to verify the
> file from outside Emacs). But users may have different preferences.
> This may be material for another thread.

Yup, I consider this as a feature. Especially for people using
auto-save-visited-mode and similar. If saving is triggered on timer,
while editing encrypted heading, encrypting everything in the middle of
typing is not fun.

> Minor thing, not important now: the cursor jumps to the end of the
> header after a C-x C-s when in the middle of a currently-decrypted
> block without changes.

Should be better now on the latest version of the branch.

> Another minor thing: I use a key that calls
> (org-save-all-org-buffers), and if I press it e.g. from the *scratch*
> buffer it may ask me the „Passphrase for symmetric encryption“
> question (because I edited some crypted section) but I don't know
> which buffer it's asking about. But it's not a problem because if I
> press C-g then I'll see it.

Should also be better now.

> I see a new problem: with (org-crypt-use-before-save-magic) enabled, I
> edit a decrypted section, press C-x C-s to save and it asks me for the
> encryption password. Here, if I press C-g, org-crypt would catch it
> and then tell me that it won't be able to encrypt due to the C-g.
> However I'm not pressing C-g, what I'm doing is opening another TTY
> frame (I'm running TTY emacsclient, with no X support, but under
> urxvt); this makes the minibuffer disappear, and I see „Back to top
> level“, and the whole contents of the section being encrypted are
> lost.

I tried to reproduce with the latest version of the branch. Seems to
work fine. May you test?

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



Re: Pending contents in org documents

2024-07-19 Thread Ihor Radchenko
ending-describe-reglock (reglock)
>   "Describe REGLOCK in a buffer.
> 
> Describe position REGLOCK.
> The information is displayed in new buffer.

in *a* new buffer... except that it is not really a new buffer, when
another REGLOCK buffer is already being displayed.

May users want to see info about multiple reglocks at the same time?

> (setq-local header-line-format
>   (format "Lock info (at %s), hit 'g' to update."
>   (format-time-string "%T")))

Please, avoid using hard-coded bindings.  Instead, see
`substitute-command-keys' (also see how org-capture.el sets up header
line)

> (defun org-pending--describe-reglock-at-point ()

Why internal? It is a command users may want to call via M-x.

> (defun org-pending-pre-insert-outcome-default (_lock _message)
>   "Default value for `org-pending-pre-insert-outcome-function'.")

May as well just use #'ignore

> (defvar org-pending-pre-insert-outcome-function
> (defvar org-pending-post-insert-outcome-function

Should these be defcustom ?

> (overlay-put outcome-ovl
>  'help-echo
>  "Last lock outcome, click to popup its full description.")

This assumes fixed key bindings in the lock overlay keymap. Which may or
may not be the case. Please compute 'help-echo programmatically, based on
the key map. (using `substitute-command-keys').

> (cl-defun org-pending--update (reglock status data)

No docstring.  Please, add.

> (let* ((reg  (org-pending-reglock-region reglock))
>(start (car reg))
>(end (cdr reg))
>(buf (marker-buffer start)))
>   (when (buffer-live-p buf)
> (with-current-buffer buf
>   (save-excursion
>     (if (> (- end start) 1)

What if the buffer is narrowed and reglock is outside the narrowing?

>   (with-current-buffer buffer
> (without-restriction

`without-restriction' is only available since Emacs 29. However, we
still support Emacs 27 and will support Emacs 28 for quite a while.
So, please avoid `without-restriction' if possible.

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



Re: Experimental public branch for inline special blocks

2024-07-19 Thread Ihor Radchenko
Juan Manuel Macías  writes:

> ... until
> September I will not be able to participate actively or continuously on
> the list.

No problem.
I just wanted to make sure that this is not forgotten.

> Of course, if someone wants to actively collaborate in the development
> of this branch, I have no problem. If necessary, I also have no
> objection to moving the repository to another more ‘open’ place (in Gitlab
> it is necessary to have an account to collaborate).

+1

This is an important feature that should be added sooner or later to
address numerous edge cases in the Org markup.

On my side, it is not on the very top of the priorities, so I am happy
that Juan is working on it. If anyone else wants to help, it will be
very welcome as well.

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



Re: [O] Generate and fill PDF-forms by org-mode?!

2024-07-18 Thread Ihor Radchenko
Balaji Bikshandi  writes:

> I use a transparent terminal over the PDF and then screenshot it!
>
> This is, as you would expect, an ultralight and ultrafast solution. 
>
> In fact, I use mupdf to open the PDF, then open the venerable SC spreadsheet 
> calculator in a transparent terminal over it. Once ‘filled’, I just take a 
> screenshot! Then use Imagemagick to convert it.

Interesting.
May you expand a bit on how exactly you do it?

In particular, how does Org mode enter the picture? I imagine that you
need to align the text layout in the Org file to fit the underlying PDF,
but I am not sure if Org is the most suitable program to achieve such
alignment. Something like M-x artist-mode might probably be more flexible.

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



Re: [BUG] Org parser error: invalid search bound (wrong side of point) [9.7.7 (9.7.7-1ee080 @ /home/talmage/.emacs.d/elpa/org-9.7.7/)]

2024-07-18 Thread Ihor Radchenko
David Talmage  writes:

> What I did: I visited Planning.org, a big Org Mode file I use to plan an
> extended motorcycle trip.
>
> What I expected: Emacs would load Planning.org, handing it off to Org
> Mode to Do The Right Thing, as it usually does.
>
> What occurred: Emacs complained of a parsing error.

Thanks for reporting!
Are you seeing this problem frequently?

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



Re: Testing issues for Ada/SPARK support in Babel

2024-07-18 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> If you don't mind, I attach here the patch in its current state for
>> reviewing purposes.
>
> Sure. See my comments inline.
> ...

It has been two months since the last message in this thread.
Francesc, did you have a chance to look into my comments?

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



Re: Experimental public branch for inline special blocks

2024-07-18 Thread Ihor Radchenko
Juan Manuel Macías  writes:

> Well, next week I will continue commenting. I will try to stay up to
> date with everything that is being discussed here. By the way, if
> someone wants to collaborate on the branch, I can add them as a
> contributor (I'm afraid it is necessary to have a GitLab account, if
> I'm not mistaken).

It has been quite a while since the last activity in this thread.
Juan, may I know if you had a chance to work on the branch?

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



Re: org-element--cache: Added org-data parent to non-headline element

2024-07-17 Thread Ihor Radchenko
mousebot  writes:

>> It does not look like a complete backtrace. Was there anything else in
>> the warning buffer?
>
> i copied the whole warning buffer after an error was triggered.

Then, it looks like indirect buffer does not get registered for some reason.

> i had another go:
>
> - i made a purely lorem ipsum org file (can share if needed)
> - loaded a minimal emacs config (the one i use for testing/debugging 
> mastodon.el, can share)
> - loaded a really minimal org config (can share if needed)
> - loaded the org file
> - repeated the already mentioned steps, triggering the error.
>
> with this test file, when the error is triggered, the way the file breaks is 
> that a second-level TODO heading is split after the first star, becoming a 
> top-level heading with a single star on a previous line (often, not sure if 
> always, i think other breakages happen also, with my original file other 
> breakages happened).

A full reproducer I can follow from emacs -Q (or make repro) would be very nice.

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



Re: org-element--cache: Added org-data parent to non-headline element

2024-07-17 Thread Ihor Radchenko
martyhi...@riseup.net writes:

>> (setq org-element--cache-self-verify 'backtrace)
>> 
>
> i have a backtrace from my file, but it contains information i don't
> want to post to a public mailing list (my essay/notes). i tried again
> in a partly lorem ipsum-ified file and received the backtrace below
> when moving todo items around.
>
> is that of any help?

It does not look like a complete backtrace. Was there anything else in
the warning buffer?

> when playing around i noticed that the error only occurs when
> narrowing is in effect: i narrow in the main window then can cause the
> error in the secondary/cloned one.

This is useful information.

Also, since you are able to reproduce quickly with a constructed file,
any chance that you can also create a reproducer starting from clean
Emacs config?

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



Re: Built a list of Org-mode files with Org-ql

2024-07-17 Thread Ihor Radchenko
Sébastien Gendre  writes:

> I have a directory with a few Org-mode files in it. And inside another
> Org-mode file, I try to generate a table that list all the Org-mode
> files of this directory.
>
> Each Org-mode file of this directory have a "#+TITLE", a "#+DATE" and a
> "#+KEYWORDS" buffer setting, and I would to use them as column in the
> created table. And to sort this table by the "#+DATE" field.

> I have looked into Org-ql dynamic bloc [2] to do that. Org-ql is an
> amazing package, I love it. But, from what I understand, it only work
> for searching Org-mode headings, not for searching Org-mode files like I
> try to do.

You are right. Org-ql only searches headings.

> Any one have an idea or a suggestion ?

You need to write Elisp to loop over files in the directory, open them,
and then query Org mode for TITLE, DATE, and KEYWORDS.
You can do it using `org-collect-keywords'.

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



Re: HTML export: Force links that end in .jpg or .png to be exported as a tags

2024-07-17 Thread Ihor Radchenko
Rodrigo Morales  writes:

> My question is: How to force a link that end in =.jpg= or =.png= to be 
> exported as a =a= tag instead of an =img= tag?

`org-html-inline-images'.

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



Re: org-element--cache: Added org-data parent to non-headline element

2024-07-17 Thread Ihor Radchenko
[ Adding Org mailing list back to CC. Please use Reply All to keep the
conversation public ]

martyhi...@riseup.net writes:

> i can confirm i can still cause the problem having updated org.

That is to Org >=9.7.4, right?

> here's an example error, reproduced in the same way as the above:
>
> ⛔ Warning (org-element): org-element--cache: Org parser error in 
> my-file.org<2>::22313. Resetting.
>   The error was: (wrong-type-argument integer-or-marker-p nil)
> ...

Ok.
May you then add the following to your config and share the diagnostics
next time the error comes out:

(setq org-element--cache-self-verify 'backtrace)

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



Re: [SUMMARY] #9 [[bbb:OrgMeetup]] on Wed, July 10, 19:00 UTC+3

2024-07-17 Thread Ihor Radchenko
Suhail Singh  writes:

> Ihor Radchenko  writes:
>
>>   - Aside, built-in ox-odt has quite a history
>> - Its original author is... (to say) no longer interested to deal
>>   with FSF copyright assignment (it was quite a drama at some point)
>
> Out of curiosity, would you happen to have a reference to associated
> discussion in case it happened on a public mailing list?  I am curious
> as to the reasons.

https://list.orgmode.org/orgmode/87ppydmigz@gmail.com/t/#u

>>   - Oh well. ~org-sbe~ is a hack (on top of
>> ~org-babel-execute-src-block~) in reality and not a properly
>> designed API
>>   - One day we need to implement something better
>>   - Patches welcome! At least, it is a good idea to start a discussion
>> on the mailing list. See 
>> https://orgmode.org/manual/Feedback.html#Feedback
>
> Could you please elaborate on what about ~org-sbe~ makes it a "hack"?
> On a related note, what would "something better" look like?

Because it uses `org-babel-execute-src-block', which works with code
block at point. `org-sbe' tries to make it work with code blocks that
are not at point, against `org-babel-execute-src-block' docstring.

Something better would be a proper API function that can execute code
block at arbitrary location, not just at point. Such API function is
likely something to be factored out from `org-babel-execute-src-block'
and many helper functions it uses.

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



Re: Possible bug getting bounds of URL at point?

2024-07-17 Thread Ihor Radchenko
Karl Fogel  writes:

> I admit that I don't immediately understand why this is a good 
> thing.  The user asked for the bounds of the URL at point, but got 
> instead the bounds of some other thing (the Org "node"). 
> Especially in the case of a standalone URL, with no description 
> text, I don't see how including the whitespace is useful.
>
> However, there could be issues here that I'm not familiar with. 
> It sounds like you've already thought this out and concluded that 
> that including the trailing whitespace is the right behavior.  If 
> you have time to explain why in more detail, I'd appreciate a 
> chance to learn more about it.  However, if you don't have time to 
> do that, it's no problem.

The notion of "URL", and especially "URL at point" in Org mode needs to
be special. Consider something like

[[https://orgmode.org][this is a very long and /convoluted/
description of this url; all the text here is clickable as a link]].

Org mode will consider point anywhere inside the link as "at URL".
That "URL" will be https://orgmode.org, and it is indeed what
(thing-at-point 'url) will return on that link in Org mode, even when
point is on the link description.
Hope it makes sense.

What does not make sense in such scenario is returning
(bounds-of-thing-at-point 'url) to not include point. So, we instead
return the relevant syntax object - link object. And that object
includes description, brackets, and whitespace after.

There is no reason to make plain links special in this regard, so we
don't.

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



Re: [Bug] org-persist.el: xdg.el is unavailable in emacs-25.2

2024-07-17 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> org.el in the main branch still declares
>>
>>> ;; Package-Requires: ((emacs "25.1"))

This is no longer relevant. We only support Emacs 26+.
Canceled.

We will be dropping Emacs 26 as well once we start seeing breakage
(Emacs 29 is the newest Emacs as for now, and we only officially support
Emacs 29-2=27). Now, Emacs 26 is working while it is working. No special
effort to keep things for Emacs 26.

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



Re: [BUG] Emphasized text in *HEADLINE link target leaks through invisible text [9.8-pre (release_9.7.6-107-gf21415 @ /home/jschmidt/work/org-mode/lisp/)]

2024-07-17 Thread Ihor Radchenko
Jens Schmidt  writes:

> - snip -
> * foo =bar= baz
>
> * FOO BAR BAZ
>
> [[*foo =bar= baz][Link Title]]
> - snip -
> ...
> =bar=Link Title
> - snip -
>
> That is, the =bar= part leaks through from the otherwise hidden link
> target.

Confirmed.
Yet another bug with fontification.
Postponing until
https://orgmode.org/list/87ee7c9quk.fsf@localhost

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



Re: [BUG] org-indent-line edge case in empty Org mode buffer [9.8-pre (release_9.7.6-107-gf21415 @ /home/jschmidt/work/org-mode/lisp/)]

2024-07-17 Thread Ihor Radchenko
Jens Schmidt  writes:

> The following sequence of commands:
>
>   make vanilla
>   M-x org-mode RET
>   M-x erase-buffer RET SPC
>   M-: (setq org-adapt-indentation 'headline-data)
>   M-x org-indent-line RET

Thanks for reporting!
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=e269942a3

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



Re: [BUG] Org parser error [9.6.15 (release_9.6.15 @ /snap/emacs/current/usr/share/emacs/29.4/lisp/org/)]

2024-07-17 Thread Ihor Radchenko
Nina Lanyon  writes:

> I have no idea what was supposed to happen or why this occurred.
>
> Suddenly I received this message:
>
>
> ⛔ Warning (org-element-cache): org-element--cache: Org parser error in 
> diary.org::1434902. Resetting.
> The error was: (error "Invalid search bound (wrong side of point)")
> Backtrace:
> nil
> Please report this to Org mode mailing list (M-x org-submit-bug-report).
> ...
> Package: Org mode version 9.6.15 (release_9.6.15 @ 
> /snap/emacs/current/usr/share/emacs/29.4/lisp/org/)

Thanks for reporting!
Are you seeing this frequently?
If yes, you may consider upgrading Org mode to 9.7 version.
We fixed a number of parser errors there.

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



Re: Possible bug getting bounds of URL at point?

2024-07-16 Thread Ihor Radchenko
Karl Fogel  writes:

> In Org Mode buffers, `bounds-of-thing-at-point-provider-alist' 
> names a Org-Mode-specific URL provider:
> ...
> I think this is causing URL boundaries to be calculated 
> incorrectly.
>
> REPRODUCTION:
>
> Assume we have this line in an Org Mode buffer (note there are 
> three trailing spaces after the final "m" -- hopefully the MTAs 
> and MUAs will leave those spaces there):
>
>   https://example.com   
>
> Let's say the initial "h" is at position 22205, the position right 
> after the final "m" is 4, and the final position on the line 
> (after the three spaces) is 7.
>
> With point anywhere inside the URL, if I run 
> (bounds-of-thing-at-point 'url), I currently get this result:
>
>   (22205 . 7)
>
> But I expected this result instead:
>
>   (22205 . 4)
>
> Is (22205 . 7) correct, and I'm just misunderstanding how URL 
> boundaries are supposed to work in Org Mode?

This is correct. Trailing whitespace belongs to the preceding node in
Org syntax. This is not a bug.

Moreover, if you have something like
[[https//orgmode.org][description]]
the whole thing will be considered a URL.

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



Re: [PATCH v3] Re: Org Babel related popup buffer names not unified

2024-07-16 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

> From 75ab4e209e99502f49b506ce59f613bbe4e1 Mon Sep 17 00:00:00 2001
> From: stardiviner 
> Date: Sun, 14 Jul 2024 19:24:55 +0800
> Subject: [PATCH] ob-core.el: unify Org Babel related buffer names using
>  constant variable

Applied, onto main, with amendments to the commit message. I updated it
according to the latest iteration of the patch and added missing
changelog entries.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f2141541b

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



Re: [fr] refile goto: push mark in the target buffer first

2024-07-16 Thread Ihor Radchenko
Samuel Wales  writes:

> in undo-tree and i think vundo, you have a tree.  in the case of point
> locs, suppose you were in one place, 0, and then you went to a, then back
> to 0 with l, then went to b.  now you have a branching point at 0.  you can
> do n and p to choose between a and b -- actually  moving to them with a
> message is an option here as is showing their lines in a visualizer.   n
> and p could also cycle through 0 for convenience if that's not too
> confusing [a message can notify]. a command like l can also be used to go
> back to it.
>
> so the f and b thing has nothing to do with history; it is just navigation
> in the buffer [if local ring] according to the sequence in the buffer, akin
> to m-tab in org for links.
>
> l and r are like in info, navigating history. n and p choose different r
> locations for the case where there is more than one r.

buffer-undo-list actually supports storing point positions.
So, if one wants to implement what you want, it is certainly possible by
doing something like

(let ((buffer-undo-list special-point-history))
  <... move point>)

Then, one can hack on existing packages like vundo to get the tree-like
interface.

I am not sure if it would be something we need in Org mode though.
Maybe ELPA package or something.

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



[SUMMARY] #9 [[bbb:OrgMeetup]] on Wed, July 10, 19:00 UTC+3

2024-07-16 Thread Ihor Radchenko
 when encryption is broken for some reason
   (say, GnuPG does not work)
4. Improve performance (org-crypt is quite slow on large buffers
   now because it scans through every single heading)
5. Improve UI when encrypting multiple headings symmetrically.
   The current design is to encrypt each heading separately, using
   a separate password - it is hardly useful to anyone. If
   passwords are not same, how would one go around remembering
   them?

  - The last thing I was fighting with was (5)
- On the surface, it is not too hard to hook into Emacs EPG and
  query password only once for all the encrypted headings
- However, the problem comes when there are existing symmetrically
  encrypted headings in the buffer. What if they are encrypted
  using a different password?
  - =emacs-user= suggested trying decrypting the already encrypted
headings with a given new encryption password and if it does
not work, suggest to re-encrypt using the new password

  - Jeff Trull asked why not to display decrypted text as an overlay
and avoid all the above trickery with data leaks and whatnot
- Overlaying decrypted text is all fine until one needs to
  actually edit that text (using normal Org mode commands!)
- So, we do need to put the decrypted text into actual buffer one
  way or another. And we go back to the same problem with leakage,
  albeit less frequent.
- Since leakage should not happen at all, we should solve it even
  with overlay approach
- So, overlay idea just complicates things

- =emacs-user= asked about calling function from Library of Babel from elisp
  - The general answer is ~org-sbe~
  - However, as =emacs-user= pointed, it triggers warning when used outside Org 
buffer
  - Oh well. ~org-sbe~ is a hack (on top of
~org-babel-execute-src-block~) in reality and not a properly
designed API
  - One day we need to implement something better
  - Patches welcome! At least, it is a good idea to start a discussion
on the mailing list. See https://orgmode.org/manual/Feedback.html#Feedback

:comments:
[18:15] Welcome to [[bbb:OrgMeetup]]!For help on using 
BigBlueButton see these (short) https://www.bigbluebutton.org/html5; 
target="_blank">tutorial videos.To join the audio bridge 
click the phone button.  Use a headset to avoid causing background noise for 
others.This server is running https://docs.bigbluebutton.org/; target="_blank">BigBlueButton.
[18:16] William Denton : Hello!
[18:17] Dave Marquardt : Hi
[18:17] cryptk : hello
[18:19] Ihor Radchenko : As usual, the latest edition of Emacs News: 
https://sachachua.com/blog/2024/07/2024-07-08-emacs-news/
[18:19] fnat : Hello! (Still sorting out audio on my end.)
[18:19] William Denton : No problem.
[18:23] Demo : Hihi! Listening only for the moment.
[18:23] fnat : Same here, listening mode. I was able to work around the audio 
issues using a second device.
[18:25] William Denton : Nothing new from me, and no problems ... I'm just 
lurking.
[18:26] Demo : I think my only problem is i'm still suffering from slowdowns in 
huge files.
[18:26] Demo : if you want to discuss that, i just can't show the file :P
[18:26] Dave Marquardt : I recently used the Pandoc exporter to create a nice 
Word document, mostly avoiding using Word or LibreOffice, except for fixing a 
reference document. Cool stuff!
[18:26] Demo : let me get mic
[18:30] Dave Marquardt : :)
[18:42] Ihor Radchenko : ox-pandoc?
[18:42] Dave Marquardt : ox-pandoc
[18:43] Ihor Radchenko : https://github.com/emacsorphanage/ox-pandoc
[18:43] Dave Marquardt : Yes, I used ox-pandoc
[18:44] Ihor Radchenko : https://github.com/kjambunathan/org-mode-ox-odt
[18:44] Ihor Radchenko : ox-odt fork
[18:45] Ihor Radchenko : from the original author
[18:46] Ihor Radchenko : 
https://github.com/kjambunathan/org-mode-ox-odt?tab=readme-ov-file#faqs
[18:46] Ihor Radchenko : Will you merge this repo to upstream Orgmode or GNU 
Emacs?

Never
[18:46] Ihor Radchenko : Will you put this repo on MELPA or GNU ELPA?

Never
[18:46] Dave Marquardt : Yes, I remember the drama!
[18:48] Dave Marquardt : IIRC, the ODT exporter doesn't support inline code 
snippets, which affects me
[18:48] Dave Marquardt : The original one
[18:48] Dave Marquardt : src_lang{foo}
[18:49] Dave Marquardt : Yeah, the FIXME error!
[18:49] Demo : its very clear!
[18:49] Demo : so glad to see you here too davemq ;]
[18:51] Dave Marquardt : Most exporters do nice font and color stuff with 
inline code
[18:51] Dave Marquardt : Thanks
[18:52] William Denton : I need to drop out for something at the top of the 
hour ... thanks for organizing, Ihor, and as always, thanks for all your Org 
work.
[18:58] fnat : Thanks Ihor and all. I also need to switch to another meeting in 
a few mins. This is very interesting and useful, thanks for organising it, I'll 
be back next time.
[19:00] Jeff Trull : I have a general discussion 

Re: Org v9.7.7 org-assert-version problem?

2024-07-16 Thread Ihor Radchenko
David Masterson  writes:

> I just tried to package-install org-9.7.7 and I'm getting a problem with
> org-assert-version.  It looks like a conflict between the system
> installed version of 9.5.5 and my ~/.emacs.d/elpa install of 9.7.7.  The
> main problem (so far) seems to be org-assert-version -- even Hyperbole
> seems to be complaining that it is missing!

Problems with `org-assert-version' always indicate issues with
installation. I recommend upgrading Org mode from clean Emacs config -
ideally, using emacs -Q.

> ...  Org 9.7.6 was giving me other problems after that
> (main one seemed to be pdflatex [I think] giving an error about ox-latex
> not producing a good tex file).

If you see problems, feel free to report them. But with more details.

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



Re: Effort by category in agenda view

2024-07-15 Thread Ihor Radchenko
Patrick Nicodemus  writes:

> Yes, I am referring to the agenda column view, using the "Effort" property;

Column view in agenda does not support updating summaries when applying
filters.

As usual, patches welcome, of course.

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



Re: [BUG] org-appear error after uninstalled [9.8-pre (release_N/A-N/A-c426f4)

2024-07-15 Thread Ihor Radchenko
Kepa  writes:

> I have uninstalled org-appear several days ago, and I am constantly receiving 
> this error:
>
> Error in post-command-hook (org-appear--post-cmd): (wrong-type-argument 
> number-or-marker-p nil)

This does not look have anything to do with Org. This is org-appear specific.

> So, I ran these commands, getting a warning that advised me to inform the 
> mailing list:
> (require 'org-appear)
> (add-hook 'post-command-hook 'org-appear--post-cmd)
>
> Warning:
> ⛔ Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org 
> buffer # (lisp-interaction-mode)
> ⛔ Warning (org-element): org-element--cache: Org parser error in 
> *scratch*::305. Resetting.
>  The error was: (error "rx ‘**’ range error")
>  Backtrace:
> nil
>  Please report this to Org mode mailing list (M-x org-submit-bug-report).

This is expected. `org-appear--post-cmd' is not designed to be used
outside Org mode. But you forced it to. Hence getting errors.

Not a bug.
Canceled.

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



Re: [ANN] tchanges.el: Collaborate with word processor (docx) users using 'track changes'

2024-07-15 Thread Ihor Radchenko
James Thomas  writes:

>> Well. My dream is to have native Org markup for comments. With
>> appropriate UI to view/edit them.
>>
>> Maybe something based on footnotes.
>
> Footnotes are, at least technically, for a point and not a region. Any
> thoughts about how to extend that?

For example, re-using the idea of inline special blocks we discussed in
https://list.orgmode.org/875xwqj4tl.fsf@localhost/

Something like

@note{short inline comment}{}

@note{[cn:X: another inline comment]}{}
Text that has nothing to do with comment. @note{[cn:X]}{another part of
text related to the same comment X}

@note{[cn:Y]}{}
...
...
...
[cn:Y] Long comment, maybe even a discussion
   - (by John) Involving different parties
 - (by Mark) with replies, etc.

The idea is to use, say [cn:X] (comment note), instead of [fn:X].

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



Re: Effort by category in agenda view

2024-07-15 Thread Ihor Radchenko
Patrick Nicodemus  writes:

> Currently the agenda gives an overview of the total effort scheduled in
> hours. Filtering items from the agenda does not affect the effort estimate
> for the day.

May you please elaborate where exactly you are seeing the estimate? Is
it agenda column view?

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



Re: [fr] refile goto: push mark in the target buffer first

2024-07-15 Thread Ihor Radchenko
Samuel Wales  writes:

> a redesign: i think it would probably be great if all three rings stopped
> being rings and started being trees, much like undo-tree, perhaps even with
> visualizer, with a consistent interface.  if you think of info's navigation
> commands like l and r, you can imagine various things you can do.  in
> undo-tree and vundo you can switch branches for the next place you might
> want to go to.  point locs could use the same type of navigation commands.

I can see what you mean, although I am not sure if there is a good UI
for tree-like navigation in this scenario. At least, I can't think of
one. I am not sure how undo-tree-like interface would work here.

> draft spec: here is a draft spec i wrote for a point history ui.
>
> the spec applies to local, global, and link oriented, with an expanded idea
> of links to include such things, if desired by user, as identifiers,
> timestamps, bare fs paths, and many other things.
>
> dispatcher f and b go to next and prev point loc in buffer, much like m-tab
> in org.  it is settable on the fly whether it navigates local, global, or
> link, or it can use different prefixes or initial key sequences.

This is not like mark ring though - just search across specific object
types in buffer. Something akin next/previous-button.

> vvv draft spec
> Dispatcher l and r go back and forward
> in history of point, regardless of
> buffer.  Thus, dispatcher RET then
> dispatcher l returns to point, even if
> point was not on a link.  The bindings
> are modeled on l and r in info or help.
>
> Dispatcher n and p change at branching
> points, cycling you to the different
> places r might go and back.

This part about branching is not very clear.

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



Re: Latex preview + symbolic link + relatvie path bug

2024-07-15 Thread Ihor Radchenko
Emil Vatai  writes:

> Yepp, that helped. Thanks for checking (my bad for not checking).

Thanks for confirming!
Canceled.

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



Re: [ANN] tchanges.el: Collaborate with word processor (docx) users using 'track changes'

2024-07-15 Thread Ihor Radchenko
James Thomas  writes:

>>> They're loaded on import and view/edit/add-able before re-exporting. A
>>> 'Save WIP' feature for writing to disk until then is on the TODO list.
>>
>> Are the comments also using Org markup? Or is it something more ad-hoc?
>
> The comments are separately stored in bookmark.el bookmarks. I'd briefly
> considered also using a fake backend like "@@comment:the annotation
> text@@" inline for it specifically for org, but preferred the former due
> to the easier sorting/browsing etc.; and I also didn't want to maintain
> the state in two places. But if you have better ideas, please tell me.

Well. My dream is to have native Org markup for comments. With
appropriate UI to view/edit them.

Maybe something based on footnotes.

> (If you're talking about markup within the comment text, that's
> obviously orthogonal to this)

I was talking about that too :)
If we have native markup for comments in Org, may as well allow the rest
of Org markup there.

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



Re: Latex preview + symbolic link + relatvie path bug

2024-07-15 Thread Ihor Radchenko
Emil Vatai  writes:

> The bug and how to reproduce (a potential solution to it) can be found here:
> https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-10/msg01152.html
>
> Copy of the most relevant part:
>
>>* How to reproduce:*
>>
>>* 1. Run `mkdir -p ~/a_dir/org'.*
>>
>>* 2. Run `ln -s ~/a_dir/org ~/docs'.*
>>
>>* 3. Run `emacs -Q ~/docs/example.org <http://example.org>'.*
>>
>>* 4. Insert into the file "$2+2=4$", press `C-c C-x C-l', and see that it*
>>* does not work.*
>>
>>* 5. Kill emacs.*
>>
>>* 6. Run `emacs -Q ~/a_dir/org/example.org <http://example.org>'.*
>>
>>* 7. Insert into the file "$2+2=4$, press `C-c C-x C-l', and see LaTeX*
>>* preview.*

I am unable to reproducing using the latest version of Org mode.
May you please try to upgrade your Org mode version and let me know if
you are still seeing the problem?

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



Re: [FR] org-babel-n-tangle

2024-07-15 Thread Ihor Radchenko
Phil  writes:

> All right. So I have it working for single blocks by
> modifying only `org-babel-tangle' with :tangle-directory
> accepting a single string or a list, e.g.
>
> :tangle-directory '("dir1" "/ssh:host1:/dir2" "/-::/etc")
>
> The option is ignored for file-wide tangle.
>
> What do you think of, instead of adding :tangle-directory,
> modifying :tangle to make it accept also a list?

I am ok with making :tangle accept multiple values, but I think that
having a separate :tangle-directory argument is still useful.

Consider something like

#+PROPERTY: header-args :tangle-directory '("/path/to/project1" 
"/path/to/project2")

#+begin_src :tangle file1
...
#+end_src

#+begin_src :tangle file2
...
#+end_src

> Since I may not get back to this in the next weeks,
> I'm saving the following note and a patch as a current
> status of the function for later.

No problem. We have no deadlines here.

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



Re: [BUG] Warning (org-element): org-element--cache: Warning(2.org): Org parser error in 2.org::5951. Resetting. [9.8-pre (release_9.7.6-101-g4f6aab @ /home/grfz/src/org-mode/lisp/)]

2024-07-15 Thread Ihor Radchenko
Gregor Zattler  writes:

> this happened when I juggled with some
> org-mode formatted text from an email in
> two versions, comparing them.  I cannot
> say at what specific command the warning
> was shown.
>
> I'm not able to reproduce.

I was really hoping that we eradicated this in the latest major
release. So much for that hope.

Other that noticing this fact, the report is not actionable without
debug info or reproducer.

So, canceling after taking a note that this issue is still with us.

Canceled.

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



Re: dotime property on non-dated item

2024-07-14 Thread Ihor Radchenko
Florian Lindner  writes:

>> Use 'time-of-day instead.
>
> Thanks for advise! However, I was unable to get something else but nil 
> for time-of-day for these entries:
>
> * TODO dated and timed item
> SCHEDULED: <2024-07-14 So 14:00>

This item will have 'time-of-day property.

> * TODO timed item
> <2024-07-14 So>
> * TODO undated item

These two will not, because they do not specify time.

>   using the procedure described above.

Also, try M-x describe-text-properties

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



Re: Q: Attachments and IDs?

2024-07-14 Thread Ihor Radchenko
David Masterson  writes:

> I'm getting old, but I think I'm seeing it now.  I think the word
> "entry" in 10.2 threw me for awhile (entry as in a task hierarchy as
> opposed to a particular attachment). Maybe an Appendix for these generic
> words (entry, ID, header, task, ...) that explains their special meaning
> in Org for reference?  Not sure.

I tried to make things more clear by avoiding "outline node".
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=058aec0f3

Entry may still be confusing, but that's basically an alias to
"heading" and it is used all over the place.

I do not think that we need an appendix - most of the terms are simply
introduced one by one while reading the manual.

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



Re: dotime property on non-dated item

2024-07-14 Thread Ihor Radchenko
Florian Lindner  writes:

> * TODO dated item
> SCHEDULED: <2024-07-04 Do 14:00>
> * TODO undated item
>
> which is in org-agenda-files. Using "org-agenda t" and executing "C-x 
> C-x =" (what-cursor-position) yields "dotime t" for both entries.
>
> I have found no documentation on the "dotime" property, my understanding 
> is that the "undated item" should have this property set to nil.
>
> Some background:
>
> org-super-agenda uses this property to determine if items are to appear 
> on the time grid, when using the time-grid property, see that discussion 
> https://github.com/alphapapa/org-super-agenda/issues/264
>
> What is the definition of the dotime property?
> Is there maybe another property or way to determine if entries should 
> appear on the time time grid?

DOTIME is an internal property storing arguments to
`org-ageda-format-item'.

Use 'time-of-day instead.

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



Re: [BUG] Invalid search bound [9.6.24 (9.6.24-??-5bdfc02 @ /Users/forsil/.config/emacs/.local/straight/build-29.2/org/)]

2024-07-14 Thread Ihor Radchenko
Ihor Radchenko  writes:

> May you upgrade Org mode to Org 9.7 and let us know if you still see the
> warning?

No response within one month.
Closing.
Canceled.

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



Re: Missing the first and last number of the date and time in the :CREATED: field.

2024-07-14 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Thanks for reporting, but may you provide mode details?
> What one needs to do to replicate the problem you are seeing?
> Is some kind of capture template necessary? Custom commands?
>
> See https://orgmode.org/manual/Feedback.html#Feedback

No response within one month.
Closing.
Canceled.
We can re-open the report any time once there is more information.

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



Re: [BUG] Incorrect application of 'comment-region' in code blocks

2024-07-13 Thread Ihor Radchenko
the_wurfkreuz  writes:

> I don't really know for sure what exactly i should do.
> I cloned the repo 'git clone 
> https://git.savannah.gnu.org/git/emacs/org-mode.git'.
> Created minimal config ~/minimal_config.el:
>
> (require 'org)
> (setq initial-major-mode 'org-mode)
>
> Created the repro file /tmp/bug.org.
> Then from the cloned directory i did this:
>
> make repro REPRO_ARGS="-l ~/minimal_config.el /tmp/bug.org"
>
> Then i made the action that produces the bug and i got it.

Confirmed.
It was important that src block code should be indented.

The culprit is that `org-comment-or-uncomment-region' assumes that the
region size will remain unchanged when in Org src buffer. It is not true
when the code in Org mode is indented.

> #+begin_src emacs-lisp
>
>   ;; (with-eval-after-load 'evil
>   ;;   (define-key evil-insert-state-map (kbd "C-S-v") 'yank)
>   ;;   (define-key evil-visual-state-map (kbd "{") 'evil-backward-paragraph)
>   ;;   (define-key evil-visual-state-map (kbd "}") 'evil-forward-paragraph)
>   ;;   (define-key evil-insert-state-map (kbd "M-w") 'evil-forward-word-begin)
>   ;;   (define-key evil-insert-state-map (kbd "M-b") 
> 'evil-backward-word-begin)
>   ;;   (define-key evil-insert-state-map (kbd "M-W") 'evil-forward-WORD-begin)
>   ;;   (define-key evil-insert-state-map (kbd "M-B") 
> 'evil-backward-WORD-begin)
>
>   ;;   (define-key e
> vil-normal-state-map (kbd "gq") 'FormatToThreshold)
> (define-key evil-visual-state-map (kbd "gq") 'FormatToThreshold))
>
>   (defun my-move-beginning-of-line ()
> "Move point to the first non-whitespace character of the line and enter 
> insert mode."
> (interactive)
> (evil-first-non-blank)
> (evil-insert-state))
>
> #+end_src
>
> (with-eval-after-load 'evil
> (define-key evil-insert-state-map (kbd "C-S-v") 'yank)
> (define-key evil-visual-state-map (kbd "{") 'evil-backward-paragraph)
> (define-key evil-visual-state-map (kbd "}") 'evil-forward-paragraph)
> (define-key evil-insert-state-map (kbd "M-w") 'evil-forward-word-begin)
> (define-key evil-insert-state-map (kbd "M-b") 'evil-backward-word-begin)
> (define-key evil-insert-state-map (kbd "M-W") 'evil-forward-WORD-begin)
> (define-key evil-insert-state-map (kbd "M-B") 'evil-backward-WORD-begin)
>
> (define-key evil-normal-state-map (kbd "gq") 'FormatToThreshold)
> (define-key evil-visual-state-map (kbd "gq") 'FormatToThreshold))
>
>   (defun my-move-beginning-of-line ()
> "Move point to the first non-whitespace character of the line and enter 
> insert mode."
> (interactive)
> (evil-first-non-blank)
> (evil-insert-state))

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



Re: [ANN] tchanges.el: Collaborate with word processor (docx) users using 'track changes'

2024-07-13 Thread Ihor Radchenko
James Thomas  writes:

>> What about comments? Are they stored into Org mode file or separately?
>
> They're loaded on import and view/edit/add-able before re-exporting. A
> 'Save WIP' feature for writing to disk until then is on the TODO list.

Are the comments also using Org markup? Or is it something more ad-hoc?

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



Re: Org Babel related popup buffer names not unified

2024-07-13 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

> I use bellowing config to manage Org Babel related popup buffer displaying.
>
> (add-to-list 'display-buffer-alist '("^\\*Org Src.*\\*" . 
> (display-buffer-below-selected)))
> (add-to-list 'display-buffer-alist '("^\\*Org Babel Results\\*" . 
> (display-buffer-below-selected)))
> (add-to-list 'display-buffer-alist '("^\\*Org Babel Preview.*\\*" . 
> (display-buffer-below-selected)))
> (add-to-list 'display-buffer-alist '("^\\*Org Babel Error Output\\*" . 
> (display-buffer-below-selected)))
>
> I found in org-mode source code, some places use "*Org-Babel Results*",
> somewhere does not have dash between *Org-Babel, "*Org-Babel Results*".
>
> Other Org Babel related buffer names has same situations.
>
> I hope org-mode can unify those buffer names.
>
> Ihor, WDYT?

I agree that the inconsistency is annoying, but by changing the names we
risk breaking user configs. And there is no clear significant benefit in
being more consistent (other than aesthetics). So, I see no reason to
change the status quo.

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



Re: Q: Attachments and IDs?

2024-07-13 Thread Ihor Radchenko
David Masterson  writes:

>> ///attached-file
>
> Hmm. I'm still misunderstanding the *value* of an ID (value in the sense
> of why is it useful for me).  This suggests to me that, under
> org-attach-id-dir, you could have a tree of attachments, but what is an
> example of why that's a good thing (particularly for a newbie)?
> ... Since
> the documentation on attachments starts out mentioning an ID, it's
> helpful to understand why it's useful.  Basically, I guess the above
> mentions "folder structure" without defining what is trying to be
> achieved with this more complicated folder structure instead of just one
> attachment directory where all attachments are dumped.

You can attach files to multiple headings.
Using the heading ID to construct the attachment location makes sure
that we do not dump all the attachments together.
Isn't it obvious? I am genuinely surprised.

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



Re: [fr] refile goto: push mark in the target buffer first

2024-07-13 Thread Ihor Radchenko
Samuel Wales  writes:

> thank you!  this would definitely meet my need.
>> ...
>> See the attached tentative patch.
>> This is an easy addition.

Applied, onto main.
Done.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=486ebe118

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



Re: [BUG] Incorrect application of 'comment-region' in code blocks

2024-07-13 Thread Ihor Radchenko
the_wurfkreuz  writes:

> Reproduction:
>
> 1. emacs -Q
> 2. Enable org-mode in the scratch buffer (M-x org-mode)
> 3. Paste this code:
> ...
> ...
> 4. Highlight the first code paragrapth in the org code block:
> ...
> 5. Execute 'comment-region'. It will apply partial commenting on the
> next line like this:

I am unable to reproduce.
May you try your recipe using "make repro" as described in
https://orgmode.org/manual/Feedback.html#Feedback
If you do it in freshly cloned Org code directory, it will use the
latest Org version I used on my side.

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



Re: multipage html output

2024-07-13 Thread Ihor Radchenko
Orm Finnendahl  writes:

>> This sounds like some kind of extension to :filter-final-output.
>> I think it should also be an ok option.
>
> :filter-final-output functions could be used, but the name is a bit
> misleading. Therefore I'd suggest to extend the
> org-export-filters-alist with :export-final-output which only gets
> called if non-nil. Otherwise org-export-as will return a single string
> as before, so we don't break anything.

It is not very clear for me from the name how :export-final-output would
differ from :filter-final-output. Maybe :finalize-export-functions?

> In the multipage case we still need a hook to split the parse tree
> before transcoding. The place for this should probably be in
> org-export--annotate-info. I don't see any mechanism/alist function to
> use so I would suggest to add an option :multipage-process-hook to
> org-export-filters-alist.

We should better use a new option, yes. Many existing options can be
modified by users by accident, and we do not want that.

> In addition the backend will set a :multipage option at the beginning
> of the export, when exporting to multipage.

It will be more in-line with the existing design to set
:export-options. See `org-export--get-export-attributes'.

> I will go ahead and implement a proposal. Let me know if something
> sounds bad/unreasonable.

As you see, nothing major. We can work out the details after you get a
prototype to work with.

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



Re: [Bug] org-update-dblock randomly broken for more than 10 columns and larger files

2024-07-12 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> I just tested with GNU Emacs 29.4 with --no-init-file and the minimal 
>> example still doesn't produce a correct table.
>
> May you please elaborate what exactly is not correct in the table?
> I am not seeing any problem - no extra empty lines are added by the
> second and subsequent calls.

Never mind my question.
Emacs 29.4 does not include Org 9.7, where the bug has been fixed.
You need either upcoming Emacs 30 or upgrade Org mode from ELPA.

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



Re: [Bug] org-update-dblock randomly broken for more than 10 columns and larger files

2024-07-12 Thread Ihor Radchenko
Jakob Schöttl  writes:

>> Thanks for the reproducer!
>> I committed a fix onto main.
>> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=58c5c5882
>
> Hi Ihor, do you know anything on the merge progress of your fix into emacs?
>
> I just tested with GNU Emacs 29.4 with --no-init-file and the minimal 
> example still doesn't produce a correct table.

May you please elaborate what exactly is not correct in the table?
I am not seeing any problem - no extra empty lines are added by the
second and subsequent calls.

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



Re: Capture from Firefox to Org-mode

2024-07-12 Thread Ihor Radchenko
Sébastien Gendre  writes:

> Ihor Radchenko  writes:
>> I wrote https://github.com/yantar92/org-capture-ref to do exactly
>> this. 
>
> Is it meant to be used with org-ref ?

No. It has nothing to do with org-ref.

> I didn't plan to build a bibliography with bibtex (at least for now). I
> just plan to built a simple book reading tracker with Org-mode. But I
> keep a note about your suggestion, it could be very helpful in the
> future.

org-capture-ref does not create bibtex. It just stores metadata and
chooses a format of that metadata in Org headings that is compatible
with ol-bibtex library.

I use org-capture-ref as reading tracker myself.

Examples of books/articles captured by org-capture-ref:

 DONE Cal Newport [Goodreads] Digital Minimalism: Choosing a Focused Life 
in a Noisy World :book:ATTACH:
CLOSED: [2021-02-27 Sat 22:33]
:PROPERTIES:
:ID: goodreads_digit_minim_choos_focus_life
:CREATED: [2020-07-28 Tue 10:18]
:Effort:   0:20
:HOWPUBLISHED: Goodreads
:URL:  https://www.goodreads.com/book/show/40672036-digital-minimalism
:NOTE: Online; accessed 12 July 2024
:AUTHOR:   Cal Newport
:BTYPE:book
:TITLE:Digital Minimalism: Choosing a Focused Life in a Noisy World
:END:

* DONE Blair [JAMA] (1989) Physical Fitness and All-Cause Mortality 
:article:ATTACH:
SCHEDULED: <2021-03-14 Sun>
:PROPERTIES:
:TITLE:Physical Fitness and All-Cause Mortality
:BTYPE:article
:ID:   3c7ab86d5821f6c622d20c6b83605ef5e4e02691
:AUTHOR:   Steven N. Blair
:JOURNAL:  JAMA
:VOLUME:   262
:NUMBER:   17
:PAGES:2395
:YEAR: 1989
:DOI:  10.1001/jama.1989.03430170057028
:URL:  https://doi.org/10.1001/jama.1989.03430170057028
:CREATED:  [2021-03-13 Sat 20:50]
:HOWPUBLISHED: Jamanetwork
:NOTE: Online; accessed 13 March 2021
:END:



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



Re: [FR] org-babel-n-tangle

2024-07-12 Thread Ihor Radchenko
Phil  writes:

> The ability to tangle to multiple destinations is a very convenient way
> to manage cluster configurations. No, it's more than that: it's an
> *awesome* way to deploy and keep clusters configs and repros well
> organized.
> ...
> #+begin_example
> #+begin_src elisp :n-tangle "hosts-A/tmp" :tangle /x/y :mkdirp t
>(org-babel-n-tangle '(4))
> #+end_src
> #+end_example
>
> In the above example the tangled outputs goes to
> *hostA:/tmp/x/y* and *hostB:/tmp/x/y* using a default protocol.
>
> In the absence of *:n-tangle* or when
> *org-babel-ntangle-destinations* is nil.
> *org-babel-n-tangle* behaves like *org-babel-tangle*
>
> What do you think ?

This sounds like a logic extension of the existing tangle mechanism.
Although, I feel that the semantics is a bit cumbersome.

IMHO, a more natural approach would be (1) Introduce :tangle-directory
parameter that defines relative directory to be used as tangle target;
this directory, if defined, will be used instead of the Org file
directory to expand the tangle target; (2) Allow :tangle-directory and
:tangle-file to be a list of targets to write.

Then, we can modify `org-babel-effective-tangled-filename' to account
for :tangle directory and modify `org-babel-tangle' (as you did) to
write to multiple targets.

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



Re: in 28, massive slowness in capture, folding, and org-show-context

2024-07-12 Thread Ihor Radchenko
Samuel Wales  writes:

> 18018  99% - command-execute
> ...
>17488  96%  - org-capture
>17434  96%   - org-capture-place-template
>17398  96%- org-fold-show-all
>17370  96% - org-fold-region
>11415  63%  - org-fold-core-get-regions
>11371  62%   - org-fold-core-next-folding-state-change
> *** FACT colophon
> i am running org 9.7.6.  i recently upgraded to emacs 28
> from 27.  simultaneously bookworm from bullseye.  was
> running 9.7.6 without major issues before bookworm.
>
> emacs -q with default org without my .org files is
> relatively ok.  no changes to my .emacs that seem relevant,
> none to capture.  i did disable some capture hooks i had in
> hopes of fixing hte issue, but they did not.
>
> when i am running a normal large rsync that i always ran
> under bullseye, all keystrokes in emacs can take seconds.  i
> believe vlc can be slower too.

Looks like you have too many text properties in buffers, which makes
redisplay slow.

Try setting `org-fold-core--optimise-for-huge-buffers' to '(grab-invisible)
If that does not help, try settqing `org-fold-core-style' to 'overlays.

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



Re: Org babel R command session

2024-07-12 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Or we can just document that ESS defaults are used for sessions and ask
> users to customize inferior-ess-R-program if they need something
> non-standard for sessions.
>
> The problem with `inferior-ess-R-program' is that it must be executable
> name, and cannot be command with arguments, as in our default value of
> org-babel-R-command: "R --slave --no-save". In the absense of people who
> are actually making use of the proposed feature, I see no reasons to
> complicate the code.

Fixed, on the ob-R documentation page in WORG.
https://git.sr.ht/~bzg/worg/commit/c6380ced

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



Re: [BUG] List: org-shiftright brake list by indentation. Patch. [9.6.28 ( @ /home/u/.emacs.d/elpa/org-9.6.28/)]

2024-07-11 Thread Ihor Radchenko
Vitaliy Chepelev  writes:

> Hi, In the first version I disabled indentation completely,
>  but this breaks sub-list items, as I found out later. In
>  the second version I disabled calculation of bullet lengths
>  ( 1. 1) = 2 (- +) = 1, all = 1 now, this works for text
>  formatted with fill-paragraph like this one that you read
>  now. I assume that bullet lenght calculated only for case
>  when user set custom bullets like: (First., Second.,
>  Third.).

FYI, I have already fixed the bug you reported. So, your patch should
not be necessary, unless you think that my fix is not sufficient.
See https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f7ef4071b

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



Re: [ANN] tchanges.el: Collaborate with word processor (docx) users using 'track changes'

2024-07-11 Thread Ihor Radchenko
James Thomas  writes:

> The import part in my package is merely a frill.
>
>> but with an added feature to automatically display diffs.

What about comments? Are they stored into Org mode file or separately?

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



Re: Capture from Firefox to Org-mode

2024-07-11 Thread Ihor Radchenko
Sébastien Gendre  writes:

> How to capture data from a web page to Org-mode ?
>
> * What I need
>
> I want to be able to capture different kind of information :
>
> - Article, to read later
>
> - Book, with all its metadata (title, author, subject, etc)
>
> - Magazin, to buy later (title, editor, price, etc)
>
> - IRL event, that I want to go
>
>
> For each case, different kind of data is needed to be extracted from the
> web page and passed to Org-capture.

I wrote https://github.com/yantar92/org-capture-ref to do exactly
this. 

> * Capture Protocol
>
> I know it exist an org-protocol for capture, but after reading the
> manual (section 17.16.2 The capture protocol), there is something
> I did not understand.
>
> On the URL of the capture protocol, key value pairs can be specified.
> But are they a predefined set of keys, independent to the capture
> template, or are they related to the capture template special words (ex:
> %a) ?
>
> Is it possible, with Org-protocol, to pass data to be stored into org entry
> properties, or an arbitrary string ?

Yes, but passing non-standard data is an undocumented feature. (It is
stored in :query property that you may need to extract via
%(plist-get (org-capture-get :query) :my-keyword) placeholder or
something similar.

> I have seen a typo in the manual "17.16.2 The capture protocol":
> https://orgmode.org/manual/The-capture-protocol.html
>
> At the end of the first phrase, it miss a space between the "a" and
> "capture". Instead of "a capture", we have "acapture".

This has been already fixed in de775a36d, but thanks for the heads-up anyway.

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



Re: Capture, template expansion and keyword for link type

2024-07-11 Thread Ihor Radchenko
Sébastien Gendre  writes:

> I was reading the Org-mode manual, at section "10.1.3.2 Template
> expansion":
> https://orgmode.org/manual/Template-expansion.html
>
> And I was a little bit confused by the "%:keyword". The manual say:
> "Specific information for certain link types, see below."
>
> Where did this link come from ?

> When is it defined, and from/to where ?

> To be able to use the "%:keyword" in a capture: Do I need to store a
> link before calling org-capture ? Or do the call of org-capture will
> automatically store a link to where my point is before the call ?

> The manual page of template expansion did not explain it.
>

1. If there is %a placeholder in the template, org-capture stores link
   to the location from where you called org-capture

2. If there is no placeholder, the last stored link is used

> Also, if a capture template is selected after an org-protocol call, the
> documentation say that only 3 keywords are available: %:link’,
> ‘%:description’ and ‘%:annotation’.
>
> Is it possible to passe more keyword through an org-protocol call ?

Not directly. Additional keywords are stored inside undocumented %:query
keyword value.

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



Re: Q: Attachments and IDs?

2024-07-11 Thread Ihor Radchenko
David Masterson  writes:

> It's taking awhile to get through my hard head, but I think I'm
> beginning to understand the directory structure of attachments.
>
>   org-attach-id-dir/IDx/attachment-file
>
> I don't understand the value of IDx. I would think that "attachment:"
> could simply reference 'org-attach-id-dir' (drop 'id'?) unless
> overridden by a DIR property.  I think I'm missing something that would
> help my understanding of attachments.  Am I?

> Is there a section of the Org manual that talks about IDs?

10.2.2 Attachment options

‘org-attach-id-to-path-function-list’
 When ‘ID’ is used for attachments, the ID is parsed into a part of
 a directory-path.  See ‘org-attach-id-uuid-folder-format’ for the
 default function.  Define a new one and add it as first element in
 ‘org-attach-id-to-path-function-list’ if you want the folder
 structure in any other way.  All functions in this list will be
 tried when resolving existing ID's into paths, to maintain backward
 compatibility with existing folders in your system.

For IDs, we use `org-attach-id-uuid-folder-format' by default - it puts
attachments under

///attached-file

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



Re: [BUG] List: org-shiftright brake list by indentation. Patch. [9.6.28 ( @ /home/u/.emacs.d/elpa/org-9.6.28/)]

2024-07-11 Thread Ihor Radchenko
[ Adding Org mailing list back to CC to keep the conversation public ]

Vitaliy Chepelev  writes:

> I made much better patch for my org-9.6.28/org-list.el, now indentation
>  is working and list don't breaks:

May you please explain in more details what is better in the proposed
patch compared to the already installed fix?

> diff --git a/org-list.el b/org-list.el
> index 502e61b..27617c5 100644
> --- a/org-list.el
> +++ b/org-list.el
> @@ -1813,6 +1813,14 @@ This function modifies STRUCT."
>  (setq end-list (sort end-list (lambda (e1 e2) (< (cdr e1) (cdr e2)
>  (org-list-struct-assoc-end struct end-list)))
>
> +(defcustom org-list-static-bullet-length t
> +  "Assume that bullet length always equal one character.
> +Oterwise indent list items according to calculated length of
> +bullet."
> +  :group 'org-plain-lists
> +  :group 'org-cycle
> +  :type 'boolean)
> +
>  (defun org-list-struct-apply-struct (struct old-struct)
>"Apply set difference between STRUCT and OLD-STRUCT to the buffer.
>
> @@ -1900,8 +1908,12 @@ Initial position of cursor is restored after the 
> changes."
>  (ind-old (org-list-get-ind pos old-struct))
>  (bul-pos (org-list-get-bullet pos struct))
>  (bul-old (org-list-get-bullet pos old-struct))
> -(ind-shift (- (+ ind-pos (length bul-pos))
> -  (+ ind-old (length bul-old
> +(ind-shift (if org-list-static-bullet-length
> +  (- (+ ind-pos 1)
> + (+ ind-old 1))
> +  ;; else
> +  (- (+ ind-pos (length bul-pos))
> + (+ ind-old (length bul-old)
>  (end-pos (org-list-get-item-end pos old-struct)))
> (push (cons pos ind-shift) itm-shift)
> (unless (assq end-pos old-struct)

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



Re: multipage html output

2024-07-11 Thread Ihor Radchenko
Orm Finnendahl  writes:

> If org-export-as returns just one string, then it will reparse the
> parse tree each time it needs to generate an output string. But as you
> say below, you rather think org-export-as returns a list of strings
> for the multipage case.

Got it now.

>> What I have in mind is that `org-export-as' will return a list of
>> strings + INFO. INFO will contain data about which files to use for
>> saving the strings. Then, the caller does the saving and whatever is
>> necessary. If we write to files from `org-export-as' it will be a
>> massive breaking change in the expected behavior.
>
> ok, that's what you mean. I can do this, but don't you think it'd be
> more consistent with the general layout of ox, if org-export-as uses a
> callback function to call on each generated string with the filename
> as argument nad we agree on names for multipage file output which have
> to get implemented by multipage backends?

This sounds like some kind of extension to :filter-final-output.
I think it should also be an ok option.

> Whatever, both ways will do what's needed, just let me know what you
> prefer and I will provide a suggestion, ok? I try to find time on the
> weekend, otherwise I'll have time after the end of next week.

I am ok with what you propose. So, please go ahead.

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



Re: [BUG] org--plot/sensible-tick-num when range is a power of 10

2024-07-11 Thread Ihor Radchenko
Brice Waegenire  writes:

> I've found a bug in =org--plot/sensible-tick-num=, when a plot has a
> range of a power of 10  (1, 10, 100, ...).
>
> To reproduce, run =org-plot/gnuplot= on the following plot:
> #+plot: type:radar min:0 max:10
> | Metric  | Value |
> |-+---|
> | alpha   | 2 |
> | beta| 4 |
> | gamma   | 6 |
> | delta   | 8 |
> | epsilon |10 |
>
> It produce the error: =let*: Wrong type argument: number-or-marker-p, nil=.

Confirmed.
I am completely lost in the intended logic of how the tics are
determined.
CCing the author.

Timothy, I feel that the logic is pretty much off for ranges with powers
of 10 and for single value column.

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



Re: org-encrypt-entries is slow (was: org-crypt leaking data when encryption password is not entered twice (was: Please document the caching and its user options))

2024-07-11 Thread Ihor Radchenko
Daniel Clemente  writes:

> I see it's trying to decrypt things (therefore it asks for the
> password). It shouldn't, since I didn't modify any encrypted section.
> I said „it asked me for an encryption password“ because the GPG prompt
> confusingly uses the word „encryption“ („Passphrase for symmetric
> encryption“), though it's actually asking for a decryption password.
> ...
> This is the text "abc" encrypted with password "abc". Use this file:
>
> * hi  
> :nocrypt:
> -BEGIN PGP MESSAGE-
>
> jA0ECQMCVpS/qSoed5f/0joBYoIRWdgt/+PVQCsZh9sg176SdnvP2Wc8tH/CV1Rk
> l2MjAh3Rk19Q2aP2EffpZ5CFeGELTMXCnCYv
> =FNtI
> -END PGP MESSAGE-
>
> Open the file, add a space to the title and save it. The first time it
> works (no questions asked) because there's no tag called :crypt:
> Now change the :nocrypt: to :crypt: and save.  It asks for the
> password. Press C-g to cancel.
> Change again the tag to :nocrypt:. Save. It asks for the encryption
> password; it shouldn't.
> Add a space to the title, save, it keeps asking for the encryption
> password, though there's no :crypt: section.

This should be fixed now.
May you try yet again?

>> > - Org spends around 20 seconds trying to save the file, in a loop,
>> > reporting:  (error "org-crypt: Encryption failed.  Not saving the
>> > buffer. Error: GPG error: \"Encrypt failed\", \"Canceled; Exit\"")
>>
>> This is curious, but I again have no clue. Maybe the new version of the
>> branch works a bit better.
>>
>
> Since this error can happen because of a problem in a different buffer
> (not the current one), would it be good to mention the file name in
> that error message?

Yes. Done now on the branch.

> I didn't see this particular problem again. But I see others, which
> are hard to report and reproduce. For instance I had an encrypted
> section under a :crypt: header (I see „BEGIN PGP“ and hex codes), I
> save, and saving *UNencrypts* the header before saving, without
> asking. It should never decrypt when saving, but it does. This happens
> with the same small example I posted above (but using the :crypt:
> tag).

The other problem you reported had something to do with incorrectly
cycling encryption state during save. I hope that fixing one also fixed
another.

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



Re: figures not exported properly by ox-latex

2024-07-11 Thread Ihor Radchenko
mahmood sheikh  writes:

> it might've been fixed for figures as its been a while, but shouldnt latex
> environments with #+caption: and #+name: above them be exported as figures?
> because currently the user has to write \begin{figure} and \end{figure}
> explicitly which would work but may not be as practical for other ox
> backends like html i think? perhaps im wrong.

It looks like your original problem is not reproducible, and you are
talking about a _different_ problem now.

May you please provide an example of what kind of behavior you are
talking about?

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



Re: [BUG] unexpected behaviour on sub-list

2024-07-11 Thread Ihor Radchenko
Phil  writes:

> I'm reporting this bug on Org mode version 9.7.6.
> It was in already in 9.5.
>
> - here is a list
>   with a sub list
>
>   - like here ;
>
>   and then text (<- this will be deleted)
> x
>
>   1) Trying to insert an other item above,
>  by suppressing the "x", and hitting M-RET,
>  if there's no text after, the command gets stuck
>  in org-list-struct-apply-struct.

Confirmed.
Potentially a duplicate of 
https://list.orgmode.org/orgmode/v3up5d$oc4$1...@ciao.gmane.io/

>  file:~/.emacs.d/repos/org/lisp/org-list.el::1968
>  Very likely, needs to check if forward line returns 0
>  otherwise it will keep looping.
>
>  #+begin_src patch
> - (while (< (point) down)
> + (while (and ( < (point) down) (not(> lines-left-to-move 0)))
> #+end_src
>
>  file:~/.emacs.d/repos/org/lisp/org-list.el::1982
>  #+begin_src patch
>   - (forward-line)))
>   + (setq-local lines-left-to-move (forward-line)
>  #+end_src

Thanks for looking into the causes!
I will look closer into this later.

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



Re: Treat habits as ordinary tasks

2024-07-10 Thread Ihor Radchenko
Patrick Nicodemus  writes:

> Any task which is a habit is listed in a special portion of the agenda for
> consistency tracking. This is useful and convenient. However, this
> apparently conflicts with scheduling the habit for a certain time. For
> example, if I want to go for a run on Tuesday at 5pm, I would like to have
> the option to schedule my running habit for 5pm on Tuesday and have it
> appear in the agenda at that position.
>
> Ideally I would like to toggle the features of the habit module on and off,
> so that in the agenda view, habits are treated either as normal tasks at a
> particular time, or they appear in the consistency tracker window rather
> than the schedule. Is there a way to accomplish this?
>
> Note that I don't want to filter (remove) the habits from the agenda. I am
> familiar with this functionality.

This is no built-in way to toggle this, but I can give you pointers how
to achieve what you want.

The reason why habits are grouped together is the default value of
`org-agenda-sorting-strategy':

org-agenda-sorting-strategy is a variable defined in ‘org-agenda-sort.el’.

Its value is
((agenda habit-down time-up urgency-down category-keep)
 (todo urgency-down category-keep) (tags urgency-down category-keep)
 (search category-keep))

As you can see, for "agenda" blocks, the first sorting key is
"habit-down" causing all habits go after non-habits.

To get the habits sorted by time (I assume that you are looking for your
habits to appear in the time grid), you need to remove "habit-down" from
the sorting strategy.

You can write a small helper command to do this:

(defvar my/org-agenda-sorting-strategy-pre nil
  "Previous value of `org-agenda-sorting-strategy'.")
(defun my/org-agenda-toggle-habit-grouping ()
  "Toggle grouping of habits in agendas.
Does not work when custom agenda command defines local sorting strategy."
  (interactive)
  (org-agenda-check-type t 'agenda)
  (if my/org-agenda-sorting-strategy-pre
  (progn
(setq org-agenda-sorting-strategy my/org-agenda-sorting-strategy-pre)
(setq my/org-agenda-sorting-strategy-pre nil)
(org-agenda-redo)
(message "Habit grouping ON"))
(let ((old-strategy (alist-get 'agenda org-agenda-sorting-strategy)))
  (if (not (or (memq 'habit-up old-strategy) (memq 'habit-down 
old-strategy)))
  (user-error "Habits are not grouped in agendas: %S" old-strategy)
(setq my/org-agenda-sorting-strategy-pre (copy-alist 
org-agenda-sorting-strategy))
(setf (alist-get 'agenda org-agenda-sorting-strategy) (delete 'habit-up 
(delete 'habit-down old-strategy)))
(org-agenda-redo)
(message "Habit grouping OFF")

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



Re: multipage html output

2024-07-10 Thread Ihor Radchenko
Orm Finnendahl  writes:

>> >> > - org-html-multipage-front-matter
>> >> >
>> >> >   A list to specify pages in front of the headlines of the
>> >> >   document. Possible values are 'title, 'title-toc and 'toc. title-toc
>> >> >   is a combined page containing the title and the toc. Multiple
>> >> >   entries are possible.
> ...
> Consider a doucument like this:
>
> ** Headline 1
> ** Headline 2
> *** Subheadline 2.1
>
> In the multipage export you want a front page with booktitle, author,
> date, etc. (maybe even an image...) and as a second page after the
> front page you want to have a full toc. Both pages should be reachable
> by the side toc but shouldn't get numbered so the toc on the side
> would appear like this:
>
> My Booktitle
> Contents
> 1 Headline 1
> 2 Headline 1
>   2.1 Subheadline 1
> ...Is my explanation somewhat clearer?

Yup. Clear now.
In the nutshell, you want

1. Special export settings for certain pages (inline toc vs. side toc)
2. Extend TOC generation rules to be more automatic than they are now
   (insert TOC inline automatically for certain headings vs side TOC for
   the rest)

Looks doable using the available means + previously discussed multipage
setting ideas.

>> 1. Take document AST
>> 2. Split it into multiple parts
>> 3. Filter the obtained part list (post-process)
>> 4. Perform actual per-page export
>> ...
>
> yes. we can build a complete machinery around all that, but currently
> I fear that this gets a bit out of control for me: I really have to
> get going with other things and currently I'd prefer to realize
> something that works with the architecture built in way that it is
> easlily extendable in the future without having to redo everything
> again.

Sure. Feel free to do things that work better for you. Just keep in mind
the ideas we discuss - we will eventually need to get them going and the
preliminary implementation should not cause hard blockers.

I am looking forward to your future contributions.

(And, BTW, feel free to check out
https://orgmode.org/worg/org-contribute.html - we provide some important
information about our patch conventions. Please pay attention to
https://orgmode.org/worg/org-contribute.html#copyright)

> ...
>> Sorry, but I am lost. What do you mean by "content" and what do you mean
>> by "page-main-body"?
>
> Look at the tags and ids of the html code on these pages.

Ok. More clear now.

What you have is


{TOC element aligned left}

{TITLE}

{document body aligned right}



Now, I think I can answer your original question:

> In addition I have a question about the html output layout
> structure. Here is an example of a file generated with the current
> code with some preliminary layout. It might give an idea about my use
> case:
>
> 
https://www.selma.hfmdk-frankfurt.de/finnendahl/klangsynthesebuch/01_00_00_vorwort.html#orge24571b
>
> Regardless of the colours, the file has a slightly different hierarchy
> than the single page html template of ORGMODE and is more oriented
> towards the layout of documentation nowadays with a (hideable) toc at
> the side on every page rather than the texinfo oriented layout used by
> the orgmode manual. If my code gets accepted/merged to org what should
> be the default layout shipped with multipage output? FYI: The
> visibility of the toc entries is managed by the css and the whole toc
> is included on each page (and its visibility could be managed with js
> as well). Should I rather go for the classic texinfo view?

For context, the vanilla exported HTML body is
(see `org-html-template', `org-html-inner-template', `org-html-toc')


{LINK UP}
{PREAMBLE}

{TITLE}
{TOC}
{exported CONTENTS}
{Footnotes}

{POSTAMBLE}
{JS scripts}


I see no major problem customizing TOC position in the HTML template.
In fact, it would be rather desirable to provide a set of less
bare-bones defaults (as long as they do not get too complex).

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



  1   2   3   4   5   6   7   8   9   10   >