Re: what is the purpose of "This link has already been stored"?

2023-06-28 Thread Samuel Wales
i am not sure i am using store/insert to their full actual or
potential potential.

if you move the recent one to top of list, that would work for my
mindless store/insert, but it might not work for a user who has
carefully cultivated a set of links that are all to be inserted, or
such.  although idk if the mechanism supports.

On 6/28/23, Samuel Wales  wrote:
> that is, if completing-read is changed, idk if ido will work with it
> well or not  idk if proposed fix means
>
> - include id and description in orig list for selection
> - include id and description is for marginalia
> - user selects description and id is returned
> - another change
>
> just showing the basename headings [or whatever has an org id] wold
> wfm but there are probably other considerations.
>
> at least, as long as the inserted link mainains the mapping of id with
> description.
>
> On 6/28/23, Samuel Wales  wrote:
>> On 6/28/23, Ihor Radchenko  wrote:
>>> This behaviour has been introduced in bb61b37ee
>>>
>>> bb61b37ee223fd89cf951a5fbf62e35e606a4646
>>> Author: Bastien 
>>> AuthorDate: Thu Dec 5 17:11:26 2019 +0100
>>> ol.el: Don't store the same link twice
>>>
>>> * lisp/ol.el (org-store-link): Don't store the same link twice.
>>
>> thanks for traking down.
>>
>>>
>>> I think that it will make a lot more sense to move the link in front of
>>> the stored link list instead of just printing the message.
>>
>> good idea.  after all you most recently stored it, duplicate or no.
>>
  id:2134123-11234123-41234123--12341
  eww:
  gnus:
  ...
  id:44242423-23452-345-234-523452-345
  ...

as there is no description and the presumably useful ids
are near te bottom it is useless to try to use
org-insert-link.  so idk what the solution is.
>>>
>>> The descriptions are displayed in *Org Links* buffer.
>>
>> all i see is the org buffer and the minibuffer.  perhaps for
>> accessibility reasons i made it so that i don't see an org links
>> bufer.  i maximize everything and one window where possibel.
>>
>> idk what geeral use links buffer woul be in practice, but it wouln't
>> work for me.  orig, mini, and links buffers would be too small, frame
>> maximized.
>>
>>> The completing-read call could, however, be improved to display link
>>> descriptions as well. Patches welcome!
>>
>> sounds good but idk.  ido did ussed to do things like put files in
>> parens, although i removed that nad only have the basename heading in
>> my ido lists for olpaths for clarity.  but idk if ido integrates well
>> enough to work with such a fix or not.
>>
>>>
>>> --
>>> Ihor Radchenko // yantar92,
>>> Org mode contributor,
>>> Learn more about Org mode at .
>>> Support Org development at ,
>>> or support my work at 
>>>
>>
>>
>> --
>> The Kafka Pandemic
>>
>> A blog about science, health, human rights, and misopathy:
>> https://thekafkapandemic.blogspot.com
>>
>
>
> --
> The Kafka Pandemic
>
> A blog about science, health, human rights, and misopathy:
> https://thekafkapandemic.blogspot.com
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: what is the purpose of "This link has already been stored"?

2023-06-28 Thread Samuel Wales
that is, if completing-read is changed, idk if ido will work with it
well or not  idk if proposed fix means

- include id and description in orig list for selection
- include id and description is for marginalia
- user selects description and id is returned
- another change

just showing the basename headings [or whatever has an org id] wold
wfm but there are probably other considerations.

at least, as long as the inserted link mainains the mapping of id with
description.

