this post was submitted on 12 Oct 2023
0 points (50.0% liked)

Emacs

314 readers
2 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

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"))

top 1 comments
sorted by: hot top controversial new old
[–] fuzzbomb23@alien.top 1 points 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))