[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 95/119: better ws-send-directory-list
From: |
Eric Schulte |
Subject: |
[elpa] 95/119: better ws-send-directory-list |
Date: |
Mon, 10 Mar 2014 16:57:50 +0000 |
eschulte pushed a commit to branch master
in repository elpa.
commit dbfec4f59c2fd0c492cb7f9371d03bfc5a0573f4
Author: Eric Schulte <address@hidden>
Date: Sun Jan 12 08:56:01 2014 -0700
better ws-send-directory-list
---
web-server.el | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/web-server.el b/web-server.el
index 9bc5772..944521c 100644
--- a/web-server.el
+++ b/web-server.el
@@ -555,7 +555,11 @@ used to limit the files sent."
(ws-response-header proc 200 (cons "Content-type" "text/html"))
(process-send-string proc
(concat "<ul>"
- (mapconcat (lambda (f) (format "<li><a href=%S>%s</li>" f f))
+ (mapconcat (lambda (f)
+ (let* ((full (expand-file-name f directory))
+ (end (if (file-directory-p full) "/" ""))
+ (url (url-encode-url (concat f end))))
+ (format "<li><a href=%s>%s</li>" url f)))
(directory-files directory nil match)
"\n")
"</ul>")))
- [elpa] 90/119: tutorials, (continued)
- [elpa] 90/119: tutorials, Eric Schulte, 2014/03/10
- [elpa] 88/119: accept single-function handlers, Eric Schulte, 2014/03/10
- [elpa] 96/119: expand this example w/smart dir listings, Eric Schulte, 2014/03/10
- [elpa] 98/119: TODO chunked encoding, Eric Schulte, 2014/03/10
- [elpa] 99/119: serve files with htmlize Emacs fontification, Eric Schulte, 2014/03/10
- [elpa] 97/119: added ws-stop-all convenience function, Eric Schulte, 2014/03/10
- [elpa] 89/119: authorization helper, Eric Schulte, 2014/03/10
- [elpa] 92/119: simpler handler in example, Eric Schulte, 2014/03/10
- [elpa] 102/119: updated content- transfer-encoding notes, Eric Schulte, 2014/03/10
- [elpa] 103/119: set Content-length when serving files, Eric Schulte, 2014/03/10
- [elpa] 95/119: better ws-send-directory-list,
Eric Schulte <=
- [elpa] 106/119: TODO Content and Transfer encodings, Eric Schulte, 2014/03/10
- [elpa] 104/119: tweak notes, Eric Schulte, 2014/03/10
- [elpa] 108/119: test chunked/gzipped transfer/content encodings, Eric Schulte, 2014/03/10
- [elpa] 100/119: manual application of x-gzip content encoding, Eric Schulte, 2014/03/10
- [elpa] 101/119: manual application of chunked transfer encoding, Eric Schulte, 2014/03/10
- [elpa] 107/119: support for content and transfer encodings, Eric Schulte, 2014/03/10
- [elpa] 109/119: doc for new content/transfer encoding helpers, Eric Schulte, 2014/03/10
- [elpa] 110/119: automatically generate dir file w/install-info, Eric Schulte, 2014/03/10
- [elpa] 113/119: Fix WebSocket varint length encoding, Eric Schulte, 2014/03/10
- [elpa] 117/119: adding .elpaignore to keep extra file from package, Eric Schulte, 2014/03/10