Hi there, Today I'm going to write a small example on connecting the Sawfish window manager to the Emacs text editor.
Why might you want to do this? Well mostly I just wanted to further my usage of Emacs, and thought the idea of being able to clock in and out of tasks in org-mode whenever I change workspace or window would be pretty cool. Of course both Sawfish and Emacs make extensive use of the Lisp programming language) so it is a natural fit :)
To start off, you'll want to be using the Sawfish window manager, and you'll want to have
emacs.jl somewhere in your lisp path. From there you can put something like the following in your
;; Require emacs.jl for emacs functions (require 'emacs) ;; Define a hook to be run on workspace change, utilizes the emacs-eval function defined in emacs.jl (define (my-enter-workspace-hook) (emacs-eval (format nil "(org-clock-in-on-workspace-change %S)" (nth current-workspace workspace-names)))) ;; Add our hook! (add-hook 'enter-workspace-hook my-enter-workspace-hook)
You will need to reload Sawfish for these changes to take effect (or you can eval them from Emacs).Read more...