Skip to main content
Example added per OP request
Source Link
Fran Burstall
  • 3.9k
  • 12
  • 18

Inspect the value of the variable major-mode. From the docs:

Symbol for current buffer’s major mode. The default value (normally ‘fundamental-mode’) affects new buffers. A value of nil means to use the current buffer’s major mode, provided it is not marked as "special".

Example:

(defun example ()
  (cond ((eq major-mode 'foo-mode) (foo))
        ((eq major-mode 'bar-mode) (bar))))

Inspect the value of the variable major-mode. From the docs:

Symbol for current buffer’s major mode. The default value (normally ‘fundamental-mode’) affects new buffers. A value of nil means to use the current buffer’s major mode, provided it is not marked as "special".

Inspect the value of the variable major-mode. From the docs:

Symbol for current buffer’s major mode. The default value (normally ‘fundamental-mode’) affects new buffers. A value of nil means to use the current buffer’s major mode, provided it is not marked as "special".

Example:

(defun example ()
  (cond ((eq major-mode 'foo-mode) (foo))
        ((eq major-mode 'bar-mode) (bar))))

Source Link
Fran Burstall
  • 3.9k
  • 12
  • 18

Inspect the value of the variable major-mode. From the docs:

Symbol for current buffer’s major mode. The default value (normally ‘fundamental-mode’) affects new buffers. A value of nil means to use the current buffer’s major mode, provided it is not marked as "special".