gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] storm README opentext.py


From: Benja Fallenstein
Subject: [Gzz-commits] storm README opentext.py
Date: Fri, 27 Jun 2003 12:06:03 -0400

CVSROOT:        /cvsroot/storm
Module name:    storm
Branch:         
Changes by:     Benja Fallenstein <address@hidden>      03/06/27 12:06:02

Modified files:
        .              : README 
Added files:
        .              : opentext.py 

Log message:
        Explain how I've configured emacs to work with Storm

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/storm/storm/opentext.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/storm/storm/README.diff?tr1=1.9&tr2=1.10&r1=text&r2=text

Patches:
Index: storm/README
diff -u storm/README:1.9 storm/README:1.10
--- storm/README:1.9    Fri May 16 04:38:29 2003
+++ storm/README        Fri Jun 27 12:06:02 2003
@@ -115,3 +115,80 @@
 
 or, start a remote peer that can fetch the blocks:
 make peer ARGS="-gw 5000 -port 2000 fishy.it.jyu.fi:2000"
+
+
+How to set up emacs
+-------------------
+
+(Benja says:) I use Storm with emacs and the `eldav`_.
+eldav is available as a Debian package.
+
+.. _eldav: http://www.gohome.org/eldav/
+
+With eldav, you can open a Storm URN by entering
+a filename like this (without the line break)::
+
+    :http://localhost:5555/urn:x-storm:1.0:text/plain,3i42h3s6nnf
+    q2msvx7xzkyayscx5qbyj.lwpnacqdbzryxw3vhjvcj64qbznghohhhzwclnq
+
+Note the leading colon. This works with pointer 
+as well as with block URIs. (But I actually never
+enter these URIs in emacs myself, I use links from
+my web browser; see below.)
+
+Opening a URI from the command line isn't quite
+straightforward. I do it like this:
+
+    emacs -eval '(find-file ":http://localhost:5555/ur
+    n:x-storm:1.0:text/plain,3i42h3s6nnfq2msvx7xzkyays
+    cx5qbyj.lwpnacqdbzryxw3vhjvcj64qbznghohhhzwclnq")'
+
+I've written `a little python script`__ that opens files,
+``http://`` URLs and ``urn:x-storm:`` URIs passed on the
+command line. (It uses `gnuclient`__ to attach to a
+running emacs session, but it could easily be adapted 
+to use emacs directly.)
+
+__ opentext.py
+__ http://www.emacswiki.org/cgi-bin/wiki.pl?GnuClient
+
+I have configured my web browser (Konqueror) to open 
+``text/plain`` resources by passing their URI to this
+Python script. The result is that I can click on a
+Storm link in the browser, and view and edit the
+linked text file in emacs.
+
+Here's how I activate eldav in my ``.emacs`` file::
+
+   (defun trivial-file-writable-p (file) t)
+   (put 'file-writable-p 'eldav 'trivial-file-writable-p)
+   (require 'eldav)
+
+The first two lines disactivate some checks that eldav performs
+before saving a file using HTTP PUT. The checks use WebDAV,
+a superset of HTTP which Storm doesn't implement yet.
+Disactivating the checks allows me to save to a pointer URI
+from inside emacs.
+
+Opening a pointer through my web browser, then editing
+and saving it with emacs normally is quite convenient.
+However, creating to a new pointer isn't convenient
+that way, for me; I prefer to first type some notes
+into an empty file, then save it and give it a name
+if I think it's worth the time (through the Web interface,
+I would have to give the name before I can start editing
+the note).
+
+Therefore, I've put some additional stuff into my ``.emacs``,
+which allows me to save the current buffer to a newly
+created Storm pointer using ``C-x C-j``::
+
+   (defun as-new-pointer (title)
+     (interactive "sPointer name: ")
+     (shell-command-to-string (format "echo -n 
'title=%s&target=urn:x-storm:1.0:text%%2fplain,3i42h3s6nnfq2msvx7xzkyayscx5qbyj.lwpnacqdbzryxw3vhjvcj64qbznghohhhzwclnq'
 > /tmp/newnote.urlencoded" title)) 
+     (write-file (format ":http://localhost:5555/%s"; (shell-command-to-string 
"nd -P /tmp/newnote.urlencoded -T application/x-www-urlencoded 
http://localhost:5555/new-pointer-plain";)))
+   )
+   (global-set-key "\C-x\C-j" 'as-new-pointer)
+
+Of course, you can change the key binding by
+changing the last line.
\ No newline at end of file




reply via email to

[Prev in Thread] Current Thread [Next in Thread]