]> code.delx.au - gnu-emacs/blobdiff - lisp/bs.el
Merge from gnus--devo--0
[gnu-emacs] / lisp / bs.el
index 4eef017129d0bde39d34e22d68e41e91b1006e5f..d240de8184548f1da71f9b41853a2032e030cf3e 100644 (file)
@@ -1,17 +1,17 @@
 ;;; bs.el --- menu for selecting and displaying buffers
 
 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 ;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
 ;; Maintainer: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
 ;; Keywords: convenience
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; 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, or (at your option)
-;; any later version.
+;; 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
@@ -19,9 +19,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -369,9 +367,9 @@ A value of `always' means to show buffer regardless of the configuration.")
 
 (defun bs--sort-by-mode (b1 b2)
   "Compare buffers B1 and B2 by mode name."
-  (save-excursion
-    (string< (progn (set-buffer b1) (format "%s" mode-name))
-            (progn (set-buffer b2) (format "%s" mode-name)))))
+  (save-current-buffer
+    (string< (progn (set-buffer b1) (format-mode-line mode-name nil nil b1))
+            (progn (set-buffer b2) (format-mode-line mode-name nil nil b2)))))
 
 (defun bs--sort-by-size (b1 b2)
   "Compare buffers B1 and B2 by buffer size."
@@ -1331,7 +1329,7 @@ ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
   "Return the name of mode of current buffer for Buffer Selection Menu.
 START-BUFFER is the buffer where we started buffer selection.
 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
-  mode-name)
+  (format-mode-line mode-name nil nil start-buffer))
 
 (defun bs--get-file-name (start-buffer all-buffers)
   "Return string for column 'File' in Buffer Selection Menu.
@@ -1480,5 +1478,5 @@ name of buffer configuration."
 ;; Now provide feature bs
 (provide 'bs)
 
-;;; arch-tag: c0d9ab34-bf06-4368-ae9d-af88878e6802
+;; arch-tag: c0d9ab34-bf06-4368-ae9d-af88878e6802
 ;;; bs.el ends here