; A boss key for emacs, with several functions you can bind it to. ; -- sburke@cpan.org ; ;====================================================================== ;====== Time-stamp: "2007-08-26 15:19:05 AKDT sburke@cpan.org" ;====================================================================== ; (global-set-key [key-20] 'boss-key) (global-set-key [scroll-lock] 'boss-key) ;========================================================== ;; (I've no idea why the goto-line stuff just does nothing ;; at all under xemacs.) ;; One way... (defun boss-key () (interactive) (dired (expand-file-name "~")) (delete-other-windows) (goto-line (random (count-lines (point-min) (point-max))))) ;; Or anothaaaah... (defun boss-key () "Bring up 'ps aux'" (interactive) ;(require 'ps-mode) (view-buffer (get-buffer-create "*ps aux*")) (delete-other-windows) (shell-command "ps aux" "*ps aux*") (message "") (goto-line (+ 70 (random 20)))) ;; I'm gonna find yaaaa... (setq so-many-damn-switches '("ls" "screen" "less" "ps" "tar" "find")) (defun boss-key () "Bring up a tricky man page'" (interactive) (let* ( (topic (random-nth so-many-damn-switches)) (bufnam (concat "*man: " topic "*")) (buf (view-buffer (get-buffer-create bufnam))) ) (shell-command (concat "man -P cat -E ascii " topic) (current-buffer)) (delete-other-windows) (goto-line (+ 90 (random 50)))) (message "")) (defun random-nth (somelist) (nth (random (length somelist)) somelist)) ;======================================================================