;;; ;;; I don't really think the original author of these macros ;;; wants his name in the header for posterity. Neither do I, ;;; for that matter. All I did was to port them from Gosmacs ;;; Mocklisp to GNU Elisp, so don't blame me! Remember to put ;;; a bunch of hash marks (#) below the bong, or else you'll ;;; have nothing to smoke. ;;; (defun fill-bong () "Prepare to get stoned..." (interactive) (save-excursion (if (not (re-search-forward "======" nil t)) (error "Shit, man, I can't find the fucking bong...")) (if (not (re-search-forward "#" nil t)) (error "Aww, yer all out, dude.") (progn (backward-delete-char-untabify 1) (if (not (search-backward "[ ]" nil t)) (progn (insert-string "#") (message "The bowl's full, dipshit.")) (progn (forward-char 1) (delete-char 1) (insert-string "#") (message "It's all ready to toke up!")))) (goto-char (point-min))))) (defun smoke-bong () "I'm *confused*!" (interactive) (save-excursion (message "") (goto-char (point-min)) (random t) (if (not (re-search-forward "======" nil t)) (error "Why don't you find the fucking bong?") (progn (previous-line 2) (setq bong-base (point)) (goto-char (point-min)) (if (not (re-search-forward "\\[#\\]" nil t)) (error "There ain't nothin' to smoke!") (progn (backward-char 2) (setq hash-base (point)) (setq bubbles 0) (while (< bubbles 7) (goto-char hash-base) (delete-char 1) (insert-string (one-of "@*+&=")) (goto-char bong-base) (sit-for 1) (bubble-bong " .:oO") (bubble-bong " .:oO") (bubble-bong "_.:oO") (bubble-bong " (){}") (bubble-bong " (){}") (bubble-bong " (){}") (setq bubbles (+ bubbles 1))) (goto-char hash-base) (delete-char 1) (insert-string "%") (goto-char bong-base) (sit-for 1) (bubble-bong " ") (bubble-bong " ") (bubble-bong "_") (bubble-bong " ") (bubble-bong " ") (bubble-bong " "))))) (sit-for 4))) ;;; Hey, isn't there an absolute value function lying around here ;;; somewhere? If I had one this would be a one-liner! (defun one-of (these) "Returns a random character out of a string" (setq which-of-these (/ (random) 100)) (if (< which-of-these 0) (setq which-of-these (- which-of-these))) (setq which-of-these (mod which-of-these (length these))) (substring these which-of-these (+ which-of-these 1))) (defun bubble-bong (bubbles) "" (beginning-of-line) (search-forward "|") (delete-char 2) (insert-string (one-of bubbles)) (insert-string (one-of bubbles)) (previous-line 1) (sit-for 0)) (defun empty-bong () "Take the ashes out..." (interactive) (goto-char (point-min)) (save-excursion (if (discard-ashes) (while (discard-ashes)) (error "It's already empty, jerk-off.")))) (defun discard-ashes () "" (if (re-search-forward "\\\[[^ ]\\\]" nil t) (progn (backward-char) (backward-delete-char 1) (insert-string " ") (sit-for 1) t))) (defun do-hit () "Macro for when you're too stoned to type." (interactive) (find-file "bh") (setq mode-name "-> Bong <-") (goto-char (point-min)) (fill-bong) (sit-for 3) (smoke-bong) (empty-bong) (goto-char (point-min)) (sit-for 0))