Re: emojis in tags?

2023-02-09 Thread Jean Louis
* Robert Nikander  [2023-02-10 06:36]:
> Does anyone else think it might be nice to allow emojis in tags? I
> used to use OmniFocus before I got into org-mode. I had some tags
> that were certain symbols that had meaning to me. 

While I do not use it in tags, I use Emojis in headings.

And that creates problem in exporting as Org to LaTeX for example, as
Org cannot solve the problem.

One solution to include Emojis in LaTeX would be to use this package for LaTeX:

alecjacobson/coloremoji.sty: Style package for directly including color emojis 
in latex documents:
https://github.com/alecjacobson/coloremoji.sty

-- 
Jean

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

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



emojis in tags?

2023-02-09 Thread Robert Nikander
Hi,

Does anyone else think it might be nice to allow emojis in tags? I used to use 
OmniFocus before I got into org-mode. I had some tags that were certain symbols 
that had meaning to me. 

Rob


Re: [POLL] Proposed syntax for timestamps with time zone info (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)

2023-02-09 Thread Jean Louis
* Ihor Radchenko  [2023-02-08 13:36]:
> > Is it Org as program?
> >
> > Or is it human?
> 
> Both.
> 
> The idea is to ensure exact point of time relative to UTC.
> For example, when you want to schedule something exactly 10024 hours in
> future, regardless of time zone changes.

I got it, thank you.

iCalendar allows UTC time. If you have UTC time, you need not have UTC
offset, as that is NOT what other programs are doing.

My recommendation is follow what is successful. If you wish to use UTC
time, use it, but no need to add offset as it will be confusing.

Timestamp is either in UTC or in other time zones. UTC time has no
offset.

If you start adding in Org "fixed" time with UTC offset, that is a new
type of timestamp, as it is not common in world.

Here is suggestion:
---

1. Convert local time timestamp to UTC
2. Add 10024 hours
3. Provide timestamp in UTC

Also look at this reference:
https://icalendar.org/iCalendar-RFC-5545/3-3-5-date-time.html

,
| The form of date and time with UTC offset MUST NOT be used. For
| example, the following is not valid for a DATE-TIME value:
| 
|  19980119T23-0800   ;Invalid time format
`

As with the above format, author would maybe think it is alright, but
in general it is confusing. If author wish to specify UTC time, then
no offset shall be used.

> The same can be done by specifying the timestamp in UTC directly.

That is simplest.

> > Another program in future, and human, must know did the organizer of
> > event, had in mind:
> 
> I would like to remind you that timestamps are not necessarily used for
> meetings. And not always shared with other people.

Ok, and I have asked you to provide practical examples.

Calculation of time shall not be made for sake of sole calculation,
but for human and by considering use application.

Timestamps for past time, like for logs, I always store as UTC time in
database, with time zone (which does not mean that time zone is
stored, but displayed in local time zone).

However, future time to be coordinated with people, anything human
related, it has to be stored with date, time, and time zone in
separate fields. That way program in future will understand it.

Timestamp is in general always considered past, not future. That is
where the word comes from, the "stamp", if you stamp something, it is
on paper, when it was done. It is not about "When it will be".

https://en.wikipedia.org/wiki/Timestamp

A timestamp is a sequence of characters or encoded information
identifying when a certain event occurred, usually giving date and
time of day, sometimes accurate to a small fraction of a second

We have to distinguish in Org what we are doing here, and meaning with
"timestamp", as in Org context, timestamp is more than just time when
something occured.

In Org context there is new type of "timestamp" which is meant for
future.

Timestamp for past -- should be as accurate as possible in general
applications.

Practical example of a timestamp: I enter person's contact details,
the moment I enter such details, the timestamp is created. It is not
100% accurate to the event that really has taken place, as computer
user need some time to write first name, last name of person, it is
"about". But for the sole entry of the data in database, that
timestamp is pretty accurate.

Timestamp for future is not really timestamp, it is intended time, in
many applications it cannot be accurate. 

The last example on the page:
https://icalendar.org/iCalendar-RFC-5545/3-3-5-date-time.html
gives good clues how to specify date and time in future.

> > I find such situations rather easy to solve with database:
> >
> > - I can have column like "timestamp" with UTC time or local time plus
> >   UTC offset, and if I did not enter any other information, that UTC
> >   offset is considered in future. Consider this column name
> >   "timestamp".
> >
> > - I can have column "time" and when such is entered, then date is
> >   extracted from "timestamp" column, and combined with time. In this
> >   case UTC is only calculated in new time point but not used as period
> >   from past to appointment time.
> >
> > - I can have time zone for the future, if I enter such in other
> >   column, the future calculation must use that proper time zone. 
> 
> Sorry, I do not understand what you are trying to explain here. Would
> you mind showing an example?

The above quote came from explaining that you should not use "time
offset" to designate UTC time, as such offset will be mistaken in
future for "UTC offset". 

By doing that you are creating new type of time representation that is
not used anywhere else (for future purposes).

Example
---

2023-02-01 12:00 -08 @SomeTimeZone would mean that UTC offset at that
time and date was -08. One can derive UTC time easily and it will be
accurate.

2033-02-01 12:00 -08 @SomeTimeZone, means that one should consider
that @SomeTimeZone in future to first derive the UTC offset, as -08
can only be taken 

Re: [PATCH] remove unused code in ob-octave.el

2023-02-09 Thread Max Nikulin

On 10/02/2023 04:21, Leo Butler wrote:

In lisp/ob-octave.el:

What is the point of ob-octave-prep-session:octave or its brother,
ob-octave-prep-session:matlab?

These two functions are unused in the existing code.


Have you checked the following? I am not familiar with org-babel code.

grep -nH org-babel-prep-session lisp/ob-core.el
lisp/ob-core.el:1041:	 (prep-cmd (intern (concat 
"org-babel-prep-session:" lang
lisp/ob-core.el:1050:	(error "No org-babel-prep-session function for 
%s!" lang))


Do test passes when you patch is applied? It might mean that test 
coverage is not perfect.




Re: [RFC] If you use Org 9.6, please share the output of M-x org-element-cache-hash-show-statistics

2023-02-09 Thread General discussions about Org-mode.


Ihor Radchenko  writes:
>
> If you are ok with sharing the statistics, and you are running Emacs
> session for at least few hours (using Org mode, obviously), please reply
> sharing the output of
>  M-x org-element-cache-hash-show-statistics 
>  M-x emacs-uptime 

I have emacs running on two machines right now, with the same set of
files and the same version of Org 9.6.1.

NixOS 22.11:

Org mode version 9.6.1 ( @ 
/nix/store/k8y11pil3q0fca3xc7ma1f1dsjqkxy47-emacs-packages-deps/share/emacs/site-lisp/elpa/org-9.6.1/)
29.84% of cache searches hashed, 0.33% non-hashable.
1 day, 13 hours, 28 minutes, 37 seconds

MacOS 12.3, with Nix:

Org mode version 9.6.1 ( @ 
/nix/store/6carlqy174ab1fwz6ihb4rz3sldvc555-emacs-packages-deps/share/emacs/site-lisp/elpa/org-9.6.1/)
31.70% of cache searches hashed, 0.75% non-hashable.
4 days, 19 hours, 45 minutes, 10 seconds

-- Ted Reed



Re: [RFC] If you use Org 9.6, please share the output of M-x org-element-cache-hash-show-statistics

2023-02-09 Thread Jonathan Gregory

Hi,

On 09 Feb 2023, Ihor Radchenko wrote:


Hi,

I would like to assess the efficiency of one of search 
optimizations used in org-element.el [1]


The statistics about efficiency is collected by Org, but 
obviously not shared without your consent.


If you are ok with sharing the statistics, and you are running 
Emacs session for at least few hours (using Org mode, 
obviously), please reply sharing the output of


 M-x org-element-cache-hash-show-statistics 


18.64% of cache searches hashed, 7.90% non-hashable.


 M-x emacs-uptime 


8 days, 9 hours, 14 minutes, 34 seconds

[1] Pugh [Information Processing Letters] (1990) Slow optimally 
balanced search strategies vs. cached fast uniformly balanced 
search strategies. 
http://dx.doi.org/10.1016/0020-0190(90)90130-P



--
Jonathan



Re: [RFC] If you use Org 9.6, please share the output of M-x org-element-cache-hash-show-statistics

2023-02-09 Thread João Pedro
On Thu, February 09 2023 11:51, Ihor Radchenko  wrote:

> Hi,

Hello Ihor!

> If you are ok with sharing the statistics, and you are running Emacs
> session for at least few hours (using Org mode, obviously), please reply
> sharing the output of

Definitely OK with it! Here it goes

>  M-x org-element-cache-hash-show-statistics 

22.63% of cache searches hashed, 1.71% non-hashable.

>  M-x emacs-uptime 

2 days, 3 hours, 19 minutes, 31 seconds

Best regards,

-- 
João Pedro de A. Paula
IT bachelors at Universidade Federal do Rio Grande do Norte (UFRN)


[PATCH] remove unused code in ob-octave.el

2023-02-09 Thread Leo Butler
In lisp/ob-octave.el:

What is the point of ob-octave-prep-session:octave or its brother,
ob-octave-prep-session:matlab?

These two functions are unused in the existing code.

Leo

From f91562d9ea36d7f76f222e457c8fd1b0570e7e3d Mon Sep 17 00:00:00 2001
From: Leo Butler 
Date: Thu, 9 Feb 2023 11:02:04 -0600
Subject: [PATCH] lisp/ob-octave.el: remove
 org-babel-prep-session:{octave,matlab}

* lisp/ob-octave.el (org-babel-prep-session:matlab,
org-babel-prep-session:octave):  Remove unused functions.
---
 lisp/ob-octave.el | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/lisp/ob-octave.el b/lisp/ob-octave.el
index 9bf16b984..24537ad57 100644
--- a/lisp/ob-octave.el
+++ b/lisp/ob-octave.el
@@ -104,10 +104,6 @@ end")
(org-babel-pick-name
 	(cdr (assq :rowname-names params)) (cdr (assq :rownames params)))
 
-(defun org-babel-prep-session:matlab (session params)
-  "Prepare SESSION according to PARAMS."
-  (org-babel-prep-session:octave session params 'matlab))
-
 (defun org-babel-variable-assignments:octave (params)
   "Return list of octave statements assigning the block's variables."
   (mapcar
@@ -133,17 +129,6 @@ specifying a variable of the same value."
  (t
   (format "%s" var)
 
-(defun org-babel-prep-session:octave (session params  matlabp)
-  "Prepare SESSION according to the header arguments specified in PARAMS."
-  (let* ((session (org-babel-octave-initiate-session session params matlabp))
-	 (var-lines (org-babel-variable-assignments:octave params)))
-(org-babel-comint-in-buffer session
-  (mapc (lambda (var)
-  (end-of-line 1) (insert var) (comint-send-input nil t)
-  (org-babel-comint-wait-for-output session))
-	var-lines))
-session))
-
 (defun org-babel-matlab-initiate-session ( session params)
   "Create a matlab inferior process buffer.
 If there is not a current inferior-process-buffer in SESSION then
-- 
2.39.1



Re: [RFC] If you use Org 9.6, please share the output of M-x org-element-cache-hash-show-statistics

2023-02-09 Thread Simon Butler


two computers, both running org mode version 9.6.1 and Emacs 27.1

1.00% of cache searches hashed, 0.00% non-hashable.
3 days, 11 hours, 17 minutes, 32 seconds


5.88% of cache searches hashed, 3.75% non-hashable.
3 days, 13 hours, 49 minutes, 16 seconds





On 2023-02-09 at 11:51 GMT, Ihor Radchenko  wrote: 
> Hi,
>
> I would like to assess the efficiency of one of search optimizations used
> in org-element.el [1]
>
> The statistics about efficiency is collected by Org, but obviously not
> shared without your consent.
>
> If you are ok with sharing the statistics, and you are running Emacs
> session for at least few hours (using Org mode, obviously), please reply
> sharing the output of
>  M-x org-element-cache-hash-show-statistics 
>  M-x emacs-uptime 
>
> [1] Pugh [Information Processing Letters] (1990) Slow optimally balanced
>  search strategies vs. cached fast uniformly balanced search strategies.
>  http://dx.doi.org/10.1016/0020-0190(90)90130-P




Re: [RFC] If you use Org 9.6, please share the output of M-x org-element-cache-hash-show-statistics

2023-02-09 Thread Jeffrey DeLeo
Org mode version 9.6.1
15.80% of cache searches hashed, 5.90% non-hashable.
Emacs Uptime: 9 hours, 58 minutes, 8 seconds




Re: [RFC] If you use Org 9.6, please share the output of M-x org-element-cache-hash-show-statistics

2023-02-09 Thread Kévin Le Gouguec
Hey Ihor,

Ihor Radchenko  writes:

> If you are ok with sharing the statistics, and you are running Emacs
> session for at least few hours (using Org mode, obviously), please reply
> sharing the output of
>  M-x org-element-cache-hash-show-statistics 
>  M-x emacs-uptime 

Here are the stats for today:

org-element-cache-hash-show-statistics:
> 19.32% of cache searches hashed, 11.88% non-hashable.

Evolution throughout the day: (don't know if *Messages* can be told to
add timestamps)

> 28.02% of cache searches hashed, 4.20% non-hashable.
> 19.79% of cache searches hashed, 13.80% non-hashable.
> 19.57% of cache searches hashed, 12.10% non-hashable.
> 19.25% of cache searches hashed, 11.93% non-hashable.
> 19.32% of cache searches hashed, 11.88% non-hashable.

emacs-uptime:
> 10 hours, 50 minutes, 12 seconds

emacs-version:
> GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
> cairo version 1.16.0) of 2023-02-06

emacs-repository-version:
> 907fd1f7ff402f9d226ebb3b891ea5b54fac1d1c

org-version:
> Org mode version 9.6.1 (release_9.6.1-23-gc45a05 @
> /usr/local/share/emacs/30.0.50/lisp/org/)

FWIW, this was with 5 Org files open, clocking in and out of 18 headings
out of a little under 2000 headings.

Hope that helps; let me know if there is more info I can collect
tomorrow.



Re: Either zero or two newlines with org-agenda-block-separator, cannot seem to get one?

2023-02-09 Thread TRS-80
Hello List,

I had sent original email to the list some time ago, never received a
reply.

Hopefully I have set the correct headers for proper threading; if not
the OP can be found at (either of) these URLs:

https://yhetil.org/orgmode/33fe6d20c0591fedbdd8c6ea78e34...@isnotmyreal.name/

https://list.orgmode.org/33fe6d20c0591fedbdd8c6ea78e34...@isnotmyreal.name/

I just looked at latest master(main) and It looks like this part of the
function `org-agenda-prepare' (in org-agenda.el) remains the same:

#+begin_src emacs-lisp
(insert "\n"
(if (stringp org-agenda-block-separator)
org-agenda-block-separator
  (make-string (window-max-chars-per-line) 
org-agenda-block-separator))
"\n"))
#+end_src

This results in problem mentioned in title.

I guess no one else is affected/bothered by this?

I have been patching it locally, it would be nice not to have to manage
that any longer.

-- 
Cheers,
TRS-80




Re: [RFC] If you use Org 9.6, please share the output of M-x org-element-cache-hash-show-statistics

2023-02-09 Thread Mark Barton



> On Feb 9, 2023, at 3:51 AM, Ihor Radchenko  wrote:
> 
> Hi,
> 
> I would like to assess the efficiency of one of search optimizations used
> in org-element.el [1]
> 
> The statistics about efficiency is collected by Org, but obviously not
> shared without your consent.
> 
> If you are ok with sharing the statistics, and you are running Emacs
> session for at least few hours (using Org mode, obviously), please reply
> sharing the output of
> M-x org-element-cache-hash-show-statistics 
> M-x emacs-uptime 
> 
> [1] Pugh [Information Processing Letters] (1990) Slow optimally balanced
> search strategies vs. cached fast uniformly balanced search strategies.
> http://dx.doi.org/10.1016/0020-0190(90)90130-P
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
> 



 command ‘org-element-cache-hash-show-statistics’ 
