Re: [BUG] ox-odt.el overrides auto-mode-alist defaults [9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)]

2023-12-29 Thread Ihor Radchenko
Ihor Radchenko  writes:

> I am not applying the patches yet just in case if some users are relying
> on the removed behaviour. If anyone reading this does use this undocumented
> feature, please reply, and we will discuss how to retain it.

Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=69e746c1e
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=996441fd5

Fixed.

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



Re: [BUG] ox-odt.el overrides auto-mode-alist defaults [9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)]

2023-12-09 Thread Ihor Radchenko
Peter Prevos  writes:

> ox-odt.el overrides the auto-mode-alist settings and instructs 
> Emacs to open od[fgpst] files in archive-mode instead of 
> doc-view-mode.
>
> This line can be removed because it prevents Emacs from opening 
> LibreOffice files.

Confirmed.
AFAIU, the reason that change is made is a line in
`org-odt--export-wrap' where the exporter
"Open the OpenDocument file in archive-mode for examination."

However, most users probably don't have a chance for "examination" as
the file is opened in the background without notice in the message
buffer or manual. It is also a side effect no other export backend has.

So, I am inclined to remove that code in `org-odt--export-wrap' and then
remove the code altering `auto-mode-alist' (which is definitely
something we must not do). See the attached patch set.

I am not applying the patches yet just in case if some users are relying
on the removed behaviour. If anyone reading this does use this undocumented
feature, please reply, and we will discuss how to retain it.

>From f60b3b4f2d9159ac367c08bfb7e024d0faeb1d3b Mon Sep 17 00:00:00 2001
Message-ID: 
From: Ihor Radchenko 
Date: Sat, 9 Dec 2023 11:37:02 +0100
Subject: [PATCH 1/2] lisp/ox-odt.el: Do not open the generated exported file
 in the background

* lisp/ox-odt.el (org-odt--export-wrap): Do not open the exported file
in the background.  Such behavior is not consistent with the other
export backends and is not documented (users don't know about it).
* etc/ORG-NEWS (ODT export no longer opens the exported file in the
background): Document the breaking change.
---
 etc/ORG-NEWS   | 7 +++
 lisp/ox-odt.el | 3 ---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 59c45b2aa..439323f00 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -13,6 +13,13 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
 
 * Version 9.7 (not released yet)
 ** Important announcements and breaking changes
+*** ODT export no longer opens the exported file in the background
+
+ODT exporter used to open the exported file in ~archive-mode~ "for
+examination".  This was not documented, was done in the background,
+and is not consistent with all other export backends. Now, this
+feature is removed.
+
 *** ~org-src-associate-babel-session~ and ~org-babel--associate-session~ are now obsolete
 
 This functionality is not documented, rarely used and can be achieved
diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 8d3a48394..e51547f48 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -4081,9 +4081,6 @@ (defmacro org-odt--export-wrap (out-file  body)
 	 (message "Created %s" (expand-file-name target))
 	 ;; Cleanup work directory and work files.
 	 (funcall --cleanup-xml-buffers)
-	 ;; Open the OpenDocument file in archive-mode for
-	 ;; examination.
-	 (find-file-noselect target t)
 	 ;; Return exported file.
 	 (cond
 	  ;; Case 1: Conversion desired on exported file.  Run the
-- 
2.42.0

>From 3508ed0df8cf28e8f5d74cc1c9e232f027055356 Mon Sep 17 00:00:00 2001
Message-ID: <3508ed0df8cf28e8f5d74cc1c9e232f027055356.1702118852.git.yanta...@posteo.net>
In-Reply-To: 
References: 
From: Ihor Radchenko 
Date: Sat, 9 Dec 2023 11:38:22 +0100
Subject: [PATCH 2/2] lisp/ox-odt.el: Do not alter `auto-mode-alist'

