From 823a28329776fb6b4d3eba8b1454258b90f70209 Mon Sep 17 00:00:00 2001 From: Michael W Date: Mon, 12 Sep 2011 10:33:54 -0600 Subject: [PATCH] Put the previously selected workgroup first wg-read-workgroup will now show the previously selected workgroup first instead of having them be sorted by name or whatever it is. This lets you just hit "enter" to go back to the previous one instead of C-z a all the time. --- workgroups.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/workgroups.el b/workgroups.el index 4dccd65..712015a 100644 --- a/workgroups.el +++ b/workgroups.el @@ -1471,7 +1471,12 @@ Query to overwrite if a workgroup with the same name exists." (defun wg-read-workgroup (&optional noerror) "Read a workgroup with `wg-completing-read'." (wg-get-workgroup - 'name (wg-completing-read "Workgroup: " (wg-names)) + 'name (wg-completing-read "Workgroup: " + (let ((prev (wg-previous-workgroup t))) + (if prev + (cons (wg-name prev) + (remq (wg-name prev) (wg-names))) + (wg-names)))) noerror)) (defun wg-read-buffer-name ()