[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Feature request: Maintaining multiple init files with one org fi
From: |
Amin Bandali |
Subject: |
Re: [O] Feature request: Maintaining multiple init files with one org file |
Date: |
Sat, 28 Jul 2018 09:53:54 -0400 |
Hello,
Indeed, a tag-based solution (e.g. with :office:, :home:, etc)
would be great; but what I do right now looks something like
this:
,----
| #+property: header-args :tangle ~/.emacs
|
| * Default Frame
|
| ** All computers
| #+begin_src emacs-lisp
| (defvar myvar "testing")
| #+end_src
|
| ** Office Computer
| #+begin_src emacs-lisp :tangle (when (string= (system-name) "officepc")
"~/.emacs")
| (setq default-frame-alist '(
| (font . "-PfEd-DejaVu Sans
Mono-normal-normal-normal-*-26-*-*-*-m-0-iso10646-1")
| (width . 102)
| (height . 41))
| #+end_src
|
| ** Laptop
| #+begin_src emacs-lisp :tangle (when (string= (system-name) "mylaptop")
"~/.emacs")
| (setq default-frame-alist '(
| (font . "-PfEd-DejaVu Sans
Mono-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1")
| (width . 80)
| (height . 30))
| #+end_src
|
| ** More stuff for all computers
|
| #+begin_src emacs-lisp
| (message myvar)
| #+end_src
`----
In other words, I use `when' and `string=' (from subr.el) and
`system-name' to check the hostname. If it matches what I want,
I return the "~/.emacs" filename, nil otherwise. Alternatively,
you could probably use `if' and return "no" when it doesn't
match, but :tangle nil seems to work just fine so I went with
`when'.
Hope that helps.
Best,
-amin