emacsbufferelispmajor-mode

Keep getting mode name when switching buffers in Emacs


I have strange thing in my Emacs and I can't locate it, everytime I switch a buffer I get message with major mode name even when I call the function I get minibuffer-inactive-mode

The only global function (for all modes) in my .emacs file (I think) is this:

(add-hook 'after-change-major-mode-hook (lambda ()
                                      (if (not (memql (intern (major-mode))
                                                      '(fundamental-mode
                                                        erc-mode
                                                        text-mode
                                                        sql-mode)))
                                          (local-set-key (kbd "RET")
                                                         'new-line-and-indent-fix))))

How to find the place that add this annoying thing? What different hook can be executed on each mode?


Solution

  • There is no major-mode function in vanilla Emacs. Whatever that function is in your config, it's probably responsible for displaying the message you're seeing.

    You want to fix your code (as per Stefan's comment), but you probably also want to look into that non-standard function:

    M-x find-function RET major-mode RET