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

Use derived-mode-p for functions to also work for derived modes #92

Merged
merged 2 commits into from
Nov 21, 2022

Conversation

meliache
Copy link
Contributor

In my case I recently started using dirvish, which is an enhanced dired-mode, and I was surprised that crux-open-with didn't work, but I fixed it by using derived-mode-p.

Then, I searched for other occurrences of major-mode and also replaced there

(equal major-mode '<mode>)

by

(derived-mode-p '<mode>)

I'm still not sure whether I should also do that in crux-cleanup-buffer-or-region, where in checking the membership in crux-untabify-sensitive-modes and crux-indent-sensitive-modes, derived modes are note considered. These variables are customizable and I think not considering derived modes there adds control. But here I would be happy on feedback.


  • The commits are consistent with our contribution guidelines
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)

In my case I recently started using `dirvish', which is an enhanced dired-mode,
and I was surprised that `crux-open-with' didn't work, but I fixed it by using
`derived-mode-p'.

Then, I searched for other occurances of `major-mode' and also replaced

    (equal major-mode '<mode>)

by

    (derived-mode-p '<mode>)

I'm still not sure whether I should also do that in
`crux-cleanup-buffer-or-region', where in checking the membership in
`crux-untabify-sensitive-modes' and `crux-indent-sensitive-modes', derived modes
are note considered. So far I didn't touch that, since those variables are
customizable anyway.
@meliache meliache changed the title Used `derived-mode-p' for functions to also work for derived modes Used derived-mode-p for functions to also work for derived modes Apr 8, 2022
@meliache meliache changed the title Used derived-mode-p for functions to also work for derived modes Use derived-mode-p for functions to also work for derived modes Apr 8, 2022
@bbatsov bbatsov merged commit 6ee63c7 into bbatsov:master Nov 21, 2022
@bbatsov
Copy link
Owner

bbatsov commented Nov 21, 2022

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants