~ubuntu-branches/ubuntu/karmic/muse-el/karmic

« back to all changes in this revision

Viewing changes to contrib/httpd.el

  • Committer: Bazaar Package Importer
  • Author(s): Michael W. Olson (GNU address)
  • Date: 2006-10-10 21:44:42 UTC
  • mfrom: (1.1.2 upstream) (3.1.1 edgy)
  • Revision ID: james.westby@ubuntu.com-20061010214442-dwhmmh43pp8oqi4f
Tags: 3.02.8-1
* New upstream release.
* Bug fix: "muse-el: Can not activate planner-mode on Emacs 22", thanks
  to intrigeri (Closes: #391408).
* Bug fix: "muse-el: muse-http.el is not functional", thanks to Junichi
  Uekawa (Closes: #357949).
* control (Build-Depends): New field which contains debhelper
  dependency.
  (Standards-Version): Bump to 3.7.2.
* debian/emacsen-install: Compile files in contrib directory in addition
  to the normal fare.  Thanks to Junichi Uekawa for the suggestion.
* debian/emacsen-startup: Add contrib directory to load-path.
* debian/emacsen-remove: Fix comment.
* debian/compat: New file that sets the debhelper compatibility level to
  4.
* debian/rules: Remove DH_COMPAT line.  Thanks to Romain Francoise for
  the suggestion.
* debian/NEWS: Rename from NEWS.Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
;;;
3
3
;;; Author: Eric Marsden <emarsden@laas.fr>
4
4
;;;         John Wiegley <johnw@gnu.org>
5
 
;;; Version: 1.0
 
5
;;;         Michael Olson <mwolson@gnu.org> (slight modifications)
 
6
;;; Version: 1.1
6
7
;;; Keywords: games
7
8
;;; Copyright (C) 2001, 2003 Eric Marsden
 
9
;;; Parts copyright (C) 2006 Free Software Foundation, Inc.
8
10
;;
9
11
;;     This program is free software; you can redistribute it and/or
10
12
;;     modify it under the terms of the GNU General Public License as
35
37
;; I have only tested this code with Emacs; it may need modifications
36
38
;; to work with XEmacs.
37
39
;;
 
40
;; This version has been modified to work with GNU Emacs 21 and 22.
 
41
;;
38
42
;;; Acknowledgements:
39
43
;;
40
44
;; httpd.el was inspired by pshttpd, an HTTP server written in
250
254
      )))
251
255
 
252
256
(defun httpd-start (&optional port)
253
 
  (interactive (list (read-input "Serve Web requests on port: " "8080")))
 
257
  (interactive (list (read-string "Serve Web requests on port: " "8080")))
254
258
  (if (null port)
255
259
      (setq port 8080)
256
260
    (if (stringp port)
257
 
        (setq port (string-to-int port))))
 
261
        (setq port (string-to-number port))))
258
262
  (if httpd-process
259
263
      (delete-process httpd-process))
260
264
  (setq httpd-process
261
 
        (open-network-stream-server "httpd" (generate-new-buffer "httpd")
262
 
                                    port nil 'httpd-serve))
263
 
  (if (eq (process-status httpd-process) 'listen)
 
265
        (if (fboundp 'make-network-process)
 
266
            (make-network-process :name "httpd"
 
267
                                  :buffer (generate-new-buffer "httpd")
 
268
                                  :host 'local :service port
 
269
                                  :server t :noquery t
 
270
                                  :filter 'httpd-serve)
 
271
          (and (fboundp 'open-network-stream-server)
 
272
               (open-network-stream-server "httpd"
 
273
                                           (generate-new-buffer "httpd")
 
274
                                           port nil 'httpd-serve))))
 
275
  (if (and (processp httpd-process)
 
276
           (eq (process-status httpd-process) 'listen))
264
277
      (message "httpd.el is listening on port %d" port)))
265
278
 
266
279
(defun httpd-stop ()