Skip to content

Instantly share code, notes, and snippets.

@vderyagin
Created September 23, 2012 10:00
Show Gist options
  • Save vderyagin/3769558 to your computer and use it in GitHub Desktop.
Save vderyagin/3769558 to your computer and use it in GitHub Desktop.
RFC-3092 compatible metasyntactic variable name generator.
(eval-when-compile
(require 'cl-lib))
(defun foo (count)
"Inserts at point position COUNT metasyntactic variable names separated by spaces.
Compatible with RFC-3092."
(interactive "p")
(insert
(mapconcat
'identity
(cl-loop
repeat count
with foos = '("bar" "baz" "qux" "quux" "corge"
"grault" "garply" "waldo" "fred"
"plugh" "xyzzy" "thud")
for foo = (nth (random (length foos)) foos)
collect foo)
" ")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment