Commit Graph

129 Commits

Author SHA1 Message Date
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
c795a988e6 Conform many modules to new conventions 2019-07-23 12:30:47 +02:00
82e882c630 lang/emacs-lisp: obey changes to lisp-indent-offset
In case the user has changed it.
2019-07-22 02:37:45 +02:00
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
5005721039 lang/emacs-lisp: make company-elisp use helpful
Instead of describe-*
2019-07-22 02:30:40 +02:00
62f2f6af48 lang/emacs-lisp: revise macrostep evil keybinds
Most of these are upstream in evil-collection-macrostep.
2019-07-22 02:30:40 +02:00
18078dd160 Add special lisp indent logic for add-hook
So that inline defun forms are indented like other body forms.
2019-07-22 02:30:40 +02:00
be789caa04 Add elisp demos for Doom API in helpful buffer 2019-07-22 02:30:40 +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
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
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
d91888b432 lang/emacs-lisp: tab-width = 2 by default
A more sensible default. Also fixes evil-shift-width in emacs-lisp-mode.
2019-06-10 09:38:56 +02:00
34b4ff12f4 lang/emacs-lisp: remove buggy read-only hook
Breaks package-install when it attempts to byte-compile package files.
2019-05-22 05:35:37 -04:00
08bfd5879a Enable read-only-mode in package files
These files shouldn't be modified directly.
2019-05-20 21:09:12 -04:00
87771aaa1e lang/emacs-lisp: remove auto-compile package
This package would clash with flycheck's byte-compilation checker. In
any case you should not be modifying byte-compiled files.
2019-05-15 20:24:52 -04:00
25beb4bcfd lang/emacs-lisp: restore flycheck in elisp buffers
However, with `emacs-lisp-checkdoc` disabled and `emacs-lisp`
significantly gimped.

byte-compile-warnings may need to be adjusted to allow for *some*
warnings.

Also, reformat emacs-lisp-mode hooks
2019-05-02 21:23:33 -04:00
ee7ff68ae4 lang/emacs-lisp: don't move cursor on syntax error
i.e. when parentheses are unbalanced.
2019-05-02 20:40:48 -04:00
1c976dc0e4 Minor, general refactors
Also rename custom lookup handlers for consistency and use the new
inline :async property instead.
2019-05-02 17:57:31 -04:00
6d314c2795 Revise and update docstrings and comments 2019-05-01 21:02:28 -04:00
6b69eaa397 Minor refactors across the board 2019-04-26 17:42:44 -04:00
77e4cc4d58 💥 Remove :feature category
:feature was a "catch-all" category. Many of its modules fit better in
other categories, so they've been moved:

- feature/debugger -> tools/debugger
- feature/evil -> editor/evil
- feature/eval -> tools/eval
- feature/lookup -> tools/lookup
- feature/snippets -> editor/snippets
- feature/file-templates -> editor/file-templates
- feature/workspaces -> ui/workspaces

More potential changes in the future:

- A new :term category for terminal emulation modules (eshell, term and
  vterm).
- A new :os category for modules dedicated to os-specific functionality.
  The :tools macos module would fit here, but so would modules for nixos
  and arch.
- A new :services category for web-service integration, like wakatime,
  twitter, elfeed, gist and pastebin services.
2019-04-24 18:16:04 -04:00
08c30336d2 Apply elisp-demos to describe-function-1 as well 2019-03-16 23:59:51 -04:00
e1f4668c0b Remove redundant :commands
The elisp-demos package autoloads elisp-demos-advice-helpful-update
2019-03-12 11:31:25 -04:00
0a30b4ee4b Add elisp-demos to lang/emacs-lisp module
This is an extremely useful package which adds little examples to the
help docs for a massive number of elisp functions.

https://github.com/xuchunyang/elisp-demos
2019-03-11 00:22:22 +10:00
54d1c0dd56 Minor, general refactors 2019-03-09 03:42:55 -05:00
90a10931f7 lang/emacs-lisp: new +emacs-lisp-outline-regexp var 2019-03-08 04:25:44 -05:00
96aa172071 Prevent overseer from being autoloading with elisp
Now it'll only load when +emacs-lisp-ert-mode is active.
2019-03-04 20:47:26 -05:00
c7aa41599d Add new emacs-lisp :documentation lookup handler
Made to do-what-I-mean. Uses describe-symbol/helpful-symbol and falls
back to apropos.
2019-03-04 20:47:25 -05:00
7c9e96da87 General module refactor 2019-03-02 02:04:11 -05:00
7c5eefee3e General, minor refactoring 2019-02-24 13:58:56 -05:00
69ed1a4a99 feature/{syntax-checker,spellcheck} -> tools/fly{check,spell} 2019-02-22 00:25:30 -05: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
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
4daa9271a0 Introduce general.el & rewrite map!
+ Now uses an overriding keymap for leader keys, so that it is always
  available, even outside of normal/visual states. In insert/emacs
  states, or in sessions where evil is absent, an alternative prefix is
  used for leader/localleader keys. See these variables:
  + doom-leader-prefix
  + doom-leader-alt-prefix
  + doom-localleader-prefix
  + doom-localleader-alt-prefix
