Re: Is this proper time format?

2023-06-16 Thread Ihor Radchenko
David Masterson  writes:

>> What about:
>>
> ...
> I agree with your change.  I'm often minimalist in my changes (especially when
> I'm trying not to rock the boat), but that's not always good.  If that's
> it, make the change in both files and we can call it a day.  :-)

May you please re-create the patch for the current main?

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



Re: [POLL] Will it be ok to allow HABIT property inheritance? (optionally) (was: [BUG] org-habit does not respect STYLE property inheritance)

2023-06-16 Thread Ihor Radchenko
Dmitry Logvinenko  writes:

> Subject: [PATCH] lisp/org-habit.el: Inherit habit style property
>
> * lisp/org-habit.el (org-is-habit-p):  Use `org-entry-get' with
> 'selective option to optionally find habit subheadings.
> * etc/ORG-NEWS: Describe a breaking change.

Thanks for the patch!
May I know if you have FSF copyright assignment?
If not, you need to add TINYCHANGE cookie to the commit message.
See https://orgmode.org/worg/org-contribute.html#first-patch

> --- a/etc/ORG-NEWS
> +++ b/etc/ORG-NEWS
> @@ -478,6 +478,18 @@ After:
>  : ("simple" "list")
>  #+end_src
>  
> +
> +*** =org-habit.el= now optionally inherits ~:STYLE: habit~ properties
> +
> +Currently, the ~STYLE~ property of habits is not inherited when searching
> +for entries.
> +
> +This change allows the property to be inherited optionally by customizing
> +the ~org-use-property-inheritance~ variable.
> +
> +This change aims to provide more flexibility in managing habits, allowing
> +users to dedicate separate subtrees or files to habits without manually
> +setting the ~STYLE~ property for each sub-task.

Please add this under Org 9.7. It is for main branch - next release.
Also, please mention that the change is breaking when
`org-use-property-inheritance' is set to t. This is important
information - we need to explain how the change can break existing configs.

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



org-table, empty cells and nan

2023-06-16 Thread Uwe Brauer
Hi 

I have the following table(s)



| Name  | Exam1 | Exam2 | Exercises | Ex1_Ex2 | Total |
|---+---+---+---+-+---|
| Smith |   |  7.90 |   |5.81 | NP|
#+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+$4); E f-1

However when colum 2 is not empty but colum 4 is then I obatin *nan*

| Name  | Exam1 | Exam2 | Exercises | Ex1_Ex2 | Total |
|---+---+---+---+-+---|
| Smith |   5.9 |  7.90 |   |5.81 |   nan |
#+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+$4); E f-1


A solution is to put 0 in colum 4, but for some reasons which are a
complicated to explain, I want to avoid that.

| Name  | Exam1 | Exam2 | Exercises | Ex1_Ex2 | Total |
|---+---+---+---+-+---|
| Smith |   5.9 |  7.90 | 0 |5.81 |   5.8 |
#+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+$4); E f-1



Any idea how to deal with the situation?

Regards

Uwe Brauer 




Re: [PATCH] ox-html.el: add option to embed SVG for CSS support in SVG

2023-06-16 Thread gerard . vermeulen




On 15.06.2023 22:51, Ihor Radchenko wrote:

gerard.vermeu...@posteo.net writes:


On 07.06.2023 19:57, Ihor Radchenko wrote:

I am not expert in html. Maybe someone else (Timothy?) can chime in.

That said, I do not see why we cannot offer  strategy as an
option regardless whether is can solve the problem with CSS.


;; For each SVG image during HTML export:
;; 1. It checks `svg-as-object' and "image in-lining" whether to
;;embed the SVG image in an  tag.
;; 2. If not, it checks `svg-inclusion' and "image in-lining"
;;whether to copy the SVG contents to the HTML output.
;; 3. If not, it falls back to checking "image in-lining" whether to
;;embed the SVG image in an  tag (as any other image type).
;; 4. It is possible to set `svg-as-object' and/or `svg-inclusion':
;;- For each SVG link by means of "#+ATTR_HTML: :svg-as-object t"
;;  or "#+ATTR_HTML: :svg-inclusion t".
;;- Within file scope by means of "#+OPTIONS: svg-as-object:t" or
;;  "#+OPTIONS: svg-inclusion:t".
;;- Within toplevel scope by means of the options
;;  `org-html-svg-as-object' or `org-html-svg-inclusion'.


I think you missed `org-html-inline-image-rules' where users can
include/exclude svg images from inlining.


The term "image in-lining" is a very terse description of what my code 
does.


In case of rules 1, 2, and 3 above: the code takes into account the two
relevant options `org-html-inline-image' and 
`org-html-inline-image-rules'

to decide  whether the image would be in-lined in an  tag.

For rule 1 above: in case `svg-as-object' is also true, the code 
in-lines

