summary refs log tree commit diff stats
path: root/config.org
diff options
context:
space:
mode:
authorCase Duckworth2021-01-14 19:03:53 -0600
committerCase Duckworth2021-01-14 19:03:53 -0600
commit67b64cca3fcfb18b3785bbcccb8aa614f8c5ae1f (patch)
treee61b0601e5acb9faf9f66a08be4aaa7650ac4e5f /config.org
parentDelete re-definition of lisp-indent-function for something simpler (diff)
downloademacs-67b64cca3fcfb18b3785bbcccb8aa614f8c5ae1f.tar.gz
emacs-67b64cca3fcfb18b3785bbcccb8aa614f8c5ae1f.zip
Change at-work and at-home to the more general when-at
Diffstat (limited to 'config.org')
-rw-r--r--config.org54
1 files changed, 29 insertions, 25 deletions
diff --git a/config.org b/config.org index 949ef22..460c59d 100644 --- a/config.org +++ b/config.org
@@ -143,17 +143,20 @@
143 I use Emacs at home, with Linux, and at work, with Windows. 143 I use Emacs at home, with Linux, and at work, with Windows.
144 144
145 #+begin_src emacs-lisp 145 #+begin_src emacs-lisp
146 (defmacro at-work (&rest commands) 146 (defmacro when-at (conditions &rest commands)
147 "Only do COMMANDS when at work." 147 "Only do COMMANDS when CONDITIONS are met.
148 (declare (indent defun)) 148 CONDITIONS are one of `:work', `:home', or a list beginning with
149 `(when (memq system-type '(ms-dos windows-nt)) 149 the above and other conditions to check."
150 ,@commands)) 150 (declare (indent 1))
151 151 (let ((at-work (memq system-type '(ms-dos windows-nt)))
152 (defmacro at-home (&rest commands) 152 (at-home (memq system-type '(gnu gnu/linux gnu/kfreebsd))))
153 "Only do COMMANDS when at home." 153 (pcase conditions
154 (declare (indent defun)) 154 (:work `(when ',at-work ,@commands))
155 `(when (memq system-type '(gnu gnu/linux gnu/kfreebsd)) 155 (:home `(when ',at-home ,@commands))
156 ,@commands)) 156 (`(:work ,others) `(when (and ',at-work ,others)
157 ,@commands))
158 (`(:home ,others) `(when (and ',at-home ,others)
159 ,@commands)))))
157 #+end_src 160 #+end_src
158 161
159** Clean =.emacs.d= 162** Clean =.emacs.d=
@@ -1395,7 +1398,7 @@ from [[https://github.com/mpereira/.emacs.d#make-cursor-movement-an-order-of-mag
1395 "Or a new tab, in Firefox.") 1398 "Or a new tab, in Firefox.")
1396 1399
1397 ;; we need to add Firefox to `exec-path' on Windows 1400 ;; we need to add Firefox to `exec-path' on Windows
1398 (at-work 1401 (when-at :work
1399 (add-to-list 'exec-path "c:/Program Files/Mozilla Firefox")) 1402 (add-to-list 'exec-path "c:/Program Files/Mozilla Firefox"))
1400 #+end_src 1403 #+end_src
1401 1404
@@ -1896,11 +1899,12 @@ from [[https://github.com/mpereira/.emacs.d#align-all-tags-in-the-buffer-on-tag-
1896 "Disable `visual-fill-column-mode'." 1899 "Disable `visual-fill-column-mode'."
1897 (visual-fill-column-mode -1)) 1900 (visual-fill-column-mode -1))
1898 1901
1899 (at-home 1902 (eval-when-compile
1900 (straight-use-package 'pdf-tools) 1903 (when-at :home
1901 (pdf-loader-install) 1904 (straight-use-package 'pdf-tools)
1905 (pdf-loader-install)
1902 1906
1903 (add-hook 'pdf-view-mode-hook #'acdw/disable-visual-fill-column-mode)) 1907 (add-hook 'pdf-view-mode-hook #'acdw/disable-visual-fill-column-mode)))
1904 #+end_src 1908 #+end_src
1905 1909
1906** E-book tools 1910** E-book tools
@@ -1925,8 +1929,7 @@ from [[https://github.com/mpereira/.emacs.d#align-all-tags-in-the-buffer-on-tag-
1925** Email 1929** Email
1926 1930
1927 #+begin_src emacs-lisp 1931 #+begin_src emacs-lisp
1928 (when (executable-find "mu") 1932 (when-at (:home (executable-find "mu"))
1929
1930 (add-to-list 'load-path 1933 (add-to-list 'load-path
1931 "/usr/share/emacs/site-lisp/mu4e") 1934 "/usr/share/emacs/site-lisp/mu4e")
1932 (require 'mu4e) 1935 (require 'mu4e)
@@ -2162,13 +2165,14 @@ from [[https://github.com/mpereira/.emacs.d#align-all-tags-in-the-buffer-on-tag-
2162*** Exec path from shell 2165*** Exec path from shell
2163 2166
2164 #+begin_src emacs-lisp 2167 #+begin_src emacs-lisp
2165 (at-home 2168 (eval-when-compile
2166 (straight-use-package 'exec-path-from-shell) 2169 (when-at :home
2167 (defvar acdw/exec-path-from-shell-initialized nil 2170 (straight-use-package 'exec-path-from-shell)
2168 "Stores whether we've initialized or not.") 2171 (defvar acdw/exec-path-from-shell-initialized nil
2169 (unless acdw/exec-path-from-shell-initialized 2172 "Stores whether we've initialized or not.")
2170 (exec-path-from-shell-initialize) 2173 (unless acdw/exec-path-from-shell-initialized
2171 (setq acdw/exec-path-from-shell-initialized (current-time)))) 2174 (exec-path-from-shell-initialize)
2175 (setq acdw/exec-path-from-shell-initialized (current-time)))))
2172 #+end_src 2176 #+end_src
2173 2177
2174* Appendices 2178* Appendices