A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jrblevin/markdown-mode/issues/532 below:

Checks for major-mode should include derived modes · Issue #532 · jrblevin/markdown-mode · GitHub

I'm having a problem with toggling hiding that I can't quite track down, not all list items get converted to bullets properly. In researching this I found that it worked properly in markdown-mode and gfm-mode but not in my recently created derived mode. I created this derived mode to have a special abbrev table to use for some markdown documents. Here it is:

(define-derived-mode d&d-mode gfm-mode "D&D"
  "Major mode for editing text for D&D."
  (set (make-local-variable 'require-final-newline) mode-require-final-newline)
  (abbrev-mode 1))

I found several places in the markdown-mode code that check what the major-mode is using the following:

(memq major-mode '(markdown-mode gfm-mode))
(memq major-mode '(gfm-mode gfm-view-mode))
(member major-mode '(markdown-mode markdown-view-mode gfm-mode gfm-view-mode))

Regardless of whether it solves my toggle hiding problem (which it seems to) I think these should be changed to some form of the following to allow for derived modes of markdown-mode and gfm-mode. Particularly since markdown-view-mode and gfm-view-mode are derived modes themselves and gfm-mode is derived from markdown-mode. They also have the benefit of being shorter and easier to read.

(derived-mode-p 'markdown-mode)
(derived-mode-p 'gfm-mode)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4