Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something funky setting global-page-break-lines-mode via Customize #27

Closed
rnkn opened this issue Dec 7, 2019 · 10 comments
Closed

Something funky setting global-page-break-lines-mode via Customize #27

rnkn opened this issue Dec 7, 2019 · 10 comments

Comments

@rnkn
Copy link

rnkn commented Dec 7, 2019

Hi Steve,

Something weird happens when setting global-page-break-lines mode to t via Customize. This is what goes into my custom-file:

'(global-page-break-lines-mode t nil (page-break-lines))

when I would expect:

'(global-page-break-lines-mode t)

The problem this causes is if page-break-lines happens not to be in the load-path for whatever reason (testing something, etc.) then Emacs initialisation will stumble, with:

file-missing "Cannot open load file" "No such file or directory" "page-break-lines"

Having a look at the source, I can't see why this is the case, so I suspect that it might be a "clever" change upstream with Emacs... What's your take?

@purcell
Copy link
Owner

purcell commented Dec 9, 2019

I can only imagine that your custom file is getting loaded before packages have been initialized, ie. the various packages' source directories have not yet been added to load-path at the time that your custom-file gets loaded.

@purcell
Copy link
Owner

purcell commented Dec 9, 2019

The problem this causes is if page-break-lines happens not to be in the load-path for whatever reason (testing something, etc.) then Emacs initialisation will stumble, with:

FWIW, I get the same clause written into my custom file if I do the same thing. It's normal that something would not work as expected if the customize system tries to set things that don't yet exist, so a noisy error like this is a good thing IMO.

@rnkn
Copy link
Author

rnkn commented Dec 9, 2019

I'm calling package-initialize before loading custom-file, so that's not it:
https://github.com/rnkn/.config/blob/master/emacs/init.el

It's more than a noisy error, as it prevents Emacs from loading. The customize system is specifically designed not to prevent loading even when libraries aren't found, e.g. settings hang around after uninstalling their library, because obviously it makes sense if the user then chooses to reinstall. The separation of settings and source is a good thing, and ought not to trip Emacs over.

However I have become convinced this is an Emacs bug. Just wanted to get your take.

@purcell
Copy link
Owner

purcell commented Dec 9, 2019

Yes, you could be right. If I save the setting (producing the same clause in my custom-file and then restart Emacs, I see no error. This is with Emacs 26.3.

@rnkn
Copy link
Author

rnkn commented Dec 30, 2019

This appears to be fixed on 27.x
🎉

@rnkn rnkn closed this as completed Dec 30, 2019
@purcell
Copy link
Owner

purcell commented Dec 30, 2019

Thanks for confirming.

@rnkn
Copy link
Author

rnkn commented Jan 1, 2020

I'm sorry, I spoke too soon...

I was using MELPA stable, and so I couldn't reproduce the issue with page-break-lines 0.11. Now using your master branch I'm getting the previous results with the init-stopping error. This would seem to indicate the change between 0.11 and master branch of: 913732a

is the source of the error. So, the problem appears to be in define-globalized-minor-mode and so an Emacs bug...

@rnkn
Copy link
Author

rnkn commented Jan 1, 2020

Just to confirm, yes it is the line https://github.com/purcell/page-break-lines/blob/master/page-break-lines.el#L173

With:

 '(global-page-break-lines-mode t nil (page-break-lines))

Without:

 '(global-page-break-lines-mode t)

@rnkn
Copy link
Author

rnkn commented Jan 1, 2020

@purcell
Copy link
Owner

purcell commented Jan 1, 2020

Aha. Excellent upstream bug report, btw!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants