Commit graph

110 commits

Author SHA1 Message Date
Henrik Lissner
a8300a53f1
ui/popup: allow ESC to close eval result popups 2019-05-15 20:29:46 -04:00
Henrik Lissner
dd4e265a49
ui/popup: merge eval output popup rules 2019-05-15 15:25:03 -04:00
Henrik Lissner
a22c035815
ui/popup: ensure existing buffers are reused
This resolves an issue where the popup manager would open another popup
if a previous one had been raised. The popup manager now delegates to
the existing buffer if it already exists (without resizing it).
2019-05-15 15:22:09 -04:00
Henrik Lissner
c549091ce5
ui/popup: polish default rules
- Establish popup naming convention:
  - *doom:name* -> a temporary editing buffer (requires interaction)
  - *doom name* -> a transient buffer (no interaction required)
2019-05-15 15:22:09 -04:00
Henrik Lissner
b9729380c4
Use ;;;###package cookies in popup hacks file
Used by doom/help-package-config
2019-05-08 00:58:51 -04:00
Xavier A
4c283a80f3
One dot in wrong place
Not sure what I am doing, but I cannot run the example with the `.` and the example on the previous line also use `:size` without a `.` before the size value.
2019-05-03 14:38:29 +02:00
Henrik Lissner
ae06ddf78a
ui/popup: update README 2019-05-02 15:11:32 -04:00
Henrik Lissner
77e4cc4d58
💥 Remove :feature category
:feature was a "catch-all" category. Many of its modules fit better in
other categories, so they've been moved:

- feature/debugger -> tools/debugger
- feature/evil -> editor/evil
- feature/eval -> tools/eval
- feature/lookup -> tools/lookup
- feature/snippets -> editor/snippets
- feature/file-templates -> editor/file-templates
- feature/workspaces -> ui/workspaces

More potential changes in the future:

- A new :term category for terminal emulation modules (eshell, term and
  vterm).
- A new :os category for modules dedicated to os-specific functionality.
  The :tools macos module would fit here, but so would modules for nixos
  and arch.
- A new :services category for web-service integration, like wakatime,
  twitter, elfeed, gist and pastebin services.
2019-04-24 18:16:04 -04:00
Henrik Lissner
cce55db6ed
Remove display-buffer-reuse-window from default actions
This would cause +popup/raise to reuse non-popup windows when raising
popups. If this doesn't work, it may be necessary to write a specialized
display-buffer-reuse-window to only reuse popups, specifically.
2019-04-21 13:32:22 -04:00
Henrik Lissner
b7c02d5c0a
Half-revert ba23b63 #1349 2019-04-21 13:25:33 -04:00
Henrik Lissner
6cd30c926b
Persist scratch buffer across sessions
- Adds doom/open-project-scratch-buffer (persistent project scratch
  buffers)
- Prefix arg = open scratch buffer in current window, for both
  doom/open-scratch-buffer and doom/open-project-scratch-buffer.
- Rename doom/delete-scratch-files ->
  doom/delete-persistent-scratch-file
