Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda

2023-01-26 Thread Daryl Manning
Oh wow... this is a great idea. Good idea sending it round. Ought to make
things a bit easier when discussing and avoiding misunderstandings.  =]

On Fri, Jan 27, 2023 at 1:06 PM Sterling Hooten  wrote:

> Hi all,
>
> Collaborating around the subject of "time" is difficult; there are
> subtleties abound in implementation, the perspectives people come from,
> and the language used in discussions. I'm going to provide a glossary to
> establish common terminology, use these terms to analyze our current
> state, offer a roadmap for solving the problem in stages, suggest a
> format for timestamps, urge compatibility with "exotic" use cases, and
> finally call for outside help with implementing a timezone aware agenda
> system.
>
> Summary and references are at the end.
>
> This is an initial glossary compiled from various standards and sources;
> it's incomplete, probably incorrect, and open to critique, but is useful
> in articulating a possible road map forward.
>
> • Time
>
>   Time (concept)
> What clocks measure (Einstein)
>   Time axis
> Mathematical representation of the succession in time according
> to the space-time model of instantaneous events along a unique
> axis (ISO).
>
>   Instant (object)
> A single point on time axis (ISO).
>   Moment in time
> See: instant.
>   Mark
> A set of symbols related to the object, or carrying some
> symbolic meaning
>   Time scale
> System of ordered marks which can be attributed to instants on
> the time axis , one instant being chosen as the origin. e.g.,
> GMT, UTC, TAI.
>   Basis time
> See: time scale.
>   Time (mark)
> The designation of an instant on a selected time scale, used in
> the sense of time of day.
>   Time interval (object)
> part of the time axis limited by two instants and, unless
> otherwise stated, the limiting instants themselves a part of
> time limited by two instants or moments in time (ISO). The
> elapsed time between two events (NIST).
>   Duration (object)
> as a quantity characterizing a time interval. These can be
> written in different formats.
>   UTC
> Time scale with the same rate as International Atomic Time
> (TAI), but differing from TAI only by an integral number of
> seconds.
>   Offset
> Constant duration difference between times of two time scales
> (ISO). i.e., a quantity to combine with a time scale to produce
> a wall time. e.g., Nepal uses a +5:45 offset from the UTC time
> scale.
>   Time shift
> See: offset.
> • Calendar and civil time
>   Wall time
> what shows on the clock on the wall at a location. Like "local
> system time" but needn't reference a computer to do the
> calculation.
>   Standard time
> Time scale derived from UTC, by a time shift established in a
> given location by the competent authority (ISO).
>   Local system time
> Local system time is determined by applying the system's time
> zone offset and year offset values to UTC. The Time of day
> system value displays the local system time. Local system time
> and system time are used interchangeably.
>   Time Zone
> A place/region. Can map between wall time and a time scale with
> a table and an offset. A set of rules for determining the local
> observed time (wall time) as it relates to incremental time (as
> used in most computing systems) for a particular geographical
> region. e.g., Brasília time presently has an offset of −03:00
> from the UTC time.
>   Calendar event
> A calendar object that is commonly used to represent things that
> mark time or use time. Examples include meetings, appointments,
> anniversaries, start times, arrival times, closing times.
>
> • Implementation These concern how we actually decide to record,
>   reference, or manipulate time.
>   Representation
> Expression indicating a time point, time interval or recurring
> time interval. e.g., [2023-02-02 Thu 12:58 +1w], "this next
> suday at 2pm EST", 3600 seconds from Unix epoch
>   Format
> A description of the abstract form used for a representation.
> e.g., [-MM-DD] 'Explain in prose relative to this moment in
> time using locale and include your timezone'
>   Encoding
> The method of storing a representation of time e.g., datestruct
> in memory, Org timestamp in body of heading, value of a
> "created" key in a database
>   Format syntax
> Rules that allow for parsing a encoding unambiguously into some
> time scale.
>   Timestamp (mark)
> An encoded representation in a selected format. e.g., 24/01/2023
> or 2023-01-24
>   Delimiting syntax
> Rules that allow for detection and extraction of an 

Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda

2023-01-26 Thread Sterling Hooten
Hi all,

Collaborating around the subject of "time" is difficult; there are
subtleties abound in implementation, the perspectives people come from,
and the language used in discussions. I'm going to provide a glossary to
establish common terminology, use these terms to analyze our current
state, offer a roadmap for solving the problem in stages, suggest a
format for timestamps, urge compatibility with "exotic" use cases, and
finally call for outside help with implementing a timezone aware agenda
system.

Summary and references are at the end.

This is an initial glossary compiled from various standards and sources;
it's incomplete, probably incorrect, and open to critique, but is useful
in articulating a possible road map forward.

• Time

  Time (concept)
What clocks measure (Einstein)
  Time axis
Mathematical representation of the succession in time according
to the space-time model of instantaneous events along a unique
axis (ISO).

  Instant (object)
A single point on time axis (ISO).
  Moment in time
See: instant.
  Mark
A set of symbols related to the object, or carrying some
symbolic meaning
  Time scale
System of ordered marks which can be attributed to instants on
the time axis , one instant being chosen as the origin. e.g.,
GMT, UTC, TAI.
  Basis time
See: time scale.
  Time (mark)
The designation of an instant on a selected time scale, used in
the sense of time of day.
  Time interval (object)
part of the time axis limited by two instants and, unless
otherwise stated, the limiting instants themselves a part of
time limited by two instants or moments in time (ISO). The
elapsed time between two events (NIST).
  Duration (object)
as a quantity characterizing a time interval. These can be
written in different formats.
  UTC
Time scale with the same rate as International Atomic Time
(TAI), but differing from TAI only by an integral number of
seconds.
  Offset
Constant duration difference between times of two time scales
(ISO). i.e., a quantity to combine with a time scale to produce
a wall time. e.g., Nepal uses a +5:45 offset from the UTC time
scale.
  Time shift
See: offset.
• Calendar and civil time
  Wall time
what shows on the clock on the wall at a location. Like "local
system time" but needn't reference a computer to do the
calculation.
  Standard time
Time scale derived from UTC, by a time shift established in a
given location by the competent authority (ISO).
  Local system time
Local system time is determined by applying the system's time
zone offset and year offset values to UTC. The Time of day
system value displays the local system time. Local system time
and system time are used interchangeably.
  Time Zone
A place/region. Can map between wall time and a time scale with
a table and an offset. A set of rules for determining the local
observed time (wall time) as it relates to incremental time (as
used in most computing systems) for a particular geographical
region. e.g., Brasília time presently has an offset of −03:00
from the UTC time.
  Calendar event
A calendar object that is commonly used to represent things that
mark time or use time. Examples include meetings, appointments,
anniversaries, start times, arrival times, closing times.

• Implementation These concern how we actually decide to record,
  reference, or manipulate time.
  Representation
Expression indicating a time point, time interval or recurring
time interval. e.g., [2023-02-02 Thu 12:58 +1w], "this next
suday at 2pm EST", 3600 seconds from Unix epoch
  Format
A description of the abstract form used for a representation.
e.g., [-MM-DD] 'Explain in prose relative to this moment in
time using locale and include your timezone'
  Encoding
The method of storing a representation of time e.g., datestruct
in memory, Org timestamp in body of heading, value of a
"created" key in a database
  Format syntax
