Commit graph

33 commits

Author SHA1 Message Date
Henrik Lissner
653161fe2e
lang/org: refactor org config load order
- No longer use org-load-hook; it was unnecessary and there were corner
  cases where org would get loaded before hooks were added to it.
- Update comments
- Remove config that was redundant with org's defaults (wrt org-file-apps)
- Perform persp-mode check before using persp-mode API in
  +org|exclude-agenda-buffers-from-workspace advice.
- Update outdated smartparens config and move it out of
  org-mode-hook (only needs to be run once, not everytime org-mode is
  enabled)
- Autoload mode hooks
2019-04-10 18:47:21 -04:00
Henrik Lissner
fa26dc1269
Refactor lang/org 2019-03-08 02:37:33 -05:00
UndeadKernel
5d4dec996f org: let ob-async ignore ob-ipython
ipython implements its own `async` keyword. As ob-async is loaded now by
default, we need to explicitly tell ob-async not to touch ob-ipython blocks.
2019-01-09 14:14:39 +01:00
Henrik Lissner
d6cb0ec5f5
General cleanup & minor refactoring 2018-12-22 04:25:15 -05:00
Henrik Lissner
ced8f94830
lang/org: improve ob-async lazy loading
ob-async adds its own advice around org-babel-execute-src-block, which
directly interferes with Doom's lazy loader for babel
packages (sometimes bypassing it entirely). This ensures it can't do
that.
2018-12-10 18:09:28 -05:00
Henrik Lissner
2d13dbe10a
lang/org: fix ob-async support
ob-async uses org-babel-load-languages to load babel packages in a child
process, but packages entered into the org-babel-load-languages variable
by Doom's lazy loader were misnamed. This caused load errors in the
child process.

The language-to-package resolution is now performed before it is entered
into org-babel-load-languages. Additionally, ob-async will now be lazy
loaded if it is available (and fail silently otherwise).
2018-12-10 13:50:58 -05:00
Henrik Lissner
ed1775b42d
lang/org: refactor +babel/ipython library
+ Conform ipython advice and helpers to naming conventions.
+ Refactor out dash.el usage
2018-09-21 22:38:21 -04:00
Henrik Lissner
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
Henrik Lissner
9d74ede286
lang/org: remove second org-src popup rule
And rearrange ipython rules
2018-08-08 18:02:20 +02:00
Henrik Lissner
4941e327f4
General refactor for readability
+ Removes redundant/unhelpful comments
+ Renames functions, hooks and variables to be self-documenting
+ Use add-to-list to ensure idempotency (and is more performant)
2018-07-09 15:33:31 +02:00
Henrik Lissner
f6dc6ac74e
Refactor out map.el usage
After some profiling, it turns out map-put and map-delete are 5-7x
slower (more on Emacs 25) than delq, setf/alist-get and add-to-list for
small lists (under 250 items), which is exactly how I've been using
them.

The only caveat is alist-get's signature is different on Emacs 25, thus
a polyfill is necessary in core-lib.
2018-06-23 19:53:54 +02:00
Henrik Lissner
7a98919597
Fix quoting in babel popup rules
Reported by @fuxialexander
2018-06-19 20:50:16 +02:00
Henrik Lissner
6808c46b58
💥 Change set-popup-rule! usage
Now accepts a flat plist of all its former parameters, including new
:parameters and :actions properties to increase your control over the
fate of your windows.

The old usage of set-popup-rule! is deprecated and may not work right!

The :ui popup module has also seen a major refactor to improve
efficiency and load times.

Sorry! This is the last "big" change before 2.1!
2018-06-18 02:34:16 +02:00
Henrik Lissner
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
Henrik Lissner
1e81a35461
Minimize dependence on map!
This is in preparation for general.el integration coming in 2.1.1. It is
very likely that map! will change (and even more, be split into several
macros). Not much, but change none-the-less. Specifically, the state
keywords (e.g. :nvi, :n, :i) will be removed in favor of a :state
property that takes a list, e.g. (normal visual insert).

