Commit Graph

81 Commits

Author SHA1 Message Date
Henrik Lissner
eae2529ed8 fix(popup): ensure hooks run in popup buffer/window
Ref: 13b64229a0
2025-04-09 15:59:47 -04:00
Henrik Lissner
13b64229a0 fix(popup): fringe/margins adjusted in wrong window
Due to a race condition in some contexts, hooks that adjusted window
fringes or margins weren't targeting the windows (usually popups) they
were supposed to, often affecting the last selected window instead. This
could cause the fringes (or margins) to resize or outright vanish
unexpectedly in the wrong windows (e.g. after opening or killing a vterm
or eshell popup).

Fix: #8346
2025-04-07 13:59:30 -04:00
Henrik Lissner
5b11ac7267 feat(popup): +popup/raise: use visible popup if none selected
This command would formerly raise the focused window into a regular
window, erroring out if that window isn't a popup. Now, if the focused
window isn't a popup, any (single) visible popup in the current frame
will be targeted, and if multiple popups are visible, you'll be prompted
to select one.
2025-04-01 00:48:03 -04:00
Henrik Lissner
0a715cc3f2 refactor: (if|when)-let -> (if|when)-let*
With the former macros' future in the air (and likely to be targeted in
future, potentially breaking changes), I'll deal with this now than have
it bite me later.

Ref: https://lists.gnu.org/archive/html/emacs-devel/2024-10/msg00637.html
2025-01-08 19:33:37 -05:00
Henrik Lissner
d1c2c8c35b fix(popup): don't disable hide-mode-line if enabled globally
Ref: hlissner/emacs-hide-mode-line#11
2024-08-29 02:46:21 -04:00
Henrik Lissner
5e2e886b35 nit: comment revision & reformatting 2024-08-15 23:18:47 -04:00
Henrik Lissner
f5a9f5d7ad docs(popup): set-popup-rule!: update docstring 2024-07-18 22:38:59 -04:00
yuhan0
5589722c8e fix(popup): fix typo in local variable name 2024-04-01 13:28:49 -04:00
Tim Ruffing
e27d9b35d3 fix(popup): fix finding of major side window
Fix: #7647
Amend: #7598
2024-03-11 02:55:38 -04:00
Henrik Lissner
5ef7075f96 nit(popup): mention post-command-select-window for 30.x+
Ref: emacs-mirror/emacs@6f75d0f36d
2024-02-08 00:58:20 -05:00
Tim Ruffing
dca4e4a8ed fix(popup): find internal major side windows
Fix: #5485
2024-01-24 12:16:58 -05:00
Henrik Lissner
d8372b6e2d fix(popup): +popup/raise: recursive popup
Without this, raising a popup might result in simply opening a popup
with the same rules.
2023-09-11 23:53:59 +02:00
StrawberryTea
177157b044 fix(popup): cycle windows with no-other-window property
Previously, +popup/other would do nothing if a window with the
no-other-window property that was not a popup was focused. Now
+popup/other will always select different window if there is another
popup or window with the no-other-window property.

Fix: #7119
2023-07-24 19:18:53 +02:00
Henrik Lissner
06392a723f refactor: rename orig-fn arg in advice to fn
A minor tweak to our naming conventions for the first argument of an
:around advice.
2021-08-04 01:53:12 -04:00
Itai Y. Efrat
34fae1c01c Remove remaining Emacs27+ checks
- Remove remaining `EMACS27+` checks, since the whole codebase is
  assumed to run at version 27 or above now
- Remove `EMACS27+` definition since it's no longer needed
2021-07-10 16:03:41 +03:00
Henrik Lissner
11cbd41b1b Fix process X is not a subprocess errors
When killing repl popups with special processes (e.g. for cider).
2021-03-13 16:33:18 -05:00
Mikhail Skorzhinskii
9c510159ff popup.el: consider auto-saving indirect buffers too
Function (buffer-file-name) always returns nil with indirect buffer as
an argument. Extracting base buffer and checking if base buffer visiting
file fixes data loss in indirect buffers showed in popups.

E-mail thread in the org-mode mailing list:

  https://lists.gnu.org/archive/html/emacs-orgmode/2020-12/msg00085.html
2020-12-13 15:45:45 +01:00
Henrik Lissner
d2f7999c29 Don't close treemacs on ESC #1970 2020-07-29 14:30:09 -04:00
Henrik Lissner
b8a8ca9b06 Consider any window with no-other-window a popup
This allows +popup/other (other-popup) to jump to side windows created
outside of Doom's popup manager (e.g. treemacs or neotree).
2020-07-25 17:50:27 -04:00
Henrik Lissner
0904ee406f Make +popup/diagnose output result
Rather than succeed silently.
2020-05-03 16:31:06 -04:00
Mingwei Zhang
9af8786e25 minor documentation spelling fix
`more tha one` -> `more than one`
2020-02-29 12:14:17 -08:00
Henrik Lissner
4fe24df90f Fix #1970: don't count treemacs as a "popup"
And remove its popup rule.

It isn't being caught by the popup system in the first place, so this is
all a charade.
2020-01-06 03:50:48 -05:00
Henrik Lissner
adc8cba14b Revise docstrings & minor reformatting 2019-12-26 01:41:44 -05:00
Henrik Lissner
6ac04e5a6d ui/popup: prevent infinite loop when killing popup buffers 2019-12-22 16:02:56 -05:00
Ralf Beckmann
7f06644490 Make +pop/raise return the current window 2019-12-17 21:14:35 +01:00
Henrik Lissner
bcdb9f583a Require origin argument
If it doesn't satisfy windowp, it'll cause errors.
2019-12-03 20:00:38 -05:00
Henrik Lissner
79faa02d6b Record origin window earlier
The selected window could change in between +popup--maybe-select-window calls.
2019-12-03 19:59:27 -05:00
Yiming Chen
359ae77250 ui/popup: extract +popup--maybe-select-window helper function 2019-12-04 08:32:27 +08:00
Yiming Chen
ca63b0bbfc ui/popup: respect :select nil when reusing a window
- before this change: when reusing a window, select option would get ignored
- after this change: when reusing a window, select option would be used
  just as a new popup
2019-12-04 08:20:17 +08:00
Henrik Lissner
fb13b902b0 Minor comment/doc revision & refactors 2019-11-21 14:46:45 -05:00
Henrik Lissner
99cd52e70f 💥 Drop Emacs 25.x support
Emacs 26.1 is Doom's new minimum supported version

Closes #2026
2019-11-08 16:02:06 -05:00
Henrik Lissner
74cad2632b ui/popup: use old alist use-case for set-popup-rule!
This paradigm has been long since abandoned.
2019-10-21 06:26:57 -04:00
Henrik Lissner
b3a0fb9fc7 ui/popup: correct docstring of set-popup-rule!
Predicate functions take two arguments.
2019-10-21 06:26:57 -04:00
Henrik Lissner
e7f492c400 ui/popup: fix "back to top level" issue
The popup manager (by default) auto-kills most popup buffers after
~5s (controlled by the :ttl property). However, when backtrace buffers
are killed, it calls `top-level`. When the popup manager kills the
buffer, this causes janky cursor movement and the message "Back to top
level" to be displayed in the minibuffer.
2019-10-20 19:57:27 -04:00
Henrik Lissner
7a1c8bd582 ui/popup: fix buffer cleanup ignoring kill-buffer-hook 2019-09-22 14:25:10 -04:00
Henrik Lissner
2de198e749 Fix +popup/raise not raising some windows
The command now raises the popup into the previously selected window,
unless the prefix argument is used.
2019-09-20 23:54:17 -04:00
Henrik Lissner
82ae3a73f3 def-advice!->defadvice! & conform to new advice conventions
This commit does two things:

- Renames def-advice! to defadvice!, in the spirit of naming convenience
  macros after the function/macro they enhance or replace.
- Correct the names of advice functions to indicate visibility and
  intent. A public advice function like doom-set-jump-a is meant to be
  used elsewhere. A private one like +dired--cleanup-header-line-a
  shouldn't -- it likely won't work anywhere but the function(s) it was
  made to advise.
2019-07-23 17:24:56 +02:00
Henrik Lissner
1c4215c187 Fix 'command not found' errors for hidden commands 2019-07-22 04:46:14 +02:00
Henrik Lissner
53d1bf6b58 Refactor +popup/other 2019-06-30 18:12:16 +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
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
b7c02d5c0a Half-revert ba23b63 #1349 2019-04-21 13:25:33 -04:00
Henrik Lissner
ba23b63f5c Fix +popup/raise for consecutive popups 2019-04-09 21:20:08 -04:00
Henrik Lissner
a8532faf08 Improve set-popup-rule!'s signature 2019-03-16 23:59:51 -04: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
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