Commit graph

603 commits

Author SHA1 Message Date
Henrik Lissner
aa54383b5d
refactor: deprecate doom-etc-dir for doom-data-dir
doom-etc-dir will be renamed to doom-data-dir, to better reflect its
purpose, and align it with XDG_DATA_HOME (where it will be moved to in
v3, where Doom will begin to obey XDG directory conventions more
closely).
2022-08-14 20:43:35 +02:00
Henrik Lissner
a5c80fcb4b
refactor: deprecate doom-private-dir for doom-user-dir
- Deprecates the doom-private-dir variable in favor of doom-user-dir.
- Renames the pseudo category for the user's module: :private -> :user.
- Renames the doom-private-error error type to doom-user-error.

Emacs uses the term "user" to refer to the "things" in user space (e.g.
user-init-file, user-emacs-directory, user-mail-address, xdg-user-dirs,
package-user-dir, etc), and I'd like to be consistent with that. It also
has the nice side-effect of being slightly shorter. I also hope
'doom-user-error' will be less obtuse to beginners than
'doom-private-error'.
2022-08-14 20:43:35 +02:00
Henrik Lissner
ad6a3d0f33
refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
2022-08-14 20:43:35 +02:00
Henrik Lissner
0ebf254f4e
fix(org): enable evil-org-mode in doom-docs-org-mode
So (evil) readers can get its benefits too.
2022-08-08 18:24:56 +02:00
Henrik Lissner
a71e757c8d
fix(org): create org-persist-directory recursively
`org-persist-write:index' does not recursively create
`org-persist-directory', causing `make-directory` to throw a
file-missing if a parent directory is missing.

Fix: #6635
Ref: bzg/org-mode@edd7f2962f
2022-08-05 18:13:48 +02:00
Henrik Lissner
1f8bf7accb
merge: rewrite-docs
I've omitted docs/*.org from this merge, as there is still work left to
do there, but I am pushing the module docs early so folks can benefit
from the new docs sooner.
2022-08-03 03:27:50 +02:00
Henrik Lissner
b777300e2c
tweak(org): move org caches to {doom-cache-dir}/org/
Instead of separate {doom-cache-dir/org-*/ directories.
2022-08-03 03:09:26 +02:00
Henrik Lissner
dd83c455ba
fix(org): update +org--more-startup-folded-options-a
With the introduction of org-fold, this advice (which adds support for a
special family of visibility #+startup options) needed to be updated.
2022-07-26 00:54:25 +02:00
Henrik Lissner
9d1df5f298
nit: minor refactors & comment/docstring revisions 2022-06-21 14:40:15 +02:00
Henrik Lissner
d6d1e600c0
fix(org): org-protocol not triggering for its uris
A more elegant solution will have to wait until the CLI rewrite (where
modules can supply patches for its packages, then I could hoist
org-protocol-check-filename-for-protocol into the autoloads file using
autoload cookie magic).

Fix: #6481
Fix: #5997
2022-06-21 03:04:28 +02:00
Henrik Lissner
eb7329d912
fix(org): unbalanced parenthesis
Causing odd org related errors at startup or 'doom doctor'.

Amend: fb1c8eb11d
2022-06-20 03:45:46 +02:00
Henrik Lissner
fb1c8eb11d
fix(org): lazy loading of org-protocol
First, removal of the old org-protocol advice needed to be updated,
because org-protocol-detect-protocol-server was renamed to
org--protocol-detect-protocol-server upstream.

Second, I only noticed now that our lazy loader for org-protocol wasn't
active until Org was loaded, which was far too late, and meant
org-protocol wasn't working out of the box. This fixes that.
2022-06-20 01:55:21 +02:00
NightMachinery
ff7ae66372
fix(org): make last arg of +org--follow-search-string-a optional
To accommodate the optional second argument of org-roam-id-open in
org-roam-v1.

Ref: 946a879a4a/org-roam.el (L1140)
2022-06-18 17:25:22 +02:00
Henrik Lissner
e855c2d132
fix(org): update +org--export-lazy-load-library-h
org-babel-exp-src-block's signature changed upstream, in org-mode (to
accept one optional argument), so the advice must adapt.

Amend: 373386173a
2022-06-18 15:00:43 +02:00
Henrik Lissner
59d3d8e8da
tweak(org): remove redundant eldoc-mode activation 2022-06-17 18:21:23 +02:00
Henrik Lissner
aed2972d74
fix(org): don't show parent trees by default
Instead of changing the behavior of the showNlevels startup options,
I've added a new set of showNlevels* options to perform the new behavior
of unfolding parent trees all the way up to the target level.

Ref: https://www.reddit.com/r/emacs/comments/tj0na6/comment/i1laya6/?utm_source=reddit&utm_medium=web2x&context=3
2022-03-22 02:49:09 +01:00
Henrik Lissner
aeef05bfd7
feat(org): add ::SEARCH support to id: links 2022-03-19 16:43:28 +01:00
Mora Unie Youer
18f74d277f
feat(org): keybinds for removing #+RESULTS blocks
Added new keybinds for easy removal of RESULTS blocks in org-mode.

SPC m k - delete RESULTS block under cursor
SPC m K - delete all RESULTS blocks under cursor
SPC u SPC m K - delete all RESULTS blocks in buffer
2022-03-19 16:19:54 +01:00
Henrik Lissner
bdac4466f8
tweak(org): move org-persist-directory to doom-cache-dir 2022-02-19 01:08:08 +01:00
Henrik Lissner
9217bb81f4 fix(org): org-babel-do-in-edit-buffer deleting popups
Fix: #6061
2022-02-10 21:28:55 +01:00
Henrik Lissner
9672dbcb5e refactor(org): name anonymous keybind on RET
Makes it easier to advise, swap, or reference.
2022-02-10 21:07:20 +01:00
Henrik Lissner
8179dc641e fix(org): better-jumper support for more links
Doom sets jump points before following most org links. This allows you
to jump back to where you were afterwards using
C-o (better-jumper-jump-backward) or forward with
C-i (better-jumper-jump-forward). It does this by setting a jump point
on the org-open-at-point-functions hook.

However, not all org links' :follow handlers trigger this hook (like id:
or roam: links), and you can get around it by triggering link opener
handlers directly (with M-x org-goto). Most of these link openers use
org-mark-ring-push to record jump points in org's own jumplist, so
advising it to call better-jumper-set-jump should address more of these
fringe cases.

