Worg build status?

2024-03-13 Thread Adam Porter

Hi,

A couple of days ago I pushed some updates to Worg.git, and then I saw 
that the build seems to be failing 
.  I found this message 
from January 
 
explaining that the builds weren't happening automatically anymore, but 
I can't tell if that's still the problem; the last build failure seems 
to have a truncated log.


What's the current status?  I was a little disappointed to see that the 
new page I'd written up isn't getting published, along with any other 
changes.


Thanks,
Adam



Best way to make the Org source tree?

2024-03-13 Thread William Denton
I looked on the site and in the source but didn't see this, but forgive me if I 
missed something obvious.  Say I cloned the Git repository and now I'm in that 
directory and want to update Org.  I'm not doing any development, I just want 
to stay current.  I think these are equivalent:

$ make update
$ git pull && make

Is that right?   Is `make autoloads` needed?  What should I be running?

I ask because I suddenly wondered if I'd been doing this wrong and it was 
triggering a problem.

Bill
--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada



Re: Things got very slow: profiler output

2024-03-13 Thread William Denton
On Wednesday, March 13th, 2024 at 19:19, Bruno Cardoso  
wrote:

> For me this improved the situation a bit, but I still get significant 
> slow-downs as before.
> 
> I don't know if it is related, but if I set a property (C-c C-x p) in a new 
> heading with no drawers, I'm unable to unfold the newly created drawer (TAB 
> over it does nothing), although I am able to fold/unfold other already 
> existent drawers as expected. 

I don't have that problem, if I understand your description right, but like you 
Ihor's tweak didn't get things back to normal for me.  I'm now using Emacs from 
the development tree and its Org (which doesn't yet have commit 
5d186b499dde97f5 from 25 February) and it's back to normal for now.

Could it be something our systems or configurations have in common, Bruno?  My 
Org configuration is here, if you want to compare:

https://github.com/wdenton/.emacs.d/blob/master/init.org#org

Thanks for looking at this problem, Ihor.  If there's anything else to try, 
I'll try it.

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada





Re: Table column formula with remote reference

2024-03-13 Thread Wu Ming


> On 13 Mar 2024, at 20:16, Ihor Radchenko  wrote:
> 
> Wu Ming  writes:
> 
>> My fault. Missed the line "One of the very first actions during evaluation 
>> of Calc formulas and Lisp formulas is to substitute ‘@#’ and ‘$#’ in the 
>> formula with the row or column number of the field where the current result 
>> will go to.“  So '@@#' becomes '@'. 
>> 
>> Overlooked it also because I did read the other line "‘@0’ and ‘$0’ refer to 
>> the current row and column, respectively, i.e., to the row/column for the 
>> field being computed.” and did try '@0$1'. Why is this different from the 
>> above?
> 
> See "Remote references" subsection. It explains that in
> remote(NAME,REF), REF is inside the remote table. Relative and current
> column/row is ambiguous there.
> 
> In contrast, @# and $# are special - they are replaced before
> remote(...) is processed.
> 
> I agree that the manual is somewhat confusing. Possibly, we may even
> change `org-table-get-remote-range' to use relative references according
> to the original table. Improvements welcome!
> 

I have some trouble at understanding your answer. Do you mean @# refers a row 
on the table where the formula belongs and @0 refers a row on the remote table? 
Was tempted to describe the former as “current” but remote table is also 
current when accessed. A better noun may be needed.


Unrelated, but appeared on the same trial, noticed a cell was mis-calculated. 
Could not pin-point the reason before error disappeared after running a side 
formula performing the same operation. Formula was simply copying column values 
from a remote table. Remote table values were never changed. Recalculate all 
and C-c C-c were performed multiple times before the curious fix.

This made me worry about reliability of simple biz calculations I am trying on 
Org spreadsheet for the first time. Please advise.


Finally I moved columns but now column numbers in formulas don’t relate to 
column order on display. How to understand which column formula affect which 
column?


Sorry to coalesce multiple questions in to one. They just came to me while 
typing.


Re: Things got very slow: profiler output

2024-03-13 Thread Bruno Cardoso


On 2024-03-12, 12:43 +, Ihor Radchenko  wrote:

>
> Profiler data does not make sense here.
> In any case, I tried to make fontifying newlines after folds slightly
> faster on the latest main:
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c9b655f27
>
> If you are lucky, it should help.
>

Hello,

For me this improved the situation a bit, but I still get significant 
slow-downs as before.

I don't know if it is related, but if I set a property (C-c C-x p) in a new 
heading with no drawers, I'm unable to unfold the newly created drawer (TAB 
over it does nothing), although I am able to fold/unfold other already existent 
drawers as expected. This also happens in `emacs -Q' (org-version 9.7-pre 
release_9.6.20-1280-g7653e5).

Besides the profiler, which still blames 
`org-fold-core--property-symbol-get-create' for the slow-down, is there some 
debugging configuration I should try out? I tried setting

(setq org-element--cache-self-verify 'backtrace)
(setq org-element--cache-self-verify-frequency 1.0)

but it does not signal any error.


Best,

Bruno.



Re: `:export' attribute?: Re: Experimental public branch for inline special blocks

2024-03-13 Thread Juan Manuel Macías
Juan Manuel Macías writes:

> It was necessary with the previous implementation, which excessively
> abused regexp. Not now (I want to do a few more tests and I'll make a
> new commit with the changes). With the new implementation, now:
>
> -  do not export
>
> *  export only the content
>
> = rest (full)
>
> =* rest (contents only)
>
> backend- do not export this backend (and the backends derived from it)
>
> backend+ (or, perhaps, just "backend") export this backend (idem)
>
> backend* export this backend (contents only) (idem)
>
> I think your example with the video link would also be possible with the
> new implementation.

Please try the latest commit:

