Ice Energy, Parathystas, Shirley Horn with Horns & Ōzora, Hokkaido.
This commit is contained in:
parent
ba73259e35
commit
a45902fa29
1 changed files with 10 additions and 11 deletions
21
litanize.el
21
litanize.el
|
@ -33,7 +33,7 @@
|
||||||
;;
|
;;
|
||||||
;; Currently uses wikipedia titles as elements. Might be extended to use
|
;; Currently uses wikipedia titles as elements. Might be extended to use
|
||||||
;; other lists in other futures.
|
;; other lists in other futures.
|
||||||
;;
|
;;
|
||||||
;; 'M-x litanize' will generate a litany in a new buffer
|
;; 'M-x litanize' will generate a litany in a new buffer
|
||||||
;;
|
;;
|
||||||
;; 'M-x litanize-at-point' will generate a litany at the point
|
;; 'M-x litanize-at-point' will generate a litany at the point
|
||||||
|
@ -44,24 +44,23 @@
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(defgroup litanize nil
|
(defgroup litanize nil
|
||||||
"Generating 'Latour Litanies' as an exercise in ontography, metaphorism, and carpentry"
|
"Generating 'Latour Litanies' as an exercise in ontography, metaphorism, and carpentry."
|
||||||
:group 'stochastism)
|
:group 'stochastism)
|
||||||
|
|
||||||
(require 's)
|
(require 's)
|
||||||
(require 'enlive)
|
(require 'enlive)
|
||||||
|
|
||||||
(defun litanize-wp-title ()
|
(defun litanize-wp-title ()
|
||||||
"Return a random wikipedia title."
|
"Return a random Wikipedia title."
|
||||||
(s-chop-suffix
|
(s-chop-suffix
|
||||||
" - Wikipedia"
|
" - Wikipedia"
|
||||||
(nth 2 (enlive-query
|
(nth 2 (enlive-query
|
||||||
(enlive-fetch "https://en.wikipedia.org/wiki/Special:Random")
|
(enlive-fetch "https://en.wikipedia.org/wiki/Special:Random")
|
||||||
[title]))))
|
[title]))))
|
||||||
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun litanize-litany (length)
|
(defun litanize-litany (length)
|
||||||
"Create an arbitary (or random) LENGTH litany in its own buffer."
|
"Create an arbitrary (or random) LENGTH litany in its own buffer."
|
||||||
(interactive "nHow long a litany? ")
|
(interactive "nHow long a litany? ")
|
||||||
(with-current-buffer (get-buffer-create "*Latour litany*")
|
(with-current-buffer (get-buffer-create "*Latour litany*")
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
|
@ -69,8 +68,8 @@
|
||||||
(dotimes (i length)
|
(dotimes (i length)
|
||||||
(insert (litanize-wp-title))
|
(insert (litanize-wp-title))
|
||||||
(cond ((<= i (- length 3)) (insert ", "))
|
(cond ((<= i (- length 3)) (insert ", "))
|
||||||
((= i (- length 2)) (insert " & "))
|
((= i (- length 2)) (insert " & "))
|
||||||
((= i (- length 1)) (insert "."))))))
|
((= i (- length 1)) (insert "."))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun litanize ()
|
(defun litanize ()
|
||||||
|
@ -85,8 +84,8 @@
|
||||||
(dotimes (i 5)
|
(dotimes (i 5)
|
||||||
(insert (litanize-wp-title))
|
(insert (litanize-wp-title))
|
||||||
(cond ((<= i 2) (insert ", "))
|
(cond ((<= i 2) (insert ", "))
|
||||||
((= i 3) (insert " & "))
|
((= i 3) (insert " & "))
|
||||||
((= i 4) (insert ".")))))
|
((= i 4) (insert ".")))))
|
||||||
|
|
||||||
|
|
||||||
(provide 'litanize)
|
(provide 'litanize)
|
||||||
|
|
Loading…
Reference in a new issue