Commit Graph

622 Commits

Author SHA1 Message Date
Henrik Lissner
2eb8035f15
Add more DEPRECATED tags
For Emacs 25 functionality that'll be removed when 25.x support is
dropped.
2019-08-19 21:04:11 -04:00
Henrik Lissner
b34a542ca0
Fix over-eager whitespace-mode after switching major modes
Some major modes (like rust-mode) may trigger
doom-highlight-non-default-indentation-h twice, causing whitespace-style
to be set to its default global value, which (by default) enables
whitespace-mode with all its features. This may overwhelm the
unsuspecting user, so we instead only tack on our modifications to
whitespace-style to its existing buffer-local value, rather than its
global value.
2019-08-06 20:38:04 -04:00
Henrik Lissner
80988a7ad4
Fix kill-current-buffer advise supressing exwm hooks 2019-08-06 14:37:46 -04:00
Henrik Lissner
ff5be98cec
Disable show-trailing-whitespace by default #1593
Let people decide if they want it on or not.

See doom-enable-show-trailing-whitespace-h or setq-hook!
2019-07-28 16:10:54 +02:00
Henrik Lissner
19ecf8e46a
Correct last inline hook defuns
See a3e262c7 for rationale
2019-07-28 16:10:53 +02:00
Henrik Lissner
fe5d285a50
scroll-conservatively = 10
Match the vim default behavior of recenting the cursor in the window if
it moves more than 10 lines above or below the ends of the window.
2019-07-27 02:46:49 +02:00
Henrik Lissner
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
Henrik Lissner
88096a81a9
merge whitespace-style with global value, not local
And ensure it runs as late as possible in after-change-major-mode-hook.

Hopefully to increase the probability of
doom-highlight-non-default-indentation-h detecting a user-enabled
whitespace-mode and bowing out in time.
2019-07-26 13:57:42 +02:00
Henrik Lissner
4299da1eb8
:after -> :after-while for load-theme advice
The advice shouldn't run if load-theme doesn't return
non-nil (indicating it succeeded).
2019-07-25 01:50:33 +02:00
Henrik Lissner
be46d31866
Use display-multi-font-p check in all-the-icons advice
display-multi-font-p is just an alias for display-graphic-p, but it
communicates better the purpose of this advice.
2019-07-23 17:27:55 +02: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
76cacb5bfe
💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
Henrik Lissner
c795a988e6
Conform many modules to new conventions 2019-07-23 12:30:47 +02:00
Henrik Lissner
d59405b282
Minor comment revision & refactors 2019-07-23 00:30:45 +02:00
Henrik Lissner
060ede0e2e
General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
2019-07-22 02:37:45 +02:00
Henrik Lissner
47216117cc
Stop reloading theme on every new frame
It was slow and unnecessary (doom-themes and solaire-mode support
terminal colors already).
2019-07-22 02:30:41 +02:00
Henrik Lissner
a0593cc097
Refactor font loading
Init extra fonts within doom-init-fonts-h. This was moved because I used
to believe that set-fontset-font (according to its documentation) could
only change the frame-local fontset. It turns out that the exception
when you pass t for its first argument, which targets the default (i.e.
global) fontset.
2019-07-22 02:30:40 +02:00
Henrik Lissner
fdcb259bcd
Major refactor of Doom core files
- Remove core-os and move many of its settings out to other core
  libraries, where they belong
- Significantly improve commenting & compartmentalization of many
  settings
- Correct some mis-named public hooks (that were named as if they were
  private)
- Move the vast majority of optimizations to "Optimizations" section in
  core.el
- Don't activate xclip-mode or osx-clipboard-mode if we're accessing
  Emacs through an SSH connection (does more bad than good there)
- Add fast-but-imprecise-scrolling = t
- Set bidi-display-reordering = 'left-to-right, at the recommendation of
  an Emacs dev. Apparently setting it to nil is undefined, as Emacs is
  designed to always assume it's set; setting it explicitly to
  left-to-right will still do what was originally intended by turning it
  off: to reduce line/text scans for bidirectional text, which gives us
  a moderate boost in general runtime snappiness
- Set inhibit-compacting-fon-caches = t on windows (where it struggles
  especially with icon fonts)
- Disables "literal" mode for very large files (because I will be
  backporting so-long.el from Emacs 27 in the next commit)
2019-07-22 02:30:38 +02:00
Henrik Lissner
149b2617b0
💥 revise hook/var fns naming convention (2/2)
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:

1. Replace the bar | to indicate a hook function with a -h suffix, e.g.

     doom|init-ui -> doom-init-ui-h
     doom|run-local-var-hooks -> doom-run-local-var-hooks-h

