aboutsummaryrefslogtreecommitdiff
path: root/connection.el
diff options
context:
space:
mode:
authorTorsten Hilbrich <torsten.hilbrich@gmx.net>2013-07-03 04:59:40 +0200
committerTorsten Hilbrich <torsten.hilbrich@gmx.net>2013-07-03 05:46:26 +0200
commit32710f7bd81e529e2ff370c04a63b47521425cff (patch)
tree40de62468b31a932d2c601964a4aa8763de2b7fe /connection.el
parentba4a47055cbd6953644ad742ee9799e3dbfde5ea (diff)
connection: Use with-current-buffer
This is now prefered to using a combination of save-excursion and set-buffer.
Diffstat (limited to 'connection.el')
-rwxr-xr-xconnection.el9
1 files 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))