emacs-devel
[Top][All Lists]
Advanced

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

Condider adding buffer-mode


From: Bozhidar Batsov
Subject: Condider adding buffer-mode
Date: Thu, 24 Oct 2013 17:22:11 +0300

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


reply via email to

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