the image in an  tag instead of an  tag and returns
the  tag. In case `svg-as-object' is nil, apply rule 2.

For rule 2 above: in case `svg-inclusion' is also true,  return the SVG
contents as a result. In case `svg-inclusion' is nil, apply rule 3.

Rule 3 is applied by the normal "Image file" handling code from
org-html-link in ox-html which handles `org-html-image-inline-rules',
but my code for rules 1 and 2 do too.

My clone of org-html-link is a copy with the exception that I
added 4 lines of code (and 2 lines of comments) to implement
the rules 1 and 2 (but we should not implement rule 2).

Before going ahead with a patch to in-line images in  tags,
there remains the question of how to make those tags behave as
much as possible as  tags.  My knowledge of HTML is very thin
and Javascript even worse.

Best regards -- Gerard










Re: org-table, empty cells and nan

2023-06-16 Thread Bruno Barbier


Hi,

Uwe Brauer  writes:

> A solution is to put 0 in colum 4, but for some reasons which are a
> complicated to explain, I want to avoid that.
>
> | Name  | Exam1 | Exam2 | Exercises | Ex1_Ex2 | Total |
> |---+---+---+---+-+---|
> | Smith |   5.9 |  7.90 | 0 |5.81 |   5.8 |
> #+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+$4); E f-1
>
>
>
> Any idea how to deal with the situation?

Maybe this formula?

#+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+ if("$4" == 
"nan", 0, $4)); E f-1

Regards,

Bruno



Re: org-table, empty cells and nan

2023-06-16 Thread Uwe Brauer
>>> "BB" == Bruno Barbier  writes:

> Hi,

> Uwe Brauer  writes:

>> A solution is to put 0 in colum 4, but for some reasons which are a
>> complicated to explain, I want to avoid that.
>> 
>> | Name  | Exam1 | Exam2 | Exercises | Ex1_Ex2 | Total |
>> |---+---+---+---+-+---|
>> | Smith |   5.9 |  7.90 | 0 |5.81 |   5.8 |
>> #+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+$4); E f-1
>> 
>> 
>> 
>> Any idea how to deal with the situation?

> Maybe this formula?

> #+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+ if("$4" == 
> "nan", 0, $4)); E f-1

Ha nested if, ah, of course

Thanks very very much


-- 
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 NATO membership of the Ukraine.
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


Export settings in subtree level with org-koma-letter

2023-06-16 Thread Sébastien Gendre
Hello,

I try to use Org-mode and org-koma-letter to make letters.

I want to have one file where each first level headline as a letter. So,
I tried to define the export settings of org-koma-letter as headline
properties. With no success.


Here is an example:

#+begin_src org

* Example of letter
:PROPERTIES:
:LANGUAGE: en
:AUTHOR: Me
:FROM_ADDRESS: 4 place of nowhere
:EMAIL: m...@example.com
:PHONE_NUMBER: 000-000-000
:TO_ADDRESS: Someone, 4 place somewhere
:OPENING: Hello,
:CLOSING: Bye.
:DATE: \today
:PLACE: Here
:OPTIONS: foldmarks:nil phone:t email:t
:END:

This is a test of text, a test of text, a test of text, a test of
text, a test of text, a test of text, a test of text, a test of text,
a test of text, a test of text, a test of text, a test of text, a test
of text, a test of text, a test of text, a test of text, a test of
text, a test of text, a test of text, a test of text, a test of text,
a test of text, a test of text, a test of text, a test of text, a test
of text, a test of text, a test of text, a test of text, a test of
text, a test of text, a test of text, a test of text, a test of text,
a test of text, a test of text, a test of text, a test of text.


* Another example of letter
:PROPERTIES:
:LANGUAGE: en
:AUTHOR: Not me
:FROM_ADDRESS: 5 place of nowhere
:EMAIL: not...@example.com
:PHONE_NUMBER: 000-000-001
:TO_ADDRESS: Someone, 5 place somewhere
:OPENING: Hello there,
:CLOSING: I'll be back.
:DATE: \today
:PLACE: There
:OPTIONS: foldmarks:nil phone:t email:t
:END:

This is not a test of text, not a test of text, not a test of text, not a test 
of
text, not a test of text, not a test of text, not a test of text, not a test of 
text,
not a test of text, not a test of text, not a test of text, not a test of text, 
not a test
of text, not a test of text, not a test of text, not a test of text, not a test 
of
text, not a test of text, not a test of text, not a test of text, not a test of 
text,
not a test of text, not a test of text, not a test of text, not a test of text, 
not a test
of text, not a test of text, not a test of text, not a test of text, not a test 
of
text, not a test of text, not a test of text, not a test of text, not a test of 
text,
not a test of text, not a test of text, not a test of text, not a test of text.

#+end_src

After an export with ~(org-koma-letter-export-to-pdf nil t)~, in the
resulted PDF, only the author and date are set.

Do I do something wrong ?

Emacs version: 28.2
Orgmode version: 9.5.5



Best regards.




Re: Export settings in subtree level with org-koma-letter

2023-06-16 Thread Sébastien Gendre
So, I posted my question too soon.

To use the export option as properties, I had to add EXPORT_ prefix.

Example, not this:
:PROPERTIES:
:LANGUAGE: en
:AUTHOR: Me
:FROM_ADDRESS: 4 place of nowhere
:END:

But this:
:PROPERTIES:
:EXPORT_LANGUAGE: en
:EXPORT_AUTHOR: Me
:EXPORT_FROM_ADDRESS: 4 place of nowhere
:END:

Sorry.


Sébastien Gendre  writes:

> Hello,
>
> I try to use Org-mode and org-koma-letter to make letters.
>
> I want to have one file where each first level headline as a letter. So,
> I tried to define the export settings of org-koma-letter as headline
> properties. With no success.
>
>
> Here is an example:
>
> #+begin_src org
>
> * Example of letter
> :PROPERTIES:
> :LANGUAGE: en
> :AUTHOR: Me
> :FROM_ADDRESS: 4 place of nowhere
> :EMAIL: m...@example.com
> :PHONE_NUMBER: 000-000-000
> :TO_ADDRESS: Someone, 4 place somewhere
> :OPENING: Hello,
> :CLOSING: Bye.
> :DATE: \today
> :PLACE: Here
> :OPTIONS: foldmarks:nil phone:t email:t
> :END:
>
> This is a test of text, a test of text, a test of text, a test of
> text, a test of text, a test of text, a test of text, a test of text,
> a test of text, a test of text, a test of text, a test of text, a test
> of text, a test of text, a test of text, a test of text, a test of
> text, a test of text, a test of text, a test of text, a test of text,
> a test of text, a test of text, a test of text, a test of text, a test
> of text, a test of text, a test of text, a test of text, a test of
> text, a test of text, a test of text, a test of text, a test of text,
> a test of text, a test of text, a test of text, a test of text.
>
>
> * Another example of letter
> :PROPERTIES:
> :LANGUAGE: en
> :AUTHOR: Not me
> :FROM_ADDRESS: 5 place of nowhere
> :EMAIL: not...@example.com
> :PHONE_NUMBER: 000-000-001
> :TO_ADDRESS: Someone, 5 place somewhere
> :OPENING: Hello there,
> :CLOSING: I'll be back.
> :DATE: \today
> :PLACE: There
> :OPTIONS: foldmarks:nil phone:t email:t
> :END:
>
> This is not a test of text, not a test of text, not a test of text, not a 
> test of
> text, not a test of text, not a test of text, not a test of text, not a test 
> of text,
> not a test of text, not a test of text, not a test of text, not a test of 
> text, not a test
> of text, not a test of text, not a test of text, not a test of text, not a 
> test of
> text, not a test of text, not a test of text, not a test of text, not a test 
> of text,
> not a test of text, not a test of text, not a test of text, not a test of 
> text, not a test
> of text, not a test of text, not a test of text, not a test of text, not a 
> test of
> text, not a test of text, not a test of text, not a test of text, not a test 
> of text,
> not a test of text, not a test of text, not a test of text, not a test of 
> text.
>
> #+end_src
>
> After an export with ~(org-koma-letter-export-to-pdf nil t)~, in the
> resulted PDF, only the author and date are set.
>
> Do I do something wrong ?
>
> Emacs version: 28.2
> Orgmode version: 9.5.5
>
>
>
> Best regards.




Re: Is this proper time format?

2023-06-16 Thread David Masterson
Ihor Radchenko  writes:

> May you please re-create the patch for the current main?

Ok. See below.

Minor question -- I've used Ediff in the past, but I now see diff-mode
in Emacs.  I get the idea of it (I think I used an early version of it
in the deep past), but wonder if I am seeing a bug in it.  In the diff
file below, there is a few mentions of "=--=" in separating timestamps
in a date/time range.  When I view the diff file in Diff mode, a couple
on those strings show up and a couple do not.  I had to check the file
with 'less' to make sure the diff file was intact.  Switching from
unified to context view didn't change this.