Rules that allow for parsing a encoding unambiguously into some
time scale.
  Timestamp (mark)
An encoded representation in a selected format. e.g., 24/01/2023
or 2023-01-24
  Delimiting syntax
Rules that allow for detection and extraction of an encoding.
Necessary for encodings embedded in prose. e.g., '[]' for org
timestamps.

  Displayed time
The formatting of a representation exposed to a user.
  Calculating
Manipulating a set of time points, time intervals, or recurring
time intervals. e.g., determining instant from an offset,
comparing two representations in some lattice.
  Incremental time
A 

Re: [O] [PATCH] ob-eval: display error fix

2023-01-26 Thread General discussions about Org-mode.


Ping -- I don't think anyone else has replied / reviewed this patch yet,
unless it has happened in a different thread.

Best,


RY

Andreas Gerler  writes:

> [[PGP Signed Part:Undecided]]
>
> [2. text/x-patch; 0001-lisp-ob-eval.el-Display-error-fix.patch]...
>
>
>
> Hi Ruijie,
>
> thanks for asking.
> I combined them now and tested again all variants.
>
> Andreas
>
>> On 7. Jan 2023, at 22:33, Ruijie Yu via General discussions about Org-mode. 
>>  wrote:
>>
>>
>> Hi Andreas,
>>
>> -(display-buffer buf))
>> +(if org-babel-eval-error-display-notify
>> +(display-buffer buf)
>> +  (if (or (not (numberp exit-code))
>> +  (> exit-code 0))
>> +  (display-buffer buf
>>
>> Quick question, does it help or hurt readability if we change this
>> nested `if' into a `cond' expression?
>>
>> Or, alternatively, since both the outer then branch and the inner then
>> branch are the same expression, maybe we can just combine all three
>> conditions into a single `or' call?
>>
>> Something like
>>
>> (when (or org-babel-eval-error-display-notify
>>  (not (numberp exit-code))
>>  (> exit-code 0))
>>  (display-buffer buf))
>>
>> Best,
>>
>>
>> RY
>>
>
> [[End of PGP Signed Part]]



Re: Org mode timestamps on the Moon ;] (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)

2023-01-26 Thread Tom Gillespie
Oh boy. In short, I think we can only hope they come up with
LTC and we already have a syntactic space to say whether
our reference seconds are TAI/UTC/LTC/MTC/JTC etc. And
being the privileged squats that we are if the time system is
left out then it means UTC. The friendly thing to do would be
to always include the time system code in our timestamps,
but I don't think those have standard reference codes yet?

> would gain about 56 microseconds over 24 hours

And here I was naively hoping to avoid having to deal with
relativistic effects. That would seem to be a pretty serious
issue, but my assumption further down that comment is
hopefully what they will do. Specifically:

> let's just assume that clock synchonization will happen between earth and
> mars so that the unix epoch could be synchronized between the frames

The only generalized solution is to record the full location
(see intro to http://naggum.no/lugm-time.html which I'm surprised
hasn't been linked in this thread yet, but was linked on the same
topic back in 2011 it seems) and let people sort out how to translate
that local time from that reference frame in that particular gravity well.

I don't think we want to force users to start embedding their gps
coordinates, their current acceleration, etc. along with their
timestamp. But it turns out that the unix epoch is only standard
at 9.8m/s^2. So ... minutes should be ok right?

Joking aside. Clocks run faster on the moon, slower on the ISS,
so either clocks are synchronized back to earth seconds, or
they use some alternate standard reference time.

My expectation is that there will be some time keeping standard
that will ensure uniformity and that what we will want to capture
is whose seconds they are using to keep track of time, because
unix epoch on the moon has a different integer value than on
earth, and is likely off by multiple seconds.

I guess as long as the moon can participate in earth NTP it will
be ok? Otherwise I suspect that the NTP network standard for
the celestial body will be what we want to go with/record. I think
that will fit in the opening you have created for this in the syntax.

So instead of UTC it would be LTC (lunar coordinated time).
If you're getting logs from servers on the moon knowing that the
system clock was running on LTC and not UTC will be critical.

Some future engineer: "Leaving earth was a mistake."



[PATCH] org-element-cache-map: Fix handling of continue-from

2023-01-26 Thread Matthieu Caneill
Hi,

I'm hit by the following bug in `org-element-cache-map'. When I use
`tags' or `tags-todo' in an agenda, with the option
`(org-tags-match-list-sublevels nil)', all sub-elements of a matching
item are correctly skipped except the last one.

It can be reproduced with the following org file:

  * TODO Parent

  ** TODO Child 1

  ** TODO Child 2

and the following agenda:

  (setq org-agenda-custom-commands
'(
  ("t" "Test"
   (
(tags-todo "-foo" ((org-tags-match-list-sublevels nil)))
(tags "-foo" ((org-tags-match-list-sublevels nil)))
)
   ((org-agenda-files '("~/org/test.org"))

With `(org-tags-match-list-sublevels t)', I correctly see all 3
elements. With `(org-tags-match-list-sublevels nil)', I see Parent and
Child 2. This wasn't the case on an older version of org-element that
didn't make use of the cache.

I understand the option `org-tags-match-list-sublevels' is
semi-deprecated in favor of proper tag inheritance
configuration. However, to the best of my understanding, I can't
accomplish "list all todo items except those tagged with foo, and skip
children of matching entries" with tag inheritance.

Patch is attached. Happy to iterate over it in case my understanding
of this rather complex function is flawed. I tested it on my org
files, and would of course appreciate if others could test.

Best,
--
Matthieu
From 5d0e2beb9c8b8a239c41dab2f3b44d1fe83bff0c Mon Sep 17 00:00:00 2001
From: Matthieu Caneill 
Date: Thu, 26 Jan 2023 23:51:05 +0100
Subject: [PATCH] org-element-cache-map: Fix handling of continue-from

* lisp/org-element.el (org-element-cache-map): When the receiving
  function sets `org-element-cache-map-continue-from', value of START
  should be set accordingly.

* lisp/org.el (org-scan-tags): Reset `org-map-continue-from' for every
  iteration, and set it to the end of the element when sub-elements
  should be skipped following `org-tags-match-list-sublevels'.

TINYCHANGE
---
 lisp/org-element.el | 3 ++-
 lisp/org.el | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index a3d909290..0a1d31bee 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -7700,7 +7700,8 @@ the cache."
   ;; If FUNC moved point forward, update
   ;; START.
   (when org-element-cache-map-continue-from
-(goto-char org-element-cache-map-continue-from))
+(goto-char org-element-cache-map-continue-from)
+(setq start org-element-cache-map-continue-from))
   (when (> (point) start)
 (move-start-to-next-match nil))
   ;; Drop nil.
diff --git a/lisp/org.el b/lisp/org.el
index ac2acfefb..dc9b7da7f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11010,6 +11010,7 @@ headlines matching this string."
 		   org-outline-regexp
 (org-element-cache-map
  (lambda (el)
+   (setq org-map-continue-from nil)
(goto-char (org-element-property :begin el))
(setq todo (org-element-property :todo-keyword el)
  level (org-element-property :level el)
@@ -11084,7 +11085,6 @@ headlines matching this string."
'type (concat "tagsmatch" ts-date-type))
 	 (push txt rtn))
 	((functionp action)
-	 (setq org-map-continue-from nil)
 	 (save-excursion
 		   (setq rtn1 (funcall action))
 		   (push rtn1 rtn)))
@@ -11092,7 +11092,8 @@ headlines matching this string."
 
 	   ;; if we are to skip sublevels, jump to end of subtree
 	   (unless org-tags-match-list-sublevels
-	 (goto-char (1- (org-element-property :end el))
+	 (goto-char (1- (org-element-property :end el)))
+ (setq org-map-continue-from (org-element-property :end el)
;; Get the correct position from where to continue
 	   (when org-map-continue-from
  (setq org-element-cache-map-continue-from org-map-continue-from)
-- 
2.30.2



signature.asc
Description: PGP signature


Re: [ANN] orgtbl-fit

2023-01-26 Thread tbanelwebmin

On 1/26/23 11:35, Ihor Radchenko wrote:

tbanelwebmin  writes:


Actually, orgtbl-fit is a bridge between Org Mode tables and Calc.

By the way, Org Mode table spreadsheet capabilities are also a bridge
with Calc.

Examples & documentation can be read here:
https://github.com/tbanel/orgtblfit/blob/main/README.org

Interesting.
Could it be somehow integrated with TBLFM formulas?
I imagine something like

? +?*year +?*passengers +?*(year-2016)*passengers

, when set as a column value in table formula, to be auto-updated with
actual coefficients upon re-calculating the table.



Hey! That's an awesome idea.


Expanding on the idea
-

We need to specify the target column ("consumption" in this example). 
Therefore, the formula could be something like that:


$4 = fit (consumption = ? +?*year +?*passengers +?*(year-2016)*passengers)

It would benefit from other spreadsheet features, like constants and 
remote references.


On the development side, the TBLFM handling is already quite a big chunk 
of code. We must take care that such an additional feature do not add 
complexity and maintenance burden.



Orgtbl-fit as-is


It is also possible to include orgtbl-fit as-is into Org Mode core. It 
would sit side-by-side with the core without changing anything in its 
code and its unit-tests.



Data-analysis toolkit
-

From a higher perspective, we could give a consistent data-analysis 
toolkit to Org Mode (and call it org-data-analysis.el).


It would start with fitting, clustering & aggregation. Then, new 
algorithms would be added upon user requests.


Of course, there should be an interest among Org Mode users for such a 
toolkit.








Re: Link from orgmode file to E-Mail (using kmail or notmuch)

2023-01-26 Thread AW
Am Donnerstag, 26. Januar 2023, 13:18:49 CET schrieb Jean Louis:
> * AW  [2023-01-26 13:00]:
> > This is about a maildirs of kmail on my local machine. The E-Mails are
> > being indexed by akonadi on the side of kde-pim. But referring to a
> > certain E-Mail from orgmode with a kind of link fails, because I'd need
> > to got to the maildir and search for the specific E-Mail. kde-pim does
> > not offer an easy way to extract that or the message-ID.
> 
> How many Maildirs do you have?

One main, a hundred submaildirs.

> 
> and what does program:
> 
> akonadi_maildir_resource does?
> 
> Should it find e-mail?

Akonadi is a part of kde-pim.

> Without Akonadi:
> 
> 
> Solution may be simple without akonadi and external software.
> 
> It would be to provide main Maildir, then for program to find
> submaildirs, and to find Message ID in every e-mail, and record it,
> once per day, of course with e-mail file or folder location plus
> Message ID. This is simple program and can be done in shell or Emacs
> Lisp, collecting all Message IDs efficiently from every Maildir.
> 
> This program thus can be universal program, and then function can
> decide how to open e-mail, and it is just fine opening e-mail in Emacs
> as well.
> 
> Same program could be used to find e-mails by name or sender, or
> recipient.
Yes, that's what I'm doing with notmuch, thanks to the hint that ol-notmuch 
provides notmuch-search with message-ID. So far, my issue is solved. 

-- 

Regards,

Alexander






Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)

2023-01-26 Thread Thomas S. Dye

Aloha Max,

Max Nikulin  writes:


On 23/01/2023 23:04, Thomas S. Dye wrote:

* Kinds of event
- No-host event :: An event that takes place at an absolute 
time. Participants
must know their local timezone offset from UTC. Example 
[2023-01-23

06:00@UTC].
- Situated event :: An event that takes place at a time local 
to the event
site.  Participants must know their local timezone offset from 
UTC and the
event site timezone offset from UTC at the time of the event. 
Example

[2023-01-22 Sun 08:29@Australia/Sydney].
- [Itinerant | Traveling | Mobile] event :: An event that takes 
place at a
time local to the event site, which might change after the 
event has been
scheduled.  Participants must know their local timezone offset 
from UTC and
the event site timezone offset from UTC at the time of the 
event.  Examples
might be a regular staff meeting that takes place at 9:00 AM 
wherever the boss
happens to be, or a proposal to meet with a traveler when it is 
noon on Sunday
for the traveler. Example [2023-01-23 06:00].  In this case 
timezone is set

according to user timezone preference in scope.


Thomas, I mostly agree with the set of event kinds your 
suggested. Perhaps names
should be justified to have precise and concise terms in UI. 
From my point of
view their value is association with appropriate storage format 
for particular

timestamp.

Agreed.  Another idea for the mobile event is "variably situated 
event".  I don't doubt that better terms might be proposed.


An additional parameter (or sometimes first one to choose) is if 
explicit or
implicit time zone should be used in the file. In the latter 
case the same kinds
of events are possible, particular one is determined from a 
parent scope. User
should be just aware what is actual time zone if it is implicit 
one.


I was trying to capture this in the timestamp, where an explicit 
time zone is indicated and an implicit time zone is simply a date 
and time.


The following concept is aside from event kinds, but might (or 
might not) be
useful to present agenda, to schedule events, to implement the 
feature. Perhaps
a trip may be considered as an ad hoc timezone that follows 
offsets of time in
locations to visit. (Several such ad hoc time zones may allow to 
track schedule
of several people, but it may be too complex to use.) It may be 
considered close
to "mobile" event, but the purpose is not to ensure correct time 
of particular
event. It may facilitate presentation of timeline during the 
trip.


An alternative would be to have headlines for each stop on the 
trip, each of which has a #+TIMEZONE property.  Under each 
headline would be subheads for events, each with a timestamp for a 
"mobile event".  Org would let me toggle the times of these events 
relative to my current location, the event location, and UTC.




Perhaps it is more correct to talk about how events are 
scheduled, not of event
kinds. Consider Christmas and similar events. It is personal and 
local for each
user. If you share your .org file (with specified file-local 
time zone) with
other persons they celebrate accordingly to their local time. In 
addition they
may decide that it should be pleasant for you to receive a 
greeting close to

your local time.


In the first case, "Open Christmas presents at 8:00 AM", the event 
would be variably situated because I want to do this on the years 
I celebrate at home and also the years when I celebrate with 
friends and family in other parts of the world.  A timestamp for a 
variably situated event shares well--the recipient user needs to 
ensure that the event is stored within user's local time zone 
scope.


In the second case, "Send Christmas greetings to Max when he opens 
presents at 8:00 AM" would be an event situated at the place Max 
is celebrating--it is separate from the first case.  If I know 
where Max will celebrate Christmas, then I could use a timestamp 
for a situated event.  Otherwise, I would use a timestamp for a 
mobile event and make certain to ensure that the time zone scope 
for the event tracks Max's whereabouts.


It seems during discussion we use terms in slightly different 
meaning, so I will

try to clarify my point of view.

I had a course on general relativity theory, so "absolute time" 
does make much
sense for me. UTC is just a widely accepted agreement. I was 
bound to Earth
rotation and accumulated some offset from more precise atomic 
clocks. UTC
however currently is easiest way to perform time related 
calculations.


Yes, UTC is the sign we've widely agreed to interpret as absolute 
time.  A key property is that UTC is a continuum, absent the 
potential discontinuities that characterize space/time units like 
time zones.


My perception is still that UTC is one of timezones that may be 
used to specify
event time. It is a bit special since it is used as a reference 
for other time
zones, so it may be preferable for global events. If UTC 
considered as an
ordinary time zone then the whole set 

Re: This is out of thread subject

2023-01-26 Thread Jean Louis
* Ihor Radchenko  [2023-01-25 21:01]:
> Jean Louis  writes:
> 
> > Haven thanks Firefox developers did not complain on users setting
> > their own content types. Firefox can open Org content type and launch
> > Emacs on it, but Emacs "can't" as it is security risk. 
> 
> Well...
> https://bugzilla.mozilla.org/show_bug.cgi?id=1678994

That is fine, it is useful to be asked by which application something
will be opened. It is question about permission, which is given
once. That does not prevent user opening any URL with external
programs. Or content type.

There is more in computing than single user need. An HTML file on
local area network may list various URLs to various people of single
organization, and their work disconnected from Internet -- where all
users can access any kind of files, it need not be single user need.

> https://bugzilla.mozilla.org/show_bug.cgi?id=1565574

Any hyperlinks executing external program should not be opened
automatically of course. Imagine placing 20 various programs as
hyperlinks where user by opening single page launches 20 programs,
that is out of control of user. Having option for user to decide to
allow it, would be fine..

Otherwise hyperlinks like mid: should not be opened automatically,
hyperlink should wait for user to activate it.

-- 
Jean

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

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



Re: Link from orgmode file to E-Mail (using kmail or notmuch)

2023-01-26 Thread Jean Louis
* AW  [2023-01-26 13:00]:
> This is about a maildirs of kmail on my local machine. The E-Mails are being 
> indexed by akonadi on the side of kde-pim. But referring to a certain E-Mail 
> from orgmode with a kind of link fails, because I'd need to got to the 
> maildir 
> and search for the specific E-Mail. kde-pim does not offer an easy way to 
> extract that or the message-ID. 

How many Maildirs do you have?

and what does program:

akonadi_maildir_resource does?

Should it find e-mail?

Without Akonadi:


Solution may be simple without akonadi and external software.

It would be to provide main Maildir, then for program to find
submaildirs, and to find Message ID in every e-mail, and record it,
once per day, of course with e-mail file or folder location plus
Message ID. This is simple program and can be done in shell or Emacs
Lisp, collecting all Message IDs efficiently from every Maildir.

This program thus can be universal program, and then function can
decide how to open e-mail, and it is just fine opening e-mail in Emacs
as well.

Same program could be used to find e-mails by name or sender, or
recipient.

-- 
Jean

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

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



Re: Should Org provide commonly used link types?

2023-01-26 Thread Jean Louis
* Ihor Radchenko  [2023-01-25 21:15]:
> So, the suggested links are:
> 1. pdf + page
> 2. video/audio + timestamp
> 3. epub/djvu/mibi + page
> 
> Note that all these are basically file: links. While we can make users
> say pdf:... or video:..., or would be more convenient to extend file:
> link instead. Max pointed to experimental proof-of-concept code for pdf
> + page in another email.

Yes, you could extend file: and make special handlings for various types.

> > Message-ID, should support FOLDER+Message-ID
> 
> I am not sure here. How can we utilize FOLDER? It depend on the kind of
> external application or Emacs package we use to open the link.

If you only provide "mid" and function for user to customize it, that
is enough, then user's function must know how to handle it.

However, that is not by standard as "mid:" is not meant to be
referable from Org. See: https://www.rfc-editor.org/rfc/rfc2392

That URL expects message-id only, with possible content-id

 mid-url   = "mid" ":" message-id [ "/" content-id ]

Which means, in turn, that "mid:" shall be reserved only for indexing
programs, as RFC mentions "indexed", and I assume that is what was
meant with it.

Many e-mail clients do not have general indexing of e-mails and yet
they internally use Message IDs and have no problems finding it, or
may have internal indexing not exposed to user.

I do think that my proposal is more flexible, by allowing user to
introduce function, user can go away from standard and introduce
folder, in the sense:

mid:/home/user/Maildir?1231...@gnu.org

with parts being:

mid :   /home/user/Maildir  ?   1231...@gnu.org

I have many many mbox files on computer, they are used by various
programs, there is no single program opening all of mbox-es, and
Maildirs, and I have 59869+ Maildirs in total.

In case I as user change e-mail client to some indexing one, my
function can still discard the file location part and find Message ID

Another idea is to use "file:" as usual, for those e-mail Message IDs
which are stored in files, in that case function again must be
somewhere to detect:

- if file is Maildir, mbox
- to use Page ID part of "file:" if such exist, as Message-ID

or third, new URI scheme can be introduced, such as "message-id:"
which supports file and message ID together.

Outside of scope of thread:
---

Personally I have it solved with hyperlinks on higher level, they
remain immutable inside of Org, while decision making how to open them
is decided in their definition.

[[elisp:(hyperscope-action 1)][ ╔ Notes]]

[[elisp:(hyperscope 73361)][Secondary School in Lobolwala]]

And there is even more general UUID based hyperlink:

[[elisp:(uuid "6ADD037A-31BC-435A-BEC8-FE990EBF2A17")][Secondary School in 
Lobolwala]]

UUID based hyperlinks avoid hard coding hyperlink, and avoid hard
coding the action to run hyperlink.

Actions for UUID are then defined by user. When capturing UUID
hyperlink, name is captured as well to construct Org hyperlink.

(defcustom rcd-db-uuid-action-alist '(("people" . cf-people-by-id)
  ("hyobjects" . hyperscope)
  ("sobjects" . ignore)
  ("predicates" . ignore)
  ("uuid2uuid" . ignore)
  ("properties" . 
rcd-notes-properties-list-by-referenced-uuid)
  ("statsdefinitions" . 
rcd-r-statistics-view)
  ("transactions" . 
rcd-accounts-transaction-edit)
  ("messages" . rcd-message-edit))
  "Database UUID action alist."
  :group 'rcd
  :type '(alist))

That way using abstract UUID hyperlinks enables more flexibility,
practically more collaboration and accessibility to hyperlinks, as it
does not "hard code" the object named "Joe Doe", as that object may go
across computers. "Joe Doe" vCard may be opened on computer A, if such
has been received, because it has same UUID inside, while on computer
B, database entry is opened locally for that UUID, but on computer C,
remote database entry is accessed.

> > Geo location shall be supported, as it has already many handlers in
> > GNU/Linux, then GPX files, GeoJSON files
> 
> Are there any? I only know web handlers. I did search at some point.

When you use geographic software, the /usr/share/applications get
populated with various handlers, for example:

  -rw-r--r-- 1 1.2K Jan 11 20:53 marble_geo.desktop
with Exec=marble --geo-uri=%u

Yes, there are many web based handlers.

In Emacs there is `osm' package that can easily use Openstreetmaps as
URI handler for "geo:"

-- 
Jean

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

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



Re: Should Org provide commonly used link types?

2023-01-26 Thread Jean Louis
* Ihor Radchenko  [2023-01-25 21:15]:
> Jean Louis  writes:
> 
> >> Suggestions welcome
> >
> > Main suggestion would be to make interface for users to easy setup
> > those hyperlinks.
> >
> > If user is supposed to adapt mind to programmer by setting this horror:
> > (info "(org) Adding Hyperlink Types")
> > that leads nowhere. Forget about "usability".
> 
> I am sorry, but what can be simpler than
> 
>  (org-link-set-parameters "man" :follow #'org-man-open)

Customize is simpler, it was made to help users, that is what we have in Emacs:

Hyperlink URI scheme: man
Function: org-man-open


-- 
Jean

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

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



Re: Org mode timestamps on the Moon ;]

2023-01-26 Thread Thomas S. Dye

Aloha Eric,

"Fraga, Eric"  writes:


On Thursday, 26 Jan 2023 at 15:24, Ihor Radchenko wrote:
"The Moon’s gravitational pull is weaker than Earth’s, meaning 
that, to
an observer on Earth, a lunar clock would run faster than an 
Earth one.
Gramling estimates that a lunar clock would gain about 56 
microseconds
over 24 hours" (how will it affect Org's timestamps? should we 
do

anything about it?)


Well, it would take a little over 120 years for this difference 
to affect an org time stamp (given resolution to the minute as 
used by org)...


I love what I'm learning about time zones etc. in this 
discussion thread!


Then I can recommend Carlo Rovelli's The Order of Time.

All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye



Re: Link from orgmode file to E-Mail (using kmail or notmuch)

2023-01-26 Thread Max Nikulin

On 25/01/2023 00:49, Jean Louis wrote:

When goto-mode works with mid: by me setting up browse-url-handlers,
then I have expected Org to work as well.


Do you mean `goto-address-mode'? Have you had a look into its 
implementation?





Re: Org mode timestamps on the Moon ;]

2023-01-26 Thread Fraga, Eric
On Thursday, 26 Jan 2023 at 15:24, Ihor Radchenko wrote:
> "The Moon’s gravitational pull is weaker than Earth’s, meaning that, to
> an observer on Earth, a lunar clock would run faster than an Earth one.
> Gramling estimates that a lunar clock would gain about 56 microseconds
> over 24 hours" (how will it affect Org's timestamps? should we do
> anything about it?)

Well, it would take a little over 120 years for this difference to affect an 
org time stamp (given resolution to the minute as used by org)...

I love what I'm learning about time zones etc. in this discussion thread!

-- 
: Eric S Fraga, with org release_9.6.1-199-g7ad779 in Emacs 30.0.50

Re: [PATCH] Change default value of org-clock-x11-idle-program-name

2023-01-26 Thread Max Nikulin

On 24/01/2023 19:41, Ihor Radchenko wrote:



What we can do is check if xprintidle executable is available and use
it. Otherwise, fall back to x11idle to retain backwards compatibility on
systems that do no have xprintidle installed.


See the attached patch.


I have not tested your patch, however I consider it as an improvement. I 
hope, effect of `executable-find' is negligible in respect to load time.






Re: UTC or not UTC for timestamps in the past ([FEATURE REQUEST] Timezone support in org-mode)

2023-01-26 Thread Max Nikulin

On 23/01/2023 23:04, Thomas S. Dye wrote:

* Kinds of event
- No-host event :: An event that takes place at an absolute time. 
Participants must know their local timezone offset from UTC. Example 
[2023-01-23 06:00@UTC].
- Situated event :: An event that takes place at a time local to the 
event site.  Participants must know their local timezone offset from UTC 
and the event site timezone offset from UTC at the time of the event.  
Example [2023-01-22 Sun 08:29@Australia/Sydney].
- [Itinerant | Traveling | Mobile] event :: An event that takes place at 
a time local to the event site, which might change after the event has 
been scheduled.  Participants must know their local timezone offset from 
UTC and the event site timezone offset from UTC at the time of the 
event.  Examples might be a regular staff meeting that takes place at 
9:00 AM wherever the boss happens to be, or a proposal to meet with a 
traveler when it is noon on Sunday for the traveler. Example [2023-01-23 
06:00].  In this case timezone is set according to user timezone 
preference in scope.


Thomas, I mostly agree with the set of event kinds your suggested. 
Perhaps names should be justified to have precise and concise terms in 
UI. From my point of view their value is association with appropriate 
storage format for particular timestamp.


An additional parameter (or sometimes first one to choose) is if 
explicit or implicit time zone should be used in the file. In the latter 
case the same kinds of events are possible, particular one is determined 
from a parent scope. User should be just aware what is actual time zone 
if it is implicit one.


The following concept is aside from event kinds, but might (or might 
not) be useful to present agenda, to schedule events, to implement the 
feature. Perhaps a trip may be considered as an ad hoc timezone that 
follows offsets of time in locations to visit. (Several such ad hoc time 
zones may allow to track schedule of several people, but it may be too 
complex to use.) It may be considered close to "mobile" event, but the 
purpose is not to ensure correct time of particular event. It may 
facilitate presentation of timeline during the trip.


Perhaps it is more correct to talk about how events are scheduled, not 
of event kinds. Consider Christmas and similar events. It is personal 
and local for each user. If you share your .org file (with specified 
file-local time zone) with other persons they celebrate accordingly to 
their local time. In addition they may decide that it should be pleasant 
for you to receive a greeting close to your local time.


It seems during discussion we use terms in slightly different meaning, 
so I will try to clarify my point of view.


I had a course on general relativity theory, so "absolute time" does 
make much sense for me. UTC is just a widely accepted agreement. I was 
bound to Earth rotation and accumulated some offset from more precise 
atomic clocks. UTC however currently is easiest way to perform time 
related calculations.


My perception is still that UTC is one of timezones that may be used to 
specify event time. It is a bit special since it is used as a reference 
for other time zones, so it may be preferable for global events. If UTC 
considered as an ordinary time zone then the whole set of time zones may 
be divided into 2 classes: with fixed time offset (including UTC, 
Etc/GMT+3 that may be specified as -03:00, etc) and with time zones 
associated to specific locations. Second class is affected by DST, 
changes of offsets that may be source of uncertainty. The role of UI is 
to help user to choose a timezone that is suited best for particular 
event. For events in the future often it is necessary to use a 
location-based time zone, in other cases it is UTC or anyone with fixed 
offset. When you recording current time, explicit offset may be better. 
I am still unsure what is better to use: kinds of events or kinds of 
time zones.


I agree that offset as a part of timestamp may be confusing, but I am 
afraid that significant part of affected users are unaware of UTC as 
well. That is why proper UI may be a challenging task.


Thomas, for me event kinds are less important than understanding that 
UTC timestamps are not enough achieve properly working schedule. 
Currently you see that timezones associated with locations in some cases 
must be used in stored timestamps. Have you noticed that I missed 
anything significant in your messages?





Org mode timestamps on the Moon ;] (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)

2023-01-26 Thread Ihor Radchenko
Tom Gillespie  writes:

> ; given my objective to ensure that org documents can be interpreted
> ; without having to stick stupid things like #+planet: mars in the
> ; header or risk your earthling readers getting incorrect dates --- I
> ; suggest that org switch to storing all dates and times in earth zulu
> ; time ...

https://www.nature.com/articles/d41586-023-00185-z

"The coming decade will see a resurgence in lunar exploration —
including dozens of missions and plans to establish permanent bases on
the Moon. The endeavours pose myriad challenges. Among them is a subtle,
but fundamental, question that metrologists worldwide are working to
answer: what time is it on the Moon?"

...

"It’s not obvious what form a universal lunar time would take. Clocks on
Earth and the Moon naturally tick at different speeds, because of the
differing gravitational fields of the two bodies"

...

"Decisions must be made soon,... If an official lunar time is not
established, space agencies and private companies will come up with
their own solutions" (and Org too?)

...

"Moon missions will also need an official lunar time to cooperate and
communicate, says Hahn. “All this has to trace to one kind of a time
reference, otherwise you have chaos and things do not work together.”"

...

"The Moon’s gravitational pull is weaker than Earth’s, meaning that, to
an observer on Earth, a lunar clock would run faster than an Earth one.
Gramling estimates that a lunar clock would gain about 56 microseconds
over 24 hours" (how will it affect Org's timestamps? should we do
anything about it?)

