Questions tagged [derived-mode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

Implementing dependence chain for derived modes

Have several implementations for determining the dependence chain for a derived mode once the mode has been loaded. What would be the most convenient to use and what improvements can I do? Have ...
Dilna's user avatar
  • 1
1 vote
1 answer
56 views

Hide a command from user

Is there a way to hide a command from user? Or, in other words, is there a way to undo an interactive spec? Background: I have a derived mode, which is used in a special buffer as the buffer's mode. ...
theldoria's user avatar
  • 1,835
1 vote
1 answer
290 views

disable lsp-mode for derived mode of haskell

I am writing a major mode for a new programming language that looks very similar to Haskell, and so not surprisingly I am writing a derived mode from haskell-mode (define-derived-mode foo-mode haskell-...
mark's user avatar
  • 113
1 vote
1 answer
49 views

Syntax highlighting of keywords only if following builtin

I'm writing a syntax highlighting mode and am trying to highlight certain arguments, only if they are following a specific word. I've written a MWE to show my problem: (defvar mwe-builtin-list '("...
jamesmaj's user avatar
  • 341
3 votes
1 answer
167 views

Derived major mode: new keyword fontification not playing nice with parent mode's

I am writing a major mode derived from f90-mode in order to fontify the syntax of a commonly used Fortran preprocessor, fypp (similar to jinja2 for HTML templating). Here's a contrived example of what ...
Endulum's user avatar
  • 133
3 votes
2 answers
437 views

How to find inheritance of modes?

As an example, let's use latex-mode, that inherits from tex-mode, that inherits from text-mode. Is there a command, that would take as input latex-mode and give me parent and grand-parent? Or, other ...
thdox's user avatar
  • 247
2 votes
0 answers
92 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 ...
Adrian's user avatar
  • 21
0 votes
0 answers
84 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,...
Adrian's user avatar
  • 21
5 votes
2 answers
2k 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 ...
ideasman42's user avatar
  • 8,546
2 votes
1 answer
84 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 ...
IvanR's user avatar
  • 123
0 votes
0 answers
39 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 ...
AlwaysLearning's user avatar
1 vote
0 answers
58 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 (...
wilx's user avatar
  • 173
1 vote
2 answers
164 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 '...
Tom's user avatar
  • 45
3 votes
1 answer
281 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 ...
gavenkoa's user avatar
  • 3,362
3 votes
1 answer
561 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 ...
Tianxiang Xiong's user avatar
3 votes
0 answers
193 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 ...
Jackson's user avatar
  • 1,218
5 votes
1 answer
390 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. ...
Tianxiang Xiong's user avatar