emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Support for butterfly editing


From: Juri Linkov
Subject: Re: Support for butterfly editing
Date: Mon, 29 Dec 2008 01:52:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

> Hi *,
>
> In order to maintain the reputation of emacs as being a text shell
> capable of accomplishing the most difficult tasks, I've written a
> small function that will finally add support for the now famous
> butterfly button as described in http://xkcd.com/378/.
>
> (defun butterfly ()
>   "This function is designed to be used only be the most\
> proficient hackers on earth. If equipped with a butterfly key,
> it\ should be bound to C-x M-c M-butterfly (for further
> information please refer to http://xkcd.com/378/";
>   (interactive)
>   (if (yes-or-no-p "Do you really want to unleash the powers of the 
> butterfly? ")
>       (progn
>       (message "Amazing physics going on...")
>       (sit-for (* 5 (/ (abs (random)) (float most-positive-fixnum))))
>       (message "Successfully flipped one bit!"))
>     (message "Well, then go to www.xkcd.com!")))
>
> I ask the gnu emacs dev team to either add that function to gnu emacs
> or if my implementation is not polished enough implement it in
> another way.
>
> This would be another great example where an xkcd comic kind of
> materializes (http://wetriffs.com/ is the first) and would maybe open
> emacs to a broader audience.

What a shame we still don't have this famous command as an easter egg
in Emacs.  I've added it now to misc.el (a file for nonstandard Emacs
commands) taking into account more suggestions from this thread for
using `animate-string' and `browse-url'.

As for the keys to run this command, there is a little secret:
`C-x M-c M-butterfly' is nothing more than a valid key sequence
with a slight permutation.  After the two-step conversion:

      1
   +------+
   !      !
  ==      v
C-x M-c M-butterfly
=======            ^
   !               !
   +---------------+
           2

1. move "x " to the beginning of the word "butterfly";
2. move "C-M-c" to the end of the word "butterfly".

we get a valid Emacs key sequence `M-x butterfly C-M-c'!

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]