Permalink
Browse files

remove the build system in favour of elpakit + some small updates

  • Loading branch information...
1 parent 4ebc796 commit 554f12d9b21e570ef37109fc97d23f04565b87bd @nicferrier nicferrier committed Dec 20, 2012
Showing with 31 additions and 94 deletions.
  1. +0 −9 build-parts.txt
  2. +0 −24 build.el
  3. +0 −1 elnode.el
  4. +19 −0 elnode.org
  5. +12 −16 examples/chat.el
  6. +0 −43 packagedir.el
  7. +0 −1 requirements.txt
View
@@ -1,9 +0,0 @@
-elnode.el
-elnode-tests.el
-elnode-rle.el
-elnode-wiki.el
-default-wiki-index.creole
-default-webserver-test.html
-default-webserver-image.png
-README.creole
-COPYING
View
@@ -1,24 +0,0 @@
-;; Batch test Elnode
-
-(setq package-user-dir
- (concat
- (file-name-directory
- (or (buffer-file-name)
- load-file-name
- default-directory))
- ".elpa"))
-(setq package-archives
- '(("gnu" . "http://elpa.gnu.org/packages/")
- ("marmalade" . "http://marmalade-repo.org/packages/")))
-(package-initialize)
-(package-refresh-contents)
-(let ((tar-package
- (concat
- (file-name-directory
- (or (buffer-file-name)
- load-file-name))
- (car (reverse command-line-args)))))
- (message "the package is: %s" tar-package)
- (package-install-file tar-package))
-
-;; End
View
@@ -2753,7 +2753,6 @@ default it just calls `elnode-send-404'."
(elt (file-attributes target-file) 5)
modified-since))))
-
(defun elnode-cached (httpcon)
"`elnode-docroot-for' calls this when the resources was cached.
View
@@ -1,4 +1,23 @@
+* process logging
+** log to a process
+** code like this
+(defun nic-make-log-process (filename)
+ (let ((log-name (format "*log-%s*" filename))
+ (buf-name (concat " " log-name)))
+ (start-process-shell-command
+ log-name (get-buffer-create buf-name)
+ (format
+ "while read line ; do echo $line >> %s ; done"
+ filename))))
+(setq nic-logger (nic-make-log-process))
+(process-send-string nic-logger "hello!\n")
+(process-send-string nic-logger "goodbye!\n")
+(process-send-eof nic-logger)
+** elnode-log-buffer-log does logging
+*** it takes text, buffer-or-name
+*** buffer-or-name could be a process?
+
* planned FAQ
** FAQ for installation
*** why does it not start?
View
@@ -1,6 +1,6 @@
-;;; chat example - very simple webchat -*- lexical-binding: t -*-
-(require 'esxml)
-(require 'cl)
+;;; chat example - very simple webchat
+
+(elnode-app chat-dir esxml)
(defvar chat-list '())
@@ -14,31 +14,27 @@
if (time-less-p since (car rec))
collect rec))
-;; And now the elnode
-(require 'elnode)
+;; And now the elnode
(defun chat-comet-handler (httpcon)
"Defer until there is new chat."
+ ;; FIXME - when this breaks it seems to be down to lexical-binding
+ ;; not being true
(let ((entered (current-time)))
(elnode-defer-until (chat-list-since entered)
(elnode-send-json
- httpcon elnode-defer-guard-it :jsonp t))))
+ httpcon
+ elnode-defer-guard-it :jsonp t))))
(defun chat-send-handler (httpcon)
(let* ((username (elnode-http-cookie httpcon "chatusername" t))
(msg (elnode-http-param httpcon "msg")))
(chat-add username msg)
(elnode-send-json httpcon (json-encode '("thanks")))))
-
;; Main page setup stuff
-(defconst chat-dir (file-name-directory
- (or (buffer-file-name)
- load-file-name
- default-directory)))
-
(defun chat-list-to-html ()
"Return the `chat-list' as rows for initial chat display."
(loop for entry in chat-list
@@ -48,15 +44,15 @@
`(tr
()
(td
- ((class . ,(concat "username " (elt entry 1)))) ,(elt entry 1))
- (td ((class . "message")) ,(elt entry 2))))))
+ ((class ,(concat "username " (elt entry 1)))) ,(elt entry 1))
+ (td ((class "message")) ,(elt entry 2))))))
(defun chat-main-templater ()
"Return the `chat-list' as rows for initial chat display."
(list
(cons
"messages"
- (let ((chat-list
+ (let ((chat-list
(subseq chat-list
0 (if (> (length chat-list) 10)
12
@@ -67,7 +63,7 @@
"The main handler."
(let ((chat-js (concat chat-dir "chat.js"))
(chat-html (concat chat-dir "chat.html"))
- (chat-css (concat chat-dir "styles.css")))
+ (chat-css (concat chat-dir "styles.css")))
(elnode-hostpath-dispatcher
httpcon
`(("^.*//chat/poll/" . chat-comet-handler)
View
@@ -1,43 +0,0 @@
-;; Sets the package store to a dummy location
-
-(setq package-user-dir
- (concat
- (file-name-directory
- (or (buffer-file-name)
- load-file-name
- default-directory))
- ".elpa"))
-(load-file "build.el")
-
-;; Load all the files in the list
-(flet ((map-regex (buffer regex fn)
- (with-current-buffer buffer
- (save-excursion
- (goto-char (point-min))
- (let (res)
- (save-match-data
- (while (re-search-forward regex nil t)
- (let ((f (match-data)))
- (setq res
- (append res
- (list
- (save-match-data
- (funcall fn f))))))))
- res)))))
- (map-regex
- (find-file-noselect
- (concat
- (file-name-directory
- (or (buffer-file-name)
- load-file-name
- default-directory)) "build-parts.txt"))
- "^\\(.*.el\\(\\.gz\\)*\\)$"
- (lambda (md)
- (let ((filename (match-string 0)))
- (when (file-exists-p filename)
- (load-file filename))))))
-
-;; And now run the tests
-(ert-run-tests-batch-and-exit)
-
-;; End
View
@@ -1 +0,0 @@
-'((web "0.1.4")(db "0.0.1")(kv "0.0.9")(fakir "0.0.14")(creole "0.8.14"))

0 comments on commit 554f12d

Please sign in to comment.