> I’ve seen the following code used hundreds of times:Where?
> (buffer-local-value 'major-mode buffer)
> or
> (with-current-buffer buffer ‘major-mode)
> Why don’t we add the following function to Emacs and simplify a bitMost uses of `major-mode' are better replaced with derived-mode-p, so
> the lives of Elisp hackers:
> (defun buffer-mode (buffer) "Return the major mode associated with BUFFER."
> (buffer-local-value ‘major-mode buffer))
I don't think we just want to provide `buffer-mode'.
Stefan