HI,

nothing like sleeping over a problem. This solution seems to be easier...

/PA

On Sun, 10 Mar 2024 at 12:49, Pedro A. Aranda <paag...@gmail.com> wrote:

> Hi,
>
> 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.
>
> Attached is a patch in four parts to make natively compiled orgmode more
> consistent.
>
> This is a first step and I would like reactions to it, before submitting
> a unified patch.
>
> I hope that splitting it up helps understanding the different parts of
> my "solution". Maybe some parts can be cherry picked better this way...
>
> 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
From 9476898539bd9ad72a5b45bc1625fa398eada879 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" <paag...@gmail.com>
Date: Mon, 11 Mar 2024 09:48:10 +0100
Subject: [PATCH 2/3] Clean .eln files from user emacs configuration

* lisp/Makefile: Get the directory where emacs stores the compiled files
  in the user storage and use that to locate the .eln files generated by
  'make native' and delete them

---
 lisp/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/Makefile b/lisp/Makefile
index c570d9cfa..506aa75e1 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -11,6 +11,9 @@ 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 '(princ (car native-comp-eln-load-path))')
+
 -include local.mk

 .PHONY:	all compile compile-dirty \
@@ -79,6 +82,11 @@ cleanauto clean cleanall::
 clean cleanall cleanelc::
 	$(RM) *.elc

+cleaneln::
+	for elnf in $(patsubst %.eln, %-*.eln, $(LISPN)); do \
+	  find $(ELNDIR) -name $$elnf -exec $(RM) -v {} \; ;\
+	done
+
 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" <paag...@gmail.com>
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 $@
+
 cleanelc:
 	$(MAKE) -C lisp $@

--
2.34.1
From 0b5d791d32f26698e53299e639d7ef73581a6310 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" <paag...@gmail.com>
Date: Mon, 11 Mar 2024 09:56:05 +0100
Subject: [PATCH 3/3] Announce cleaneln

---
 etc/ORG-NEWS | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index abe62daaf..325fd412b 100644
--- 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)
 ** Important announcements and breaking changes
 *** When ~org-link-file-path-type~ is a function, its argument is now a filename as it is read by ~org-insert-link~; not an absolute path
 
@@ -1263,6 +1264,11 @@ 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~.
+
 ** Miscellaneous
 *** =org-crypt.el= now applies initial visibility settings to decrypted entries
 
-- 
2.34.1

Reply via email to