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

2024-03-14 Thread Juan Manuel Macías
To summarize the latest improvements and modifications to the `:export'
attribute...

The attribute supports one or more elements separated by a space. Each
element can be any of the following signs: "*" (export only the
content), "-" (do not export), "=" (export the rest normally), "=*"
(export the rest, but only the content), "=-" (do not export the rest).
Additionally, backend names can be given explicitly, alone or
accompanied by the "*" or "-" signs, that is (where "backend" equals the
name of the backend):

  backend: export normally for that backend and its derived backends;

  backend-: do not export for that backend or its derived backends.

  backend*: export only the content for that backend and its derived
  backends.

Some examples with valid combinations:

@foo[:export *]{lorem ipsum}

==> export only the content

@foo[:export -]{lorem ipsum}

==> do not export

@foo[:export latex-]{lorem ipsum}

==> do not export to LaTeX

@foo[:export latex- html* =]{lorem ipsum}

==> do not export to LaTeX, export only the content to html and export the
rest normally.

@foo[:export latex =*]{lorem ipsum}

==> export normally to LaTeX but export only the content to the rest

@foo[:export latex =-]{lorem ipsum}

==> export normally to LaTeX and not export to the rest

And below is a complete example based on a possible use case that Max
had exposed:


 To see a demo of the Fairlight CMI, watch @@[:export html =-]{this
 video} @@[:export
 html-]{[[https://www.youtube.com/watch?v=am0GBuS_7cE][this video]]}
 with Peter Vogel.
 
 #+begin_export html
 https://www.youtube.com/embed/am0GBuS_7cE?si=X7pghJhtdfOT1hby;
 title="YouTube video player"
 frameborder="0"
 allow="accelerometer;
 autoplay; clipboard-write; encrypted-media; gyroscope;
 picture-in-picture; web-share"
 allowfullscreen>
 #+end_export




Re: Things got very slow: profiler output

2024-03-14 Thread Bruno Cardoso


On 2024-03-14, 21:23 +, Ihor Radchenko  wrote:

>
> That's a different bug.
> Fixed on main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=fb61e83f2
>
> You can try to run
> M-: (benchmark-run 1 (org-fold-core--property-symbol-get-create 'outline 
> nil t)) 
> from inside Org mode buffer.
>
> I am getting (0.178426995 0 0.0) as a result - takes almost no CPU time.
>

Thanks Ihor. Indeed I get a similar result from benchmark-run. 




Re: Org-attach risks

2024-03-14 Thread Ihor Radchenko
Kepa  writes:

> Each time I change the DIR property for attachments, I have to answer 
> correctly two questions: if I want to move every file to the new path, and if 
> I want to delete the old folder.
>
> Is it possible to not receive these questions?
> For me, it's a big risk I don't want to take every time.

May you elaborate on what other behavior you would prefer to see?

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



Re: Worg build status?

2024-03-14 Thread Ihor Radchenko
Adam Porter  writes:

> A couple of days ago I pushed some updates to Worg.git, and then I saw 
> that the build seems to be failing 
> .

Those are for orgmode.org (orgweb repository), not for Worg. Bastien did
some updates to automatic rebuilds, which was likely the cause.

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

This is still a problem. Likely on Sourcehut side.
For now, only Bastien can trigger the builds.

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



Re: Strange behavior => bug?

2024-03-14 Thread Ihor Radchenko
Guillaume MULLER  writes:

> Here is the simplest example I could write:
>
>  main.org
> * slide 1
> 2. [@2] Works
> 3. Also
>
> #+INCLUDE:  "./doesnotwork.org"
>
>  doesnotwork.org
> ** Lorem
> 9. [@9] \small ipsum
> 10. ipsum
>
>
> - If I try to "org-beamer-export-to-pdf" "main.org", I get:
> org-do-latex-and-related: Args out of range: 0, 1

I just tried
1. emacs -Q /tmp/main.org
2. M-: (require 'ox-beamer) 
3. M-x org-beamer-export-to-pdf

I do not see any errors.

This is using Emacs 28 (Org 9.5.5)
I cannot reproduce using Emacs 30 + Org 9.6 either.

-- 
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-14 Thread Ihor Radchenko
Wu Ming  writes:

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

Let me elaborate.

When Org mode sees something like

#+TBLFML: $1 = $2 + remote(A,@@#$1) 

1. it goes to every cell in column 1 and remembers current column and
   row numbers (original cell)

2. In the right side of the formula $2 + remote(A,@@#$1), Org replaces
   all the instances of @# and $# with current column and row.
   So, when we are calculating the value for @1$1, we get
   $2 + remote(A,@1$1)

3. Org moves to table A and replaces remote(A,@1$1) with cell contents
   of @1$1 inside table A. At this point, it is not allowed to have
   relative references like $1 or $-1, because "current" column and row
   are set inside remote table A - the original cell coordinates are not
   available.

4. Org goes back to the original table, takes the updated formula
   $2 + , and replaces relative reference $2
   according to the current column - with the value stored in @1$2
   column

5. Org passes the resulting expression  +  to GNU cal and assigns the result as the value of the
   current cell @1$1.

6. Repeat for @2..$1 cells.

As you can see, @# and $# substitution always uses local cell
coordinates. Any other relative reference is not allowed inside
remote(...).

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

Formula debugger is really helpful to understand the process.

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

Normally, if you use org-table-* commands, the formulas get updated when
you move the columns.

To make things more readable, you can also assign names to columns:

 | ! | | P1 | P2 | P3 |   Tot |  |
 |   | Maximum | 10 | 15 | 25 |50 | 10.0 |

Then, you can write $P1 = ... instead of $3 = ...
See "3.5.10 Advanced features" 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 



Strange behavior => bug?

2024-03-14 Thread Guillaume MULLER

Hi,

Here is the simplest example I could write:

 main.org
* slide 1
2. [@2] Works
3. Also

#+INCLUDE:  "./doesnotwork.org"

 doesnotwork.org
** Lorem
9. [@9] \small ipsum
10. ipsum


- If I try to "org-beamer-export-to-pdf" "main.org", I get:
org-do-latex-and-related: Args out of range: 0, 1

- If I remove the \small on lines "9." it works.

- If I copy-paste the content of "doesnotwork.org" into "main.org" it works.

Is this behavior normal?

- I cannot manage to find nor the problem (but I'm a n00b in org mode) nor a 
workaround. I would be glad if someone could help.


Thanks in advance


Guillaume


OpenPGP_0xF3BCAD9F46F5FADC.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Things got very slow: profiler output

2024-03-14 Thread Ihor Radchenko
Bruno Cardoso  writes:

> 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).

That's a different bug.
Fixed on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=fb61e83f2

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

You can try to run
M-: (benchmark-run 1 (org-fold-core--property-symbol-get-create 'outline 
nil t)) 
from inside Org mode buffer.

I am getting (0.178426995 0 0.0) as a result - takes almost no CPU time.

-- 
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-14 Thread Ihor Radchenko
[ Adding Org ML back to CC to keep the conversation public ]

Divya  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'?
> ...
> Indeed that's what I meant, it was a typo, my apologies.

On my side, using the latest stable Org mode version, after setting
`org-fontify-quote-and-verse-blocks' to t (it must be set before loading
an Org file), text inside quote blocks is correctly fontified using
org-quote face on my side.

