# HG changeset patch # User Juanma Barranquero # Date 1205230901 0 # Node ID 9f968e893cca5236c914b941b49074076d438f33 # Parent 39c418592deeaa2dff99d92a5ab08a11caf75948 (iwconfig-program-options): Doc fix. (net-utils-run-program, run-network-program): Define as functions. diff -r 39c418592dee -r 9f968e893cca lisp/net/net-utils.el --- a/lisp/net/net-utils.el Tue Mar 11 08:14:28 2008 +0000 +++ b/lisp/net/net-utils.el Tue Mar 11 10:21:41 2008 +0000 @@ -116,7 +116,7 @@ :version "23.1") (defcustom iwconfig-program-options nil - "Options for `iwconfig-program'." + "Options for the iwconfig program." :group 'net-utils :type '(repeat string) :version "23.1") @@ -312,17 +312,17 @@ (if moving (goto-char (process-mark process)))) (set-buffer old-buffer)))) -(defmacro net-utils-run-program (name header program &rest args) +(defun net-utils-run-program (name header program args) "Run a network information program." - ` (let ((buf (get-buffer-create (concat "*" ,name "*")))) - (set-buffer buf) - (erase-buffer) - (insert ,header "\n") - (set-process-filter - (apply 'start-process ,name buf ,program ,@args) - 'net-utils-remove-ctrl-m-filter) - (display-buffer buf) - buf)) + (let ((buf (get-buffer-create (concat "*" name "*")))) + (set-buffer buf) + (erase-buffer) + (insert header "\n") + (set-process-filter + (apply 'start-process name buf program args) + 'net-utils-remove-ctrl-m-filter) + (display-buffer buf) + buf)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Wrappers for external network programs @@ -616,27 +616,22 @@ "Alist of services and associated TCP port numbers. This list is not complete.") -;; Workhorse macro -(defmacro run-network-program (process-name host port - &optional initial-string) - `(let ((tcp-connection) - (buf)) - (setq buf (get-buffer-create (concat "*" ,process-name "*"))) +;; Workhorse routine +(defun run-network-program (process-name host port &optional initial-string) + (let ((tcp-connection) + (buf)) + (setq buf (get-buffer-create (concat "*" process-name "*"))) (set-buffer buf) (or (setq tcp-connection - (open-network-stream - ,process-name - buf - ,host - ,port)) - (error "Could not open connection to %s" ,host)) + (open-network-stream process-name buf host port)) + (error "Could not open connection to %s" host)) (erase-buffer) (set-marker (process-mark tcp-connection) (point-min)) (set-process-filter tcp-connection 'net-utils-remove-ctrl-m-filter) - (and ,initial-string + (and initial-string (process-send-string tcp-connection - (concat ,initial-string "\r\n"))) + (concat initial-string "\r\n"))) (display-buffer buf))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;