[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Wed, 06 Oct 2021 22:58:26 +0200
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Uwe Brauer wrote:
> Thanks but the file edit, is missing at least not included
> in my emacs
You are right, "must" fix the names, try these and only these:
(defun region-to-string ()
"Return the region text as a string. Replace newlines with spaces."
(let ((beg (region-beginning))
(end (region-end) ))
(let ((text (buffer-substring-no-properties beg end)))
(replace-regexp-in-string "\n" " " text) ))))
(defun scramble (beg end)
"Shuffle chars in region from BEG to END."
(chars (delete "" (split-string str "")))
(rand-chars (sort chars (lambda (_ __) (zerop (random 2))))) )
(delete-region beg end)
(dolist (c rand-chars)
(insert c) )))))
(defun scramble-string (str)
"Randomize the characters of a string."
(interactive "sscramble me: ")
(let ((rand-str (seq-sort (lambda (_ __) (zerop (random 2))) str )))
(if (called-interactively-p 'any)
(defun comic-book-insult ()
(insert (concat (scramble-string "@#$%&") "!")) )
;; (comic-book-insult) ; @#$%&!
;; (comic-book-insult) ; $&#@%!
;; (scramble-string "Hello there, Emacs is very cool piece of software")
;; "aye eposrr lvre olsec,ewfico ceti ftomH hseoa l E"
underground experts united