Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect current major mode in Emacs (from Lisp)? [duplicate]

Tags:

emacs

elisp

Possible Duplicate:
emacs lisp, how to get buffer major mode?

Is there a way for Emacs Lisp code to determine the current major mode?

like image 836
compman Avatar asked Jun 10 '11 21:06

compman


People also ask

How do you find the major mode?

To easily find the mode, put the numbers in order from least to greatest and count how many times each number occurs. The number that occurs the most is the mode!

How do I make Emacs major mode?

Usually, the major mode is automatically set by Emacs, when you first visit a file or create a buffer (see Choosing File Modes). You can explicitly select a new major mode by using an M-x command.

Is Emacs Lisp the same as Lisp?

Emacs Lisp is a dialect of the Lisp programming language used as a scripting language by Emacs (a text editor family most commonly associated with GNU Emacs and XEmacs). It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C, as is the Lisp interpreter.

What is the default mode in Emacs?

The standard default value is fundamental-mode . If the default value is nil , then whenever Emacs creates a new buffer via a command such as C-x b ( switch-to-buffer ), the new buffer is put in the major mode of the previously current buffer.


1 Answers

You can look at the value of the variable major-mode.

like image 71
Lindydancer Avatar answered Sep 21 '22 00:09

Lindydancer