diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org> | 2019-03-14 15:34:25 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org> | 2019-03-14 18:19:32 -0400 |
| commit | 66eb1fcecb94ef588196602a02880b503ad72eeb (patch) | |
| tree | 714e5459775a05414c23abdaa637e8408e63ec84 /exwm-buffer-groups.el | |
| parent | aff6486f4766bf0b4614cb97e1538201aa04cfab (diff) | |
Implement exwm-buffer-groups-switch-buffer
Diffstat (limited to 'exwm-buffer-groups.el')
| -rw-r--r-- | exwm-buffer-groups.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/exwm-buffer-groups.el b/exwm-buffer-groups.el index 4702033..ca416cb 100644 --- a/exwm-buffer-groups.el +++ b/exwm-buffer-groups.el @@ -72,6 +72,22 @@ current workspace." (exwm-buffer-groups--remove-buffers) (exwm-buffer-groups--add-buffers)) +(defun exwm-buffer-groups-switch-buffer (buffer-or-name) + "Display buffer BUFFER-OR-NAME in the selected window. +If called interactively, read the buffer name using +`completing-read', completing only on buffers in the current +workspace." + (interactive + (list + (let ((buffers-in-workspace (map 'list + #'buffer-name + (elt exwm-buffer-groups-buffers + exwm-workspace-current-index))) + (current-buffer (buffer-name (other-buffer (current-buffer))))) + (completing-read "Switch to buffer: " buffers-in-workspace + nil nil nil nil current-buffer)))) + (switch-to-buffer buffer-or-name)) + (defun exwm-buffer-groups-move (nth) "Moves the current buffer to the NTH workspace." (interactive |