@@[:export html-]{Watch [[https://youtube.com/...][Org mode in action demo]] 
video.}

#+begin_export html
https://youtube.com/embed/...;
  title="Org mode in action demo"
  width="..." height="...">
#+end_export

It would not be exported to html or its derived backends.

(In your example you used `-html' instead of `html-'. I have no
preference for one variant or another).

-- 
Juan Manuel Macías -- Composición tipográfica, tratamiento de datos, diseño 
editorial y ortotipografía




Re: Reproducible work with natively compiled Emacs

2024-03-13 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  writes:

> Thanks for the feedback! I'm attaching a unified patch.

Thanks!
Some more comments.

> +# This is where Emacs stores the .eln files
> +ELNDIR= $(shell $(EMACS) --batch --eval '(princ (car 
> native-comp-eln-load-path))')

Maybe := is better here. Otherwise, we risk invoking emacs multiple times.

> +cleaneln::

Why ::?

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



Re: Modifying org-quote blocks

2024-03-13 Thread Ihor Radchenko
Divya Ranjan  writes:

> I have been trying to modify my org-blocks that pertain to quotes. I
> have tried setting the variable `org-fontify-quote-and-blocks` to `t`
> but that doesn't really do anything.

There is no such variable in Org mode.
Maybe you meant `org-fontify-quote-and-verse-blocks'?

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



Re: Reproducible work with natively compiled Emacs

2024-03-13 Thread Pedro Andres Aranda Gutierrez
Hi Ihor,

Thanks for the feedback! I'm attaching a unified patch.

TODO: check that the emacs installed supports native compilation. This is
more for
make native.

Best, /PA


On Wed, 13 Mar 2024 at 13:46, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> >> I have been experiencing some inconsistencies with org-mode, which I
> >> have been able to trace own to using native compilation and not knowing
> >> where the files from main were.
>
> Thanks for the patch!
> See my comments inline.
>
> > +# This is where Emacs stores the .eln files
> > +ELNDIR= $(shell emacs --batch --eval '(princ (car
> native-comp-eln-load-path))')
>
> Please use $(EMACS).
>
> > +cleaneln::
> > + for elnf in $(patsubst %.eln, %-*.eln, $(LISPN)); do \
> > +   find $(ELNDIR) -name $$elnf -exec $(RM) -v {} \; ;\
> > + done
>
> $(FIND).
> Also, avoid using bash as much as possible in favor or GNU make
> constructs. You can use $(foreach ...) here.
>
> >  clean-install:
> >   if [ -d $(DESTDIR)$(lispdir) ] ; then \
> > $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el*
> $(DESTDIR)$(lispdir)/ol*.el* $(DESTDIR)$(lispdir)/ox*.el* ; \
> > --
> > 2.34.1
> > From 6d98dfb3d72171e0231823260165b23e8b9963ee Mon Sep 17 00:00:00 2001
> > From: "Pedro A. Aranda" 
> > Date: Mon, 11 Mar 2024 09:47:12 +0100
> > Subject: [PATCH 1/3] Add cleaneln target
> >
> > * mk/targets.mk: add the 'cleaneln' target
> >
> > ---
> >  mk/targets.mk | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/mk/targets.mk b/mk/targets.mk
> > index de849c4fb..ab9ec2a1f 100644
> > --- a/mk/targets.mk
> > +++ b/mk/targets.mk
> > @@ -143,6 +143,9 @@ cleanall: cleandirs cleantest
> >  $(CLEANDIRS:%=clean%):
> >   -$(FIND) $(@:clean%=%) \( -name \*~ -o -name \*.elc \) -exec $(RM)
> {} +
> >
> > +cleaneln:
> > + $(MAKE) -C lisp $@
> > +
>
> Should be in .PHONY
>
> > --- a/etc/ORG-NEWS
> > +++ b/etc/ORG-NEWS
> > @@ -11,7 +11,8 @@ See the end of the file for license conditions.
> >
> >  Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
> >
> > -* Version 9.7 (not released yet)
> > +* V
> > +ersion 9.7 (not released yet)
>
> This is a stray newline.
>
> > +*** ~make cleaneln~ will remove the .eln files from the user emacs
> configuration
> > +
> > +Natively compiled Emacs lisp files generated with ~make native~ are
> > +now correctly located and deleted with ~make cleaneln~.
> > +
> >  ** Miscellaneous
> >  *** =org-crypt.el= now applies initial visibility settings to decrypted
> entries
>
> "Add 'native' option to 'make help'" from the previous version of the
> patch still makes sense.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
From 52bcbc71c62717e84dd0504ccf37d32668ed3cac Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Wed, 13 Mar 2024 17:41:56 +0100
Subject: [PATCH] Clean eln files from the user emacs eln directory

---
lisp/Makefile: clean .eln files from the directory where the user's natively
compiled files are stored

* Makefile: Add help for =make native=
* lisp/Makefile: Implement =make cleaneln=
* mk/targets.mk: Add =cleaneln= target


 Makefile  | 1 +
 etc/ORG-NEWS  | 7 +++
 lisp/Makefile | 9 -
 mk/targets.mk | 5 -
 4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index f476a3ea7..b3a167ecb 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,7 @@ help helpall::
 	$(info make all- ditto)
 	$(info make compile- build Org ELisp files)
 	$(info make single - build Org ELisp files, single Emacs per source)
+	$(info make native - build Org natively compiled Elisp files)
 	$(info make autoloads  - create org-loaddefs.el to load Org in-place)
 	$(info make test   - build Org ELisp files and run test suite)
 	$(info make vanilla- run Emacs with this Org-mode and no personal config)
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index ca73f06e7..cb8ed9b71 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -1281,6 +1281,13 @@ optional argument =NEW-HEADING-CONTAINER= specifies where in the
 buffer it will be added.  If not specified, new headings are created
 at level 1 at the end of the accessible part of the buffer, as before.

+*** ~make cleaneln~ will remove the .eln files from the user emacs configuration
+
+Natively compiled Emacs lisp files generated with ~make native~ are
+now correctly located and deleted with ~make cleaneln~.
+
+*** Add text for =make native= to ~make help~
+
 ** Miscellaneous
 *** =org-crypt.el= now applies initial 

Re: `:export' attribute?: Re: Experimental public branch for inline special blocks

2024-03-13 Thread Juan Manuel Macías
Max Nikulin writes:

>> how about the following:
>> - "--" :: do not export
>> - "**" :: export only the content
>> - "==" :: rest (full)
>> - "=*" :: rest (only the content)
>> - "!backend-name+ :: export this backend (full)
>> - "!backend-name*" :: export this backend (only the content)
>> - "!backend-name- :: do not export this backend
>
> I do not see why operator should be duplicated for backends that are not 
> specified explicitly. Single "+" (default) or "-" should be enough. I 
> have not got your idea with leading "!". From my point of view it is 
> redundant.

It was necessary with the previous implementation, which excessively
abused regexp. Not now (I want to do a few more tests and I'll make a
new commit with the changes). With the new implementation, now:

-  do not export

*  export only the content

= rest (full)

=* rest (contents only)

backend- do not export this backend (and the backends derived from it)

backend+ (or, perhaps, just "backend") export this backend (idem)

backend* export this backend (contents only) (idem)

I think your example with the video link would also be possible with the
new implementation.

-- 
Juan Manuel Macías -- Composición tipográfica, tratamiento de datos, diseño 
editorial y ortotipografía




Re: `:export' attribute?: Re: Experimental public branch for inline special blocks

2024-03-13 Thread Max Nikulin

On 13/03/2024 00:41, Juan Manuel Macías wrote:

Max Nikulin writes:


It is not clear for me how to achieve the following. Add a link

[[https://youtube.com/...][Org mode in action demo (video)]]

for all backends (EPUB, LaTeX, ODT, text, etc.) besides HTML because
there is an #+export_html block with player embedded using an iframe.


Sorry, I don't quite understand this. Could you please elaborate?


--- 8< ---
&_[:exports -html]{Watch [[https://youtube.com/...][Org mode in action 
demo]] video.}


#+begin_export html
https://youtube.com/embed/...;
 title="Org mode in action demo"
 width="..." height="...">
#+end_export
--- >8 ---

should be exported to HTML without the sentence with the link
--- 8< ---
https://youtube.com/embed/...;
 title="Org mode in action demo"
 width="..." height="...">
--- >8 ---

however only the sentence with the link is exported to LaTeX or any 
other format

--- 8< ---
Watch \href{https://youtube.com/...}{Org mode in action demo} video.
--- >8 ---


Instead of "noexport" and "rest" that may be confused with backend
names I would consider "+" and "*" without any name. I would consider
some characters like "-", "_", "!", "~" to express "do not export to
this and derived backends" and "do not export for specified backend
only".


how about the following:
- "--" :: do not export
- "**" :: export only the content
- "==" :: rest (full)
- "=*" :: rest (only the content)
- "!backend-name+ :: export this backend (full)
- "!backend-name*" :: export this backend (only the content)
- "!backend-name- :: do not export this backend


I do not see why operator should be duplicated for backends that are not 
specified explicitly. Single "+" (default) or "-" should be enough. I 
have not got your idea with leading "!". From my point of view it is 
redundant.






Modifying org-quote blocks

2024-03-13 Thread Divya Ranjan


I have been trying to modify my org-blocks that pertain to quotes. I have tried 
setting the variable `org-fontify-quote-and-blocks` to `t` but that doesn't 
really do anything. I still get `fixed-pitch` font in quote blocks. I would 
want to be able to modify the background and font nature of quote blocks, for 
e.g., changing the `fixed-pitch` font to `variable-pitch` font and maybe change 
the background color a bit.

I also intend to set the text inside any quote block to be automatically 
indented and italicized, so that it looks promimnent from the rest of the text.

I have tried to look through the mailing list to find something, but what I got 
[0] wasn't really of much help, would be glad if someone can give me a hint or 
two.

[0]: https://lists.gnu.org/r/emacs-orgmode/2018-11/msg00238.html

Regards,

Divya.



Re: Warn about shell-expansion in the docstring of org-latex-to-html-convert-command

2024-03-13 Thread Max Nikulin

On 12/03/2024 20:03, Ihor Radchenko wrote:

Max Nikulin writes:

It is trivial to cause shell failure when single quotes are used around
%i. I am in doubts concerning double quotes. Perhaps stripping them is
more reliable.


May you list the cases to you propose to recognize?


Sun, 25 Feb 2024 17:41:43 +0700
https://list.orgmode.org/6e49c590-ad27-4fb0-b1f2-6a89c60a0...@gmail.com

- '%i' and "%i" in any position including e.g. --option='%i' and 
protocol:"%i"
- 'something%i' and "something%i" surrounded by spaces or at the end of 
command but with no spaces in "something". It should be applied to %%%i, 
but not to %%i.



- I would explicitly stress that quotes causes undefined or even
dangerous behavior. See e.g. the last paragraph
https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html


In ORG-NEWS?


Since quotes were recommended in the manual and the docscring, it is 
better to say there that they lead to undefined behavior. ORG-NEWS is to 
make the change visible for those who have read docs earlier.



- I expected it as bugfix.


It is a breaking change.
Also, only users who customized the variable may be prone to unexpected
shell expansion. So, I do not see it as a critical bug.
Hence, not for bugfix.


I am still in doubts. I have no idea how much users need ODT export with 
math and rely on the backend shipped with Org. All of them have to 
customize the user option and those who added %i with quotes have risk 
to get incorrect output. If quotes around %i are stripped then the 
change is not breaking one for most of them.



Moreover, it
does not work in a container where git is not installed:
...
Debugger entered--Lisp error: (file-missing "Searching for program" "No
such file or directory" "git")


with emacs -Q?


emacs -Q --batch --eval '(find-file-noselect "not-found.txt" t)'
Starting new Ispell process ispell with default dictionary... \
Error enabling Flyspell mode:
(Searching for program No such file or directory ispell)
Error: (file-missing "Searching for program" "No such file or directory" 
"git")


Emacs-28.2

ispell error is due to my .dir-locals-2.el
 (text-mode . ((mode . flyspell)))
bug to get the git error it is enough to create .git subdirectory.





Re: [DISCUSSION] Face priority in Org fontification (was: [BUG] org dates, radio links, and special keywords override heading backgrounds [9.7 (9.7-??-902dacb @ /home/st/.config/emacs/.local/straight/

2024-03-13 Thread Ihor Radchenko
Protesilaos Stavrou  writes:

>> This is not an exhaustive list. We have a number of markup objects that
>> are fontified overriding the containing element/paragraph/heading face:
>>
>> - target links
>> - timestamps
>> - footnotes
>> - radio targets
>> - macros
>> - inline export snippets
>>
>> I am not 100% sure we should unconditionally prepend their faces to
>> the containing headline/table/etc.
>>
>> CCing Protesilaos. This discussion might be of interest for him.
>
> I think it makes sense to not override the background because otherwise
> the heading can look visually "broken". See attached screenshot for an
> example: it is called "demo-org-heading-with-background.png". In that
> screenshot I include an overline for the heading, to show how this is
> not limited to the background colour but extends to all face attributes.
> To this end, I also attach "demo-org-heading-with-more-height.png" which
> shows how the date is not scaling to match the heading's increased text
> height.

I agree that override (what we do now) is clearly not good.
The question, however, is whether we should prioritize object face over
the containing element face or vice versa:

Should link properties take precedence over headline or should headline
properties take precedence?

For example, if link explicitly sets face height to be smaller, should
we honor it? Or should we honor the headline face height, if set?
Similar for background. In your example, the white background override
does not really look nice when heading has its own background.

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



Re: [PATCH] org-contrib/org-collector.org: fix example link and instructions

2024-03-13 Thread Ihor Radchenko
Gerard Vermeulen  writes:

> I noticed that the link
> https://orgmode.org/worg/sources/org-contrib/org-collector-example.org
> is broken.
> Furthermore, I think that the usage instructions for Emacs-28.1 and 
> later are
> outdated.
>
> This patch proposes fixes.

Thanks!
Applied.
https://git.sr.ht/~bzg/worg/commit/137c609e

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



Re: [BUG] Using org-table-next-line creates a new row when used on the header row [9.6.21 ( @ /Users/parhamdoustdar/.emacs.d/elpa/org-9.6.21/)]

2024-03-13 Thread Ihor Radchenko
Parham Doustdar  writes:

> If you run org-table-next-row on the very first line of a table that has a 
> “horizontal rule”, it inserts a row above the horizontal rule, instead of 
> skipping over it.

This is expected.
`org-table-next-row' is, by default, bound to .
When current row is the last row in the table  will create a new
empty row.
When current row is before hline,  again creates a new empty row -
useful when editing tables separated into several parts by hlines:

| a | b |
|---+---|
| 1 | 2 |
| 3 | 4 |
|---+---|
| X | Y |

In the above,  conveniently extends the current table span between
hline separators.

Not a bug.
Canceled.

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



[PATCH] org-contrib/org-collector.org: fix example link and instructions

2024-03-13 Thread Gerard Vermeulen

Hi,

I noticed that the link
https://orgmode.org/worg/sources/org-contrib/org-collector-example.org
is broken.
Furthermore, I think that the usage instructions for Emacs-28.1 and 
later are

outdated.

This patch proposes fixes.

Regards -- Gerard


0001-org-contrib-org-collector.org-fix-example-link-and-i.patch
Description: Binary data


[BUG] Using org-table-next-line creates a new row when used on the header row [9.6.21 ( @ /Users/parhamdoustdar/.emacs.d/elpa/org-9.6.21/)]

2024-03-13 Thread Parham Doustdar
Hi,
I’m facing an issue, and I’m not sure if it’s a bug, or a feature I don’t 
understand. I looked at the documentation for org tables, but couldn’t find 
anything that explicitly says I’m right or wrong.
If you run org-table-next-row on the very first line of a table that has a 
“horizontal rule”, it inserts a row above the horizontal rule, instead of 
skipping over it.
Steps to reproduce:
1. Open a buffer and turn on org-mode
2. Create a test table like this:
`| First column | Second column | C-c ’
3. Move to the header line, that is, the very first line of the table and do 
`M-x org-table-next-row ’
Note that a new line gets created under the very first line, and now the 
horizontal rule has moved to line number 3 of the table.
 What I expect to happen is for point to move to line 3 of the table, that is, 
the very first line under the horizontal rule.
Emacs  : GNU Emacs 29.1 (build 1, aarch64-apple-darwin23.1.0, Carbon Version 
170 AppKit 2487.2)
 of 2023-11-20
Package: Org mode version 9.6.21 ( @ 
/Users/parhamdoustdar/.emacs.d/elpa/org-9.6.21/)

current state:
==
(setq
 org-agenda-prefix-format '((agenda . "%?-12t% s %? b")
(todo . "%?-12t% s %? b") (tags . " % b")
(search . ""))
 org-link-elisp-confirm-function 'yes-or-no-p
 org-directory "~/org/"
 org-log-done 'time
 org-agenda-tags-todo-honor-ignore-options t
 org-agenda-custom-commands '(("i" "In-tray" tags "+intray/TODO"
   ((org-agenda-overriding-header "In-tray")))
  ("n" "Show what I should do now" tags
   
"SCHEDULED>\"\"+SCHEDULED<\"\"/TODO"
   ((org-agenda-prefix-format
 

 (list

  

  

   (cons 'tags "%t")

  

  

   )
 

 )


(org-agenda-overriding-header "Scheduled for the rest of the day")


)
   )
  ("o" "Someday/maybe" tags "someday"
   ((org-agenda-overriding-header "Someday/Maybe"))
   )
  )
 org-agenda-skip-scheduled-if-done t
 org-agenda-files '("~/org/projects/")
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-refile-targets '((org-agenda-files :tag . "tasklist")
  ("~/org/someday.org" :level . 1))
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
  org-cycle-optimize-window-after-visibility-change
  org-cycle-display-inline-images)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-modules '(org-bbdb org-bibtex org-docview org-gnus org-info org-irc
   org-mhe org-rmail org-w3m org-drill)
 org-link-from-user-regexp "|\\"
 org-mode-hook '((closure
  (org--rds reftex-docstruct-symbol org-agenda-restrict-end
   org-agenda-restrict-begin org-agenda-restrict
   visual-fill-column-width org-clock-history
   org-agenda-current-date org-with-time org-defdecode org-def
   org-read-date-inactive org-ans1
   org-columns-current-fmt-compiled org-clock-current-task
   org-clock-effort org-agenda-skip-function
   org-agenda-skip-comment-trees org-agenda-archives-mode
   org-end-time-was-given org-time-was-given org-state
   org-agenda-headline-snapshot-before-repeat
   org-agenda-buffer-name org-agenda-start-on-weekday

Re: Org-agenda: List project with deadlines

2024-03-13 Thread Ihor Radchenko
Sébastien Gendre  writes:

> But how do I differentiate a project from a task for Org-mode ? Tags
> have inheritance. Do I use a property ?

It is completely up to you.
It is, however, common to use either project tag to PROJ todo keyword to
mark project.
You can exclude specific tags from inheritance via
`org-tags-exclude-from-inheritance'.

> Is it a good idea to organize every thing by classes ? Or is it better
> to have one Org file named "Assignments" to regroup every projects ? In
> these files, I have other information recorded, like the taken notes,
> the list of distributed documents and their notes and also the list of
> class sessions to see them in my agenda.

Depends. There is no silver bullet for task management.

IMHO, the benefit of grouping by class could be when you sometimes need
to suspect certain classes, excluding the related tasks from the
agendas. Then, you can trivially comment or flag the whole class heading
with a special tag (for example :HOLD:) and configure your agendas to
not lists tasks with that tag (tasks inside commented headings are
skipped by default, as defined in `org-agenda-skip-comment-trees').

However, if all you classes are mandatory, and your workflow does not
involve focusing on certain classes and temporarily hiding others,
global "Assignments" file may be more suitable.

> ** List the projects
>
> To list only the projects, I wanted to use Org-agenda todo list view and
> editing the column shown. But the manual say it may cause issues.

Those issues are only relevant to more complex column views, when you
utilize summary attribute (see 7.5.1.2 Column attributes).
AFAIU, your needs are simpler. So, you don't need to worry here.

> What can I do ? Do I use it correctly or do I need to it in a completely
> different way ? Is it better to use a column view for it ? If yes, is it
> possible to build a column view from multiple files ?

Yes, you can build column view from multiple files in agenda.

> ** List of tasks from a project
>
> What is the best way to do it ? A custom Org-agenda view for each
> project ? A column view under the project top heading ?

You can use sparse tree from project heading.
You can also narrow the agenda scope to heading at point ("<<" in agenda
dispatcher)
If you projects are taking a long time, you can create custom agenda
views for those projects.

> I have the felling that wanting to have everything well organized and
> using Org-agenda push me to think of too much complex ways to do thing.
>
> Maybe I need to do like with a bullet journal, with an Org-mode file
> instead of a page and don't try to use too much features.
>
> Do you have any suggestion ? Do I forget something ? For what I have
> suggested, am I completely wrong ?

I strongly discourage you from using many features all at once.
Start simple and add things one by one, when you have free time and
interest to improve workflow. Only add new things when you get used to
the existing simpler workflow.

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



Re: Sort alphabetically and order across sub-headings

2024-03-13 Thread Ihor Radchenko
Zenny  writes:

> I am trying to create a list where the ordered list numbering expands
> across sub-headings:
>
> * Bacteria
> ** Acetobacter Species
> 1. Acetobacter aceti
> 2. Acetobacter rasens
> 
> * Fungi
> ** Candida Species
> 3. Candida famata
> 4. Candida firmetaria
> ...
>  How can one sort the ordered list alphabetically?

There is no ready-to-use command. You may need to write one yourself.
Note that you can tell Org mode to start lists from number other than 1
like

3. [@3] foo
4. bar

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



Re: [Question] Learning to use Org Element API setters and how to ignore properties

2024-03-13 Thread Ihor Radchenko
Antonio Romano  writes:

> There's nothing concrete on my side, but I'd like to try and see if
> org-element's AST can fit this kind of merging. However, I've had close
> to no progress in trying to make the setter functions work despite all
> the indications on worg and I think I would really benefit to see some
> concrete usage examples somewhere.

You may study `org-export--install-footnote-definitions',
`org-export--remove-uninterpreted-data',
`org-export-insert-image-links', `org-latex--wrap-latex-math-block', or
`org-extra--merge-sections' from ox-extra (part of org-contrib package).

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



Re: Questions about splitting a tree into multiple files

2024-03-13 Thread Ihor Radchenko
Sébastien Gendre  writes:

> At first, I create one Org file where each book is a heading of level 1.
> The title of the heading is the title of the book, the status is a TODO
> keyword, the properties use Org-mode properties feature. And the notes
> are simply headings of level 2, where the title of these headings
> correspond to the chapter of the book.
> ...
> Now, after adding a lot of books and notes, the file is too big. I want
> to split it into multiple files: Each file is a book.
>
> But with this, I have multiple problems:
>
> A file doesn't have a status. If I want to assign a status, I have to
> create a heading of level 1 representing the book. But in this case,
> when I export the file to PDF or HTML, the result doesn't have a title.
> And instead of having each notes as a level 1 section, I have 1 section
> of level 1, representing the book, and all the rest are sections of level
> 2.

Rather than exporting the whole file, you can export subtree. Then, book
heading title will be used as exported document title.

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



Re: Summarize a list of work for school

2024-03-13 Thread Ihor Radchenko
Sébastien Gendre  writes:

> When you display a list of tasks in Org-agenda, you have these columns:
>
> - Category
> - Status
> - Task title
> - Tags
>
> But what I need in my list of work for school is:
> - Task title
> - Importance
> - Deadline date and time
> - Name of the work

Check out 11.8 Using Column View in the Agenda section of Org manual.

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



Re: Minor patch

2024-03-13 Thread Ihor Radchenko
Stefan Monnier  writes:

> The minor patch below clarifies what the computation is about and
> removes the assumption that point-min == 1, while arguably
> making the the code ever so slightly more efficient.

Thanks!
Applied, onto main, with minor amendments to the commit message.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=2773904cf

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



Re: [BUG] Re: The orgframe construct in the Beamer exporter as a default needs a rethink

2024-03-13 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  writes:

> I really don't have anything to object to the original patch. I support the
> need to circumvent the "\begin-or-end{frame} inside frame" problem and
> using orgframe is a clean way of doing so.
> My only concern is the _default_ value for `org-beamer-frame-environment'.
> If we set it to "frame", we only need to customise it in the file local
> variables in files where it needs to be changed and we catch all flies in a
> stroke:
>
> Situation 1: presentation has no "\begin-or-end{frame} inside frame" -> no
> extra stuff in file local variables AND newenvironment is not generated AND
> frames are between \begin{frame} and \end{frame}
> Situation 2: presentation needs to circumvent "\begin-or-end{frame} inside
> frame" -> set local variable in file AND newenvironment is generated AND
> frame is changed where it is strictly necessary,

I do not like that users would need to do manual action in situation 2.
For situation 1, Leo's patch will ensure that all the frames are between
\begin{frame}..\end{frame}, but newenvironment is still generated.

Leo, may you improve the patch to avoid defining
`org-beamer-frame-environment' when it is not used in all the frames?

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



Re: The org--math-p advice around texmathp

2024-03-13 Thread Ihor Radchenko
Tony Zorman  writes:

> I recently stumbled upon the fact that Org has some around advice for
> texmathp: org--math-p. For reasons that aren't entirely clear to me,
> this has some special handling for cdlatex-math-symbol, and recognises
> display and inline maths environments on its own, only calling out to
> texmathp if it could not find anything. In the former cases, it also
> populates the texmathp-why variable, although the position is just
> filled in with 0.
>
> I suppose my succinct question is: why? Is there any advantage in
> handling inline and display maths in this way, only deferring to
> texmathp as a last resort? I'm asking because I wrote a small package to
> switch between environments, and the position information that
> texmathp-why provides is very useful in choosing the closest
> environment.

Because Org mode syntax is not LaTeX and `texmathp' assumes that we are inside
LaTeX buffer. So, we first check using Org syntax whether the point is
inside latex fragment in Org sense.

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



Re: Reproducible work with natively compiled Emacs

2024-03-13 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  writes:

>> I have been experiencing some inconsistencies with org-mode, which I
>> have been able to trace own to using native compilation and not knowing
>> where the files from main were.

Thanks for the patch!
See my comments inline.

> +# This is where Emacs stores the .eln files
> +ELNDIR= $(shell emacs --batch --eval '(princ (car 
> native-comp-eln-load-path))')

