Skip to content

Version 1.5

Compare
Choose a tag to compare
@bmag bmag released this 13 Feb 13:22
· 109 commits to master since this release

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 commands purpose-load-window-layout, purpose-save-window-layout, purpose-load-frame-layout and purpose-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 variable purpose-layout-dirs specifies a list of directories in which to store layout files. Its default value is ("~/.emacs.d/layouts/").
    The old purpose-load-window-layout, purpose-save-window-layout, purpose-load-frame-layout and purpose-save-frame-layout have been renamed to purpose-load-window-layou-file, purpose-save-window-layout-file, purpose-load-frame-layout-file and purpose-save-frame-layout-file, and their behaviour has not changed.

  • action argument of display-buffer and pop-to-buffer functions is fully supported:
    When the action argument of display-buffer or pop-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 macros purpose-save-purpose-config, purpose-with-temp-purposes, purpose-with-empty-purposes and purpose-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 macros purpose-with-temp-display-actions, purpose-with-temp-display-action, purpose-with-additional-display-actions and purpose-with-additional-display-action allow code to be executed with a different value for purpose-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 ignore force-same-window parameter in purpose-switch-buffer when called from ivy-switch-buffer. This matches the way Purpose ignores the force-same-window parameter when switch-to-buffer is called interactively.

Testing

Migrate to new Travis-CI infrastructure, builds should be faster now.