emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/bs.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/bs.el
Date: Sun, 29 Jan 2006 02:47:55 +0000

Index: emacs/lisp/bs.el
diff -u emacs/lisp/bs.el:1.23 emacs/lisp/bs.el:1.24
--- emacs/lisp/bs.el:1.23       Wed Aug 31 13:47:26 2005
+++ emacs/lisp/bs.el    Sun Jan 29 02:47:54 2006
@@ -1332,17 +1332,9 @@
 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))))
-    (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)) ? ))
-      name)))
+  (propertize (buffer-name)
+              'help-echo "mouse-2: select this buffer, mouse-3: select in 
other frame"
+              'mouse-face 'highlight))
 
 (defun bs--get-mode-name (start-buffer all-buffers)
   "Return the name of mode of current buffer for Buffer Selection Menu.
@@ -1399,12 +1391,12 @@
 (defun bs--format-aux (string align len)
   "Generate a string with STRING with alignment ALIGN and length LEN.
 ALIGN is one of the symbols `left', `middle', or `right'."
-  (let ((length (length string)))
-    (if (>= length len)
-       string
-      (if (eq 'right align)
-         (concat (make-string (- len length) ? ) string)
-       (concat string (make-string (- len length) ? ))))))
+  (let* ((width (length string))
+         (len (max len width)))
+    (format (format "%%%s%ds" (if (eq align 'right) "" "-") len)
+            (if (eq align 'middle)
+                (concat (make-string (/ (- len width) 2) ?\s) string)
+              string))))
 
 (defun bs--show-header ()
   "Insert header for Buffer Selection Menu in current buffer."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]