Skip to content
This repository
Browse code

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

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

0 notes on commit 554f12d

Please sign in to comment.
Something went wrong with that request. Please try again.