unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: Emanuel Berg <moasenwood@zoho.eu>
Cc: help-gnu-emacs@gnu.org
Subject: Re: comic-book-insult
Date: Sun, 08 Sep 2019 22:16:16 +0200	[thread overview]
Message-ID: <8736h6mtm7.fsf@mbork.pl> (raw)
In-Reply-To: <86k1aiip6o.fsf@zoho.eu>


On 2019-09-08, at 21:05, Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:

> (defun scramble-string (str)
>   "Randomize the characters of a string."
>   (interactive "sscramble me: ")
>   (let*((empty-str  "")
>         (chars      (delete empty-str (split-string str empty-str)))
>         (rand-chars (sort chars (lambda (_ __) (zerop (random 2)))))
>         (rand-str   (mapconcat 'identity rand-chars ""))
>         )
>     rand-str) )

Nice, but a bit wrong.  If you try it as an interactive function, it
won't display the result - only return it, but this is of no use with M-x.

> (defun comic-book-insult ()
>   (interactive)
>   (insert (concat (scramble-string "@#$%&") "!") ))
>
> ;; (comic-book-insult) ; %@&$#!
> ;; (comic-book-insult) ; $%#@&!

And this is rather cute, thanks for sharing!

Best,

-- 
Marcin Borkowski
http://mbork.pl



  reply	other threads:[~2019-09-08 20:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-08 19:05 comic-book-insult Emanuel Berg via Users list for the GNU Emacs text editor
2019-09-08 20:16 ` Marcin Borkowski [this message]
2019-09-08 22:55   ` comic-book-insult Emanuel Berg via Users list for the GNU Emacs text editor
2019-09-08 22:29 ` comic-book-insult Adam Porter
2019-09-10 23:43   ` comic-book-insult Emanuel Berg via Users list for the GNU Emacs text editor
2019-09-08 23:47 ` comic-book-insult Eric Abrahamsen
2019-09-09  3:56   ` comic-book-insult Emanuel Berg via Users list for the GNU Emacs text editor
2019-09-09  5:09 ` comic-book-insult Yuri Khan
2019-09-09 17:41   ` comic-book-insult Emanuel Berg via Users list for the GNU Emacs text editor
2019-09-09 18:26     ` comic-book-insult Yuri Khan
2019-09-09 18:33       ` comic-book-insult Emanuel Berg via Users list for the GNU Emacs text editor
2019-09-09  8:00 ` comic-book-insult Jean Louis
2019-09-09 17:32   ` comic-book-insult Emanuel Berg via Users list for the GNU Emacs text editor
2019-09-09 18:05     ` comic-book-insult Jean Louis
2019-09-09 18:10       ` comic-book-insult Emanuel Berg via Users list for the GNU Emacs text editor
2019-09-09 18:13       ` comic-book-insult Eli Zaretskii
2019-09-11 12:56         ` Anonymous arguments - comic-book-insult Jean Louis
2019-09-11 15:12           ` Emanuel Berg via Users list for the GNU Emacs text editor
2019-09-17  6:19             ` Jean Louis

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=8736h6mtm7.fsf@mbork.pl \
    --to=mbork@mbork.pl \
    --cc=help-gnu-emacs@gnu.org \
    --cc=moasenwood@zoho.eu \
    /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.
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).