Add desktop-registry-remove-desktop
- desktop-registry.el (desktop-registry--completing-read): (desktop-registry-remove-desktop): New functions. (desktop-registry-change-desktop): Use `desktop-registry--completing-read' to interactively ask the user which desktop to switch to.
This commit is contained in:
parent
e2807445bb
commit
131cd421c0
3 changed files with 27 additions and 3 deletions
7
NEWS
Normal file
7
NEWS
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: org; -*-
|
||||
#+STARTUP: showall
|
||||
|
||||
* Development
|
||||
|
||||
- Add =desktop-registry-remove-desktop= command to remove desktops you
|
||||
no longer (want to) use.
|
|
@ -24,3 +24,6 @@ to fix that.
|
|||
To switch between desktops you can use
|
||||
=desktop-registry-change-desktop=, this will prompt (with completion)
|
||||
for the directory you would like to load.
|
||||
|
||||
When you're done with a desktop or want to get rid of a desktop for
|
||||
another reason you can use =desktop-registry-remove-desktop=.
|
||||
|
|
|
@ -63,12 +63,26 @@
|
|||
(error "No desktop loaded"))
|
||||
(desktop-registry-add-directory desktop-dirname))
|
||||
|
||||
(defun desktop-registry--completing-read ()
|
||||
"Ask the user to pick a desktop directory."
|
||||
(completing-read "Directory: " 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)))
|
||||
(let ((spec (assoc desktop desktop-registry-registry)))
|
||||
(if spec
|
||||
(customize-save-variable
|
||||
'desktop-registry-registry
|
||||
(delete spec desktop-registry-registry))
|
||||
(error "Unknown desktop: %s" desktop))))
|
||||
|
||||
;;;###autoload
|
||||
(defun desktop-registry-change-desktop (name)
|
||||
"Change to the desktop named NAME."
|
||||
(interactive
|
||||
(list (completing-read "Directory: " desktop-registry-registry nil nil
|
||||
nil 'desktop-registry--history)))
|
||||
(interactive (list (desktop-registry--completing-read)))
|
||||
(desktop-change-dir (cdr (assoc name desktop-registry-registry))))
|
||||
|
||||
;;;###autoload
|
||||
|
|
Loading…
Reference in a new issue