Commit graph

91 commits

Author SHA1 Message Date
Henrik Lissner
0dc0ccc63e
Refactor +popup*org-pop-to-buffer
Simplify pop-to-buffer call.
2018-06-25 20:19:33 +02:00
Henrik Lissner
8fcc12ed08
Add +popup-display-buffer-fullframe
Adds support for the saved-wconf window parameter. If a popup possesses
a window configuration in this parameter, it will be restored when the
popup (or its popup buffer) is killed.
2018-06-25 19:28:09 +02:00
Henrik Lissner
618358413b
Major refactor of ui/popup
+ Make it pass tests
+ Changes the behavior and arguments of functions passed to :autosave,
  :ttl, and :modeline.
+ Updated the documentation of set-popup-rule! to reflect these changes
+ Phase out map.el usage as per f6dc6ac7
2018-06-23 22:18:44 +02:00
Henrik Lissner
f11bd617cd
Add ui/popup tests (wip) 2018-06-23 22:17:56 +02:00
Henrik Lissner
f6dc6ac74e
Refactor out map.el usage
After some profiling, it turns out map-put and map-delete are 5-7x
slower (more on Emacs 25) than delq, setf/alist-get and add-to-list for
small lists (under 250 items), which is exactly how I've been using
them.

The only caveat is alist-get's signature is different on Emacs 25, thus
a polyfill is necessary in core-lib.
2018-06-23 19:53:54 +02:00
Henrik Lissner
0bea00c183
Fix with-popup-rules! macro
Mistreating its RULES argument, causing void-function errors.
2018-06-22 19:17:15 +02:00
Henrik Lissner
16975d0dc3
Slightly smaller backtrace popups 2018-06-22 01:49:21 +02:00
Henrik Lissner
27ab47cd11
Improve *Backtrace* popup rule
+ High vslot = unlikely to be replaced by other popups.
+ Make it large; backtraces are important!
+ Don't allow ESC to close it. It must be done manually, with q or zx
2018-06-20 02:12:37 +02:00
Henrik Lissner
ca2c8b5a45
Minor refactor, across the board
Do you see the board? Now look at the other side. That's how far this
refactor extends.

Yes.
2018-06-18 15:02:24 +02:00
Henrik Lissner
6808c46b58
💥 Change set-popup-rule! usage
Now accepts a flat plist of all its former parameters, including new
:parameters and :actions properties to increase your control over the
fate of your windows.

The old usage of set-popup-rule! is deprecated and may not work right!

The :ui popup module has also seen a major refactor to improve
efficiency and load times.

Sorry! This is the last "big" change before 2.1!
2018-06-18 02:34:16 +02:00
Henrik Lissner
6490c4b922
Prevent unsafe file variable prompts on help links 2018-06-17 17:26:15 +02:00
Henrik Lissner
0fd8e1dd6b
Restore +popup-ttl
Accidentally removed in a recent commit.

Fixes #692
2018-06-17 11:34:55 +02:00
Henrik Lissner
d31052d9db
Reformat popup library: move polyfills down 2018-06-17 02:21:46 +02:00
Henrik Lissner
1eae57a0b4
Rename +popup-display-buffer
To +popup-display-buffer-stacked-side-window, to make it more obvious
what it actually does.
2018-06-17 02:21:46 +02:00
Henrik Lissner
c3988a8298
Give popups a small margin
To make up for lack of fringe.
2018-06-17 02:21:46 +02:00
Henrik Lissner
9b5a219373
Improve robustness of popup predicates & checks 2018-06-17 02:21:46 +02:00
Henrik Lissner
635fbb4a97
Fix "selecting deleted buffer" errors in helm #665
By properly handling helm popups.
2018-06-16 14:42:47 +02:00
Henrik Lissner
44363cae40
General, minor refactor & revision
Across the board. All the boards.
2018-06-16 12:26:58 +02:00
Henrik Lissner
74d364776e
Move no-other-window to +popup-default-parameters
Should be customizable.
2018-06-16 11:45:09 +02:00
Henrik Lissner
02d532a09a
Set ibuffer-use-other-window in ui/popup/+hacks.el
It was originally set to accommodate the popup system.
2018-06-16 10:22:59 +02:00
Henrik Lissner
1cfc146e3a
Fix indentation of set-popup-rule!'s arguments 2018-06-16 00:40:37 +02:00
Henrik Lissner
fe6a9b0cd8
ui/popup: tie +defaults flag to +hacks 2018-06-15 22:13:44 +02:00
Henrik Lissner
f81a0e6f41
Remove redundant def-setting! docstrings
def-setting! will now grab the autodef's docstring if it has an
:obsolete property defined.
2018-06-15 16:54:39 +02:00
Henrik Lissner
d8b1e469bc
Introduce autodefs to replace some settings
+ :popup -> set-popup-rule!
+ :popups -> set-popup-rules!
+ :company-backend -> set-company-backend!
+ :evil-state -> set-evil-initial-state!