2. And add a -fn suffix for functions meant to be set on variables,
   e.g.

     (setq magit-display-buffer-function #'+magit-display-buffer-fn)

See ccf327f8 for the reasoning behind these changes.
2019-07-22 02:30:38 +02:00
Henrik Lissner
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
Henrik Lissner
1f84c206d6
Don't grow minibuffer when echoing large messages
Unless we're in the minibuffer (e.g. eval-expression, ivy or evil-ex)

Also makes direnv summaries less imposing.
2019-07-10 21:28:27 +02:00
Henrik Lissner
0f0a8a5744
Rewrite custom-set-face!, add custom-theme-set-face!
custom-set-faces! and custom-theme-set-faces! are now drop-in
replacements for custom-set-faces and custom-theme-set-faces with one
major distinction: the latter will wait for the theme to be loaded
before applying the changes, this allows you to use theme-specific APIs
in your face definitions (like doom-color from doom-themes).

You no longer have to think about load order when using these macros.
2019-07-06 23:22:27 +02:00
Henrik Lissner
2762a08a76
highlight non-default indent despite whitespace-mode
Before, a custom whitespace-style (or global-whitespace-mode) would
disable doom|highlight-non-default-indentation (because they were
incompatible). Now it injects itself into the current style, if one
exists.
2019-06-30 14:28:21 +02:00
Henrik Lissner
92676bfe39
uniquify-buffer-name-style = 'forward #1506 2019-06-28 17:28:53 +02:00
Henrik Lissner
2aa9252725
Move doom|disable-show-paren-mode to autoload/ui 2019-06-27 13:26:03 +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
f3d8053933
Add internal doom-customize-theme-hook
Ensures custom-set-faces! take effect before any load-theme hooks.
2019-06-12 22:42:32 +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
2643d7e5ba
Prefer vertical splits 2019-05-29 23:46:45 -04:00
Henrik Lissner
6c69bf5313
Fix emoji font initialization 2019-05-28 23:47:52 -04:00
Henrik Lissner
f7fb729269
Enable show-trailing-whitespace selectively
Instead of enabling it globally and disabling it in particular modes, we
do the opposite. There are fewer edge cases this way.
2019-05-19 02:17:58 -04:00
Henrik Lissner
ba92adf7b3
Reformat core-ui, add outline headers to core-editor 2019-05-17 01:58:39 -04:00
Henrik Lissner
20720cda61
Remove visual-fill-column package from Doom core
It is not essential enough to keep in Doom core. I'm working on a new
module (or a rewrite for app/write) to replace it.
2019-05-17 01:58:27 -04:00
Henrik Lissner
67b6c44939
Enable show-trailing-whitespace globally
The variable is buffer-local and must be set with setq-default instead.

Also adds doom|{enable,disable}-show-trailing-whitespace hooks.
2019-05-17 01:58:08 -04:00
Henrik Lissner
5d2610fc31
Fix window issues due to switch-buffer hooks
- Fixes the issue that 45873615 was trying to address with frameworks
  like ivy, helm and hydra (where they would manipulate the wrong
  windows),
- Fixes an issue where notmuch couldn't find its buffers ("no buffer
  named *notmuch-X*" errors),
2019-05-16 11:42:30 -04:00
Henrik Lissner
4587361579
Prevent switch hooks while minibuffer is active
Fixes an issue where lv (used by hydra) would manipulate the wrong
window when invoked from, say, ivy.
2019-05-16 03:27:52 -04:00
Henrik Lissner
a4fb4070ea
Rework how unicode fonts are set and loaded 2019-05-15 20:24:52 -04:00
Henrik Lissner
962f6a1032
Fix switch-buffer hooks running from wrong buffer
The destination buffer should be current while the switch-buffer hooks
run.
2019-05-15 15:22:08 -04:00
Henrik Lissner
7443669b1e
Minor refactors & comment revision 2019-05-13 14:37:00 -04:00
Henrik Lissner
0f0fdbc00c
Add doom/{increase,decrease,reset}-font commands
Borrows the idea from zoom-frm (see #1389).
2019-05-12 21:56:52 -04:00
Henrik Lissner
ef4106dae8
Remove echo-keystrokes fix in isearch
It isn't necessary anymore.
2019-05-12 17:06:56 -04:00
Henrik Lissner
e088a21335
Fix theme not loading in daemon sessions #1397 2019-05-09 23:15:13 -04:00
Henrik Lissner
17e337a434
Remove reload-theme-on-new-display-device feature
The intention for this feature was to ensure the theme always looks as
expected even if you were to open a new frame on a different display
device (e.g. open a GUI frame, start the server, then open a tty frame
from it).

It turned out to be buggier than anticipated. The underlying issue is
that solaire-mode is fundamentally incompatible with tty Emacs.
Terminals uses will need to disable it, as there's no good way to
predict what kind of frames a user will open.

TL;DR Avoid opening a TTY frame from a GUI session. If you must, and you
see odd colors, disable solaire-mode.
2019-05-09 21:45:42 -04:00
Henrik Lissner
72e8178e42
show-trailing-whitespace = t
A sensible default.
2019-05-04 19:13:26 -04:00
Henrik Lissner
47f0f77d91
Fix #1384
Redundant with show-trailing-whitespace
2019-05-04 19:13:26 -04:00
Henrik Lissner
3bebf3ac9b
Extend switch-buffer hook coverage
To cover switch-to-{next,prev}-buffer commands, which are used in quite
a few places, but don't implicitly trigger switch-buffer hooks.

Also removes switch-{window,buffer,frame} logging. Adds too much noise,
which isn't very helpful.

Also fixes VC state not being refreshed when switching to stale buffers
in certain ways.
2019-05-02 23:10:09 -04:00
Henrik Lissner
4aa65aa019
Move avy, ace-link & ace-window out of core
They don't belong there, and ace-window is no longer a core dependency
anyhow.
2019-05-01 21:02:28 -04:00
Henrik Lissner
3a3017004c
Fix whitespace-style for non-default-indentation hl
And remove lines-tail. This is outside the purview of this hook.
2019-04-30 14:37:29 -04:00
Henrik Lissner
9735f034e1
General refactors & optimizations 2019-04-29 18:54:46 -04:00
Henrik Lissner
7c5fb8ed9c
Remove highlight-escape-sequences
Payoff < performance cost, and is too opinionated.
2019-04-29 18:17:23 -04:00