+ Keybinds now support alternative prefixes through the new :alt-prefix
  property. This is useful for non-evil users and non-normal evil
  states. By default, this is M-SPC (leader) and M-SPC m (localleader).
+ Removed +evil-commands flag from config/default (moved to
  feature/evil/+commands.el).
+ config/default/+bindings.el has been split into
  config/default/+{evil,emacs}-bindings.el, which one is loaded depends
  on whether evil is present or not. The latter is blank, but will soon
  be populated with a keybinding scheme for non-evil users (perhaps
  inspired by #641).
+ The define-key! macro has been replaced; it is now an alias for
  general-def.
+ Added unmap! as an alias for general-unbind.
+ The following modifier key conventions are now enforced for
  consistency, across all OSes:
    alt/option      = meta
    windows/command = super
  It used to be
    alt/option      = alt
    windows/command = meta
  Many of the default keybinds have been updated to reflect this switch,
  but it is likely to affect personal meta/super keybinds!

The map! macro has also been rewritten to use general-define-key. Here
is what has been changed:

+ map! no longer works with characters, e.g. (map! ?x #'do-something) is
  no longer supported. Keys must be kbd-able strings like "C-c x" or
  vectors like [?C-c ?x].
+ The :map and :map* properties are now the same thing. If specified
  keymaps aren't defined when binding keys, it is automatically
  deferred.
+ The way you bind local keybinds has changed:

    ;; Don't do this
    (map! :l "a" #'func-a
          :l "b" #'func-b)
    ;; Do this
    (map! :map 'local "a" #'func-a
                      "b" #'func-b)

+ map! now supports the following new blocks:
  + (:if COND THEN-FORM ELSE-FORM...)
  + (:alt-prefix PREFIX KEYS...) -- this prefix will be used for
    non-normal evil states. Equivalent to :non-normal-prefix in general.
+ The way you declare a which-key label for a prefix key has changed:

    ;; before
    (map! :desc "label" :prefix "a" ...)
    ;; now
    (map! :prefix ("a" . "label") ...)

+ It used to be that map! supported binding a key to a key sequence,
  like so:

    (map! "a" [?x])  ; pressing a is like pressing x

  This functionality was removed *temporarily* while I figure out the
  implementation.

Addresses: #448, #814, #860
Mentioned in: #940
2018-12-22 04:14:43 -05:00
7b761a9b42 Refactor feature deferral for (common|emacs)-lisp
'lisp-mode is now deferred, to make it easier to lazy-configure it
2018-12-05 22:11:54 -05:00
aa08f338de lang/emacs-lisp: add outline-minor-mode
And simplify outline-regexp for elisp buffers.
2018-09-20 15:28:03 -04: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
fd8f8c5108 feature/lookup: rewrite dash docset integration
+ Uses alist variable to store config, rather than hooks
+ Added check for installed docsets in +lookup/documentation
+ Set docsets for various language modules (c-mode, c++-mode, css-mode,
  scss-mode, sass-mode, web-mode, go-mode, racket-mode, emacs-lisp-mode,
  js2-mode, rjsx-mode, typescript-mode, rust-mode, and php-mode)
+ Made *eww* popups for dash docsets larger
+ Renamed set-docset! => set-docsets! (set-docset! is aliased to
  set-docsets!)
+ New +lookup/install-docset alias
2018-08-31 02:49:48 +02:00
a7b87fe3de Add +emacs-lisp-enable-extra-fontification option 2018-08-30 20:41:54 +02:00
edc9bf70af Delete trailing whitespace, globally, by default
Also adds doom|disable-delete-trailing-whitespace hook, which can be
used to disable this behavior on a per-buffer basis. If you want to turn
off this global behavior:

  (remove-hook 'write-file-functions #'delete-trailing-whitespace)
2018-08-30 20:36:15 +02:00
4acb3f29ab lang/emacs-lisp: reformat & autoload functions 2018-08-21 02:56:53 +02:00
1cb31d7cb5 lang/emacs-lisp: optimize symbol fontification
By ignoring symbols in comments and strings.
2018-08-20 23:47:31 +02:00
97bc69b9e5 lang/emacs-lisp: recenter window after elisp-def 2018-08-20 23:47:16 +02:00
3d4b03a8ea lang/emacs-lisp: replace xref with elisp-def
Possibly better goto-definition behavior than xref; needs more testing.
2018-08-19 00:13:18 +02:00
09678f8b1d lang/emacs-lisp: combine imenu var rules 2018-08-11 01:59:37 +02:00
631f075a82 lang/emacs-lisp: polish symbol fontification
Follow up on 76b4af99; resolves "flickering christmas lights" issue
where symbols were incorrectly fontified with the last face while typing
them.
2018-08-11 01:59:37 +02:00
76b4af99cc lang/emacs-lisp: rewrite extra fontification
Now fontifies defined variables and functions, rather than from a
hardcoded list.
2018-08-10 19:40:07 +02:00
63cc8b4306 Fix flycheck staying enabled after doom/reload 2018-08-08 23:37:30 +02:00
9f074a1aa3 Add option to enable extra elisp fontification 2018-07-31 03:48:45 +02:00