[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#32795: Acknowledgement (26.1; provided-mode-derived-p does not suppo
bug#32795: Acknowledgement (26.1; provided-mode-derived-p does not support parent modes set with defalias)
Mon, 24 Sep 2018 19:36:11 -0700
I actually just found _another_ scenario that breaks due to this. I was
editing a Jenkinsfile (groovy-mode) and expecting dtrt-indent to
automatically adjust the indent, but it was not. Turns out it's the same
(when (derived-mode-p 'prog-mode 'text-mode)
The check `(derived-mode-p 'prog-mode 'text-mode)` returns nil, because
the mode that groovy-mode derived from is set up like this:
(if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))
Using this for `provided-mode-derived-p` fixes it:
(defun provided-mode-derived-p (mode &rest modes)
"Non-nil if MODE is derived from one of MODES.
Uses the `derived-mode-parent' property of the symbol to trace
If you just want to check `major-mode', use `derived-mode-p'."
(not (memq mode modes))
(let* ((parent (get mode 'derived-mode-parent))
(parentfn (symbol-function parent)))
(setq mode (if (and parentfn (symbolp parentfn)) parentfn
Thanks Robert Pluim for the `let*` trick, I was wondering how you do
that without nesting `let` expressions.
Does anyone have other suggestions before I send a patch file?
On 09/21/2018 8:22 am, address@hidden wrote:
Thank you for filing a new bug report with debbugs.gnu.org.
This is an automatically generated reply to let you know your message
has been received.
Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.
Your message has been sent to the package maintainer(s):
If you wish to submit further information on this problem, please
send it to address@hidden
Please do not send mail to address@hidden unless you wish
to report a problem with the Bug-tracking system.