From e5122febe89668170639e9648233811fd8cef3b4 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 7 Aug 2013 15:19:06 +0200 Subject: [PATCH] Change prompts when selecting a desktop --- NEWS | 2 ++ desktop-registry.el | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 7053a7f..d8e1851 100644 --- a/NEWS +++ b/NEWS @@ -10,3 +10,5 @@ the currently loaded desktop. - Add =desktop-registry-rename-desktop= command to rename a desktop. + + - Specify prompts for each action that wants a desktop selected. diff --git a/desktop-registry.el b/desktop-registry.el index c4393b2..a937b0d 100644 --- a/desktop-registry.el +++ b/desktop-registry.el @@ -79,15 +79,16 @@ Returns an empty string when `desktop-dirname' is nil." (error "No desktop loaded")) (desktop-registry-add-directory desktop-dirname)) -(defun desktop-registry--completing-read () +(defun desktop-registry--completing-read (&optional prompt) "Ask the user to pick a desktop directory." - (completing-read "Directory: " desktop-registry-registry nil nil - nil 'desktop-registry--history)) + (let ((prompt (or prompt "Desktop: "))) + (completing-read prompt desktop-registry-registry nil nil nil + 'desktop-registry--history))) ;;;###autoload (defun desktop-registry-remove-desktop (desktop) "Remove DESKTOP from the desktop registry." - (interactive (list (desktop-registry--completing-read))) + (interactive (list (desktop-registry--completing-read "Remove: "))) (let ((spec (assoc desktop desktop-registry-registry))) (if spec (customize-save-variable @@ -98,7 +99,7 @@ Returns an empty string when `desktop-dirname' is nil." ;;;###autoload (defun desktop-registry-rename-desktop (old new) "Rename DESKTOP." - (interactive (list (desktop-registry--completing-read) + (interactive (list (desktop-registry--completing-read "Rename: ") (read-string "to: "))) (let ((spec (assoc old desktop-registry-registry))) (if (not spec) @@ -110,7 +111,7 @@ Returns an empty string when `desktop-dirname' is nil." ;;;###autoload (defun desktop-registry-change-desktop (name) "Change to the desktop named NAME." - (interactive (list (desktop-registry--completing-read))) + (interactive (list (desktop-registry--completing-read "Switch to: "))) (desktop-change-dir (cdr (assoc name desktop-registry-registry)))) ;;;###autoload