Questions tagged [derived-mode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
0answers
29 views

Derived mode from CC Mode: how do I write one?

Where is the definitive, up-to-date guide on how to write a derived mode from CC Mode. I have a mode that's malfunctioning and thought I might just rewrite it, but information I find is spotty and ...
0
votes
0answers
25 views

`scad-mode` (derived from CC Mode) hangs Emacs. How to debug/fix?

I have found that scad-mode.el, a derived mode from CC Mode, which can be found here: https://github.com/openscad/openscad/blob/master/contrib/scad-mode.el hangs emacs if I type #( into the window,...
2
votes
2answers
411 views

How to run a 'prog-mode-hook' after more specific hooks?

I'm running into an order of initialization issue with hooks. prog-mode-hook enables fci-mode rust-mode-hook sets the fci-rule-column to 99. on initial display the fill column shows at 80 (it's ...
2
votes
1answer
37 views

How to delete menu item defined in a parent major from within derived mode?

I'm creating custom major mode derived from js-mode which comes with it's own menu entry "Javascript" (top-level entry, between Tools & Help (sorry, not sure what the correct name for that UI ...
0
votes
0answers
28 views

Defining a derived mode breaks a feature that worked in the parent mode

In org-ref there is a feature whereby when the cursor is on a citation link, the information about the citation appears in the echo area. The feature is implemented using idle timers. I have defined ...
1
vote
0answers
39 views

derived mode for Pandoc Templates

I am trying to derive mode based on Sample Mode. Reduced contents here: ;;; pandoc-template.el --- Pandoc-Template major mode ;; Copyright (C) 2017 ;; Author: VaclavHaisman ;; Keywords: extensions (...
1
vote
2answers
73 views

defalias derived mode to parent mode

I wrote a new major mode config-general-mode, which is derived from conf-mode. I like it a lot and want to have it as the default mode for all configuration files. Thus I tried: (defalias 'conf-mode '...
2
votes
1answer
114 views

Prevent hooks from parent mode in derived mode

I have: (add-hook 'text-mode-hook 'turn-on-auto-fill) but in lisp/nxml/nxml-mode.el: (define-derived-mode nxml-mode text-mode "nXML" All XML files is opened with auto-fill-mode. That is ...
3
votes
1answer
210 views

Derived mode without merging keymap

It seems that when using define-derived-mode, the new mode's keymap is merged with that of the parent mode. Is there a way to avoid this? That is, to inherit font-lock, etc. from the parent mode, but ...
2
votes
0answers
96 views

Find all modes derived from a mode

Is there any way to easily find all the modes that derive from a mode? The closest I can get is to use M-x apropros and search for -mode$ and manually comb through all defuns with the property ...
4
votes
1answer
223 views

Why isn't emacs-lisp-mode derived from lisp-mode?

Just out of curiosity, why isn't emacs-lisp-mode derived from lisp-mode? Instead, both are derived from prog-mode. It seems to me that there is a natural hierarchical relationship that should exist. ...