From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amin Bandali Subject: Re: Feature request: Maintaining multiple init files with one org file Date: Sat, 28 Jul 2018 09:53:54 -0400 Message-ID: <874lgja2kt.fsf@aminb.org> References: <87va8ziuem.fsf@ntnu.no> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjPhq-0007CP-Kz for emacs-orgmode@gnu.org; Sat, 28 Jul 2018 09:56:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjPhn-00067k-IC for emacs-orgmode@gnu.org; Sat, 28 Jul 2018 09:56:26 -0400 In-Reply-To: <87va8ziuem.fsf@ntnu.no> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Sven Bretfeld , Org-mode 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