Re: org code and error catching

2023-05-15 Thread Michael Heerdegen
Ihor Radchenko  writes:

> In my attempts, the tests started failing for no obvious reason.
> Just from changing `condition-case' to `condition-case-unless-debug'.
>
> Though I did not investigate if it happened for every atomic change.

Hmm - mine gave a different result: I cloned the org-mode archive from
https://git.savannah.gnu.org/git/emacs/org-mode.git, called "make" and
ran the tests as described in the "testing/README".  That gave 6 failing
tests.

Then I blindly replaced every occurrence of `condition-case' with
`condition-case-unless-debug' (everywhere but not in the tests), ran
"git clean -xf", then "make" again, and ran the tests again.  Again 6
failing tests.

Not sure if I did something wrong.

Michael.



Formulas on table cells containing '$'

2023-05-15 Thread Jeff Trull
While investigating an error executing a table formula I discovered that
cells containing '$' cause column references to be executed even when no
attempt is made to evaluate cell contents as code. Here's a simple example:

#+TITLE: demonstrate strange error in currency column

| 3/1/2023  | Deposit| $200.00 |
| 3/13/2023 | Interest   | $1.13   |
| 4/1/2023  | Deposit| $301.22 |
|---++-|
|   | Number of Transactions | |
#+TBLFM: @4$3='(length '(@1$3..@I$3))

Evaluating the table formula produces a 'Invalid field specifier "$200"'
message. In more complicated examples you just see a #ERROR in the cell.
With formula debugging turned on, I can evaluate the expanded expression
with no errors.

This is surprising for a number of reasons:

   1. The formula makes no use of the cell contents
   2. The formula debugger notes an error but actually shows a valid
   expression
   3. Columns with currencies will be fairly common esp in imports from
   financial institutions
   4. This error happens before the formula is evaluated so there is no
   chance to remove the problem character in the formula as I do with the
   commas ',' which are also present

Is this by design? If so, I was unable to find any documentation explaining
it.

Thanks,
Jeff


Re: link to magnet URL in org-mode?

2023-05-15 Thread Max Nikulin

On 15/05/2023 19:55, Guillaume MULLER wrote:
I maintain a list of links in an org-file. I wanted to export it as HTML 
file for a colleague, but I got the following error:


   Unable to resolve link: "magnet:?xt=urn:..."

What would be the correct way of linking to a magnet link in an org-mode 
file ?


You need to define :export property for magnet links. See 
`org-link-set-parameters' and (info "(org) Adding Hyperlink Types")

https://orgmode.org/manual/Adding-Hyperlink-Types.html




[PATCH v3.1] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`

2023-05-15 Thread Christopher M. Miles

"Christopher M. Miles"  writes:

> [[PGP Signed Part:Undecided]]
>
> Ihor Radchenko  writes:
>
>> "Christopher M. Miles"  writes:
>>
 You are almost there.
 Just run your code only when (lentgh> fulltable 26).

 Of course, 26 should be a defcustom rather than a hard-coded constant.
 And do the same for `org-fast-todo-selection'.
>>>
>>> Ok, I added defcustom option, and add cl-case condition on custom option
>>> `org-use-fast-tag-selection'.
>>
>> I do not think that we need to care about the value of
>> `org-use-fast-tag-selection'.  Instead, just
>>
>> 1. If the total number of tags does not exceed
>>`org-fast-tag-selection-maximum-tags', display them all.
>> 2. If the total number of tags is larger, just display all the bound
>>tags + any extra tags, up to `org-fast-tag-selection-maximum-tags',
>>and add a note in the tag selection buffer that more tags are not
>>displayed.
>
> Ok, I re-implemented the mechanism like bellowing, can you check whether it 
> fits?
>
> #+begin_src emacs-lisp
> (setq tbl (let ((bound-tags (seq-filter 'cdr fulltable)))
> (if (length< fulltable 
> org-fast-tag-selection-maximum-tags)
> fulltable
>   (if (length< bound-tags 
> org-fast-tag-selection-maximum-tags)
>   (progn
> (seq-take (seq-uniq (append bound-tags fulltable))
>   org-fast-tag-selection-maximum-tags)
> (message "Tags are limited displayed by 
> `org-fast-tag-selection-maximum-tags'."))
> bound-tags
> (message "Tags are limited displayed only has key 
> bound."
>   char ?a cnt 0)
> #+end_src

