Commit graph

243 commits

Author SHA1 Message Date
Henrik Lissner
522c532893
Correct add-hook!'s docstring 2020-01-20 05:41:42 -05:00
Henrik Lissner
fd6def4d5a
Fix letenv! macro
It didn't work due to over-aggressive quoting of the let-vars.
2020-01-01 23:48:36 -05:00
Henrik Lissner
5929e5b75a
Add undefadvice! macro for rotate-text convenience 2020-01-01 19:34:33 -05:00
Henrik Lissner
a999a0ddd6
General refactors & comment revision 2019-12-19 14:51:34 -05:00
Henrik Lissner
8224f14d92
Expand on lambda!/lambda!!'s docstrings 2019-12-13 14:35:28 -05:00
Henrik Lissner
4bcc9e1a94
Add letenv! macro for lexical envvars 2019-12-08 20:14:11 -05:00
Henrik Lissner
99cd52e70f
💥 Drop Emacs 25.x support
Emacs 26.1 is Doom's new minimum supported version

Closes #2026
2019-11-08 16:02:06 -05:00
Henrik Lissner
b0ac9abfbf
Fix add-hook! for hooks that take arguments 2019-10-28 23:23:13 -04:00
Henrik Lissner
f4acb3cefd
New add-load-path! convenience macro 2019-10-23 04:24:06 -04:00
Henrik Lissner
e1622142ed
Minor, general refactors 2019-10-23 03:57:48 -04:00
Henrik Lissner
ddce674a6c
Minor refactors across the board 2019-10-07 16:10:33 -04:00
Henrik Lissner
8527897c88
Remove unused delete! macro
Redundant with delq!
2019-10-06 14:13:30 -04:00
Maximiliano
dea5d84069 Add more api demos (#1845)
* Added function Demos
* Added use-package demos
* Some corrections
* Fix duplicated use-package! type
2019-10-03 14:51:08 -04:00
Henrik Lissner
ac276bcd3c
Correct eldoc signature for {add,remove}-hook! 2019-09-19 13:01:20 -04:00
Henrik Lissner
62b089ba36
Refactor core & core-lib
And make their tests pass
2019-09-03 00:59:46 -04:00
Henrik Lissner
4b736bef68
Introduce doom-interactive-mode
As soft inverse alias for noninteractive; this makes it easier to unit
test functionality that depends on the session type.
2019-09-03 00:37:30 -04:00
Henrik Lissner
8cb1fe1874
Add setq! macro
A convenient alternative to setq where you don't have to care about load
order (no need for after! blocks).
2019-08-27 00:08:22 -04:00
Henrik Lissner
ca574c60b0
Fix pushnew! inserting duplicates of complex types
Because it was using #'eql for comparison, which is insufficient for
compound datatypes, like strings.
2019-08-27 00:05:12 -04:00
Henrik Lissner
a567e2f85e
Remove pushmany! macro
It is redundant with prependq!, appendq! and pushnew!.
2019-08-27 00:05:12 -04:00
Henrik Lissner
aff5cc5b28
Move file-exists-p! to core/autoload/files.el 2019-08-22 13:03:12 -04:00
Henrik Lissner
856a2afe43
Add delete! convenience macro
And polish delq!'s docstring.
2019-08-11 02:05:09 -04:00
Henrik Lissner
87358db85e
Fix void-function mapcan on Emacs 25.x 2019-08-07 16:54:47 -04:00
Daniel Koning
2d28808121 Correct argument name in `defadvice!' docstring 2019-08-05 18:27:56 -05:00
Henrik Lissner
99c73cea0b
setq-hook!: don't append setq hooks
Now settings can take effect in time for hooks that could see them.
2019-07-29 21:09:23 +02:00
Henrik Lissner
3c36a345d8
Fix file! not returning filename in some cases
There are scenarios where load-file-name is set, but load-in-progress is
not. It is safe to assume the value of load-file-name is always what we
want.

Also: file! now throws an error if it can't find the directory.
Otherwise we have to deal with roundabout errors from other places that
expect file! to never fail.
2019-07-27 17:00:12 +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
a146e61728
Remove DIR!, FILE! and def-advice! obsolete aliases 2019-07-26 03:12:07 +02:00
Oleksii Filonenko
62741a4214
Remove quoting in λ!! 2019-07-25 20:50:54 +03:00
Henrik Lissner
b8837ac022
Fix keyword type check in doom-keyword-name 2019-07-24 15:26:43 +02:00
Henrik Lissner
d55f284386
Refactor file-exists-p macro
And refactor too doom--resolve-path-forms
2019-07-23 20:43:24 +02:00
Henrik Lissner
d95acb4caa
Change λ!! to a function
It doesn't need to be a macro
2019-07-23 19:09:29 +02:00
Henrik Lissner
58ab20ec5f
Fix prependq!
Used one too many levels of nesting
2019-07-23 18:10:40 +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
6f56b9f9d4
Add autoload/themes.el library 2019-07-23 14:31:00 +02:00
Henrik Lissner
83763414fb
Improve docstring for def-advice! functions
Now lists linked functions that the advice was defined with.
2019-07-23 14:12:01 +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
6200f5d876
Move file functions in core-lib to autoload/files 2019-07-22 23:22:55 +02:00
Henrik Lissner
be2ade62d2
Add polyfill for Emacs 26+ alist-get 2019-07-22 23:22:54 +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
be789caa04
Add elisp demos for Doom API in helpful buffer 2019-07-22 02:30:40 +02:00
Henrik Lissner
492f2dea1e
core-lib: add nconcq! macro 2019-07-22 02:30:40 +02:00
Henrik Lissner
e8ecf65cf9
core-lib: add pushmany! macro, refactor pushnew! 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
3404899ec3
core-lib: add doom-partial & doom-rpartial functions 2019-07-22 02:30:39 +02:00
Henrik Lissner
ee10b3b0d9
core-lib: add doom-{glob,path,dir}, replace {file,dir}!
- file! replaces FILE!
- dir! replaces DIR!
- doom-{glob,path,dir} have the power to construct paths out of the
  segment pieces provided to it.
- Move doom-files-in to core-lib and refactor to use the above.
2019-07-22 02:30:39 +02:00
Henrik Lissner
602e2f31c7
core-lib: refactor pushnew! macro
Do a little more work at expand-time.
2019-07-22 02:30:39 +02:00
Henrik Lissner
3306eaa17c
core-lib: refactor defer-until!, add-transient-hook!
Now uses an interned hook name (that could be removed, unlike the
uninterned symbol make-symbol creates).

Also, for consistency: fun -> fn

No fun allowed!
2019-07-22 02:30:39 +02:00
Henrik Lissner
b742bf086f
core-lib: add prependq! and appendq! macros 2019-07-22 02:30:39 +02:00
Henrik Lissner
0f98b5b3c2
core-lib: use projectile cache in file-exists-p!
If available.
2019-07-22 02:30:39 +02:00
Henrik Lissner
f05aa3a0b1
core-lib: add unsetq-hook! #1568 2019-07-22 02:30:39 +02:00