From 91a79651a7a0f23798b1e1e1cb1d6ccb9bb82ad5 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 4 Jan 2021 13:39:34 -0600 Subject: Add at-work and at-home macros Once I figure out what else I might want to determine, and how I’d want to specify them, I might turn these into a more general macro ‘when-at’, the second argument of which would be a keyword (defined where?) that would specify how to tell where we are (a predicate?). --- config.org | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index e511c8d..1b81d0d 100644 --- a/config.org +++ b/config.org @@ -5,7 +5,7 @@ #+EXPORT_FILE_NAME: README.md #+OPTIONS: toc:nil #+BANKRUPTCY_COUNT: 3.2 -#+Time-stamp: <2021-01-03 14:46:41 acdw> +#+Time-stamp: <2021-01-04 13:39:13 acdw> * Basics @@ -138,6 +138,24 @@ This comes in handy when I want to garbage collect, say, or save recent files. (apply func args))) #+end_src +*** Determine where I am + +I use Emacs at home, with Linux, and at work, with Windows. + +#+begin_src emacs-lisp + (defmacro at-work (&rest commands) + "Only do COMMANDS when at work." + (declare (indent defun)) + `(when (memq system-type '(ms-dos windows-nt)) + ,@commands)) + + (defmacro at-home (&rest commands) + "Only do COMMANDS when at home." + (declare (indent defun)) + `(when (memq system-type '(gnu gnu/linux gnu/kfreebsd)) + ,@commands)) +#+end_src + ** Clean =.emacs.d= #+BEGIN_SRC emacs-lisp @@ -1528,7 +1546,7 @@ I’m only enabling this at home for now, since it requires building stuff. "Disable `visual-fill-column-mode'." (visual-fill-column-mode -1)) - (when (memq system-type '(gnu/linux)) + (at-home (straight-use-package 'pdf-tools) (pdf-loader-install) -- cgit 1.4.1-21-gabe81