2019-05-04 How to obtain major mode of current buffer emacs You can obtain the major mode by using following snippet: (buffer-local-value 'major-mode (current-buffer))