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>



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

2024-07-10 Thread Ihor Radchenko
William Denton  writes:

> On Wednesday, June 26th, 2024 at 11:48, Ihor Radchenko  
> wrote:
>
>> Another OrgMeetup will be scheduled on the second Wednesday of July,
>> in two weeks.
>> 
>> URL: https://bbb.emacsverse.org/b/iho-h7r-qg8-led
>> Time & Date: <2024-07-10 Wed 19:00-21:00 @+03,Europe/Istanbul>
>
> If my time zone figuring is correct, the meeting should be on now, but the 
> Big Blue Button session hasn't started so I'm checking in.

Starting now.
(Sorry, messed up the time zones; thought it is still one hour 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: [patch] ox-beamer: allow setting frame subtitle with BEAMER_SUBTITLE property

2024-07-10 Thread Ihor Radchenko
h...@heagren.com writes:

> On 2024-07-08 19:17, Ihor Radchenko wrote:
>> (org-element-parse-secondary-string value (org-element-restriction 
>> 'keyword))
>
> Thanks for the guidance. There's a new patch attached, which allows
> org markup in the subtitle string, and announces the new feature in
> ORG-NEWS. Hope this is sufficient?

Yup.
Applied, onto main with some minor amendments to the commit message.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=50e34dde1

-- 
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 "swallows" table column groups

2024-07-10 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> Ihor Radchenko  writes:
>
>> May you try the attached tentative patch set?
>
> With the two patches applied, the bug is gone.  Yay!

Fixed, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=90d4ae92e
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=e0924db3c

> I have noticed two issues during testing:
>
> - a warning on 'make':
>
>   Compiling single /Users/salutis/src/org-mode/lisp/org-table.el...
>   In orgtbl-to-generic:
>   org-table.el:5843:14: Warning: Unused lexical variable 
> ‘org-export-replace-macros’

Yup.

> - a failure on 'make test':
>
>   FAILED  test-org-table/to-generic  "Undefined Org macro: macro; aborting"

This is what warning is telling 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] List: org-shiftright brake list by indentation. Patch. [9.6.28 ( @ /home/u/.emacs.d/elpa/org-9.6.28/)]

2024-07-10 Thread Ihor Radchenko
vita...@gmx.com writes:

> Hello. I use fill-paragraph function with (setq fill-prefix " ") variable.
> If I have list:
> 1) text text text texttext texttext texvttext texttext texttext
>  texttext texttext texttext texttext texttext text
> 2) text text text texttext texttext texttext texttext texttext
>  texttext texttext texttext texttext texttext text
>
> After org-shiftright I have:
>
> - text text text texttext texttext texvttext texttext texttext
> texttext texttext texttext texttext texttext text
> - text text text texttext texttext texttext texttext texttext
> texttext texttext texttext texttext texttext text
>
> This breakes list strcuture. I don't want to use (setq fill-prefix "  ")
>  with two spaces.

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

Although I am wondering how fill-prefix has anything to do with your report.

-- 
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 to set block switches "globally"?

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

>> I tried searching for where switches are parsed in the code, but
>> couldn't find much. Could you provide me with some pointers and files I
>> should be looking at?
>
> `org-element-src-block-parser' and `org-element-example-block-parser'.

Hi João,
It has been a while since the last message in this thread.
May I know if you are still working on this?

-- 
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 element cache error in indirect buffer [9.6.15 (release_9.6.15 @ c:/Users/User/Downloads/emacs-master-x86_64-full/share/emacs/30.0.50/lisp/org/)]

2024-07-09 Thread Ihor Radchenko
Matthew Clarke  writes:

> When using an indirect buffer I get the warning
> ...
> Warning (org-element-cache): org-element--cache: Org parser error in
> PIBBSS.org<2>::488418. Resetting.
> ...
> I am also experiencing, in indirect buffers, the inability to unfold
> org-headings, and problems where rearranging them leaves sub-headings
> behind, which may be related

Please upgrade to Org 9.7 and let us know if you stop seeing problems
with indirect buffers.

-- 
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: Incorrect cursor placement after using 'undo'

2024-07-09 Thread Ihor Radchenko
the_wurfkreuz  writes:

