Commit Graph

44 Commits

Author SHA1 Message Date
49d86ae648 lang/lua: conform hooks to new naming convention 2019-09-06 00:34:23 -04:00
e55ed59951 lang/lua: add flycheck-moonscript package
And only install moonscript package if +moonscript flag is provided.
2019-09-06 00:33:17 -04:00
e38dad13c6 lang/lua: fix +lua-love-project-root
Its former logic would only return a correct path if both
main.{lua,moon} and src/main.{lua,moon} exist within the same project,
which is very unlikely.
2019-08-23 01:56:43 -04:00
ee81d0533a lang/lua: set default indent width to 2
As per the official lua style guide:
http://lua-users.org/wiki/LuaStyleGuide
2019-08-23 01:04:41 -04: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
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
0a84d2f0a9 core-lib: add auto-minor-mode, revise def-project-mode!
- Adds the auto-minor-mode package to replace our in-house
  implementation.
- Merges associate! into the def-project-mode! macro because associate!
  on its own is less useful than auto-minor-mode-alist,
  auto-minor-mode-magic-alist or hooks.
- Changes the semantics of :modes and :add-hooks properties of
  def-project-mode!. Its arguments are evaluated as is; lists will need
  to be quoted.

squash! core-lib: remove associate! macro
2019-07-22 02:30:39 +02:00
1f0a5f04f2 lang/lua: improve moonscript & love2D support
- Fix moonscript-mode not highlighting/treating single-quoted strings as
  strings
- Fontify interpolated expressions in moonscript-mode strings (PR
  upstream?)
- Fix +lua-love-mode project detection
- Fix +lua/run-love-game love project root resolution
2019-07-09 02:19:35 +02:00
57c52e4db6 Wrap :on-load for +lua-love-mode in a progn
Fixes #1516.
2019-06-27 20:26:32 +03:00
22cc519ac1 Add set-project-type! autodef
And use it for love2d projects in lang/lua module.
2019-06-27 17:16:40 +02:00
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
72fb5603e7 Minor, general refactor & reformatting
Also swaps C-o and M-o in ivy

And use new ;;;###package cookie (not used yet)
2019-04-06 01:36:46 -04: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
3b1305b66f lang/lua: lazy load lua-mode 2019-02-16 19:03:45 -05:00
7ca2b42d2b lang/lua: set default indent = tab-width
Because it's original default was 3. Madness.
2019-01-25 03:10:28 -05:00
3f195614d9 Normalize :leader/:localleader keybinds
Evil states no longer apply to them. Also removes x-alt-keysym.
2018-12-23 23:54:27 -05:00
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
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
84abac6b69 Remove def-menu!; use :localleader keys instead
def-menu was clumsy. We could use a better UI for refactoring commands,
but they should be available via localleader keybinds in any case.
2018-09-09 09:58:18 -04:00
8a4f15b01c Refactor smartparens default rules
Move them to config/default, but move single-lang-specific ones to their
respective modules.
2018-06-25 15:54:38 +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
c0251aacee Replace :lookup with set-lookup-handlers! autodef
And update all internal references.
2018-06-15 17:27:48 +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
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
dc33c72d19 Refactor removal of default smartparens rules for certain modes 2018-04-18 18:29:48 -04:00
1c0509edbb lang/lua: set :documentation lookup to lua-search-documentation 2018-03-19 21:00:29 -04:00
46dbf8f490 lang/lua: improve main.lua detection in +lua/run-love-game 2018-03-18 22:18:34 -04:00
4575cd9310 lang/lua: minor refactor 2018-03-18 15:31:32 -04:00
c94893c6ba lang/lua: fix localleader key hijacking SPC 2018-02-14 07:47:22 -05:00
f063a08891 Remove :editorconfig setting 2017-12-08 23:14:11 -05:00
9d81bc5a8b Major refactor: use-package-always-defer = nil & use :hook
Possibly breaking change: packages are no longer deferred by default.

Addresses #286
2017-12-08 23:14:11 -05:00
d0fcb23314 Replace feature/eval build system with def-menu! 2017-10-03 02:58:09 +02:00
c7254e7bdc Major optimization refactor, across the board
+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster
  startup; ~5-20% general boost
+ reduce consing, function calls & garbage collection by preferring
  cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and
  various cl-lib filter/map/reduce functions) -- where possible
+ prefer functions with dedicated opcodes, like assq (see byte-defop's
  in bytecomp.el for more)
+ prefer pcase & cond (faster) over cl-case
+ general refactor for code readability
+ ensure naming & style conventions are adhered to
+ appease byte-compiler by marking unused variables with underscore
+ defer minor mode activation to after-init, emacs-startup or
  window-setup hooks; a customization opportunity for users + ensures
  custom functionality won't interfere with startup.
2017-06-09 00:47:45 +02:00
5ae94b765c PRAISE BE TO THE BYTE COMPILER FOR THY SHARP QUOTES 2017-04-17 02:17:10 -04:00
648c4c1d3b Update lang modules' :build settings 2017-04-07 01:46:33 -04:00
3e63d2d23b Reduce def-package magic; explicitly use :when property 2017-03-19 22:47:50 -04:00
3ac1d382be Fix project mode definitions 2017-03-02 18:28:46 -05:00
105c0b945b Add :editorconfig setting 2017-03-01 19:16:22 -05:00
33c88d4f82 Revert macros to ...! name convention (elisp doesn't like @...) 2017-02-23 00:06:12 -05:00
afc5b622bb Refactor :electric setting 2017-02-20 20:55:21 -05:00
e14e25ecb4 Update modules/lang/* 2017-02-20 00:26:08 -05:00
f453b3cee1 Reorganize modules 2017-02-20 00:23:03 -05:00