;;; segregation ;;; '(1 2 3 4 5 6) -> (seg 3 ls) -> #((1 4) (2 5) (3 6)) (defun seg (m ls0) (let ((a (make-array m))) (labels ((rec (i ls) (if ls (progn (push (car ls) (aref a (mod i m))) (rec (1+ i) (cdr ls))) (dotimes (j m) (setf (aref a j) (nreverse (aref a j))))))) (rec 0 ls0) a))) ;;; a simple launcher (defmacro launch (&rest apps) (let* ((a (seg 2 apps)) (lsym (mapcar #'(lambda (name) (intern (concat "launch-" name))) (aref a 0)))) `(progn ,@(mapcar #'(lambda (sym exe) `(defun ,sym () (interactive) (call-process ,exe))) lsym (aref a 1)) (add-hook '*post-startup-hook* #'(lambda () (add-popup-menu *app-menu* (define-popup-menu ,@(mapcar #'(lambda (sym name) `(:item nil ,name ',sym)) lsym (aref a 0))) "‹N“®")))))) ;;; change following according to your use and system (launch "ftp" "d:\\wbin\\ffftp\\ffftp.exe" "mail" "c:\\Program Files\\Mozilla Thunderbird\\thunderbird.exe" "www" "c:\\Program Files\\Mozilla Firefox\\firefox.exe" "word" "c:\\Program Files\\OpenOffice.org 1.9.79\\program\\swriter.exe" "calc" "c:\\Program Files\\OpenOffice.org 1.9.79\\program\\scalc.exe" "draw" "c:\\Program Files\\OpenOffice.org 1.9.79\\program\\sdraw.exe")