;;; hippie-eclipse.el --- emulate the Eclipse user interface in Emacs

;; Copyleft (C) 2009 Cecil Curry <http://raiazome.com>

;; Author:     Cecil Curry <http://raiazome.com>
;; Maintainer: Cecil Curry <http://raiazome.com>
;; Time-stamp: "2009-05-21 18:09:43 leycec"
;; Created: 1 Mar 2009
;; Version: 0.0.1
;; URL: http://hippie.raiazome.com
;; Keywords: convenience,emulations,faces,files,matching,tools

;; This file is not part of GNU Emacs.

;;; Commentary:
; --------------------( TODO                               )--------------------

;;; History:
;; 
;; 2009-05-01  Cecil Curry  <http://raiazome.com>
;;   * Created.

;;; Code:
; ....................{ LIFECYCLE                          }....................
(defun hippie-eclipse/load ()
  "Load `hippie-eclipse'. Specifically:

* Load the external Tabbar feature.
* Set somewhat sane defaults for these features."
  ; Import Tabbar.
  (hippie-eclipse/load-tabbar))

(defun hippie-eclipse/unload ()
  "Unload `hippie-eclipse'. Undo side-effects made by `hippie-eclipse/load'."
  (unload-feature 'tabbar))

; ....................{ TABBAR                             }....................
(defun hippie-eclipse/load-tabbar ()
  "Load `tabbar'. `tabbar' displays tabs at the top of each Emacs frame
describing interesting buffers housed in that frame."
  (require 'tabbar)
  (tabbar-mode t)
  (setq tabbar-buffer-list-function 'hippie-eclipse/tabbar-buffer-list)
  ; Group all buffers under one global group.
  (setq tabbar-buffer-groups-function (lambda (buffer) (list "All Buffers"))))

(defun hippie-eclipse/tabbar-buffer-list
  "Return a list of buffers filtered for display as tabbar tabs. Scratch
buffers (e.g., most buffers beginning with a '*') and anonymous message
buffers are filtered by default."
  (remove-if
   (lambda (buffer)
     (let ((buffer-name (buffer-name buffer)))
       (or
        (and (find (aref buffer-name 0) " *")
             (not (member buffer-name '("*eshell*" "*mpg123*"))))
        (member buffer-name '("calendar.diary" "diary")))))
   (buffer-list)))

; --------------------( COPYRIGHT AND LICENSE              )--------------------
; The information below applies to everything in this distribution,
; except where noted.
; 
; Copyleft 2009 by Cecil Curry <http://hippie.raiazome.com>.
; 
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see L<http://www.gnu.org/licenses/>.
;
; --------------------( FEATURE                            )--------------------
(provide 'hippie-eclipse)

;;; hippie-eclipse.el ends here