Fix: #6098
2022-02-10 21:07:20 +01:00
Henrik Lissner
5941a41fd9 tweak(org): larger capture/src popups by default 2022-02-06 03:27:08 +01:00
Henrik Lissner
9cfd798076 fix(org): unbalanced parens
A regression caused by typo in 451be94.

Amend: 451be94fb8
2022-01-30 02:42:54 +01:00
Henrik Lissner
9dbdb854b9 fix(org): bounds for inline images in babel results
org-babel-result-end can return the wrong position if cursor is in a src
block (which is where it will be when org-babel-after-execute-hook
triggers).

Amend: 451be94fb8
2022-01-29 18:43:40 +01:00
Henrik Lissner
2c06577edf fix(org): type error when refreshing images in src results
Ref: 451be94fb8
2022-01-29 04:07:21 +01:00
Henrik Lissner
451be94fb8 fix(org): out-of-bounds refreshing inline images
A regression caused by 6934014, due to
org-babel-where-is-src-block-result returning a position after
org-babel-result-end.

Fix: #6046
Amend: 69340149f9
2022-01-27 14:37:04 +01:00
Henrik Lissner
69340149f9 fix(org): don't refresh images while exporting/tangling
Also limits the scope of org-display-inline-images to the current src
block. org-display-inline-images was previously used on the entire
subtree, which was slower than it needed to be (especially while
exporting/tangling org).
2022-01-27 03:43:51 +01:00
Henrik Lissner
c93790bb5c fix(org): omit -i switch from org-babel-python-command
The -i switch for python or ipython can cause python org src blocks to
hang indefinitely when executed.

Ref: hlissner/doom-emacs@c0d988fe0d
Ref: #5569
2021-11-28 22:08:07 +01:00
Henrik Lissner
45ee0ecf21 refactor(biblio): reformat module
- Defer citar-org, since citar autoloads it.
- Add introducing PR to #+SINCE and use new calver scheme.
- Move <localleader> @ keybind to :lang org

Ref: #5810
2021-11-22 15:45:00 +01:00
Henrik Lissner
88844e9cec docs: simplify internal docs links
Fewer links means less confusion.

- Merge doom-issue and doom-commit links into doom-ref (for auto-linking
  Issue/PR/commit references).
- Merge doom-module-source and doom-docs-source links into doom-source.
- Rename doom-report-issue to doom-report.
- Use '!' as the icon for module issues link.
- Remove doom-repo (replaced with "doom:*" in :lang org module).
- Add doomdir and emacsdir links to :lang org module.
2021-11-21 20:04:28 +01:00
Henrik Lissner
7bc0033d0a docs: add doom-docs-mode & doom-docs-org-mode
These two modes exist to provide a nicer reading experience while
viewing Doom's org documentation from within Emacs; they hide
meta-lines, comments, markup, and more.

They also enable our docs to use IDs for links and keep our ID db
separate from any user ID dbs.
2021-11-21 20:04:28 +01:00
Henrik Lissner
7034378968 nit: s/#+BEGIN_SRC/#+begin_src, s/elisp/emacs-lisp/
From now on Doom will enforce two conventions for its org files for
consistency's sake:

- Lower-case meta-lines in org files, like #+begin_src, #+name, or
  #+end_quote (only exception are the top-level ones, like #+TITLE and
  #+STARTUP).
- Use 'emacs-lisp' as the lang specifier for elisp blocks rather than
  'elisp'. Emacs doesn't natively recognize the latter.