"...a clock’s speed would also subtly change depending on its position
on the lunar surface, because of the Moon’s rotation" (oh, dear...)

...

“The idea is to produce a Solar System internet,” says Gramling. “And
the first part would be at the Moon.” 

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



[SOLVED] (was: how to export to latex with $ constructs rcsinfo)

2023-01-26 Thread Uwe Brauer

> Uwe Brauer  writes:

> Then just use #+begin_export latex construct

Thanks! That solved the problem
-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: how to export to latex with $ constructs rcsinfo

2023-01-26 Thread Uwe Brauer
>>> "FE" == Fraga, Eric  writes:

> On Thursday, 26 Jan 2023 at 12:22, Uwe Brauer wrote:
>> \rcsInfo $Id: manual-matlab-git.tex,v 2716 2023/01/26 10:48:53 oub Exp oub $

> What if you protect this, as in

> @@latex:\rcsInfo $Id: manual-matlab-git.tex,v 2716 2023/01/26 10:48:53 oub 
> Exp oub $@@

Thanks but that does not work!


smime.p7s
Description: S/MIME cryptographic signature


Re: how to export to latex with $ constructs rcsinfo

2023-01-26 Thread Fraga, Eric
On Thursday, 26 Jan 2023 at 12:22, Uwe Brauer wrote:
> \rcsInfo $Id: manual-matlab-git.tex,v 2716 2023/01/26 10:48:53 oub Exp oub $