You can check faces using M-x describe-text-properties with point inside
quote block.

-- 
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-14 Thread Tony Zorman
On Wed, Mar 13 2024 12:58, Ihor Radchenko wrote:
> 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.

But isn't what Org calls LaTeX math pretty equivalent to what would
count as the same in a LaTeX buffer? From a quick scan of texmathp.el, I
couldn't actually see a hard-dependency on a TeX-derived mode at all. I
wouldn't really care about this so much, but the fact that the Org
variant just misreports the position is a bit unfortunate, in my
opinion.

  Tony

-- 
Tony Zorman | https://tony-zorman.com/



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

2024-03-14 Thread Leo Butler
On Wed, Mar 13 2024, Ihor Radchenko  wrote:

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

"all the" should be "any of" in that last sentence.

--

How about the attached patch?

The previous org file exports in the same way, and exporting just the
final heading shows that no newenvironment is emitted.

Leo

From 22d829089fc2ca153f1541abe1d5415d311b33d3 Mon Sep 17 00:00:00 2001
From: Leo Butler 
Date: Tue, 12 Mar 2024 15:11:27 -0500
Subject: [PATCH] lisp/ox-beamer.el: constrain use of
 org-beamer-frame-environment

* lisp/ox-beamer.el (org-beamer--format-frame, org-beamer-template):
Only use `org-beamer-frame-environment' when a frame is marked as
fragile and the frame's contents include either \begin{frame} or
\end{frame}.  When `org-beamer-frame-environment' is used and not
equal to "frame", set `org-beamer--frame-environment-used' to t.  When
`org-beamer--frame-environment-used' is t, `org-beamer-template' emits
a definition of the alternative frame environment.