Updated version which fix the `message` error in upper code:

#+begin_src emacs-lisp
(setq tbl (let ((bound-tags (seq-filter 'cdr fulltable)))
(if (length< fulltable org-fast-tag-selection-maximum-tags)
fulltable
  (if (length< bound-tags 
org-fast-tag-selection-maximum-tags)
  (progn
(insert "Tags are limited displayed by 
`org-fast-tag-selection-maximum-tags'.\n")
(seq-take (seq-uniq (append bound-tags fulltable))
  org-fast-tag-selection-maximum-tags))
(insert "Tags are limited displayed only has key 
bound.\n")
bound-tags)))
  char ?a cnt 0)
#+end_src

-- 

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

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


signature.asc
Description: PGP signature


Re: [PATCH] org-crypt-decrypt-entry: Apply initial visibility upon decryption

2023-05-15 Thread Christopher M. Miles

No objection

-- 

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

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


signature.asc
Description: PGP signature


Re: Interest in an Org video meetup?

2023-05-15 Thread Sacha Chua
I'll let Amin Bandali know. Thanks for everyone's patience!

On Mon, May 15, 2023, 11:20 Ihor Radchenko  wrote:

> Russell Adams  writes:
>
> > I was given an account on https://bbb.emacsverse.org/, and trying to
> > use it today I get a certificate expired error that cannot be ignored.
> >
> > I was hoping to test it to setup a Saturday video session.
> >
> > Any ideas?
>
> I am also seeing the same error.
> Looks like they forgot to update the certificate.
> It expired a month ago.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>
>


Re: Interest in an Org video meetup?

2023-05-15 Thread Ihor Radchenko
Russell Adams  writes:

> I was given an account on https://bbb.emacsverse.org/, and trying to
> use it today I get a certificate expired error that cannot be ignored.
>
> I was hoping to test it to setup a Saturday video session.
>
> Any ideas?

I am also seeing the same error.
Looks like they forgot to update the certificate.
It expired a month ago.

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



Re: How to filter a clock table by property value?

2023-05-15 Thread Marcin Borkowski


On 2023-05-08, at 17:30, Ihor Radchenko  wrote:

> Marcin Borkowski  writes:
>
>> #+BEGIN: clocktable :match "property=\"value\""
>> #+END
>
> "+property=\"value\""
>
> I just tried #+BEGIN: clocktable :scope subtree :match "+ID=\"Organization\""
> and it worked.

Thanks!  Still didn't work, it turned out that I didn't set
`org-use-property-inheritance'.  Then it turned out that I don't even
need the plus sign.

Thanks,

-- 
Marcin Borkowski
http://mbork.pl



Re: Interest in an Org video meetup?

2023-05-15 Thread Russell Adams
On Wed, Apr 26, 2023 at 04:13:47PM -0500, Corwin Brust wrote:
> On Wed, Apr 26, 2023 at 9:31 AM Matt  wrote:
> >
> > FSF associate members have access to a FSF hosted Jitsi instance.  I'm an 
> > FSF associate member and could host it using that if I'm able to make the 
> > time.
> >
>
> We can make EmacsConf instance of BigBlueButton (BBB) available, as
> well.  FWIW I had more success with BBB than Jitsi for larger
> meetings.

I was given an account on https://bbb.emacsverse.org/, and trying to
use it today I get a certificate expired error that cannot be ignored.

I was hoping to test it to setup a Saturday video session.

Any ideas?

--
Russell Adamsrlad...@adamsinfoserv.com
https://www.adamsinfoserv.com/



[PATCH v3] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`

2023-05-15 Thread Christopher M. Miles

Ihor Radchenko  writes:

> "Christopher M. Miles"  writes:
>
>>> You are almost there.
>>> Just run your code only when (lentgh> fulltable 26).
>>>
>>> Of course, 26 should be a defcustom rather than a hard-coded constant.
>>> And do the same for `org-fast-todo-selection'.
>>
>> Ok, I added defcustom option, and add cl-case condition on custom option
>> `org-use-fast-tag-selection'.
>
> I do not think that we need to care about the value of
> `org-use-fast-tag-selection'.  Instead, just
>
> 1. If the total number of tags does not exceed
>`org-fast-tag-selection-maximum-tags', display them all.
> 2. If the total number of tags is larger, just display all the bound
>tags + any extra tags, up to `org-fast-tag-selection-maximum-tags',
>and add a note in the tag selection buffer that more tags are not
>displayed.

Ok, I re-implemented the mechanism like bellowing, can you check whether it 
fits?

#+begin_src emacs-lisp
(setq tbl (let ((bound-tags (seq-filter 'cdr fulltable)))
(if (length< fulltable org-fast-tag-selection-maximum-tags)
fulltable
  (if (length< bound-tags 
org-fast-tag-selection-maximum-tags)
  (progn
(seq-take (seq-uniq (append bound-tags fulltable))
  org-fast-tag-selection-maximum-tags)
(message "Tags are limited displayed by 
`org-fast-tag-selection-maximum-tags'."))
bound-tags
(message "Tags are limited displayed only has key 
bound."
  char ?a cnt 0)
#+end_src

-- 

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

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


signature.asc
Description: PGP signature


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

2023-05-15 Thread Christopher M. Miles

Ihor Radchenko  writes:

> "Christopher M. Miles"  writes:
>
>> The `org-redisplay-inline-images' will refresh whole buffer inline
>> images. When the buffer is a big Org file, and not all inline images are
>> display already by default (still image file links under fold status).
>> Invoking `org-redisplay-inline-images' will cause Emacs suspend a long
>> time.
>>
>> So I suggest to add an variant local function of
>> `org-redisplay-inline-images' which named
>> `org-redisplay-inline-images-under-headline' that only redisplay inline
>> images under current headline to solve the issue.
>>
>> Here is the diff code prototype, Ihor, can you review it? If it's ok, I
>> will send patch update then.
>
> I'd prefer something more closely resembling `org-latex-preview'
> approach with prefix arguments:
>
> Toggle preview of the LaTeX fragment at point.
> 
> If the cursor is on a LaTeX fragment, create the image and
> overlay it over the source code, if there is none.  Remove it
> otherwise.  If there is no fragment at point, display images for
> all fragments in the current section.  With an active region,
> display images for all fragments in the region.
> 
> With a C-u prefix argument ARG, clear images for all fragments
> in the current section.
> 
> With a C-u C-u prefix argument ARG, display image for all
> fragments in the buffer.
> 
> With a C-u C-u C-u prefix argument ARG, clear image for all
> fragments in the buffer.
>
> `org-toggle-inline-images' should also be changed.

I agree this solution. I will check out latex fragment preview source
code whether I can implement this.

-- 

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

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


signature.asc
Description: PGP signature


Re: [BUG] Some Org mode files require org-macs.el more than once

2023-05-15 Thread Ihor Radchenko
Niall Dooley  writes:

> Reviewing some Org files I noted the following files require org-macs.el more
> than once:
> ...
> The additional require seems redundant to my ignorant self.  I appreciate this
> should cause no issue but is there a reason why such lines are
> duplicated?

To emphasize that

(require 'org-macs)
(org-assert-version)

should always go together.

Canceled.

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



[BUG] Some Org mode files require org-macs.el more than once

2023-05-15 Thread Niall Dooley
Reviewing some Org files I noted the following files require org-macs.el more
than once:

- ob.el
- ob-python.el
- org-fold.el

There are likely others too.

The additional require seems redundant to my ignorant self.  I appreciate this
should cause no issue but is there a reason why such lines are duplicated?
I've indicated this as a BUG in the subject line so forgive me if that is an
inaccurate characterisation.

Regards,

doolio



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

2023-05-15 Thread Christopher M. Miles

Ihor Radchenko  writes:

> "Christopher M. Miles"  writes:
>
>> The `org-redisplay-inline-images' will refresh whole buffer inline
>> images. When the buffer is a big Org file, and not all inline images are
>> display already by default (still image file links under fold status).
>> Invoking `org-redisplay-inline-images' will cause Emacs suspend a long
>> time.
>>
>> So I suggest to add an variant local function of
>> `org-redisplay-inline-images' which named
>> `org-redisplay-inline-images-under-headline' that only redisplay inline
>> images under current headline to solve the issue.
>>
>> Here is the diff code prototype, Ihor, can you review it? If it's ok, I
>> will send patch update then.
>
> I'd prefer something more closely resembling `org-latex-preview'
> approach with prefix arguments:
>
> Toggle preview of the LaTeX fragment at point.
> 
> If the cursor is on a LaTeX fragment, create the image and
> overlay it over the source code, if there is none.  Remove it
> otherwise.  If there is no fragment at point, display images for
> all fragments in the current section.  With an active region,
> display images for all fragments in the region.
> 
> With a C-u prefix argument ARG, clear images for all fragments
> in the current section.
> 
> With a C-u C-u prefix argument ARG, display image for all
> fragments in the buffer.
> 
> With a C-u C-u C-u prefix argument ARG, clear image for all
> fragments in the buffer.
>
> `org-toggle-inline-images' should also be changed.

Here is the source code of `org-toggle-inline-images'. I implement this
by reference `org-latex-preview'. I have not write testing, but only
manually tested with Edebug and on actual Org buffer displaying and
disable inline images. The command works fine. Ihor, can you review the code?

#+begin_src emacs-lisp
(defun org-toggle-inline-images ( arg include-linked beg end)
  "Toggle the display of inline images at point.
INCLUDE-LINKED is passed to `org-display-inline-images'.

If cursor is on an inline image link, display the inline image.
If there is none, remove it otherwise.
If there is no inline image link at point, display all inline images in the 
current section.
With an active region, display inline images in the region.

With a `\\[universal-argument]' prefix argument ARG, clear inline
images in the current section.

With a `\\[universal-argument] \\[universal-argument]' prefix
 argument ARG, display all inline images in the buffer.

With a `\\[universal-argument] \\[universal-argument] \
\\[universal-argument]' prefix argument ARG, clear all inline
images in the buffer."
  (interactive "P")
  (cond
   ((not (display-graphic-p)) nil)
   ;; Clear whole buffer inline images.
   ((equal arg '(64))
(org-remove-inline-images (point-min) (point-max))
(message "Inline images preview disabled in buffer."))
   ;; Display whole buffer inline images.
   ((equal arg '(16))
(message "Displaying all inline images in buffer...")
(org-display-inline-images include-linked nil (point-min) (point-max))
(message "Displaying all inline images in buffer... done."))
   ;; Clear current section.
   ((equal arg '(4))
(let* ((beg (if (use-region-p)
(region-beginning)
  (if (org-before-first-heading-p) (point-min)
(save-excursion
  (org-with-limited-levels (org-back-to-heading t) 
(point))
   (end (if (use-region-p)
(region-end)
  (org-with-limited-levels (org-entry-end-position
   (inline-images (org--inline-image-overlays beg end)))
  (org-remove-inline-images beg end)
  (message "%d inline images display removed." (length inline-images
   ;; Display region selected inline images.
   ((use-region-p)
(message "Displaying inline images in region...")
(org-display-inline-images include-linked t (region-beginning) (region-end))
(message "Displaying inline images in region... done."))
   ;; Toggle display of inline image link at point.
   ((let ((context (org-element-context)))
  (and (memq (org-element-type context) '(link))
   (let ((beg (org-element-property :begin context))
 (end (org-element-property :end context)))
 (if (org--inline-image-overlays beg end)
 (progn
   (org-remove-inline-images beg end)
   (message "Display inline image at point removed."))
   (org-display-inline-images include-linked t beg end)
   (message "Displaying inline image at point ... done."))
 t
   ;; Display inline images under current section.
   (t
(let ((beg (if (org-before-first-heading-p) (point-min)
 (save-excursion
   (org-with-limited-levels (org-back-to-heading t) (point)
  (end (org-with-limited-levels (org-entry-end-position
  (message 

[POLL] ob-C: Should we allow saving compiled src block to specified binary excecutable? (was: [RFC/PATCH] naming src/bin files in ob-C.el)

2023-05-15 Thread Ihor Radchenko
Leo Butler  writes:

>> I am not sure how I feel about such side effects of evaluation.
>> Is there any other babel backend that is doing something similar?
>
> ob-java.el deals with it by using a :dir header; if non-nil, the
> compiled files are placed in that directory instead of
> `org-babel-temporary-directory'. (And, by default, the :dir header is
> "."). The filename is determined by the packagename.

Well. What ob-java does is mostly for historical reasons and because
some users of Java source blocks tend to use a lot of local classes
defined in current directory. See
https://list.orgmode.org/orgmode/87imadafo0@iki.fi/
ob-java does not really aim to generate compiled source in :dir for
the sole purpose of generating the compiled source.

I feel slightly reluctant about adding side effects to babel evaluation.
Not too reluctant though.

I'd like to hear from other ob-C users, so I changed this thread into a poll.

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



Re: [PATCH] org-crypt-decrypt-entry: Apply initial visibility upon decryption

2023-05-15 Thread Ihor Radchenko
Ihor Radchenko  writes:

> I'd like to propose applying initial visibility to the freshly decrypted
> headings. IMHO, it makes much more sense by default compared to showing
> all the text unfolded, including property drawers.
>
> Any objections?

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

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



Re: [PATCH v2] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`

2023-05-15 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

>> I do not think that we need to care about the value of
>> `org-use-fast-tag-selection'.  Instead, just
>>
>> 1. If the total number of tags does not exceed
>>`org-fast-tag-selection-maximum-tags', display them all.
>> 2. If the total number of tags is larger, just display all the bound
>>tags + any extra tags, up to `org-fast-tag-selection-maximum-tags',
>>and add a note in the tag selection buffer that more tags are not
>>displayed.
>
> I think we should consider the option `org-use-fast-tag-selection'.
> Because it controls the behavior that whether auto assign short-key to
> tags. Make condition decision based on this option is needed. I hope you
> can reconsider this.

We probably have a misunderstanding about the role of
`org-use-fast-tag-selection'.

`org-use-fast-tag-selection' _currently_ determines whether to display
the tag selection window at all:

Non-nil means use fast tag selection scheme.

This is a special interface to select and deselect tags with single keys.
When nil, fast selection is never used.
When the symbol auto, fast selection is used if and only if selection
characters for tags have been configured, either through the variable
org-tag-alist or through a #+TAGS line in the buffer.
When t, fast selection is always used and selection keys are assigned
automatically if necessary.

Even when the value is t, not 'auto, the user bindings for tags are
honored. `org-fast-tag-selection' never checks the value of
`org-use-fast-tag-selection'.

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



link to magnet URL in org-mode?

2023-05-15 Thread Guillaume MULLER

Hello,

I maintain a list of links in an org-file. I wanted to export it as HTML file 
for a colleague, but I got the following error:

  Unable to resolve link: "magnet:?xt=urn:..."

What would be the correct way of linking to a magnet link in an org-mode file ?

Thanks in advance

--
Guillaume MULLER


OpenPGP_0xF3BCAD9F46F5FADC.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: [PATCH v2] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`

2023-05-15 Thread Christopher M. Miles

Ihor Radchenko  writes:

> "Christopher M. Miles"  writes:
>
>>> You are almost there.
>>> Just run your code only when (lentgh> fulltable 26).
>>>
>>> Of course, 26 should be a defcustom rather than a hard-coded constant.
>>> And do the same for `org-fast-todo-selection'.
>>
>> Ok, I added defcustom option, and add cl-case condition on custom option
>> `org-use-fast-tag-selection'.
>
> I do not think that we need to care about the value of
> `org-use-fast-tag-selection'.  Instead, just
>
> 1. If the total number of tags does not exceed
>`org-fast-tag-selection-maximum-tags', display them all.
> 2. If the total number of tags is larger, just display all the bound
>tags + any extra tags, up to `org-fast-tag-selection-maximum-tags',
>and add a note in the tag selection buffer that more tags are not
>displayed.

I think we should consider the option `org-use-fast-tag-selection'.
Because it controls the behavior that whether auto assign short-key to
tags. Make condition decision based on this option is needed. I hope you
can reconsider this.

-- 

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

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


signature.asc
Description: PGP signature


Re: [RFC/PATCH] naming src/bin files in ob-C.el

2023-05-15 Thread Leo Butler
On Mon, May 15 2023, Ihor Radchenko  wrote:

> Leo Butler  writes:
>
>> On the other hand, I don't see any sense in producing a link to the
>> binary file. Org can't do anything with that link, so the user would
>> need to write something like ":results file :file /path/to :wrap
>> comment". That is why I would prefer something like a :bin-file header.
>
> I am not sure how I feel about such side effects of evaluation.
> Is there any other babel backend that is doing something similar?

ob-java.el deals with it by using a :dir header; if non-nil, the
compiled files are placed in that directory instead of
`org-babel-temporary-directory'. (And, by default, the :dir header is
"."). The filename is determined by the packagename.

Leo


org-element tutorial?

2023-05-15 Thread bvchgvbt
Hi,

Does anyone know of a good tutorial on using org-element? I'm finding
the documentation hard to grok.

Alternatively, given a doc like

* TODO No
** Uninteresting
   - item 1
   - item 2

* NEXT My thing
  SCHEDULED: <2023-05-16 Tue .+1d>
  :PROPERTIES:
  :STYLE: habit
  :LAST_REPEAT: [2023-05-15 Mon 12:12]
  :END:
  - State "DONE"   from "NEXT"   [2023-05-15 Mon 12:12] \\
I want this

how would I get at the note entered for the state change, i.e. the "I
want this" list item, in this example  (which might be in a drawer,
just doesn't happen to be, here)?



Re: [RFC/PATCH] naming src/bin files in ob-C.el

2023-05-15 Thread Ihor Radchenko
Leo Butler  writes:

> Ok, stopping after 1 seems reasonable when the code block is meant to
> produce just the executable. But, your suggestion would mean that the
> code block can *only* produce an executable file. Maybe that is ok, but
> since the current semantics allow something like
>
> #+begin_src C++ :includes   :results file :file 
> ./results.csv
>   using namespace std;
>   for(int i=0; i<10; i++){ cout << i << "," << i*i << endl; }
> #+end_src
>
> so I am not sure that we should break that.

Fair point.

> On the other hand, I don't see any sense in producing a link to the
> binary file. Org can't do anything with that link, so the user would
> need to write something like ":results file :file /path/to :wrap
> comment". That is why I would prefer something like a :bin-file header.

I am not sure how I feel about such side effects of evaluation.
Is there any other babel backend that is doing something similar?

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



Re: New note not included in org-element-parse-buffer result

2023-05-15 Thread bvchgvbt
> "Ihor Radchenko" wrote:
> bvchg...@mail.com writes:
>
> > am finding that the note that I insert when the state change
> > is logged is not present in the result of a call to
> > (org-element-parse-buffer).
>
> The note might indeed not yet be inside the Org buffer.
> `org-add-log-setup' arranges the note to be written _after_ current
> command finishes (`post-command-hook').

Ah. Thank you. That explains it.



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

2023-05-15 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

> The `org-redisplay-inline-images' will refresh whole buffer inline
> images. When the buffer is a big Org file, and not all inline images are
> display already by default (still image file links under fold status).
> Invoking `org-redisplay-inline-images' will cause Emacs suspend a long
> time.
>
> So I suggest to add an variant local function of
> `org-redisplay-inline-images' which named
> `org-redisplay-inline-images-under-headline' that only redisplay inline
> images under current headline to solve the issue.
>
> Here is the diff code prototype, Ihor, can you review it? If it's ok, I
> will send patch update then.

I'd prefer something more closely resembling `org-latex-preview'
approach with prefix arguments:

Toggle preview of the LaTeX fragment at point.

If the cursor is on a LaTeX fragment, create the image and
overlay it over the source code, if there is none.  Remove it
otherwise.  If there is no fragment at point, display images for
all fragments in the current section.  With an active region,
display images for all fragments in the region.

With a C-u prefix argument ARG, clear images for all fragments
in the current section.

With a C-u C-u prefix argument ARG, display image for all
fragments in the buffer.

With a C-u C-u C-u prefix argument ARG, clear image for all
fragments in the buffer.

`org-toggle-inline-images' should also be changed.

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



Re: [PATCH v2] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`

2023-05-15 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

>> You are almost there.
>> Just run your code only when (lentgh> fulltable 26).
>>
>> Of course, 26 should be a defcustom rather than a hard-coded constant.
>> And do the same for `org-fast-todo-selection'.
>
> Ok, I added defcustom option, and add cl-case condition on custom option
> `org-use-fast-tag-selection'.

I do not think that we need to care about the value of
`org-use-fast-tag-selection'.  Instead, just

1. If the total number of tags does not exceed
   `org-fast-tag-selection-maximum-tags', display them all.
2. If the total number of tags is larger, just display all the bound
   tags + any extra tags, up to `org-fast-tag-selection-maximum-tags',
   and add a note in the tag selection buffer that more tags are not
   displayed.

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



Re: org code and error catching

2023-05-15 Thread Ihor Radchenko
Michael Heerdegen  writes:

> Ihor Radchenko  writes:
>
>> This is a good idea, except that `condition-case-unless-debug' has
>> non-obvious side effects that interfere with ERT (Org testing system).
>
> What side effects are these?

In my attempts, the tests started failing for no obvious reason.
Just from changing `condition-case' to `condition-case-unless-debug'.

Though I did not investigate if it happened for every atomic change.

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