Am I missing an option in diff mode or is this a bug around handling
this particular string?

Change log:

Doc change to explain timestamps better

doc/org-guide.org (Dates and Times): purpose of timestamp + examples
doc/org-manual.org (Dates and Times): purpose of timestamp + examples


diff --git a/doc/org-guide.org b/doc/org-guide.org
index 828bdd872..a6d4e7c3d 100644
--- a/doc/org-guide.org
+++ b/doc/org-guide.org
@@ -1081,7 +1081,15 @@
 
 To assist project planning, TODO items can be labeled with a date
 and/or a time.  The specially formatted string carrying the date and
-time information is called a /timestamp/ in Org mode.
+time information is called a /timestamp/ in Org mode.  This may be
+a little confusing because timestamp is often used as indicating when
+something was created or last changed.  However, in Org mode this term
+is used in a much wider sense.
+
+Timestamps can be used to plan appointments, schedule tasks, set
+deadlines, track time, and more.  The following sections describe
+the timestamp format and tooling that Org mode provides for common
+use cases dealing with time and time intervals.
 
 ** Timestamps
 :PROPERTIES:
@@ -1099,12 +1107,16 @@ the agenda (see [[*The Weekly/Daily Agenda]]).  We distinguish:
 
   A simple timestamp just assigns a date/time to an item.  This is
   just like writing down an appointment or event in a paper agenda.
+  There can be multiple timestamps in an item.
 
   #+begin_example
   ,* Meet Peter at the movies
 <2006-11-01 Wed 19:15>
   ,* Discussion on climate change
 <2006-11-02 Thu 20:00-22:00>
+  ,* My days off
+<2006-11-03 Fri>
+<2006-11-06 Mon>
   #+end_example
 
 - Timestamp with repeater interval ::
@@ -1121,8 +1133,6 @@ the agenda (see [[*The Weekly/Daily Agenda]]).  We distinguish:
 
 - Diary-style expression entries ::
 
-  #+cindex: diary style timestamps
-  #+cindex: sexp timestamps
   For more complex date specifications, Org mode supports using the
   special expression diary entries implemented in the Emacs Calendar
   package.  For example, with optional time:
@@ -1132,13 +1142,28 @@ the agenda (see [[*The Weekly/Daily Agenda]]).  We distinguish:
 <%%(diary-float t 4 2)>
   #+end_example
 
+- Time range
+
+  Time range is a timestamp having two time units connected by =-=
+
+  #+begin_example
+  ,* Discussion on climate change
+<2006-11-02 Thu 10:00-12:00>
+  #+end_example
+
 - Time/Date range ::
 
-  Two timestamps connected by =--= denote a range.
+  Two timestamps connected by =--= denote a range.  In the agenda, the
+  headline is shown on the first and last day of the range, and on any
+  dates that are displayed and fall in the range.  The first example
+  specifies just the dates of the range while the second example
+  specifies a time range for each date.
 
   #+begin_example
   ,** Meeting in Amsterdam
  <2004-08-23 Mon>--<2004-08-26 Thu>
+  ,** This weeks committee meetings
+ <2004-08-23 Mon 10:00-11:00>--<2004-08-26 Thu 10:00-11:00>
   #+end_example
 
 - Inactive timestamp ::
diff --git a/doc/org-manual.org b/doc/org-manual.org
index c11694849..e0c100474 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -5978,7 +5978,6 @@ or a dynamic block.
 #+cindex: dates
 #+cindex: times
 #+cindex: timestamp
-#+cindex: date stamp
 
 To assist project planning, TODO items can be labeled with a date
 and/or a time.  The specially formatted string carrying the date and
@@ -5987,22 +5986,26 @@ a little confusing because timestamp is often used as indicating when
 something was created or last changed.  However, in Org mode this term
 is used in a much wider sense.
 
+Timestamps can be used to plan appointments, schedule tasks, set
+deadlines, track time, and more.  The following sections describe
+the timestamp format and tooling that Org mode provides for common
+use cases dealing with time and time intervals.
+
 ** Timestamps
 :PROPERTIES:
 :DESCRIPTION: Assigning a time to a tree entry.
 :END:
 #+cindex: timestamps
 #+cindex: ranges, time
-#+cindex: date stamps
 #+cindex: deadlines
 #+cindex: scheduling
 
-A timestamp is a specification of a date (possibly with a time) in a
-special format, either =<2003-09-16 Tue>= or
-=<2003-09-16 Tue 09:39>=[fn:19].  A timestamp can appear anywhere in
-the headline or body of an Org tree entry.  It