- Remove doom-scratch-buffer-display-fn
- Rename doom-scratch-files-dir -> doom-scratch-dir
- Add SPC p s keybind to open project scratch buffer
2019-04-17 11:15:56 -04:00
Henrik Lissner
4a7b821934
Don't auto-kill scratch buffer popups 2019-04-15 14:16:45 -04:00
Henrik Lissner
138248ed03
Don't auto-kill compilation log buffers #1316 2019-04-09 21:55:46 -04:00
Henrik Lissner
ba23b63f5c
Fix +popup/raise for consecutive popups 2019-04-09 21:20:08 -04:00
Henrik Lissner
47d09b3ef5
ui/popup: update README 2019-03-21 17:00:52 -04:00
Henrik Lissner
a8532faf08
Improve set-popup-rule!'s signature 2019-03-16 23:59:51 -04:00
Henrik Lissner
9b1b75f947
Improve profiler popup integration
Following profiler links will open in different window; also displays
CPU/Memory reports side by side.
2019-03-13 20:15:20 -04: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
adfc06f3dd
Add no-other-window in popup criteria
This allows +popup-window-p to recognize popup windows created by
plugins (like treemacs).
2019-02-19 01:29:03 -05:00
Henrik Lissner
93132e43c1
Fix window--display-buffer advice #1173
Forgot to have the :filter-return advice return the window (whoops!)
2019-02-16 01:16:09 -05:00
Henrik Lissner
c5cd97d3cc
Fix breaking change in window--display-buffer
This change is present in later builds of Emacs 27, where
window--display-buffer no longer has a 5th argument.
2019-02-15 19:53:15 -05:00
Henrik Lissner
4132be4208
org-agenda-window-setup = popup-window
This is a custom setting that allows org agenda windows to be managed by
Doom's popup manager.
2019-02-03 18:39:29 -05:00
Henrik Lissner
4b2dbe42a5
Fix popup :slot property
It was broken by the new split-window parameter set on popup windows.
2019-01-08 21:49:43 -05:00
Henrik Lissner
30eaf8fd03
Fix "cannot split parent or side window" errors
Hopefully addresses a common issue where helm actions will operate on
the wrong window (a popup, typically, which is a dedicated side window;
Emacs doesn't let you split side windows).

This comes with a side effect: trying to split a popup will cause a
non-popup window nearby to be split instead.

Popups really aren't supposed to be split (interactively) in any case.
2019-01-08 20:38:17 -05:00
Henrik Lissner
b56639e31b
Remove deprecated set! & def-setting! macros 2019-01-05 17:48:46 -05:00
Henrik Lissner
6a03b37dd3
General refactor for comments & docstrings 2019-01-05 15:20:49 -05:00
Henrik Lissner
1610cd32b2
ui/popup: respect org-src-window-setup
Added a new value for org-src-window-setup: 'popup-window

Other values (like 'other-window) will revert to org's old behavior.

Needs more testing.
2018-12-06 17:52:12 -05:00
Henrik Lissner
5c14fb42e0
Add +popup/diagnose for debugging popup rules 2018-12-06 17:51:40 -05:00
Henrik Lissner
b41e38dcf4
Make RET respect popups in Buffer-menu 2018-12-06 17:50:32 -05:00
Henrik Lissner
745bd3238c
Fix delete-other-windows from inside popups
Occasionally, a window will lose its popup status, but not its special
window parameters, forcing non-popups to be treated like popups when
delete-other-windows is called.
2018-12-06 17:45:53 -05:00
Henrik Lissner
35170cb2e0
Merge pull request #1029 from amosbird/patch-8
Don't scan frames other than current in popup
2018-12-03 22:18:03 -05:00
Elijah Malaby
d063fff8a1 Fixed +popup--kill-buffer visibility check
Now it checks all frames instead of only the current one.
2018-12-02 13:24:02 -05:00
Amos Bird
3b67338b4a
Don't scan frames other than current in popup
This accidentally reuses windows in other frames, especially when there are multiple compliation buffers.
2018-11-27 22:08:35 +08:00
Henrik Lissner
702e0a6159
ui/popup: fix typo in d8928d4a 2018-10-03 02:32:22 -04:00
Henrik Lissner
d8928d4aab ui/popup: fix which-key vslot fix
Prevents which-key from "sharing" popups.

Reported by @mfiano
2018-10-03 01:26:59 -04:00
Henrik Lissner
ccb04c43da
ui/popup: refactor default rules
The vslots don't have to be so far from 0. Also makes compilation popups
bigger.
2018-09-28 21:13:52 -04:00
Henrik Lissner
4ea4754162 Add commands for using bin/doom from inside Emacs
This is experimental. I'd eventually like users to be able to management
Doom from inside Emacs, if they desire. This may be the only way to have
a decent user experience on Windows, for that matter.

Also adds a popup rule for it.
2018-09-28 21:13:27 -04:00
Edwin Török
27e17ace67 Fix race condition in popup load
When compiling everything I got this on Emacs startup:
```
Debugger entered--Lisp error: (void-variable +popup--display-buffer-alist)
  (setq +popup--old-display-buffer-alist display-buffer-alist display-buffer-alist +popup--display-buffer-alist window--sides-inhibit-check t)
  (cond (+popup-mode (add-hook 'doom-escape-hook (function +popup|close-on-escape) t) (add-hook 'doom-cleanup-hook (function +popup|cleanup-rules)) (setq +popup--old-display-buffer-alist display-buffer-alist display-buffer-alist +popup--display-buffer-alist window--sides-inhibit-check t) (let ((--dolist-tail-- +popup-window-parameters)) (while --dolist-tail-- (let ((prop (car --dolist-tail--))) (setq window-persistent-parameters (cons (cons prop 'writable) window-persistent-parameters)) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (t (remove-hook 'doom-escape-hook (function +popup|close-on-escape)) (remove-hook 'doom-cleanup-hook (function +popup|cleanup-rules)) (setq display-buffer-alist +popup--old-display-buffer-alist window--sides-inhibit-check nil) (+popup|cleanup-rules) (let ((--dolist-tail-- +popup-window-parameters)) (while --dolist-tail-- (let ((prop (car --dolist-tail--))) (delq (assq prop window-persistent-parameters) window-persistent-parameters) (setq --dolist-tail-- (cdr --dolist-tail--)))))))
  (let ((last-message (current-message))) (setq-default +popup-mode (if (eq arg 'toggle) (not (default-value '+popup-mode)) (> (prefix-numeric-value arg) 0))) (cond (+popup-mode (add-hook 'doom-escape-hook (function +popup|close-on-escape) t) (add-hook 'doom-cleanup-hook (function +popup|cleanup-rules)) (setq +popup--old-display-buffer-alist display-buffer-alist display-buffer-alist +popup--display-buffer-alist window--sides-inhibit-check t) (let ((--dolist-tail-- +popup-window-parameters)) (while --dolist-tail-- (let ((prop (car --dolist-tail--))) (setq window-persistent-parameters (cons (cons prop 'writable) window-persistent-parameters)) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (t (remove-hook 'doom-escape-hook (function +popup|close-on-escape)) (remove-hook 'doom-cleanup-hook (function +popup|cleanup-rules)) (setq display-buffer-alist +popup--old-display-buffer-alist window--sides-inhibit-check nil) (+popup|cleanup-rules) (let ((--dolist-tail-- +popup-window-parameters)) (while --dolist-tail-- (let ((prop (car --dolist-tail--))) (delq (assq prop window-persistent-parameters) window-persistent-parameters) (setq --dolist-tail-- (cdr --dolist-tail--))))))) (run-hooks '+popup-mode-hook (if (default-value '+popup-mode) '+popup-mode-on-hook '+popup-mode-off-hook)) (if (called-interactively-p 'any) (progn (customize-mark-as-set '+popup-mode) (if (and (current-message) (not (equal last-message (current-message)))) nil (let ((local "")) (message "+Popup mode %sabled%s" (if (default-value '+popup-mode) "en" "dis") local))))))
  +popup-mode()
  doom-try-run-hook(+popup-mode)
  run-hook-wrapped(doom-try-run-hook +popup-mode)
  doom|init-ui()
  run-hooks(emacs-startup-hook term-setup-hook)
  #f(compiled-function () #<bytecode 0x46c615>)()
  normal-top-level()
```

Signed-off-by: Edwin Török <edwin@etorok.net>
2018-09-19 21:43:56 +01:00
Henrik Lissner
b76a09539c Fix helm TAB completion from org-insert-link #897 #829
This is a tricky issue and a tricky fix. See the comments in the commit
for an explanation.
2018-09-18 21:44:59 -04:00
Henrik Lissner
a1440f8d66
Fix meta keybinds in popup in tty Emacs #869
Meta keys map to ESC in tty Emacs.
2018-09-13 19:15:16 -04:00
Henrik Lissner
0b350f6ea4
ui/popup: refactor +popup/raise
Improves its error tolerance and gives it a window argument.
2018-09-09 09:58:22 -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
5e25cfd6a7
Fix delete-other-windows in popups #858
Originally, calling delete-other-windows from a popup window would kill
only popup windows. This has been corrected to raise the popup, *then*
delete other windows.

As if you'd done `M-x +popup/raise` then `M-x delete-other-windows`
2018-09-02 20:38:36 +02:00
Henrik Lissner
82376f324b
Merge pull request #824 from hackeryarn/popup-readme-updates
ui/popup: updated readme to use set-popup-rules!
2018-09-01 13:20:09 +02:00
Henrik Lissner
fd8f8c5108
feature/lookup: rewrite dash docset integration
+ Uses alist variable to store config, rather than hooks
+ Added check for installed docsets in +lookup/documentation
+ Set docsets for various language modules (c-mode, c++-mode, css-mode,
  scss-mode, sass-mode, web-mode, go-mode, racket-mode, emacs-lisp-mode,
  js2-mode, rjsx-mode, typescript-mode, rust-mode, and php-mode)
+ Made *eww* popups for dash docsets larger
+ Renamed set-docset! => set-docsets! (set-docset! is aliased to
  set-docsets!)
+ New +lookup/install-docset alias
2018-08-31 02:49:48 +02:00
Henrik Lissner
be8eedc296
Fix lost window state when toggling popups
Replaces af045213 with a method for preserving popup state.
2018-08-29 02:16:06 +02:00
Henrik Lissner
af045213e3
Preserve window state when toggling popups
e.g. size
2018-08-26 17:24:27 +02:00
Henrik Lissner
469aa81570
Forward-require dependencies in tests
Easier to see at a glance what the test's dependencies are.
2018-08-26 00:20:16 +02:00
Henrik Lissner
cc47798846
Revert 6b910392 #829
Causes other errors. Will need a better solution.
2018-08-25 12:00:27 +02:00
Henrik Lissner
6b91039283
Fix helm persistent action with *Org Links* window
Fixes #829. Helm's persistent action would try to operate on the *Org
Links* window, which is dedicated, causing a "Cannot split side window
or parent of side window" error.

This fix gets rid of this unhelpful popup altogether when helm is
enabled.
2018-08-24 01:09:53 +02:00