This will be reflected in our rewritten docs/*.org and module
README.org's.
2021-10-18 12:09:42 +02:00
Ethan Leba
0ca2e791f7 feat(org): add binding for org-clone-subtree-with-time-shift 2021-10-03 20:40:55 +02:00
Henrik Lissner
c0d988fe0d fix(org): recognize python-shell-interpreter-args
Also does not tamber with org-babel-python-command if the user has
changed it.

Fix #5569
2021-10-03 20:40:00 +02:00
Henrik Lissner
3179c2a744 tweak(org): org-clock-history-length = 20
The default value of 5 is too conservative. 20 seems more reasonable,
without being overwhelming.
2021-09-28 22:42:29 +02:00
Henrik Lissner
ed43b8e36f tweak(org): org-startup-folded = nil
'nil' behaves the same as 'showeverything' in every other way, except it
respects visibility options (like 'hideblocks').
2021-09-25 23:54:44 +02:00
Henrik Lissner
d210b983d4 tweak(org): unset org-list-demote-modify-bullet
Imposing different list bullets per-level was a poor and jarring
default.
2021-09-25 00:55:19 +02:00
Henrik Lissner
206063f27d tweak(org): org-imenu-depth = 6
Headings beyond 6 are excessive in almost any org document, and only
muddy (and slow down) imenu search results, so I'm reducing it to the
number of available HTML headings.
2021-09-25 00:54:13 +02:00
David Lukes
a03d30047c tweak(org): map f to org-footnote-action 2021-09-14 19:25:57 +02:00
Henrik Lissner
bf8495b412 fix(org): epdfinfo error when storing/exporting links
Here's the problem:

1. Org's link system unconditionally calls *all* link :store handlers
   when you call `org-store-link`, and all :export handlers when you
   export an Org file.
2. The org-pdftools package works by defining a custom pdf: link with
   custom :store and :export handlers.
3. Those handlers do not perform error handling before using pdftool's
   API.
4. pdf-tools fails loudly and ungracefully with a
   "pdf-info-epdfinfo-program is not executable" error when its API is
   used and epdfinfo isn't installed.

TL;DR org-pdftools effectively breaks storing/exporting in org-mode
until pdf-tools-install is executed to install epdfinfo. This is awful
UX, so let's suppress the error.
2021-08-22 01:41:26 -04:00
Robert Irelan
ff356e9c37
fix(org): error trying to kill dead agenda buffers
It may happen that org-agenda-new-buffers contains a killed buffer.
2021-08-06 03:18:47 -04:00
Henrik Lissner
06392a723f refactor: rename orig-fn arg in advice to fn
A minor tweak to our naming conventions for the first argument of an
:around advice.
2021-08-04 01:53:12 -04:00
Henrik Lissner
11007f3997 feat(org): add kbd & doom-{module,package}} links
I make extensive use of these in our new in-repo Org documentation.
2021-07-31 19:40:58 -04:00
Henrik Lissner
858a0e44a3 feat(org): open help:* links with helpful-*
Rather than describe-*
2021-07-31 04:35:49 -04:00
Henrik Lissner
83171ac554 feat(org): add #+STARTUP inlinegifs playgifs
- #+STARTUP: inlinegifs = play inline gif previews when point is on
  them.
- #+STARTUP: playgifs = play all gifs in the visible buffer (super,
  super slow; use at your own risk).
- Add +org-startup-with-animated-gifs for changing the global
  default (nil). Can be set to 'at-point (inlinegifs) or t (playgifs)
2021-07-31 04:35:49 -04:00
Henrik Lissner
823fb275a0 feat(org): expand parents for showNlevels option
#+STARTUP: showNlevels

This tells org to expand N levels at startup, but it only partially
unfolds headings, so show2levels gets you:

  * A [...]
  ** X [...]
  ** Y [...]
  ** Z [...]

Instead of (what I think is expected):

  * A
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
  eiusmod tempor incididunt ut labore et dolore magna aliqua.

  ** X [...]
  ** Y [...]
  ** Z [...]

Perhaps this should be upstreamed?
2021-07-28 15:02:14 -04:00
Henrik Lissner
7b274c7dbe feat(org): add native :async support
ob-comint (included with org) added native :async support. It only works
for python currently, but unlike ob-async supports :session for :async
python blocks. In fact, it *requires* :session, so we still fall back to
ob-async in its absence, failing that, it ultimately falls back to
synchronous execution.
2021-07-28 15:00:38 -04:00
Henrik Lissner
c48c01ebab feat(org): set org-num-face & org-num-skip-tags
+ Perhaps a dedicated face would be better, but org-special-keyword will
  do for now.
+ Don't number trees tagged :noexport: or :nonum:.
2021-07-28 14:06:35 -04:00
Henrik Lissner
4ac5332a1d
Merge pull request #5271 from Wetlize/add-roam2
lang/org: Add `+roam2` flag for org-roam v2
2021-07-25 04:13:03 -04:00