unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Condider adding buffer-mode
@ 2013-10-24 14:22 Bozhidar Batsov
  2013-10-24 21:46 ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Bozhidar Batsov @ 2013-10-24 14:22 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

I’ve seen the following code used hundreds of times:  

(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 bit the lives of Elisp hackers:

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

Trivial, but useful.

--  
Cheers,
Bozhidar


[-- Attachment #2: Type: text/html, Size: 3204 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-10-31 12:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-24 14:22 Condider adding buffer-mode Bozhidar Batsov
2013-10-24 21:46 ` Stefan Monnier
2013-10-29 15:53   ` Bozhidar Batsov
2013-10-29 16:36     ` Stefan Monnier
2013-10-29 17:28       ` Bozhidar Batsov
2013-10-29 21:56         ` Stefan Monnier
2013-10-30  9:34           ` Bozhidar Batsov
2013-10-30 12:41             ` Stefan Monnier
2013-10-31 12:57               ` Bozhidar Batsov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).