On 6/28/23, Samuel Wales  wrote:
> On 6/28/23, Ihor Radchenko  wrote:
>> This behaviour has been introduced in bb61b37ee
>>
>> bb61b37ee223fd89cf951a5fbf62e35e606a4646
>> Author: Bastien 
>> AuthorDate: Thu Dec 5 17:11:26 2019 +0100
>> ol.el: Don't store the same link twice
>>
>> * lisp/ol.el (org-store-link): Don't store the same link twice.
>
> thanks for traking down.
>
>>
>> I think that it will make a lot more sense to move the link in front of
>> the stored link list instead of just printing the message.
>
> good idea.  after all you most recently stored it, duplicate or no.
>
>>>  id:2134123-11234123-41234123--12341
>>>  eww:
>>>  gnus:
>>>  ...
>>>  id:44242423-23452-345-234-523452-345
>>>  ...
>>>
>>>as there is no description and the presumably useful ids
>>>are near te bottom it is useless to try to use
>>>org-insert-link.  so idk what the solution is.
>>
>> The descriptions are displayed in *Org Links* buffer.
>
> all i see is the org buffer and the minibuffer.  perhaps for
> accessibility reasons i made it so that i don't see an org links
> bufer.  i maximize everything and one window where possibel.
>
> idk what geeral use links buffer woul be in practice, but it wouln't
> work for me.  orig, mini, and links buffers would be too small, frame
> maximized.
>
>> The completing-read call could, however, be improved to display link
>> descriptions as well. Patches welcome!
>
> sounds good but idk.  ido did ussed to do things like put files in
> parens, although i removed that nad only have the basename heading in
> my ido lists for olpaths for clarity.  but idk if ido integrates well
> enough to work with such a fix or not.
>
>>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at .
>> Support Org development at ,
>> or support my work at 
>>
>
>
> --
> The Kafka Pandemic
>
> A blog about science, health, human rights, and misopathy:
> https://thekafkapandemic.blogspot.com
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: what is the purpose of "This link has already been stored"?

2023-06-28 Thread Samuel Wales
On 6/28/23, Ihor Radchenko  wrote:
> This behaviour has been introduced in bb61b37ee
>
> bb61b37ee223fd89cf951a5fbf62e35e606a4646
> Author: Bastien 
> AuthorDate: Thu Dec 5 17:11:26 2019 +0100
> ol.el: Don't store the same link twice
>
> * lisp/ol.el (org-store-link): Don't store the same link twice.

thanks for traking down.

>
> I think that it will make a lot more sense to move the link in front of
> the stored link list instead of just printing the message.

good idea.  after all you most recently stored it, duplicate or no.

>>  id:2134123-11234123-41234123--12341
>>  eww:
>>  gnus:
>>  ...
>>  id:44242423-23452-345-234-523452-345
>>  ...
>>
>>as there is no description and the presumably useful ids
>>are near te bottom it is useless to try to use
>>org-insert-link.  so idk what the solution is.
>
> The descriptions are displayed in *Org Links* buffer.

all i see is the org buffer and the minibuffer.  perhaps for
accessibility reasons i made it so that i don't see an org links
bufer.  i maximize everything and one window where possibel.

idk what geeral use links buffer woul be in practice, but it wouln't
work for me.  orig, mini, and links buffers would be too small, frame
maximized.

> The completing-read call could, however, be improved to display link
> descriptions as well. Patches welcome!

sounds good but idk.  ido did ussed to do things like put files in
parens, although i removed that nad only have the basename heading in
my ido lists for olpaths for clarity.  but idk if ido integrates well
enough to work with such a fix or not.

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


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: [BUG] org-store-link on document title

2023-06-28 Thread Ihor Radchenko
Anthony Carrico  writes:

> On 6/28/23 15:56, Ihor Radchenko wrote:
>> Latest version of Org will also auto-assign TITLE as the
>> link description.
>
> Nice, sound like this issue is already fixed. Looking forward to the 
> upgrade.

It has been added back in Org 9.5.

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



Re: [BUG] org-store-link on document title

2023-06-28 Thread Anthony Carrico

On 6/28/23 15:56, Ihor Radchenko wrote:

Latest version of Org will also auto-assign TITLE as the
link description.


Nice, sound like this issue is already fixed. Looking forward to the 
upgrade.


