Here's a little python script to dump an RFC to the stdout.  Call it
like:

> rfc.py 822

#!/usr/local/bin/python
import urllib
import sys

def usage():
    print 'Example usage: %s 822' % sys.argv[0] 
    sys.exit(1)
    
try: n = int(sys.argv[1])
except: usage()

print urllib.urlopen('http://www.ietf.org/rfc/rfc%d.txt' % n).read()

---

And here's an emacs function which calls the python script and dumps
the result into a suitably named emacs buffer.  Naturally, you'll need
to put rfc.py into your executable path and make it executable if you
want the emacs thingie to work.

(defun rfc (num)
  "Insert RFC indicated by num into buffer *RFC<num>*"
  (interactive "sRFC: ")
  (shell-command 
    (concat "rfc.py " num)
    (concat "*RFC" num "*")))

JDH

_______________________________________________
Bits mailing list
[EMAIL PROTECTED]
http://www.sugoi.org/mailman/listinfo/bits

Reply via email to