I use the same init for both Windows and Linux.

I would like to simplify my file and use variables for some file locations (using a variable in agenda section, etc).

What is the right way to do that in lisp?

Is it as simple as this?

(setq win-file-location '("c:/Users/Username/Desktop/filename.org"))

(setq linux-file-location '("/home/username/Desktop/filename.org"))

  • fuzzbomb23@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    For variables you created (i.e. named) yourself, you can also use defvar, which lets you give it a docstring.

    To set a different value according to the OS, you can conditionally set the value based on a system-type.

        (defvar fuzzbomb/startup-theme 'modus-vivendi-tinted
            "The theme to enable during startup.
    
        This variable should be set before the first call to `load-theme' in
    `init.el'.")
    
          (if (eq system-type 'windows-nt)
              (setq fuzzbomb/startup-theme 'ef-maris-light))