> When i comment something inside a source block but then decide to undo
> the commenting, the cursor ends up on the very first line of the block.
>
> Steps to reproduce:
> ...

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

-- 
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-09 Thread Ihor Radchenko
Orm Finnendahl  writes:

>> Or we can make `org-export-as' retain INFO channel when returning the
>> output. Then, we can make `org-export-to-file' make use of the INFO
>> channel to decide the file name. This way, there will be no need to
>> decide the file name before running the parsing.
>
> Are you sure that works? org-export-as currently returns a string. It
> could in addition return the parse-tree in info, plus the smaller
> parts which need to be exported, but we should not forget, that
> org-export-as is an inferior function called from org-export-to-file
> or org-export-to-buffer. But maybe I misunderstand what you mean.

That's exactly what I mean.

> Here is what is needed from my perspective:
>
> 1. parse the tree of the whole document
>
> 2. split the tree up.
>
> 3. call the export backend on each of the split parts to generate the
>string and save it to disk or do whatever is appropriate.
>
> For me the most natural way would be that a central function
> (export-according-to-org-property-list) does the parsing and then call
> the different backend functions to export according to their rules
> (the trees being converted in the central function or in backend
> code).
>
> If toplevel functions like org-export-to-file use org-export-as, than
> org-export-as should only be concerned with generating the string but
> not with reparsing.

Sorry, but I do not understand your concern.

> Alternatively we can do the conversion to a string in the central
> function as now with org-export-as, but there still needs to be a
> mechanism to generate the different files for multipage output and
> call the export backend on them to save them or whatever. Or what did
> you have in mind?

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.

-- 
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-09 Thread Ihor Radchenko
...

>> > - org-html-multipage-split
>> >
>> >   How to split the document. Possible values are
>> >
>> >   'toc for generating a page for each toc entry.
>> 
>> May I guess that the previous option may have something do with
>> situation when #+TOC: keyword is in the middle of a text?
>
> No: In the online document of the link above the page splitting
> follows the toc (with the exception of the page joining explained
> above), meaning that each visible toc entry will generate one page. Be
> aware that this is not obvious on the online page as subfolders are
> folded automatically using the css (folded elements have the class
> "toc-hidden"). If you look at the html page source you can see that
> every page contains the full toc to enable other css or js based
> styling decisions.

Sounds reasonable. I guess that the docstring can be improved :)

>> Do I understand correctly that your alternative layout is simply a
>> question of custom #+HTML_HEADER? Or is there something more to it?
>
> In my layout the main difference is that the nav left and nav right
> elements are part of the page-main-body rather than part of
> . I'm not positive this is elegantly manageable with css,
> when the navigation is outside the page-main-body.

Sorry, but I am lost. What do you mean by "content" and what do you mean
by "page-main-body"?

-- 
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 source block indentation [9.8-pre (release_9.7.6-86-g571f1c)]

2024-07-09 Thread Ihor Radchenko
the_wurfkreuz  writes:

> When I create a source block, pressing ENTER (RET) at the end of the
> first line indents the cursor visually about 10 characters to the
> right. If I press RET again to create a new line, it re-indents the
> previously displaced line, but the new line is also incorrectly placed.
>
> Steps to reproduce:
> ...

Thanks for reporting!
This was a subtle one.
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=022bb471c

-- 
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-09 Thread Ihor Radchenko
James Thomas  writes:

> I'd like to let you know of a package I made, mainly for personal use:
>
> https://codeberg.org/quotuva/tchanges
>
> It lets Emacs users collaborate with others who use Office software like
> Libreoffice, using the 'track changes' feature. I'd previously mentioned
> it on help-gnu-emacs, but its primary use is along with org-mode.
>
> Would love to get some feedback!

Looks similar to https://github.com/tecosaur/org-pandoc-import, but with
an added feature to automatically display diffs.

-- 
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] ox-beamer: allow setting frame subtitle with BEAMER_SUBTITLE property

2024-07-08 Thread Ihor Radchenko
h...@heagren.com writes:

>> I think that it will make more sense to recognize Org markup in the > 
>> BEAMER_SUBTITLE property value.
>
> I agree, that would be a good idea. I tried to implement this in the 
> same way as with the frametitle ...:

You can use

(org-element-parse-secondary-string value (org-element-restriction 'keyword))

-- 
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: 31.0.50; Org Persist file formatting

2024-07-08 Thread Ihor Radchenko
Michael Mauger  writes:

>> > (Note: the "..." in the last entry; sometimes it showed up as "\...".)
>> 
>> 
>> This is curious. May it be that you have non-default value of
>> `pp-default-function'?
>> 
>
> I don't touch `pp-default-function' and I've confirmed that it is 
> set to `pp-fill' in my instance.

Then, what if you re-define `org-persist-write:index' to

(defun org-persist-write:index (container _)
  "Write index CONTAINER."
  (org-persist--get-collection container)
  (unless (file-exists-p org-persist-directory)
(condition-case nil
(make-directory org-persist-directory 'parent)
  (t
   (warn "Failed to create org-persist storage in %s."
 org-persist-directory)
   (org-persist--check-write-access org-persist-directory
  (when (file-exists-p org-persist-directory)
(let ((index-file
   (org-file-name-concat org-persist-directory org-persist-index-file)))
  (org-persist--merge-index-with-disk)
  ;; CHANGED: disable pretty-printing
  (org-persist--write-elisp-file index-file org-persist--index t nil)
  (setq org-persist--index-age
(file-attribute-modification-time (file-attributes index-file)))
  index-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] Org-publish-find-date ignores #+DATE keyword [9.7.5 (9.7.5-eafa47 @ /usr/share/emacs/29.3/lisp/org/)]

2024-07-08 Thread Ihor Radchenko
noa  writes:

> When generating a sitemap from org-publish with the anti-chronological...
>
> All the dates shown were the mtime of the files, rather than the dates i 
> specified with the DATE keyword...
>
> I've tried running this with emacs -q and get the same issue, and also have 
> updated to the version of org in elpa, and get the same issue.

Thanks for reporting!

May you please provide more detailed steps how to reproduce the problem
starting from emacs -Q?
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] org-at-table-p does not recognize table inside \begin{} \end{} block [9.8 (9.8-??-571f1ce0d @ /Users/liyuxiao/.emacs.d/.local/straight/build-29.1/org/)]

2024-07-08 Thread Ihor Radchenko
Li Yuxiao  writes:

> When I tried to type table between \between \end blocks, for example
> \begin{pmatrix}
> \* table contents *\
> \end{pmatrix}
>
> The table contents are not recognized. For instance, I can't use Tab to
> go to next line. It turns out the result of org-at-table-p is nil. I
> deleted all my configurations, but it doesn't get recognized as well.
> I'm quite new to emacs, and I can't figure out why. Any instructions on
> solving the problem or how to debug is appreciated. Thanks for your 
> assistance!

This is because text between \begin{...}...\end{...} is considered
verbatim LaTeX - Org mode markup is not recognized inside. Instead, Org
will pass the whole text inside this "latex environment" directly to
LaTeX, without any processing. (see 
https://orgmode.org/manual/LaTeX-fragments.html)

If you want to enter Org mode table, you should _not_ use LaTeX
\begin{...}...\end{...} markup.

In short, if you want Org table features, use Org markup for tables.

Feel free to ask anything if you still feel confused.

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: [BUG] Org-element--cache: unregistered buffer [9.8 (9.8-??-39272e216 @ /Users/nino/.emacs.d/.local/straight/build-29.1/org/)]

2024-07-08 Thread Ihor Radchenko
Fernando Niño  writes:

> Your bug report will be posted to the Org mailing list.
> 

Thanks for reporting, but may you also share the full warning text?

-- 
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-08 Thread Ihor Radchenko
Orm Finnendahl  writes:

>> Yes, roughly like this.  Ideally, we should simply modify
>> `org-export-as', but handling output file name may be a bit tricky -
>> it is somewhat awkwardly placed in the current ox.el API (see the
>> discussion in
>> https://list.orgmode.org/orgmode/25393.61240.135445.401...@gargle.gargle.howl/T/#u).
>
> Today I had a look at ox.el when upgrading my code to
> 9.8-pre. Unfortunately the code (and behaviour of org-element, etc.)
> has changed quite a bit and I had to fix many things.
>
> Especially in org-export-as the parsing of the tree is now done in the
> lexical context of a copy of the buffer which makes implementing a
> multipage backend even more awkward.
>
> IMHO the code is just the wrong way around: org-export-to-file calls
> org-export-as which combines the parsing with generating the output
> string. The multipage code has to split that part and that doesn't get
> easier when both parts have to be evaluated in the context of
> org-export-with-buffer-copy. I'd rather have that turned inside out:
> Instead of org-export-as being a part of
> org-export-to-file/buffer/etc., its functionality could be at the
> top-level and then call org-export-to... appropriately (either for
> multipage output, single-page output, buffer-output...). I will handle
> it by splitting org-export-as just before the
> org-export-with-buffer-copy, but consider it a bit ugly.

Or we can make `org-export-as' retain INFO channel when returning the
output. Then, we can make `org-export-to-file' make use of the INFO
channel to decide the file name. This way, there will be no need to
decide the file name before running the parsing.

> There is something else: A lot of my energy in the multipage backend
> went into getting links and footnotes correct. Footnotes aren't a big
> deal, but I have no idea how to handle cross document links if
> different backends are present (e.g. linking from html to a pdf
> document and vice versa ;-) I think this requires quite a bit more
> thinking and maybe is unrealistic altogether, but at least the
> framework could be changed to be able to tackle that in the distant
> future...

Yes, it is an important feature we would need to implement - turning
internal links into external when they no longer point inside the same
document.

Somewhat relevant code: `org-export--update-included-link' and ox-publish.

For links to external pdfs and co, we have discussed what can be done in
https://list.orgmode.org/orgmode/87a5rpoi4c.fsf@localhost/
TL;DR: In latex, \href{file.pdf#anchor} works; In web, anchors should
also work with pdfjs.

-- 
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: 31.0.50; Org Persist file formatting

2024-07-08 Thread Ihor Radchenko
Michael Mauger  writes:

> This bug has been difficult to reproduce but several people have
> encountered it, or symptoms of it. Most recently, there has been this
> thread on Reddit:
> https://www.reddit.com/r/emacs/comments/1drxsz6/tangled_0_code_blocks_from_filename_problem/
>
> Unfortunately, replicating on emacs -Q has proven impossible since -Q
> disables some of the implicated features. My Emacs config is contained 
> in Org Babel files that are invoked with `org-babel-tangle-file' and have
> demonstrated the error multiple times.

Thanks for reporting!

> After some poking around I started getting failure when I tried to
> reopen an Org file or ran `normal-mode' on it. Shutting down emacs and
> restarting cleared the issue. When the issue arose when reopening the
> file within a session, the backtrace was pointing to `plistp' failing in
> `org-persist-read'. When I looked at the persist index there were
> entries like:
>
>  (:container
>   ((elisp org-element--headline-cache) (elisp org-element--cache)
>(version "2.3"))
>   :persist-file "49/605653-361a-49a4-a000-47db8d522096" :associated
>   (:hash "aa1176747642fdac45aaf96095a88367" :file
>"/home/michael/Projects/my-config/emacs/my-org.org" :inode
>2554490)
>   :expiry 30 :last-access 1719791738.4428508 :last-access-hr
>   "2024-06-30T19:55:38-0400" ...)
>
> (Note: the "..." in the last entry; sometimes it showed up as "\...".)

This is curious. May it be that you have non-default value of
`pp-default-function'?

> The failure during tangling occurred with `org-get-heading' expecting
> `stringp' but getting `nil'. That seemed to be tracked down to
> `org-complex-heading-regexp' not being set yet. If an error had aborted
> out of the `org-persist-read' it appears we could have half of org-mode
> up but not everything properly initialized.

Sounds right.

> Looking at the code in `org-persist.el' in
> `org-persist--write-elisp-file (file data  no-circular pp)'
> around line 486 it handles calling `pp' or `prin1'. The code for `pp'
> uses `pp-use-max-width' (as part of a bug fix #58687) which has since
> been superseded in Emacs 30.

Yes, it should be fixed. I did not know that they quickly obsoleted that
variable.

> It looks like the `org-persist-write' code ought to be updated and the
> `org-persist-read' code made more robust so that it does not just shut
> down processing of Org files entirely. That is if the entry is not a
> plist, act as though no entry exists and proceed as if it were a new
> org file. 

Yes. The case when the contents of index file is a valid Elisp data, but
not the data we expect is currently not covered. It should be.

-- 
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-08 Thread Ihor Radchenko
Orm Finnendahl  writes:

> For the backend I'm planning to realize the following options
> (implemented as custom variables, which can be overwritten in the
> document):
>
> - org-html-multipage-export-directory
>
>   The directory for the exported files (relative or absolute).

I am wondering about the reasoning behind not re-using
#+EXPORT_FILE_NAME: here (its directory part) and simply defaulting to
 `default-directory'.

Is there any situation when you need to export the full document
vs. multipage to different places?

> - org-html-multipage-head
>
>   (similar to HTML_HEAD but will be used instead of the HTML_HEAD for
>   custom css/js)

Again, why not directly using #+HTML_HEAD?

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

This sounds orthogonal to multipage export. May you please illustrate
what you want to achieve by introducing this option? Maybe there is an
existing feature that can be re-used instead of creating something new?

> - org-html-multipage-join-first-subsection
>
>   Boolean: Non-nil means that the first subsection of a section
>   without a body will be joined on the section page (recursively). See
>   my generated example pages linked below (Chapters 4, 5 and 7 for a
>   recursive example)

Sorry, but I cannot understand anything from there. May you explain in
words?

> - org-html-multipage-split
>
>   How to split the document. Possible values are
>
>   'toc for generating a page for each toc entry.

May I guess that the previous option may have something do with
situation when #+TOC: keyword is in the middle of a text?
   
> 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?

Do I understand correctly that your alternative layout is simply a
question of custom #+HTML_HEADER? Or is there something more to 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: multipage html output

2024-07-08 Thread Ihor Radchenko
> elegant but also somewhat different from the current layout of
> org-export which is single-page single-backend centered. Hmm...

I do not think that we need to go too deep into this rabbit hole for
now. A simple toggle based on `org-export-dispatch' might be good
enough. It can be easily extended to something like multi-state switch
(t/nil vs. t -> option A -> option B -> nil -> 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: Org Babel "swallows" table column groups

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

>>   #+BEGIN_SRC emacs-lisp
>>   (list (list 1 2) (list "/" "<>") 'hline (list 3 4) (list 5 6))
>>   #+END_SRC
>>
>> Org Babel outputs
>> ...
>> with the second element of the list
>>
>>   (list "/" "<>")
>>
>> swallowed, without a word.
>>
>> Why would Org Babel do this?
>>
>> And, how can one output tables with column groups?
>
> This is because of how `orgtbl-to-generic' is implemented. It is taking
> pieces from the full ox.el exporter, hard-coding certain things. For
> example, it always removes special table lines:
>
> ;; Since we are going to export using a low-level mechanism,
> ;; ignore special column and special rows manually.

I refactored `orgtbl-to-generic', so that it does not have to duplicate
`org-export-as'. Now, things should be more consistent with the normal
export.

May you try the attached tentative patch set?

>From f1ff68920c417343fda4c5a6450567d703ccf9b6 Mon Sep 17 00:00:00 2001
Message-ID: 
From: Ihor Radchenko 
Date: Mon, 8 Jul 2024 13:52:32 +0200
Subject: [PATCH 1/2] ox: New custom option to disable macro replacement

* lisp/ox.el (org-export-replace-macros): New custom option
controlling macro replacement.
(org-export--annotate-info): Honor it, except when processing inline
code block results and their {{{results...}}} macro.
* etc/ORG-NEWS (Allow disabling macro replacement during export):
Announce the new option.
* doc/org-manual.org (Macro Replacement):
(Summary of the export process): Document the new option.
---
 doc/org-manual.org | 11 +++
 etc/ORG-NEWS   |  9 +
 lisp/ox.el | 13 +++--
 3 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index d30c18e0c..5f5104f91 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -12682,9 +12682,11 @@ ** Macro Replacement
 #+cindex: @samp{MACRO}, keyword
 
 #+vindex: org-export-global-macros
-Macros replace text snippets during export.  Macros are defined
-globally in ~org-export-global-macros~, or document-wise with the
-following syntax:
+#+vindex: org-export-replace-macros
+Macros replace text snippets during export[fn::The macro replacement
+can be disabled by setting ~org-export-replace-macros~ to nil (default
+is t).].  Macros are defined globally in ~org-export-global-macros~,
+or document-wise with the following syntax:
 
 : #+MACRO: name   replacement text; $1, $2 are arguments
 
@@ -16702,7 +16704,8 @@ *** Summary of the export process
 3. Remove commented subtrees in the whole buffer (see [[*Comment
Lines]]);
 
-4. Replace macros in the whole buffer (see [[*Macro Replacement]]);
+4. Replace macros in the whole buffer (see [[*Macro Replacement]]),
+   unless ~org-export-replace-macros~ is nil;
 
 5. When ~org-export-use-babel~ is non-nil (default), process code
blocks:
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0c3b14128..dcd324115 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -43,6 +43,15 @@ or newer.
 # adding new customizations, or changing the interpretation of the
 # existing customizations.
 
+*** Allow disabling macro replacement during export
+
+New custom option ~org-export-replace-macros~ controls whether Org
+mode replaces macros in the buffer before export.  Set it to nil to
+disable macro replacement.
+
+This variable has no effect on the ={{{results...}}}= macros for inline
+code block results.
+
 *** Allow headline/olp target in ~org-capture-templates~ to be a function/variable
 
 The variable ~org-capture-templates~ accepts a target specification as
diff --git a/lisp/ox.el b/lisp/ox.el
index 6fa21be90..902c9f089 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -860,6 +860,14 @@ (defcustom org-export-expand-links t
   :package-version '(Org . "9.7")
   :type 'boolean)
 
+(defcustom org-export-replace-macros t
+  "When non-nil, replace macros before export.
+This variable does not affect {{{results}}} macros when processing
+code block results."
+  :group 'org-export-general
+  :package-version '(Org . "9.8")
+  :type 'boolean)
+
 (defcustom org-export-snippet-translation-alist nil
   "Alist between export snippets backends and exporter backends.
 
@@ -3048,8 +3056,9 @@ (defun org-export--annotate-info (backend info  subtreep visible-only e
 (org-export-backend-name backend))
 (org-export-expand-include-keyword nil nil nil nil (plist-get info :expand-links))
 (org-export--delete-comment-trees)
-(org-macro-initialize-templates org-export-global-macros)
-(org-macro-replace-all org-macro-templates parsed-keywords)
+(when org-export-replace-macros
+  (org-macro-initialize-templates org-export-global-macros)
+  (org-macro-replace-all org-macro-templates parsed-keywords))
 ;; Refresh buffer properties

Re: [PATCH] Ability to specify :html-head as a function

2024-07-07 Thread Ihor Radchenko
Nathan Nichols  writes:

> OK, I fixed the commit message and other issues that you mentioned. Please
> let me know if theres anything else.

Thanks!
Applied, onto main, with changes.

I changed the commit message to list all the changes in all the
functions, not just per-file.  I also added TINYCHANGE cookie as
required since you do not appear to have FSF copyright assignment.

I also fixed some wording (like p-list vs plist), the :package-version
changed in irrelevant defcustom, and stray old function name
(org-element-normalize-string-or-function). 

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

You are now also listed as an Org mode contributor.
https://git.sr.ht/~bzg/worg/commit/ecd71e0b

-- 
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-goto slows down org-set-property

2024-07-07 Thread Ihor Radchenko
Maxim Nikulin  writes:

> It is strange. Merely 3500 markers created by org-refile-cache in 2.2Mb 
> file ruin performance of regexps in that buffer. I would expect either 
> no influence of markers at all since search is a read-only operation or 
> some negligible penalty proportional to fraction of markers in relation 
> to total amount of characters.
>
> Look at the numbers for nm-test that is just some regexp searches from 
> `org-buffer-property-keys'. Performance is restored after clearing of 
> the cache.
> ...

This is no longer reproducible on the latest Emacs master, after a
couple of improvements in the marker handling.

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: Pending contents in org documents

2024-07-07 Thread Ihor Radchenko
Bruno Barbier  writes:

> I've just pushed a new version.

Thanks!

> I added a function 'org-pending-unlock-NOW!' which unlock the region
> immediately.  The uppercase "NOW!" emphasizes that it's not the
> "safe" way to unlock a region.

I expect to see this function called by some kind of button in the
details buffer, so that users can actually call it.

Also, a few more small comments on the commentary section:

> ;; The library makes locks visible to the user using text properties
> ;; and/or overlays.  It diplays and updates the status while the
* displays

> ;; If the user kills a buffer, or, kills Emacs, some locks may have to
> ;; be destroyed.  The library will ask the user to confirm if an
> ;; operation requires to destroy some locks.  See the field
> ;; `before-destroy-function' of REGLOCK object, if you need to do
> ;; something before a lock is destroyed.

We should provide a user option to suppress the query. Something like
what `confirm-kill-processes' does. Maybe even support something akin
`process-query-on-exit-flag', but for reglocks.

> ... feel free to look at the docstrings of the
> ;; cl-defstruct `org-pending-reglock' for the full documentation.

Maybe better refer to M-x cl-describe-type org-pending-reglock. It will
look nicer.

---

I have no other comments on your replies, so I am proceeding with the
code review. Next step is focusing on the core API functions :)

> (cl-defun org-pending (region
> ...
> On receiving the outcome (a :success or :failure message, sent with
> `org-pending-send-update'), remove the region protection.  Call
> ON-OUTCOME with the reglock and the outcome, from the position from
> where the REGLOCK was created.  If ON-OUTCOME returns a region (a
> pair (start position . end position)), use it to report the
> success/failure using visual hints on that region.  If ON-OUTCOME
> returns nothing, don't display outcome marks.

Please describe what the default value of ON-OUTCOME (when ON-OUTCOME is
not explicitly provided) does right in the docstring.

> You may set/update the following fields of your reglock to customize its
> behavior:
>- Emacs may have to destroy your locks; see the field
>  `before-destroy-function' if you wish to do something before your
>  lock is destroyed.
>- The user may ask Emacs to cancel your lock; see the field
>  `user-cancel-function' to override the default cancel function.
>- The user may request a description of the lock; see the the field
>  `insert-details-function' to add custom information when your
>  lock is displayed to the user.
> 
> You may add/update your own properties to your reglock using the field
> `properties', which is an association list.

Here, we may also refer to cl-describe-type for more details about the fields.

>   ( user-cancel-function nil
> :documentation
> "Function called when the user wish to cancel this REGLOCK,
> with the REGLOCK as argument.  This function must return immediately; it
> may, asynchronously, stop some processing and release resources; and,
> once this is done, it should send the outcome to the REGLOCK (using
> `org-pending-send-update', so that the region is unlocked and the
> REGLOCK destroyed). The default value is
> `org-pending--user-cancel-default'" )

How come the default value is `org-pending--user-cancel-default' when it
is nil?

> (cl-defstruct (org-pending-reglock
> ...

It would be nice to define slot types for each slot.

>   insert-details-function nil
> When non-nil, function called to insert custom details at the end of
> ‘org-pending-describe-reglock’.  The function is called with a REGLOCK,
> a START position and an END position, it must insert details at
> point. Assuming B is a (virtual) buffer containing all detailed human
> readable information, insert at point details from START to END.  Handle
> cases where START, END are nil or out of bounds without raising an
> error.  The function may use text properties, overlays, etc.  See
> ‘org-pending-describe-reglock’

>From this description, my understanding is that the existing text
between START and END must be replaced? Or is it something else? It is
also not clear what the custom function is supposed to do when START/END
are nil.

I looked up the docstring of `org-pending-describe-reglock', but it does
not contain anything useful wrt setting insert-details-function slot.

-- 
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: Re: multipage html output

2024-07-07 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  writes:

> O... Because this functionality
> would be more about typesetting than about anything else. When you export a
> doc to LaTeX, you barely
> care about the TOC, because that is generated "behind the scenes" from
> headings only.

AFAIU, the feature we are discussing here is not about typesetting, but
about producing multi-file output.

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