Re: Is this proper time format?

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

> David Masterson  writes:
>
>> Ihor Radchenko  writes:
>>
>>> May you please re-create the patch for the current main?
>>
>> Ok. See below.
>
> Thanks!
> See the attached final draft.

What's the command to save the attachment?  It doesn't look like a mime
attachment to me,

> I amended removals of cindex entries in the manual - redundancy will not
> hurt here (for better searchability).

If they've got a purpose, that's fine.

> I also slightly adjusted the wording and fixed list indentation in
> one of description list items.

One minor note -- I think of datestamp & timestamp as one word each
while 'date range' & 'time range' are two words each.  Unless you've got
other reasons, I'd follow this convention.  I think I see one 'cindex'
that has 'timerange'.

> Finally, I detailed all the changes in the commit message and added
> TINYCHANGE cookie.

Thanks.  This is a good example for me.

> Let me know if you are ok with this version.

It looks good except for the minor note above.

> Please note that with this patch your total contribution is approaching
> non-trivial 15LOC. Further patches will require FSF copyright
> assignment.

You got the number via some 'git' command??  If I get to doing more, I
will do the copyright assignment -- I just never thought I'd make much
changes. 

-- 
David Masterson



batch breaks bugfix

2023-06-17 Thread Samuel Wales
can you think of any differences between bugfix and main
that could result in

1) bugfix not producing certain agenda entries from the org
   outline (THE BUG)
2) with no obvious differences between the entries that show
   and the entries that do not
3) FROM A BATCH CALL.  removing --batch from the emacs call
   removes the bug.

i am merely hoping for an a priori idea about what might be
different from bugfix to main so that i don't have to do
what for unrealted reasons i cannot do at this time which is
produce an ecm.  27.1.  apologies for bad non-bug-report.

===

(info "(elisp) Startup Summary") says what --batch does
differehtly from interactive.  long ago i tried to make
testcase be like normal emacs gui use.  loads .emacs, which
batch does not.  i have no default library for batch to not
run.  i did not do the other stuff --batch does.  recently
adding (package-initialize) made no difference.

so idk what --batch is doing or not doing to screw up the
bugfix agenda but not main.

batch maint has sorting differences from main, which i will
presume are expected and fixable.

===

i wouldn't care about this issue but i like running my old
regression script to ensure agenda works ok.


-- 
The Kafka Pandemic

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



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

2023-06-17 Thread Sébastien Miquel

Hi Ihor, wolf,

Ihor Radchenko writes:

Confirmed.
This is caused by `org-src--contents-for-write-back' not adjusting
blank line indentation in some cases.


I don't think that's the issue. In fact, applying your diff didn't
seem to solve the issue on my end.

Generally, if you edit the given yaml in a =C-c C-'= buffer and go
back to the org buffer with the default configuration, spaces will be
converted to tabs, because =indent-tabs-mode= is =t= in the org buffer.

I don't think there's much that we can do about it. We could try to
read the value of =indent-tabs-mode= in the native buffer and preserve
it in the org buffer, but then the org buffer would have mixed
indentation all over, and that's exactly what the current code tries to
avoid.

To fix the original issue, you can set =indent-tabs-mode= to =nil= in
your org files, or possibly set =org-preserve-indentation= to =t=
(untested).


I feel that the whole approach we use now with preserve-fl, use-tabs?,
and preserve-blank-line is overcomplicated. Maybe someone can explain
why we need all these special cases? The code does not reveal a whole lot.


 - =use-tabs?= seems pretty straightforward, its purpose is to respect
   the value of =indent-tabs-mode= in the org buffer.
 - =preserve-fl= is an isolated issue, and only concerns LaTeX
   fragments. I will attach a test with the issue it solves with
   multiline LaTeX fragments. I think LaTeX fragments are particular
   because in the org buffer they do not need to start at the
   beginning of a line.
 - The =preserve-blank-line= part (committed by me) is quite abstruse.
   Its name does not make any sense !

   Originally, we did not try to reindent blank lines when writing
   back to the org buffer. I changed it so that when using
   =org-return=, the newline would get correctly indented, I think.
   Then I changed it again so that only the current blank line might
   get indented, see
   : https://list.orgmode.org/725763.1632663...@apollo2.minshall.org/T/
   The variable =preserve-blank-line= decides whether we should indent
   the current blank line (if it is empty, we should maybe not).


Here are three patches attached.
 1. Two tests : about editing LaTeX fragments, and preserving empty
lines.
 2. Renaming of =preserve-blank-line=, for clarity.
 3. Two more tests testing the behaviour of =org-return= and
indentation, with the default configuration. When writing these, I
found the behaviour was buggy in one case, and modified
=org-indent-line= to fix it.

Does that look alright to you ?

Regards,
--
Sébastien MiquelFrom 9613a54d20883e56301f987f5495b962f3763cad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= 
Date: Sat, 17 Jun 2023 17:00:51 +0200
Subject: [PATCH] test-org-src.el: Add two tests

* testing/lisp/test-org-src.el (test-org-src/preserve-empty-lines):
Test that empty lines are not indented.
(test-org-src/indented-latex-fragments): Test special edit of
multiline indented LaTeX fragment.
---
 testing/lisp/test-org-src.el | 52 
 1 file changed, 52 insertions(+)

diff --git a/testing/lisp/test-org-src.el b/testing/lisp/test-org-src.el
index 2a45ba66e..42edb364a 100644
--- a/testing/lisp/test-org-src.el
+++ b/testing/lisp/test-org-src.el
@@ -144,6 +144,47 @@ This is a tab:\t.
   (org-edit-src-exit)
   (buffer-string))
 
+(ert-deftest test-org-src/preserve-empty-lines ()
+  "Editing block preserves empty lines."
+  (should
+   (equal "
+#+begin_src emacs-lisp
+  The following line is empty
+
+  abc
+#+end_src"
+  (org-test-with-temp-text
+   "
+#+begin_src emacs-lisp
+  The following line is empty
+
+  abc
+#+end_src"
+   (let ((org-edit-src-content-indentation 2)
+ (org-src-preserve-indentation nil))
+ (org-edit-special)
+ (org-edit-src-exit)
+ (buffer-string)
+  (should
+   (equal "
+#+begin_src emacs-lisp
+  The following line is empty
+
+  abc
+#+end_src"
+  (org-test-with-temp-text
+   "
+#+begin_src emacs-lisp
+  The following line is empty
+
+  abc
+#+end_src"
+   (let ((org-edit-src-content-indentation 2)
+ (org-src-preserve-indentation nil))
+ (org-edit-special)
+ (org-edit-src-exit)
+ (buffer-string)  )
+
 (ert-deftest test-org-src/coderef-format ()
   "Test `org-src-coderef-format' specifications."
   ;; Regular tests in a src block, an example block and an edit
@@ -376,6 +417,17 @@ This is a tab:\t.
 	(org-edit-src-exit)
 	(buffer-string))
 
