Re: Org and Hyperbole

2022-10-09 Thread indieterminacy

Hello Robert,

On 08-10-2022 22:26, Robert Weiner wrote:

Hi Jonathan:

I and I think others would love to understand what you are trying to
achieve.  I get that you want to use the Koutline format with external
systems like GemText and the TXR parser generator/Lisp language but I
would rather understand the purpose of what you are trying to build
(problem(s) to solve) and what you can't do with the Koutliner as it
now stands that you would like to do.  Try to explain it without
referencing any particular technologies, as I can't follow many of the
things you write because of a lack of context.



How does one describe crimson and clover?

My medium term plans are to adapt my utilitarian setup, so that it 
becomes encapsulated.

Im planning to provide augmentation of Icebreaker's stack into areas of:
* text-to-speech
* speech-to-text
* braile

Though initially focusing on software design, I could (eventually) see 
advantages of product design to

complement the interfacing and interpreting aspects of my work.

Not technologically speaking, the problem Im wrestling is broadly 
similar to George Bernard Shaw (with regards to
notation; shorthand; and semiotics) when he proposed the Shavian 
Alphabet to supplant the

Latin alphabet.

Philologists should track down the later half of his preface in the 
book,

The Miraculous Birth of Language:
https://archive.org/details/in.ernet.dli.2015.462145/page/n9/mode/2up

Coincidentally, both his and my approaches to our different problems 
settled on a notation with 40 characters.



Focusing on my TXR interpreter, I have been creating my own flavour of 
canonical s-exp, Qiuynonical:

https://git.sr.ht/~indieterminacy/1q20hqh_oqo_parsing_qiuynonical

Here is an example of the parsing-expression-grammars interleaving 
different uris and there comments:

```
+ (("2:=>" "1: ") ("w-i" (("6:gemini" "3:://" "10:icebreaker" "1:." 
"5:space") ("5:/?q=/" ("3:111:1:." "1:+" "6:gemini" "3:://" 
"10:icebreaker" "1:." "5:space")))
+  "i-w" ("3:REM:5:bunch:2:of:5:words" ("3:ueu" ("1:_" 
"14:testing-search"

+  "bing-x-b-ii-a")
+ (("2:=>" "1: ") ("w-i" (("6:gopher" "3:://" "10:icebreaker" "1:." 
"5:space") ("3:/?=" ("3:1aa:1:." "1:&" "6:gemini" "3:://" 
"10:icebreaker" "1:." "5:space")))
+  "i-w" ("3:REM:5:bunch:2:of:5:words" ("3:ueu" ("1:_" 
"14:testing-search"

+  "bing-x-b-ii-a")
+ (("2:=>" "1: ") ("w-i" (("6:finger" "3:://" "10:icebreaker" "1:." 
"5:space") ("2:/?" ("3:1a2:1:." "1:&" "6:gemini" "3:://" "10:icebreaker" 
"1:." "5:space")))
+  "i-w" ("3:REM:5:bunch:2:of:5:words" ("3:ueu" ("1:_" 
"14:testing-search"

+  "bing-x-b-ii-a")
+ (("2:=>" "1: ") ("w-i" (("5:https:5:bunch:2:of:5:words" "3:://" 
"10:icebreaker" "1:." "5:space") ("4:/?q=" ("2:1a:1:." "1:%" "6:gemini" 
"3:://" "10:icebreaker" "1:." "5:space")))
+  "i-w" ("3:REM" ("3:ueu" ("1:_" 
"14:testing-search"

+  "bing-x-b-ii-a")
```