I am slowly phasing out the setting system (def-setting! and set!),
starting with these.

What are autodefs? These are functions that are always defined, whether
or not their respective modules are enabled. However, when their modules
are disabled, they are replaced with macros that no-op and don't
waste time evaluating their arguments.

The old set! function will still work, for a while.
2018-06-15 03:42:01 +02:00
Henrik Lissner
6fe0017e24
Add popup hacks for pdf-tools' annot list windows
Annotations are displayed in stacked windows to the left of the pdf.

Thanks to @UndeadKernel for help figuring this out.
2018-06-14 19:55:36 +02:00
Henrik Lissner
1f07b37c9c
Fix elusive back-to-top-level error
These occurred because of disruptive kill-buffer-hooks running when the
backtrace buffer was auto-killed by the popup cleanup system. No more!
2018-06-14 00:45:57 +02:00
Henrik Lissner
a77a967299 Fix elusive 'already at top-level' error
I have hunted this bug on and off for nearly a year now. It would kill
processes randomly, move the point suddenly, and quit the active
minibuffer without warning.

The only clue it'd leave behind is an announcement in the minibuffer:
"Already at top-level".

Thanks to @UndeadKernel for the last piece of the puzzle!

Fixes #436
2018-06-12 14:13:12 +02:00
Henrik Lissner
6e6dfc2215
Implement helm project search functionality #644
Adds +helm/project-search, as well as +helm/ag and +helm/ag-from-cwd,
and variants for rg, pt and grep/git-grep, to mirror the functionality
available to :completion ivy.

Also updates the evil ex commands and keybinds
2018-06-02 20:37:02 +02:00
Henrik Lissner
dd57a521f3 Correct :popup/:popups docstrings 2018-06-02 18:20:09 +02:00
Henrik Lissner
209b281dc6
Move popup mode keymaps to autoload.el 2018-06-02 16:58:56 +02:00
Henrik Lissner
90ddc67337
Fix with-popup-rules! macro 2018-05-31 01:34:53 +02:00
Henrik Lissner
abd8f87e28
Move popup keymaps to config.el
This prevents void-variable +popup-buffer-mode-map errors that occur in
some hard to reproduce scenarios.

Also ensures that window-persistent-parameters is being restored when
+popup-mode is disabled.
2018-05-30 23:02:36 +02:00
Henrik Lissner
75e6ea6bee
ui/popup: delete old rule in :popup/:popups settings
In case the settings are used or ran after initialization (e.g. in the
case of doom//reload).
2018-05-30 01:39:17 +02:00
Henrik Lissner
73d083b1fa
ui/popup: larger Info popups 2018-05-29 16:00:16 +02:00
Henrik Lissner
947fe345c3
Minor, general refactor
In some contexts, map-put is superior to add-to-list.
2018-05-29 15:34:13 +02:00
Henrik Lissner
1a452b6842
💥 Change first arg of load! macro
load!'s first argument is no longer a symbol (that will cause
void-variable errors now) to save on unnecessary interning and simplify
compile-time logic. It accepts any valid form that evaluates to a string
now.

If you use load!, you need to change its argument to a string!

e.g. (load! +my-module) => (load! "+my-module")
2018-05-27 12:52:28 +02:00
Henrik Lissner
fa17de9f19
ui/popup: refactor :popup/:popups settings
And move org popup settings to lang/org
2018-05-26 23:26:45 +02:00
Henrik Lissner
4e2beb8b7e
Merge +popup-define's documentation into :popup setting's
Users are more likely to view :popup's documentation for information on
defining popup rules (they shouldn't be using +popup-define!).
2018-05-26 14:20:23 +02:00
Henrik Lissner
09cb4f6716
Major refactor & optimization of how modules load their packages
Now that we are loading package autoloads files (as part of the
generated doom-package-autoload-file when running make autoloads), many
:commands properties are redundant. In fact, many def-package! blocks
are redundant.

In some cases, we can do without a config.el file entirely, and can move
into the autoloads file or rely entirely on package autoloads.

Also, many settings have been moved in their module's autoloads files,
which makes them available ASAP; their use no longer depends on module
load order.

This gained me a modest ~10% boost in startup speed.
2018-05-25 00:46:16 +02:00
Henrik Lissner
dcec3b9b25
feature/popup: add new autosave window parameter
(autosave . CDR)

This parameter determines what to do with modified buffers in closing
popup windows. CDR can be a t, 'ignore, a function or nil.

+ If t, no prompts. Just save them automatically (if they're
  file-visiting buffers).
+ If 'ignore, no prompts, no saving. Just silently kill it.
+ If nil (the default), prompt the user what to do if the buffer is
  file-visiting and modified.
+ If a function, the return value must return one of the other values.
  It takes two arguments: the popup window and buffer.
2018-05-19 12:08:24 +02:00
Henrik Lissner
83118dc65c
Move feature/popup => ui/popup
And move settings to ui/popup/init.el
2018-05-14 13:05:03 +02:00