7.85% of cache searches hashed, 1.88% non-hashable.

emacs uptime: 22 hours, 24 minutes, 10 seconds

Org mode version 9.6.1 (release_9.6.1-23-gc45a05 @ 
/Applications/Emacs.app/Contents/Resources/lisp/org/)

GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin22.2.0, NS appkit-2299.30 
Version 13.1 (Build 22C65)) of 2023-02-08




[PATCH] ol.el: Recommend `browse-url' to `:follow' links

2023-02-09 Thread Max Nikulin
I think, it might be helpful to mention the `browse-url' package in the 
docs for the :follow property of `org-link-parameters'. Writing code to 
launch an external application may be tricky, so it is better to 
delegate the task to existing utilities.From 9d6b216d4bd654f976cd889dec2f805f05f76428 Mon Sep 17 00:00:00 2001
From: Max Nikulin 
Date: Thu, 9 Feb 2023 22:31:51 +0700
Subject: [PATCH] ol.el: Recommend `browse-url' to `:follow' links

* lisp/ol.el (org-link-parameters): Recommend the `browse-url' function
for calling external protocol handlers in the docstring.

This is indirect follow-up of the
https://list.orgmode.org/3218434.44cspzl...@linux.fritz.box/ thread.
---
 lisp/ol.el | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/lisp/ol.el b/lisp/ol.el
index 9e4781f6e..dd883ab29 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -109,6 +109,20 @@ (defcustom org-link-parameters nil
   Here, you may use `org-link-open-as-file' helper function for
   types similar to \"file\".
 
