From 545f73103e4f0460ada22f98d0c11cc830a15490 Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Mon, 19 Nov 2001 16:32:37 +0000 Subject: [PATCH] (last-buffer, unbury-buffer): New functions. (mode-line-unbury-buffer): Use `unbury-buffer'. --- lisp/ChangeLog | 13 +++++++++---- lisp/bindings.el | 21 +++++++++++++++------ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 32a3c1eec6a..9e1b8624a80 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2001-11-19 Sam Steingold + + * bindings.el (last-buffer, unbury-buffer): New function. + (mode-line-unbury-buffer): Use `unbury-buffer'. + 2001-11-18 Stephen Eglen * iswitchb.el (iswitchb-cannot-complete-hook): New variable to @@ -17,12 +22,12 @@ (Math-num-integerp, Math-bignum-test, Math-equal-int) (Math-natnum-lessp, math-format-radix-digit): Change to `defsubst'. (calc-record-compilation-date-macro): Deleted. Callers updated. - (math-format-radix-digit): Move to calc-bin.el. + (math-format-radix-digit): Move to calc-bin.el. * calc/calc.el (calc-record-compilation-date): Remove. (calc-bug-address): Update. (calc-settings-file): Use `user-init-file'. - + * calc/calc-mode.el (calc-settings-file-name, calc-save-modes): Handle null `calc-settings-file'. @@ -38,7 +43,7 @@ (calcFunc-floor): Ditto. * calc-units.el (calcFunc-usimplify): Ditto. - + * calc-aent.el, calc-ext.el, calc-incom.el, calc-misc.el * calc-sel.el, calc-vec.el, calc-alg.el, calc-fin.el * calc-keypd.el, calc-mode.el, calc-stat.el, calc-yank.el @@ -53,7 +58,7 @@ and move them before their first use. Use `when', `unless'. Remove trailing periods from error forms. Add description and headers suggested by Emacs Lisp coding conventions. - + 2001-11-19 Stefan Monnier * newcomment.el (comment-indent): diff --git a/lisp/bindings.el b/lisp/bindings.el index 3f64044554b..8731e6f5817 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -258,7 +258,7 @@ Normally nil in most modes, since there is no process to display.") 'mouse-2 #'mode-line-widen)) (propertize ")%]--" 'help-echo help-echo))) - (setq-default mode-line-position + (setq-default mode-line-position `((line-number-mode (,(propertize "L%l" 'help-echo help-echo) ,dashes)) (column-number-mode (,(propertize "C%c" 'help-echo help-echo) ,dashes)) (-3 . ,(propertize "%p" 'help-echo help-echo))))) @@ -272,15 +272,24 @@ Keymap for what is displayed by `mode-line-mode-name'.") (defvar mode-line-mode-menu-keymap nil "\ Keymap for mode operations menu in the mode line.") +(defun last-buffer () " +Return the last non-hidden buffer in the buffer list." + (let ((list (reverse (buffer-list)))) + (while (eq (aref (buffer-name (car list)) 0) ? ) + (setq list (cdr list))) + (car list))) + +(defun unbury-buffer () " +Switch to the `last-buffer'." + (interactive) + (switch-to-buffer (last-buffer))) + (defun mode-line-unbury-buffer (event) "\ -Switch to the last buffer in the buffer list that is not hidden." +Call `unbury-buffer' in this window." (interactive "e") (save-selected-window (select-window (posn-window (event-start event))) - (let ((list (reverse (buffer-list)))) - (while (eq (aref (buffer-name (car list)) 0) ? ) - (setq list (cdr list))) - (switch-to-buffer (car list))))) + (unbury-buffer))) (defun mode-line-bury-buffer (event) "\ Like bury-buffer, but temporarily select EVENT's window."