Reported-by: Peter Prevos 
Link: https://orgmode.org/list/87wmtoosru@prevos.net
---
 lisp/ox-odt.el | 5 -
 1 file changed, 5 deletions(-)

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index e51547f48..c209e01a6 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -4349,11 +4349,6 @@ (defun org-odt-convert ( in-file out-fmt open)
 
 ;;; Library Initializations
 
-(dolist (desc org-odt-file-extensions)
-  ;; Let Emacs open all OpenDocument files in archive mode.
-  (add-to-list 'auto-mode-alist
-	   (cons (concat  "\\." (car desc) "\\'") 'archive-mode)))
-
 (provide 'ox-odt)
 
 ;; Local variables:
-- 
2.42.0


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


[BUG] ox-odt.el overrides auto-mode-alist defaults [9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)]

2023-12-08 Thread Peter Prevos




Remember to cover the basics, that is, what you expected to happen 
and
what in fact did happen.  You don't know how to make a good 
report?  See


https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


Hi,

ox-odt.el overrides the auto-mode-alist settings and instructs 
Emacs to open od[fgpst] files in archive-mode instead of 
doc-view-mode.


This line can be removed because it prevents Emacs from opening 
LibreOffice files.


The test is to open a LibreOffice file in vanilla Emacs and when 
ox-odt.el is activated.


Regards

P:)

Emacs  : GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ 
Version 3.24.38, cairo version 1.17.8)
Package: Org mode version 9.6.6 (release_9.6.6 @ 
/usr/share/emacs/29.1/lisp/org/)


current state:
==
(setq
org-agenda-prefix-format '((dashboard-agenda . " %i %-12:c %s ")
(agenda . " %i %-12:c%?-12t% s")
(todo . " %i %-12:c")
(tags . " %i %-12:c")
(search . " %i %-12:c"))
org-archive-location 
"~/Documents/notes/20230604T152600--gtd-archive__productivity.org::* 
From %s"

org-link-elisp-confirm-function 'yes-or-no-p
org-directory "/home/peter/Documents/notes/"
org-cite-insert-processor 'citar
org-hide-emphasis-markers t
org-bibtex-headline-format-function #[257 "\300\236A\207" 
[:title] 3 "\n\n(fn ENTRY)"]

org-log-done 'time
org-capture-bookmark nil
org-agenda-custom-commands '(("n" "Netherlands" ((tags-todo 
"nl"))

   ((org-agenda-files
 (denote-directory-files-matching-regexp 
 "_gtd")

 )
)
   )
  ("h" "Third Hemisphere"
   ((agenda ""
 ((org-agenda-span 3)
  (org-agenda-start-on-weekday 
  nil))

 )
(todo "NEXT"
 ((org-agenda-overriding-header
   "Next Actions")
  )
 )
(todo "WAITING"
 ((org-agenda-overriding-header
   "Waiting")
  )
 )
(stuck))
   ((org-agenda-files
 (cl-remove-if
  (lambda (f)
   (string-match-p "_cw" f))
  (denote-directory-files-matching-regexp 
  "_gtd")

  )
 )
)
   )
  ("p" "Projects"
   ((todo "PROJECT")
(stuck ""
 ((org-agenda-sorting-strategy
   '(alpha-up priority-down))
  )
 )
)
   )
  ("c" "Work"
   ((agenda ""
 ((org-agenda-span 7)
  (org-agenda-start-on-weekday 1))
 )
(todo "NEXT") (todo "WAITING")
(stuck))
   ((org-agenda-files
 (denote-directory-files-matching-regexp 
 "_cw.*_gtd")

 )
)
   )
  )
org-log-into-drawer t
org-agenda-skip-scheduled-if-done t
org-agenda-files 
'("/home/peter/Documents/notes/20220718T190010--notes-inbox__gtd.org" 
"/home/peter/Documents/notes/20220719T125424--third-hemisphere-action-plan__gtd.org" 
"/home/peter/Documents/notes/20230104T060726--lucid-manager-action-plan__gtd_lucidmanager.org" 
"/home/peter/Documents/notes/20230104T193809--horizon-of-reason-action-plan__gtd.org" 
"/home/peter/Documents/notes/20230115T083737--magic-perspectives-action-plan__gtd_magic.org" 
"/home/peter/Documents/notes/20230821T094002--nederland__gjpc_gtd_nl.org" 
"/home/peter/Documents/notes/20230925T150445--coliban-water-actions__cw_gtd.org")

org-capture-templates '(("f" "Fleeting note" item
  (file+headline org-default-notes-file
   "Notes")
  "- %?")
 ("t" "New task" entry
  (file+headline org-default-notes-file
   "Tasks")