--
Anthony Carrico




Re: [BUG] org-store-link on document title

2023-06-28 Thread Ihor Radchenko
Anthony Carrico  writes:

> To duplicate:
>
> Create file test.org as in this example:
> #+begin_example
> #+TITLE: test org title link
> #+end_example
>
> 1. go to title line of test.org, and do org-store link: 'C-c l'
> 2. go to new file test2.org, and do org-insert-link: 'C-c C-l M-p '
>
> Here is the actual file test2.org produced by this method:
> #+begin_example
> [[file:test.org::+TITLE: test org title link]]
> #+end_example
>
> This isn't great because there is no description.

Org does not know if you want to store link to file or to this specific
line. The current default is trying to store link to current line,
stripping "#" to disambiguate from custom ID search string.
See 4.8 Search Options in File Links

> 1. Expected file test2.org:
> #+begin_example
> [[file:test.org::+TITLE: test org title link][test org title link]]
> #+end_example
>
> Or even better:
>
> 2. Desired file test2.org:
> #+begin_example
> [[file:test.org][test org title link]]
> #+end_example

You can set `org-id-link-to-org-use-id' to non-nil (4.5 Handling Links).
Then, Org will store link to current file/heading instead of more
generic link. Latest version of Org will also auto-assign TITLE as the
link description.

Canceled.
You may consider sending patch for Org manual if you think that we can
do a better job describing how Org handles links.

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



Export Documentation Confusions

2023-06-28 Thread Matt
In the Emacs Berlin meeting today, we noticed several items that might be 
improved in the manual.

- Section 13.18. 1: Bare HTML may be better placed under Section 13.9 HTML 
Export.  The information in this section appears unrelated to Exporting in 
non-Org buffers.  In fact,  the settings given for a minimal HTML export do not 
apply when converting a region.  For example, when converting a region 
containing an Org table to HTML, a preamble is not inserted even when the 
variable `org-html-preamble` is t.

https://orgmode.org/manual/Bare-HTML.html

Proposed solution: Move Section 13.18.1 nearer the sections on HTML export.

- Section 13.18: Export in Foreign Buffers

The section uses the term "foreign buffer" without providing a definition.  It 
appears to mean a buffer without "org-mode" enabled.  The section describes 
functions which allow users to write Org mode syntax in non-Org buffers and use 
various functions to convert the Org syntax to other syntaxes, like HTML, 
Markdown, etc.

https://orgmode.org/manual/Export-in-Foreign-Buffers.html

Proposed solution: Change wording from "foreign buffers" to "Convert Region" 
and "non-Org" buffer.   The functionality is really about conversion rather 
than anything to do with non-Org buffers.  If fact, Org respects users' freedom 
to run the program as they wish–it does not prevent them from converting Org 
formatted text within an Org buffer to a non-Org format, no matter how absurd 
it may appear :)

- Section 13.18: Export in Foreign Buffers

There was confusion caused by the function names.  Specifically, the 
"namespace" (such as "org-ascii-" or "org-texinfo-") is confusing to users who 
are not familiar with Org function naming conventions. For example, one 
participant thought `org-ascii-convert-region-to-utf8` might convert non-utf8 
ascii to utf8 and was confused why `org-texinfo-convert-region-to-texinfo` 
would convert texinfo to texinfo.  Of course, this is not a correct 
understanding of the function behavior.

https://orgmode.org/manual/Export-in-Foreign-Buffers.html

Proposed solution: Clarify the overall purpose of the functions.  Another 
solution could be to make an aside and clarify what is meant by "Org export 
back end".  For example, change

"The export back-ends in Org often include..."

to 

"The export back-ends in Org (for example, Org ASCII or Org HTML) often 
include..."

However, my hope is that the changes I made with regard to "foreign buffers" 
also clarifies the purpose and use of functions listed in this section.

These changes are given in the attached patches.   If there are no suggested 
improvements, I could merge them in.  Please let me know your thoughts.

move-bare-html-section-to-html-export-section.patch
Description: Binary data


change-foreign-to-non-org.patch
Description: Binary data


[BUG] org-store-link on document title

2023-06-28 Thread Anthony Carrico

On 6/28/23 12:48, Ihor Radchenko wrote:
> I cannot reproduce.
> Please provide more details and report this under a different email
> subject, so that we can easily distinguish the two bugs.
> See https://orgmode.org/manual/Feedback.html#Feedback

Ah, very sorry for the distraction on the "This link has already been 
stored" issue.


I'll describe the behavior I observe, and a more useful behavior. I'm 
not sure this constitutes an actual bug, since org-store-link isn't 
documented to work on the title line of a document.


Org mode version 9.5.5 (release_9.5.5 @ /usr/share/emacs/28.2/lisp/org/)
GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, 
cairo version 1.17.6) of 2023-01-02


To duplicate:

Create file test.org as in this example:
#+begin_example
#+TITLE: test org title link
#+end_example

1. go to title line of test.org, and do org-store link: 'C-c l'
2. go to new file test2.org, and do org-insert-link: 'C-c C-l M-p '

Here is the actual file test2.org produced by this method:
#+begin_example
[[file:test.org::+TITLE: test org title link]]
#+end_example

This isn't great because there is no description.

1. Expected file test2.org:
#+begin_example
[[file:test.org::+TITLE: test org title link][test org title link]]
#+end_example

Or even better:

2. Desired file test2.org:
#+begin_example
[[file:test.org][test org title link]]
#+end_example

Here the title is used as the description, and the file itself is 
linked, rather than the title line.


The second option makes more sense to me. Why? Because at the title line 
I intend to store a link to the document labeled with the title, and at 
a headline I intend to store a link to a section of the document labeled 
with the headline.


This option also produces cleaner html output (at least a few years 
ago--see org mailing list around 2020-08-06 with subject "ISSUE: Unable 
to resolve link (html export)").


--
Anthony Carrico



Re: [PATCH] org-faq.org: rename org-export-htmlize-* options to org-html-htmlize-*

2023-06-28 Thread Ihor Radchenko
dongdigua  writes:

> sorry, my email client wrapped the lines

Thanks!
I looked into this again, and I can see that the FAQ entry is dubious.

> -** How can I preserve faces when I export an agenda from the command line?
> +** How can I preserve faces when I export an org file from the command line?

Note that the FAQ entry is talking both about exporting Org files and
also exporting agenda - two different code branches.

> @@ -3821,18 +3821,18 @@ does not have a display and therefore only 
> rudimentary face
>  definitions.  If you'd like to use more complex styles, you'll have to
>  make sure that the export process only assigns classes instead of
>  direct color values.  This can be done by binding the variable
> -=org-export-htmlize-output-style= to =css= for the duration of the
> +=org-html-htmlize-output-style= to =css= for the duration of the

`org-html-htmlize-output-type', not "-style".