+(ert-deftest test-org-src/indented-latex-fragments ()
+  "Test editing multiline indented LaTeX fragment."
+  (should
+   (equal
+"- Item $abc\n  efg$"
+(org-test-with-temp-text
+ "- Item $abc\n  efg$"
+ (org-edit-special)
+ (org-edit-src-exit)
+ (buffer-string)
+
 (ert-deftest test-org-src/footnote-references ()
   "Test editing footnote references."
   ;; 

[PATCH] ox-html.el: Fix relative links with :html-link-use-abs-url

2023-06-17 Thread Akira Kyle


I'm pretty sure this fixes a bug and that the intended behavior is 
that when publishing with, say, ~:html-link-use-abs-url t~ and 
~:html-link-home mysite.com~, one would expect a link like 
~[[file:my/page.org]]~ to be exported to ~mysite.com/my/page.com~.


I may have have misunderstood something though.

>From e9b8b782dbf956c855e2e3cdec5b9e8aa47d47c1 Mon Sep 17 00:00:00 2001
From: Akira Kyle 
Date: Mon, 27 Feb 2023 12:12:32 -0700
Subject: [PATCH] org-html-link: Fix relative links with :html-link-use-abs-url

* lisp/ox-html.el (org-html-link): When publishing relative links with
both :html-link-use-abs-url and :html-link-home, ensure the correct
link is constructed.
---
 lisp/ox-html.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index b519402b1..27da1cc30 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -3227,7 +3227,7 @@ INFO is a plist holding contextual information.  See
 			 (org-trim (plist-get info :html-link-home)
 	  (when (and home
 			 (plist-get info :html-link-use-abs-url)
-			 (file-name-absolute-p raw-path))
+			 (not (file-name-absolute-p raw-path)))
 		(setq raw-path (concat (file-name-as-directory home) raw-path
 	;; Maybe turn ".org" into ".html".
 	(setq raw-path (funcall link-org-files-as-html-maybe raw-path info))
-- 
2.41.0



Re: [PATCH] ox-icalendar: Unscheduled tasks & repeating tasks

2023-06-17 Thread Jack Kamm
Ihor Radchenko  writes:

> Would it make sense to throw a warning instead of silently skipping ~++~
> and ~.+~ repeaters?
>
> I think it would make sense to link to this variable in the
> `org-icalendar-use-scheduled' docstring and possibly in the manual.

Thanks, I agree.  I've updated the patch to add a warning for the
nonstandard repeaters (plus a unit test), and also added links to
`org-icalendar-todo-unscheduled-start' in the manual and
`org-icalendar-use-scheduled' docstring.

For convenience I attach these as separate patches here.  If it looks
OK I will squash with the prior patch before applying to main.

>From 80c05e00335062cc96bdcd85ec507066af4a1d3b Mon Sep 17 00:00:00 2001
From: Jack Kamm 
Date: Sat, 17 Jun 2023 07:55:17 -0700
Subject: [PATCH 2/3] ox-icalendar: Display warning for unsupported repeaters

This commit to be squashed with the previous one

* lisp/ox-icalendar.el (org-icalendar--repeater-type): Helper function
to get the repeater type, and display warning if not supported.
* testing/lisp/test-ox-icalendar.el
(test-ox-icalendar/warn-unsupported-repeater): Unit test to warn for
unsupported repeater types.
---
 lisp/ox-icalendar.el  | 30 +-
 testing/lisp/test-ox-icalendar.el | 14 ++
 2 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el
index 8c569752b..0dbc623b4 100644
--- a/lisp/ox-icalendar.el
+++ b/lisp/ox-icalendar.el
@@ -810,6 +810,23 @@ (\"PUBLIC\", \"CONFIDENTIAL\", and \"PRIVATE\") are predefined, others
 	(org-icalendar--valarm entry timestamp summary)
 	"END:VEVENT")))
 
+(defun org-icalendar--repeater-type (elem)
+  "Return ELEM's repeater-type if supported, else warn and return nil."
+  (let ((repeater-value (org-element-property :repeater-value elem))
+(repeater-type (org-element-property :repeater-type elem)))
+(cond
+ ((not (and repeater-type
+repeater-value
+(> repeater-value 0)))
+  nil)
+ ;; TODO Add catch-up to supported repeaters (use EXDATE to implement)
+ ((not (memq repeater-type '(cumulate)))
+  (org-display-warning
+   (format "Repeater-type %s not currently supported by iCalendar export"
+   (symbol-name repeater-type)))
+  nil)
+ (repeater-type
+
 (defun org-icalendar--vtodo
 (entry uid summary location description categories timezone class)
   "Create a VTODO component.
@@ -826,13 +843,8 @@ (defun org-icalendar--vtodo
 		  (org-element-property :scheduled entry)))
  (dl (and (memq 'todo-due org-icalendar-use-deadline)
   (org-element-property :deadline entry)))
- ;; TODO Implement catch-up repeaters using EXDATE
- (sc-repeat-p (and (eq (org-element-property :repeater-type sc)
-   'cumulate)
-   (> (org-element-property :repeater-value sc) 0)))
- (dl-repeat-p (and (eq (org-element-property :repeater-type dl)
-   'cumulate)
-   (> (org-element-property :repeater-value dl) 0)))
+ (sc-repeat-p (org-icalendar--repeater-type sc))
+ (dl-repeat-p (org-icalendar--repeater-type dl))
  (repeat-value (or (org-element-property :repeater-value sc)
(org-element-property :repeater-value dl)))
  (repeat-unit (or (org-element-property :repeater-unit sc)
@@ -881,14 +893,14 @@ (defun org-icalendar--vtodo
  (eq repeat-unit (org-element-property
   :repeater-unit dl)
   ;; TODO Implement via RDATE with changing DURATION
-  (warn "Not yet implemented: \
+  (org-display-warning "Not yet implemented: \
 different repeaters on SCHEDULED and DEADLINE. Skipping.")
   nil)
  ;; DEADLINE has repeater but SCHEDULED doesn't
  ((and dl-repeat-p (and sc (not sc-repeat-p)))
   ;; TODO SCHEDULED should only apply to first instance;
   ;; use RDATE with custom DURATION to implement that
-  (warn "Not yet implemented: \
+  (org-display-warning "Not yet implemented: \
 repeater on DEADLINE but not SCHEDULED. Skipping.")
   nil)
  ((or sc-repeat-p dl-repeat-p)
diff --git a/testing/lisp/test-ox-icalendar.el b/testing/lisp/test-ox-icalendar.el
index 6a0c961d7..e631b2119 100644
--- a/testing/lisp/test-ox-icalendar.el
+++ b/testing/lisp/test-ox-icalendar.el
@@ -114,5 +114,19 @@ (ert-deftest test-ox-icalendar/todo-repeater-until-utc ()
 (should (re-search-forward "RRULE:FREQ=DAILY;INTERVAL=3;UNTIL=2023050.T..Z"
   (when (file-exists-p tmp-ics) (delete-file tmp-ics)
 
+(ert-deftest test-ox-icalendar/warn-unsupported-repeater ()
+  "Test warning is emitted for unsupported repeater type."
+  (let ((org-icalendar-include-todo 'all))
+(should
+ 

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

2023-06-17 Thread gerard . vermeulen

On 17.06.2023 14:38, Ihor Radchenko wrote:

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


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

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.


I am afraid that I am reaching the limit of my HTML-fu.
Let's wait for Timothy (ox-html maintainer) to review this.


That is perfectly fine with me.  I put this aside until after his 
review.




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

2023-06-17 Thread Ihor Radchenko
gerard.vermeu...@posteo.net writes:

> The term "image in-lining" is a very terse description of what my code 
> does.
> ...
>
> 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.

I am afraid that I am reaching the limit of my HTML-fu.
Let's wait for Timothy (ox-html maintainer) to review this.

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



Re: Is this proper time format?

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

> Ihor Radchenko  writes:
>
>> May you please re-create the patch for the current main?
>
> Ok. See below.

Thanks!
See the attached final draft.
I amended removals of cindex entries in the manual - redundancy will not
hurt here (for better searchability).
I also slightly adjusted the wording and fixed list indentation in
one of description list items.
Finally, I detailed all the changes in the commit message and added
TINYCHANGE cookie.

Let me know if you are ok with this version.

Please note that with this patch your total contribution is approaching
non-trivial 15LOC. Further patches will require FSF copyright assignment.

> 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?

I suspect that it is greedy fontification. =--= is a part of diff
syntax, AFAIK. May report is as a bug to Emacs.

>From 17e8902e8d6f3c23a9226d697e51169c24b5414a Mon Sep 17 00:00:00 2001
Message-ID: <17e8902e8d6f3c23a9226d697e51169c24b5414a.1687004884.git.yanta...@posteo.net>
From: David Masterson 
Date: Sat, 17 Jun 2023 15:26:55 +0300
Subject: [PATCH] org-manual, org-guide: Improve timestamp documentation

* doc/org-manual.org (Dates and Times): Explain the purpose of
timestamps in the opening paragraphs.
(Timestamps): Mention that time range.  Clarify that an entry may
contain multiple timestamps, providing an example.  Explain formal
time range meaning, with example.  Add cindex entry "time range".  Add
date range example.
* doc/org-guide.org: Syncronoize changes with org-manual, adding some
missing pieces.
(Timestamps): Remove useless cindex entries (org-guide does not
produce index).

Co-authored-by: Ihor Radchenko 
Link: https://orgmode.org/list/sj0pr03mb5455693ca8266256d46ba594a2...@sj0pr03mb5455.namprd03.prod.outlook.com

TINYCHANGE
---
 doc/org-guide.org  | 33 +++
 doc/org-manual.org | 49 +++---
 2 files changed, 62 insertions(+), 20 deletions(-)

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 @@ * Dates and Times
 
 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 @@ ** Timestamps
 
   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 @@ ** Timestamps
 
 - 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 @@ ** Timestamps
 <%%(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

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

2023-06-17 Thread Ihor Radchenko
Sébastien Gendre  writes:

> So, I posted my question too soon.
>
> To use the export option as properties, I had to add EXPORT_ prefix.

Added a linter. Hope it helps.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1ec3a43c5

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