Commit Graph

70 Commits

Author SHA1 Message Date
ad6a3d0f33 refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
2022-08-14 20:43:35 +02:00
a70e634ebd refactor(:lang): move tree-sitter init
Moved add-hook calls (for tree-sitter initialization) into their
respective modes' config blocks, or nearby, to be consistent with how
other, similar tools (like lsp!) are initialized, and does so at
runtime, rather than at expansion/compile time, which eval-when! caused.
2022-07-25 17:34:44 +02:00
7f814e5d99 refactor(:lang): redo tree-sitter hooks
- bind to major-mode-local-vars-hook instead of major mode hook
- bind the autodef tree-sitter! instead of the functions.
2022-05-22 21:26:08 +01:00
7a7565cedf nit(sh): revert formatting
snuck in when running the formatter
2022-05-22 21:26:08 +01:00
0c2f986708 feat(:lang): enable ts text objs in modes 2022-05-22 21:26:03 +01:00
06ed5ade3f refactor!(tree-sitter): add +tree-sitter flag
BREAKING CHANGE: break the global nature of the tree sitter
module by adding a +tree-sitter flag to every applicable module

In the background this hooks turn-on-tree-sitter-mode
to the major-mode-hook of the language.
This may also solve the eager loading of tree sitter
2022-05-22 21:26:00 +01:00
d58d084774 tweak(:lang,:tools): start eglot/lsp-mode later
To ensure lsp/eglot settings have precedence over local servers (e.g.
cider and lookup handlers).

Ref: clojure-emacs/cider#3170
2022-03-30 17:32:47 +02:00
a27cd2de13 fix(sh): disable meta fetch by default on mac OS
The `whatis` command is excessively slow on mac OS, rendering
company-shell unusable.