>  export, for example with
>  
>  : emacs -batch -l ~/.emacs
> -:   -eval '(let ((org-export-htmlize-generate-css (quote css)))
> +:   -eval '(let ((org-html-htmlize-generate-css (quote css)))
>  :(org-batch-agenda "e"))'

And this example is talking specifically about agenda export, which is
relying on htmlize package. There, the css generation is controlled by
`htmlize-output-type', not by `org-html-htmlize-generate-css'.

So, we need a much more significant rewrite to make this FAQ entry up to
date.

[ org-faq is severely outdated, unfortunately. It would really be welcome
  if some kind soul could review it and update things as needed. ]

>  Then you can use a style file to make these classes look any way you
>  like.  To generate face definitions for a CSS file based on any faces
>  you are currently using in Emacs, you can use the following command:
>  
> -: M-x org-export-htmlize-generate-css RET
> +: M-x org-html-htmlize-generate-css RET
>  
>  This will generate a =...= section, the content of
>  which you can add to your style file.

And in agenda, it will be org-agenda-export-html-style variable that has
to be set.

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



Re: what is the purpose of "This link has already been stored"?

2023-06-28 Thread Ihor Radchenko
Anthony Carrico  writes:

> Storing the link is also currently somewhat buggy. I almost always link 
> to the top of the page (the title), and org creates a table entry which 
> looks like this:
>
>   Abstract Syntax Graphs for Domain Specific Languages>

