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

What is the most proper way to add org modules? #12003

Closed
Anton-Latukha opened this issue Feb 19, 2019 · 5 comments
Closed

What is the most proper way to add org modules? #12003

Anton-Latukha opened this issue Feb 19, 2019 · 5 comments
Labels
stale marked as a stale issue/pr (usually by a bot)

Comments

@Anton-Latukha
Copy link
Contributor

Anton-Latukha commented Feb 19, 2019

Description :octocat:

Spacemacs has a specially crafted structure for Org-mode.

I want to clarify a question to solve for me and others in a doc/PR about this.

Officially by org-mode - additional (especially official) extensions to org-mode recommended to be installed by extending the org-modules list.
I asked a question on Gitter, and recieved some responses, as also found my own, but nothing really solid.
I what to clarify what is the most proper way to add official org modules to extend org-mode from the org layer.


Also good to have some input to maybe open other issue/PR. Default org-modules list has many modules enabled by default:

(org-w3m org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-rmail org-eww)

And most of them probably not used by many if not majority people that use Spacemacs. Browsers AFAIK in Spacemacs not in great shape.
Probably it can be right to allow people to populate org-modules from the ground-up.

Reproduction guide 🪲

  • Start Emacs
    Wonder what is the proper way to add org-habit to extend org layer.

Observed behaviour: 👀 💔
Declare installation of org-habit after the initialization of org layer.

Expected behaviour: ❤️ 😄
Something beautiful. Like:

(org :variables
  org-modules '(
    org-habit
    org-capture
    org-id
    org-protocol
    org-brain
    )
)

System Info 💻

  • OS: gnu/linux
  • Emacs: 26.1
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 95422ae)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
@agzam
Copy link
Contributor

agzam commented Feb 20, 2019

Modules have to be extended, not in prescriptive manner like you suggesting using :variables. Simply doing something like this should work (add-to-list 'org-modules 'org-tempo t).

@Anton-Latukha
Copy link
Contributor Author

Anton-Latukha commented Feb 20, 2019

  1. On every module - Emacs runs an add-to-list expression that adds a single element (by default to the beginning of the list).
  2. Official org-mode documentation states to add new entries to the end of the list. So if respect that - indeed add-to-list ... t to append to the end.

I did:

require 'org
(nconc org-modules
       '(
         org-capture
         org-habit
         org-id
         org-protocol
         org-brain
         )) 

It is one invocation and code easily readable/modefiable. nconc in this form adds values to the back, back to the referred list.

But I want to know is I am doing the completely right thing regarding Spacemacs org layer.

@michaelherold
Copy link

This is what I'm using in a private layer:

# packages.el
(with-eval-after-load 'org
  (add-to-list 'org-modules 'org-habit t))

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Jun 16, 2020
@Anton-Latukha
Copy link
Contributor Author

Basically I got sure that Org packages just need to be loaded, there is no need to declare them as modules explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

3 participants