unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: emacs-devel@gnu.org
Subject: Re: Support for butterfly editing
Date: Mon, 29 Dec 2008 01:52:18 +0200	[thread overview]
Message-ID: <871vvrnc9p.fsf@jurta.org> (raw)
In-Reply-To: <87prv848t0.wl%raffael.mancini@hcl-club.lu> (raffael mancini's message of "Fri, 08 Feb 2008 00:59:39 +0100")

> 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/




  parent reply	other threads:[~2008-12-28 23:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07 23:59 Support for butterfly editing raffael.mancini
2008-02-08  9:23 ` Jason Rumney
2008-02-08  9:59 ` martin rudalics
2008-12-28 23:52 ` Juri Linkov [this message]
2008-12-29  4:27   ` tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871vvrnc9p.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).