Commit graph

171 commits

Author SHA1 Message Date
Wetlize
0a2ed4d346
lang/emacs-lisp: Replace sym with var in +emacs-lisp-log-unsafe-local-variables-a
Otherwise it will make Emacs to error with (void-variable sym) error when
checking the variable.
2021-05-06 13:04:15 +03:00
Henrik Lissner
b63441387b lang/emacs-lisp: don't use risky-local-variable-p
It's hardcoded to return t for symbols that end in any of '-command',
'-frame-alist', '-function', '-functions', '-hook', '-hooks', '-form',
'-forms', '-map', '-map-alist', '-mode-alist', '-program', or
'-predicate' -- which I think is excessive next to a safety check.

I'll trust that: if the user marks X as safe, and it isn't *explicitly*
marked risky, and it destroys the universe, then it's their fault, not
mine, not Emacs'.
2021-05-06 04:27:33 -04:00
Henrik Lissner
ccf6f0b53d Log unsafe eval forms in file/dir local variables 2021-04-29 13:25:48 -04:00
Henrik Lissner
5e7864838a Ignore unsafe local variables, but log them
This suppresses the annoying "do you want to apply these unsafe file/dir
local variables" prompt by ignoring them (but stills them so at least
users are told).

Fixes issue mentioned in #4335
2021-03-21 00:42:49 -04:00
Nikita Bloshchanevich
169d0b2ed5 Emacs lisp: fix variable value display in eldoc
`fboundp' does not check if a variable is bound, but rather a function.
Use `boundp'.
2021-03-06 16:29:07 +01:00
Henrik Lissner
1c8451e509 Move docs/api.org to emacs-lisp module 2021-01-18 17:45:29 -05:00
Nikita Bloshchanevich
b12df73cc1 Emacs-lisp eldoc: fix error if symbol unbound
`+emacs-lisp-append-value-to-eldoc-a' `error's if the symbol isn't
bound, because `symbol-value' errors in that case. Fix that bug by only
modifying the result of `elisp-get-var-docstring' if the symbol is
bound.
2021-01-04 12:08:53 +01:00
Nikita Bloshchanevich
345327ae8b Use max', not min'
`min' puts a lower bound on LIMIT, but we want an upper bound, so `max' must be
used.
2020-11-29 19:55:41 +01:00
Nikita Bloshchanevich
49f4461daa Elisp `eldoc': fix "Invalid format operation %-"
In `+emacs-lisp-append-value-to-eldoc-a', if the `frame-width' of the minibuffer
is smaller than the length of the documentation + " [...]" + 1, a negative
maximum %s bound is passed, causing the error in the title.

Fix this by clamping the computed LIMIT to 0.
2020-11-29 09:37:11 +01:00
Henrik Lissner
7081d833f6
Move :ui pretty-code to :ui ligatures
Includes a major refactor of the module.
2020-08-20 02:14:32 -04:00
Henrik Lissner
b8c20d50fe
Fix unreadable indentation in native elisp files 2020-08-02 18:58:58 -04:00
Andrew Whatson
b9a1563746 Define lookup handlers for lisp-interaction-mode 2020-06-10 00:19:51 +10:00
Henrik Lissner
8bf902d5f4
General refactors & reformatting across the board 2020-06-04 20:13:28 -04:00
Andrew Whatson
595c055953 Add lookup handlers for IELM 2020-05-28 11:53:48 +10:00
Henrik Lissner
ada4110730
Refactor :lang emacs-lisp 2020-05-25 03:43:40 -04:00
Henrik Lissner
a80ae71b05
Append elisp variable's value to eldoc 2020-05-06 21:01:04 -04:00
Henrik Lissner
a634e2c812
Indent elisp plists more sensibly 2020-04-30 15:54:36 -04:00
Henrik Lissner
45cdfb1258
Bump :core
spudlyo/clipetty@7ee3f9c -> spudlyo/clipetty@01b3904
bbatsov/projectile@eec569d -> bbatsov/projectile@5cd261d
noctuid/general.el@14ad4c8 -> noctuid/general.el@42e3803

We're also transitioning from abbreviated SHA1 hashes to full ones,
because underlying git machinery in future updates of straight will
require it (e.g. to obtain shallow clones of pinned packages).
2020-04-29 23:48:21 -04:00
Henrik Lissner
b78fc4eb76
Minor refactor & reformatting across the board 2020-04-08 15:30:10 -04:00
Henrik Lissner
7e40c1ebe3
Fix #2752: self-aborting company-box/docs 2020-04-02 00:46:58 -04:00
yoavm448
f543ed8c2e Set elisp lookup for helpful-mode 2020-02-26 23:29:32 +02:00
Henrik Lissner
12094788d7
Fix references to :tools fly{spell,check} 2020-01-14 03:04:26 -05:00
Henrik Lissner
062cc4aea5
Notify straight that package was modified
When you edit its files.
2020-01-06 22:49:54 -05:00
Henrik Lissner
5929e5b75a
Add undefadvice! macro for rotate-text convenience 2020-01-01 19:34:33 -05:00
Henrik Lissner
fe1642e854
Add special goto def/docs support in doom! blocks
- Pressing gd on a module in your doom! block will now browse that
  module's directory.
- Pressing K on a module will jump to that module's documentation, if any.
- Pressing K on a module flag will jump to that flag's description
  within that module's documenation.
- This is now explained in init.example.el

Closes #2249
2019-12-26 01:41:45 -05:00
Henrik Lissner
213a6fda86
General refactors & reformatting 2019-12-22 23:53:04 -05:00
Henrik Lissner
322bca710a
General refactors & reformatting 2019-12-20 00:59:52 -05:00
Henrik Lissner
4478fceaf5
lang/emacs-lisp: add 'SPC m e l' & 'SPC m g l'
For loading libraries and jumping to their source code.
2019-10-25 20:25:20 -04:00
Henrik Lissner
bdd9d91f72
lang/emacs-lisp: remove extraneous macrostep keybind
`e` is more than enough
2019-10-20 10:58:53 -04:00
Henrik Lissner
ec4d144edd
lang/emacs-lisp: fix syntax error
Due to extra parenthesis.
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
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