Version 1.5
New features
-
Layouts can be stored in multiple directories and accessed by layout name
Layouts can now be accessed by layout name, instead of by file name, by using the commandspurpose-load-window-layout
,purpose-save-window-layout
,purpose-load-frame-layout
andpurpose-save-frame-layout
. The files used to store layout are named according to the formats<window-layout-name>.window-layout
and<frame-layout-name>.frame-layout
.
A new customizable variablepurpose-layout-dirs
specifies a list of directories in which to store layout files. Its default value is("~/.emacs.d/layouts/")
.
The oldpurpose-load-window-layout
,purpose-save-window-layout
,purpose-load-frame-layout
andpurpose-save-frame-layout
have been renamed topurpose-load-window-layou-file
,purpose-save-window-layout-file
,purpose-load-frame-layout-file
andpurpose-save-frame-layout-file
, and their behaviour has not changed. -
action
argument ofdisplay-buffer
andpop-to-buffer
functions is fully supported:
When theaction
argument ofdisplay-buffer
orpop-to-buffer
is used, Purpose will treat the function or list of functions specified by the action as an additional action sequence (called "user action sequence"). Purpose will try to use the sequence to display the buffer before trying the special action sequence or normal action sequence. -
New macros to change the purpose configuration temporarily:
New macrospurpose-save-purpose-config
,purpose-with-temp-purposes
,purpose-with-empty-purposes
andpurpose-with-additional-purposes
allow code to be executed with a different purpose configuration, and restore the previous purpose configuration afterwards. -
New macros to change the special display actions temporarily:
New macrospurpose-with-temp-display-actions
,purpose-with-temp-display-action
,purpose-with-additional-display-actions
andpurpose-with-additional-display-action
allow code to be executed with a different value forpurpose-special-display-actions
, and restore the previous value afterwards.For example, open
*Messages*
buffer in a new frame:(purpose-with-temp-purposes '(("*Messages*" . msg)) nil nil (purpose-with-temp-display-action '(msg purpose-display-pop-up-frame) (pop-to-buffer "*Messages*")))
New extension: purpose-x-kill
The purpose-x-kill extension hooks Purpose into the buffer-replacement mechanism that is triggered when a visible buffer is killed. The rules for deciding what to do with killed buffer's window are simple:
- If the window is buffer-dedicated, delete the window.
- If the window is purpose-dedicated, and there is another buffer with the same purpose, display that buffer in the window.
- If the window is purpose-dedicated, but there are no other buffers with the same purpose, delete the window.
- Otherwise, display any buffer in the window.
Integration with other packages
- Integration with which-key:
Give which-key its own purpose, don't interfere with how which-key opens its window. - Integration with Ivy:
Include workaround to ignoreforce-same-window
parameter inpurpose-switch-buffer
when called fromivy-switch-buffer
. This matches the way Purpose ignores theforce-same-window
parameter whenswitch-to-buffer
is called interactively.
Testing
Migrate to new Travis-CI infrastructure, builds should be faster now.