emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/net/socks.el,v [EMACS_22_BASE]


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/net/socks.el,v [EMACS_22_BASE]
Date: Thu, 23 Aug 2007 18:36:08 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Stefan Monnier <monnier>        07/08/23 18:36:08

Index: socks.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/socks.el,v
retrieving revision 1.3.2.3
retrieving revision 1.3.2.4
diff -u -b -r1.3.2.3 -r1.3.2.4
--- socks.el    25 Jul 2007 04:25:42 -0000      1.3.2.3
+++ socks.el    23 Aug 2007 18:36:07 -0000      1.3.2.4
@@ -263,10 +263,9 @@
 (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 @@
   (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*"))
+  (with-current-buffer (get-buffer-create " *socks-tmp*")
     (erase-buffer)
     (insert-file-contents socks-services-file)
     ;; Nuke comments
@@ -566,10 +564,8 @@
 (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 @@
                                 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))))




reply via email to

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