Commit Graph

113 Commits

Author SHA1 Message Date
Henrik Lissner
24b40824ce
Add doom-{visible,buried}-buffer-p predicates 2019-07-18 13:13:31 +02:00
Henrik Lissner
9a02bd8ac8
Minor refactors across the board
- when-let* -> when-let
- Fix projectile-locate-dominating-file for connected remote files
2019-06-26 14:31:06 +02:00
Siddharth Shekar
aa64cf9426 Replace kill-this-buffer with kill-current-buffer
As per the documentation for kill-this-buffer, it should only be invoked
from the menu and behaves unpredictably when invoked programmatically.
2019-05-30 18:54:58 -07:00
Henrik Lissner
863fc1a6bb
Add buffer-live-p check to doom-real-buffer-p 2019-04-17 11:29:41 -04:00
Andrew Whatson
fe6dfb08b6 Add doom/kill-project-buffers command
Prompts for an open project and kills all its buffers.  This is useful
for closing `.emacs.d` in an effort to get some *billable* work done.

Added `doom-fixup-windows` and `doom-kill-buffer(s)-fixup-windows`
helper functions for leaving affected windows on a real buffer or the
fallback buffer.

Fixed `doom/kill-this-buffer-in-all-windows` to properly "fixup"
windows.
2019-04-05 16:04:26 +10:00
Henrik Lissner
259590d54e
Remove doom|protect-visible-buffer
This behavior is now isolated to kill-this-buffer.
2019-03-16 23:59:50 -04:00
Andrew Whatson
a086e6967e Fixes for doom/kill-this-buffer-in-all-windows
This was erroring when run inside a popup (eg. `M-x ielm` `C-x k`) due
to a missing check for `window-live-p`.  We don't need to do anything if
the window has already gone away.

The real vs unreal check was backwards; we should only try
`previous-buffer` if the current buffer is *not* real.
2019-03-17 00:53:17 +10:00
Henrik Lissner
a05b1877be
Rewrite switch-{buffer,window} hooks
+ Add doom-switch-frame-hook
+ Replace doom-{enter,exit}-{buffer,window}-hook with
  doom-switch-{buffer,window}-hook
+ New switch-buffer hooks run on buffer-list-update-hook rather than
  in select-window advice.
+ Blank our buffer-list-update-hook in some places to reduce how many
  times it gets triggered.
2019-03-08 02:37:33 -05:00
Henrik Lissner
b98f34d1fd
Add :killb & doom/kill-buried-buffers
Also fix reported killed-buffer count when invoking kill commands
interactively.
2019-03-04 14:07:34 -05:00
Henrik Lissner
9b7d95f43a
Remove doom-cleanup-hook & doom/cleanup-session
These weren't reliable, often times buggy or overzealous about killing
buffers and processes. Best to do it manually or come up with a better
solution.
2019-02-26 22:57:02 -05:00
Henrik Lissner
d80802d3c9
doom/cleanup-session: don't kill processes by default 2019-01-14 00:52:31 -05:00
Henrik Lissner
53fe7a1f04 Refactor Project API to reflect changes upstream
projectile-project-root no longer returns `default-directory` if not in
a project (it returns nil). As such, doom-project-* functions (and their
uses) have been refactored.

+ doom-project-p & doom-project-root are aliases for
  projectile-project-p & projectile-project-root.
+ doom-project-{p,root,name,expand} now has a DIR argument (for
  consistency, since projectile-project-name and
  projectile-project-expand do not).
+ The nocache parameter is no longer necessary, as projectile's caching
  behavior is now more sane.
+ Removed some projectile advice/hacks that are no longer necessary.
+ Updated unit tests
2018-09-28 21:13:27 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Henrik Lissner
44e536e8e8
Refactor core-ui
+ Remove doom/switch-theme (replaced with an advice for load-theme)
+ Reorganize core-ui
+ Fix Emacs 26+ hl-line hack being applied for Emacs 25 users
+ Rename doom|show-whitespace-maybe to doom|highlight-non-default-indentation
+ Disable tool-bar, menu-bar and vertical-scroll-bars via
  default-frame-alist; this is a little faster than using the minor
  modes.
