Commit graph

630 commits

Author SHA1 Message Date
Henrik Lissner
659f7bfc71
refactor!: deprecate IS-* OS constants
BREAKING CHANGE: This deprecates the IS-(MAC|WINDOWS|LINUX|BSD) family
of global constants in favor of a native `featurep` check:

  IS-MAC      ->  (featurep :system 'macos)
  IS-WINDOWS  ->  (featurep :system 'windows)
  IS-LINUX    ->  (featurep :system 'linux)
  IS-BSD      ->  (featurep :system 'bsd)

The constants will stick around until the v3 release so folks can still
use it -- and there are still some modules that use it, but I'll phase
those uses out gradually.

Fix: #7479
2024-02-04 17:54:29 -05:00
Tim Ruffing
1ee429406b fix(org): restart org-mode before indirect buffer
Fix: #5714
2024-01-24 12:11:48 -05:00
Ocean Shen
f6851d56ef fix(org): correct face for doom-user links
`org-link-set-parameters` accepts `:face` for a function returning a face
or a symbol naming a face. Use a lambda returning `org-priority` to
avoid it being called directly as a function.
2023-12-07 21:47:11 -05:00
Henrik Lissner
b1d8d1cd9f
nit: reformatting, comment, and markup revision 2023-12-02 11:34:10 -05:00
mosquito-magnet
db29f71f10 fix(org): add missing autoloads for org-attach
org-attach-delete-one and -all are bound to keys, thus requiring
autoload.
2023-09-22 23:17:43 +02:00
Liam Hupfer
2279a42c50 fix(org): address fancy links regressions
- several all-the-icons references were missed, and some code points are
  different in nerd-fonts. the variable icon became a folder, the
  package icon became a scissors, and the file-icons font icon is not
  available
- make face link type face passthrough work
- remove extraneous rear-nonsticky and height properties that nerd-icons
  already sets
- generally improve consistency across link types
  - material design icons, underlines, and font lock faces for symbols,
    shadow if unbound
  - octicons for packages, modules, and executables, blue links if
    installed, shadow if not. color coded icon based on status
  - refactor and remove extraneous code
2023-09-20 20:23:26 +02:00
Liam Hupfer
c3342a8011 nit(org): make activate function suffixes consistent 2023-09-20 20:23:26 +02:00
Liam Hupfer
54c67acf2a nit(org): use consistent link follow function names
Looks like the doom-module one was partially renamed to follow naming
conventions, and that didn’t propagate to the corresponding doom-package
function.
2023-09-20 20:23:26 +02:00
Liam Hupfer
f369b48b2a fix(org): use correct doom-module link follow function 2023-09-20 20:23:26 +02:00
VitalyR
547584b831 refactor(org): move org-crypt and related hooks behind a '+crypt' flag 2023-07-22 16:12:23 +02:00
Henrik Lissner
6471690782
perf(org): disable auto-reformat/update for tables/cookies
These two can *significantly* slow down larger org buffers for evil
users, when switching modes (e.g. leaving insert/replace mode), so I am
removing these if/when I find a better alternative. Though, they can
still be done manually with `C-c C-c` (for cookies) and `TAB` in tables.
2023-02-25 20:47:28 -05:00
Henrik Lissner
4651df6530
nit(org): remove unused doom-source link type
A vestigial link type that snuck in during my tinkering, but was never
used, and has been replaced in some unpublished work.
2023-02-23 20:45:03 -05:00
TEC
733f857199 feat(org): new "cmd" link type 2023-02-21 18:35:15 -05:00
TEC
825458e039 refactor(org): use new :help-echo for kbd link 2023-02-21 18:35:15 -05:00
TEC
c1361c0ede feat(org): add some :help-echo for some links
Also use the :help-echo for eldoc.
2023-02-21 18:35:15 -05:00
TEC
181540c8b7 feat(org): introduce doom-executable link type 2023-02-21 18:35:15 -05:00
TEC
c26d64c9b9 feat(org): fancy docs links with activation fns 2023-02-21 18:35:15 -05:00
NitrogenPointBlue
818efb263f
fix(org): update org-attach-store-link-p default
Org-mode's behavior when org-attach-store-link-p is 't' recently
changed.

When the value of org-attach-store-link-p is 't' org-store-link now
suggests a 'file:' link to the attachment's original location. Setting
the value to 'attached' instead suggests an 'attachment:' link utilizing
the attachment directory.

Ref: https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=0d60013f0e3980fab959542eeb171ab9a02b450c
Fix: #6952
2023-02-18 15:26:14 -05:00
Edmund Miller
3ae293e37a
feat(org): bind '<localleader> r R' to org-refile-reverse 2022-10-29 02:51:30 +02:00
TEC
24f98d49ec tweak(org): have doom links use path for info 2022-10-05 01:01:19 +02:00
Ellis Kenyő
4d24a3f1a7 feat(org): restore org-contrib packages removed upstream
org-contrib is slowly removing packages (most of which have moved or
will move to their own repos or into Org proper).

Ref: emacsmirror/org-contrib@3dd9841522
Ref: emacsmirror/org-contrib@c555d8d489
Ref: emacsmirror/org-contrib@0740bd3fe6
Close: #6740
2022-09-30 23:02:34 +02:00
Henrik Lissner
4efaf6837b
refactor: introduce doom-module-context
Where f9201eb introduced a general context system, this one introduces
one for modules, to simplify our let-bind game when interacting with
modules, and to more efficiently expose module state to modulep! (which
gets called at runtime a great deal, so its performance is important).

* lisp/doom-lib.el (doom-log): simplify macro and introduce
  doom-inhibit-log variable.
* lisp/doom-modules.el (modulep!): fix reported file path if modulep!
  fails to find the local module.
* lisp/lib/debug.el (doom-debug-variables): disable doom-inhibit-log
  when debug mode is on.

Ref: f9201eb218
2022-09-24 22:09:46 +02:00
Henrik Lissner
f9201eb218
refactor: introduce doom-context
Introduces a system to announce what execution contexts are active, so I
can react appropriately, emit more helpful logs/warnings in the case of
issues, and throw more meaningful errors.

* bin/doom: load module CLIs in the 'modules' context.
* lisp/cli/doctor.el: load package files in 'packages' context.
* lisp/doom-cli.el:
  - (doom-before-init-hook, doom-after-init-hook): trigger hooks at the
    correct time. This may increase startup load time, as the benchmark
    now times more of the startup process.
  - (doom-cli-execute, doom-cli-context-execute,
    doom-cli-context-restore, doom-cli-context-parse,
    doom-cli--output-benchmark-h, doom-cli-call, doom-cli--restart,
    doom-cli-load, run!): remove redundant context prefix in debug logs,
    it's now redundant with doom-context, which doom-log now prefixes
    them with.
* lisp/doom-lib.el (doom-log): prefix doom-context to doom-log output,
  unless it starts with :.
* lisp/doom-packages.el (package!, doom-packages--read): throw error if
  not used in a packages.el file or in the context of our package
  manager.
* lisp/doom-profiles.el (doom-profile--generate-init-vars,
  doom-profile--generate-load-modules): use modules doom-context instead
  of doom-init-time to detect startup.
* lisp/doom-start.el (doom-load-packages-incrementally-h): move function
  closer to end of doom-after-init-hook.
* lisp/doom.el:
  - (doom-before-init-hook, doom--set-initial-values-h,
    doom--begin-init-h): rename doom--set-initial-values-h to
    doom--begin-init-h and ensure it runs as late in
    doom-before-init-hook as possible, as that is the point where Doom's
    "initialization" formally begins.
  - (doom-after-init-hook): don't trigger at the end of command-line-1
    in non-interactive sessions. This will be triggered manually in
    doom-cli.el's run!.
* lisp/lib/config.el (doom/reload, doom/reload-autoloads,
  doom/reload-env): use 'reload' context for reload commands.
* modules/lang/emacs-lisp/autoload.el (+emacs-lisp-eval): use 'eval'
  context.
* modules/lang/org/config.el: remove doom-reloading-p; check for
  'reload' doom context instead.
2022-09-24 22:09:05 +02:00
Henrik Lissner
46527c0b85
fix(org): eldoc showing empty heading breadcrumbs
Fix: #6795
Amend: ab9896c526
2022-09-17 10:37:09 +02:00
Henrik Lissner
ab9896c526
refactor(org): move doom-docs link defs to :lang org
Where they will be further generalized, later.

This also prevents an issue where org was loaded while the profile init
files are generated, which caused a warning about org-loaddefs which
introduces a noticable delay.
2022-09-16 13:06:17 +02:00
Henrik Lissner
511f0ca38f
fix(org): void-variable doom-user-dir on org-async export
This advice needed to be updated to reflect recent changes.

Fix: #6624
2022-09-16 03:17:46 +02:00
Henrik Lissner
4c9df9bfc6
fix: partially revert OS detection changes
These changes snuck into ad6a3d0, but have not been implemented yet, so
some OS-specific functionality was orphaned.

Amend: ad6a3d0f33
2022-08-18 17:08:16 +02:00
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