Permalink
Browse files

remove tabs and change to spaces

  • Loading branch information...
vii committed Feb 19, 2011
1 parent d283f08 commit 2b074bec9766b1854cd05233fb0f14d3ec51f6b0
Showing with 5,056 additions and 5,058 deletions.
  1. +130 −130 src/blog/blog.lisp
  2. +88 −88 src/blog/entry.lisp
  3. +31 −31 src/blog/feed.lisp
  4. +108 −108 src/datastore/datastore.lisp
  5. +11 −11 src/game/card.lisp
  6. +21 −21 src/game/coins.lisp
  7. +4 −4 src/game/controllers.lisp
  8. +66 −66 src/game/framework.lisp
  9. +2 −2 src/game/generic.lisp
  10. +13 −13 src/game/unassigned-controller.lisp
  11. +46 −46 src/game/web-messages.lisp
  12. +182 −182 src/game/web.lisp
  13. +59 −59 src/http/dispatcher.lisp
  14. +8 −8 src/http/encoding.lisp
  15. +15 −15 src/http/headers.lisp
  16. +105 −105 src/http/request.lisp
  17. +128 −128 src/http/serve.lisp
  18. +19 −19 src/http/servestate.lisp
  19. +71 −71 src/io/con.lisp
  20. +36 −36 src/io/epoll.lisp
  21. +11 −11 src/io/mux.lisp
  22. +1 −1 src/io/openssl.lisp
  23. +56 −56 src/io/posix-socket.lisp
  24. +42 −42 src/io/protocol.lisp
  25. +31 −31 src/io/recvbuf.lisp
  26. +10 −10 src/io/repeater.lisp
  27. +70 −70 src/io/sendbuf.lisp
  28. +27 −27 src/io/ssl.lisp
  29. +125 −125 src/io/syscalls.lisp
  30. +67 −67 src/lib/byte-vector.lisp
  31. +18 −18 src/lib/callcc.lisp
  32. +68 −68 src/lib/macros.lisp
  33. +85 −85 src/lib/my.lisp
  34. +16 −16 src/lib/once-only.lisp
  35. +38 −38 src/lib/one-liners.lisp
  36. +6 −7 src/lib/quick-queue.lisp
  37. +33 −33 src/lib/strcat.lisp
  38. +9 −9 src/lib/superquote.lisp
  39. +38 −38 src/lib/timeout.lisp
  40. +44 −44 src/lib/utils.lisp
  41. +178 −178 src/ml/css.lisp
  42. +61 −61 src/ml/define-dtd.lisp
  43. +8 −8 src/ml/js.lisp
  44. +20 −20 src/ml/output.lisp
  45. +1 −1 src/ml/rss.lisp
  46. +43 −43 src/packages.lisp
  47. +25 −25 src/small-games/nash-bargain.lisp
  48. +31 −32 src/small-games/prisoners-dilemma.lisp
  49. +17 −17 src/small-games/roshambo.lisp
  50. +13 −13 src/small-games/ultimatum.lisp
  51. +30 −30 src/survey/survey.lisp
  52. +42 −42 src/truc/robots.lisp
  53. +64 −64 src/truc/truc.lisp
  54. +29 −29 src/truc/web.lisp
  55. +83 −83 src/webapp/actions.lisp
  56. +56 −56 src/webapp/channel.lisp
  57. +1 −1 src/webapp/frame.lisp
  58. +146 −146 src/webapp/js-library.lisp
  59. +2 −2 src/webapp/list-channel.lisp
  60. +10 −10 src/webapp/message-channel.lisp
  61. +1,980 −1,980 src/webapp/names.lisp
  62. +50 −50 src/webapp/page.lisp
  63. +5 −5 src/webapp/simple-channel.lisp
  64. +36 −36 src/webapp/site.lisp
  65. +49 −49 src/webapp/webapp.lisp
  66. +55 −55 t/http.lisp
  67. +47 −47 t/io.lisp
  68. +36 −36 t/regex.lisp