Please use $(EMACS).

> +cleaneln::
> + for elnf in $(patsubst %.eln, %-*.eln, $(LISPN)); do \
> +   find $(ELNDIR) -name $$elnf -exec $(RM) -v {} \; ;\
> + done

$(FIND).
Also, avoid using bash as much as possible in favor or GNU make
constructs. You can use $(foreach ...) here.

>  clean-install:
>   if [ -d $(DESTDIR)$(lispdir) ] ; then \
> $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* 
> $(DESTDIR)$(lispdir)/ol*.el* $(DESTDIR)$(lispdir)/ox*.el* ; \
> --
> 2.34.1
> From 6d98dfb3d72171e0231823260165b23e8b9963ee Mon Sep 17 00:00:00 2001
> From: "Pedro A. Aranda" 
> Date: Mon, 11 Mar 2024 09:47:12 +0100
> Subject: [PATCH 1/3] Add cleaneln target
>
> * mk/targets.mk: add the 'cleaneln' target
>
> ---
>  mk/targets.mk | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/mk/targets.mk b/mk/targets.mk
> index de849c4fb..ab9ec2a1f 100644
> --- a/mk/targets.mk
> +++ b/mk/targets.mk
> @@ -143,6 +143,9 @@ cleanall: cleandirs cleantest
>  $(CLEANDIRS:%=clean%):
>   -$(FIND) $(@:clean%=%) \( -name \*~ -o -name \*.elc \) -exec $(RM) {} +
>
> +cleaneln:
> + $(MAKE) -C lisp $@
> +

