Add tabbar properly
git-svn-id: http://photonzero.com/dotfiles/trunk@84 23f722f6-122a-0410-8cef-c75bd312dd78
574
.emacs.d/aquamacs-tools.el
Normal file
|
|
@ -5,7 +5,9 @@
|
|||
(add-to-list 'load-path "~/.emacs.d")
|
||||
(add-to-list 'load-path "~/.emacs.d/auto-complete")
|
||||
(add-to-list 'load-path "~/.emacs.d/icicles")
|
||||
(add-to-list 'load-path "~/.emacs.d/aquamacs-tabbar")
|
||||
(add-to-list 'load-path "~/.emacs.d/tabbar")
|
||||
|
||||
(fset 'yes-or-no-p 'y-or-n-p)
|
||||
|
||||
(require 'icicles)
|
||||
(icy-mode 1)
|
||||
|
|
@ -14,10 +16,17 @@
|
|||
(require 'vimpulse)
|
||||
(require 'color-theme)
|
||||
(require 'color-theme-autoloads)
|
||||
(require 'aquamacs-tabbar)
|
||||
(require 'tabbar)
|
||||
;(require 'highlight-symbol)
|
||||
(require 'auto-complete-config)
|
||||
|
||||
;; Hack to get *Messages* in viper-mode.
|
||||
;; ;; (must be done after loading viper)
|
||||
;; ;; Futzing with fundamental-mode doesn't seem to help.
|
||||
(save-excursion
|
||||
(set-buffer "*Messages*")
|
||||
(viper-change-state-to-vi))
|
||||
|
||||
|
||||
|
||||
(add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-complete/dict")
|
||||
|
|
@ -70,6 +79,7 @@
|
|||
(vimpulse-map "gp" 'tabbar-backward-tab)
|
||||
(vimpulse-map "gw" 'vimpulse-search-forward-for-symbol-at-point)
|
||||
(vimpulse-map "gK" 'kill-buffer-and-window)
|
||||
(vimpulse-map "gc" 'kill-buffer-and-window)
|
||||
;(define-key viper-insert-global-user-map "\C-d" 'delete-char))
|
||||
|
||||
(add-hook 'window-setup-hook 'delete-other-windows)
|
||||
|
|
@ -77,7 +87,7 @@
|
|||
; Basic frame defaults
|
||||
(let ((background-color "#2F2F2F")
|
||||
(foreground-color "LightGrey")
|
||||
(fname "Inconsolata-15")
|
||||
(fname "Inconsolata-18")
|
||||
(fheight 45)
|
||||
(fwidth 115))
|
||||
|
||||
|
|
@ -103,3 +113,28 @@
|
|||
(when (and (featurep 'vc-hooks)
|
||||
(not (memq (vc-backend file) '(nil SVN))))
|
||||
ad-do-it)))
|
||||
|
||||
;; add a buffer modification state indicator in the tab label,
|
||||
;; and place a space around the label to make it looks less crowd
|
||||
(defadvice tabbar-buffer-tab-label (after fixup_tab_label_space_and_flag activate)
|
||||
(setq ad-return-value
|
||||
(if (and (buffer-modified-p (tabbar-tab-value tab))
|
||||
(buffer-file-name (tabbar-tab-value tab)))
|
||||
(concat " " (concat ad-return-value "+ "))
|
||||
(concat " " (concat ad-return-value " ")))))
|
||||
;; called each time the modification state of the buffer changed
|
||||
(defun ztl-modification-state-change ()
|
||||
(tabbar-set-template tabbar-current-tabset nil)
|
||||
(tabbar-display-update))
|
||||
;; first-change-hook is called BEFORE the change is made
|
||||
(defun ztl-on-buffer-modification ()
|
||||
(set-buffer-modified-p t)
|
||||
(ztl-modification-state-change))
|
||||
|
||||
(defun ztl-on-buffer-demodification ()
|
||||
(set-buffer-modified-p nil)
|
||||
(ztl-modification-state-change))
|
||||
(add-hook 'after-save-hook 'ztl-modification-state-change)
|
||||
;; this doesn't work for revert, I don't know
|
||||
(add-hook 'after-revert-hook 'ztl-on-buffer-demodification)
|
||||
(add-hook 'first-change-hook 'ztl-on-buffer-modification)
|
||||
|
|
|
|||
927
.emacs.d/tabbar/aquamacs-tabbar.el
Normal file
BIN
.emacs.d/tabbar/close-tab.png
Normal file
|
After Width: | Height: | Size: 412 B |
BIN
.emacs.d/tabbar/down.png
Normal file
|
After Width: | Height: | Size: 186 B |
BIN
.emacs.d/tabbar/left.png
Normal file
|
After Width: | Height: | Size: 282 B |
BIN
.emacs.d/tabbar/left_disabled.png
Normal file
|
After Width: | Height: | Size: 282 B |
BIN
.emacs.d/tabbar/right.png
Normal file
|
After Width: | Height: | Size: 286 B |
BIN
.emacs.d/tabbar/right_disabled.png
Normal file
|
After Width: | Height: | Size: 287 B |
835
.emacs.d/tabbar/tabbar-window.el
Normal file
|
|
@ -841,13 +841,21 @@ That is for buttons and separators."
|
|||
tabbar-scroll-left-button-value nil
|
||||
tabbar-scroll-right-button-value nil)))
|
||||
|
||||
;; the following cache only provides minor speed benefits
|
||||
;; but it may be a workaround for the close-tab/undo.png display issue
|
||||
(defvar tabbar-cached-image nil)
|
||||
(defvar tabbar-cached-spec nil)
|
||||
(defsubst tabbar-find-image (specs)
|
||||
"Find an image, choosing one of a list of image specifications.
|
||||
SPECS is a list of image specifications. See also `find-image'."
|
||||
(if (eq tabbar-cached-spec specs)
|
||||
tabbar-cached-image
|
||||
(when (and tabbar-use-images (display-images-p))
|
||||
(condition-case nil
|
||||
(find-image specs)
|
||||
(error nil))))
|
||||
(prog1
|
||||
(setq tabbar-cached-image (find-image specs))
|
||||
(setq tabbar-cached-spec specs))
|
||||
(error nil)))))
|
||||
|
||||
(defsubst tabbar-disable-image (image)
|
||||
"From IMAGE, return a new image which looks disabled."
|
||||
BIN
.emacs.d/tabbar/up.png
Normal file
|
After Width: | Height: | Size: 175 B |
|
|
@ -39,6 +39,8 @@
|
|||
(left-margin ((t (nil))))
|
||||
(text-cursor ((t (:background "yellow" :foreground "black"))))
|
||||
(toolbar ((t (nil))))
|
||||
(tabbar-default ((t (:background "black" :foreground "grey75"))))
|
||||
(tabbar-selected (( (:background "grey75" :foreground "black"))))
|
||||
(underline ((nil (:underline nil))))
|
||||
|
||||
(zmacs-region ((t (:background "snow" :foreground "ble")))))))
|
||||
|
|
|
|||