comparison lisp/bindings.el @ 90268:d88caeac70d7

Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-2 Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (base, patch 1-3) - tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-704 - Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0 (patch 700-704) - Update from CVS - Merge from gnus--rel--5.10 - Update from CVS: lisp/cus-edit.el (customize-rogue): Minor doc fix. * miles@gnu.org--gnu-2005/gnus--rel--5.10 (patch 185-186) - Merge from emacs--cvs-trunk--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Thu, 19 Jan 2006 07:11:42 +0000
parents 7beb78bc1f8e d300de715fe6
children c5406394f567
comparison
equal deleted inserted replaced
90267:e5855ea89245 90268:d88caeac70d7
359 359
360 (defun mode-line-other-buffer () "\ 360 (defun mode-line-other-buffer () "\
361 Switch to the most recently selected buffer other than the current one." 361 Switch to the most recently selected buffer other than the current one."
362 (interactive) 362 (interactive)
363 (switch-to-buffer (other-buffer))) 363 (switch-to-buffer (other-buffer)))
364
365 (defun mode-line-next-buffer (event)
366 "Like `next-buffer', but temporarily select EVENT's window."
367 (interactive "e")
368 (save-selected-window
369 (select-window (posn-window (event-start event)))
370 (next-buffer)))
371
372 (defun mode-line-previous-buffer (event)
373 "Like `previous-buffer', but temporarily select EVENT's window."
374 (interactive "e")
375 (save-selected-window
376 (select-window (posn-window (event-start event)))
377 (previous-buffer)))
364 378
365 (defvar mode-line-mode-menu (make-sparse-keymap "Minor Modes") "\ 379 (defvar mode-line-mode-menu (make-sparse-keymap "Minor Modes") "\
366 Menu of mode operations in the mode line.") 380 Menu of mode operations in the mode line.")
367 381
368 (defun mode-line-mode-menu-1 (event) 382 (defun mode-line-mode-menu-1 (event)
433 ;; of the mode line.or header line. 447 ;; of the mode line.or header line.
434 ; 448 ;
435 (let ((map (make-sparse-keymap))) 449 (let ((map (make-sparse-keymap)))
436 ;; Bind down- events so that the global keymap won't ``shine 450 ;; Bind down- events so that the global keymap won't ``shine
437 ;; through''. 451 ;; through''.
438 (define-key map [mode-line mouse-1] 'mode-line-unbury-buffer) 452 (define-key map [mode-line mouse-1] 'mode-line-previous-buffer)
439 (define-key map [header-line down-mouse-1] 'ignore) 453 (define-key map [header-line down-mouse-1] 'ignore)
440 (define-key map [header-line mouse-1] 'mode-line-unbury-buffer) 454 (define-key map [header-line mouse-1] 'mode-line-previous-buffer)
441 (define-key map [header-line down-mouse-3] 'ignore) 455 (define-key map [header-line down-mouse-3] 'ignore)
442 (define-key map [mode-line mouse-3] 'mode-line-bury-buffer) 456 (define-key map [mode-line mouse-3] 'mode-line-next-buffer)
443 (define-key map [header-line down-mouse-3] 'ignore) 457 (define-key map [header-line down-mouse-3] 'ignore)
444 (define-key map [header-line mouse-3] 'mode-line-bury-buffer) 458 (define-key map [header-line mouse-3] 'mode-line-next-buffer)
445 (setq mode-line-buffer-identification-keymap map)) 459 (setq mode-line-buffer-identification-keymap map))
446 460
447 (defun propertized-buffer-identification (fmt) 461 (defun propertized-buffer-identification (fmt)
448 "Return a list suitable for `mode-line-buffer-identification'. 462 "Return a list suitable for `mode-line-buffer-identification'.
449 FMT is a format specifier such as \"%12b\". This function adds 463 FMT is a format specifier such as \"%12b\". This function adds
450 text properties for face, help-echo, and local-map to it." 464 text properties for face, help-echo, and local-map to it."
451 (list (propertize fmt 465 (list (propertize fmt
452 'face 'Buffer-menu-buffer 466 'face 'mode-line-buffer-id
453 'help-echo 467 'help-echo
454 (purecopy "mouse-1: previous buffer, mouse-3: next buffer") 468 (purecopy "mouse-1: previous buffer, mouse-3: next buffer")
455 'mouse-face 'mode-line-highlight 469 'mouse-face 'mode-line-highlight
456 'local-map mode-line-buffer-identification-keymap))) 470 'local-map mode-line-buffer-identification-keymap)))
457 471