Should be in .PHONY

> --- a/etc/ORG-NEWS
> +++ b/etc/ORG-NEWS
> @@ -11,7 +11,8 @@ See the end of the file for license conditions.
>  
>  Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
>  
> -* Version 9.7 (not released yet)
> +* V
> +ersion 9.7 (not released yet)

This is a stray newline.

> +*** ~make cleaneln~ will remove the .eln files from the user emacs 
> configuration
> +
> +Natively compiled Emacs lisp files generated with ~make native~ are
> +now correctly located and deleted with ~make cleaneln~.
> +
>  ** Miscellaneous
>  *** =org-crypt.el= now applies initial visibility settings to decrypted 
> entries

"Add 'native' option to 'make help'" from the previous version of the
patch still makes sense.

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



Minor patch

2024-03-13 Thread Stefan Monnier
The minor patch below clarifies what the computation is about and
removes the assumption that point-min == 1, while arguably
making the the code ever so slightly more efficient.


Stefan
>From d386af0653ff75956cc20e0df8ddb5bfa86fec9d Mon Sep 17 00:00:00 2001
From: Stefan Monnier 
Date: Wed, 13 Mar 2024 08:31:11 -0400
Subject: [PATCH] (org-src-font-lock-fontify-block): Clarify offset computation

* lisp/org-src.el (org-src-font-lock-fontify-block): Improve the translation
of local positions into org-buffer positions, and get rid of
assumption about the value of `point-min` while we're at it.
---
 lisp/org-src.el | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index de8d6ee42c..bec13427c2 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -681,7 +681,9 @@ as `org-src-fontify-natively' is non-nil."
 	(unless (eq major-mode lang-mode) (funcall lang-mode))
 (setq native-tab-width tab-width)
 (font-lock-ensure)
-	(let ((pos (point-min)) next)
+	(let ((pos (point-min)) next
+	  ;; Difference between positions here and in org-buffer.
+	  (offset (- start (point-min
 	  (while (setq next (next-property-change pos))
 	;; Handle additional properties from font-lock, so as to
 	;; preserve, e.g., composition.
@@ -695,7 +697,7 @@ as `org-src-fontify-natively' is non-nil."
 (when new-prop
   (if (not (eq prop 'invisible))
 		  (put-text-property
-		   (+ start (1- pos)) (1- (+ start next)) prop new-prop
+		   (+ offset pos) (+ offset next) prop new-prop
 		   org-buffer)
 ;; Special case.  `invisible' text property may
 ;; clash with Org folding.  Do not assign
@@ -727,7 +729,7 @@ as `org-src-fontify-natively' is non-nil."
 (when invisibility-spec
   (add-to-invisibility-spec invisibility-spec))
 (put-text-property
-		 (+ start (1- pos)) (1- (+ start next))
+		 (+ offset pos) (+ offset next)
  'org-src-invisible new-prop
 		 org-buffer)))
 	(setq pos next)))