Ref: #5839
2021-12-03 16:45:22 +01:00
ef84fce68c Define sh-mode for bats files
bats is a superset of shell script for writing automated tests exected
with TAP. sh-mode works very well with bats files.
2021-07-08 11:16:38 +02:00
99fbdb1092 lang/sh: make shfmt indent-style aware
Fixes #2905
2021-06-04 16:15:17 -04:00
f3e527cd3d Set sh-mode's docsets to '("Bash"). 2021-03-02 18:24:31 +07:00
813f5da263 lang/sh: use (wo)man for docs lookup handler
i.e. Press K to look symbol at point up in man pages.
2021-02-23 20:32:34 -05:00
2d9c4012c0 added defet for lazy loading and fixed indentation 2020-10-07 17:47:34 +01:00
7c5fe3cf30 Completed PR changes 2020-10-06 08:34:15 +01:00
f9884cc068 Added powershell flag to sh 2020-10-06 08:30:28 +01:00
7081d833f6 Move :ui pretty-code to :ui ligatures
Includes a major refactor of the module.
2020-08-20 02:14:32 -04:00
60f8cc7f8a Add pretty-symbols for Shell-mode (#3538)
* Add pretty-symbols for Shell-mode

* Sort sh/config.el
2020-07-13 17:18:06 -04:00
b78fc4eb76 Minor refactor & reformatting across the board 2020-04-08 15:30:10 -04:00
ae75326a40 Move lsp! to sh-mode-local-vars-hook 2020-02-10 02:39:26 -05:00
3530f19ef5 Add lsp support to sh-mode. 2020-01-07 14:50:13 +02:00
8b18604b63 lang/sh: remove /bin/* fallback mode assocation
Now that doom-guess-mode-h exists (which will set the major mode when
you save a file in fundamental-mode), this association isn't needed
anymore (because doom-guess-mode-h will deduce the mode from the
shebang line).
2019-10-20 15:14:38 -04:00
e972c97b2e lang/sh: remove zsh detection
sh-mode already does its own detection for zsh, so this is unnecessary.
2019-10-19 13:52:27 -04:00
01c9ec0c7f Merge pull request #1716 from flatwhatson/sh-keywords
Add ln to +sh-builtin-keywords
2019-09-06 00:50:04 -04:00
81ee250c09 Minor refactor & revision across the board 2019-09-03 00:59:46 -04:00
4f7adcca7c Add ln to +sh-builtin-keywords 2019-08-28 00:15:33 +10:00
19ecf8e46a Correct last inline hook defuns
See a3e262c7 for rationale
2019-07-28 16:10:53 +02:00
5cc0e92a48 lang/sh: append "/bin/*" rule in auto-mode-alist
It's too aggressive. Rather, it should be a fallback.
2019-07-26 03:12:06 +02:00
b24d7506e6 lang/sh: conform to new hook conventions 2019-07-26 03:12:05 +02:00
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
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
3a2f156acd lang/sh: extract extra fontification into hook
So it can apply to sh-mode derivatives, like direnv-envrc-mode.
2019-07-10 02:28:01 +02:00
e17e9a5c53 lang/sh: associate bin/[^/]$ files with sh-mode 2019-07-10 02:27:27 +02:00
94b16cba6c Standardize REPL commands & improve SPC o r
- SPC o r now prompts for a REPL to open when none was found for the
  current buffer.
- REPL handlers must now follow the naming convention "*/open*-repl".
  e.g. +python/open-ipython-repl, +emacs-lisp/open-repl, etc.
- +eval/open-repl has been split in two:
  - +eval/open-repl-other-window
  - +eval/open-repl-same-window
2019-02-18 01:59:56 -05:00
d6cb0ec5f5 General cleanup & minor refactoring 2018-12-22 04:25:15 -05:00
4067c8937e Remove doom-major-mode-names & doom|set-mode-name
And replace it with buffer-local mode-name setters. This is more
explicit and less magical, which is easier for users to discover and
change, if they'd like.
2018-09-18 15:19:50 -04:00
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
f51f2948af New :editor format module
Centralized code formatting with built-in support for a variety of
languages. Provides the set-formatter! function for defining your own.

Still experimental and needs more testing!
2018-08-22 02:20:11 +02:00
ee73d6c9af Minor reformatting & comment tweaks 2018-08-21 03:34:39 +02:00
ecf9c14229 Enable rainbow-delimiters-mode in sh-mode 2018-08-20 12:43:48 +02:00
90d09e6f93 Highlight-numbers on every prog-mode 2018-07-29 12:19:56 +10:00
8ff5543d3b Moved lang/fish into lang/sh +fish 2018-07-18 15:56:55 -04:00
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
e05d7cfee0 Change flycheck initialization strategy
Initialize it globally and turn it off where needed, instead of enabling
it on demand. Also fixes void-function: flycheck-mode errors when
:feature syntax-checker is disabled. This is experimental.

Indirectly fixes #710
2018-06-22 01:49:20 +02:00
588359cc5f Replace :eval/:repl with autodef functions
+ :eval => set-eval-handler!
+ :repl => set-repl-handler!
+ Updates all internal references.
2018-06-15 16:20:20 +02:00
9f0ebe42e8 Replace :electric with set-electric-rules!
And general refactor of the emacs/electric-indent module.

Also updates (set! :electric ...) references in various :lang modules
2018-06-15 13:32:07 +02:00
d8b1e469bc Introduce autodefs to replace some settings
+ :popup -> set-popup-rule!
+ :popups -> set-popup-rules!
+ :company-backend -> set-company-backend!
+ :evil-state -> set-evil-initial-state!

I am slowly phasing out the setting system (def-setting! and set!),
starting with these.

What are autodefs? These are functions that are always defined, whether
or not their respective modules are enabled. However, when their modules
are disabled, they are replaced with macros that no-op and don't
waste time evaluating their arguments.

The old set! function will still work, for a while.
2018-06-15 03:42:01 +02:00
ae95b9e8d5 lang/sh: improve zsh shebang detection regexp 2018-05-25 00:52:37 +02:00
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
aef9724324 Add doom*shut-up advisor to core-lib 2018-04-23 00:03:28 -04:00
8c5286f2dc lang/sh: silence indentation messages 2018-02-02 20:47:34 -05:00