+  To invoke an external handler of specific URI scheme such as \"irc:\",
+  consider delegating the task to `browse-url', for details
+  see Info node `(emacs) Browse-URL'.
+
+(lambda (path  arg)
+  (browse-url (concat type \":\" path) arg))
+
+  Either ensure that a system-wide protocol handler is configured or
+  add an entry to `browse-url-handlers' for Emacs-28 and newer
+  or define `browse-url-browser-function' as alist for older versions.
+  The advantage of this approach is that the same handler
+  will be available for `goto-address-mode'
+  (see Info node `(emacs) Goto Address mode').
+
 `:export'
 
   Function that accepts four arguments:
-- 
2.25.1



Catching invisible edits: problem understanding doc

2023-02-09 Thread Alain . Cochard


Hello.  The documentation (version 9.6) says:

   2.2.3 Catching invisible edits
   --

   Sometimes you may inadvertently edit an invisible part of the
   buffer and be confused on what has been edited and how to undo the
   mistake.  Setting ‘org-fold-catch-invisible-edits’ to non-‘nil’
   helps preventing this.


I visit a new file.  I type

   * foo

then
   
   

then

   bar

Then I move the cursor one line up and press

   

So now the headline is folded and I see

   * foo...

In my understanding, 'bar' is now in an invisible part of the buffer.
But whether org-fold-catch-invisible-edits is set to 'nil, 'error',
'show', 'show-and-error' or nothing (i.e., 'smart' by default in 9.6),
if then I do

   M-x undo

I visually see no change, but I can observe by unfolding the headline
that 'bar' has disappeared.  In my understanding of the documentation
above and of the docstring for org-fold-catch-invisible-edits, this
should only happen with 'nil'.

What am I understanding incorrectly?  Thank you.

Tests performed with 'emacs -Q -l .emacs.git' with '.emacs.git' being 

   (add-to-list 'load-path "~/Org/Coch-git/org-mode/lisp")
   (custom-set-variables
'(org-fold-catch-invisible-edits 'nil)
;; or 'error or 'show or 'show-and-error (or nothing)
)

giving:

   Org mode version 9.6.1 (release_9.6.1-239-g739ccf @
   /home/cochard/Org/Coch-git/org-mode/lisp/)

PS: a very minor incidental point: after 'bar' has disappeared, the
headline is then void, so I tend to say that the ellipsis should
immediately disappear as well.


-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]




Re: [RFC] If you use Org 9.6, please share the output of M-x org-element-cache-hash-show-statistics

2023-02-09 Thread Hanno Perrey
Hej Ihor,

below is the requested output. I spent most my time working in Org mode.

Best wishes,
Hanno


,
| (org-element-cache-hash-show-statistics)
`

,
| 1.56% of cache searches hashed, 3.37% non-hashable.
`


,
| (org-version nil 't)
`

,
| Org mode version 9.6 (9.6-??-bed47b437 @ 
/home/hperrey/.emacs.d/.local/straight/build-28.1.91/org/)
`


,
| (emacs-uptime)
`

,
| 37 days, 5 hours, 20 minutes, 25 seconds
`



Ihor Radchenko  skrev: (9 februari 2023 12:51:49 CET)
>Hi,
>
>I would like to assess the efficiency of one of search optimizations used
>in org-element.el [1]
>
>The statistics about efficiency is collected by Org, but obviously not
>shared without your consent.
>
>If you are ok with sharing the statistics, and you are running Emacs
>session for at least few hours (using Org mode, obviously), please reply
>sharing the output of
> M-x org-element-cache-hash-show-statistics 
> M-x emacs-uptime 
>
>[1] Pugh [Information Processing Letters] (1990) Slow optimally balanced
> search strategies vs. cached fast uniformly balanced search strategies.
> http://dx.doi.org/10.1016/0020-0190(90)90130-P
>
>-- 
>Ihor Radchenko // yantar92,
>Org mode contributor,
>Learn more about Org mode at .
>Support Org development at ,
>or support my work at 
>



Re: Should we obsolete org-emphasis-alist? (was: [PATCH v5] org.el: Warning for unsupported markers in `org-set-emphasis-alist')

2023-02-09 Thread Max Nikulin

On 07/02/2023 17:47, Ihor Radchenko wrote:


Upon looking closer, `org-set-emph-re' is not affected by the value of
`org-emphasis-alist' with a single exception when the value is nil.


You are right, it is result of the following commit:

9fb2e047d 2016-12-08 09:44:26 +0100 Nicolas Goaziou: Split `org-emph-re' 
and `org-verbatim-re'



I think that we should simply obsolete `org-emphasis-alist' and
introduce individual faces for emphasis.


I agree with your conclusions and proposal.

If you are close to merging fontification based on org-element then we 
may just discard this patch. Otherwise it may be merged with minimal 
modifications:

- Do not add the watcher
- Instead of `org-set-emph-re' use a lambda calling new 
`org-emphasis-alist--check-value` as the :set attribute of `defcustom'.

- Fix description of verbatim tag.





[RFC] If you use Org 9.6, please share the output of M-x org-element-cache-hash-show-statistics

2023-02-09 Thread Ihor Radchenko
Hi,

I would like to assess the efficiency of one of search optimizations used
in org-element.el [1]

The statistics about efficiency is collected by Org, but obviously not
shared without your consent.

If you are ok with sharing the statistics, and you are running Emacs
session for at least few hours (using Org mode, obviously), please reply
sharing the output of
 M-x org-element-cache-hash-show-statistics 
 M-x emacs-uptime 

[1] Pugh [Information Processing Letters] (1990) Slow optimally balanced
 search strategies vs. cached fast uniformly balanced search strategies.
 http://dx.doi.org/10.1016/0020-0190(90)90130-P

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



Re: [PATCH] Async evaluation in ob-shell

2023-02-09 Thread Ihor Radchenko
Matt  writes:

> I found cleaning the output was dramatically helped by calling 
> `buffer-substring-no-properties' instead of `buffer-substring' in 
> `org-babel-comint-async-filter'.  I'm not sure why `buffer-substring' was 
> originally used.  `make test' shows no failures, so I assume it doesn't make 
> a difference...?

Could you please elaborate? What was the problem with
`buffer-substring'? I am asking because one of the previous versions of
`org-babel-comint-wait-for-output' relied upon 'face text property. See
a35d16368.

>   On Tue, 07 Feb 2023 06:40:51 -0500  Ihor Radchenko  wrote --- 
>  > That's likely because of the same reasons why prompt did not get cleaned
>  > in synchronous blocks earlier. See `org-babel-comint-with-output'.
>
> That, my friend, was a wild ride.
>
> I'm curious about people's feelings on `org-babel-comint-with-output'.

My feelings are: WTF and how does it even work :)
More in https://yhetil.org/emacs-devel/87y1tgqhmc.fsf@localhost/
It is a mess, because comint.el is not designed for programmatic use.

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



Re: ob-sql dbconnection engine

2023-02-09 Thread Ihor Radchenko
Andreas Gerler  writes:

> In the end you are still able to overwrite in your src block parameters via 
> :engine

Sure, but wouldn't it be better to amend the patch adding aliases to the
supported engine names in `sql-connection-alist'?

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



Re: [BUG] ob-gnuplot.el can't handle importing more than one table from the current file [9.6.1 ( @ /home/thomas/.emacs.d/elpa/org-9.6.1/)]

2023-02-09 Thread Ihor Radchenko
Thomas Worthington  writes:

> I can't replicate now. It was about four weeks ago I tripped over 
> this and I absolutely saw it in action repeatedly - I could see 
> gnuplot loading the same file in its process buffer, and only one 
> file being created on-disc too.

One possibility is hash collision in `org-babel-temp-stable-file'.
Something similar to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56255

I will see if I can implement collision-free hashing to work around the
limitations of sxhash.

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



Re: Creating animated gif from latex src blocks

2023-02-09 Thread Edouard Debry


Hi,

In reply to an old thread initiated, here is how I get animated pictures
from latex src blocks.

<=== GIF image ===>

#+NAME: before-make-gif
#+begin_src elisp :lexical no :results none
(setq org-format-latex-header "\\documentclass[tikz]{standalone}")
(setq org-latex-default-packages-alist nil)
(setq org-latex-packages-alist nil)
#+end_src

#+NAME: after-make-gif
#+begin_src elisp :lexical no :results none
(custom-reevaluate-setting 'org-format-latex-header)
(custom-reevaluate-setting 'org-latex-packages-alist)
(custom-reevaluate-setting 'org-latex-default-packages-alist)
#+end_src

#+NAME: make-gif
#+header: :file test1.gif
#+header: :exports results
#+header: :results output silent graphics file
#+header: :imagemagick yes
#+header: :iminoptions -density 600 -delay 8 -loop 0 -background white -alpha 
remove
#+header: :headers '("\\usepackage{tikz}" "")
#+begin_src latex
\foreach \angle in {0,10,...,360} %
{
  \begin{tikzpicture}
% fill circle and plot
\fill[blue!50] (-1,0) arc (0:\angle:1) -- (-2,0) -- cycle;
\fill[blue!50] plot[smooth,domain=0:\angle] (pi/180*\x,{sin(\x)}) |- (0,0);
% draw connection
\draw (-2,0) +(\angle:1) circle (2pt) -- (pi/180*\angle,{sin(\angle)}) 
circle (2pt);
% draw axes an ticks
\draw (-3.5,0) -- (7,0);
\foreach \deg in {90, 180, 270, 360}
  \draw (pi/180*\deg,2pt) -- (pi/180*\deg,-2pt) node[below] {$\deg^\circ$};
\draw (0,-1.2) -- (0,1.2);
\foreach \y in {-1,-0.5,0.5,1}
  \draw (2pt,\y) -- (-2pt,\y) node[left] {$\y$};
% draw plot and circle outline
\draw plot[smooth,domain=0:360] (pi/180*\x,{sin(\x)});
\draw (-2,0) circle (1);
  \end{tikzpicture}
}
#+end_src

#+ATTR_ORG: :width 1500 :height 600
[[file:test1.gif]]

<=== GIF image ===>



<=== SVG image ===>

#+NAME: before-make-svg
#+begin_src elisp :lexical no :results none
(setq org-format-latex-header "\\documentclass[dvisvgm]{standalone}")
(setq org-latex-default-packages-alist nil)
(setq org-latex-packages-alist nil)
#+end_src

#+NAME: after-make-svg
#+begin_src elisp :lexical no :results none
(custom-reevaluate-setting 'org-format-latex-header)
(custom-reevaluate-setting 'org-latex-packages-alist)
(custom-reevaluate-setting 'org-latex-default-packages-alist)
#+end_src

#+NAME: make-svg
#+header: :file test1.svg
#+header: :exports results
#+header: :results output silent graphics file
#+header: :headers '("\\usepackage{animate}" "\\usepackage{tikz}" 
"\\pgfmathsetmacro{\\pendulumswing}{40}" 
"\\pgfmathsetmacro{\\pendulumlength}{5}")
#+begin_src latex
\begin{animateinline}[controls, palindrome]{45}
  \multiframe{45}{rt=0+4}{%
\begin{tikzpicture}[line width=1pt]
  \draw[dashed] (0:0) -- (90:{-\pendulumlength}) coordinate (o);
  \draw[dashed] ({90-\pendulumswing}:{-\pendulumlength}) coordinate (a)
  arc[start angle={90-\pendulumswing}, end angle={90+\pendulumswing}, 
radius={-\pendulumlength}] coordinate (b);
  \draw[dashed, red] (a) -- (a |- o) coordinate (c) node[below] {$-x_m$};
  \draw[dashed, red] (b) -- (b |- o) coordinate (d) node[below] {$x_m$};
  \draw[-stealth, red] ([xshift=-1cm]c) -- ([xshift=1cm]d);

  % variable \rt goes from 0 to 180
  % cos(\rt) returns a value between -1 and 1 following a (co)sine curve
  \pgfmathsetmacro{\pendulumangle}{cos(\rt)*\pendulumswing}
  \draw (0:0) -- ({90+\pendulumangle}:{-\pendulumlength})
  node[circle, fill=blue, text=white] {$\mathbf{m}$};
\end{tikzpicture}%
  }%
\end{animateinline}
#+end_src

#+ATTR_ORG: :width 1500 :height 600
[[file:test1.svg]]

<=== SVG image ===>

The GIF generation first goes through generating a PDF file and then, converts 
it
afterwards to gif with ImageMagick. It only uses "tikz" latex package.

The SVG generation uses "tikz" and "animate" latex packages. This latter is 
initiated
with "dvisvgm" and therefore, the src block is configured to produce a svg file
("dvisvgm" again under the hood).

The GIF image shows up correctly animated in emacs, either as a plain file or 
as a link in
orgmode (org-inline-animate).

The SVG file is statically well displayed in emacs, but not animated. As far as 
I understand
the "animate" package uses javascript under the hood and indeed, the SVG file is
correctly animated in (e.g.) the chromium browser.

That is to note that for correct image generation, I had to tweak
'org-format-latex-header, , 'org-latex-packages-alist and
'org-latex-default-packages-alist orgmode variables. Setting nil for two 
latters is probably
a bit too harsh, but I did not have enough time to figure out which package was 
causing
problems.

So, as you may have guessed, before evaluating the latex block, I evaluate the 
first
elisp block and after, the second elisp block's evaluation reverts orgmode 
variables to
their 

Re: [PATCH] org--batch-store-agenda-views: Fix treatment of lambda functions

2023-02-09 Thread Ihor Radchenko
Aaron Zeng  writes:

> New patch looks good.  Thanks!

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

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



Re: [BUG] M-S- does not adjust clock timestamps as described in docs [9.5.5]

2023-02-09 Thread Ihor Radchenko
Robert Nikander  writes:

> I’m pretty much a beginner with the clock features, so I don’t have an 
> opinion yet on how it should work. But yes, it seems like clarifying the 
> manual there would be an improvement. 

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

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



Re: [BUG] CUSTOM_id ignored on blocks by ox-beamer

2023-02-09 Thread Alan Schmitt
Hello Ihor,

On 2023-01-19 10:21, Ihor Radchenko  writes:

> Please add a changelog entry detailing the definitions where the changes
> happened. See https://orgmode.org/worg/org-contribute.html#commit-messages
>
...
> Please document the new %l option in the docstring of
> `org-beamer-environments-extra' and add a notice to etc/ORG-NEWS file.

Here is an updated patch.



signature.asc
Description: PGP signature
>From c480b26f9cb536b68b00930a19d59485f9221ef7 Mon Sep 17 00:00:00 2001
From: Alan Schmitt 
Date: Sun, 8 Jan 2023 17:20:31 +0100
Subject: [PATCH] lisp/ox-beamer.el: add labels to latex export

* ox-beamer.el (org-beamer-environments-default): add label escape to
some environments
(org-beamer--format-block): generate label string for label escape
(org-beamer-environments-extra): document label escape

A new escape %l is available to be used in `org-beamer-environments-*'
to insert the label of the current block, obtained using
`org-babel--get-label'
---
 etc/ORG-NEWS  |  5 +
 lisp/ox-beamer.el | 10 ++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index c5e9cd568..47806484e 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -79,6 +79,11 @@ document header:
 The face ~org-agenda-calendar-daterange~ is used to show entries with
 a date range in the agenda.  It inherits from the default face in
 order to remain backward-compatible.
+*** New escape in ~org-beamer-environments-extra~ for labels in Beamer export
+The escape ~%l~ in ~org-beamer-environments-extra~ inserts the label
+obtained from ~org-beamer--get-label~.  This is added to the default
+environments "theorem", "definition", "example", and "exampleblock" in
+~org-beamer-environments-default~.
 
 ** New features
 *** ~org-metaup~ and ~org-metadown~ now act on headings in region
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 689bf1559..5df78d5a4 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -116,6 +116,7 @@ openThe opening template for the environment, with the following escapes
 %r   the raw headline text (i.e. without any processing)
 %H   if there is headline text, that raw text in {} braces
 %U   if there is headline text, that raw text in [] brackets
+%l   the label, obtained from `org-beamer--get-label'
 close   The closing string of the environment."
   :group 'org-export-beamer
   :version "24.4"
@@ -178,10 +179,10 @@ through `org-beamer-environments-extra' variable.")
 ("quotation"  "q" "\\begin{quotation}%a %% %h""\\end{quotation}")
 ("quote"  "Q" "\\begin{quote}%a %% %h""\\end{quote}")
 ("structureenv"   "s" "\\begin{structureenv}%a %% %h" "\\end{structureenv}")
-("theorem""t" "\\begin{theorem}%a[%h]""\\end{theorem}")
-("definition" "d" "\\begin{definition}%a[%h]" "\\end{definition}")
-("example""e" "\\begin{example}%a[%h]""\\end{example}")
-("exampleblock"   "E" "\\begin{exampleblock}%a{%h}"   "\\end{exampleblock}")
+("theorem""t" "\\begin{theorem}%a[%h]%l""\\end{theorem}")
+("definition" "d" "\\begin{definition}%a[%h]%l" "\\end{definition}")
+("example""e" "\\begin{example}%a[%h]%l""\\end{example}")
+("exampleblock"   "E" "\\begin{exampleblock}%a{%h}%l"   "\\end{exampleblock}")
 ("proof"  "p" "\\begin{proof}%a[%h]"  "\\end{proof}")
 ("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}" "\\end{beamercolorbox}"))
   "Environments triggered by properties in Beamer export.
@@ -578,6 +579,7 @@ used as a communication channel."
 		(cons "O" (or raw-options ""))
 		(cons "h" title)
 		(cons "r" raw-title)
+(cons "l" (format "\\label{%s}" (org-beamer--get-label headline info)))
 		(cons "H" (if (equal raw-title "") ""
 			(format "{%s}" raw-title)))
 		(cons "U" (if (equal raw-title "") ""
-- 
2.39.1


Best,

Alan


Re: Possible error in manual

2023-02-09 Thread Ihor Radchenko
TRS-80  writes:

>>  org-fold-catch-invisible-edits does not exist in Org mode version 9.5.2,
>> it should be org-catch-invisible-edits.
>
> Do you think you might be able to submit a patch?  :)

As pointed in another message, this is not a bug. Just version mismatch
between online manual and installed Org version.

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