-- 
2.43.0



Re: [PATCH] Fix headers in some testing lisp files

2024-03-13 Thread Ihor Radchenko
Max Nikulin  writes:

> Looking for a file suitable for a new portion of unit tests I have 
> noticed some inconsistencies in first lines of files.

Thanks!
Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=37a98d7de
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=ff5fc2563
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=ca2929094

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



Re: [PATCH] Allow external libraries (org-roam) to supply org-id locations

2024-03-13 Thread Ihor Radchenko
"Rick Lupton"  writes:

> Since updating the org-id code [1] to use the standard org-link registered 
> functions instead of hard-coding org-id opening, I have a problem using 
> org-roam.
>
> org-roam overwrites the :follow function for "id" links from the build-in 
> `org-id-open' to its own `org-roam-id-open' 
> (https://github.com/org-roam/org-roam/blob/8667e441876cd2583fbf7282a65796ea149f0e5f/org-roam-id.el#L91).
>   The only change between these functions is to insert a call to try 
> `org-roam-id-find' before trying `org-id-find', which uses org-roam's cached 
> sqlite database to find the id 
> (https://github.com/org-roam/org-roam/blob/8667e441876cd2583fbf7282a65796ea149f0e5f/org-roam-id.el#L70-L71)
>
> As well as being messy, my specific problem is that the improvements to open 
> search strings in org-id links are no longer enabled when org-roam is loaded.
>
> It seems reasonable that a library might want to provide its own way of 
> locating org-ids.  The attached patch adds a new hook variable 
> `org-id-find-functions` which contains functions doing the same job as 
> `org-id-find' that should be tried first.  Then all org-roam needs to do is 
> add its `org-roam-id-find' to the hook.
>
> Does this seem like a good idea?

I think that we can do it simpler.

Something like

(defun yant/message-me ( _) (message "I am here!") nil) ; return nil to 
pass the turn
(gv-define-setter org-link-get-parameter (value type key)
  `(org-link-set-parameters ,type ,key ,value))
(add-function :before-until (org-link-get-parameter "id" :follow) 
#'yant/message-me)

The idea is to use Emacs' advice machinery to allow third-party code
alter the functions stored in link parameters.

Either way, org-roam needs to be adapted in order to support the changes
in org-id. My variant appears to be simpler. We just need to add
`gv-define-setter ...' and maybe also document the `add-function'
approach in the manual.

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



Re: Table column formula with remote reference

2024-03-13 Thread Ihor Radchenko
Wu Ming  writes:

> My fault. Missed the line "One of the very first actions during evaluation of 
> Calc formulas and Lisp formulas is to substitute ‘@#’ and ‘$#’ in the formula 
> with the row or column number of the field where the current result will go 
> to.“  So '@@#' becomes '@'. 
>
> Overlooked it also because I did read the other line "‘@0’ and ‘$0’ refer to 
> the current row and column, respectively, i.e., to the row/column for the 
> field being computed.” and did try '@0$1'. Why is this different from the 
> above?

See "Remote references" subsection. It explains that in
remote(NAME,REF), REF is inside the remote table. Relative and current
column/row is ambiguous there.

In contrast, @# and $# are special - they are replaced before
remote(...) is processed.

I agree that the manual is somewhat confusing. Possibly, we may even
change `org-table-get-remote-range' to use relative references according
to the original table. Improvements welcome!

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



Re: org-agenda-skip-function now evaluated on line after headline?

2024-03-13 Thread Ihor Radchenko
Sean Whitton  writes:

> It looks like the org-agenda-skip-function is now evaluated with point
> on the second line of the subtree, rather than on the headline?
>
> It always used to be evaluated with point on the headline.  Seems like
> this might count as a regression?

May you please provide more details?
What kind of agenda view are you talking about? When did the behavior change?

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



Re: [BUG] "\fC" macro in ox-man.el [9.6.15 (release_9.6.15 @ /usr/share/emacs/29.2/lisp/org/)]

2024-03-13 Thread Ihor Radchenko
Xiyue Deng  writes:

> I'm not very familiar with roff so my understanding may be off.
> According to the `Safe subset' section in man(7), they mentioned the
> following:
>
> ,
> | Font changes (ft and the \f escape sequence) should only have the
> | values 1, 2, 3, 4, R, I, B, P, or CW (the ft command may also have no
> | parameters).
> `
>
> Does it mean `\fC' should be replaced by `\f[CW]'?

I am not sure

man 7 groff has

  Fonts often have trademarked names, and even Free Software fonts
  can require renaming upon modification. groff maintains a
  convention that a de‐ vice’s serif font family is given the name
  T (“Times”), its sans-serif family H (“Helvetica”), and its
  monospaced family C (“Courier”). Histori‐ cal inertia has driven
  groff’s font identifiers to short uppercase abbreviations of font
  names, as with TR, TB, TI, TBI, and a special font S.

So, \fC refers to "Courier".

I did not find any text description of CW font, but my groff
installation has usr/share/groff/1.23.0/font/devdvi/CW font spec:

name CW
special
...

for comparison, /usr/share/groff/1.23.0/font/devps/CR has

name CR
internalname Courier
...

which looks more suitable. But CR is not listed in "safe" subset
(man 7 man)

Also, neither CW nor CR work with html output:

with \fC

.TH "" "1" 
.PP
\fBThis is test\fP 
\fCcode a+b\fP here a+b.

yields (groff -Thtml test.man)

This is test code a+b here a+b.

Note  tag.

but with \f[CW]

.TH "" "1" 
.PP
\fBThis is test\fP 
\f[CW]code a+b\fP here a+b.

This is test code a+b here a+b.

No special markup is applied to the code.

Same for \f[CR].

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



Re: Org mode version 9.7-pre (9.7-pre-n/a-gb0c3c9); Infinite loop in org-update-statistics-cookies when org-hierarchical-todo-statistics nil

2024-03-13 Thread Ihor Radchenko
No Wayman  writes:

> (elpaca-test
> ...
> 1. toggle-debug-on-quit
> 2. With point on the statistics cookie in the first headline, 
> invoke org-update-statistics-cookies twice. 
> 3. Observer an infinite loop.

Thanks for reporting!
Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=505db97a8

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



Re: Pending contents in org documents (Re: Asynchronous blocks for everything (was Re: ...))

2024-03-13 Thread Ihor Radchenko
Bruno Barbier  writes:

>> While reading the library header and `org-pending' docstring (btw, it
>> should probably be a separate library, not a part of org-macs),
>
> I was feeling more and more like squatting the wrong file :-)
>
> Would "lisp/org-pending.el" be OK ?  Or do you see a better place/name ?

org-pending sounds fine. Maybe org-pending-text to be more explicit.

>> More or less, org-pending implements Elisp asynchronous process control,
>> but the processes are associated with region, not the whole buffer.
>> Hence, I feel that we should adopt terminology similar to the existing
>> terminology for processes - process filters, process sentinels, sending
>> signals to processes, etc. And similar API.
>
> The current `org-pending' doesn't know what a process is, or a thread.
> The job of org-pending is only to let Emacs know that a given region
> will be updated at some point later (much like what
> `org-edit-src-code' does, when a source block is being edited
> manually).

> I've re-read the Elisp manual about asynchronous processes.  The only
> thing that seemed obvious to me, was to replace "feedbacks-handler"
> with "sentinel".  I also tried to simplify things and use REGION
> instead of CONTENT where it make sense.  Thanks.

> Do you see something else ?

Similar to process API, your library provides means to interact with
process associated with the pending text - create them (40.4 Creating an
Asynchronous Process), handle feedback (40.9.2 Process Filter
Functions), handle on-done/fail/etc (40.10 Sentinels: Detecting Process
Status Changes), kill/cancel execution (40.5 Deleting Processes, 40.8
Sending Signals to Processes), insert-log (strerr in Emacs processes)
list pending (40.6 Process Information), org-pending-on-kill-buffer
(40.11 Querying Before Exit), get information (`process-attributes',
40.12 Accessing Other Processes)

I simply went across 40 Processes section of Elisp manual and I see
parallels for pretty much every subsection; but the terminology _and
API_ are different.

>> Also, I am not sure if I like the idea of exposing raw PINFO alist and
>> mutating it. In particular, I have doubts about mutating CONTENT.
>> What we might do instead is implement PINFO as struct with custom
>> accessors/setters.
>
> I went for this simple alist because it's more flexible (easy to add new
> bindings) and less code than using a struct.  And Org already uses lists
> like this (params, info, etc.).  Mutating CONTENT (or other essential
> data) would be a very bad idea indeed; but it's like that for pretty
> much everything with elisp.
>
> I'm OK to rewrite it using a cl-defstruct (to be honnest, I just
> flipped a coin to decide between a struct or an alist :) ).

I think that I need to elaborate.
It is not necessarily a matter of alist vs. struct, but more about the
API. I do not like the idea of mutating the alist entries directly. I'd
rather expose an API to work with "pending" as an opaque object - send
signals to it, get status, etc.

struct is slightly better here because it automatically defines setters
and getters for all the slots without a need to write extra boilerplate
code.

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



Re: Org-agenda: List project with deadlines

2024-03-13 Thread Christian Moe


Hi, Sébastien,

A general take: Org does not tell you how to organize your notes, it
provides tools for doing it any way you like, and this freedom bewilders
everyone. People work out their own systems, with advantages and
disadvantages. You may find it liberating to consider that there is no
single right way to do it. Though of course it's always good to arrive
at some consistent scheme you can re-use.

To add to the bewildering choice: One option you did not mention is
capturing column views [[info:org#Capturing column view]]. This gives
you updateable table of tasks and the properties you select for column
view. While you cannot perform actions on the tasks in those tables as
you can when using column view directly, they are helpful for getting an
overview (I find them easier to take in at a glance than the column-view
overlay). Using different column definitions for subtrees, you could
have a top-level table for projects and project-level tables for tasks.

As the info page mentions, in addition to the built-in system there is
also a contributed package, org-collector, that offers an alternative
approach to tabulating tasks and properties. I have found it powerful
and flexible. Since it does not rely on column-view definitions, though,
it means a tiny bit of duplicated effort if you're going to use column
view as well.

Yours,
Christian

Sébastien Gendre writes:

> Hello,
>
> I have some problems to manage my tasks for school with Org-mode. I had
> read manual, blog posts and tried different way. With no success.
>
>
> * What I need.
>
> For the school, I have a list of projects to do. Each with a deadline
> and different level of importance. And each project have their how
> tasks. Some with schedule, some with deadline and some with neither.
>
> Some times, I need to see only the list of projects, with their status,
> deadline, percentage done, importance and class name. How many days left
> would be nice. But not their inner tasks.
>
> When I work on a project, I need to see its tasks with their
> deadline/schedule, importance/optionality and status.
>
>
>
> * The problem I got
>
> I search a good way to manage it with Org-mode, but I have difficulty to
> do it easily. I always end with a complex system.
>
>
> ** Record the information
>
> Each class have its own file. In each class file, I have a section named
> "Projects and Tasks". As the name say, this section regroup the class
> projects and tasks.
>
> For each project and their tasks, I was thinking of creating a heading
> for the project and sub-heading for its tasks. Adding a [%] in the
> project title, a level A to C for its importance, a DEADLINE for its
> deadline and a tag for the class name.
>
> To record a new projects, I use a capture template to not forget
> anything. The new project go into an Inbox.org file and I use Org-refile
> to move it to its file.
>
> But how do I differentiate a project from a task for Org-mode ? Tags
> have inheritance. Do I use a property ?
>
> Is it a good idea to organize every thing by classes ? Or is it better
> to have one Org file named "Assignments" to regroup every projects ? In
> these files, I have other information recorded, like the taken notes,
> the list of distributed documents and their notes and also the list of
> class sessions to see them in my agenda.
>
>
> ** List the projects
>
> To list only the projects, I wanted to use Org-agenda todo list view and
> editing the column shown. But the manual say it may cause issues.
>
> What can I do ? Do I use it correctly or do I need to it in a completely
> different way ? Is it better to use a column view for it ? If yes, is it
> possible to build a column view from multiple files ?
>
>
> ** List of tasks from a project
>
> What is the best way to do it ? A custom Org-agenda view for each
> project ? A column view under the project top heading ?
>
>
> * Conclusion
>
> I have the felling that wanting to have everything well organized and
> using Org-agenda push me to think of too much complex ways to do thing.
>
> Maybe I need to do like with a bullet journal, with an Org-mode file
> instead of a page and don't try to use too much features.
>
> Do you have any suggestion ? Do I forget something ? For what I have
> suggested, am I completely wrong ?
>
>
>
> Best regards



Re: [DISCUSSION] Face priority in Org fontification (was: [BUG] org dates, radio links, and special keywords override heading backgrounds [9.7 (9.7-??-902dacb @ /home/st/.config/emacs/.local/straight/

2024-03-13 Thread Protesilaos Stavrou
Thank you, Ihor!

> From: Ihor Radchenko 
> Date: Mon,  4 Mar 2024 10:32:38 +
>
> StrawberryTea  writes:
>
>> Hello. Currently, if you have a heading background, and you have a date,
>> radio link, or special keyword, the background is overridden. I have
>> attached a patch that fixes this issue by using the `prepend' property
>> instead of the `t' property. Here is also a minimal example to reproduce
>> the issue:
>
> This is not an exhaustive list. We have a number of markup objects that
> are fontified overriding the containing element/paragraph/heading face:
>
> - target links
> - timestamps
> - footnotes
> - radio targets
> - macros
> - inline export snippets
>
> I am not 100% sure we should unconditionally prepend their faces to
> the containing headline/table/etc.
>
> CCing Protesilaos. This discussion might be of interest for him.

I think it makes sense to not override the background because otherwise
the heading can look visually "broken". See attached screenshot for an
example: it is called "demo-org-heading-with-background.png". In that
screenshot I include an overline for the heading, to show how this is
not limited to the background colour but extends to all face attributes.
To this end, I also attach "demo-org-heading-with-more-height.png" which
shows how the date is not scaling to match the heading's increased text
height.

All the best,
Protesilaos (or simply "Prot")

-- 
Protesilaos Stavrou
https://protesilaos.com


Re: [BUG] Re: The orgframe construct in the Beamer exporter as a default needs a rethink

2024-03-13 Thread Pedro Andres Aranda Gutierrez
Hi Leo,

I really don't have anything to object to the original patch. I support the
need to circumvent the "\begin-or-end{frame} inside frame" problem and
using orgframe is a clean way of doing so.
My only concern is the _default_ value for `org-beamer-frame-environment'.
If we set it to "frame", we only need to customise it in the file local
variables in files where it needs to be changed and we catch all flies in a
stroke:

Situation 1: presentation has no "\begin-or-end{frame} inside frame" -> no
extra stuff in file local variables AND newenvironment is not generated AND
frames are between \begin{frame} and \end{frame}
Situation 2: presentation needs to circumvent "\begin-or-end{frame} inside
frame" -> set local variable in file AND newenvironment is generated AND
frame is changed where it is strictly necessary,

Cheers, /PA

On Tue, 12 Mar 2024 at 21:32, Leo Butler  wrote:

> On Tue, Mar 12 2024, Ihor Radchenko  wrote:
>
> > Pedro Andres Aranda Gutierrez  writes:
> >
> >> Jup, of course. If you look in org-lint.el, one of the cases that would
> >> trigger a message is when the frame environment uses "frame" directly
> and
> >> there is a \begin{frame} in the org.
> >> Line 1522 onwards in org-lint.el
> >
> > (1)
> > Sure, but we should not demand users to run org-lint. Ideally, exporting
> > any valid Org file should work.
> > The fact that the presence of \begin{frame} breaks beamer is a technical
> > detail users should better not be bothered with. That's why we added the
> > orgframe construct.
> >
> > (2)
> > On the other hand, it is clear that Org mode users are unwilling to
> > tolerate too much of machine generated latex output. So, going further
> > and trying to generate unique orgframe environments might not be ideal.
> >
> > The current approach is a balance between the above considerations.
> >
> > AFAIU, what you propose is reverting the orgframe code; that goes
> > against the first point.
>
> Current git HEAD allows a user like Pedro to effectively turn off the
> orgframe code via
>
> (setq org-beamer-frame-environment "frame")
>
> or an equivalent.
>
> >
> > What I proposed is to reduce the amount of machine-generated code by
> > using `org-beamer-frame-environment' only when strictly necessary.
>
> Attached is a patch that limits the use of
> `org-beamer-frame-environment' to those frames that contain either
> \begin{frame} or \end{frame} in their body.
>
> This has the nice side-effect that one can include example frames
> generated by Org without causing an error (previously, Org exported
> latex that would not compile). See the attachments.
>
> Leo
>
>

-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet


Re: Table column formula with remote reference

2024-03-13 Thread Wu Ming


> On 12 Mar 2024, at 22:46, Ihor Radchenko  wrote:
> 
> Wu Ming  writes:
> 
>> Problem solved with
>> 
>> $1 = remote(A,@@#$1)
>> 
>> as described on the manual page 
>> https://orgmode.org/manual/References.html#Field-coordinates-in-formulas-1 
>> 
>> 
>> Where is the coordinate @@# documented?
> 
> I am confused. Isn't it documented in the linked section of the manual?
> 
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 

My fault. Missed the line "One of the very first actions during evaluation of 
Calc formulas and Lisp formulas is to substitute ‘@#’ and ‘$#’ in the formula 
with the row or column number of the field where the current result will go 
to.“  So '@@#' becomes '@'. 

Overlooked it also because I did read the other line "‘@0’ and ‘$0’ refer to 
the current row and column, respectively, i.e., to the row/column for the field 
being computed.” and did try '@0$1'. Why is this different from the above?