Fix typo.
[bpt/emacs.git] / lisp / bs.el
index 4b0c80b..357852d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; bs.el --- menu for selecting and displaying buffers
 
-;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 ;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
 ;; Maintainer: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
 ;; Keywords: convenience
     (""       2   2 left  "  "))
   "*List specifying the layout of a Buffer Selection Menu buffer.
 Each entry specifies a column and is a list of the form of:
-(HEADER MINIMUM-LENGTH MAXIMUM-LENGTH ALIGNMENT FUN-OR-STRING)
+\(HEADER MINIMUM-LENGTH MAXIMUM-LENGTH ALIGNMENT FUN-OR-STRING)
 HEADER         : string for header for first line or a function
   which calculates column title.
 MINIMUM-LENGTH : minimum width of column (number or name of function).
@@ -187,7 +187,7 @@ return a string representing the column's value."
       (setq ele (cdr ele)))
     (concat res "$\\)")))
 
-;;; Font-Lock-Settings
+;; Font-Lock-Settings
 (defvar bs-mode-font-lock-keywords
   (list ;; header in font-lock-type-face
    (list (bs--make-header-match-string)
@@ -924,8 +924,9 @@ WHAT is a value of nil, `never', or `always'."
   (interactive)
   (let ((current (bs--current-buffer))
        (inhibit-read-only t))
+    (unless (kill-buffer current)
+      (error "Buffer was not deleted"))
     (setq bs-current-list (delq current bs-current-list))
-    (kill-buffer current)
     (beginning-of-line)
     (delete-region (point) (save-excursion
                             (end-of-line)
@@ -1230,9 +1231,8 @@ by buffer configuration `bs-cycle-configuration-name'."
        (bs-must-show-regexp   bs-must-show-regexp)
        (bs-dont-show-function bs-dont-show-function)
        (bs-must-show-function bs-must-show-function)
-       (bs--show-all          bs--show-all))
-    (if bs-cycle-configuration-name
-       (bs-set-configuration bs-cycle-configuration-name))
+       (bs--show-all          nil))
+    (bs-set-configuration (or bs-cycle-configuration-name bs-default-configuration))
     (let ((bs-buffer-sort-function nil)
          (bs--current-sort-function nil))
       (let* ((tupel (bs-next-buffer (if (or (eq last-command
@@ -1262,9 +1262,8 @@ by buffer configuration `bs-cycle-configuration-name'."
        (bs-must-show-regexp   bs-must-show-regexp)
        (bs-dont-show-function bs-dont-show-function)
        (bs-must-show-function bs-must-show-function)
-       (bs--show-all          bs--show-all))
-    (if bs-cycle-configuration-name
-       (bs-set-configuration bs-cycle-configuration-name))
+       (bs--show-all          nil))
+    (bs-set-configuration (or bs-cycle-configuration-name bs-default-configuration))
     (let ((bs-buffer-sort-function nil)
          (bs--current-sort-function nil))
       (let* ((tupel (bs-previous-buffer (if (or (eq last-command
@@ -1341,7 +1340,12 @@ for mouse highlighting.
 START-BUFFER is the buffer where we started buffer selection.
 ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu."
   (let ((name (copy-sequence (buffer-name))))
-    (put-text-property 0 (length name) 'mouse-face 'highlight name)
+    (add-text-properties
+     0 (length name)
+     '(mouse-face highlight
+       help-echo
+       "mouse-2: select this buffer, mouse-3: select in other frame")
+     name)
     (if (< (length name) bs--name-entry-length)
        (concat name
                (make-string (- bs--name-entry-length (length name)) ? ))
@@ -1364,7 +1368,11 @@ ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu."
                                           '(shell-mode dired-mode))
                                   default-directory
                                 (or buffer-file-name "")))))
-    (put-text-property 0 (length string) 'mouse-face 'highlight string)
+    (add-text-properties
+     0 (length string)
+     '(mouse-face highlight
+       help-echo "mouse-2: select this buffer, mouse-3: select in other frame")
+     string)
     string))
 
 (defun bs--insert-one-entry (buffer)
@@ -1504,7 +1512,7 @@ name of buffer configuration."
   (setq bs--marked-buffers nil)
   (bs--show-with-configuration (bs--configuration-name-for-prefix-arg arg)))
 
-;;; Now provide feature bs
+;; Now provide feature bs
 (provide 'bs)
 
 ;;; bs.el ends here