Marking task creation date or re-scheduling.

2023-06-07 Thread Vladimir Nikishkin
Hello, fellow org users,

Until recently, I used to just Schedule a task once, and it would stay
in the agenda until it is done.

This has a nice property of having "Schedules x234 days" displayed near
the task in Agenda, so I know for how long this task has been hanging.

However, often I find myself wanting to make the task as "done for
today", meaning not that a task is finished, but rather that I have done
everything I could do today.

People around seem to suggest just re-scheduling it for tomorrow. This
way the task will disappear from the Agenda. However, this way I am
losing that nice metadata of "when a task was created".

This can be worked around by, say, creating a clock-in session right
after the creation of a task, or just marking it as a time-stamp, but
this looks unpleasant. It's more convoluted than just counting time
elapsed since "SCHEDULED" until "CLOSED".

So, is it possible to add, or maybe there is some built-in way of
accommodating for such a use-case? Maybe a way to automatically add a
"CREATED" time-stamp for a task? Or maybe hide from agenda the tasks
that "have a logbook entry today"?

-- 
Your sincerely,
Vladimir Nikishkin (MiEr, lockywolf)
(Laptop)



Re: problem with org-map-entries and the doc for export hooks

2023-06-07 Thread Victor A. Stoichita

Le 07 Jun 2023, Ihor Radchenko  a écrit :

> 1. Update Org mode. I do not see any hangs with the latest stable
> Org release.
> 2. Use alternative example. The current example may not work if you have
>headings not separated by contents or empty lines.
>See 
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=16f15f966

Thanks for the hints Ihor !

I still see the problem with org version 9.6.6 and your latest example
code. 

I also checked with emacs -Q which has org version 9.6.1.

I’m testing this on the attached file.

I also see that if I set the export scope to "subtree" instead of
"buffer" the process runs as expected.

Cheers,
Victor


simple-org-file.org
Description: application/vnd


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

2023-06-07 Thread Ihor Radchenko
Christian Moe  writes:

>> Reading the linked threads, it seems that  has its own
>> downsides. Why is it strictly better then?
>
> I'm not sure it's strictly better.
>
> The problem in the linked threads was with scaling, and I don't think it
> applies anymore. As I just tested in Firefox, at least, I can control
> the size of Gerard's SVG illustration perfectly well by setting CSS
> height and width attributes on an .

That ship sailed long time ago.
Now, switching back to  will be a breaking change that should be
justified. Mind that we use "img" tag for all images, not just svg.

For now, you are just pointing that  will inherit CSS of the
page.

But there will be downsides you mentioned, like absence of alt
attribute (which is a big deal - we do not want to compromise
accessibility for blind users - see
https://orgmode.org/list/CAJcAo8uTOpEazLNCr0t1kFqPGTLz=G=adnklhuo1-ura8-m...@mail.gmail.com
 or
https://list.orgmode.org/orgmode/87czew3w5l.fsf@localhost/ )
Also, https://www.w3schools.com/TAgs/tag_object.asp explicitly
recommends against  for images in favor or .

Finally, I can see that there are ways to use CSS on img+svg:
https://blog.union.io/code/2017/08/10/img-svg-fill/

> - For Org to extract and embed the SVG means more things that can break
>   (though I admit that it can be made a lot less fragile than the
>   #+INCLUDE hack) and when they do break, it's an Org problem. With
>Org just needs to properly format the tags; if it does, the
>   rest is the browser's responsibility.

May you elaborate?

> - If the external SVG file is modified, with embedding all files
>   referencing it need to be exported again for the change to take
>   effect. With  linking to the external file, all that is
>   needed is refreshing the browser.

That's why the proposed patch does not turn the embedding on by default.
But some people do want embedding to make html self-contained, if not
for CSS.

Note that I am inclined to accept the patch for reasons different
from the motivation of the patch author. Especially, if the patch gets
extended to allow embedding raster images as well.

> - Readable, uncluttered HTML is nice; huge, unreadable stretches of SVG
>   aren't.

Sure, if users want uncluttered HTML. Some users do. Some wants the
opposite.

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



Re: problem with org-map-entries and the doc for export hooks

2023-06-07 Thread Ihor Radchenko
"Victor A. Stoichita"  writes:

> I’m trying to use the example given here in the manual for "Export
> hooks": https://orgmode.org/manual/Advanced-Export-Configuration.html
> ...
> However the export process hangs indefinitely emacs after evaluating this.
> I have to C-g to quit. 
> The same happens with the newer org-export-before-parsing-functions
> instead of org-export-before-parsing-hook.
>
> Is there something else that needs to be updated for the example to work?

1. Update Org mode. I do not see any hangs with the latest stable Org release.
2. Use alternative example. The current example may not work if you have
   headings not separated by contents or empty lines.
   See https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=16f15f966

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



problem with org-map-entries and the doc for export hooks

2023-06-07 Thread Victor A. Stoichita
Greetings all!

I’m trying to use the example given here in the manual for "Export
hooks": https://orgmode.org/manual/Advanced-Export-Configuration.html

--8<---cut here---start->8---
(defun my-headline-removal (backend)
  "Remove all headlines in the current buffer.
BACKEND is the export back-end being used, as a symbol."
  (org-map-entries
   (lambda () (delete-region (point) (line-beginning-position 2)

(add-hook 'org-export-before-parsing-hook #'my-headline-removal)
--8<---cut here---end--->8---

However the export process hangs indefinitely emacs after evaluating this.
I have to C-g to quit. 
The same happens with the newer org-export-before-parsing-functions
instead of org-export-before-parsing-hook.

Is there something else that needs to be updated for the example to work?

Regards,
Victor



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

2023-06-07 Thread Christian Moe


Ihor Radchenko writes:

> Christian Moe  writes:
>
>> I think there's a better approach. Tl;dr:
>>
>> - A better way to have active CSS in SVG images is to link to the
>>   external SVG file with the  rather than  tag, as we used
>>   to.
>
> Reading the linked threads, it seems that  has its own
> downsides. Why is it strictly better then?

I'm not sure it's strictly better.

The problem in the linked threads was with scaling, and I don't think it
applies anymore. As I just tested in Firefox, at least, I can control
the size of Gerard's SVG illustration perfectly well by setting CSS
height and width attributes on an .

Apart from that, my reasoning amounted only to this:

-  works as well as embedding for CSS

- For Org to extract and embed the SVG means more things that can break
  (though I admit that it can be made a lot less fragile than the
  #+INCLUDE hack) and when they do break, it's an Org problem. With
   Org just needs to properly format the tags; if it does, the
  rest is the browser's responsibility.

- If the external SVG file is modified, with embedding all files
  referencing it need to be exported again for the change to take
  effect. With  linking to the external file, all that is
  needed is refreshing the browser.

- Readable, uncluttered HTML is nice; huge, unreadable stretches of SVG
  aren't.

Some arguments for embedding I didn't consider:

- fewer http calls

- It makes accessing the SVG internals with Javascript a bit easier than
  with  (the difference is just one line of JS) -- and a lot
  easier if you trigger Firefox's same-origin restrictions by keeping
  the files on a file system rather than a server.

>> - Without patching Org, you can embed an external SVG file as an SVG
>>   island in Org HTML export simply by using #+INCLUDE.
>
> To be clear, I am in favor of adding "embedding" switch for ox-html in
> general. It is a feature several people requested elsewhere - for all images.
> #+INCLUDE is cumbersome, does not work with captions, and will generally
> break Org customization relying on Org knowing what kind of object is
> being exported.

Fair points.

Yours,
Christian



Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-07 Thread Ihor Radchenko
Max Nikulin  writes:

> It seems https://orgmode.org/worg/org-faq.html#mailto-links requires an 
> update for Emacs-28 (besides a typo with "~" instead of "-").

May you elaborate? (Or, better, send a patch)

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



Re: Bug: using :wrap src interferes with :cache yes with :var [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]

2023-06-07 Thread Ihor Radchenko
Emin Martinian  writes:

> I think there is a bug with the `:cache' header and how results of
> evaluation are wrapped: Using `:cache yes' and wrapping the results
> prevents later blocks using the cached results.
>
> To reproduce, start with an example like the one at the bottom of the
> documentation in
> . Then add
> something like `:wrap src R' (or `:results value drawer') to the header
> of the block named `random' and the second block produces `nil' instead
> of the desired result.

I tried to evaluate the following in various orders.

#+NAME: random
#+BEGIN_SRC R :cache yes :wrap src R
  runif(+1)
#+END_SRC

#+NAME: caller
#+BEGIN_SRC emacs-lisp :var x=random :cache yes
  x
#+END_SRC

I am unable to see any issues with the latest development version of Org.
You may try to update Org and check on your side.

Canceled, for now.

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



Re: [BUG] org-agenda-custom-commands with org-agenda-category-filter-preset not working [9.6.4 (release_9.6.4-9-g8eb209 @ /usr/local/share/emacs/29.0.90/lisp/org/)]

2023-06-07 Thread Ihor Radchenko
Erik Guldberg via "General discussions about Org-mode."
 writes:

> In every work related org-file, I set the category like this: 
>
> #+CATEGORY: work
>
> I then use org-agenda-custom-commands like those below to show work related 
> content or not work related content. This works in Org version 9.5.5/Emacs 
> 28.2, but in Org version 9.6.4/Emacs 29.0.90, both custom-commands shows the 
> content of every file, category "work" or not.
>
> I posted this on Reddit, and according to a user it can be reproduced in the 
> stable version, while it works fine in the development version.

Canceled.
I was actually wrong in my initial attempt to reproduce (and reddit
reply).

The reason your filter is not working is that you are setting it in a
composite agenda view. According to the docstring of
`org-agenda-filter-preset':

This variable should not be set directly, but agenda custom commands can
bind it in the options section.  The preset filter is a global property of
the entire agenda view.  In a block agenda, it will not work reliably to
define a filter for one of the individual blocks.  You need to set it in
the global options and expect it to be applied to the entire view.

Note that the docstring explicitly warns you to set the filter in global
agenda options, not within individual blocks.

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



Re: [BUG] org-insert-todo-heading-respect-content and org-insert-todo-heading have different behaviors [9.6.1 ( @ /home/username/.chemacs/spacemacs/elpa/28.2/develop/org-9.6.1/)]

2023-06-07 Thread Ihor Radchenko
Xuan Wang  writes:

> --text follows this line--
>
> Problem: Now org-insert-todo-heading-respect-content does not respect the
> TODO
> state of current heading.
>
> How to reproduce:
> Example: define a todo sequence as followed:
> "#+TODO: WAIT(w@/!) TODO(t) | DONE(d) CANCELED(c@)"
> ...

Thanks for reporting and for the detailed analysis!
Fixed, on main. Now, we just pass the prefix args directly to
`org-insert-todo-heading'.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=ba8c46863

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



Re: [BUG] Org-9.6.x org templates hang on 'clipboard pasted as level 2 subtree'...

2023-06-07 Thread Ihor Radchenko
Carlo Tambuatco  writes:

> Hey Ihor, I recently upgraded my emacs to emacs@29 via homebrew, and I know
> this is an
> old thread, but now that my new emacs version comes with org-9.6.6, I am
> getting the same
> issues as I detailed in this thread with my org capture templates. I tried
> to do a reproduce
> with emacs -q but the error does not reproduce in those conditions, so it
> might be an issue
> with org mode interacting with some of my other packages installed.
>
> I will include a list of emacs packages I have installed, and my
> org-init.el file. Maybe you
> could see if anything jumps out at you that is causing this weird behavior.

You may try https://github.com/Malabarba/elisp-bug-hunter to narrow down
the cause in your config.

If that does not work, we can try to arrange jitsi call to investigate
in more details.

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



Re: Org-mode customization in emacs

2023-06-07 Thread Fleur Chrysalis
Yes, tho headings for To do lists is great and can be used for great potential, 
most people really like to use checklists thanks to the constant habit createad 
by stuff like xit-mode, todoist, google Keep and other checklist and text 
focused todo modes and applications.

To me the greatest thing would come from combining the two methods, a checklist 
that has a lot of flexibility to be used like a heading and the heading that 
indicates a bigger project is in the works conveying the broader perspective 
that the checklists won't have.

But yeah my headings are working as they are supposed to now.

 Mensagem Original 
Em 6 de jun. de 2023 23:22, Samuel Wales escreveu:

> great. so org headings instead of checklists work for you now? i have lately 
> come to the realization that checklists are not always as suitable for me as 
> they seem, and that what i need is [possibly existing, possibly user] 
> features, to be determined, for headings so that i can use headings like 
> checklists. this is the opposite of frequent requests, and early version x 
> wrote: > I got it solved now, found the line to enable TODO headings in 
> Org-brain to > show properly. My initial problem was with the todo/doing/done 
> headings not > showing up in org-brain thanks to its implementation of 
> org-mode on its > mindmap, but now i have the line that allows me to see it, 
> so i got around > the issue. > >  Mensagem Original  > Em 6 
> de jun. de 2023 13:36, Ihor Radchenko escreveu: > >> Fleur Chrysalis writes: 
> > Ah, understood, thank you for the reply. > >> Rather unfortunate that there 
> is no way to extend it or customize it >> easily. Note that I do not fully 
> understand the problem you are trying to >> solve. It may be XY problem. Try 
> to check other ways to achieve what you >> want. Maybe post a feature request 
> for org-brain? -- Ihor Radchenko // >> yantar92, Org mode contributor, Learn 
> more about Org mode at . Support Org >> development at , or support my work 
> at -- The Kafka Pandemic A blog about science, health, human rights, and 
> misopathy: https://thekafkapandemic.blogspot.com

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

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

> I had been think about names like
> :with-svgs-to-embed (...)
> :sans-svgs-to-embed (...)
> while preparing the patch. I decided to err towards verbosity.

I think that the idea with putting explicit file names is not good.
It will force extra work for users.
Instead, it should be possible to switch embedding on/off right at near
image link. And more global setting should deal with regexp patterns or
enabling/disabling embedding globally.

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



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

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

>> This is awkward. To do per-image export adjustments, we usually use
>> export attributes (#+ATTR_HTML: ...). And why "split"?
>
> I do not think that #+ATTR_HTML allows to embed (= copy) the contents
> of an SVG file directly into the HTML page.  As far as I understand, it 
> adds
> only attributes to HTML elements.

For now, yes. But more generally, Org uses #+ATTR_BACKEND to configure
export. For example, see "13.10.6 Images in LaTeX export".

You may arrange ox-html to handle special #+ATTR_BACKEND: :org-embed t
attribute that will be ignored in `org-html--make-attribute-string' and
checked in your `org-html--embed-svg-p'.

> The "split" is because of similarity with :select_tags and :exclude_tags 
> in ox.
> It allows several files to be included in or excluded from embedding.

Makes sense.

>> Please use `org-export-inline-image-p'.
>
> I think that the terminology "inline-image" in ox-html is confusing.
> In ox-html the result of the "inline-image"  code is an HTML tag like
>
> 
>
> It does not mean that image data is copied inline as with embedding.

If image is not inlined, it must not be displayed as an image, just as a
link. Your code will break this convention.

Please refer to "13.9.9 Images in HTML export" section of Org manual.

>> But the original code is different, no?
>
> Yes, I pretend that my code is an improvement:
> 1. The with-syntax-table is superfluous.
> 2. The error message gives a reason and the filename causing it.

Then, I find your code sufficiently different to not link to
stackoverflow. This link is not helpful to understand the code.

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



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

2023-06-07 Thread Ihor Radchenko
Christian Moe  writes:

> That said, I still think the better solution to the issue you raised is
> for Orgmode to go back to exporting SVG links as  not , not
> to extract SVG file contents and embed them as SVG islands.
>
> (Though I may be a breaking change for some users. In particular,
> because OBJECT does not have an ALT attribute, but uses several other
> ways to provide alternative text for accessibility, users would need to
> change their =#+attr_html :alt= to using :aria-label or :title
> attributes, unless the Org implementation for SVG links were to handle
> this smartly.)

It might be ok optional feature, controlled by some #+ATTR_HTML
attribute. Patches welcome.

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



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

2023-06-07 Thread Ihor Radchenko
Christian Moe  writes:

> I think there's a better approach. Tl;dr:
>
> - A better way to have active CSS in SVG images is to link to the
>   external SVG file with the  rather than  tag, as we used
>   to.

Reading the linked threads, it seems that  has its own
downsides. Why is it strictly better then?

> - Without patching Org, you can embed an external SVG file as an SVG
>   island in Org HTML export simply by using #+INCLUDE.

To be clear, I am in favor of adding "embedding" switch for ox-html in
general. It is a feature several people requested elsewhere - for all images.
#+INCLUDE is cumbersome, does not work with captions, and will generally
break Org customization relying on Org knowing what kind of object is
being exported.

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



Re: [BUG] Dead link in the org documentation

2023-06-07 Thread Ihor Radchenko
Dima Kogan  writes:

> Hi. I'm looking here:
>
>   https://orgmode.org/worg/exporters/beamer/
>
> The "Using the new exporter" link returns a 404:
>
>   https://orgmode.org/worg/exporters/beamer/ox-beamer.html

Thanks for reporting!
Fixed.
https://git.sr.ht/~bzg/worg/commit/296135cb

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



Re: Org-Agenda view customization

2023-06-07 Thread Dieter Faulbaum



Ihor Radchenko  writes:


Dieter Faulbaum  writes:

Is there a way to get rid of the part 
'<2023-06-06>--<2023-06-10>' 
in the agenda view

(with the date entry in the same line in the org-file)?


org-agenda-remove-timeranges-from-blocks


Oh thanks Ihor, that does it!
But I didn't find that variable in the org.pdf manual.-)


We do not document everything in the manual. Just most important 
things.

M-x customize-group is your friend.


Thanks, another very useful hint!
I don't use this very often before but will do it more in the 
future.-)




Re: How can I disable "priority penalty" for Scheduled overdue tasks?

2023-06-07 Thread Ihor Radchenko
Vladimir Nikishkin  writes:

> I have a problem with my agenda. I have a task scheduled 3 years ago,
> org-priority-show displays 2199.
>
> Agenda thinks that this is a super important task, and sorts it above
> all other tasks. In reality this task is so unimportant that I seldom
> get to doing it, hence such a slow progress in 3 years.
>
> Is it possible to ignore that "scheduled long ago" behaviour?

This is controlled by category-up/down `org-agenda-sorting-strategy' on
stable Org release.
In the development version of Org, it is urgency-up/down.
See https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/etc/ORG-NEWS#n16

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



Re: Org-Agenda view customization

2023-06-07 Thread Ihor Radchenko
Dieter Faulbaum  writes:

>>> Is there a way to get rid of the part 
>>> '<2023-06-06>--<2023-06-10>' 
>>> in the agenda view
>>> (with the date entry in the same line in the org-file)?
>>
>> org-agenda-remove-timeranges-from-blocks
>
> Oh thanks Ihor, that does it!
> But I didn't find that variable in the org.pdf manual.-)

We do not document everything in the manual. Just most important things.
M-x customize-group is your friend.

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



How can I disable "priority penalty" for Scheduled overdue tasks?

2023-06-07 Thread Vladimir Nikishkin
Hello, fellow org users

I have a problem with my agenda. I have a task scheduled 3 years ago,
org-priority-show displays 2199.

Agenda thinks that this is a super important task, and sorts it above
all other tasks. In reality this task is so unimportant that I seldom
get to doing it, hence such a slow progress in 3 years.

Is it possible to ignore that "scheduled long ago" behaviour?

-- 
Your sincerely,
Vladimir Nikishkin (MiEr, lockywolf)
(Laptop)