-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add Emacs 29's clean-mode
#27
Comments
According to the Emacs 29 news:
The mode seems to be supposed to be triggered interactively for debugging only? We avoid to add interactive functionality in Compat, see https://elpa.gnu.org/packages/doc/compat.html#Limitations. So probably this mode is out of scope of Compat. Do you intend to use the mode programmatically in a package of yours? If yes, how do you use it? |
Daniel Mendler ***@***.***> writes:
According to the Emacs 29 news:
~~~
** New major mode 'clean-mode'.
This is a new major mode meant for debugging. It kills absolutely all
local variables and removes overlays and text properties.
~~~
The mode seems to be supposed to be triggered interactively for
debugging only? We avoid to add interactive functionality in Compat,
see https://elpa.gnu.org/packages/doc/compat.html#Limitations. So
probably this mode is out of scope of Compat. Do you intend to use the
mode programmatically in a package of yours? If yes, how do you use
it?
Joseph is using this in the new "hyperdrive" package
https://git.sr.ht/~ushin/hyperdrive.el/tree/master/item/hyperdrive-lib.el#L1098
|
(@phikal We just wrote at the same time.) @josephmturner I've found the relevant mail regarding your hyperdrive package: https://lists.gnu.org/archive/html/emacs-devel/2023-09/msg00300.html (unless hyperdrive-mode
;; Remove overlays/text properties that might be in effect.
(hyperdrive-clean-mode)
(when hyperdrive-honor-auto-mode-alist
(let ((buffer-file-name (hyperdrive-entry-name entry)))
(set-auto-mode)))
(hyperdrive-mode)) Maybe rewrite this without relying on |
You're welcome!
Sure, proposing and discussing it makes sense. I am not sure if adding such a function is worth the costs. It could be that the given code pattern, which removes overlays and properties, is repeated multiple times across the Emacs code base. |
I agree, especially since |
Per Daniel Mendler's suggestion: emacs-compat/compat#27 (comment)
The definition uses
define-derived-mode
, which has no direct correlate incompat-macs.el
:Would you use
compat-defmacro
or maybecompat-defun
on the macro-expansion ofdefine-derived-mode
?The text was updated successfully, but these errors were encountered: