Releases: bmag/emacs-purpose
Version 1.8.1
Version 1.8
Breaking Changes
-
#144: purpose-x-magit extension: replace
magit
purpose withMagit
When using the purpose-x-magit extension viapurpose-x-magit-single-on
, the extension no longer defines amagit
purpose. Instead it defines an identical purpose namedMagit
. This way, the purpose can be used as a condition inpurpose-special-action-sequences
.Those who use purpoxe-x-magit via
purpose-x-magit-multi-on
are not affected by this change.
Enhancements
-
#172: Rework Travis CI tests configuration and add Emacsen up to 27.1
-
#149, #152: Lower memeory usage when calculating a buffer's purpose
Bug Fixes
-
#182: Prevent
debug
command from bypassing purpose -
#166, #180: Toggle integration fixes when
purpose-mode
is toggled
Previously, the integration fixes would remain active even whenpurpose-mode
was disabled, disrupting the normal display behavior of integrated packages and features. -
#153, #177: purpose-x-popwin extension: quit-window closes popup window when no previous buffers can be shown in it
-
#171: Reimplement
whitespace-display-window
using purposes
Originalwhitespace-display-window
doesn't go throughdisplay-buffer
, thus disregardingwindow-purpose
entirely. -
#170: Reimplement
edebug-pop-to-buffer
using purposesOriginal
edebug-pop-to-buffer
doesn't go throughdisplay-buffer
, thus disregardingwindow-purpose
entirely. -
#169: Prevent Isearch help commands from bypassing purpose
-
#168: purpose-x-magit extension: prevent
magit-display-buffer-function
from bypassing purpose -
#167: Prevent
next-error
from bypassing purpose -
#166: Properly format defcustom package-version
-
#133: Neotree fix honors
neo-window-position
-
#137:
purpose-change-buffer
to ignorededicated
argument in new Emacsen
As of Emacs 27.0.50, the functionwindow--display-buffer
no longer accepts adedicated
argument, and instead relies onalist
anddisplay-buffer-mark-dedicated
to decide dedication state of the window. As result,purpose-change-buffer
ignores thededicated
argument when using Emacs version 27 or newer. Older Emacs versions are not affected. -
#134: add support for Zone
-
#78 (comment) purpose-x-persp extension:
persp-curr
is now a function
Version 1.7
Breaking Changes
- removed support for Emacs 24.3
Supported versions are Emacs 24.4 and newer (up to 26.1 at the time of writing). The branchrelease-1.6
will continue to support Emacs 24.3 and is available for those who need it. No development or bug fixes are planned for this branch, but pull requests will be accepted.
Bug Fixes
- #116: honor
display-buffer-mark-dedicated
Version 1.6.1
Breaking Changes
-
#84, #125: remove option
purpose-preferred-prompt
and prompts shims.
Removedcompleting-read
andread-file-name
shims, thus the
custom variablepurpose-preferred-prompt
has been removed. From the README:In the past, the variable
purpose-preferred-prompt
, allowed you to choose whether you want Purpose to use IDO or Helm when it needs information from the user. This variable has been removed.
Instead, the prompt relies on the normal mechanism. For Helm prompts enablehelm-mode
, for Ivy mode enableivy-mode
, for IDO prompts enableido-mode
, etc. If usingido-mode
, note that because how IDO works it doesn't cover all commands, and some commands won't have an IDO prompt. To work around that, please see the package ido-completion-read+ (formerly ido-ubiquitous).
Enhancements
- #113, #114: default to
editpurpose for buffers visiting files
If a buffer is visiting a file, its default purpose (if no other
purpose matches) will beedit
. - Emacsen 25.1, 25.3 and 26.1 added to Travis CI tests
Emacs 25.2 not added, because it is almost exactly the same as
25.3, and the difference doesn't affect Purpose's behavior.
Bug Fixes
- added some missing default purposes for some modes
- css-mode: edit
- eshell-mode, term-mode: terminal
- #110: wrong window layout after using magit-popup's help system
Added a fix inwindow-purpose-fixes.el
. - #111: wrong layout when using org-goto
Added a fix inwindow-purpose-fixes.el
. - #123 purpose-x-popwin: fix custom type mismatches
- #127, #128: purpose-x-code1: correctly create and display dired buffer
- #118: fix typos in README
- #121: prefer the selected window even with multiple frames
- #120: pop-up-frames takes precedence over pop-up-windows
Version 1.6
New Features
- New functions for easier purpose configuration
User purposes:purpose-add-user-purposes
,purpose-remove-user-purposes
.
Extension purposes:purpose-add-extension-purposes
,purpose-remove-extension-purposes
- Added Purpose menu to the menu-bar
Enhancements
- Purpose ships with preinstalled layouts
Subdirectorylayouts
contains preinstalled layouts. Customizable variablepurpose-use-built-in-layouts
controls if those layouts are available to the user (available by default). purpose-window-with-purpose
now takes optional frame argument
Defaults to the selected frame.
Bug Fixes
- #79: nil buffer means
other-buffer
for some buffer switching commands
These commands are:purpose-switch-buffer
,purpose-switch-buffer-other-window
,purpose-pop-buffer
andpurpose-pop-buffer-same-window
. - dislpay function returning
fail
means don’t display buffer at all - #80: added autoloads to some commands outside of window-purpose.el
- fixed argument order for purpose--remove-suffix in Emacs 24.3 and 24.4
- #95: loading layouts to show different buffers
purpose-set-window-layout
places different buffers of the same purpose, if the layout has multiple windows with same purpose. Previously, all windows with the purpose would show the same buffer after loading a layout. This affects all layout-loading commands.
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.
Version 1.4
Core changes
- New user option to choose IDO or Helm prompts:
Customizable variablepurpose-preferred-prompt
lets the user decide which
prompts Purpose should use. Available options:auto
(the default): Use IDO ifido-mode
is enabled, otherwise use Helm if
helm-mode
is enabled, otherwise use default Emacs prompts ("vanilla").ido
: IDOhelm
: Helmvanilla
: default Emacs prompts
- New command:
purpose-set-window-purpose
:
New commandpurpose-set-window-purpose
allows user to change the purpose of
the current window. The window's buffer is changed accordingly. - Improved mode-line display of window's dedication status:
"#" means window is dedicated to its buffer, "!" means window is dedicated to
its purpose. Examples:[edit]
: window hasedit
purpose and is not dedicated.[edit!]
: window hasedit
purpose and is dedicated to its current purpose.[edit#]
: window hasedit
purpose and is dedicated to its current buffer.[edit!#]
: window hasedit
purpose and is dedicated to its current purpose
and to its current buffer.
- Don't force same window when
switch-to-buffer
is called interactively:
Normally, executing commandswitch-to-buffer
implies that if the chosen buffer
can't be disaplyed in the current window, don't display it at all. Purpose
does allow the buffer to be displayed in another window, if the current window
is not available.
Doesn't change the behavior ofswitch-to-buffer
when called non-interactively. - New option for
purpose-display-fallback
:
purpose-display-fallback
can be set to a function. In such case, it should a
display function: a function that receives two arguments - BUFFER to display and
an ALIST, displays the buffer in some window and returns that window. See
display-buffer
for more info. - More accurate restoration of windows' width when loading a window layout:
When saving and loading window layouts,window-total-width
is used instead
window-width
, resulting in a more accurate layout when loading a previously
saved layout. For completeness,window-total-height
replacedwindow-height
as well, though that doesn't seem to have changed anything. - Better handling of the minibuffer:
The minibuffer was given its own purpose, and several functions were modified to
handle the minibuffer better. - Changed
purpose-get-extra-window-params-function
topurpose-get-extra-window-params-functions
:
The hookpurpose-get-extra-window-params-function
was changed so it can hold
several functions instead of just one, and was renamed accordingly. Modify this
variable viaadd-hook
andremove-hook
. - New function:
purpose-get-all-purposes
:
New functionpurpose-get-all-purposes
returns a list of all defined purposes.
Thanks to @jinnovation . - Made window parameter
purpose-dedicated
a persistent parameter:
Matters forwindow-state-get
andwindow-state-put
. Should help with saving
and loading the window layout through external packages.
Miscellaneous changes
- Deleted obsolete files purpose.el and purpose-x.el:
These files weren't used since version 1.3. - New tests and better test coverage
Integration with other packages
- Integration with Popwin:
Stop Purpose from interfering with Popwin when Popwin creates a popup window. - Integration with guide-key:
Give guide-key its own purpose, so other buffers don't reuse guide-key's window. - Integration with NeoTree:
Fix for creating NeoTree's window in the correct place in the frame. - Integration with Hydra:
Changed the fix for Hydra's LV window, so the fix is loaded afterlv
is
loaded, rather than afterhydra
is loaded.
Extensions
- Improved Code1 extension:
- Better detection of when the selected window has changed.
- Dired buffers are buried automatically, so they don't show up first when
switching buffers.
- New extension for enhancing perspectives:
See perspective extension.- Commands for switching to a buffer in the current perspective with the same
purpose as the current buffer. - Enable different purpose configurations for different perspectives.
- Commands for switching to a buffer in the current perspective with the same
- New extension for popup windows (simple popwin emulation):
See popwin extension.popup
purpose for showing buffers in a dedicated popup window.- Automatic and manual closing of popup windows.
- Commands to make the popup window "stick" and "unsticked". A "sticked" window
is not closed automatically. - Use function
purpose-x-popwin-popupify
to treat purposes as popup. Different
"popupified" purposes serve as different kinds of popup windows.
Version 1.3
Summary of Version 1.3
Version 1.3 improves Purpose in several ways.
First, Purpose's package was renamed to "window-purpose" , and Purpose now uses autoloads and automatic tests.
Second, Purpose has some new extensions and features, such as Code1 extension, new display functions and new user commands.
Third, a few bugs have been fixed and integration with several other packages has been introduced. Among these packages are Helm, Magit and Hydra.
See below for a full list of changes.
Next Release
The plan for Purpose's next version is to focus on integrating Purpose with other packages. Packages that do their own kind of window management will probably need special care to make them work with Purpose.
One such notable package is Helm. Currently, Purpose has basic support for Helm that should work fine, but they may be some rough edges. Purpose's support for Helm should be improved in the next version.
Reporting issues and contributing will help significantly, so feel free.
Important changes:
- Renamed package: The package was renamed from "purpose" to "window-purpose". The source files were renamed as well, but the symbols themselves remain unchanged.
Hopefully this will help users to find the package, without causing too much trouble for existing users.
Changes
Integration changes and extensions:
- Integration with Helm and IDO: Purpose works reasonably with Helm. The issue where Purpose would call IDO functions instead of regular functions is resolved: when
ido-mode
is enabled, Purpose will use IDO. Otherwise, ifhelm-mode
is enabled, Purpose will use Helm.
There may still be some issues with using Purpose and Helm together, I plan to fully integrate Purpose and Helm in the next release. Reporting issues and any other help is welcome.
Purpose continues to support IDO fully. - Integration with Magit: For users of Magit, two different purpose configurations are available. One configuration gives the same purpose to all Magit buffers, while the other purpose gives a unique purpose for each Magit major mode. To activate, use command
purpose-x-magit-single-on
orpurpose-x-magit-multi-on
. To deactivate, use commandpurpose-x-magit-off
.
See Extensions. - Integration with Hydra (issue #31): Fixed issue with Hydra's popup window displaying in the wrong place.
- Integration with golden-ratio-mode: For users of golden-ratio-mode, proper integration with Purpose is activated by command
purpose-x-golden-ratio-setup
and deactivated by commandpurpose-x-golden-ratio-unset
.
See Extensions. - New extension: Code1: Code1 is an extension that provides a window layout with one main dedicated edit window, and 3 dedicated side windows (dired, ibuffer, imenu-list). Activate with command
purpose-x-code1-setup
, deactivate withpurpose-x-code1-unset
. This extension is not fully developed, so sometimes the dired buffer doesn't update.
See Extensions. - New extensions combining popup-switcher and purpose-switch-buffer-with-purpose: command
purpose-x-psw-switch-buffer-with-purpose
uses popup-switcher's interface to switch to a buffer with the same purpose as the current buffer. popup-switcher needs to be installed separately.
See Extensions.
User interface and API changes:
- New commands and key bindings:
C-c , 1
:purpose-delete-non-dedicated-windows
C-c , w
:purpose-delete-window-at
- delete window at top/bottom/left/right (depends on prefix argument)
C-c , b
:purpose-switch-buffer-with-purpose
C-c , 4 b
:purpose-switch-buffer-with-purpose-other-window
C-c , 5 b
:purpose-switch-buffer-with-purpose-other-frame
- New functions and commands for handling windows at edges (issue #32):
- Get functions:
purpose-get-top-window
,purpose-get-left-window
, etc. - Display functions:
purpose-display-at-top
,purpose-display-at-left
, etc. - Delete functions:
purpose-delete-window-at-top
,purpose-delete-window-at-left
, etc.
- Get functions:
- Renaming of variables and functions:
purpose-default-action-sequence
-->purpose-default-action-order
purpose--change-buffer
-->purpose-change-buffer
purpose-display-buffer-hook
-->purpose-display-buffer-functions
- New hook: purpose-display-buffer-functions: The hook
purpose-display-buffer-functions
runs after Purpose displayed a buffer (runs at the end ofpurpose--action-function
, if display was successful). - New options for purpose-display-fallback: value
nil
forpurpose-display-fallback
means to fallback to Emacs' originaldisplay-buffer
function when Purpose can't display a buffer. Valueerror
means to signal an error. Other possible values arepop-up-window
(the default) andpop-up-frame
.
General changes:
- Automatic tests: Purpose gained automatic tests through Travis CI.
- Error with eager macro expansion is fixed (issue #35)
- Purpose now uses autoloads
- Fixed bug with compilation-next-error-function (issue #17)
Plans for the future:
- Integration with other packages: I plan to make Purpose work well with other packages. Packages that do their own window management will probably need special care (e.g. Helm, Popwin). Reporting issues and contributing would help significantly, so feel free.
...
Version 1.2
Important Changes:
- The purpose configuration system has been redone. The configuration now has 3 layers: user settings, extensions settings, and default settings.
Users can configure purposes through customize. Extensions can configure purposes throughpurpose-conf
objects andpurpose-set-exended-configuration
function.
See the wiki for more details. - Purpose is now customizable. User-relevant variables can be changed via
customize
(group "purpose"). - Purpose is now compatible with Emacs 24.3, and probably some older versions as well.
User-Interface Changes:
- New functions:
purpose-reset-window-layout
andpurpose-reset-frame-layout
restore the layout to the previously loaded window layout or frame layout, respectively. - New function:
purpose-switch-buffer-with-purpose
is likepurpose-switch-buffer
, but only buffers with the same purpose as the current one are offered. You can call it withC-u C-u C-x b
.
Similar functionspurpose-switch-buffer-with-purpose-other-window
andpurpose-switch-buffer-with-purpose-other-frame
also exist. - New fallback behavior for displaying a buffer: pop-up-window instead of pop-up-frame.
- New variable:
purpose-special-action-sequences
lets you define special display behaviors for specific purposes.
General Changes:
- Purpose now uses lexical bindings.
purpose-set-window-layout
andpurpose-set-frame-layout
optionally save the loaded layout inpurpose-mru-window-layout
andpurpose-mru-frame-layout
. MRU stands for "most recently used".- Code uses
purpose-message
instead ofmessage
for debugging. Variablepurpose-message-on-p
togglespurpose-message
on and off (default is off).
Bug Fixes:
- When loading layouts (
purpose-set-window-layout
) with a window that was split at least twice in the same direction, all windows except the first one were loaded in the reverse order. This bug was fixed. - purpose-display-pop-up-window would use an existing window and ignore purposes, instead of creating a new window. This bug was fixed (
display-buffer-pop-up-window
is no longer used).
Fixes for v1.1
v1.1.1 important fix and a cool extension