@@ -1081,16 +1081,6 @@ of `eaf--buffer-app-name' inside the EAF buffer."
10811081 (symbol-name command)
10821082 `(quote , command ))))
10831083
1084- (defun eaf-focus-buffer (focus-buffer-id )
1085- " Focus the buffer given the FOCUS-BUFFER-ID."
1086- (catch 'found-eaf
1087- (eaf-for-each-eaf-buffer
1088- (when (string= eaf--buffer-id focus-buffer-id)
1089- (let ((buffer-window (get-buffer-window buffer 'visible )))
1090- (when buffer-window
1091- (select-window buffer-window)))
1092- (throw 'found-eaf t )))))
1093-
10941084(defun eaf-get-buffer (buffer-id )
10951085 " Find the buffer given the BUFFER-ID."
10961086 (catch 'found-eaf
@@ -1099,6 +1089,12 @@ of `eaf--buffer-app-name' inside the EAF buffer."
10991089 (throw 'found-eaf buffer))
11001090 nil )))
11011091
1092+ (defun eaf-focus-buffer (buffer-id )
1093+ " Focus the buffer given the BUFFER-ID."
1094+ (let* ((buffer (eaf-get-buffer buffer-id))
1095+ (window (if buffer (get-buffer-window buffer 'visible ) nil )))
1096+ (when window (select-window window) t )))
1097+
11021098(defun eaf--show-message (format-string )
11031099 " A wrapper around `message' that prepend [EAF/app-name] before FORMAT-STRING."
11041100 (let ((fmt (if eaf--buffer-app-name
@@ -1123,13 +1119,10 @@ and does not log to the *Message* buffer."
11231119 " Set Lisp variable NAME with VALUE on the Emacs side."
11241120 (set (intern name) value))
11251121
1126- (defun eaf-request-kill-buffer (kill-buffer-id )
1127- " Function for requesting to kill the given buffer with KILL-BUFFER-ID."
1128- (catch 'found-eaf
1129- (eaf-for-each-eaf-buffer
1130- (when (string= eaf--buffer-id kill-buffer-id)
1131- (kill-buffer buffer)
1132- (throw 'found-eaf t )))))
1122+ (defun eaf-request-kill-buffer (buffer-id )
1123+ " Function for requesting to kill the given buffer with BUFFER-ID."
1124+ (let* ((buffer (eaf-get-buffer buffer-id)))
1125+ (when buffer (kill-buffer buffer) t )))
11331126
11341127(defun eaf--first-start (eaf-epc-port )
11351128 " Call `eaf--open-internal' upon receiving `start_finish' signal from server.
0 commit comments