Commit graph

36 commits

Author SHA1 Message Date
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
Henrik Lissner
5bed0a6d16 Fix #5057: don't read editorconfig files in archives 2021-05-16 15:21:42 -04:00
Henrik Lissner
92760d91ae
Add editorconfig-mode to doom-first-buffer-hook 2020-05-28 22:01:23 -04:00
Henrik Lissner
b78fc4eb76
Minor refactor & reformatting across the board 2020-04-08 15:30:10 -04:00
Henrik Lissner
2e543f822a
Remove ws-butler+editorconfig hack
Now that it's supported upstream through
editorconfig-trim-whitespaces-mode
2020-03-27 21:14:47 -04:00
Henrik Lissner
dd402b7db3
Remove references to enh-ruby-mode 2020-03-12 11:29:54 -04:00
Henrik Lissner
c088aaeb1b
tools/editorconfig: remove editorconfig-lisp-use-default-indent
This is now its default value upstream.
2019-12-14 01:15:59 -05:00
Henrik Lissner
c360f0dceb
Minor refactor & comment/docstring revision 2019-10-26 23:44:28 -04:00
Henrik Lissner
6fab07a2e7
tools/editorconfig: detect elisp & js shell scripts
(And sort +editorconfig-mode-alist alphabetically)
2019-10-20 19:57:28 -04:00
Henrik Lissner
19ecf8e46a
Correct last inline hook defuns
See a3e262c7 for rationale
2019-07-28 16:10:53 +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
28aead72ef
tools/editorconfig: conform to new conventions 2019-07-22 23:51:12 +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
fddef812ec
tools/editorconfig: refactor how we ignore lisp modes 2019-07-12 16:47:49 +02:00
Henrik Lissner
df748e6cee
tools/editorconfig: remove extra indent vars
They were merged upstream in editorconfig/editorconfig-emacs#196

Relevant to: #1283, #1289
2019-04-05 14:23:28 -04:00
Henrik Lissner
dfc21e1157
tools/editorconfig: fix syntax error
Typo introduced in 8cd0a31a
2019-04-05 03:14:13 -04:00
Henrik Lissner
8cd0a31aef
Register terra-indent-level with editorconfig 2019-04-05 02:18:16 -04:00
Henrik Lissner
a05b1877be
Rewrite switch-{buffer,window} hooks
+ Add doom-switch-frame-hook
+ Replace doom-{enter,exit}-{buffer,window}-hook with
  doom-switch-{buffer,window}-hook
+ New switch-buffer hooks run on buffer-list-update-hook rather than
  in select-window advice.
+ Blank our buffer-list-update-hook in some places to reduce how many
  times it gets triggered.
2019-03-08 02:37:33 -05:00
Henrik Lissner
12ddc3c360
ui/modeline: add indent segment 2019-03-04 04:57:06 -05:00
Henrik Lissner
99fd8b4e1b
O'byte-compiler
Who forbade the obsolete,
Hooks, functions; adieu.

(And an unused argument too)
2019-02-03 18:42:09 -05:00
Henrik Lissner
078e3028a6 Minor, general comment revision 2018-09-28 21:02:59 -04:00
Henrik Lissner
1b172e9f43
Better enh-ruby-mode suport in doom/describe-module & editorconfig
+ Associates enh-ruby-mode with :lang ruby for doom/describe-module
+ Enables editorconfig to detect extension-less or file-less ruby
  files (from shebang lines or file local variables).
2018-09-09 09:58:21 -04:00
Henrik Lissner
c58077810d
General refactor of modules
General code and comment improvements.

Also, removed the :desc's for csv-mode because map! is currently unable
to set which-key descriptions mode-locally, and should be avoided for
anything but global keybinds. This will be fixed when General is
introduced into Doom.
2018-09-09 09:58:20 -04:00
Henrik Lissner
0f901b560f
tools/editorconfig: add enh-ruby-mode support 2018-09-09 09:58:18 -04:00
Henrik Lissner
d72f485a97
tools/editorconfig: defer for 3 seconds
Give other plugins more room to load first.
2018-08-31 23:44:30 +02:00
Henrik Lissner
55d4cbd314
Fix vestigial refs to before-switch-buffer hook
doom-before-switch-buffer-hook was renamed to doom-enter-buffer-hook
2018-08-31 14:10:25 +02:00
Henrik Lissner
d80e79203a
Replace delete-trailing-whitespace with ws-butler
ws-butler only strips trailing spaces on lines that have been modified.

+ ws-butler is disabled if editorconfig enables
  trim_trailing_whitespace, which resorts to delete-trailing-whitespace
  instead.
+ Updates doom|(enable|disable)-delete-trailing-whitespace hooks to use
  ws-butler-mode.
2018-08-31 13:59:12 +02:00
Henrik Lissner
616c48bd62
Remove read-only monkey patch for magit/git-rebase
It was fixed upstream.
2018-07-10 14:22:53 +02:00
Henrik Lissner
6014a416b3
Fix read-only errors in magit rebase buffers
Magit would refuse to abort/commit rebases due to
delete-trailing-whitespace in write-file-functions, placed there by
editorconfig.
2018-06-30 13:21:24 +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
5b78cf7ed6
tools/editorconfig: conform to name conventions
Renamed doom-editorconfig-mode-alist to +editorconfig-mode-alist
2018-06-14 03:36:46 +02:00
Henrik Lissner
36171f5b33
Fix :after-call deferred packages not loading
If you open emacs with a file (emacs file.txt), the file is switched to
before the switch-buffer hooks are set up. However, many core packages
are hooked to those switch-buffer hooks (to load when they're first
triggered). They miss the boat and don't get loaded.

These packages are now hooked onto after-find-file as well (and
immediately), which will fire when a file is opened, before or after
initialization.

Fixes #680
2018-06-14 03:36:46 +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
3d0745c3ec
Add automatic indentation-detection (experimental)
Editorconfig is given precedence. If it successfully sets an
indent_style or indent_size for the current buffer, automatic
indentation detection will be disabled.
2018-05-18 01:28:41 +02:00
Henrik Lissner
8d936f2d0b
Move editorconfig out of core into tools/editorconfig 2018-05-08 19:59:08 +02:00