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

svg-lib-button--mouse-press is incompatible with Emacs 27.X and lower #49

Open
DavidCodingLounge opened this issue Sep 7, 2024 · 1 comment

Comments

@DavidCodingLounge
Copy link

Just a small note about an incompatibility with Emacs 27.X and lower versions with the method svg-lib-button--mouse-press. It will throw an error when invoked due to a method parameter count mismatch.

It uses methods don't exist until Emacs 28.X (e.g. minibufferp with the additional live parameter and abort-minibuffers). I patched the method when in a lower Emacs version to only execute the hook callback when not in a minibuffer using the minibufferp method available. There is likely a better solution I am sure, but just wanted to surface this issue in case anyone else runs across it.

NOTE: - A dirtier solution for lower Emacs version that would technically accomplish the same thing, more or less (i.e. it doesn't work for minibuffers from multiple recursive edits ... though that edge case is probably non-existent for the use case of the library):

(if (minibufferp)
	(unwind-protect
		(throw 'exit (lambda () (signal 'minibuffer-quit nil)))
		(funcall hook)
	)
	(funcall hook)
)

Though I do wonder if this block could be simplified:

(unwind-protect
	(when (minibufferp)
		(throw 'exit (lambda () (signal 'minibuffer-quit nil))) ; Or `abort-minibuffers` for higher Emacs versions
	)
	(funcall hook)
)

Any who, I digress.

I hope this bug report helps.

Fantastic work, as always, and great library @rougier ! Thank you so much :)

@rougier
Copy link
Owner

rougier commented Oct 21, 2024

Thanks and sorry for late answer. Thanks for your patch. Will it work on both 27 and upper? If so, can you make a PR?

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