From 32710f7bd81e529e2ff370c04a63b47521425cff Mon Sep 17 00:00:00 2001 From: Torsten Hilbrich Date: Wed, 3 Jul 2013 04:59:40 +0200 Subject: connection: Use with-current-buffer This is now prefered to using a combination of save-excursion and set-buffer. --- connection.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/connection.el b/connection.el index 6df78d6..2b0e432 100755 --- a/connection.el +++ b/connection.el @@ -66,8 +66,7 @@ A data structure identifing the connection is returned" server port))) (process)) - (save-excursion - (set-buffer process-buffer) + (with-current-buffer process-buffer (setq process (open-network-stream "connection" process-buffer server port)) (connection-create-data process-buffer process (point-min))))) @@ -110,8 +109,7 @@ nil: argument is no connection object "Send `data' to the process." (unless (eq (connection-status connection) 'up) (error "Connection is not up")) - (save-excursion - (set-buffer (connection-buffer connection)) + (with-current-buffer (connection-buffer connection) (goto-char (point-max)) (connection-set-read-point connection (point)) (process-send-string (connection-process connection) data))) @@ -126,8 +124,7 @@ nil: argument is no connection object (error "Connection is not up")) (let ((case-fold-search nil) match-end) - (save-excursion - (set-buffer (connection-buffer connection)) + (with-current-buffer (connection-buffer connection) (goto-char (connection-read-point connection)) ;; Wait until there is enough data (while (not (search-forward-regexp delimiter nil t)) -- cgit v1.2.3