* lisp/ox-beamer.el (org-beamer--frame-environment-used): New
variable.

Refs: https://list.orgmode.org/orgmode/87bk7jeik8.fsf@localhost/
https://list.orgmode.org/87a5nux3zr@t14.reltub.ca/T/
---
 lisp/ox-beamer.el | 26 ++
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 4fad37b59..a79490194 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -167,6 +167,10 @@ used inside beamer slides."
 
 ;;; Internal Variables
 
+(defvar org-beamer--frame-environment-used nil
+  "Nil unless `org-beamer-frame-environment' is used.
+See `org-beamer--frame-environment'.")
+
 (defconst org-beamer-column-widths
   "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.0 :ETC"
   "The column widths that should be installed as allowed property values.")
@@ -429,8 +433,21 @@ used as a communication channel."
 	  ;; among `org-beamer-verbatim-elements'.
 	  (org-element-map headline org-beamer-verbatim-elements 'identity
 			   info 'first-match))
- (frame (or (and fragilep org-beamer-frame-environment)
-"frame")))
+ ;; If FRAGILEP is non-nil and CONTENTS contains an occurrence
+ ;; of \begin{frame} or \end{frame}, then set the FRAME
+ ;; environment to be `org-beamer-frame-environment';
+ ;; otherwise, use "frame". If the selected environment is not
+ ;; "frame", then set `org-beamer--frame-environment-used' to
+ ;; t.
+ (frame (let ((selection
+   (or (and fragilep
+(or (string-search "\\begin{frame}" contents)
+(string-search "\\end{frame}" contents))
+org-beamer-frame-environment)
+   "frame")))
+  (unless (string= selection "frame")
+(setq org-beamer--frame-environment-used t))
+  selection)))
 (concat "\\begin{" frame "}"
 	;; Overlay specification, if any. When surrounded by
 	;; square brackets, consider it as a default
@@ -851,8 +868,9 @@ holding export options."
  (org-latex--insert-compiler info)
  ;; Document class and packages.
  (org-latex-make-preamble info)
- ;; Define the alternative frame environment.
- (unless (equal "frame" org-beamer-frame-environment)
+ ;; Define the alternative frame environment, if needed.
+ (when org-beamer--frame-environment-used
+   (setq org-beamer--frame-environment-used nil)
(format "\\newenvironment<>{%s}[1][]{\\begin{frame}#2[environment=%1$s,#1]}{\\end{frame}}\n"
org-beamer-frame-environment))
  ;; Insert themes.
-- 
2.43.0



Re: Best way to make the Org source tree?

2024-03-14 Thread Rohit Patnaik
>From reading `mk/targets.mk`, seems like `make update` runs the following:
git checkout $(GIT_BRANCH)
git remote update
git pull
make all

I think `make all` also runs `make autoloads`. Personally, my update process is
`git pull && make`, because until just now I didn't realize that `make update`
was an option.

-- Rohit Patnaik



Re: Questions about splitting a tree into multiple files

2024-03-14 Thread Sébastien Gendre
Thank you.


Ihor Radchenko  writes:

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




Re: Table column formula with remote reference

2024-03-14 Thread Fraga, Eric
On Thursday, 14 Mar 2024 at 09:16, Wu Ming wrote:
> Unrelated, but appeared on the same trial, noticed a cell was
> mis-calculated. [...] This made me worry about reliability of simple
> biz calculations I am trying on Org spreadsheet for the first
> time. Please advise.

I've not seen any problems with spreadsheet/table calculations in org and use 
it extensively.  I don't use remote access generally however.

In any case, one very nice feature of org tables is you can see exactly how and 
what it calculates when you ask it to.  Turn on debugging by "C-c {" 
(org-table-toggle-formula-debugger) and you can see all the information you 
should need to identify what, if anything, is going wrong.

Turn off debugging with the same key sequence.

-- 
: Eric S Fraga, with org release_9.6.19-1215-g67d937 in Emacs 30.0.50


Org-attach risks

2024-03-14 Thread Kepa
Hi

Each time I change the DIR property for attachments, I have to answer correctly 
two questions: if I want to move every file to the new path, and if I want to 
delete the old folder.

Is it possible to not receive these questions?
For me, it's a big risk I don't want to take every time.

Best regards


Re: Things got very slow: profiler output

2024-03-14 Thread Bruno Cardoso


On 2024-03-14, 07:34 +, Gerard Vermeulen  
wrote:

>
> I see this too and my work-around is calling org-fold-show-all to read 
> the
> newly created property drawer.
>

Hello Gerard,

Yes, this work-around also does work for me. I often do S-TAB to cycle the Org 
file visibility and then I'm able to fold/unfold the new drawer again.


> I am running
> GNU Emacs 30.0.50 (build 15, x86_64-apple-darwin20.6.0, NS 
> appkit-2202.70 Version 11.7.1 (Build 20G918)) of 2024-03-14
> with a yesterday's Org main.
>
> I am using the default theme (light background) and do not do any font 
> tweaking.

I forgot to mention my Emacs version: GNU Emacs 29.2 (build 1, 
x86_64-pc-linux-gnu, GTK+ Version 3.24.40, cairo version 1.18.0). Its the 
'emacs-nativecomp' package from Arch repository.


Best,

Bruno.



Re: Things got very slow: profiler output

2024-03-14 Thread Bruno Cardoso


On 2024-03-14, 01:17 +, William Denton  wrote:

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

Hello William,

I haven't tried to revert to it yet, but I guess it was in fact after the 
commit/date you mentioned when I started noticing this behavior.


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

I looked into your config and couldn't spot anything special we have in common. 
I have these settings in my config regarding org fold and fontify:

(setq org-fold-catch-invisible-edits 'smart  ;; default is 'smart
  org-fontify-done-headline  t   ;; default is t
  org-fontify-quote-and-verse-blocks t   ;; default is nil
  org-fontify-whole-heading-line t)  ;; default is nil

However I get the slow-down in a clean init.el with just `(straight-use-package 
'org)'.


Best,

Bruno.



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-14 Thread Protesilaos Stavrou
> From: Ihor Radchenko 
> Date: Wed, 13 Mar 2024 14:27:18 +

> [... 16 lines elided]

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

This can get tricky, I know.

The idea is to make this behave how all faces relate to the 'default'
face with regard to their 'undefined' attributes. Namely, if a face
defines an attribute, then it overrides the 'default' face, otherwise it
falls back to it for the value of the given attribute.

In the case of the headlines then, every other element should attain the
attributes of the heading unless it explicitly overrides them. So a link
with an 'undefined' height will be as high as the heading, but a link
with a height of, say, 1.0 will keep that height even if the heading is
at a 2.0 height (or whatever).

Same idea for all face attributes.

Now the tricky part is to figure out which combinations can work this
way. Headings and source blocks are two obvious ones. Maybe there are
more, but I cannot think of one right now.

-- 
Protesilaos Stavrou
https://protesilaos.com



Re: Reproducible work with natively compiled Emacs

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

attached is the patch in what I would call the final version. The main
enhancement is that
make native and make cleaneln with exit gracefully on systems where native
compilation is not enabled.

Best, /PA

On Thu, 14 Mar 2024 at 07:49, Pedro Andres Aranda Gutierrez <
paag...@gmail.com> wrote:

> HI,
>
> On Wed, 13 Mar 2024 at 18:13, Ihor Radchenko  wrote:
>
>> 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.
>>
> You are right
>
>> > +cleaneln::
>>
>> Why ::?
>>
> You are absolutely right, it's an isolated rule and it doesn't need ::
>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at .
>> Support Org development at ,
>> or support my work at 
>>
>
> Patch will follow. I'm testing it against an Emacs WITHOUT native-comp to
> check it there too.
>
> Best, /PA
> --
> 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
>
>

-- 
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 797a63581bac53f8eb9cba268a975807ec6b841e Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" 
Date: Thu, 14 Mar 2024 08:17:11 +0100
Subject: [PATCH] Make cleaneln work, execute cleanly when native comp not
 available.

---
lisp/Makefile: clean .eln files from the directory where the user's natively
compiled files are stored. Detect when native compilation is not available
and exit gracefully in that case

* 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 | 20 +++-
 mk/targets.mk |  5 -
 4 files changed, 31 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 visibility settings to decrypted entries

diff --git a/lisp/Makefile b/lisp/Makefile
index c570d9cfa..ff49dccff 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -11,12 +11,15 @@ LISPF 	:= $(filter-out $(LISPA),$(sort $(wildcard *.el)))
 LISPC 	:= $(filter-out $(LISPB) $(LISPN:%el=%elc),$(LISPF:%el=%elc))
 LISPN 	:= $(filter-out $(LISPB) $(LISPN:%el=%eln),$(LISPF:%el=%eln))
 _ORGCM_ := dirall single native source slint1 slint2
+# This is where Emacs stores the .eln files
+ELNDIR  := $(shell $(EMACS) --batch --eval '(when (native-comp-available-p) (princ (car native-comp-eln-load-path)))')
+
 -include local.mk

 .PHONY:	all compile compile-dirty \
 	$(_ORGCM_) $(_ORGCM_:%=compile-%) \
 	autoloads \
-	install clean cleanauto cleanall cleanelc clean-install
+	install clean cleanauto cleanall cleanelc cleaneln clean-install

 # do not clean here, done in toplevel make
 all compile compile-dirty::	 | autoloads
@@ -52,9 +55,15 @@ slint1:
 	@$(info Compiling single $(abspath $<)...)
 	-@$(ELC) $<

+ifeq (,$(ELNDIR))
+%.eln: %.el
+	@$(info Native compilation not enabled!)
+	@false
+else
 %.eln: %.el
 	@$(info Native compiling single $(abspath $<)...)
 	-@$(ELN) $<
+endif

 autoloads:	cleanauto $(LISPI) $(LISPV)

@@ -79,6 +88,15 @@ cleanauto clean cleanall::
 

Re: Things got very slow: profiler output

2024-03-14 Thread Gerard Vermeulen




On 14.03.2024 02:17, William Denton wrote:

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 see this too and my work-around is calling org-fold-show-all to read 
the

newly created property drawer.



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.

I did not notice any of the slow-downs and the output of the cpu 
profiler

looks normal to me.


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


I am running
GNU Emacs 30.0.50 (build 15, x86_64-apple-darwin20.6.0, NS 
appkit-2202.70 Version 11.7.1 (Build 20G918)) of 2024-03-14

with a yesterday's Org main.

I am using the default theme (light background) and do not do any font 
tweaking.


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


Regards -- Gerard