~ubuntu-branches/ubuntu/karmic/emacs-snapshot/karmic

« back to all changes in this revision

Viewing changes to lisp/misc.el

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-04-05 09:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20090405091430-nw07lynn2arotjbe
Tags: upstream-20090320
ImportĀ upstreamĀ versionĀ 20090320

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
;;; misc.el --- some nonstandard basic editing commands for Emacs
2
2
 
3
3
;; Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005,
4
 
;;   2006, 2007, 2008 Free Software Foundation, Inc.
 
4
;;   2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5
5
 
6
6
;; Maintainer: FSF
7
7
;; Keywords: convenience
106
106
  (interactive "p")
107
107
  (forward-to-word (- arg)))
108
108
 
 
109
;;;###autoload
 
110
(defun butterfly ()
 
111
  "Use butterflies to flip the desired bit on the drive platter.
 
112
Open hands and let the delicate wings flap once.  The disturbance
 
113
ripples outward, changing the flow of the eddy currents in the
 
114
upper atmosphere.  These cause momentary pockets of higher-pressure
 
115
air to form, which act as lenses that deflect incoming cosmic rays,
 
116
focusing them to strike the drive platter and flip the desired bit.
 
117
You can type `M-x butterfly C-M-c' to run it.  This is a permuted
 
118
variation of `C-x M-c M-butterfly' from url `http://xkcd.com/378/'."
 
119
  (interactive)
 
120
  (if (yes-or-no-p "Do you really want to unleash the powers of the butterfly? ")
 
121
      (progn
 
122
        (switch-to-buffer (get-buffer-create "*butterfly*"))
 
123
        (erase-buffer)
 
124
        (sit-for 0)
 
125
        (setq indent-tabs-mode nil)
 
126
        (animate-string "Amazing physics going on..."
 
127
                        (/ (window-height) 2) (- (/ (window-width) 2) 12))
 
128
        (sit-for (* 5 (/ (abs (random)) (float most-positive-fixnum))))
 
129
        (message "Successfully flipped one bit!"))
 
130
    (message "Well, then go to xkcd.com!")
 
131
    (browse-url "http://xkcd.com/378/")))
 
132
 
109
133
(provide 'misc)
110
134
 
111
135
;; arch-tag: 908f7884-c19e-4388-920c-9cfa425e449b