windrg00
windrg00

Reputation: 457

How to detect if the current major mode is derived from prog-mode

I want to write a function that invokes one of 2 functions, depending on whether the current major mode is a prog-mode. How do I detect if the current major mode is a prog-mode?

Upvotes: 6

Views: 1087

Answers (1)

phils
phils

Reputation: 73246

(if (derived-mode-p 'prog-mode) ...)

Upvotes: 9

Related Questions