2018-08-31 23:44:08 +02:00
Henrik Lissner
4618b7afad
Refactor & reformat core-ui 2018-08-21 02:56:54 +02:00
Henrik Lissner
ee91748613
Document doom-cleanup-hook 2018-07-07 13:14:50 +02:00
Henrik Lissner
537cc9e1ed
Rewrite doom-real-buffer-p; require first arg
Because of how widely used this function is, I'd rather it be as
explicit as possible to avoid bugs and to make it faster.
2018-06-30 01:57:51 +02:00
Henrik Lissner
70230b0892
Add doom-unreal-buffer-p predicate function 2018-06-30 01:57:51 +02:00
Henrik Lissner
f3aadf6c77
Fix doom-temp-buffer-p & doom-real-buffer-p
A regression caused the former to error out (if the buffer name was less
than 2 characters long) and the latter to return t too eagerly (because
of an incorrect condition chain).
2018-06-17 02:30:02 +02:00
Henrik Lissner
ec6372ef66
Mark all temp buffers as unreal
Hopefully there are no plugins that use temp buffers to display things!
2018-06-16 21:02:54 +02:00
Henrik Lissner
bf44c1abcc
Add doom-temp-buffer-p predicate function 2018-06-16 21:02:40 +02:00
Henrik Lissner
3027ed2f7f
Add new doom|mark-buffer-as-real hook to term/eshell
This is simpler (and perhaps faster) than doom-real-buffer-functions.
Better to reserve that for more complex logic.
2018-06-04 21:17:49 +02:00
Henrik Lissner
d2ca6f65b3
doom/cleanup-session: don't kill modified buffers 2018-05-30 23:06:13 +02:00
Henrik Lissner
d0f8bf402a
doom-visible-windows: support visible window-parameter 2018-05-15 01:31:40 +02:00
Henrik Lissner
326763ab3d
doom/cleanup-processes => doom/cleanup-buffer-processes 2018-03-23 16:01:46 -04:00
Henrik Lissner
f064c5d1ae
Change doom/kill-all-buffers behavior (C-u = only kill project buffers) 2018-03-23 16:01:35 -04:00
Henrik Lissner
358d7af9ac
doom/kill-all-buffers: reduce redundancy 2018-03-22 06:31:16 -04:00
Henrik Lissner
7542f4a660
Fix doom-visible-windows including popup windows 2018-03-01 22:07:14 -05:00
Sergey Trofimov
139a0c8045 Fix kill-buffer arguments. 2018-02-10 19:36:06 +03:00
Henrik Lissner
414383e5f4
Remove vestigial references to doom/{next,previous}-buffer 2018-02-04 05:05:40 -05:00
Henrik Lissner
d1953e00c4
Remove doom--cycle-real-buffers; refactor kill-this-buffer advice
cycle-real-buffers was a tidbit of complexity that was never necessary
in the first place. This functionality was already available in the form
of the frame buffer-predicate parameter, which controls where functions
like next-buffer and other-buffer can land you.

The only thing I have to do myself, is check for the condition where
there are no more real buffers left to switch to, and in that case send
you to the fallback-buffer.
2018-02-02 20:47:31 -05:00
Henrik Lissner
ca262f5e4e
Rename doom-fallback-buffer (variable) => doom-fallback-buffer-name 2018-02-01 20:06:00 -05:00
Henrik Lissner
7b2bbb973a
Improve real-buffer function docstrings 2018-02-01 20:04:54 -05:00
Henrik Lissner
2989296521
Use frame's buffer-predicate instead of doom/{next,previous}-buffer
doom/{next,previous}-buffer was implemented so that these commands could
skip over unreal buffers, and land us on either a real one or the
dashboard. Using the frame's buffer-predicate parameter accomplishes
exactly this, natively.
2018-02-01 19:58:43 -05:00
Henrik Lissner
8b19e35ef6
Consider dired-mode buffers real 2018-01-28 20:37:40 -05:00
Henrik Lissner
b57c2e2264
Disarm doom/cleanup-session's oppressive regime
It killed buffers a little too indiscriminantly.
2018-01-08 19:36:02 -05:00
Henrik Lissner
4bd74d9653
Fix doom-cleanup-hook breaking if hook didn't return an integer 2018-01-07 15:03:45 -05:00
Henrik Lissner
88f8c27a7d
Fix doom/cleanup-session & +workspaces|cleanup-unassociated-buffers
Resolve void n variable errors and silent message.
2018-01-04 16:16:44 -05:00
Henrik Lissner
ab0223144c
Refactor doom/cleanup-session & corresponding evil command 2018-01-04 16:14:50 -05:00
Henrik Lissner
8e875bfa0e
Phase out doom-kill-buffer 2018-01-04 03:01:35 -05:00
Henrik Lissner
ecc8051378
Refactor doom/kill-all-buffers & decouple from core-popup 2018-01-04 03:01:35 -05:00
Henrik Lissner
00cc57a2bd
doom--cycle-real-buffers: if n=0, switch to fallback buffer 2018-01-04 03:01:35 -05:00
Henrik Lissner
fa72e8d09b
Simplify doom-buried-buffers & doom-real-buffer-list 2018-01-04 03:01:35 -05:00
Henrik Lissner
e9a012af34
doom-visible-windows: fix predicate for 'popup window' 2018-01-04 03:01:35 -05:00
Henrik Lissner
8e7b822062
Remove core-popup coupling
New popup management system coming soon!
2018-01-03 03:44:34 -05:00
Henrik Lissner
e0c8e6daef
New doom-unreal-buffer-functions function & doom-real-buffer-p spec 2018-01-03 03:38:35 -05:00
Henrik Lissner
3d5d1b65b3
Move misplaced doom--buffer-narrowed-origin to correct place 2018-01-03 03:32:19 -05:00
Henrik Lissner
2b56fe081c
Improve docstring for doom-real-buffer-functions 2018-01-01 16:59:42 -05:00
Henrik Lissner
707b69540d
doom/cleanup-buffers => doom/cleanup-session 2017-12-30 00:59:44 -05:00
Henrik Lissner
61df57b86a
Refactor core/autoload/buffers.el 2017-12-30 00:58:58 -05:00