Commit graph

174 commits

Author SHA1 Message Date
Henrik Lissner
2485cac2e0
lang/emacs-lisp: refactor eval handler
pp-eval-expression does much of what +emacs-lisp-eval used to do.
2019-10-17 02:53:44 -04:00
Henrik Lissner
8cd9f2281b
Refactor ielm syntax highlighting 2019-10-17 01:53:14 -04:00
Rudi Grinberg
a616e1f6ba Add syntax highlighting to ielm buffers
Taken from http://www.modernemacs.com/post/comint-highlighting/

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2019-10-13 15:17:16 +09:00
Henrik Lissner
051bceb0a8
Refactor localleader keybinds #1270
Introduces a select few of the localleader keybind standards proposed in
issue #1270, corrects a few typos and introduces more localleader
keybinds in general.

Co-authored-by: yuhan0 <>
2019-10-04 22:04:47 -04:00
Rudi Grinberg
1ffaa699f8 Fix naming convention
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2019-09-19 23:01:08 +09:00
Rudi Grinberg
46c0ec0f11 [emacs lisp] Add bindings for debugging defuns
`, d f` - turn on debugging for defun
`, d F` - turn off debugging for defun

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2019-09-19 13:58:16 +09:00
Henrik Lissner
31ccd9be78
Replace vestigial references to def-package!
def-package! is deprecated and is replaced with use-package! to reduce
confusion about its purpose and connection to use-package.
2019-09-13 22:00:34 -04:00
Henrik Lissner
1539387747
Reformat docs/api.org 2019-09-07 19:57:58 -04:00
Henrik Lissner
7c6e871035
lang/emacs-lisp: add buttercup-run-project command
And replace non-interactive buttercup-run-discover.
2019-07-27 13:06:43 +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
6a9a127b0f
lang/emacs-lisp: add popup rule for buttercup results 2019-07-26 13:59:52 +02:00
Henrik Lissner
a47351c58f
lang/emacs-lisp: add test localleader keys for buttercup 2019-07-26 03:12:06 +02:00
Henrik Lissner
017aa6a9f7
editor/rotate-text: conform to hook conventions
And add it<->xit and describe<->xdescribe rotate-text patterns (for
buttercup tests).
2019-07-24 22:13:19 +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
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
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
5005721039
lang/emacs-lisp: make company-elisp use helpful
Instead of describe-*
2019-07-22 02:30:40 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
be789caa04
Add elisp demos for Doom API in helpful buffer 2019-07-22 02:30:40 +02:00
Henrik Lissner
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
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
345d09d393
lang/emacs-lisp: don't fontify function in quoted list 2019-07-18 13:13:31 +02:00
Henrik Lissner
a201409fdd
Minor refactors across the board 2019-07-10 21:27:12 +02:00
Henrik Lissner
39faabab6a
lang/emacs-lisp: fix imenu regexp for sections
Otherwise, section labels with non-symbol characters would be excluded
from imenu's results.
2019-06-16 19:16:23 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
3073bcbe39
lang/emacs-lisp: suppress errors during flycheck 2019-05-21 17:29:29 -04:00
Henrik Lissner
3e15b71568
lang/emacs-lisp: optimize var/face highlighting
A slight performance improvement in files with a lot of comments and
strings, by skipping ahead a line if in a comment and to the next double
quote if in a string. Otherwise, this function would visit every symbol
in between, and syntax-ppss calls are relatively expensive here.
2019-05-20 21:09:12 -04:00
Henrik Lissner
08bfd5879a
Enable read-only-mode in package files
These files shouldn't be modified directly.
2019-05-20 21:09:12 -04:00
Henrik Lissner
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
Henrik Lissner
8aff431ed9
Fix "section" imenu regexp 2019-05-13 22:32:33 -04:00
Henrik Lissner
bd79f942d3
lang/emacs-lisp: fix false errors from featurep! 2019-05-03 13:39:00 -04:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
fd04f468e2
lang/emacs-lisp: reformat autoloads file
Moves public function away from interactive commands.
2019-05-01 21:02:29 -04:00
Henrik Lissner
983f081369
lang/emacs-lisp: improve imenu support
Among other things:

- Recognizes after!, ;;;###package and use-package as "Packages"
- Recognizes outline-minor-mode "Sections"
2019-05-01 21:02:29 -04:00
Henrik Lissner
6d314c2795
Revise and update docstrings and comments 2019-05-01 21:02:28 -04:00
Henrik Lissner
6b69eaa397
Minor refactors across the board 2019-04-26 17:42:44 -04:00
Henrik Lissner
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
Henrik Lissner
08c30336d2
Apply elisp-demos to describe-function-1 as well 2019-03-16 23:59:51 -04:00
Henrik Lissner
784ae418da
Fix wrong-type-argument on +emacs-lisp-eval
When using +eval commands in file-less buffers, like the scratch buffer.
2019-03-15 16:15:17 -04:00
Henrik Lissner
d868f5fd10
Use new ;;;###package cookie
This will later be used for doom/describe-packages to list all locations
where a package is being configured (along with def-package! and after!
blocks).
2019-03-13 01:55:50 -04:00
Henrik Lissner
71069d6dcd
Merge pull request #1239 from flatwhatson/add-elisp-demos
Add elisp-demos to lang/emacs-lisp module
2019-03-12 11:31:44 -04:00
Henrik Lissner
e1f4668c0b
Remove redundant :commands
The elisp-demos package autoloads elisp-demos-advice-helpful-update
2019-03-12 11:31:25 -04:00
Henrik Lissner
6afe3d4115
Remove unneeded negation 2019-03-12 11:25:48 -04:00