What if you protect this, as in

@@latex:\rcsInfo $Id: manual-matlab-git.tex,v 2716 2023/01/26 10:48:53 oub Exp 
oub $@@

?

(untested)
-- 
: Eric S Fraga, with org release_9.6-204-g2f7052 in Emacs 30.0.50


Re: how to export to latex with $ constructs rcsinfo

2023-01-26 Thread Ihor Radchenko
Uwe Brauer  writes:

>> IIUC, #+latex_header{,_extra} only handles the single line it is on.
>> Therefore, you will have to prefix "#+latex_header_extra:" for each line
>> you want to have in LaTeX verbatim.
>
> Thanks but this is a misunderstanding. I need that construct *after* 
> =\begin{document}=

Then just use #+begin_export latex construct

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



Re: how to export to latex with $ constructs rcsinfo

2023-01-26 Thread Uwe Brauer

> Uwe Brauer  writes:

Hi
> Hello,

> IIUC, #+latex_header{,_extra} only handles the single line it is on.
> Therefore, you will have to prefix "#+latex_header_extra:" for each line
> you want to have in LaTeX verbatim.

Thanks but this is a misunderstanding. I need that construct *after* 
=\begin{document}=


smime.p7s
Description: S/MIME cryptographic signature


Re: Supporting non-free SQL clients in ob-sql