I cannot reproduce.
Please provide more details and report this under a different email
subject, so that we can easily distinguish the two bugs.
See https://orgmode.org/manual/Feedback.html#Feedback

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



Re: what is the purpose of "This link has already been stored"?

2023-06-28 Thread Anthony Carrico
I agree that the current behavior is useless, and I agree that a good 
default would be to bring the link to the front of the list.


Storing the link is also currently somewhat buggy. I almost always link 
to the top of the page (the title), and org creates a table entry which 
looks like this:


 Abstract Syntax Graphs for Domain Specific Languages>


Creating a link like this:

[[file:2023-06-24T161646.org::+TITLE: Ref: Functional Programming with 
Structured Graphs]]


Unfortunately the link doesn't automatically get a sensible default 
description. This would be a better table entry:


Ref: Abstract Syntax Graphs for Domain Specific Languages 



Creating a link like this:

[[file:2023-06-24T161646.org][Ref: Functional Programming with 
Structured Graphs]]


I always do this transformation manually when creating links to my pages.

I'm in the habit of stripping the title from the link, because such 
links didn't used to work, maybe due to the pound sign, but apparently 
they are currently working, as I just discovered.


--
Anthony Carrico




[PATCH] org-faq.org: Inline comments

2023-06-28 Thread Max Nikulin

On 22/06/2023 08:50, Max Nikulin wrote:

On 22/06/2023 07:04, ypuntot wrote:


