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

elisp meta-program the mjl--layers list #4

Open
sinewalker opened this issue Dec 13, 2016 · 1 comment
Open

elisp meta-program the mjl--layers list #4

sinewalker opened this issue Dec 13, 2016 · 1 comment
Assignees

Comments

@sinewalker
Copy link
Owner

sinewalker commented Dec 13, 2016

It should be possible to replace this block in init.el with something more general:

(cond ((eq system-type 'windows-nt)
         (setq mjl--layers (append mjl--layers mjl--windows-layers)))
        ((eq system-type 'darwin)
         (setq mjl--layers (append mjl--layers mjl--darwin-layers)))
        ((eq system-type 'gnu/linux)
         (setq mjl--layers (append mjl--layers mjl--gnu/linux-layers))))

(first I'll have to rename mjl--windows-layers to mjl--windows-nt-layers)

So that the system-type symbol is incorporated into the name of the list to be appended to mjl--layers. Something like (this is not quite right: it cons's `mjl--darwin-layers as a symbol):

 (setq mjl--layers (append mjl--layers
                                 (make-symbol
                                  (concat "mjl--" (symbol-name system-type) "--layers"))))

Maybe I'll need to use an Elisp Macro? That's why I've titled this Issue "meta-program"...

@sinewalker sinewalker self-assigned this Dec 13, 2016
@sinewalker
Copy link
Owner Author

sinewalker commented Feb 14, 2020

This tweet shows one way this might better be programmed:

dotspacemacs-configuration-layers
`(,(when (eq system-type 'darwin) 'osx)
 (,(when (eq system-type 'gnu/linux) 'exwm))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant