stumpwm on mac os x

stumpwm is to window managing (tiling?) system what emacs is to text editing and conkeror is to web browsing.

very cool. if i was on a linux laptop/desktop like i used to be, i would definitely use this. i’m even debating on quitting my mac os x for this (with emacs and conkeror). however, i most likely won’t since mac os x is pretty stable and most new stuff will be compatible with it (ease of use, plug and play).

i wanted to get stumpwm working on mac os x (intel based) like this post, but i never got it to work. somehow, i got it to work. my steps:

  1. update xquartz like the post said.
  2. install sbcl via macports.

UPDATE: actually, i think i used the sbcl for mac via this site.

  1. download the stumpwm source:

git clone git://git.savannah.nongnu.org/stumpwm.git

  1. followed the README file of stumpwm for sbcl:
  <pre class="src src-sh">$ sbcl

* (require ‘asdf) * (require ‘asdf-install) * (asdf-install:install ‘clx) * (asdf-install:install ‘cl-ppcre)

this step gave me MANY errors. i kept selecting the option to retry and continue like crazy. i finally gave up.

  1. continued with README
  <pre class="src src-sh">autoconf <span style="color: #ff4500;">##</span><span style="color: #ff4500;">get if not available. macports?</span>

./configure ##may need to specify sbcl if clisp is also installed make

stumpwm binary should be installed

  1. put following in ~/.xinitrc:

exec ~/Downloads/stumpwm/stumpwm ## path to stumpwm binary

launch programs in X (for example, xterm). look at stumpwm manual for keyboard shortcuts. very cool. this makes me REALLY want to go back to linux as my main computer.

comment or uncomment region in emacs: M-;

so often times in emacs u may want to comment or uncomment a region in emacs. michael zeller presents a way to create a simple macro, save it, and bind it to some keys here.

however, by default in emacs, there is a command called ‘comment-or-uncomment-region’ that is bound to ‘M-;’ . if emacs recognize a syntax or the mode of the buffer, the correct comment character will be inserted or removed. if emacs doesn’t know the default, it will ask u, and u can insert it in. for example, in .conkerorrc, there is no default. i will put ‘//’ when emacs asks me, and i can use ‘M-;’. very cool!

global hotkey / keyboard shortcut in Mac OS X to bring up remember buffer in emacs: record a new thought or TO DO task anywhere

This method worked for me, and this didn’t.

I added the following in my .emacs file:

<pre class="src src-sh">;; Emacs server on by default

(server-start)

;; http://metajack.im/2008/12/30/gtd-capture-with-emacs-orgmode/?dsq=13708223#comment-13708223 ;; together with the apple script C-M-\ anywhere in Mac to bring up the remember buffer ;; C-c C-c to save in ~/.notes and close; (require ‘remember) (defadvice remember-finalize (after delete-remember-frame activate) “Advise remember-finalize to close the frame if it is the remember frame” (if (equal “remember” (frame-parameter nil ‘name)) (delete-frame)))

(defadvice remember-destroy (after delete-remember-frame activate) “Advise remember-destroy to close the frame if it is the rememeber frame” (if (equal “remember” (frame-parameter nil ‘name)) (delete-frame)))

;; make the frame contain a single window. by default org-remember ;; splits the window. (add-hook ‘remember-mode-hook ‘delete-other-windows)

(defun make-remember-frame () “Create a new frame and run org-remember.” (interactive) (make-frame ‘((name . “remember”) (width . 80) (height . 10))) (select-frame-by-name “remember”) (org-remember))

I used this applescript with spark and bound it to C-M-\ : property eclient :

<pre class="src src-sh"><span style="color: #ffa07a;">"/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -e '(make-remember-frame)'"</span>

do shell script eclient

tell application “Emacs” activate end tell

Now, wherever im at in Mac, i just hit C-M-\ and my remember buffer will be brought up. I type what my thoughts are. Hit C-c C-c to save and close buffer. When I have time, go to ~/.notes and organize my thoughts, and finish the to-do tasks. Set the ending of that file as:

Captures

Anything i add will be under ** Date, and after that will be my notes. So remember-mode is org-mode!

create custom keyboard shortcuts / hotkeys in mac os x: spark + applescript

in any linux gui environment, u can define custom keyboard shortcuts for anything, whether its executing a shell command to anything u can think of.

i love my macbook, but i really hate how Apple WILL NOT let me customize things the way i want it. they really force you into their philosophies: we say things should be simple for everyone so we will rely on the mouse. this is BS.

well, i recently figured out a way to resize and move my emacs frame with the keyboard, and i wanted to do that with all windows on my mac like in unix. after googling, i found 2 ways:

  1. mercury mover, which costs $24. no way! the method is a lot like emacs do re mi though. this is good.
  2. use this guy’s applescripts together with spark.

Spark is a great hotkey manager. Great addon to Mac to bring yet another useful feature from linux. I first used spark with emacs remember mode for jotting down notes in the middle of my work. Will write about that next.

I think i should tweak the applescript to somehow make it like mercury mover.