emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/exwm 19515dc: Allow switching to a workspace by selecti


From: Chris Feng
Subject: [elpa] externals/exwm 19515dc: Allow switching to a workspace by selecting one X window on it
Date: Tue, 30 May 2017 12:16:13 -0400 (EDT)

branch: externals/exwm
commit 19515dc0749e820be5ec528c7a9a7bdceaac7c65
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    Allow switching to a workspace by selecting one X window on it
    
    * exwm-workspace.el (exwm-workspace-switch-to-buffer): Only allows it
    when `exwm-layout-show-all-buffers' is nil.
---
 exwm-workspace.el | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/exwm-workspace.el b/exwm-workspace.el
index 302e82e..8c22b7c 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -779,6 +779,8 @@ INDEX must not exceed the current number of workspaces."
         (xcb:flush exwm--connection)))
     (setq exwm-workspace--switch-history-outdated t)))
 
+(defvar exwm-layout-show-all-buffers)
+
 ;;;###autoload
 (defun exwm-workspace-switch-to-buffer (buffer-or-name)
   "Make the current Emacs window display another buffer."
@@ -818,8 +820,16 @@ INDEX must not exceed the current number of workspaces."
                 (select-frame-set-input-focus exwm--floating-frame)
                 (select-window (frame-root-window exwm--floating-frame)))
             ;; On another workspace.
-            (exwm-workspace-move-window exwm-workspace--current
-                                        exwm--id))
+            (if exwm-layout-show-all-buffers
+                (exwm-workspace-move-window exwm-workspace--current
+                                            exwm--id)
+              (let ((window (get-buffer-window buffer-or-name exwm--frame)))
+                (if window
+                    (set-frame-parameter exwm--frame
+                                         'exwm-selected-window window)
+                  (set-window-buffer (frame-selected-window exwm--frame)
+                                     buffer-or-name)))
+              (exwm-workspace-switch exwm--frame)))
         ;; Ordinary buffer.
         (switch-to-buffer buffer-or-name)))))
 



reply via email to

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