changeset 41280:77b1386373e0

(last-buffer, unbury-buffer): New functions. (mode-line-unbury-buffer): Use `unbury-buffer'.
author Sam Steingold <sds@gnu.org>
date Mon, 19 Nov 2001 16:32:37 +0000
parents bc45052c83ae
children a72489ba1e35
files lisp/ChangeLog lisp/bindings.el
diffstat 2 files changed, 24 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Nov 19 15:13:45 2001 +0000
+++ b/lisp/ChangeLog	Mon Nov 19 16:32:37 2001 +0000
@@ -1,3 +1,8 @@
+2001-11-19  Sam Steingold  <sds@gnu.org>
+
+	* bindings.el (last-buffer, unbury-buffer): New function.
+	(mode-line-unbury-buffer): Use `unbury-buffer'.
+
 2001-11-18  Stephen Eglen  <stephen@gnu.org>
 
 	* 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  <monnier@cs.yale.edu>
 
 	* newcomment.el (comment-indent):
--- a/lisp/bindings.el	Mon Nov 19 15:13:45 2001 +0000
+++ b/lisp/bindings.el	Mon Nov 19 16:32:37 2001 +0000
@@ -258,7 +258,7 @@
 			     '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 @@
 (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."