XEmacs 21.2.30 "Hygeia".
[chise/xemacs-chise.git.1] / lisp / gutter-items.el
index 46b137f..9581a49 100644 (file)
   "Input from the gutters."
   :group 'environment)
 
+(defvar gutter-buffers-tab nil
+  "A tab widget in the gutter for displaying buffers.
+Do not set this. Use `glyph-image-instance' and
+`set-image-instance-property' to change the properties of the tab.")
+
 (defcustom gutter-visible-p 
   (specifier-instance default-gutter-visible-p)
   "Whether the default gutter is globally visible. This option can be
 customized through the options menu."
-  :group 'display
+  :group 'gutter
   :type 'boolean
   :set #'(lambda (var val)
           (set-specifier default-gutter-visible-p val)
-          (setq gutter-visible-p val)))
-
-(defvar gutter-buffers-tab nil
-  "A tab widget in the gutter for displaying buffers.
-Do not set this. Use `glyph-image-instance' and
-`set-image-instance-property' to change the properties of the tab.")
+          (setq gutter-visible-p val)
+          (when gutter-buffers-tab (update-tab-in-gutter))))
 
 (defcustom default-gutter-position
   (default-gutter-position)
   "The location of the default gutter. It can be 'top, 'bottom, 'left or
 'right. This option can be customized through the options menu."
-  :group 'display
-  :type '(choice (const :tag "top" 'top)
-                (const :tag "bottom" 'bottom)
-                (const :tag "left" 'left)
-                (const :tag "right" 'right))
+  :group 'gutter
+  :type '(choice (const :tag "top" top)
+                (const :tag "bottom" bottom)
+                (const :tag "left" left)
+                (const :tag "right" right))
   :set #'(lambda (var val)
           (set-default-gutter-position val)
           (setq default-gutter-position val)
@@ -159,7 +160,7 @@ If this is 0, then the full buffer name will be shown."
   "For use as a value for `buffers-tab-switch-to-buffer-function'."
   (unless (eq (window-buffer) buffer)
     (if (> (length (windows-of-buffer buffer)) 0)
-       (select-window (car (windows-of-buffer buffer)))
+       (select-window (car (windows-of-buffer buffer)) t)
       (switch-to-buffer buffer t))))
 
 (defun select-buffers-tab-buffers-by-mode (buf1 buf2)
@@ -193,8 +194,12 @@ This just returns the buffer's name, optionally truncated."
   (let ((len (specifier-instance buffers-tab-default-buffer-line-length)))
     (if (and (> len 0)
             (> (length (buffer-name buffer)) len))
-       (concat (substring (buffer-name buffer) 
-                          0 (- len 3)) "...")
+       (if (string-match ".*<.>$" (buffer-name buffer))
+           (concat (substring (buffer-name buffer) 
+                              0 (- len 6)) "..."
+                              (substring (buffer-name buffer) -3))
+         (concat (substring (buffer-name buffer)
+                            0 (- len 3)) "..."))
       (buffer-name buffer))))
 
 (defsubst build-buffers-tab-internal (buffers)
@@ -282,7 +287,7 @@ items by redefining the function `format-buffers-menu-line'."
                   (eq (default-gutter-position)
                       gutter-buffers-tab-orientation))
        (add-tab-to-gutter))
-      (when (valid-image-instantiator-format-p 'tab-control)
+      (when (valid-image-instantiator-format-p 'tab-control locale)
        (let ((inst (glyph-image-instance 
                     gutter-buffers-tab
                     (when (framep frame-or-buffer)