Could it be possible to make inline comments (# something like this) ?

...

Previous discussion:

...

I think, it is time to add a FAQ entry, see the attachment.

To my taste FAQ is rather long already. If you have an idea of another 
place on Worg where such tricks may be added then, please, share it.From a8dd1797588bdab7f63628579414c65d7444f387 Mon Sep 17 00:00:00 2001
From: Max Nikulin 
Date: Wed, 28 Jun 2023 22:40:40 +0700
Subject: [PATCH] org-faq.org: Inline comments

* org-faq.org (Export): New heading describing workarounds
for inline comments.
---
 org-faq.org | 53 +
 1 file changed, 53 insertions(+)

diff --git a/org-faq.org b/org-faq.org
index ab661395..7048ab2d 100644
--- a/org-faq.org
+++ b/org-faq.org
@@ -4492,6 +4492,59 @@ ** How can I suppress the page number in the footer of an exported PDF?
 
 : #+LATEX: \thispagestyle{empty}
 
+** Is it possible to add inline comments?
+:PROPERTIES:
+:CUSTOM_ID: inline-comments
+:END:
+
+Unfortunately [[https://orgmode.org/manual/Comment-Lines.html][comments]]
+in Org are block-level elements, so they break paragraphs.
+However some workarounds are possible.
+
+Choose a non-standard export backend name and use it in
+[[https://orgmode.org/worg/org-syntax.html#Export_Snippets][export snippets]]:
+=@@comment: rewrite it @@=  or even =@@c: be concise@@=.
+
+Define a [[https://orgmode.org/manual/Macro-Replacement.html][macro]]
+that expands to nothing
+: #+MACRO: comment
+an use it as ={{{comment( not ideal )}}}=.
+A downside of this approach is warnings issued by ~org-lint~.
+
+Define a [[https://orgmode.org/manual/Adding-Hyperlink-Types.html][custom link type]]
+#+begin_src elisp :exports code :eval never-export
+  (org-link-set-parameters "rem" :export (lambda ( _) ""))
+#+end_src
+A bonus is that you may create a
+=[[rem: hidden part of comment][...]]= try =C-h .= (~display-local-help~)
+or =C-c C-l= (~org-insert-link~) to read first part of the comment.
+Another link syntax is ==.  Beware of patterns that may
+appear in plain text and be recognized as links even without
+enclosing brackets like =rem:10=.  Use a unique sequence of letters
+as the link type.
+
+Use inline [[https://orgmode.org/manual/Structure-of-Code-Blocks.html][source code blocks]]
+for a programming language that does not appear in your text.
+Just suppress export
+: #+header-args:csh :exports none :eval never-export
+and =src_csh{code}= becomes indistinguishable from comments.
+Perhaps with a custom ~org-babel~ backend that evaluates
+code to the same string you may control whether comments
+should appear in exported file.
+
+It is safer to avoid lines that have no text besides comments.
+They may be treated as paragraph separators.
+
+Unfortunately never approach suggested above works on sites for
+hosting of open source code projects. Literal markup
+(or broken links) will appear in e.g. formatted =README.org= files.
+
+Discussions on the mailing list:
+- [[https://list.orgmode.org/5210ac1c-ed73-4b82-a296-41cf90b9f...@gmail.com/][Inline comments. Thu, 22 Jun 2023 02:04:15 +0200]]
+- [[https://list.orgmode.org/mid:87zg8jwp26.fsf@localhost/][Re: [BUG] No space after footnote with org-export-with-footnotes set to nil. Sat, 11 Mar 2023 10:38:25 +]]
+- [[https://list.orgmode.org/87618398-cf6d-86b4-ba59-144f70d0f...@7d.nz/][[PATCH] ox: fix comment exported as a blank line. Wed, 1 Jun 2022 07:30:01 +0200]]
+- [[https://list.orgmode.org/alpine.deb.2.22.394.2107161156080.74...@shell3.miskatonic.org/][Comments break up a paragraph when writing one-setence-per-line. Fri, 16 Jul 2021 12:06:54 -0400]]
+
 * Backup
 
 #+index: Backup
-- 
2.25.1



Re: [PATCH] org-faq.org: rename org-export-htmlize-* options to org-html-htmlize-*

2023-06-28 Thread dongdigua

sorry, my email client wrapped the lines



From 0de831fb611c89c1a2be4825a8e28999fcf8e526 Mon Sep 17 00:00:00 2001
From: dongdigua 
Date: Wed, 28 Jun 2023 23:16:27 +0800
Subject: [PATCH] org-faq.org: rename org-export-htmlize-* to
 org-html-htmlize-*

look at this commit:
https://git.sr.ht/~bzg/org-mode/commit/8134e80bdfb55bbce9aecf3f5958a2bd43cc0b63
the document didn't catch up with source code

I encountered this problem in:
https://emacs-china.org/t/org-emacs-script-org-publish-all/20782
and documented it in: https://dongdigua.github.io/org_export_highlight
---
 org-faq.org | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/org-faq.org b/org-faq.org
index ab66139..3efebd1 100644
--- a/org-faq.org
+++ b/org-faq.org
@@ -3793,7 +3793,7 @@ There is a whole host of export options you can set with an in-buffer
 options or via global variables. See [[https://orgmode.org/manual/Export-settings.html#Export-settings][this section]] of the manual for a
 full list.
 
-** How can I preserve faces when I export an agenda from the command line?
+** How can I preserve faces when I export an org file from the command line?
:PROPERTIES:
:CUSTOM_ID: preserving-faces-during-batch-export
:END:
@@ -3821,18 +3821,18 @@ does not have a display and therefore only rudimentary face
 definitions.  If you'd like to use more complex styles, you'll have to
 make sure that the export process only assigns classes instead of
 direct color values.  This can be done by binding the variable
-=org-export-htmlize-output-style= to =css= for the duration of the
+=org-html-htmlize-output-style= to =css= for the duration of the
 export, for example with
 
 : emacs -batch -l ~/.emacs
-:   -eval '(let ((org-export-htmlize-generate-css (quote css)))
+:   -eval '(let ((org-html-htmlize-generate-css (quote css)))
 :(org-batch-agenda "e"))'
 
 Then you can use a style file to make these classes look any way you
 like.  To generate face definitions for a CSS file based on any faces
 you are currently using in Emacs, you can use the following command:
 
-: M-x org-export-htmlize-generate-css RET
+: M-x org-html-htmlize-generate-css RET
 
 This will generate a =...= section, the content of
 which you can add to your style file.
-- 
https://dongdigua.github.io



Re: what is the purpose of "This link has already been stored"?

2023-06-28 Thread Ihor Radchenko
Samuel Wales  writes:

> in maint and bugfix i frequently do org-store-link on a
> heading that has a properties drawer with an id in it.
>
> ...
> i frequently get "This link has already been
> stored".  perhaps this is meant to teach me that i can find
> it in org-insert-link?  there are 2 problems with that for
> me in practice:
>
> 1) i want to store it anyway so i can use the
>mindless store-insert combination.

This behaviour has been introduced in bb61b37ee

bb61b37ee223fd89cf951a5fbf62e35e606a4646
Author: Bastien 
AuthorDate: Thu Dec 5 17:11:26 2019 +0100
ol.el: Don't store the same link twice

* lisp/ol.el (org-store-link): Don't store the same link twice.

I think that it will make a lot more sense to move the link in front of
the stored link list instead of just printing the message.

Bastien, others: any objections? (another possibility could be a
defcustom, but I cannot find how the current behaviour is useful for
anyone).

> 2) org-insert-link, with my ido setup, and i am aware other
>completion mechanisms exist but find it difficult to
>switch, offers as completion candidates a completely
>useless list.
>
>idk how to show you the list but it looks kinda sorta like this:
>  id:2134123-11234123-41234123--12341
>  eww:
>  gnus:
>  ...
>  id:44242423-23452-345-234-523452-345
>  ...
>
>as there is no description and the presumably useful ids
>are near te bottom it is useless to try to use
>org-insert-link.  so idk what the solution is.

The descriptions are displayed in *Org Links* buffer.
The completing-read call could, however, be improved to display link
descriptions as well. Patches welcome!

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



Re: [BUG] org-display-user-inline-images stops processing when a org-link type fails [9.7-pre (release_9.6.6-412-g2f7b35 @ /Users/dmg/.emacs.d/straight/build/org/)]

2023-06-28 Thread Ihor Radchenko
dmg  writes:

> I use org-yt (https://github.com/TobiasZawada/org-yt) to create
> thumbnails of a youtube video in the orgfile (eg: yt:)
>
> When there is no Internet, the function responsible for retrieving the
> thumbnail fails with an error. Unfortunately,
> org-display-user-inline-images does not recover from this error.

May you please provide more details describing the problem?
org-display-user-inline-images is not defined by Org mode.
See https://orgmode.org/manual/Feedback.html#Feedback

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



Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)]

2023-06-28 Thread Ihor Radchenko
Sébastien Miquel  writes:

> Here are two patches, the first that removes the special case logic
> for LaTeX fragments, and the second that implements what you suggest,
> and applies on top of the first one. Does that look ok to you ?

Thanks!

> +  ;; Apply WRITE-BACK function on edit buffer contents.
> +  (goto-char (point-min))
> +  (when (functionp write-back) (save-excursion (funcall write-back)))
>(set-marker marker nil

`save-excursion' is no longer necessary here.

>  (defun org-src--edit-element
> @@ -1150,7 +1149,14 @@ Throw an error when not at such a table."
> (lambda ()
>;; Blank lines break things, replace with a single newline.
>(while (re-search-forward "\n[ \t]*\n" nil t) (replace-match "\n"))
> -  ;; If within a table a newline would disrupt the structure,
> + ;; Trim contents.

It would be nice to have a bit more context about the purpose in the
comment here.

> Subject: [PATCH] org-src.el: Use native value of `indent-tabs-mode' for
>  indentation
>
> * lisp/org-src.el (org-src--contents-for-write-back): Preserve the
> native indentation (spaces vs tabs).  If necessary, add a common org
> indentation to the block according to org's `indent-tabs-mode'.
> (org-src-font-lock-fontify-block): In case of mixed indentation,
> display the tab characters with a fixed width, according to the native
> tab width value.
> * testing/lisp/test-org-src.el (test-org-src/indented-blocks): Update
> tests.  Indentation no longer obeys `indent-tabs-mode' from the org
> buffer, but is separated in two parts.

> diff --git a/lisp/org-src.el b/lisp/org-src.el
> index 5c272c7f5..5a1030c42 100644
> --- a/lisp/org-src.el
> +++ b/lisp/org-src.el
>  ...
> -   (skip-chars-forward " \t")
> -  (when (or (not (eolp))   ; not a blank 
> line
> -(and (eq (point) (marker-position marker)) ; current line
> +  (when (or (not (eolp)) ; not an empty line
> +;; If the current line is empty, we may
> +;; want to indent it.
> +(and (eq (point) (marker-position marker))
>   preserve-blank-line))

Do we still need this dance with special case for current line?

> +;; Display tab indentation characters preceded by spaces as spaces
> +(unless org-src-preserve-indentation

unless? Don't we rather want to preserve the original indentation
alignment when `org-src-preserve-indentation' is t?

> +  (save-excursion
> +(goto-char start)
> +(while (re-search-forward "^[ ]+\\([\t]+\\)" end t)

Why just tabs at indentation? It would make sense to preserve width of
all the tabs.

> +  (let* ((b (match-beginning 1))
> + (e (match-end 1))
> + (s (make-string (* (- e b) native-tab-width) ? )))
> +(add-text-properties b e `(display ,s))

Will the actual tab width be always equal to native-tab-width? What
about tab stops? May it be more reliable to use different of column
numbers in the src mode buffer after/before the tab?

> @@ -318,19 +318,21 @@ This is a tab:\t.
>argument2))
>#+END_SRC"
>(setq-local indent-tabs-mode t)
> -  (let ((org-edit-src-content-indentation 2)
> +  (let ((tab-width 8)
> +(org-edit-src-content-indentation 2)

Why is setting tab-width necessary? 8 is the default value.

>#+BEGIN_SRC emacs-lisp
> -(progn\n  (function argument1\n\t\targument2))
> +(progn\n  (function argument1\n\targument2))

I think it would be a bit more readable to convert this string into
actual multi-line, where the alignment is visible when reading the test
source.

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



Re: How to export to the simplest possible HTML?

2023-06-28 Thread Marcin Borkowski


On 2023-06-27, at 13:00, Max Nikulin  wrote:

>>> On 08/06/2023 22:18, Thomas Redelberger wrote:
   http://web222.webclient5.de/doc/swdev/emacs/orgmode/html
>>>
>>> At this page:
>>>
 #+BIND: org-html-viewport nil
 I do not need viewport information in the HTML.
>
> On 26/06/2023 02:56, Marcin Borkowski wrote:
>> Do you mean this?
>> https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag
>
> Yes, I do. Browser development tools allows to test adaptive design
> (to simulate specific mobile devices).

Thanks.

> I was surprised that somebody may intentionally disable the feature
> supported by Org on a site that at first glance does not require
> special viewport settings. Since you are in the process of refreshing
> your site, I decided to draw your attention to this setting of HTML
> pages.

I did not plan to do anything with https://mbork.pl, but I'll look into
it.  (I'm working on another site.)

Thanks,

-- 
Marcin Borkowski
http://mbork.pl