Notice how "REM" is actually the first instance of non official token, 
starting a new parenthesis but still permitting repetitive patterns for 
things like "ueu" as an annotation to still be caught later on (with or 
without descriptors (which could be an underline, a tab or two or more 
whitespaces).


Niceley, the way ive been approaching breakpoints between line-types and 
content-types is that you could(!) have iterating blocks of gemtext and 
koutliner within the same line - with the datalisp representing it as an 
array.


As a consequence, one may then use logic rules for sophisticated 
inferences.
Such as querying a subtext of a gemtext document and appending a 
conclusion or requirement in a referenced koutliner block.


Think YahooPipes for playgrounding.


In terms of accessibility, rather than all content being read out, uris 
could be counted and headers or notion read out with a distinctive tone.

Or similarly, concerning annotations or dates.



It is of course worth stating that gemtext has advantages for written 
prose, especially its ease of transmission with its TLS backed protocol, 
Gemini.
I appreciate its simplicity and minimalism, including on a technical and 
tooling level.


Here is a (recently released) video from last years Software Freedom Day 
concerning Gemini and complexity:

https://www.youtube.com/watch?v=zyTC4QWGCQg

FFIW, the messaging service featured in the talk used sqlite.

I feel that Gemtext is as worthy of usage as Outline for instance and 
the cost for interoperating with Orgmode not insurmountable.


It is worth stating that I treat all coding comments as the 
aforementioned formats and syntaxes.
With the intention of inverting code documents into a 
literate-programming form.


Given that out of the box TXR can operate inside a Gemtext document and 
output something different gemtext content makes me feel that

 there are a lot of possibilities yet to explore.


This quote from the Gemini community highlights why Icebreaker feels it 
is making the correct design 

Re: [PATCH v2] Re: org-contacts: Dead link at https://orgmode.org/worg/org-contrib/index.html

2022-10-09 Thread Christopher M. Miles

Ihor Radchenko  writes:

> "Christopher M. Miles"  writes:
>
>> From 1521f4e27360d536197ee0ac524a641aad02822f Mon Sep 17 00:00:00 2001
>> From: stardiviner 
>> Date: Sat, 8 Oct 2022 20:40:34 +0800
>> Subject: [PATCH] Fix dead link of org-contacts
>
> Thanks!
>
>>  org-contrib/org-contacts.org | 30 ++
>
> Could you please use the standard WORG file template described in
> https://orgmode.org/worg/worg-editing.html?

Ok, I updated org-contacts.org file now. Check out the new patch.

From 0920dfa762a82f3c934b2eb11fcf7202c1cb194e Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Sat, 8 Oct 2022 20:40:34 +0800
Subject: [PATCH] Fix dead link of org-contacts

---
 org-contrib/index.org|  9 +---
 org-contrib/org-contacts.org | 40 
 2 files changed, 46 insertions(+), 3 deletions(-)
 create mode 100644 org-contrib/org-contacts.org

diff --git a/org-contrib/index.org b/org-contrib/index.org
index 628d9493..b9f42af4 100644
--- a/org-contrib/index.org
+++ b/org-contrib/index.org
@@ -66,9 +66,6 @@ the package -- it will hopefully have some documentation.
   Written by /Eric Schulte/.
   [[contribfile:lisp/org-collector.el][Link to raw file]].
 
-- [[contribfile:lisp/org-contacts.el][/org-contacts.el/ -- manage contacts (org-plus-contrib)]] ::
-  Written by /Julien Danjou/, now in Org contrib.
-
 - [[file:org-depend.org][/org-depend.el/ -- TODO dependencies for Org-mode]] ::
   Make TODO state changes in one entry trigger changes in another, or
   be blocked by the state of another entry.  Also, easily create
@@ -426,6 +423,12 @@ See [[file:../exporters/index.org][Exporters]].
   images in email.  Written by /Eric Schulte/, maintained by /Chen Bin/.
   [[https://github.com/org-mime/org-mime][Repo]].
 
+- [[file:org-contacts.org][/org-contacts.el/ -- manage contacts]] ::
+  Managing contacts information, recording, searching etc in Org
+  mode. As contacts database backend for mu4e etc.  Written by /Julien
+  Danjou/, now maintained by /stardiviner/. Link to [[https://repo.or.cz/org-contacts.git][project repo
+  page]].
+
 * Obsolete
 
 - [[file:org-annotation-helper.org][/org-annotation-helper.el/ -- managing browser bookmarks]] ::
diff --git a/org-contrib/org-contacts.org b/org-contrib/org-contacts.org
new file mode 100644
index ..6e3d20b0
--- /dev/null
+++ b/org-contrib/org-contacts.org
@@ -0,0 +1,40 @@
+#+TITLE: org-contacts.el -- managing contacts information in Org mode
+#+OPTIONS:   ^:{} author:nil
+#+STARTUP: odd
+
+# This file is released by its authors and contributors under the GNU
+# Free Documentation license v1.3 or later, code examples are released
+# under the GNU General Public License v3 or later.
+
+* Intro
+
+- Managing contacts information in Org mode.
+- Recording contact info in Org mode.
+- Searching with command ~org-contacts~.
+- Used as contacts database backend for email address completing in mu4e etc.
+- Export contacts to a vCard file.
+- Put birthdays in your Org Agenda.
+
+* Installation
+
+Package has been submitted to NonGNU or MELPA. You can install it through those package sources.
+
+* Usage
+
+More details you can check out [[https://repo.or.cz/org-contacts.git][org-contacts.el project page's README.org]].
+
+** Search contact in org-contacts databse
+
+Use command =[M-x org-contacts]= to search.
+
+** Complete contact property with some functions support
+
+*** NAME
+
+*** NICK
+
+*** EMAIL
+
+*** BIRTHDAY
+
+
-- 
2.37.2


-- 

[ 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: stability of toc links

2022-10-09 Thread Samuel Wales
[i should clarify the clarification as i do not want it to seem like
saying i already covered that was the only point for no reason.  what
i meant is to provide context for those who are stumbling upon this
long thread.

it seems an active topic and a lot of custom id solutins were
presented and while custom id is a great feature, and provides a great
solution for those who want it, and in many cases is a great solution,
it is definitely not for /everybody/ in all cases, especially the
particular case of a large document where /lots/ of headers might
potentially be linked to by users, such as my original example in op,
a /long/ blog post.  and thus lots of properties drawers and custom id
identifiers would be created.  custom id is not a solution for me, for
toc or any other links that i desire to be stable /automatically/,
which is why i addressed them and id in my op and said "short of".

for clarity, according to my sensibilities, which others obviously
will differ on, custom id is more suitable for the document author to
use manually, and reasonably sparingly, and with particularly
meaningful and carefully chosen names.  a custom id name refers to an
internal link that was chosen out of many, and refers to it with
semantic value attached.

in other words, to me, in most cases, custom id is not for code to
generate.  in my own case, code would potentially create an enormous
number of undesired properties drawers with custom ids and /also/ make
it so that it is no longer as much of a semantically valuable feature
that custom id were added manually sparingly and with meaningful names
for  particularly potent internal links to draw the reader's or
author's attention to or be straightforwardly searchable.  if that
makes any sense there.  :)

[as for drawers, as an aside: to my sensibilities, too many make the
document author wonder if they contain anything significant, require
opening them to make sure they are ok, and take up space in the emacs
window which in my case is highly limited.  also, they possibly reduce
efficiency as at least in the past drawers were highly inefficient in
org.  these issues probably do not apply to everybody.]

so that is why i said in the op "short of adding custom id or id to
everything", and why i clarified that i mentioned what you brought up
in the op.  sometimes i effectively assume that all my implications
are understood when in fact i am supposed to spell them out but i am
limited in computer use so i sometimes do not.  perhaps it helps
clarify.]


On 10/9/22, Samuel Wales  wrote:
> On 12/8/20, Tom Gillespie  wrote:
>> It sounds like you are looking for the CUSTOM_ID property.
>
> just for clarity, i addressed this in my original post when i said
> "short of adding custom id or id to everything".
>


-- 
The Kafka Pandemic

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



Re: stability of toc links

2022-10-09 Thread Samuel Wales
On 12/8/20, Tom Gillespie  wrote:
> It sounds like you are looking for the CUSTOM_ID property.

just for clarity, i addressed this in my original post when i said
"short of adding custom id or id to everything".



Re: idea for capture anywhere in x

2022-10-09 Thread Ypo

What if:
1. It were easy and immediate to open in ~eww~ any web page that we are 
reading in "x".

2. Once on eww we could:
 a. Emphasize (markup, "highlight") the text and save the 
modifications for the future. Then we could continue reading the 
emphasized web page.

 b. Create and send to an org headline the desired regions of text.

I remember when I was happy reading e-books on my brand new Nokia N80. 
Just plain text, just enough.


Eww is far superior to my old Nokia, so it could be great to work and 
process webpages for taking notes.


Re: SQLite for contacts and relations to Org - Re: contact management in emacs

2022-10-09 Thread Quiliro Ordóñez
El 2022-10-09 11:59, Jean Louis escribió:
> * Quiliro Ordóñez  [2022-10-09 18:22]:
>> El 2022-10-09 05:40, Jean Louis escribió:
>>
>> > But I can as well edit my contacts by using external tools and
>> > exchange information with other software.
>> >
>> > Do you wish to share your contacts? That is easy, one can simple send
>> > the full file to somebody.
>> >
>> > By followed the thought patterns described one shall understand that
>> > contacts may be separated from single mode (Org) and separated from
>> > single software (Emacs) and that it will not minimize or limit you but
>> > rather widen the capacities and usefulness for human.
>>
>> This is a great summary about the use of database to hold information.
>> But it requires experience configuring databases for end-users.
> 
> We speak of what? User experience? We are in Emacs environment, that
> means you run your application either by using mouse click or by M-x
> or key binding.
> 
> In the provided example you as user need nothing else but
> that. Hypothetically basic actions are just add, modify, delete,
> search for contacts. You do that by key binding in Emacs, or by mouse,
> or by M-x
> 
> In the example provided user need do nothing but that. Even the file
> can be automatically stored like in ~/.emacs.d/people.sqlite or
> otherwise configured to be somewhere else.

I agree.  But the end-user did not construct this program.  It was you. 
I coould learn how to install it.  Then, I should teach the end-user to
use it.  But the program was not made or installed by the end-user.  I
might be able to teach the end-user to modify it.  But I doubt it.

What I mean is that end-users must have an easy entry point.  Of course
that ease must not hide innner workings because that would disempower
the end-user.  How do you propose it could be implemented? (if you agree
it should be done this way, of course) 

> I have actually shown to you how it works, so you have to imagine that
> all that may be part of the package. Especially with SQLite databases
> there is nothing to configure.

Not much to do.  Just installing SQLite and then the program you
propose.



Re: idea for capture anywhere in x

2022-10-09 Thread Jean Louis
* Max Nikulin  [2022-10-09 19:41]:
> On 09/10/2022 21:47, Jean Louis wrote:
> > 
> > I have basic concept to capture X selection in file and get it in
> > Emacs. It is not really related to Org, one can capture X selection
> > and record it anyhow. There is no need for org-protocol this way.
> > 
> > File: ~/bin/capture-x-selection.sh
> > 
> > #!/usr/bin/bash
> > TEMP=/tmp/xselection.txt
> > xsel -o > $TEMP
> 
> Jean, take a breath and think several minutes on your recipe. You will
> figure out that (perhaps unsafe) intermediate file is redundant. Emacs can
> access text/plain target of PRIMARY_SELECTION and CLIPBOARD directly (anyway
> xsel, unlike xclip, is not your friend if you need more). In default
> configuration C-y yanks from CLIPBOARD, mouse middle click from
> PRIMARY_SELECTION.

Thank you.

Directly of courseworks, but that would mean that you have to make
several clicks, not just one click. It also implies you must have
Emacs in front of you, and not sitting around as server in background
or anywhere.

You must be on window manager workspace with Emacs to capture X
selection as without Emacs in front of you, how do you invoke it in
that case?

> The idea of org-protocol is to pass more data.

It is structured data, something like '(:url "https://www.example.com;
:title "Something" :body "More here") and it may be anything in
general.

But no, I don't find it appealing in itself apart from using those
ready made browser extensions. 

In fact when we speak of capturing any selection from X, I would not
like relying on Emacs, it would be better using SQLite or PostgreSQL
for that. One can define templates and forms and use some graphical
dialogs like yad, zenity, which then insert things into database.

Once in Emacs, it is easy to convert it without doing anything, to Org
or any other type of file. 

Of course I don't use Org capture browser extensions to insert
anything in Org files. Not when I have it faster and better.

> Outside of Org there is e.g. remember mode (info "remember")
> https://www.gnu.org/software/emacs/manual/html_mono/remember.html
> You might notice remnants of org-remember in docs related to org-capture.

That is great simplest note taking system.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Re: SQLite for contacts and relations to Org - Re: contact management in emacs

2022-10-09 Thread Jean Louis
* Quiliro Ordóñez  [2022-10-09 18:22]:
> El 2022-10-09 05:40, Jean Louis escribió:
> 
> > But I can as well edit my contacts by using external tools and
> > exchange information with other software.
> > 
> > Do you wish to share your contacts? That is easy, one can simple send
> > the full file to somebody.
> > 
> > By followed the thought patterns described one shall understand that
> > contacts may be separated from single mode (Org) and separated from
> > single software (Emacs) and that it will not minimize or limit you but
> > rather widen the capacities and usefulness for human.
> 
> This is a great summary about the use of database to hold information. 
> But it requires experience configuring databases for end-users.

We speak of what? User experience? We are in Emacs environment, that
means you run your application either by using mouse click or by M-x
or key binding.

In the provided example you as user need nothing else but
that. Hypothetically basic actions are just add, modify, delete,
search for contacts. You do that by key binding in Emacs, or by mouse,
or by M-x

In the example provided user need do nothing but that. Even the file
can be automatically stored like in ~/.emacs.d/people.sqlite or
otherwise configured to be somewhere else.

How many options does Org have? The example I have provided may be
option free. 

There is nothing to do but to add, modify, delete, search for
contacts, export, and so on; all by using M-x, key binding or mouse.

> It could work if the database was set up by someone else or if the
> fields were easy to define by the end-user by some kind of
> interface.

I have actually shown to you how it works, so you have to imagine that
all that may be part of the package. Especially with SQLite databases
there is nothing to configure.

This is what defines where the database is:

(defcustom rcd-people-sqlite-file (concat (expand-file-name 
user-emacs-directory) "rcd-people.sqlite")
  "SQLite database file location."
  :type 'file
  :group 'rcd)

We evaluate it:

rcd-people-sqlite-file ⇒ "/home/data1/protected/.emacs.d/rcd-people.sqlite"

The above variable is part of the package. There is nothing for
user to think about it. There is nothing to configure but user
is free to customize it.

Fields or columns in preset database tables are designed by
programmer.

It is not hard to have options to add column, delete column or
rename column. That is exactly what I am doing on the fly during
Emacs sessions.
  
> On the other hand, there is a movement to use plain text for everything.
> I know you disagree.

There are movements for each and everything. Why should I
disagree with movements, I let them be. 

What I do not agree is to claim strongly that it is useful to
keep plain text or clay tables with Cuneiform for every type of
information.

> But here is some information about accounting
> this way: https://plaintextaccounting.org

The huge amount of work necessary to create plain text accounting
can't be compared to database work and efforts. I guess I have
implemented accounting with database about 4 times in my life
and I use it in various contexts. Standard accounting is simple.

Accounting types (pasted straight from Emacs view of database
list):

 1  Asset
 2  Liability
 3  Equity
 4  Income
 5  Expenses

Sample account defined:
 ID   1
   Date created   "2022-02-27 18:36:28.690616"
  Date modified   "2022-02-27 18:36:39.372512"
   User created   "maddox"
  User modified   "maddox"
  Hyperdocument   "2022-02-27 Transactions for Joe Doe"
   Account Type   "Asset"
 Person   "Jean Louis"
   Currency   "UGX - Ugandan shilling"
   Name   "Jean Louis"
Description   nil
   Code   nil

It belongs to Hyperdocument which has type of accounting. There
may be multiple companies, multiple accounting sets or parents
to which accounts belong. No need to open a "new file" for each
new company.

And then there is journal entry:

-[ RECORD 1 
]--+---
journal_id | 4
journal_datecreated| 2019-06-12 00:08:04.409559
journal_datemodified   | 
journal_usercreated| maddox
journal_usermodified   | maddox
journal_cashentrytypes | 1
journal_code   | 
journal_description| food
journal_debit  | 5
journal_credit | 7
journal_amount | 4000
journal_signature  | 
journal_date   | 2019-06-10

The entry debits account ID 5, credits account ID 7.

> I learned a lot of elisp by reading your long explanation about how to
> construct a contact database directly on Emacs 29 without adding
> anything else.  Thank you very much!

Well that is really good, thank you.


-- 
Jean

Take action in Free 

Re: test-org-table/sort-lines: Failing test on macOS

2022-10-09 Thread Max Nikulin

On 09/10/2022 22:38, Rudolf Adamkovič wrote:


For the two examples given by Max on Linux, I get on macOS:

printf 'a\nB\n' | LC_COLLATE=C sort
B
a


This is the expected behavior.


printf 'a\nB\n' | LC_COLLATE=en_US.UTF-8 sort
B
a


This one is not consistent with what I see on Linux with glibc.

printf 'a\nB\n' | LC_COLLATE=en_US.UTF-8 sort
a
B

Perhaps you do not have en_US locale generated

locale -a | grep en_US
en_US.utf8

At least sort uses the same "C" locale definition as expected by Org 
tests. Either Emacs is linked with another libc or there is a bug in Emacs.



printf 'a\nb\n' | LC_COLLATE=C sort
a
b


Sanity test passed for sort. You may try the same set of pairs with 
`string-collate-lessp'.


I am curious if "POSIX" locale works similar to "C" and "C.UTF-8" in 
your case

(string-collate-lessp "a" "B" "POSIX" nil)





Re: idea for capture anywhere in x

2022-10-09 Thread Max Nikulin

On 09/10/2022 21:47, Jean Louis wrote:


I have basic concept to capture X selection in file and get it in
Emacs. It is not really related to Org, one can capture X selection
and record it anyhow. There is no need for org-protocol this way.

File: ~/bin/capture-x-selection.sh

#!/usr/bin/bash
TEMP=/tmp/xselection.txt
xsel -o > $TEMP


Jean, take a breath and think several minutes on your recipe. You will 
figure out that (perhaps unsafe) intermediate file is redundant. Emacs 
can access text/plain target of PRIMARY_SELECTION and CLIPBOARD directly 
(anyway xsel, unlike xclip, is not your friend if you need more). In 
default configuration C-y yanks from CLIPBOARD, mouse middle click from 
PRIMARY_SELECTION.


The idea of org-protocol is to pass more data.

Outside of Org there is e.g. remember mode (info "remember")
https://www.gnu.org/software/emacs/manual/html_mono/remember.html
You might notice remnants of org-remember in docs related to org-capture.





Re: test-org-table/sort-lines: Failing test on macOS

2022-10-09 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

> Rudolf, can you (1) try sort in terminal to confirm that "C" locale
> behaves as expected in MacOS; (2) If sort works fine, you may consider
> reporting Emacs bug.

For the two examples given by Max on Linux, I get on macOS:

printf 'a\nB\n' | LC_COLLATE=C sort
B
a

printf 'a\nB\n' | LC_COLLATE=en_US.UTF-8 sort
B
a

For the other examples mentioned, I get on macOS:

printf 'a\nb\n' | LC_COLLATE=C sort
a
b

printf 'b\na\n' | LC_COLLATE=C sort
a
b

printf 'A\nB\n' | LC_COLLATE=C sort
A
B

printf 'B\nA\n' | LC_COLLATE=C sort
A
B

printf 'a\nb\n' | LC_COLLATE=C.UTF-8 sort
a
b

printf 'b\na\n' | LC_COLLATE=C.UTF-8 sort
a
b

printf 'A\nB\n' | LC_COLLATE=C.UTF-8 sort
A
B

printf 'B\nA\n' | LC_COLLATE=C.UTF-8 sort
A
B

Rudy
-- 
"Chop your own wood and it will warm you twice."
-- Henry Ford; Francis Kinloch, 1819; Henry David Thoreau, 1854

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



Re: Add 'backend' header arg to clojure code blocks

2022-10-09 Thread Chris Clark
Thank you for the great feedback! Here are some updated patches.

Attached are two patches: one for org mode, and a corresponding one for
worg.

On Sun, Oct 9, 2022 at 3:42 AM Ihor Radchenko  wrote:

> Chris Clark  writes:
>
> > This is my first attempt to contribute to org-mode; please let me know if
> > I'm doing something wrong.
>
> Thanks a lot! Contributions are always welcome.
>
> Please also add a mention and/or example to the ob-clojure documentation
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html
> (The source repository is https://git.sr.ht/~bzg/worg )
>
> Also, you need to add an etc/ORG-NEWS entry about the new header
> argument.
>
> And I have few minor comments on the patch itself.
>
> > From cc72dcac3075be76e3edcfee75c887272e48698c Mon Sep 17 00:00:00 2001
> > From: Chris Clark 
> > Date: Sat, 8 Oct 2022 05:41:20 -0400
> > Subject: [PATCH] ob-clojure.el: Add a 'backend' header arg to clojure
> code blocks
>^:backend
> > * ob-clojure.el (org-babel-header-args:clojure,
> > org-babel-execute:clojure): Add a 'backend' header arg that can
>^:backend
> > override the configured `org-babel-clojure-backend`.
>^'
> (by convention, we quote like `symbol' using `' pair).
>
>
> Also, unless you have FSF copyright assignment, we need you to add
> TINYCHANGE at the end of the commit message. See
> https://orgmode.org/worg/org-contribute.html#first-patch
>
> > +   (t (user-error "You need to customize
> org-babel-clojure-backend")
>
> While we are here, can as well quote `org-babel-clojure-backend'.
>
> Or may even add "or set `:backend' header argument".
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


0001-ob-clojure.el-Add-a-backend-header-arg-to-clojure-co.patch
Description: Binary data


0001-ob-doc-clojure.org-Add-example-of-backend-header-arg.patch
Description: Binary data


Re: The Org mode in the Org Git does not export

2022-10-09 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

> The patch is only working by accident because [...]

TIL!

> (I'd like this patches to be tested on real export first as it is
> touching on very basic export routines).

For what is worth, I have tried the patch.  With the patch, Org exports
my elaborate notebook as fast as without it (+/- 1 second) and the tests
pass on macOS and Emacs 29.  Just FYI.

Rudy
-- 
"Logic is a science of the necessary laws of thought, without which no
employment of the understanding and the reason takes place."
-- Immanuel Kant, 1785

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



Re: SQLite for contacts and relations to Org - Re: contact management in emacs

2022-10-09 Thread Quiliro Ordóñez
El 2022-10-09 05:40, Jean Louis escribió:

> But I can as well edit my contacts by using external tools and
> exchange information with other software.
> 
> Do you wish to share your contacts? That is easy, one can simple send
> the full file to somebody.
> 
> By followed the thought patterns described one shall understand that
> contacts may be separated from single mode (Org) and separated from
> single software (Emacs) and that it will not minimize or limit you but
> rather widen the capacities and usefulness for human.

This is a great summary about the use of database to hold information. 
But it requires experience configuring databases for end-users.  It
could work if the database was set up by someone else or if the fields
were easy to define by the end-user by some kind of interface.

On the other hand, there is a movement to use plain text for everything.
 I know you disagree.  But here is some information about accounting
this way: https://plaintextaccounting.org

I learned a lot of elisp by reading your long explanation about how to
construct a contact database directly on Emacs 29 without adding
anything else.  Thank you very much!



Re: Interest in an Org video meetup?

2022-10-09 Thread Jean Louis
* Ihor Radchenko  [2022-10-07 04:43]:
> Juan Manuel Macías  writes:
> 
> > Great idea. I would like to participate, even if it was just to listen
> > :-) But I'm afraid that these months I'm going to have horrible
> > schedules. Is it planned to record these meetings?
> 
> Even if there is a recording, where can we publish the recorded videos?

Publish on https://joinpeertube.org/ that is fully free server software.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Re: idea for capture anywhere in x

2022-10-09 Thread Jean Louis
* Samuel Wales  [2022-06-10 05:37]:
> with the org capture firefox extension broken, i recalled this old
> thread, thinking it might be a fix,  and i think i understand the
> issue.  so i thought i would summarize here in this one post.
> 
> i think i was not clear in this thread in a few places.  apologies for that.
> 
> 1.
> 
> [current need, urgent] i want to select text with mouse in firefox,
> then have plain text and url save to an org entry.
> 
> this would then replace the need for the firefox org-capture
> extension.

I have basic concept to capture X selection in file and get it in
Emacs. It is not really related to Org, one can capture X selection
and record it anyhow. There is no need for org-protocol this way.

File: ~/bin/capture-x-selection.sh

#!/usr/bin/bash
TEMP=/tmp/xselection.txt
xsel -o > $TEMP
emacsclient -e "(rcd-handle-x-selection)"

Settings in my IceWM window manager, in the file: ~/.icewm/keys:

key Ctrl+F9 /home/data1/protected/bin/rcd/capture-x-selection.sh

That means anywhere in X I press C-F9 and will invoke the function
'rcd-handle-x-selection

(defun rcd-handle-x-selection ()
  "Sample function to read X selection from file and switch to buffer."
  (raise-frame)
  (let* ((my-org-files '("~/myorg1.org" "~/myorg2.org"))
 (my-org-file (completing-read "Choose Org file: " my-org-files)))
(find-file my-org-file)
(goto-char (point-max))
(rcd-my-note)
(save-some-buffers t)))  

(define-skeleton rcd-my-note
"Fill template by using variables"
  nil
  "** " (skeleton-read "Heading: ") "\n\n"
  (skeleton-read "Describe this capture: ")
  (when (file-exists-p "/tmp/xselection.txt")
(with-temp-buffer
  (insert-file-contents "/tmp/xselection.txt")
  (buffer-string)))
  "\n\n")

I could as well connect it to org-protocol, but I ask myself why, as I
do not append stuff to Org files, I don't like feeling maltreated by
limitations of Org programs. 

Workflow:

Condition is to use Emacs server with emacsclient.

1. Mark anything in X like any selection;

2. Press your favorite key binding in the X manager like Ctrl-F9

3. Emacs appears and runs skeleton rcd-my-note which in this case does
   something similar like Org, but it is not related to Org
   really. One can as well make this way Markdown notes or any other
   types of notes by using Emacs.

Let us say this way for Asciidoc notes:
---

File: ~/bin/capture-x-selection.sh

#!/usr/bin/bash
TEMP=/tmp/xselection.txt
xsel -o > $TEMP
emacsclient -e "(rcd-handle-x-selection)"

Settings in my IceWM window manager, in the file: ~/.icewm/keys:

key Ctrl+F9 /home/data1/protected/bin/rcd/capture-x-selection.sh

(defun rcd-handle-x-selection ()
  "Sample function to read X selection from file and switch to buffer."
  (raise-frame)
  (let* ((my-files '("~/mynotes1.adoc" "~/mynotes2.adoc"))
 (my-file (completing-read "Choose Asciidoc file: " my-files)))
(find-file my-file)
(goto-char (point-max))
(rcd-my-note)
(save-some-buffers t)))

(define-skeleton rcd-my-note
"Fill template by using variables"
  nil
  "== " (skeleton-read "Heading: ") "\n\n"
  (skeleton-read "Describe this capture: ")
  (when (file-exists-p "/tmp/xselection.txt")
(with-temp-buffer
  (insert-file-contents "/tmp/xselection.txt")
  (buffer-string)))
  "\n\n")

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Re: [tip] Create and Insert a public Nextcloud/Owncloud link

2022-10-09 Thread Juan Manuel Macías
Max Nikulin writes:

>> Many times I need to create and share a public link to a file
>> in my local folder. In the Nextcloud forum I learned how it can be done
>> from the command line using curl,
> ..
>> │ (result-raw (shell-command-to-string
>> │  (concat "curl -u "
>> │  "\""
>> │  my-username
>> │  ":"
>> │  my-passwd
>> │  "\""
>
> Juan Manuel, your function is a nice proof of concept, but posting
> such code you are responsible for users who may try to use it verbatim
> having less experience with elisp.
>
> Use at least `shell-quote-argument' (though it docstring has a link to
> info "(elisp)Security Considerations"). Just adding quote characters
> is unsafe. You may avoid non-alphanumeric characters in passwords and
> file names for good reasons, but for other users a quote character may
> dramatically change the executed command.
>
> When TRAMP support is not necessary, arguments should be passed to
> external binary as a list without intermediate shell command. I know,
> Emacs does not have a convenience function with such calling
> convention similar to `shell-command-to-string'.
>
> I am almost sure that Emacs has a package to send HTTP POST requests
> directly from elisp. Unsure it has convenient enough API (reasonable
> default timeouts, etc.), but it should be safer for working with
> peculiar file names and passwords stuffed with characters having
> special meaning in shell. I admit that the code would be more verbose.
> It may save you time for recovering you system from damage caused by
> unexpected interpretation of a shell command.

Maxim, you are right that the use of shell-quote-argument is preferable
in cases like these to avoid unexpected problems with filenames,
passwords, and so on. I try to use it almost always. If I don't use it
more often, it's either because I'm lazy (because of my way of naming
the files, I don't expect this type of problems) or because I think it's
unnecessary, although not 100% free of danger[1], as in this case. I'm not
saying my behavior is exemplary, I'm just saying what I tend to do. I
should probably always use shell-quote-argument. In this case, the
affected part of my function would perhaps look better like this:

(shell-command-to-string
 (mapconcat #'shell-quote-argument
`("curl"
  "-u"
  ,(format
"%s:%s"
my-user
my-password)
  "-H"
  "OCS-APIRequest:true"
  "-X"
  "POST"
  ,(format 
"%s/ocs/v1.php/apps/files_sharing/api/v1/shares"
nextcloud-url)
  "-d"
  ,(format
"path=%s/%s"
nextcloud-public-folder-name
file)
  "-d"
  "shareType=3"
  "-d"
  "permissions=1")
" "))

[1] I think that a problem in this context would not go beyond the fact
that the function simply did not work as expected.

Perhaps it would have been better to use call-process-shell-command,
instead of shell-command-to-string, and extract the resulting string
from the output buffer.

On the other hand, I agree with you that whenever possible it is better
to use an Elisp solution than a shell command.

Best regards,

Juan Manuel 

-- 
--
--
Juan Manuel Macías 

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com

https://gnutas.juanmanuelmacias.com





Re: Org and Hyperbole

2022-10-09 Thread Jean Louis
* Robert Weiner  [2022-10-08 23:55]:
> Task management is a whole area separate from note taking.  This was
> something I was interested in many years ago but have not been able
> to publish a system to implement my ideas therein.  Since people
> generally seem to be happy with Org's todo and agenda features, we
> expect to just interact with those from Hyperbole.

PLEASE: Give us more information about your ideas and your system.

For me Org is only one of many lightweight markup languages,
definitely now the easiest or friendly one IMHO. Asciidoc is way
easier and asciidoctor implementation offers better higher level and
deterministic functions for users to create documents.

AsciiDoc Syntax Quick Reference | Asciidoctor Docs:
https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/

I get better output, easier workflow with Asciidoctor and PDF rather
than with Org. Sometimes I may use txt2tags and generate asciidoc. I
get less problems with it, rather than with LaTeX.

And I don't think that Org is proper for task management. Org is
markup for me, and that is where I keep it. 

Tasks must be modular and separate from text files, external and
editable by many means, and accessible by multiple people from
multiple parts of the world. That is what various ERP, CRM systems
already do for people.

Org group of users are limited. There is no need to think that Org
users are leading in the subject of task management, as they are
not. They are troubled by too many problems, too many errors, and
constant inability to actually do what they want.

Just compare it to Cherrytree or Leo editor:

Cherrytree - hierarchical note taking application with rich text and syntax 
highlighting:
https://www.giuspen.com/cherrytree/

Leo programmable editor:
http://leoeditor.com/

In Org we are enthusiastic.

We are many unrealistic, and idealistic. That is not objective.

With Org one can't assume that productivity is granted.

Productivity comes from person skilled in handling its own tasks, not
from the tool.

Like you with Hyrolo, I guess you are using it very swift and smooth,
but I do not see anybody on mailing list talking about it. Great tool
with too few users. Org has too many users and also too many problems. 

I have no problems adding contacts to Hyrolo and searching, deleting,
finding phone numbers, it works swift. Not that I use it, but without
access to my database, on some remote computers in forest, that is
what I like to use.

I can't say that I am happy with Org agenda, far from that, in fact I
never use it because I was not happy. So I made my own, and it is
s much faster than Org agenda, because it gets it from users.

So please GIVE us the list of your ideas, as it may be useful.

> But for notes, yes, one needs to capture them quickly and then get
> back to your former context.  Later on you can process them more
> fully.

"Capturing" notes like some mouses or animals, I don't know if that
word is appropriate. Do you people in English speaking area in world
without Emacs really use the word "capturing".

Org has promoted features like swift templates on how to insert new
information into text files.

Function skeleton-insert is since 1993 there in Emacs as one of ways
how to insert in any mode new template based information. It was just
not as promoted as Org mode.

By promoting "capturing" ideas to be somehow connected exclusively to
Org mode we lure people rather into pretty difficult environment. 

This way we just limit people to think that templates and quicker and
streamlined note taking can't be used in other modes or text files.

What a silly situation.

And when I just look on the interface of M-x org-capture, I can't even
believe people use that static what, Emacs-blocking screen. I can't
even switch to that buffer. And I do not need tips "how to do it" as a
follow up to this paragraph. 

I use org-protocol as one of ways to enter information to Emacs,
because I use browser extension for Org protocol. 

But I never record anything into Org files directly.

Org protocol may is described as:
Intercept Calls from Emacsclient to Trigger Custom Actions

Great idea, but why it should be limited to Org?

So I use it to enter information straight into database by using
Firefox extension: https://github.com/vifon/org-protocol-for-firefox

> Although I see the great utility in having capabilities on mobile
> devices, I find most apps way underpowered for constant use.

I can totally agree with that statement. 

One good application on mobile devices that I use is simple text
editor. That is where I enter notes. Then I connect mobile device to
Emacs and move those notes into the database.

> As Emacs becomes more usable on mobile devices, we can add more
> mobile-friendly features to Hyperbole.

Emacs works well in Termux in Android, Lineage OS, Replicant
systems. Problem is not in Emacs which already works well in console
mode. 

Problem is with the keyboard. Mobile devices with virtual 

SQLite for contacts and relations to Org - Re: contact management in emacs

2022-10-09 Thread Jean Louis
* Sébastien Rey-Coyrehourcq  
[2022-09-09 19:12]:
> Hi,
> 
> After some search today on the web, like Alan i try to compare all
> possibility to manage my contact + mail using emacs, mu4e, and org.

I will describe you how to manage contacts with Emacs in the reverse
example reverse of what org-contacts tries to do for you.

Org contacts try to keep people in Org file. Emacs 29 has a built-in
SQLite database which allows every Emacs user to keep information in
ordered, structured manner in the relational database.

For people who do not use latest development Emacs version, there are
SQLite Emacs packages that allow immediate usage of file based
single-user access database, see https://www.sqlite.org

In Emacs 29, here is how I create the SQLite database, or open the existing one:

(setq my-db (sqlite-open "~/my-people"))

This is database handle:

my-db ⇒ #

This is how to create a table of `people' in the database. The
structure of the table `people' is thus pretty much individual,
one can record any kind of entries and be sure if the the entry
is there or not. It does not allow vague guessing with text files
like in Org or Hyrolo in Hyperbole.

This is example table, one can build upon it. This one contains emails only.

(sqlite-execute my-db "CREATE TABLE people1 (people_id INTEGER PRIMARY KEY,
   people_firstname TEXT,
   people_middlenames TEXT,
   people_name TEXT NOT NULL DEFAULT 
'>>>UNKNOWN<<<',
   people_email TEXT,
   people_description TEXT)")

This is how to get all queries from the table:

(sqlite-select my-db "SELECT * FROM people") ⇒ nil

This is how to insert new entry programmatically:

(sqlite-execute my-db "INSERT INTO people (people_firstname, people_name, 
people_email)
  VALUES (?, ?, ?)
   RETURNING people_id" 
'("Robert" "Weiner" "r...@gnu.org"))

Get information back from database, programmatically. Do with information what 
you wish.

(sqlite-select my-db "SELECT * FROM people") ⇒ ((1 "Robert" nil "Weiner" 
"r...@gnu.org" nil) (2 "Robert" nil "Weiner" "r...@gnu.org" nil))

Delete everything in the database. 

(sqlite-execute my-db "DELETE FROM people") ⇒ 0

;; Backup?

Backup database by simple copy of the file "~/my-people"

(sqlite-select my-db "SELECT * FROM people") ⇒ nil

Make nicer function to add new people:

(defun my-people-add ()
  (interactive)
  (let* ((first-name (read-string "First name: "))
 (middle-names (read-string "Middles names: "))
 (name-or-last-name (let ((result))
  (while (not result)
(setq result (apply 'read-string '("Last name: 
"
  result))
 (email (read-string "Email: "))
 (description (read-string "Description: ")))
(sqlite-execute my-db "INSERT INTO people (people_firstname, 
people_middlenames, people_name, people_email, people_description)
   VALUES (?, ?, ?, ?, ?) RETURNING people_id" 
(list first-name middle-names name-or-last-name 
description

Run the function by using (my-people-add) or M-x my-people-add

Verify that person was added:

(sqlite-select my-db "SELECT * FROM people") ⇒ ((1 "Joe" "" "Doe" nil nil))

Entries are returned as list, get the first list entry:

(caar (sqlite-select my-db "SELECT people_id FROM people WHERE people_id = 1")) 
⇒ 1

My database structure is ALWAYS as so that for TABLE I always
have primary key named TABLE_id. That principle allows to
simplify things.

Then I can make generic function to fetch from database DB, from
TABLE and COLUMN by using ID:

(defun sqlite-db-get-entry (table column id db)
  "Return value for the TABLE, COLUMN, ID from the database PG."
  (let* ((sql (format "SELECT %s FROM %s WHERE %s_id = %s" column table table 
id))
 (value (caar (sqlite-select db sql
value))

(sqlite-db-get-entry "people" "people_id" 1 my-db) ⇒ 1

(sqlite-db-get-entry "people" "people_name" 1 my-db) ⇒ "Doe"

(sqlite-db-get-entry "people" "people_email" 1 my-db) ⇒ "j...@example.com"

Make it exportable to Org:

(defun my-people-to-org-single (id)
  (let* ((first-name (sqlite-db-get-entry "people" "people_firstname" id my-db))
 (middle-names (sqlite-db-get-entry "people" "people_middlenames" id 
my-db))
 (last-name (sqlite-db-get-entry "people" "people_lastname" id my-db))
 (email (sqlite-db-get-entry "people" "people_email" id my-db))
 (description (sqlite-db-get-entry "people" "people_description" id 
my-db))
 (heading (list first-name middle-names last-name))
 (heading (mapcar (lambda (e) (cond ((seq-empty-p e) nil)
(t e)))
  heading))
 

Re: Org and Hyperbole

2022-10-09 Thread Jean Louis
* Robert Weiner  [2022-10-09 00:06]:
> We had object-based, multi-media files with Engelbart's NLS/Augment
> system.  We had relational databases way before the web.
> 
> But here we are in 2022 with enormous personal computing power and for
> interactive editing, everyone is using and transferring stream-based files
> of characters that are then interpreted at the delivery site.

Alright, though I do not see relation from transferring files to
databases. Just any digital information may be transferred to delivery
sites by many different means. I understand that two paragraphs are
related and I inject my thoughts in maybe not proper place.

> There are many reasons for this including limits in many
> organizations of the file types that may be transferred through
> common protocols and the difficulty of maintaining relational
> database or structured file type schemas across time.

I can't see how relational database is more difficult to maintain then
for example Emacs itself. Emacs is master of difficulties for computer
user. For example I have not touched configuration files for
PostgreSQL since years, if not decades. I start wondering why.

Backing up relational database is so much easier than backing up
plethora of apparently randomly dispersed files. It is just single
command line or click on some graphical interface. Just do
`pg_dumpall'. 

Let us say I wish to backup all the information that Hyperbole created
in various directories, on computer, is there such option? Missing.

We can't compare apples and eggs, but I have to give you for thinking. 

Hyperbole buttons in their files are underlying structure, user need
not know anything about it. User has interface and uses higher level
interface functions.

But let us analyze it little that way. If you have a Hyrolo file, what
you can do with it? You can send it to somebody? But that somebody
need to use what? Emacs or any editor to work with contacts.

Today users use mobile devices, they exchange structured contact
information by using vCard format, and users of many mobile devices can
accept contact information from other operating systems and import in
their phones as one or multiple without problems.

Hyrolo can't transfer contact information. And why? Because it is
written more or less freely in the text file and it is not structured. 

We don't speak of maintaining Hyrolo -- that is not easy task really,
it needs GNU Emasc which has so many dependencies, then it needs
Hyperbole, then user can handle Hyrolo. What I want to say we shall
not think of complexities, issues of installation and underlying
management by software are not concern for user. User shall be able to
click and get application. That is what 50% of people using computers
know, they have mobile devices, they click and get it. No thinking
there, but I don't say it advances society that way.

In any relational databases there are views and various exports and
unlimited variations how final data may be presented to user.

Let us say contacts, that may be transferred by using vCard
mechanism. Various other formats are possible.

Let us say I need to exchange tasks, that is what I do all the
time. Nobody at delivery site need know that I have underlying
PostgreSQL database, that is not their business. They will get the
PDF, image, video, text, WWW link, ZIP, and similar. Delivery site
will get it delivered in the format how they can read it.

If delivery site needs full database, it is just matter of two
commands pg_dumpall and pg_restore and even those commands may be
automated.

Full database is similar to file system. One does not share file
system, one shares database entries. And how such entries are shared
depends of the programmer and user. Thousands of entries from my
database are shared through web server and as HTML documents. Program
generates PDF files and text, and emails for plans, programs and
projects, and such are shared by any type of communication channel.

> Simple tends to win out over more powerful because few people want to bear
> the cost of continual training to raise all of the newcomers to a level of
> performance that they cannot teach themselves.

Today people use structured information without knowing. Contacts on
phone are structured. Even notes' applications on mobile devices are
pretty much structured, usually stored in SQLited databases and
exported in various ways. Much of information in any libraries, online
databases, and personal computers is stored in such databases.

> I like your model, Jean, and am a fan of such things but I am also
> pragmatic and thus focus on building things that I think people will
> consume within a given environment.

In the Emacs environment we consume anything that is useful, it is
wide open. Emacs 29 comes with SQLite built-in. That is advance,
progress. 

We can progress all with databases.

>  In Hyperbole's case, it is base Emacs and nothing more.

Emacs alone has many ways to store ordered and structured

Re: How do you manage complex project with Org-mode

2022-10-09 Thread Payas Relekar
Jean Louis  writes:

> * Sébastien Gendre  [2022-03-01 05:35]:
>> And I don't know how to manage this kind of projects with Org-mode.
>
> Just use pen and paper notebook. Carry it with you.

While nearly unparalleled on the input experience, pen-and-paper is
terrible at data retrieval.

--



Re: Org and Hyperbole

2022-10-09 Thread Payas Relekar
Robert Weiner  writes:

> Good to hear.  Maybe you can provide early feedback when it hits the
> Hyperbole pre-release in the elpa-devel package archive (pre-releases of
> Hyperbole packaged up from the git master branch tip).

I'll be happy to! Unfortunately I'm not able to always follow this list,
so if possible, please let me know when you have something I can try
out.

> Yes.  It will search over many files and even recursive directories of
> files.  Org-roam has a good model for rapid searching, so we'll have to
> consider something similar.  It might not be in the first release but will
> come by the second major release.

Thanks! I've found that without instant/near-instant search the chain of
thought breaks easily (Thanks, ADHD!), so this one is quite important.

> Each note will have an optional datetime stamp which will be on by
> default.  If you care to make one note per day, you can do that.

Sounds good!

> Yes, that is the reason for desiring some kind of database-backed indexing.

Yes, but from your other email it appears this one is not going to
happen due to previous Emacs versions not having built-in sqlite. Have
you thought of any alternate way for achieving same performance without
any built-in database?

> Yes.  The idea is that you initially capture notes into a single default
> file and then can quickly refile them as needed.

While single default file sounds good, individual daily files are better
IME. Because the single file inevitably becomes too large, unwieldy and
generally not the best place to go through quickly.

>> In short, the framework takes care of organization and makes retrieval
>> easy and all I have to worry about is the content.
>>
>
> Yes, I think we typically do this throughout Hyperbole, as it is very
> important to us.

Thanks! Hyperbole has been really good experience so far, because of
practically zero config and batteries included approach. Better
integration with stock Emacs stuff like Org, Gnus and Dired is always
welcome.

Thanks a lot for working on Hyperbole and being responsive!

--



Re: How do you manage complex project with Org-mode

2022-10-09 Thread Christian Moe


I nominate this as the ultimate advice on how to get things done with
Org-mode :-)

Jean Louis writes:

> * Sébastien Gendre  [2022-03-01 05:35]:
>> And I don't know how to manage this kind of projects with Org-mode.
>
> Just use pen and paper notebook. Carry it with you.



[PATCH v2] org-macs.el: Do not compare wall time and file modification time

2022-10-09 Thread Max Nikulin

On 02/10/2022 10:49, Ihor Radchenko wrote:

Max Nikulin writes:


From: Max Nikulin
Date: Fri, 6 May 2022 23:34:52 +0700
Subject: [PATCH] org-macs.el: Do not compare wall time and file modification
  time


Max, the patch does not currently apply onto main. Can you please update
it?


When prepared, it was intended for the bugfix branch to avoid problems 
in the case of Emacs-29 and Org as an ELPA package. Changes in the main 
branch since that time caused conflicts: Kyle backported Paul's fix from 
Emacs to Org, you added `set-file-time' to `org-babel-load-file'.
From cb03cdf1e7e727d596526690435c86fa5299f1ee Mon Sep 17 00:00:00 2001
In-Reply-To: <87sfk628ca.fsf@localhost>
References: <87sfk628ca.fsf@localhost>
From: Max Nikulin 
Date: Fri, 6 May 2022 23:34:52 +0700
Subject: [PATCH v2] org-macs.el: Do not compare wall time and file
 modification time
To: emacs-orgmode@gnu.org

* lisp/org-macs.el (org-file-newer-than-p): Recommend passing file
modification time instead of wall time to avoid truncation of timestamp
precision for the sake of filesystems with coarse time resolution.
(org-compile-file): Store file modification time instead of system clock
for later comparison by `org-file-newer-than-p'.
* lisp/org.el (org-babel-load-file): Use `file-newer-than-file-p'
instead of `org-file-newer-than-p' since the former is more suitable
for target-prerequisite relation in the case of equal timestamps.
Improve error reporting when source file does not exist.
Update timestamp after tangling of an org file, not before it.

This is assumed to be a better fix of the problem with change of time
representation in Emacs-29. The problem was reported by Mark Barton
 in
https://list.orgmode.org/bf5b9308-3fef-4dc6-98c9-bff36f19d...@gmail.com
Paul Eggert  committed another variant to Emacs
as 3abb3681b5.  It was ported to Org as commit 56ba22b9df several months
later.

Unchanged timestamp of a file means failure of `org-compile-file' but in
`org-babel-load-file' the target may be considered as up to date if its
timestamp is equal to the one for the prerequisite.
So `org-file-newer-than-p' is not suitable for both cases.  The
difference matters for filesystems with coarse timestamp resolution, for
example HFS+.

Earlier call of `org-babel-load-file' for a non-existing .org file
caused "Bad bounding indices: 0, 2" error.

Update file timestamp (introduced by the commit 1525a5a64e)
after tangling of the file.  Change caused by conflict resolution during
rebasing of the initial version of the patch.  See
https://list.orgmode.org/t75efi$9pv$1...@ciao.gmane.io for an argument
in support of such change.
---
 lisp/org-macs.el | 30 ++
 lisp/org.el  | 22 +++---
 2 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 2666733d0..c858f3695 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -312,17 +312,23 @@ If EXCLUDE-TMP is non-nil, ignore temporary buffers."
 ;;; File
 
 (defun org-file-newer-than-p (file time)
-  "Non-nil if FILE is newer than TIME.
-FILE is a filename, as a string, TIME is a Lisp time value, as
-returned by, e.g., `current-time'."
-  (and (file-exists-p file)
-   ;; Only compare times up to whole seconds as some file-systems
-   ;; (e.g. HFS+) do not retain any finer granularity.  As
-   ;; a consequence, make sure we return non-nil when the two
-   ;; times are equal.
-   (not (time-less-p (org-time-convert-to-integer
-			  (nth 5 (file-attributes file)))
-			 (org-time-convert-to-integer time)
+  "Non-nil if FILE modification time is greater than TIME.
+TIME should be obtained earlier for the same FILE name using
+
+  \(file-attribute-modification-time (file-attributes file))
+
+If TIME is nil (file did not exist) then any existing FILE
+is considered as a newer one.  Some file systems have coarse
+timestamp resolution, for example 1 second on HFS+ or 2 seconds on FAT,
+so nil may be returned when file is updated twice within a short period
+of time.  File timestamp and system clock `current-time' may have
+different resolution, so attempts to compare them may give unexpected
+results.
+
+Consider `file-newer-than-file-p' to check up to date state
+in target-prerequisite files relation."
+  (let ((mtime (file-attribute-modification-time (file-attributes file
+(and mtime (or (not time) (time-less-p time mtime)
 
 (defun org-compile-file (source process ext  err-msg log-buf spec)
   "Compile a SOURCE file using PROCESS.
@@ -356,7 +362,7 @@ it for output."
 	 (full-name (file-truename source))
 	 (out-dir (or (file-name-directory source) "./"))
 	 (output (expand-file-name (concat base-name "." ext) out-dir))
-	 (time (current-time))
+	 (time (file-attribute-modification-time (file-attributes output)))
 	 (err-msg (if (stringp err-msg) (concat ".  " err-msg) "")))
 (save-window-excursion
   (pcase process
diff --git a/lisp/org.el b/lisp/org.el
index 

Re: Propertize some navigational keybindings

2022-10-09 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> Ihor Radchenko  writes:
>
>> I think that the most thorough way to add this feature is following
>> what `help--key-description-fontified' does (we should not call this
>> internal function though): [...]
>
> How about the attached patch?

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


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



Re: Propertize some navigational keybindings

2022-10-09 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> Ihor Radchenko  writes:
>
>> I think that the most thorough way to add this feature is following
>> what `help--key-description-fontified' does (we should not call this
>> internal function though): [...]
>
> How about the attached patch?

Thanks!
Applied onto main.
https://orgmode.org/worg/org-contribute.html#first-patch


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



Re: Add 'backend' header arg to clojure code blocks

2022-10-09 Thread Ihor Radchenko
Chris Clark  writes:

> This is my first attempt to contribute to org-mode; please let me know if
> I'm doing something wrong.

Thanks a lot! Contributions are always welcome.

Please also add a mention and/or example to the ob-clojure documentation
https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html
(The source repository is https://git.sr.ht/~bzg/worg )

Also, you need to add an etc/ORG-NEWS entry about the new header
argument.

And I have few minor comments on the patch itself.

> From cc72dcac3075be76e3edcfee75c887272e48698c Mon Sep 17 00:00:00 2001
> From: Chris Clark 
> Date: Sat, 8 Oct 2022 05:41:20 -0400
> Subject: [PATCH] ob-clojure.el: Add a 'backend' header arg to clojure code 
> blocks
   ^:backend
> * ob-clojure.el (org-babel-header-args:clojure,
> org-babel-execute:clojure): Add a 'backend' header arg that can
   ^:backend
> override the configured `org-babel-clojure-backend`.
   ^'
(by convention, we quote like `symbol' using `' pair).  
 

Also, unless you have FSF copyright assignment, we need you to add
TINYCHANGE at the end of the commit message. See
https://orgmode.org/worg/org-contribute.html#first-patch

> +   (t (user-error "You need to customize 
> org-babel-clojure-backend")

While we are here, can as well quote `org-babel-clojure-backend'.

Or may even add "or set `:backend' header argument".

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



Re: [PATCH 2-v4] New: auto display inline images under subtree when `org-cycle'.

2022-10-09 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

>> I think that the best we can do in this situation is mocking
>> `create-image' in batch mode to return non-nil using `cl-letf'.
>
> I checked the `create-image' in image.el source code, don't know how to
> mocking this. I have no experience and idea about this. I also searched
> org testing. Have not found similar situations.
>
> If you have idea how to write this test, I suggest pass this word to
> you. What do you think?

I imagine something like

;; Mock `create-image' to work noninteractively.
(cl-letf (((symbol-function 'create-image)
   (lambda ( _)
 `(image :type "dummy" :data "dummy"
  )

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



Re: [PATCH] Re: [BUG] org-agenda-remove-restriction-lock does not remove file lock [9.5.2 (release_9.5.2-17-gea6b74 @ /nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-20220225.0/share/emacs/29.0.

2022-10-09 Thread Liu Hui

Hi Ihor,

> Ihor Radchenko  writes:
>
> > Visuwesh  writes:
> >
> >> C-u C-c C-x < followed by C-c C-x > does not remove the file restriction
> >> lock.
> >>
> >> `org-agenda-remove-restriction-lock' checks for non-nil value of
> >> `org-agenda-restriction' but `org-agenda-set-restriction-lock' explicitly
> >> sets it to nil when TYPE is 'file.  Setting `org-agenda-restriction' to
> >> a dummy value like 'dummy gets the job done.
> >
> > Confirmed.
> >
> > The fix is attached.
> > Setting org-agenda-restriction to non-nil appears to be risky since
> > org-agenda-set-restriction-lock explicitly sets it to nil. So, I use
> > different approach.
>
> Fixed.
> Applied onto main via df0e96ba4.

File restriction can be also temporarily set by pressing '<' in the
agenda dispatcher, e.g. pressing 'C-c a < a' in an org-mode file.
`org-agenda-remove-restriction-lock' still cannot remove the temporary
file restriction with the fix.

Setting `org-agenda-restrict' to a non-nil value is a straightforward
way to fixing both cases. The variable is only tested in several
places and I don't find any problem with the change. Therefore I
suggest the attached patch, where the value of `org-agenda-restrict'
is changed from nil to t during temporary and extended file
restriction.

>From f4e46051fbb13adadbbafeebab343383e1bca35a Mon Sep 17 00:00:00 2001
From: Liu Hui 
Date: Sun, 9 Oct 2022 15:00:50 +0800
Subject: [PATCH] org-agenda: Make sure file restriction can be removed

* lisp/org-agenda.el: (org-agenda):
(org-agenda-set-restriction-lock): Set `org-agenda-restrict' non-nil
during both temporary and extended file restriction.
(org-agenda-remove-restriction-lock): Revert commit df0e96ba4.
* testing/lisp/test-org-agenda.el (test-org-agenda/file-restriction):
Add a test.
---
 lisp/org-agenda.el  | 19 ---
 testing/lisp/test-org-agenda.el | 28 
 2 files changed, 36 insertions(+), 11 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 86ed6a5f5..a4f766cd9 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2962,12 +2962,12 @@ Pressing `<' twice means to restrict to the current subtree or region
 	(move-marker org-agenda-restrict-begin (point))
 	(move-marker org-agenda-restrict-end
 			 (progn (org-end-of-subtree t)
-	 ((and (eq restriction 'buffer)
-	   (or (< 1 (point-min))
-		   (< (point-max) (1+ (buffer-size)
-	  (setq org-agenda-restrict (current-buffer))
-	  (move-marker org-agenda-restrict-begin (point-min))
-	  (move-marker org-agenda-restrict-end (point-max)
+	 ((eq restriction 'buffer)
+  (if (not (buffer-narrowed-p))
+  (setq org-agenda-restrict t)
+(setq org-agenda-restrict (current-buffer))
+	(move-marker org-agenda-restrict-begin (point-min))
+	(move-marker org-agenda-restrict-end (point-max))

   ;; For example the todo list should not need it (but does...)
   (cond
@@ -7958,7 +7958,7 @@ subtree."
 	  (message "Locking agenda restriction to subtree"))
   (put 'org-agenda-files 'org-restrict
 	   (list (buffer-file-name (buffer-base-buffer
-  (setq org-agenda-restrict nil)
+  (setq org-agenda-restrict t)
   (setq org-agenda-overriding-restriction 'file)
   (move-marker org-agenda-restrict-begin nil)
   (move-marker org-agenda-restrict-end nil)
@@ -7969,14 +7969,11 @@ subtree."
 (defun org-agenda-remove-restriction-lock ( noupdate)
   "Remove agenda restriction lock."
   (interactive "P")
-  (if (not (or org-agenda-restrict org-agenda-overriding-restriction))
+  (if (not org-agenda-restrict)
   (message "No agenda restriction to remove.")
 (delete-overlay org-agenda-restriction-lock-overlay)
 (delete-overlay org-speedbar-restriction-lock-overlay)
 (setq org-agenda-overriding-restriction nil)
-(unless org-agenda-keep-restricted-file-list
-  ;; There is a request to keep the file list in place
-  (put 'org-agenda-files 'org-restrict nil))
 (setq org-agenda-restrict nil)
 (put 'org-agenda-files 'org-restrict nil)
 (move-marker org-agenda-restrict-begin nil)
diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el
index 256f701df..bd96163e9 100644
--- a/testing/lisp/test-org-agenda.el
+++ b/testing/lisp/test-org-agenda.el
@@ -255,6 +255,34 @@ See https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com;
   (get-text-property (point) 'day
 (org-test-agenda--kill-all-agendas)))

+(ert-deftest test-org-agenda/file-restriction ()
+  "Test file restriction for org agenda."
+  (org-test-with-temp-text-in-file "* TODO Foo"
+(org-agenda-set-restriction-lock t)
+(org-agenda nil "t")
+(should (search-forward "Foo"))
+(should (org-agenda-files))
+(should-not (org-agenda-files t))
+(org-agenda-remove-restriction-lock)
+(goto-char (point-min))
+(should-not (search-forward "Foo" nil t))
+(should-not (org-agenda-files)))
+  

Re: [PATCH] Re: org-contacts: Dead link at https://orgmode.org/worg/org-contrib/index.html

2022-10-09 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

> From 1521f4e27360d536197ee0ac524a641aad02822f Mon Sep 17 00:00:00 2001
> From: stardiviner 
> Date: Sat, 8 Oct 2022 20:40:34 +0800
> Subject: [PATCH] Fix dead link of org-contacts

Thanks!

>  org-contrib/org-contacts.org | 30 ++

Could you please use the standard WORG file template described in
https://orgmode.org/worg/worg-editing.html?

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



Re: [PATCH] LSP support in org-src buffers

2022-10-09 Thread Ihor Radchenko
Karthik Chikmagalur  writes:

> I've added limited support for LSP via Eglot in org-src-mode buffers.  I was 
> intending to publish it as a package but it was suggested to me that it could 
> live as part of Org instead, especially now that Eglot is intended to be part 
> of the upcoming Emacs release.  Here are some details:
> ...
> It allows you to run Eglot in org-src buffers opened with org-edit-special 
> (C-c '), giving you context-aware completion, linting, code actions etc.
> ...
> The main problem with reconciling org-src-mode and Language Server (LS) 
> support is that the LSP requires and expects files, not buffers.  By default, 
> org-src buffers are not associated with files.  Even if one were to associate 
> an org-src-mode buffer with a file, set the correct default-directory for a 
> project and start Eglot, it would only contain the small chunk of code from 
> the current code block.  The LS cannot access enough code to form a useful 
> picture of the project.

Thanks for your interest in contributing to Org core!

Transparent code editing in org-src buffers is certainly a feature that
is requested by many. Starting from people complaining about flycheck
giving nonsense errors in org-src buffers extending to any other serious
development work that relies on the existing project development
toolchains.

This is not limited to Eglot support. M-x compile, eglot, project.el,
xrefs, and similar tools all assume that current code buffer is
associated with a real file in a real project folder, possibly
containing all kinds of hints like .gitignore, .dir-locals.el, etc.

> org-src-context-mode reuses the tangling machinery to populate an org-src 
> buffer with code from all blocks associated with the current tangle file, and 
> associates it with a temporary file.  This way, the LS has a better picture 
> -- if still limited to a single file -- of the project.
>
> org-src-context-mode then checks if there's an appropriate Eglot LSP 
> connection active, and reconnects to it.
>
> Only the contents of the current code block are editable.  The other blocks 
> are marked read-only and (by default) only visible by widening the buffer.  
> No actual tangling is done -- the default-directory of the org file is not 
> touched at all.

This sounds a bit fragile and full of caveats.

You already implemented a way to associate the org-edit-src buffer with
the fully tangled code. Then, why not make it simple and do the real
tangling first and then make org-edit-src work directly with a real
file buffer associated with the tangled file?

All the tools, including Eglot will then work naturally and as intended.

The only tricky problem I am seeing with your approach is dealing with
noweb references. Care should be taken about editing code blocks
containing noweb.

> (v) org-src-context-mode does some pseudo-tangling -- this is required to 
> specify what constitutes a "file" for the LS to parse. This adds a 
> performance penalty to org-edit-src-code that can be noticeable if you have 
> many (100+?) code blocks with the same tangle file as the current block.

Our to-be-released main branch does tangling orders of magnitude faster.
For example, my config.org with 660 src blocks tangles within 1.3 sec.

This can be made even faster by extra caching if there is a real demand
for super-fast tangling.

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



Re: [Feature proposal] Add :description function to org-link-parameters

2022-10-09 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Hi,
>
> Wondering if anyone is interested in adding a new org-link property to
> customise generating the link description.
>
> For now, there is global org-link-make-description-function, which is
> shared among all the link types. If would be more convenient if the
> description function can be set independently for different link types.
>
> I propose to use :description property in org-link-parameters. A sample
> implementation working with current org version is below:

For record, this feature has been implemented in
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=e3a05d09b7398b46e8ef724ae7609eeb8a35346e

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



Re: The Org mode in the Org Git does not export

2022-10-09 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

>>> (1) re-opening the file after export always re-opens it, and
>>
>> I am not sure how to test this part.
>
> How about the attached patch?
>
> It mirrors the manual steps (find-file, export, kill-buffer, find-file),
> except it calls just the 'org-export-copy-buffer' procedure instead of
> exporting to HTML.  The test fails without your fix and passes with it.

The test in the patch is erroneous. `org-export-copy-buffer', unless it
kills the generated buffer, does nothing about `buffer-file-name' local
variable.  The patch is only working by accident because `find-file'
opens the first buffer with matching `buffer-file-name'. If there are
multiple such buffers, the return value depends on their order.

I have updated `org-export-with-buffer-copy' macro to take care about
this `buffer-file-name' issue uniformly without a need to put
workarounds into every caller. I have also updated your patch using a
more appropriate testing assertions. It now uses the updated macro.

See the attached patches.
(I'd like this patches to be tested on real export first as it is touching
on very basic export routines).

>From e8e4065da6e166e9859e14c95558e385d320dcbe Mon Sep 17 00:00:00 2001
Message-Id: 
From: Ihor Radchenko 
Date: Sun, 9 Oct 2022 14:16:41 +0800
Subject: [PATCH 1/2] org-export-with-buffer-copy: Allow safe reusable buffer
 copy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/ox.el (org-export--generate-copy-script):
(org-export-copy-buffer):  Accept cl-style key arguments.
* lisp/ox.el (org-export-with-buffer-copy): Allow optional cl-style
key arguments for fine-grained control on what to copy from the target
buffer and which buffer to use as a target.  Do not kill the target
buffer upon finished, when the target is provided.  Make sure that
remaining buffer copy does not preserve `buffer-file-name' from the
original buffer and that it never overwrites the file associated with
the original buffer.
* lisp/ox-html.el (org-html-format-latex): Use the new version of
`org-export-with-buffer-copy' instead of managing edge cases by
itself.

Reported-by: Rudolf Adamkovič 
Link: https://orgmode.org/list/87zge8j5iu.fsf@localhost
---
 lisp/ox-html.el | 27 +---
 lisp/ox.el  | 82 ++---
 2 files changed, 59 insertions(+), 50 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 3f55be2ee..cad06aebf 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2879,25 +2879,14 @@ (defun org-html-format-latex (latex-frag processing-type info)
 	;; temporary buffer so that dvipng/imagemagick can properly
 	;; turn the fragment into an image.
 	(setq latex-frag (concat latex-header latex-frag
-(with-current-buffer
-(org-export-copy-buffer
- (get-buffer-create " *Org HTML Export LaTeX*")
- 'drop-visible 'drop-narrowing 'drop-contents)
-  (erase-buffer)
-  (insert latex-frag)
-  (org-format-latex cache-relpath nil nil cache-dir nil
-		"Creating LaTeX Image..." nil processing-type)
-  ;; Present save dialogue to be shown for this buffer and prevent
-  ;; Emacs to jump into this buffer when opening
-  ;; `buffer-file-name' file.  We need this because
-  ;; `org-export-copy-buffer' copies `buffer-file-name' local
-  ;; variable thus making Emacs think that the buffer copy is
-  ;; associated with file.  Note that despite `buffer-file-name',
-  ;; `org-export-copy-buffer' arranges saving to not perform
-  ;; actual writing onto the disk.
-  (setq buffer-file-name nil)
-  (restore-buffer-modified-p nil)
-  (buffer-string
+(org-export-with-buffer-copy
+ :to-buffer (get-buffer-create " *Org HTML Export LaTeX*")
+ :drop-visibility t :drop-narrowing t :drop-contents t
+ (erase-buffer)
+ (insert latex-frag)
+ (org-format-latex cache-relpath nil nil cache-dir nil
+		   "Creating LaTeX Image..." nil processing-type)
+ (buffer-string
 
 (defun org-html--wrap-latex-environment (contents _  caption label)
   "Wrap CONTENTS string within appropriate environment for equations.
diff --git a/lisp/ox.el b/lisp/ox.el
index e059983fb..69a95ffe5 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -2544,9 +2544,9 @@ ;;; Core functions
 ;; a default template (or a back-end specific template) at point or in
 ;; current subtree.
 
-(defun org-export-copy-buffer ( buffer drop-visibility
- drop-narrowing drop-contents
- drop-locals)
+(cl-defun org-export-copy-buffer ( to-buffer drop-visibility
+   drop-narrowing drop-contents
+   drop-locals)
   "Return a copy of the current buffer.
 The copy preserves Org buffer-local variables, visibility and
 narrowing.
@@ -2561,61 +2561,81 @@ (defun org-export-copy-buffer ( buffer drop-visibility
 Emacs