2023-01-26 Thread Heinz Tuechler

Ihor Radchenko wrote/hat geschrieben on/am 26.01.2023 12:14:

Heinz Tuechler  writes:


Also, what about Emacs supporting MS DOS and old versions of Windows? Do
they still qualify as popular software?


Microsoft would probably appreciate, if only the latest version were
supported by free software.
best regards, Heinz


Are you implying that dropping support of obsolete non-free software
will encourage users to upgrade to newer versions of the same non-free
software?

Yes


If so, I disagree. It might equally encourage users to switch to newer
and also free equivalent.

You maybe right


Unless there is no free equivalent, which is
not true for Windows or MS DOS, AFAIK.





Re: Link from orgmode file to E-Mail (using kmail or notmuch)

2023-01-26 Thread Max Nikulin

On 26/01/2023 16:58, AW wrote:

This is about a maildirs of kmail on my local machine. The E-Mails are being
indexed by akonadi on the side of kde-pim.


Are you able to search messages through the KDE (global) dialog? Does it 
work if you try to find some Message-ID? Perhaps it is necessary to add 
more sources for searches in the dialog configuration. If Message-ID 
header is indexed then it might be possible to launch such search from Org.


Sorry, I do not use kmail or KDE indexers, so I am not enough motivated 
to check it myself. It just an idea, perhaps it leads to nothing.




