Add desktop-registry-rename-desktop
* desktop-registry.el (desktop-registry-rename-desktop): New function.
This commit is contained in:
parent
395277047e
commit
2fffd8cc37
3 changed files with 18 additions and 0 deletions
2
NEWS
2
NEWS
|
@ -8,3 +8,5 @@
|
|||
|
||||
- Add =desktop-registry-current-desktop= function to get the name of
|
||||
the currently loaded desktop.
|
||||
|
||||
- Add =desktop-registry-rename-desktop= command to rename a desktop.
|
||||
|
|
|
@ -28,6 +28,10 @@ to fix that.
|
|||
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=.
|
||||
|
||||
If you've registered a desktop and you don't like what it made of
|
||||
the name you can use =desktop-registry-rename-desktop= to give it a
|
||||
new name.
|
||||
|
||||
** With org-capture-templates
|
||||
|
||||
The =desktop-registry-current-desktop= can be used to insert the
|
||||
|
|
|
@ -95,6 +95,18 @@ Returns an empty string when `desktop-dirname' is nil."
|
|||
(delete spec desktop-registry-registry))
|
||||
(error "Unknown desktop: %s" desktop))))
|
||||
|
||||
;;;###autoload
|
||||
(defun desktop-registry-rename-desktop (old new)
|
||||
"Rename DESKTOP."
|
||||
(interactive (list (desktop-registry--completing-read)
|
||||
(read-string "to: ")))
|
||||
(let ((spec (assoc old desktop-registry-registry)))
|
||||
(if (not spec)
|
||||
(error "Unknown desktop: %s" old)
|
||||
(setf (car spec) new)
|
||||
(customize-save-variable 'desktop-registry-registry
|
||||
desktop-registry-registry))))
|
||||
|
||||
;;;###autoload
|
||||
(defun desktop-registry-change-desktop (name)
|
||||
"Change to the desktop named NAME."
|
||||
|
|
Loading…
Reference in a new issue