Tom Willemse
89d2b34ede
When asking the user for a desktop it is now easy to specify that the default should be the current desktop. - desktop-registry.el (desktop-registry-current-desktop): Add optional DEFAULT parameter which specifies the return value when `desktop-dirname' is `nil', instead of previously an empty string. (desktop-registry--completing-read): Add optional DEFAULT-CURRENT parameter which specifies that the current desktop should be the default when asking for a desktop. (desktop-registry-remove-desktop): (desktop-registry-rename-desktop): Use the current desktop as default when asking the user to select a desktop.
44 lines
1.6 KiB
Org Mode
44 lines
1.6 KiB
Org Mode
#+TITLE: Desktop registry
|
|
#+STARTUP: showall
|
|
|
|
After reading [[https://ericjmritz.wordpress.com/2013/05/28/emacs-desktops/][this post]] I started using =desktop.el= as a simple project
|
|
file-like system. The only problem was that remembering which desktops
|
|
were where and switching between them is bothersome. This module tries
|
|
to fix that.
|
|
|
|
* Installation
|
|
|
|
If you have [[http://marmalade-repo.org/][Marmalade]] set up you can just use:
|
|
|
|
: M-x package-install <RET> desktop-registry
|
|
|
|
* Usage
|
|
|
|
You can use =desktop-registry-prepend-directory= to add a new
|
|
directory to the registry, or
|
|
=desktop-registry-prepend-current-desktop= to add the currently loaded
|
|
desktop to the registry. If you enable
|
|
=desktop-registry-auto-register= it will automatically add new desktop
|
|
files to the registry when you use =desktop-save=.
|
|
|
|
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=.
|
|
|
|
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
|
|
currently loaded desktop into an org capture template.
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(add-to-list 'org-capture-templates
|
|
'("t" "Task" entry nil
|
|
"* TODO %? :%(desktop-registry-current-desktop \"\"):"))
|
|
#+END_SRC
|