Re: how to export to latex with $ constructs rcsinfo

2023-01-26 Thread General discussions about Org-mode.


Uwe Brauer  writes:

> Hi
>
> I have the following org file example
>
> #+LATEX_HEADER_EXTRA: \usepackage[scrpage2]{rcsinfo}
> \makeatletter
> \def\@rcsInfoFancyInfo{{\footnotesize%
> \emph{\fcolorbox{black}{yellow}{Rev: \rcsInfoRevision,}
> \rcsInfoOwner,
> \rcsInfoLongDate,
> \rcsInfoTime}}}
> \makeatother
> \rcsInfo $Id: manual-matlab-git.tex,v 2716 2023/01/26 10:48:53 oub Exp oub $
>
>
> Some text

Hello,

IIUC, #+latex_header{,_extra} only handles the single line it is on.
Therefore, you will have to prefix "#+latex_header_extra:" for each line
you want to have in LaTeX verbatim.

Best,


RY



how to export to latex with $ constructs rcsinfo

2023-01-26 Thread Uwe Brauer



Hi

I have the following org file example

#+LATEX_HEADER_EXTRA: \usepackage[scrpage2]{rcsinfo}
\makeatletter
\def\@rcsInfoFancyInfo{{\footnotesize%
\emph{\fcolorbox{black}{yellow}{Rev: \rcsInfoRevision,}
\rcsInfoOwner,
\rcsInfoLongDate,
\rcsInfoTime}}}
\makeatother
\rcsInfo $Id: manual-matlab-git.tex,v 2716 2023/01/26 10:48:53 oub Exp oub $ 


Some text


