Commit Graph

162 Commits

Author SHA1 Message Date
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
02a4f6b573 Suppress delete-window in org related functions
- If there's only one other window, delete-window would be called,
  instead of delete-other-windows
- when there is only one window other than the popup, this other window
  is the main window in this frame, delete it would raise an error:
  `delete-window: Attempt to delete main window of frame <frame name>`
2020-01-05 11:52:39 +08:00
960d756b47 General, minor refactors 2019-12-30 18:23:56 -05:00
2e9195742a Fix shell popups from regaining their modeline #2228 2019-12-26 16:50:49 -05:00
adc8cba14b Revise docstrings & minor reformatting 2019-12-26 01:41:44 -05:00
6ac04e5a6d ui/popup: prevent infinite loop when killing popup buffers 2019-12-22 16:02:56 -05:00
491e80a568 Fix cut-off which-key popups #2219 2019-12-21 02:14:36 -05:00
a999a0ddd6 General refactors & comment revision 2019-12-19 14:51:34 -05:00
e56cc98ae9 Move multi-term-buffer-name to :term term 2019-12-17 18:09:39 -05:00
7f06644490 Make +pop/raise return the current window 2019-12-17 21:14:35 +01:00
207ce02a33 ui/popup: fix quit-window sometimes breaking popups
By burying the buffer and switching to a buffer that doesn't belong in a
popup.
2019-12-16 05:45:27 -05:00
08fb9c544d ui/popup: :transient -> :ttl in readme 2019-12-16 05:13:42 -05:00
dd7af506e3 Fix regex for detecting compilation buffer
*Compilation* and *compilation* are both allowed

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
2019-12-16 12:37:18 +07:00
a7d5da494e Fix end-of-file syntax error 2019-12-06 21:45:38 -05:00
996188250b Minor refactors & comment revision 2019-12-06 17:16:34 -05:00
a8fd59a054 Merge pull request #2143 from rgrinberg/popup-ignore-more
ui/popup: add more default rules
2019-12-03 22:56:33 -05:00
894c4e1855 Fix popup ignore rules
* Process Lis is without a space
* Escape trailing star
* Combine all rules
2019-12-04 09:46:27 +07:00
bcdb9f583a Require origin argument
If it doesn't satisfy windowp, it'll cause errors.
2019-12-03 20:00:38 -05:00
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
359ae77250 ui/popup: extract +popup--maybe-select-window helper function 2019-12-04 08:32:27 +08:00
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
0bd0ac4ab9 Popup rules for more builtin types
process, timer, abbreviations, output, occur buffers are all better
displayed in a maximized fashion. Otherwise, they aren't really useful.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
2019-12-03 23:38:00 +07:00
a0e9981210 ui/popup: update configuration section in README 2019-11-25 13:51:23 -05:00
fb13b902b0 Minor comment/doc revision & refactors 2019-11-21 14:46:45 -05:00
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
a074a2c851 ui/popup: let completion popups handle themselves
Fixes #1976
2019-11-01 22:31:05 -04:00
0e0fa37b22 [popup] ignore send mail buffers
[C-x m] should not appear in a popup.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
2019-10-28 12:20:35 +09:00
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
b3a0fb9fc7 ui/popup: correct docstring of set-popup-rule!
Predicate functions take two arguments.
2019-10-21 06:26:57 -04:00
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
7a1c8bd582 ui/popup: fix buffer cleanup ignoring kill-buffer-hook 2019-09-22 14:25:10 -04:00
87c6e8900c Fix org-insert-link desc prompt for helm users #1710
A change upstream causes the prompt to be suppressed if the current
command wasn't run interactively. The check for interactivity gets
tricky when advice are involved.
2019-09-22 13:06:16 -04:00
799e822a19 ui/popup: move help buffers to new vslot
So *Messages* and help buffers get stacked instead of opened side by
side.
2019-09-22 11:58:42 -04:00
db0846f502 ui/popup: don't catch ibuffer windows
They're your problem now.
2019-09-22 11:56:00 -04:00
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
d5ecfd3429 Move pdf-tools popup rules to tools/pdf 2019-09-19 18:55:44 -04:00
31ccd9be78 Replace vestigial references to def-package!
def-package! is deprecated and is replaced with use-package! to reduce
confusion about its purpose and connection to use-package.
2019-09-13 22:00:34 -04:00
d866ee3738 ui/popup: conform function to naming conventions 2019-09-10 15:01:00 -04:00
6f6e30c428 ui/popup: refactor org hacks
This removes a few popup advice functions that are no longer necessary
and changes how we handle org agenda windows (they're now displayed in
the current window, rather than a popup -- see org-agenda-window-setup
to change this).

Other issues addressed:

+ Fixes 'Attempt to delete main window of frame' errors when using
  org-todo from popups (particularly in daemon Emacs).
+ Removed the custom 'popup-window options for org-agenda-window-setup
  and org-src-window-setup, and change them to 'current-window and
  'other-window, respectively.
2019-09-10 14:54:13 -04:00
43d80dcec6 Fix #1692 & stop org-todo from monopolizing frame
How org-todo manipulates the window config has changed upstream.
2019-09-09 14:25:23 -04:00
04166d6562 ui/popup: larger WoMan popups, by default 2019-07-27 19:40:31 +02:00
a3e262c7ac 💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:

  (add-hook! :append 'some-mode-hook #'do-something)

Thsoe properties must now follow the hooks, e.g.

  (add-hook! 'some-mode-hook :append #'do-something)

Other changes:
- Various add-hook calls have been renamed to add-hook! because I
  incorrectly assumed `defun` always returned its definition's symbol,
  when in fact, its return value is "undefined" (so sayeth the
  documentation). This should fix #1597.
- This update adds the ability to add multiple functions to hooks
  without a list:

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

- The indentation logic has been changed so that consecutive function
  symbols at indented at the same level as the first argument, but forms
  are indent like a defun.

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

    (add-hook! 'some-mode-hook
      (message "Hello"))
2019-07-26 20:17:29 +02:00
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
1c4215c187 Fix 'command not found' errors for hidden commands 2019-07-22 04:46:14 +02:00
51d3b1b424 💥 revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.

In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.

  doom*shut-up -> doom-shut-up-a
  doom*recenter -> doom-recenter-a
  +evil*static-reindent -> +evil--static-reindent-a

The rationale behind this change is:

1. Elisp's own formatting/indenting tools would occasionally struggle
   with | and * (particularly pp and cl-prettyprint). They have no
   problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
   github markdown) struggle with it, sometimes refusing to highlight
   code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
   intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
   on haphazardly way back when Doom was simply "my private config".

Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.

Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
  macro. The old pair weren't as useful. The new def-advice! saves on a
  lot of space.
- Removed "stage" assertions to make sure you were using the right
  macros in the right place. Turned out to not be necessary, we'll
  employ better checks later.
2019-07-22 02:27:45 +02:00
394d13179f Fix Org tags popup hack
Causing Org tags output to be written to the source buffer.
2019-07-10 17:28:20 +02:00
14b1e36812 ui/popup: fix *Org tags* popups
- So the mode-line doesn't "hide" the last line of the popup
- So org doesn't delete all other windows when displaying the *Org tags*
  popup
- Minor corrections to comments in ui/popup/+hacks.el
2019-07-10 12:41:51 +02:00
2f86c01170 Add default popup rule for M-x calc 2019-07-09 19:55:37 +02:00
53d1bf6b58 Refactor +popup/other 2019-06-30 18:12:16 +02:00
20b397362b Don't auto-kill term/vterm/eshell dedicated popups 2019-06-27 01:27:40 +02:00