emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org-reload reloads unnecessary files
@ 2023-06-24 11:16 Max Nikulin
  2023-06-24 12:54 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Max Nikulin @ 2023-06-24 11:16 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

`org-reload' reloads obarray and oclosure libraries that are unrelated 
to org-babel and org-cite. I believe, the function should not do it.

Frankly speaking, I miss a public function in Emacs similar to 
`package--list-loaded-files' removed in

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=9dfd945a2c2
: 9dfd945a2c2 2021-11-07 01:28:47 +0100 dickmao: Fix byte compilation of 
package built-ins
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49708

but with it's bugs fixed. I suspect `org-reload' may have another issue 
similar to the one that `package--list-loaded-files' had. If an .el.gz 
is loaded for some reason instead of the corresponding .elc file than 
`org-reload' may fail to detect it. I have not tried to test it though.

My impression is that writing such function is tricky, so single well 
tested version should be an advantage. Unfortunately the closest 
function in the current package.el requires a package description 
instead of a directory.

The context of this bug report is
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62762#284
Re: bug#62762: 'make' often errors with "Org version mismatch" Fri, 23 
Jun 2023 12:02:47 +0000



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [BUG] org-reload reloads unnecessary files
  2023-06-24 11:16 [BUG] org-reload reloads unnecessary files Max Nikulin
@ 2023-06-24 12:54 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2023-06-24 12:54 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> `org-reload' reloads obarray and oclosure libraries that are unrelated 
> to org-babel and org-cite. I believe, the function should not do it.

Confirmed. The regexp used to match Org libraries is too inclusive.

> ... I suspect `org-reload' may have another issue 
> similar to the one that `package--list-loaded-files' had. If an .el.gz 
> is loaded for some reason instead of the corresponding .elc file than 
> `org-reload' may fail to detect it. I have not tried to test it though.

It should not, by accident.

(feats (delete-dups
		 (mapcar 'file-name-sans-extension
			 (mapcar 'file-name-nondirectory
				 (delq nil
				       (mapcar 'feature-file
					       features))))))

`file-name-sans-extension' only strips the last extension in .el.gz.
Yet, (org-load-noerror-mustsuffix "foo.el") works the same way as
(org-load-noerror-mustsuffix "foo") when we pass UNCOMPILED argument to
`org-reload'.

We should still fix the case when the loaded file is ".el.gz" though.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-24 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-24 11:16 [BUG] org-reload reloads unnecessary files Max Nikulin
2023-06-24 12:54 ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).