Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[org] Improvements when using org-modern-mode #16875

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion layers/+emacs/org/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,11 @@ To enable it by default, set the =org-enable-modern-support= to =t=:
'((org :variables org-enable-modern-support t)))
#+END_SRC

To toggle its features, either call ~M-x org-modern-mode~ or ~ESC , T m~.
To toggle its features in the current buffer, press either ~M-x
org-modern-mode~ or ~, T m~.

To toggle its features in all org buffers (and agenda buffers), press
either ~M-x global-org-modern-mode~ or ~, T M~.

Org-modern and valign (above) both provide visual enhancements for org
tables (if =org-modern-table= is non-nil), and they are not compatible
Expand Down
27 changes: 13 additions & 14 deletions layers/+emacs/org/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -737,13 +737,12 @@ Headline^^ Visit entry^^ Filter^^ Da

(defun org/init-org-modern ()
(use-package org-modern
:defer t
:init
(add-hook 'org-mode-hook 'org-modern-mode)
(add-hook 'org-agenda-finalize-hook #'org-modern-agenda)

:after org
:config
(global-org-modern-mode)
(spacemacs/set-leader-keys-for-major-mode 'org-mode
"Tm" 'org-modern-mode)))
"Tm" 'org-modern-mode
"TM" 'global-org-modern-mode)))

(defun org/init-org-pomodoro ()
(use-package org-pomodoro
Expand Down Expand Up @@ -846,14 +845,14 @@ Headline^^ Visit entry^^ Filter^^ Da

(defun org/post-init-persp-mode ()
(spacemacs|define-custom-layout "@Org"
:binding "o"
:body
(let ((agenda-files (org-agenda-files)))
(if agenda-files
(progn (find-file (if org-persp-startup-org-file org-persp-startup-org-file (cl-first agenda-files)))
(if org-persp-startup-with-agenda (org-agenda nil org-persp-startup-with-agenda)))

(user-error "Error: No agenda files configured, nothing to display.")))))
:binding "o"
:body
(let ((agenda-files (org-agenda-files)))
(if agenda-files
(progn (find-file (if org-persp-startup-org-file org-persp-startup-org-file (cl-first agenda-files)))
(if org-persp-startup-with-agenda (org-agenda nil org-persp-startup-with-agenda)))

(user-error "Error: No agenda files configured, nothing to display.")))))

(defun org/init-org-contacts ()
(use-package org-contacts
Expand Down
2 changes: 1 addition & 1 deletion layers/+spacemacs/spacemacs-org/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
;; layer. So it is easier for users to steal the ownership of the
;; `org' package.
(default-org-config :location built-in)
org-superstar
(org-superstar :toggle (not (configuration-layer/package-used-p 'org-modern)))
Copy link
Collaborator

@fnussbaum fnussbaum Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to depend on a solution for #16346 which is not implemented or pushed yet?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sad. It works on my branch because I have a WIP fix for #16346. Thanks for catching this. Making the PR into a draft for now.

(space-doc :location (recipe :fetcher local))
toc-org
))
Expand Down