aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs/config.org
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2022-01-09 06:08:51 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2022-01-09 06:08:51 +0000
commit0b43dc0094ad2b8adfa63a4d5ec868ff7bd66d9a (patch)
tree11af21cd498aaf42be3f2e27482da459da3db284 /Emacs/.config/emacs/config.org
parent78232a10556ef59f9c2ad15d3c7528944261e63f (diff)
downloaddotfiles-0b43dc0094ad2b8adfa63a4d5ec868ff7bd66d9a.tar.gz
dotfiles-0b43dc0094ad2b8adfa63a4d5ec868ff7bd66d9a.tar.bz2
dotfiles-0b43dc0094ad2b8adfa63a4d5ec868ff7bd66d9a.zip
(Emacs)+environment setup macro
This basically makes it easier to provide unique configurations across my devices without screwing up the vc.
Diffstat (limited to 'Emacs/.config/emacs/config.org')
-rw-r--r--Emacs/.config/emacs/config.org12
1 files changed, 10 insertions, 2 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org
index 27c77e8..cf1482d 100644
--- a/Emacs/.config/emacs/config.org
+++ b/Emacs/.config/emacs/config.org
@@ -111,7 +111,7 @@ the buffer with name buf-name and creation function buf-create."
(display-buffer buffer)
(select-window (get-buffer-window buffer)))))))
#+end_src
-** Auto-run command after-save-hook
+** Create auto save
Macro that defines functionality that runs after a buffer save.
Requires a list of conditions (so it doesn't happen FOR ALL saved
buffers) and a function to run if the buffer satisfies the condition.
@@ -140,7 +140,7 @@ errors and general messages. Better than vim, eh?
,@to-run))
(add-hook 'after-save-hook (quote ,func-name)))))
#+end_src
-** Define procedure
+** Procedure
The =lambda= macro provides a function with possible arguments. A
procedure is a type of form that takes no arguments. This macro
returns an anonymous function with no arguments with all the forms
@@ -151,6 +151,14 @@ common use of this macro.
"For a given list of forms CDR, return a quoted non-argument lambda."
`(quote (lambda () ,@CDR)))
#+end_src
+** Environment setup
+Provides a macro to do quick environmental conditionals.
+#+begin_src emacs-lisp
+(defconst +dx:environment (system-name))
+(defmacro +dx/env-cond (name &rest to-run)
+ `(when (string= +dx:environment ,name)
+ ,@to-run))
+#+end_src
* Aesthetics
Load my custom "personal-theme" theme which is stored in the Emacs lisp
folder (look at [[file:elisp/personal-theme.el][this file]]).