summaryrefslogtreecommitdiff
path: root/lisp/net/socks.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2007-08-23 18:36:07 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2007-08-23 18:36:07 +0000
commit8d559559ce2af88493855cf3a46b299b46ef0846 (patch)
treeae53edf93f28d41178669b964da755ffd31d0ca3 /lisp/net/socks.el
parent67d0660b15f4e7d716881ac5b9192a1a17c4e4f9 (diff)
downloademacs-8d559559ce2af88493855cf3a46b299b46ef0846.tar.gz
(socks-username/password-auth-filter):
Remove unused vars `state' and `desired-len'. (socks-parse-services, socks-nslookup-host): Use with-current-buffer. (socks-wait-for-state-change): Use new-style backquotes.
Diffstat (limited to 'lisp/net/socks.el')
-rw-r--r--lisp/net/socks.el21
1 files changed, 8 insertions, 13 deletions
diff --git a/lisp/net/socks.el b/lisp/net/socks.el
index 72f6b03570b..5a2364c652c 100644
--- a/lisp/net/socks.el
+++ b/lisp/net/socks.el
@@ -263,10 +263,9 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
(defconst socks-state-connected 4)
(defmacro socks-wait-for-state-change (proc htable cur-state)
- (`
- (while (and (= (gethash 'state (, htable)) (, cur-state))
- (memq (process-status (, proc)) '(run open)))
- (accept-process-output (, proc) socks-timeout))))
+ `(while (and (= (gethash 'state ,htable) ,cur-state)
+ (memq (process-status ,proc) '(run open)))
+ (accept-process-output ,proc socks-timeout)))
(defun socks-filter (proc string)
(let ((info (gethash proc socks-connections))
@@ -493,10 +492,9 @@ version.")
(if (not (and (file-exists-p socks-services-file)
(file-readable-p socks-services-file)))
(error "Could not find services file: %s" socks-services-file))
- (save-excursion
- (clrhash socks-tcp-services)
- (clrhash socks-udp-services)
- (set-buffer (get-buffer-create " *socks-tmp*"))
+ (clrhash socks-tcp-services)
+ (clrhash socks-udp-services)
+ (with-current-buffer (get-buffer-create " *socks-tmp*")
(erase-buffer)
(insert-file-contents socks-services-file)
;; Nuke comments
@@ -566,10 +564,8 @@ version.")
(defconst socks-username/password-auth-version 1)
(defun socks-username/password-auth-filter (proc str)
- (let ((info (gethash proc socks-connections))
- state desired-len)
+ (let ((info (gethash proc socks-connections)))
(or info (error "socks-filter called on non-SOCKS connection %S" proc))
- (setq state (gethash 'state info))
(puthash 'scratch (concat (gethash 'scratch info) str) info)
(if (< (length (gethash 'scratch info)) 2)
nil
@@ -629,8 +625,7 @@ version.")
socks-nslookup-program host))
(res host))
(set-process-query-on-exit-flag proc nil)
- (save-excursion
- (set-buffer (process-buffer proc))
+ (with-current-buffer (process-buffer proc)
(while (progn
(accept-process-output proc)
(memq (process-status proc) '(run open))))