In any case, both map! and general are also relatively expensive
compared to define-key and evil-define-key* (and the new define-key!
macro), so use that when we can.

This also means changes to either API won't affect Doom's modules in the
long term.
2018-06-03 15:46:00 +02:00
Henrik Lissner
5c8ff3ada3
Fix wrong-type-arg error from #+call() in org-mode #634
By rewriting the org babel library lazy-loader.
2018-05-31 17:25:59 +02:00
Henrik Lissner
ebfc5648ef
lang/org: major refactor of +ipython feature 2018-05-30 18:14:48 +02:00
Henrik Lissner
98b439e3bb
Refactor lang/org +babel lazy loader for src blocks
Exposes +org-babel-load-functions, which are a list of functions that
will be tried in order to load the dependencies of a src block.
2018-05-30 18:11:12 +02:00
Henrik Lissner
947fe345c3
Minor, general refactor
In some contexts, map-put is superior to add-to-list.
2018-05-29 15:34:13 +02:00
Henrik Lissner
84befc0303
lang/org: map bash src blocks to ob-shell 2018-05-18 01:43:16 +02:00
Henrik Lissner
d7e054a8cc
lang/org: alias sh => ob-shell 2018-04-08 22:21:25 -04:00
Henrik Lissner
0d04afa63a
lang/org: don't complain about missing ob-X upon running src blocks 2018-02-09 23:24:37 -05:00
Henrik Lissner
0cc3b34fa2
lang/org: fix errors lazy-loading mismatched babel libraries
The ob-C.el library takes care of C, C++ and D. This modifies the babel
lazy-loader to take this into account. Name => library mappings are
defined in +org-babel-mode-alist.
2018-01-28 17:20:28 -05:00
Henrik Lissner
78cb47a072
lang/org: lazy-load babel libraries
Removes +org-babel-languages and no longer eagerly loads babel
libraries. If an ob-*.el exists for the language, it will be loaded once
you execute its src block.

Warning: this may interfere with tangling. An unloaded library can't
register a language extension in org-babel-tangle-lang-exts (if any).
This means babel won't be able to figure out the correct file extension
for certain src blocks.

Either load the package explicitly or provide a filename + extension for
the TARGET-FILE argument:

  (require 'ob-rust)
  (org-babel-tangle-file "notes.org")
  ;; or
  (org-babel-tangle-file "notes.org" "notes.rs")
2018-01-28 15:45:31 -05:00
Henrik Lissner
6853196017
lang/org: general refactor; split init into hooks
lang/org's initialization process is now split up into hooks on
org-load-hook. This approach is cleaner and easier to customize. I also
removed the escape binding in org-agenda-mode-map, as the popup system
makes it redundant.
2018-01-08 20:41:56 -05:00
Henrik Lissner
cd7bd7628f
lang/org: refactor org init process
after! org is more reliable than org-load-hook.
2017-12-09 14:42:46 -05:00
Henrik Lissner
b111303d20
Move modules/org/* back to lang/org 2017-12-08 23:14:13 -05:00
Henrik Lissner
d2d4166b42
Move lang/org => org/*
Since lang/org has grown (and is expected to grow much, much more), it
has been given its own module category.

Concerns #129, #138
2017-07-05 12:26:08 +02:00
Henrik Lissner
eff937432e
Optimize lang/org: lexical-binding = t; cl-case => pcase 2017-06-10 01:52:44 +02:00
Henrik Lissner
5add3c3805 lang/org: cleanup & refactor 2017-05-19 03:29:00 +02:00
Henrik Lissner
5beb74b14d lang/org: improve org-edit-src-code & general org-mode popup integration 2017-05-13 00:12:23 +02:00
Henrik Lissner
448cab5f57 lang/org/+babel: add missing org-babel-get-header fn (temporary fix) 2017-04-27 18:03:37 -04:00
Henrik Lissner
85a6c6e3b6 lang/org: add +babel.el 2017-04-11 08:28:02 -04:00