(setq buffer-file-coding-system 'no-conversion)
(insert (format-network-address
(process-contact server-process :local))
(setq buffer-file-coding-system 'no-conversion)
(insert (format-network-address
(process-contact server-process :local))
;; If there is an existing buffer modified or the file is
;; modified, revert it. If there is an existing buffer with
;; deleted file, offer to write it.
;; If there is an existing buffer modified or the file is
;; modified, revert it. If there is an existing buffer with
;; deleted file, offer to write it.
(obuf (get-file-buffer filen)))
(add-to-history 'file-name-history filen)
(if (and obuf (set-buffer obuf))
(obuf (get-file-buffer filen)))
(add-to-history 'file-name-history filen)
(if (and obuf (set-buffer obuf))
(let ((win (get-buffer-window next-buffer 0)))
(if (and win (not server-window))
;; The buffer is already displayed: just reuse the window.
(let ((win (get-buffer-window next-buffer 0)))
(if (and win (not server-window))
;; The buffer is already displayed: just reuse the window.
;; Otherwise, let's find an appropriate window.
(cond ((and (windowp server-window)
(window-live-p server-window))
;; Otherwise, let's find an appropriate window.
(cond ((and (windowp server-window)
(window-live-p server-window))
(switch-to-buffer next-buffer)
;; After all the above, we might still have ended up with
;; a minibuffer/dedicated-window (if there's no other).
(switch-to-buffer next-buffer)
;; After all the above, we might still have ended up with
;; a minibuffer/dedicated-window (if there's no other).