Luc Orient, Late Middle Japanese, C22H24N2O8 & Sokolsky District
This commit is contained in:
parent
b248ea0b4d
commit
4dba4c5eba
1 changed files with 32 additions and 27 deletions
55
litanize.el
55
litanize.el
|
@ -6,7 +6,7 @@
|
||||||
;; Created: 2019-01-19
|
;; Created: 2019-01-19
|
||||||
;; Version: 0.1
|
;; Version: 0.1
|
||||||
;; Keywords: Latour Litany, alien phenomenology, ontography, metaphorism, carpentry
|
;; Keywords: Latour Litany, alien phenomenology, ontography, metaphorism, carpentry
|
||||||
;; X-URL: https://github.com/zzkt/litanize
|
;; URL: https://github.com/zzkt/litanize
|
||||||
|
|
||||||
;; This file is not part of GNU Emacs.
|
;; This file is not part of GNU Emacs.
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@
|
||||||
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
;; a simple version of Ian Bogost's method of generating "Latour Litanies"
|
;; a simple version of Ian Bogost's method of generating "Latour Litanies"
|
||||||
|
@ -41,35 +40,51 @@
|
||||||
;;
|
;;
|
||||||
;; further -> http://bogost.com/writing/blog/latour_litanizer/
|
;; further -> http://bogost.com/writing/blog/latour_litanizer/
|
||||||
|
|
||||||
|
|
||||||
|
;;; Revision history:
|
||||||
|
;;
|
||||||
|
;; - 2019-01-19 - preliminary carpentry
|
||||||
|
;; - 2019-12-12 - melpa emersion, stochastism
|
||||||
|
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(provide 'litanize)
|
(defgroup litanize nil
|
||||||
(eval-when-compile
|
"Generating 'Latour Litanies' as an exercise in ontography, metaphorism, and carpentry"
|
||||||
(require 'cl))
|
:group 'stochastism)
|
||||||
|
|
||||||
(require 'enlive)
|
(require 'enlive)
|
||||||
;; enlive can be installed via melpa or from https://github.com/zweifisch/enlive
|
;; enlive can be installed via melpa or from https://github.com/zweifisch/enlive
|
||||||
|
|
||||||
|
|
||||||
(defun random-wp-title ()
|
(defun random-wp-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]))))
|
||||||
|
|
||||||
(defun litanize ()
|
|
||||||
"Create a Latour Litany in it's own buffer"
|
;;;###autoload
|
||||||
(interactive)
|
(defun latour-litany (length)
|
||||||
(with-current-buffer (get-buffer-create "*latour litany*")
|
"Create an arbitary (or random) length litany in its own buffer"
|
||||||
|
(interactive "nHow long a litany? ")
|
||||||
|
(with-current-buffer (get-buffer-create "*Latour litany*")
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(dotimes (i 5)
|
(when (<= length 3) (setq length 3))
|
||||||
|
(dotimes (i length)
|
||||||
(insert (random-wp-title))
|
(insert (random-wp-title))
|
||||||
(cond ((<= i 2) (insert ", "))
|
(cond ((<= i (- length 3)) (insert ", "))
|
||||||
((= i 3) (insert " & "))
|
((= i (- length 2)) (insert " & "))
|
||||||
((= i 4) (insert "."))))))
|
((= i (- length 1)) (insert "."))))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun litanize ()
|
||||||
|
"Create a Latour Litany in its own buffer"
|
||||||
|
(interactive)
|
||||||
|
(latour-litany 5))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
(defun insert-litany ()
|
(defun insert-litany ()
|
||||||
"Create a Latour Litany at the current point"
|
"Create a Latour Litany at the current point"
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -79,16 +94,6 @@
|
||||||
((= i 3) (insert " & "))
|
((= i 3) (insert " & "))
|
||||||
((= i 4) (insert ".")))))
|
((= i 4) (insert ".")))))
|
||||||
|
|
||||||
(defun latour-litany (length)
|
(provide 'litanize)
|
||||||
"generate an arbitary (or random) length litany as a string"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;;;##########################################################################
|
|
||||||
;;;; User Options, Variables
|
|
||||||
;;;;##########################################################################
|
|
||||||
|
|
||||||
|
|
||||||
;;; litanize.el ends here
|
;;; litanize.el ends here
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue