Function: make-mode-line-mouse-map

make-mode-line-mouse-map is a byte-compiled function defined in bindings.el.gz.

Signature

(make-mode-line-mouse-map MOUSE FUNCTION)

Documentation

Return a keymap with single entry for mouse key MOUSE on the mode line.

MOUSE is defined to run function FUNCTION with no args in the buffer corresponding to the mode line clicked.

Source Code

;; Defined in /usr/src/emacs/lisp/bindings.el.gz
;;; bindings.el --- define standard key bindings and some variables  -*- lexical-binding: t; -*-

;; Copyright (C) 1985-2024 Free Software Foundation, Inc.

;; Maintainer: emacs-devel@gnu.org
;; Keywords: internal
;; Package: emacs

;; This file is part of GNU Emacs.

;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;;; Code:

(defun make-mode-line-mouse-map (mouse function) "\
Return a keymap with single entry for mouse key MOUSE on the mode line.
MOUSE is defined to run function FUNCTION with no args in the buffer
corresponding to the mode line clicked."
  (let ((map (make-sparse-keymap)))
    (define-key map (vector 'mode-line mouse) function)
    map))