And I would like to export that to LaTeX but I need 
the string 
$Id: manual-matlab-git.tex,v 2716 2023/01/26 10:48:53 oub Exp 

Unchanged, but I always obtain 

\$Id: manual-matlab-git.tex,v 2716 2023/01/26 10:48:53 oub Exp oub $ 

Putting it in a src block does not help since I obtain than the verbatim
environment.

Any idea what to do?

Thanks

Uwe Brauer 

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/




Re: Supporting non-free SQL clients in ob-sql

2023-01-26 Thread Ihor Radchenko
Heinz Tuechler  writes:

>> Also, what about Emacs supporting MS DOS and old versions of Windows? Do
>> they still qualify as popular software?
>>
> Microsoft would probably appreciate, if only the latest version were
> supported by free software.
> best regards, Heinz

Are you implying that dropping support of obsolete non-free software
will encourage users to upgrade to newer versions of the same non-free
software?

If so, I disagree. It might equally encourage users to switch to newer
and also free equivalent. Unless there is no free equivalent, which is
not true for Windows or MS DOS, AFAIK.

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



Re: Supporting non-free SQL clients in ob-sql

2023-01-26 Thread Heinz Tuechler

Ihor Radchenko wrote/hat geschrieben on/am 26.01.2023 11:22:

Richard Stallman  writes:


Ihor Radchenko  wrote:

  > It is hard to define "well known". For me, oracle and mssql databases
  > are well-known (just by company name), while saphana and vertica are
  > not.

I have never heard of saphana or vertica, which suggests that maybe
this is an issue.  However, I don't know the database field, so I
am the wrong one to judge.


Would it then make sense to note the reasons why we support one or
another non-free software in a separate file like etc/NON-FREE-SUPPORT?
Non-free software popular now may not be popular in future, and thus it
will become not ethical to support it then.

Also, what about Emacs supporting MS DOS and old versions of Windows? Do
they still qualify as popular software?


Microsoft would probably appreciate, if only the latest version were
supported by free software.
best regards, Heinz



Re: [BUG] ob-sql sql-connection-alist

2023-01-26 Thread Bastien Guerry
Hi,

Ihor Radchenko  writes:

> Bastien, could you please confirm the copyright status of Andreas
> Gerler?

It was missing in the FSF copyright.list file, but it has been fixed
and Andreas can be added as a regular contributor.

Best,

-- 
 Bastien



Re: [PATCH] Fix one remaining emacs-30 byte-compile warning

2023-01-26 Thread Arash Esbati
Ihor Radchenko  writes:

> Thanks!
> Applied, onto bugfix.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=65ca7bc6a

Thanks!

> You are also now listed as a contributor.
> https://git.sr.ht/~bzg/worg/commit/36cbf082

Thanks for adding me.  You have me now under this section:

  * Current contributors with tiny changes

  These people have submitted tiny change patches that made it into Org
  without FSF papers.  When they submit more, we need to get papers
  eventually.

I have signed the FSF paper for GNU Emacs.  I'm not familiar with Org
development, but maybe you want to put me under, if at all:

  Here is the list of people who signed the papers with the Free Software
  Foundation and can now freely submit code to Org files that are included
  within GNU Emacs:

Best, Arash



Re: [ANN] orgtbl-fit

2023-01-26 Thread Ihor Radchenko
tbanelwebmin  writes:

> Actually, orgtbl-fit is a bridge between Org Mode tables and Calc.
>
> By the way, Org Mode table spreadsheet capabilities are also a bridge 
> with Calc.
>
> Examples & documentation can be read here:
> https://github.com/tbanel/orgtblfit/blob/main/README.org

Interesting.
Could it be somehow integrated with TBLFM formulas?
I imagine something like

? +?*year +?*passengers +?*(year-2016)*passengers

, when set as a column value in table formula, to be auto-updated with
actual coefficients upon re-calculating the table.

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



Re: Supporting non-free SQL clients in ob-sql (was: [PATCH] ob-sql: Add support for Athena)

2023-01-26 Thread Ihor Radchenko
Richard Stallman  writes:

> Ihor Radchenko  wrote:
>
>   > It is hard to define "well known". For me, oracle and mssql databases
>   > are well-known (just by company name), while saphana and vertica are
>   > not.
>
> I have never heard of saphana or vertica, which suggests that maybe
> this is an issue.  However, I don't know the database field, so I
> am the wrong one to judge.

Would it then make sense to note the reasons why we support one or
another non-free software in a separate file like etc/NON-FREE-SUPPORT?
Non-free software popular now may not be popular in future, and thus it
will become not ethical to support it then.

Also, what about Emacs supporting MS DOS and old versions of Windows? Do
they still qualify as popular software?

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



Re: Link from orgmode file to E-Mail (using kmail or notmuch)

2023-01-26 Thread Ihor Radchenko
AW  writes:

>> > Well, M-x  (browse-url "mid:3218434.44cspzl...@linux.fritz.box")
>> > produces [No match].
>> 
>> This is not a command.
>> You need M-: (...
>
> Sorry, I'm a user, not much knowledge of elisp. However, the result now is 
> 'nil'. 

On my side, it returns nil and _also_ opens mid:... url in browser. It
might also display an app selection dialogue, depending on your DM.
Did anything like I described happen on your side?

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



Re: Link from orgmode file to E-Mail (using kmail or notmuch)

2023-01-26 Thread AW
Am Dienstag, 24. Januar 2023, 11:42:01 CET schrieb Dirk-Jan C. Binnema:
> Sorry if I'm repeating things earlier mentioned...
> 
> mu4e supports message-id links through org-mode, and I *extensively*
> use that my agenda / todo lists. E.g.,
>mu4e:msgid:CACwzTKkeyptMcOA=jq8y23948-fkyfkmtwu...@mail.gmail.com

Thank you, I'll have a look into this. Sounds good that you use it much.

> To make it work through browse-url (is that useful?) shouldn't be too
> hard to configure `browse-url-default-handlers' for that. For mu4e that
> could simply use `mu4e-org-open', except that mu4e uses `msgid' (a
> better name imho) rather than `mid'.

>From my point of view that's not necessary. I'd like to have link which opens 
an emacs buffer displaying the E-Mail. 

-- 

Regards,
Alexander








Re: Link from orgmode file to E-Mail (using kmail or notmuch)

2023-01-26 Thread AW
Am Dienstag, 24. Januar 2023, 10:40:30 CET schrieb Ihor Radchenko:
> AW  writes:
> >> It is not up to Org. Try
> >> 
> >>  (browse-url "mid:3218434.44cspzl...@linux.fritz.box")
> >> 
> >> You will likely see nothing.
> > 
> > Well, M-x  (browse-url "mid:3218434.44cspzl...@linux.fritz.box")
> > produces [No match].
> 
> This is not a command.
> You need M-: (...

Sorry, I'm a user, not much knowledge of elisp. However, the result now is 
'nil'. 

> >> So, while Org may provide some limited help with mid:, as Max suggested,
> >> there is no way to guarantee that mid: links will work for all users
> >> without users hand-customizing how to open emails.
> >> 
> >> I am not even sure if we need to make Org open mid: links via
> >> `browse-url'. Maybe it should be something else? IDK.
> > 
> > This is weird since ever. I've been talking to some collegues and
> > everybody
> > has his/her own special approach. Mostly producing a PDF from the E-Mail
> > and saving this and its attachments somewhere. That's a thing that
> > bothered me for decades.
> 
> Well. The more widely used standard is Maildir - downloading emails from
> server to local machine. Emails are just files there that can be indexed
> by variety of mail client software.

This is about a maildirs of kmail on my local machine. The E-Mails are being 
indexed by akonadi on the side of kde-pim. But referring to a certain E-Mail 
from orgmode with a kind of link fails, because I'd need to got to the maildir 
and search for the specific E-Mail. kde-pim does not offer an easy way to 
extract that or the message-ID. 
> 
> The main question is which email clients actually support mid: links.
> notmuch does, but in non-standard way, without doing it system-wide.

And kmail obviously does not. OK, but since I installed notmuch, notmuch.el 
and ol-notmuch.el, I will have a look into using this. Thank you!

--

Regards,

Alexander







Re: [BUG] ob-shell doesn't evaluate last line on Windows (cmd/cmdproxy) [9.6.1 ( @ c:/Users/Osher/AppData/Roaming/.emacs.d/elpa/org-9.6.1/)]

2023-01-26 Thread Ihor Radchenko
Matt  writes:

>  >   On Fri, 20 Jan 2023 04:27:18 -0500  Ihor Radchenko  wrote --- 
>  > I think `org-babel--shell-command-on-region' will be more appropriate.
>  > Because similar issues might appear when attempting to evaluate other
>  > code blocks on Windows, where `shell-file-name' is set to cmdproxy.exe.
>
> Is something like this what you're thinking?  Or, do we want to check 
> explicitly for "cmdproxy.exe"?

AFAIK, extra newline should be safe in all other script languages.

> Also, this bug isn't currently tracked in Woof!.  I'm not able to confirm it, 
> but since we're putting in a fix, should be add it anyway?

Your message with a patch is supposed to be auto-detected... (It is not,
which is a bug)
Bastien, heads up.

Do not worry about Woof! just yet. The new version is not yet officially
used. Bastien is still polishing the code.

> - nil shell-command-switch command))
> + nil shell-command-switch
> +;; Pass newline to satisfy Windows
> +;; cmdproxy.exe prompt for More.
> +;;
> +;; See:
> +;; 
> `https://list.orgmode.org/orgmode/87bkmttv2h.fsf@localhost/'
> +(concat command "\n")))

This will add a newline to "cmdproxy.exe" command -> "cmdproxy.exe\n".
You should instead look into `org-babel--write-temp-buffer-input-file'.

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



