Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (56 sloc) 2.11 KB
;;;; Perspective
(eval-after-load 'perspective
;; Perspective Setup
(defmacro senny-persp (name &rest body)
`(let ((initialize (not (gethash ,name perspectives-hash)))
(current-perspective persp-curr))
(persp-switch ,name)
(when initialize ,@body)
(setq persp-last current-perspective)))
(defun persp-format-name (name)
"Format the perspective name given by NAME for display in `persp-modestring'."
(let ((string-name (format "%s" name)))
(if (equal name (persp-name persp-curr))
(propertize string-name 'face 'persp-selected-face))))
(defun persp-update-modestring ()
"Update `persp-modestring' to reflect the current perspectives.
Has no effect when `persp-show-modestring' is nil."
(when persp-show-modestring
(setq persp-modestring
(append '("[")
(persp-intersperse (mapcar 'persp-format-name (persp-names)) "")
;; Perspective Defuns
(defun senny-persp-last ()
(persp-switch (persp-name persp-last)))
;;;; Perspective Definitions
(defun senny-persp/jabber ()
(senny-persp "@Jabber"
(call-interactively 'jabber-display-roster)
(switch-to-buffer jabber-roster-buffer)))
(defun senny-persp/irc ()
(senny-persp "@IRC"
(dolist (channel '("emacs" "ruby" "cucumber"))
(erc-join-channel channel))))
(defun senny-persp/terminal ()
(senny-persp "@terminal"
(defun senny-persp/emacs ()
(senny-persp "@Emacs"))
(defun senny-persp/org ()
(senny-persp "@org"
(find-file (first org-agenda-files))))
(defun senny-persp/main ()
(senny-persp "main"))