Commit Graph

129 Commits

Author SHA1 Message Date
798df6bc9e feat(org): follow citations on +org/dwim-at-point
As discussed in #5290, pressing RET on citations (or citation
references) will now follow them.

Ref: #5290
2021-11-25 01:22:58 +01:00
cd87cc0cc8 refactor: remove redundant org code
org-collect-keywords does the job here. No need to reinvent the wheel.
2021-07-28 12:42:22 -04:00
ce905b9246 Expand latex snippets in org-mode fragments on TAB 2021-07-25 15:41:29 -04:00
60b595321e Lazy-load yasnippet harder for faster first-file load time
+ Rather than waiting for the first "interactive" major mode to be
  visited to activate yas-minor-mode, we wait until the first time the
  user invokes a snippet command to activate yas-global-mode.
+ yas-reload-all is one of the bottlenecks when loading a file for the
  first time. Deferring it further should help with this.
+ yas-global-mode reaches more major modes than our former list of
  hooks (fixes #5140).

Closes #5140
2021-06-05 13:12:00 -04:00
805810b95f lang/org: tab = cycle folds if in emacs state
Tab should only be changed for evil users in insert mode, since they
have fold cycling functionality available in normal mode and vanilla
users do not.
2021-05-31 14:22:54 -04:00
1d155d0c2f lang/org: reveal ancestors of point after saveplace
When opening an org file and the point is placed in a folded region (by
saveplace), it reveals the current subtree. Instead, it will reveal the
current subtree *and* its ancestors (and their siblings), which is more
intuitive.
2021-04-21 21:45:04 -04:00
aafed6d8a0 lang/org: call push-button on buttons in org-mode 2021-03-22 01:24:26 -04:00
d149c59d2e Add emacs mode checks to insert mode checks
This is to accommodate users who default to emacs mode, rather than
insert mode. The two are also very alike, so many of these checks should
apply to both (almost) equally.
2020-12-11 17:38:09 -05:00
68b1594553 Fix #4220: void-function org-clocking-p
On first invocation of +org/toggle-last-clock, before org-clock has
loaded.
2020-11-06 02:29:37 -05:00
91ab02951d Minor refactors across the board 2020-08-20 03:43:50 -04:00
14d9786360 Respect org-hierarchical-todo-statistics 2020-08-14 00:40:32 -04:00
8ae0e79918 lang/org: add eval handler
With this, gr and gR will now work in babel blocks to execute a subset
of the block (or the whole thing, if you'd like). Results are displayed
in a popup buffer (or overlay if :tools (eval +overlay) is enabled).
2020-08-05 18:26:07 -04:00
863eb82efd S-RET -> insert literal newline
A convention on many text editors and applications is to make RET
auto-indent new lines. That has already been done. Another convention is
for S-RET to insert an unindented line; this commit adds this convention
to Doom.

Relevant to #3694
2020-08-05 18:26:06 -04:00
d81ef69525 Fix #3693: don't unfold archive trees on file-open
Also refactors +org-make-last-point-visible-h to be more realistic about
when it should and shouldn't expand the hidden region at point. Since
org-agenda-inhibit-startup is now non-nil by default it makes no sense
to test it (and it was a poor choice to begin with).

Plus, instead of using outline's API, better to use org's, even if
they're aliases or wrappers. Less of a maintenance burden.
2020-08-05 15:00:34 -04:00
0e73297707 lang/org: fix edge case in +org--insert-item 2020-07-27 03:07:04 -04:00
b2e11f9a72 Revise docstrings for org hooks 2020-07-26 16:17:04 -04:00
12e414be89 Rename +org/toggle-clock -> +org/toggle-last-clock
And rewrite it to ask for confirmation before clocking in on the item at
point. Without this, it's much harder to see what exactly it's doing.
2020-07-26 15:55:11 -04:00
076cee4e89 Revise +org--insert-item
Which powers +org/insert-item-below and +org/insert-item-above.
2020-07-26 15:44:42 -04:00
afcf56a610 Redesign dwim RET on org headings
In an effort to make +org/dwim-at-point more useful and intuitive.

- Fix latex preview toggling in subtree
- Toggle inline images more selectively
- Clean up after itself (delete overlays)
- Update +org/dwim-at-point docstring
- Always update todo statistics, cookies, checkbox counts and ToC.
2020-07-24 19:27:50 -04:00
8e34998433 Fix #3254: RET not invoking org-goto-ret in org-goto buffer 2020-05-31 22:25:55 -04:00
ea18c83c0a General refactors & reformatting across the board 2020-05-15 01:44:53 -04:00
a10c157d87 Fix zr, zm, zR & zM vimmish folding in org-mode
Fixes the following keybinds for evil users:

z r        open next level of headings buffer-wide
z m        close next level of headings buffer-wide
z R        open all folded headings
z M        close all folded headings
[N] z R    open all headings at level N and above
[N] z M    close all headings at level N and below
2020-05-13 19:31:09 -04:00
31e4bfb2d4 Don't unfold to 2nd level in org-mode by default
This is too opinionated to be a default, and has thus been replaced with
"unfold subtree around point when opening an org file", in case
saveplace has restored the point to a folded region.
2020-05-11 03:00:08 -04:00
7662de55d8 Fix yasnippet breaking org-superstar
Because yasnippet has a delete first and ask never policy for cleaning
up overlays in the buffer.
2020-04-17 02:41:10 -04:00
f02d28543b Remove reference to org-bullets
Package was replaced in 5c4f3c62a
2020-04-15 18:21:50 -04:00
169fe6a7f4 lang/org: revise docstrings 2020-04-14 15:37:00 -04:00
da427a1b95 Fix #2880: RET on links in other elements 2020-04-11 14:43:58 -04:00
8332daccee make +org--insert-item respect emacs-mode
No change of behaviour in non-emacs modes, but in emacs-mode stays there
   instead of switching to insert-mode.
2020-01-25 19:38:33 +02:00
d84df72364 Dumb indent on TAB when in middle of subtree 2020-01-01 21:19:22 -05:00
07823d00a7 Fix yasnippet expansion in org src blocks
This is hacky, and causes weirdness with org-bullets-mode, but it works.
2020-01-01 21:19:22 -05:00
b9f90b3a1a lang/org: clear src block results on TAB
When cursor is inside a src block. e.g.

  #+BEGIN_SRC elisp  <-- not here
  (message "hi")     <-- in here
  #+END_SRC          <-- not here
2019-12-30 00:07:19 -05:00
73d975de6c lang/org: make C-RET create headings instead of error 2019-12-20 02:13:11 -05:00
6cf17b1237 config/default: rebind 'SPC n {c,C,n,S}'
'SPC n c' -> Toggle last org clock
'SPC n C' -> Cancel current org clock
'SPC n n' -> org-capture
'SPC n S' -> Search org-directory headings

Closes #2043
2019-12-06 13:38:57 -05:00
26c8f5c6ef Bytecompiler bytecompiler, won't you shut up 2019-11-23 01:21:25 -05:00
30f72da02a Fix No such file org-version.el errors #2010
We generate an org-version.el file, rendering our old org-release hacks
unnecessary. This may cause breakages for uses who do deep clones of
org-plus-contrib; needs testing.
2019-11-19 20:29:22 -05:00
7879a93081 lang/org: preserve TODO keyword on C-RET
Rather than reverting to first TODO keyword.
2019-11-12 15:24:02 -05:00
f70f788df3 lang/org: don't auto-demote headings on C-RET
This can be harder to predict. Instead, use TAB and S-TAB after-the-fact
to adjust heading level.
2019-11-12 15:24:01 -05:00
4703992002 Suppress missing-file org-version errors 2019-11-04 00:37:25 -05:00
0b8e7a27b6 Minor refactoring/reformatting across the board 2019-10-31 14:35:07 -04:00
9b3f21a9bc Optimize doom/help-search
Yields a ~80% decrease in indexing time.
2019-10-26 02:12:58 -04:00
5f00db871e lang/org: major refactor & add org-fancy-priorities package
- Fixes an issue where evil bindings weren't working in org-mode
- Significantly slims down on unnecessary keybinds
- Remove +org-init-keybinds-for-evil-h hook and reli more on our new
  evil-org fork, which has upstreamed some of our changes.
- Documents undocumented functions, remove unnused ones, and reorganize
  org's autoload libraries by convention.
- Adds org-fancy-priorities for more elegant (and subtle) priority
  display than ugly [#A] tags.
2019-10-25 20:25:20 -04:00
e10cd8cf2e Insult byte-compiler's mom
Yeah, that shut him up.
2019-09-20 23:10:53 -04:00
f816149589 lang/org: update +org/remove-link
To reflects changes made upstream, in org.
2019-09-07 19:57:58 -04:00
9ab49be564 Fix "fatal: no names found" errors on 'doom rebuild'
Some packages that depend on org (like elfeed) will load the built-in
org early in the rebuild/package install process, which causes org to
define org-release and org-git-version, sometimes overwriting our stubs
for it. Without our hack, org call 'git describe' in the org repo in an
attempt to determine the installed version, which won't work in a sparse
clone. To ensure future definitions never overwrite ours, we advise them
as well.

Also moves magit-version hack to its autoload file, for consistency with
org's hacks.
2019-08-07 16:31:45 -04:00
09d67f86d9 lang/org: move org-release hack back to config.el
We don't need it available *that* early.
2019-07-29 15:05:26 +02:00
ead0b1ce15 lang/org: correct paths in comment headers 2019-07-27 17:06:55 +02:00
302ec4e97a lang/org: fix and autoload org-release hack
- Lazy load all the things.
- Now org-release return a sane version string, which should address
  packages using it to version check org.
2019-07-23 18:36:18 +02:00
8147bc1aee 💥 lang/org: conform to new name conventions 2019-07-22 02:30:38 +02:00
e81cdc0523 lang/org: prioritize checkboxes lower in dwim command
Otherwise, checkboxes take priority over links, clocks or tables.
2019-07-13 02:24:11 +02:00
11bfb17894 lang/org: major refactor
The motivation for this change was to rethink lang/org's flags. Many of
its former flags represented non-features. Therefore, its flags have
been reduced to five: +dragndrop, +ipython, +pandoc, +gnuplot and
+present. Everything else is included as org-load-hooks and treated as
reasonable defaults.

Other changes:
- Fixes #1502: don't autopair certain pairs when in a math region
- Fixes #1483: broken localleader in org-agenda
- Adds gnuplot support #1108
- Doom's org submodules have been moved into lang/org/contrib/, because
  I expect there will be *many* more to come, and I don't want to
  pollute the moudle's root.
2019-06-28 17:28:28 +02:00