Add +workspace/other #1480

- Rename +workspace/switch-to-last to +workspace/switch-to-final, to
  avoid ambiguity.
- Add +workspace/switch-to-N commands
This commit is contained in:
Henrik Lissner 2019-06-11 16:09:29 +02:00
parent 6b6ea699f4
commit bc6c4b3e37
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 36 additions and 24 deletions

View file

@ -327,11 +327,22 @@ end of the workspace list."
('error (+workspace-error (cadr ex) t))))
;;;###autoload
(defun +workspace/switch-to-last ()
"Switch to the last workspace."
(dotimes (i 9)
(fset (intern (format "+workspace/switch-to-%d" i))
(lambda () (interactive) (+workspace/switch-to i))))
;;;###autoload
(defun +workspace/switch-to-final ()
"Switch to the final workspace in open workspaces."
(interactive)
(+workspace/switch-to (car (last (+workspace-list-names)))))
;;;###autoload
(defun +workspace/other ()
"Switch to the last activated workspace."
(interactive)
(+workspace/switch-to +workspace--last))
;;;###autoload
(defun +workspace/cycle (n)
"Cycle n workspaces to the right (default) or left."