* Support for butterfly editing
@ 2008-02-07 23:59 raffael.mancini
2008-02-08 9:23 ` Jason Rumney
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: raffael.mancini @ 2008-02-07 23:59 UTC (permalink / raw)
To: emacs-devel
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.
Kind regards,
Raffael Mancini
PS: Please don't tear me in pieces for this. If not appropriate just
ignore this mail.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Support for butterfly editing
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
2 siblings, 0 replies; 5+ messages in thread
From: Jason Rumney @ 2008-02-08 9:23 UTC (permalink / raw)
To: raffael.mancini; +Cc: emacs-devel
raffael.mancini@hcl-club.lu wrote:
> (message "Amazing physics going on...")
> (sit-for (* 5 (/ (abs (random)) (float most-positive-fixnum))))
>
It might be more interesting to use animate or zone here, to show the
amazing physics happening.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Support for butterfly editing
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
2 siblings, 0 replies; 5+ messages in thread
From: martin rudalics @ 2008-02-08 9:59 UTC (permalink / raw)
To: raffael.mancini; +Cc: emacs-devel
> "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/"
With this doc-string C-h f RET butterfly RET gives on my system
butterfly is an interactive Lisp function.
(butterfly)
This function is designed to be used only be the mostproficient hackers on earth. If equipped with a butterfly key,
itshould be bound to C-x M-c M-butterfly (for further
information please refer to http://xkcd.com/378/
The doc-string violates at least the following four conventions from
appendix D.6 of the Emacs Lisp Reference Manual
The first line of the documentation string should consist of one
or two complete sentences that stand on their own as a summary.
For a function, the first line should briefly answer the question,
"What does this function do?"
Finally, to create a hyperlink to URLs, write the URL in single
quotes, preceded by `URL'.
Don't write key sequences directly in documentation strings.
has two silly backslashes and misses a right paren and a period.
I think C-h f RET butterfly RET should give something like
butterfly is an interactive Lisp function.
It is bound to <C-x> <M-c> <M-butterfly>.
(butterfly)
Flip desired bit on drive platter.
This function is designed to be used only by the most proficient
hackers on earth. For further information please refer to
`http://xkcd.com/378/'.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Support for butterfly editing
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
2008-12-29 4:27 ` tomas
2 siblings, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2008-12-28 23:52 UTC (permalink / raw)
To: emacs-devel
> 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/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Support for butterfly editing
2008-12-28 23:52 ` Juri Linkov
@ 2008-12-29 4:27 ` tomas
0 siblings, 0 replies; 5+ messages in thread
From: tomas @ 2008-12-29 4:27 UTC (permalink / raw)
To: Juri Linkov; +Cc: emacs-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, Dec 29, 2008 at 01:52:18AM +0200, Juri Linkov wrote:
> > Hi *,
> >
> > In order to maintain the reputation of emacs [...]
> > [...] http://xkcd.com/378/.
> >
[...]
> What a shame we still don't have this famous command as an easter egg
> in Emacs. [...]
Christmas is barely over and you are already thinking Easter eggs. How
far are you going to take that ;-)
Seriously: Thanks for making me smile
Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFJWFGmBcgs9XrR2kYRAtIhAJ9S+W5D08mikwliduwp47VBoCjVDACfTNW2
1maMj81Efg6hifilDf7qRxE=
=xObF
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-12-29 4:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2008-12-29 4:27 ` tomas
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).