emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Condider adding buffer-mode


From: Stefan Monnier
Subject: Re: Condider adding buffer-mode
Date: Thu, 24 Oct 2013 17:46:29 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> I’ve seen the following code used hundreds of times:  
> (buffer-local-value 'major-mode buffer)
> or
> (with-current-buffer buffer ‘major-mode)

Where?

> Why don’t we add the following function to Emacs and simplify a bit
> the lives of Elisp hackers:

> (defun buffer-mode (buffer) "Return the major mode associated with BUFFER."
> (buffer-local-value ‘major-mode buffer))  

Most uses of `major-mode' are better replaced with derived-mode-p, so
I don't think we just want to provide `buffer-mode'.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]