Re: [PATCH][oc-csl] Improve reference parsing

2023-01-26 Thread Ihor Radchenko
[ Adding Org ML back to CC ]

András Simonyi  writes:

> On Thu, 19 Jan 2023 at 10:56, Ihor Radchenko  wrote:
>> So, do I understand correctly that italics, bold, subscript,
>> superscript, small-caps, and nocase must be passed to the CSL processor
>> in a format understood by CSL? Everything else could just be left in Org
>> and later exported according to actual export settings?
>
> Unfortunately, the situation is a bit different --  the solution I see
> the most viable is to export the affixes and the locator to a form in
> which
> the markup elements you listed (plus links, which I haven't mentioned
> but are also supported) are in the required CSL
> input form, but the rest is in plain text.

What do you mean by plain text? Plain text as in Org or plain text as in
ASCII export?

> Anything else would be way
> more complicated to handle in Citeproc and I don't
> really see the benefits/use-case either (we are talking about elements
> within a citation). This would "only" require a custom backend
> exporting CSL-supported elements in the html-like CSL format and
> everything else which is allowed by the Org syntax
> in plain text.

I am not much concerned about CSL format itself.
I am concerned about the formatted citation returned back to Org by CSL.

Consider the following:

[cite:Prefix *bold* +strike-through+ @key]

It will be interpreted by Org export as

(citation
(:style nil ...)
(citation-reference
 (:key "key"... :prefix
   ("Prefix "
(bold
 (... :post-blank 1 ...)
 "bold")
(strike-through
 (... :post-blank 1 ...)
 "strike-through")

Now, consider that the user has a custom export filter that decorates
"+strike-through+" like "!!strike-through!!" upon export.

If we pass the original citation to the CSL, will the export filter be
applied?

Also, what if user decorates a CSL locator with Org markup like
strike-through?
 
>> May we:
>> 1. Convert the Org markup supported by CSL into CSL-understood HTML
>> format
>> 2. Convert all other Org markup into verbatim
>
> I'm not sure what you mean by verbatim -- leaving it as Org markup?

Whatever prevents CSL from altering the text. (Like escaping "_" you
mentioned earlier)

>> 3. Convert back non-verbatim markup altered by CSL into Org
>> 4. Perform exporting Org->current export backend as usual.
>
> If verbatim is Org then step 3 could be rather complicated, we'd need
> to identify
> the Org fragments in citeproc's HTML and LaTeX output when those
> backends are used.

But can't CSL output in Org format? Isn't the whole CSL thing supposed
to work for arbitrary export backend, not just HTML and LaTeX?

> Also I'd worry that the result would not pass through Citeproc's
> post-processing steps --
> there is now a user-customizable hook variable for citation post-processing
> which acts on the internal representations.

I envision the conversion back to Org to happen after _all_ the
Citeproc's processing, be it user-customized or not.

> All in all I'd first concentrate on the use-case: is there anything
> important left out
> if we go with simply using a custom backend to export the CSL-supported markup
> in CSL input format and everything else as plain text, then do what we
> do know, namely
> either simply insert the Citeproc-formatted output into the exported document
> without any post-processing (currently this is for LaTeX and HTML), or
> parse and export
> with Org when the Org Citeproc formatter is used (currently for all
> other formats),

What I imagine is doing "parse and export with Org" all the time,
including HTML and LaTeX export.

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



Re: [PATCH] oc-natbib: Provide a fallback bibliography style

2023-01-26 Thread Ihor Radchenko
András Simonyi  writes:

>> Also, should we provide some commonly available natbib styles in the
>> defcustom?
>
> What would this look like?

`org-cite-natbib-options' has the following:

:type
  '(set
(const :tag "use round parentheses (default)" round)
(const :tag "use square brackets" square)
(const :tag "use curly braces" curly)
...)

We can provide a list of possible bibliography styles (distributed with
TeXLive) maybe also with a description. However, my TeXLive has >300
.bst files in it. We certainly don't want to list all of them. Maybe
just the most popular. But what are "the most popular"?

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



Re: Org cite in SQLite?

2023-01-26 Thread Ihor Radchenko
"Thomas S. Dye"  writes:

> The @ character in an Org citation seems to block import to an 
> SQLite table.
>
> Has anyone successfully imported an Org citation to an SQLite 
> table?

Could you please elaborate?

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



Re: [PATCH] Fix one remaining emacs-30 byte-compile warning

2023-01-26 Thread Ihor Radchenko
Arash Esbati  writes:

> Ihor Radchenko  writes:
>
>> Could you please write a full patch with commit message? See
>> https://orgmode.org/worg/org-contribute.html#first-patch
>
> Thanks for your response.  I hope I've got it right.

Thanks!
Applied, onto bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=65ca7bc6a

You are also now listed as a contributor.
https://git.sr.ht/~bzg/worg/commit/36cbf082

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