View
@@ -27,35 +27,35 @@
(my-defun blog read-in ()
(with-site ((my site))
(let ((old-entries (or (my entries-table) (make-hash-table :test 'equalp))))
- (setf
+ (setf
(my entries-table) (make-hash-table :test 'equalp)
- (my entries)
+ (my entries)
(sort
- (iter:iter (iter:for path in (cl-fad:list-directory (my dir)))
- (let ((filename (force-string path)))
- (unless (or (find #\# filename) (find #\~ filename))
- (let ((entry (read-in-entry me (file-namestring filename))))
- (iter:collect entry)))))
- #'> :key #'entry-time))
+ (iter:iter (iter:for path in (cl-fad:list-directory (my dir)))
+ (let ((filename (force-string path)))
+ (unless (or (find #\# filename) (find #\~ filename))
+ (let ((entry (read-in-entry me (file-namestring filename))))
+ (iter:collect entry)))))
+ #'> :key #'entry-time))
(loop for entry in (my entries)
- for old = (gethash (entry-index-name entry) old-entries)
- do
- (if old
- (setf (entry-score entry) (entry-score old)
- (entry-score-update-time entry) (entry-score-update-time old))
- (entry-set-score entry))
- (setf (gethash (entry-index-name entry) (my entries-table)) entry))
+ for old = (gethash (entry-index-name entry) old-entries)
+ do
+ (if old
+ (setf (entry-score entry) (entry-score old)
+ (entry-score-update-time entry) (entry-score-update-time old))
+ (entry-set-score entry))
+ (setf (gethash (entry-index-name entry) (my entries-table)) entry))
(my set-page)))
me)
(defun split-into-list-by-comma (str)
(match-split (progn (* (space)) "," (* (space)))
- str))
+ str))
(my-defun blog ready-entries (&key (age (get-universal-time)) tags)
(loop for e in (my entries)
- when (and (entry-front-page-p e tags) (<= (entry-time e) age))
- collect e))
+ when (and (entry-front-page-p e tags) (<= (entry-time e) age))
+ collect e))
(my-defun blog url (name)
(byte-vector-cat (my link-base) name))
@@ -78,97 +78,97 @@
(with-ml-output
(<link :rel "alternate" :type "application/atom+xml" :href (my atom-feed-url))
- ; disable the RSS feed as RSS wants to have absolute URLs
- ; (<link :rel "alternate" :type "application/rss+xml" :href (my rss-feed-url)))
+ ; disable the RSS feed as RSS wants to have absolute URLs
+ ; (<link :rel "alternate" :type "application/rss+xml" :href (my rss-feed-url)))
))
(my-defun blog set-page ()
(with-site ((my site))
(defpage-lambda-blog (my atom-feed-url)
- (lambda (tags)
- (my atom-feed :tags (split-into-list-by-comma tags))))
+ (lambda (tags)
+ (my atom-feed :tags (split-into-list-by-comma tags))))
(defpage-lambda-blog (my rss-feed-url)
- (lambda ()
- (my rss-feed)))
-
- (defpage-lambda (my admin-url)
- (lambda (password entry-name)
- (webapp "Blog administration"
- (<form :method :post
- :action (my admin-url)
- (<p "Password "
- (<input :type :text :name "password" )
- (<input :class "plain-submit" :type :submit :value "")))
- (when (and password (equal (force-string password) (force-string (my admin-password))))
- (let ((comments
- (if entry-name
- (datastore-retrieve-indexed 'comment 'entry-index-name entry-name)
- (remove-if-not (lambda (comment)
- (and (typecase (comment-entry-index-name comment)
- ((or string byte-vector) t))
- (if-match-bind ((= (my comment-index-prefix)) ":")
- (comment-entry-index-name comment))))
- (datastore-retrieve-all 'comment)))))
- (loop for c in (sort (copy-seq comments) #'> :key #'comment-time)
- do (<div :class "comment-admin"
- (let ((c c))
- (html-action-form "Edit comment"
- ((text (comment-text c) :type <textarea)
- (author (comment-author c)))
- (setf (comment-text c) text
- (comment-author c) author))
- (html-action-link "Delete"
- (datastore-delete c))))))))))
+ (lambda ()
+ (my rss-feed)))
+
+ (defpage-lambda (my admin-url)
+ (lambda (password entry-name)
+ (webapp "Blog administration"
+ (<form :method :post
+ :action (my admin-url)
+ (<p "Password "
+ (<input :type :text :name "password" )
+ (<input :class "plain-submit" :type :submit :value "")))
+ (when (and password (equal (force-string password) (force-string (my admin-password))))
+ (let ((comments
+ (if entry-name
+ (datastore-retrieve-indexed 'comment 'entry-index-name entry-name)
+ (remove-if-not (lambda (comment)
+ (and (typecase (comment-entry-index-name comment)
+ ((or string byte-vector) t))
+ (if-match-bind ((= (my comment-index-prefix)) ":")
+ (comment-entry-index-name comment))))
+ (datastore-retrieve-all 'comment)))))
+ (loop for c in (sort (copy-seq comments) #'> :key #'comment-time)
+ do (<div :class "comment-admin"
+ (let ((c c))
+ (html-action-form "Edit comment"
+ ((text (comment-text c) :type <textarea)
+ (author (comment-author c)))
+ (setf (comment-text c) text
+ (comment-author c) author))
+ (html-action-link "Delete"
+ (datastore-delete c))))))))))
(defpage-lambda-blog (my post-comment-url)
- (lambda (text author entry-name keep-this-empty .javascript.)
- (let ((entry-name (force-string entry-name)))
- (let ((success
- (when (and
- (zerop (length keep-this-empty))
- text
- (not (zerop (length text)))
- (< (length text) +max-comment-length+)
- (not (if-match-bind (t (or "[url=" "[URL=")) text))
- (not (equalp
- text
- (ignore-errors (comment-text (first (datastore-retrieve-indexed 'comment 'entry-index-name entry-name)))))))
- (let ((entry (gethash entry-name (my entries-table))))
- (when entry
- (let ((comment
- (make-comment
- :author author
- :text text
- :trace-details (tpd2.http:servestate-origin*)
- :entry-index-name entry-name)))
- (entry-update-score entry (comment-score comment)))
- (channel-notify (entry-channel entry)))
- t))))
- (cond
- (.javascript.
- (if success
- (webapp-respond-ajax-body)
- (tpd2.io:with-sendbuf ()
- (js-to-bv (alert "Comment rejected by spam protection.")))))
- (success
- (webapp "Comment accepted" (<p "Thank you.")))
- (t
- (webapp "Comment rejected by spam protection"
- (<p "Sorry for the inconvenience. Please contact the blog owner with a description of the problem."))))))))
-
- (defpage-lambda-blog (my link-base)
- (lambda ()
- (webapp ((with-ml-output (my name) ": popular posts")
- :head-contents
- (my feed-head-contents))
- (my front-page))))
-
- (defpage-lambda-blog (my latest-url)
- (lambda ()
- (webapp ((my name)
- :head-contents
- (my feed-head-contents))
- (my latest-page))))))
+ (lambda (text author entry-name keep-this-empty .javascript.)
+ (let ((entry-name (force-string entry-name)))
+ (let ((success
+ (when (and
+ (zerop (length keep-this-empty))
+ text
+ (not (zerop (length text)))
+ (< (length text) +max-comment-length+)
+ (not (if-match-bind (t (or "[url=" "[URL=")) text))
+ (not (equalp
+ text
+ (ignore-errors (comment-text (first (datastore-retrieve-indexed 'comment 'entry-index-name entry-name)))))))
+ (let ((entry (gethash entry-name (my entries-table))))
+ (when entry
+ (let ((comment
+ (make-comment
+ :author author
+ :text text
+ :trace-details (tpd2.http:servestate-origin*)
+ :entry-index-name entry-name)))
+ (entry-update-score entry (comment-score comment)))
+ (channel-notify (entry-channel entry)))
+ t))))
+ (cond
+ (.javascript.
+ (if success
+ (webapp-respond-ajax-body)
+ (tpd2.io:with-sendbuf ()
+ (js-to-bv (alert "Comment rejected by spam protection.")))))
+ (success
+ (webapp "Comment accepted" (<p "Thank you.")))
+ (t
+ (webapp "Comment rejected by spam protection"
+ (<p "Sorry for the inconvenience. Please contact the blog owner with a description of the problem."))))))))
+
+ (defpage-lambda-blog (my link-base)
+ (lambda ()
+ (webapp ((with-ml-output (my name) ": popular posts")
+ :head-contents
+ (my feed-head-contents))
+ (my front-page))))
+
+ (defpage-lambda-blog (my latest-url)
+ (lambda ()
+ (webapp ((my name)
+ :head-contents
+ (my feed-head-contents))
+ (my latest-page))))))
(my-defun blog link-to-latest ()
(tpd2.http:with-http-params (tags age)
@@ -182,40 +182,40 @@
(my-defun blog front-page ()
(let ((entries (my ready-entries-http)) (count 24))
(let ((entries (sort (copy-list entries) #'> :key #'entry-score)))
- (<div :class "blog-front-page"
- (my link-to-latest)
-
- (<div :class "blog-front-page-entries"
- (let* (
- (entries (loop for e in entries repeat count collect e))
- (total-score (loop for e in entries summing (entry-score e)))
- (score-mul (/ (length entries) (max 1 total-score)))
- (reverse-entries (reverse entries)))
- (loop for entry in entries
- repeat (/ count 3)
- do
- (with-ml-output (entry-headline-ml entry score-mul)
- (loop repeat 2 do
- (with-ml-output (entry-headline-ml (pop reverse-entries) score-mul))))
- )))
-
- (my link-to-latest)))))
+ (<div :class "blog-front-page"
+ (my link-to-latest)
+
+ (<div :class "blog-front-page-entries"
+ (let* (
+ (entries (loop for e in entries repeat count collect e))
+ (total-score (loop for e in entries summing (entry-score e)))
+ (score-mul (/ (length entries) (max 1 total-score)))
+ (reverse-entries (reverse entries)))
+ (loop for entry in entries
+ repeat (/ count 3)
+ do
+ (with-ml-output (entry-headline-ml entry score-mul)
+ (loop repeat 2 do
+ (with-ml-output (entry-headline-ml (pop reverse-entries) score-mul))))
+ )))
+
+ (my link-to-latest)))))
(my-defun blog latest-page ()
(tpd2.http:with-http-params (tags)
(let ((entries (my ready-entries-http)) (count 10))
(<div :class "blog"
- (loop while entries
- repeat count
- do
- (let ((entry (pop entries)))
- (<h2 (<a :href (entry-url-path entry) (entry-title entry)))
- (output-object-to-ml entry)))
- (when entries
- (<h3 :class "next-entries"
- (<a :href (page-link (my latest-url) :age (force-byte-vector (entry-time (first entries))) :tags (force-byte-vector tags)) "Older entries (" (length entries) " remaining)")))))))
+ (loop while entries
+ repeat count
+ do
+ (let ((entry (pop entries)))
+ (<h2 (<a :href (entry-url-path entry) (entry-title entry)))
+ (output-object-to-ml entry)))
+ (when entries
+ (<h3 :class "next-entries"
+ (<a :href (page-link (my latest-url) :age (force-byte-vector (entry-time (first entries))) :tags (force-byte-vector tags)) "Older entries (" (length entries) " remaining)")))))))
(my-defun blog last-updated ()
(loop for e in (my entries)
- when (entry-front-page-p e)
- maximizing (entry-time e)))
+ when (entry-front-page-p e)
+ maximizing (entry-time e)))
Oops, something went wrong.

0 comments on commit 2b074be

Please sign in to comment.