]> code.delx.au - gnu-emacs/blobdiff - lisp/bs.el
* lisp/progmodes/ruby-mode.el: Bump the version to 1.2.
[gnu-emacs] / lisp / bs.el
index 94fbd0e04f946d499621abca18853e442c7813ca..a84c951acfee67790f1f821c422ec0fa3c052161 100644 (file)
@@ -1,6 +1,6 @@
 ;;; bs.el --- menu for selecting and displaying buffers -*- lexical-binding: t -*-
 
-;; Copyright (C) 1998-201 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2012 Free Software Foundation, Inc.
 ;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
 ;; Maintainer: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
 ;; Keywords: convenience
@@ -25,7 +25,7 @@
 ;; Version: 1.17
 ;; X-URL: http://www.geekware.de/software/emacs
 ;;
-;; The bs-package contains a main function bs-show for poping up a
+;; The bs-package contains a main function bs-show for popping up a
 ;; buffer in a way similar to `list-buffers' and `electric-buffer-list':
 ;; The new buffer offers a Buffer Selection Menu for manipulating
 ;; the buffer list and buffers.
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))
-
 ;; ----------------------------------------------------------------------
 ;; Globals for customization
 ;; ----------------------------------------------------------------------
@@ -618,7 +616,7 @@ Used from `window-size-change-functions'."
 (put 'bs-mode 'mode-class 'special)
 
 (define-derived-mode bs-mode nil "Buffer-Selection-Menu"
-  "Major mode for editing a subset of Emacs' buffers.
+  "Major mode for editing a subset of Emacs's buffers.
 \\<bs-mode-map>
 Aside from two header lines each line describes one buffer.
 Move to a line representing the buffer you want to edit and select
@@ -830,10 +828,10 @@ See `visit-tags-table'."
   (interactive)
   (let ((res
          (with-current-buffer (bs--current-buffer)
-           (setq bs-buffer-show-mark (case bs-buffer-show-mark
-                                       ((nil)   'never)
-                                       ((never) 'always)
-                                       (t       nil))))))
+           (setq bs-buffer-show-mark (pcase bs-buffer-show-mark
+                                       (`nil   'never)
+                                       (`never 'always)
+                                       (_       nil))))))
     (bs--update-current-line)
     (bs--set-window-height)
     (bs--show-config-message res)))
@@ -964,7 +962,7 @@ Default is `bs--current-sort-function'."
 Uses function `toggle-read-only'."
   (interactive)
   (with-current-buffer (bs--current-buffer)
-    (toggle-read-only))
+    (read-only-mode 'toggle))
   (bs--update-current-line))
 
 (defun bs-clear-modified ()
@@ -1215,7 +1213,7 @@ by buffer configuration `bs-cycle-configuration-name'."
         ;; We don't want the frame iconified if the only window in the frame
         ;; happens to be dedicated.
         (bury-buffer (current-buffer))
-       (switch-to-buffer next)
+       (switch-to-buffer next nil t)
        (setq bs--cycle-list (append (cdr cycle-list)
                                     (list (car cycle-list))))
        (bs-message-without-log "Next buffers: %s"
@@ -1244,7 +1242,7 @@ by buffer configuration `bs-cycle-configuration-name'."
                                            bs--cycle-list)))
             (prev-buffer (car tupel))
             (cycle-list (cdr tupel)))
-       (switch-to-buffer prev-buffer)
+       (switch-to-buffer prev-buffer nil t)
        (setq bs--cycle-list (append (last cycle-list)
                                     (reverse (cdr (reverse cycle-list)))))
        (bs-message-without-log "Previous buffers: %s"
@@ -1414,8 +1412,8 @@ for buffer selection."
        (bs--restore-window-config)
        (setq bs--window-config-coming-from (current-window-configuration))
        (when (> (window-height (selected-window)) 7)
-          (split-window-vertically)
-          (other-window 1)))
+          ;; Errors would mess with the window configuration (bug#10882).
+          (ignore-errors (select-window (split-window-below)))))
       (bs-show-in-buffer liste)
       (bs-message-without-log "%s" (bs--current-config-message)))))