diff --git a/index.html b/index.html index ed614474..6a23ef15 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- +org-agenda-files
shell-command-on-region
org-agenda-files
shell-command-on-region
vc
vc
ansi-term
Colorsload-theme
hookansi-term
Colorsload-theme
hookThis is my emacs configuration in literate form. It aspires to be @@ -627,73 +638,133 @@ those two have. Still, there are definitely a few sections of which I am quite proud, and that others may find to be useful.
These sections are the ones that have the most potential to be interesting to others:
+I wrote a githook and an installer script that automatically update index.html
+at the root of the repository by running org-html-export-to-html
on my
+README.org (essentially this document) . These should work no matter where they
+are placed in a repository. The org-mode file that they target is set here and
+should be relatively easy to change.
+
+I use fniessen's ReadTheOrg theme which can be found at https://github.com/fniessen/org-html-themes. +
+
+To make it so that internal heading links have names that correspond to the
+heading text, and don't change when new headings are added to the document, I
+wrote a custom version of org-export-get-reference
.
+
+See how this link (which is just a normal internal link in the original +document) takes you to http://ivanmalison.github.io/dotfiles/#usemyowndefaultnamingschemefororgheadings. +
+ ++In case you haven't noticed, that is where you should go grab the code that does +this. +
+ ++I'm considering turning this snippet in to a package, so please let me know if +that is something you are interested in. +
++For some reason, org-mode uses all of your currently active fontification when exporting EXCEPT for background color. This modification fixes this. +
+…has a bunch of generally useful functions:
The configurations in this section need to occur early in emacs startup for some reason or another.
This makes it so that the file that is produced from tangling this file uses lexical scoping. @@ -706,9 +777,9 @@ file uses lexical scoping.
(when (boundp 'use-package) @@ -722,9 +793,9 @@ file uses lexical scoping.
To reduce the risk of loading outdated byte code files, we set load-prefer-newer and enable auto-compile-on-load-mode as early as @@ -737,9 +808,9 @@ possible.
The default value of custom-file
is just the current user's .emacs.d/init.el
file. Emacs will add content to custom-file
whenever a variable is customized
@@ -765,12 +836,12 @@ in the dotfiles repo but they are shared across machines elsewhere.
(when (file-exists-p "~/.emacs.d/load.d/emit.el") @@ -780,9 +851,9 @@ in the dotfiles repo but they are shared across machines elsewhere.
This appears here so that it can accurately benchmark as much of startup as possible. @@ -797,9 +868,9 @@ startup as possible.
Death to any gui elements in emacs! Do this EARLY so that emacs doesn't redisplay in a way that is visually unpleasant on startup a @@ -822,9 +893,9 @@ Tooltips are annoying:
These definitions silence the byte-compiler.
@@ -854,9 +925,9 @@ These definitions silence the byte-compiler.Sets environment variables by starting a shell.
@@ -884,9 +955,9 @@ Sets environment variables by starting a shell.
Emacs' built in shell-command-to-string
function has the downside that it
forks a new shell process every time it is executed. This means that any shell
@@ -940,9 +1011,9 @@ This makes it so that we always try to call-process instead of shell-command-to-
(defvar imalison:secure t) @@ -982,9 +1053,9 @@ This makes it so that we always try to call-process instead of shell-command-to-
The org archive does not support https, so we set http as the protocol explicitly.
@@ -1015,9 +1086,9 @@ The org archive does not support https, so we set http as the protocol explicitlIts a shame that everyone has to have some version of this function in their init.el. I use use-package's own mechanism for ensuring packages @@ -1065,9 +1136,9 @@ Ensure by default since most of the package for which I use use-package need to
Emacs cask seems to depend on the EMACS environment variable being set to the binary path of emacs. I found the method for getting the path to the emacs @@ -1088,12 +1159,12 @@ to cause issues. Oh well…
Works in the same way as os.path.join in python
@@ -1108,9 +1179,9 @@ Works in the same way as os.path.join in python(defvar imalison:projects-directory @@ -1121,9 +1192,9 @@ Works in the same way as os.path.join in python
(put 'imalison:use-package 'lisp-indent-function 'defun) @@ -1150,17 +1221,17 @@ Works in the same way as os.path.join in python
The packages in this section provide no functionality on their own, but provide support for writing custom elisp.
(use-package s :demand t) @@ -1168,9 +1239,9 @@ but provide support for writing custom elisp.
(use-package dash @@ -1181,9 +1252,9 @@ but provide support for writing custom elisp.
(imalison:use-package* gh "gh.el" @@ -1192,9 +1263,9 @@ but provide support for writing custom elisp.
(use-package shut-up @@ -1205,9 +1276,9 @@ but provide support for writing custom elisp.
(use-package pcache @@ -1216,9 +1287,9 @@ but provide support for writing custom elisp.
(use-package parse-csv @@ -1227,9 +1298,9 @@ but provide support for writing custom elisp.
This is disabled for now until I figure out what to do with emit.
@@ -1243,9 +1314,9 @@ This is disabled for now until I figure out what to do with emit.(use-package request) @@ -1254,11 +1325,11 @@ This is disabled for now until I figure out what to do with emit.
(defmacro imalison:emacs-version-predicate-fn (major-version minor-version) @@ -1321,14 +1392,14 @@ new macro name and the -fn suffix.
(defun imalison:make-list (thing) @@ -1400,9 +1471,9 @@ new macro name and the -fn suffix.
(defmacro imalison:compose-unary (&rest funcs) @@ -1420,9 +1491,9 @@ new macro name and the -fn suffix.
(defmacro imalison:make-interactive-fn (function) @@ -1435,9 +1506,9 @@ new macro name and the -fn suffix.
For composing functions with an apply so that they can be used with
the :around
keyword of advice-add.
@@ -1452,9 +1523,9 @@ the :around
keyword of advice-add.
(imalison:advice-add-around-builder imalison:kill-new-around kill-new)
@@ -1463,9 +1534,9 @@ the :around
keyword of advice-add.
(defmacro imalison:let-around-fn (orig-func &rest forms)
@@ -1484,9 +1555,9 @@ the :around
keyword of advice-add.
(defmacro imalison:let-advise-around-fn (&rest forms)
@@ -1499,9 +1570,9 @@ the :around
keyword of advice-add.
For composing functions with an apply so that they can be used with the :around
keyword of advice-add.
:a
(defmacro imalison:measure-time (&rest body)
@@ -1535,9 +1606,9 @@ For composing functions with an apply so that they can be used with the :a
org-agenda-files
org-agenda-files
(defun imalison:add-to-org-agenda-files (incoming-files)
@@ -1550,9 +1621,9 @@ For composing functions with an apply so that they can be used with the :a
(defun imalison:get-string-from-file (file-path)
@@ -1564,9 +1635,9 @@ For composing functions with an apply so that they can be used with the :a
(defun imalison:get-lat-long ()
@@ -1578,9 +1649,9 @@ For composing functions with an apply so that they can be used with the :a
(defun imalison:sin2 (p)
@@ -1607,9 +1678,9 @@ For composing functions with an apply so that they can be used with the :a
This was taken from here but it has diverged significantly from the original.
@@ -1651,9 +1722,9 @@ This was taken from -This macro is useful when writing emacs-lisp. It creates a new interactive command that shows you the result of evaluating a function, with optionally provided arguments.
@@ -1682,9 +1753,9 @@ This interactive functions allows the user the select a function to invoke usingshell-command-on-region
shell-command-on-region
(defun imalison:copy-shell-command-on-region (start end command) @@ -1712,9 +1783,9 @@ This interactive functions allows the user the select a function to invoke using
A macro for composing functions together to build an interactive command to copy a string to the kill ring.
@@ -1728,9 +1799,9 @@ A macro for composing functions together to build an interactive command to copy(defmacro imalison:copy-buffer-file-path-builder (&rest args) @@ -1747,9 +1818,9 @@ A macro for composing functions together to build an interactive command to copy
(imalison:compose-copy-builder imalison:copy-current-git-branch @@ -1759,9 +1830,9 @@ A macro for composing functions together to build an interactive command to copy
(defun imalison:named-compile (command) @@ -1777,9 +1848,9 @@ A macro for composing functions together to build an interactive command to copy
(defun imalison:replace-escape-sequences () @@ -1796,11 +1867,11 @@ A macro for composing functions together to build an interactive command to copy
(defun imalison:maybe-symbol-name (arg) @@ -1834,12 +1905,12 @@ A macro for composing functions together to build an interactive command to copy
- Note that you'll need to make sure that emacs properly inherits -the path variable for this work. Check out my 3.9 config for + Note that you'll need to make sure that emacs properly inherits +the path variable for this work. Check out my exec-path-from-shell config for details.
(defun imalison:toggle-lexical-binding () @@ -1877,9 +1948,9 @@ details.
(defun imalison:copyq-get (i) @@ -1900,9 +1971,9 @@ details.
This was stolen from https://github.com/jwiegley/dot-emacs
@@ -1943,9 +2014,9 @@ This was stolen from https://git(imalison:let-around imalison:projectile-helm-command-from-zsh helm-command-from-zsh @@ -1955,9 +2026,9 @@ This was stolen from https://git
The stuff in this section is pretty crusty. I don't think its used anywhere, but I keep it around just in case I need it. @@ -2059,15 +2130,15 @@ I keep it around just in case I need it.
This keyboard macro extracts the current sexp to an emacs-lisp source block of its own
@@ -2079,9 +2150,9 @@ This keyboard macro extracts the current sexp to an emacs-lisp source block of i(fset 'name-source-block-for-use-package-name
@@ -2090,9 +2161,9 @@ This keyboard macro extracts the current sexp to an emacs-lisp source block of i
(fset 'extract-and-name-use-package-block
@@ -2104,12 +2175,12 @@ This keyboard macro extracts the current sexp to an emacs-lisp source block of i
(setq user-full-name @@ -2122,9 +2193,9 @@ This keyboard macro extracts the current sexp to an emacs-lisp source block of i
1: (global-auto-revert-mode) @@ -2142,9 +2213,9 @@ This keyboard macro extracts the current sexp to an emacs-lisp source block of i
(line-number-mode t) @@ -2164,12 +2235,12 @@ programming mode.
(defconst emacs-tmp-dir @@ -2181,9 +2252,9 @@ programming mode.
(setq backup-inhibited t) @@ -2194,12 +2265,12 @@ programming mode.
(setq ns-pop-up-frames nil) @@ -2208,9 +2279,9 @@ programming mode.
1: (defadvice yes-or-no-p (around prevent-dialog activate) @@ -2228,9 +2299,9 @@ programming mode.
(setq use-dialog-box nil) @@ -2239,9 +2310,9 @@ programming mode.
(defun split-horizontally-for-temp-buffers () (split-window-horizontally)) @@ -2252,9 +2323,9 @@ programming mode.
Get rid of nags about requiring setences to end with two spaces.
@@ -2273,9 +2344,9 @@ Set the default fill-columnTrailing whitespace is really messy and annoying, which makes this a must-have in my opinion. It's kind of crazy how often you will encounter serious codebases @@ -2287,9 +2358,9 @@ with random whitespace ALL over the place.
Unfortunately, this setting can get annoying in a lot of modes, which is why I use this hook to disable it in those modes @@ -2303,9 +2374,9 @@ use this hook to disable it in those modes
UTF-8 everywhere
@@ -2333,9 +2404,9 @@ Disable CJK coding/encoding (Chinese/Japanese/Korean characters)This is set to true to disable the annoying audible bell that plays whenever there is an error. @@ -2347,9 +2418,9 @@ whenever there is an error.
vc
vc
(setq vc-follow-symlinks t) @@ -2357,9 +2428,9 @@ whenever there is an error.
(setq display-time-default-load-average nil) @@ -2370,9 +2441,9 @@ whenever there is an error.
(setq kill-ring-max 1000) @@ -2380,9 +2451,9 @@ whenever there is an error.
This makes forward-word
and backward-word
understand snake and camel case.
forward-word
and backward-word
understand s
(setq initial-scratch-message "") @@ -2404,9 +2475,9 @@ This makesforward-word
andbackward-word
understand s
(defun risky-local-variable-p (&rest args) @@ -2415,9 +2486,9 @@ This makesforward-word
andbackward-word
understand s
proced is an top like utility that runs inside of emacs. The following sets auto updating automatically and makes the update interval faster.
@@ -2430,9 +2501,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto(when (equal system-type 'gnu/linux) @@ -2442,9 +2513,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(setq epg-gpg-program "gpg") @@ -2452,9 +2523,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) @@ -2462,9 +2533,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(defvar iedit-toggle-key-default nil) @@ -2543,9 +2614,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package paradox @@ -2560,9 +2631,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package diminish @@ -2579,9 +2650,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package edit-server @@ -2595,9 +2666,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package load-dir @@ -2611,9 +2682,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package server @@ -2624,9 +2695,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package list-environment) @@ -2634,9 +2705,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package bug-hunter) @@ -2644,9 +2715,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package shackle @@ -2663,9 +2734,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package beacon @@ -2676,9 +2747,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package iregister) @@ -2686,9 +2757,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package discover-my-major) @@ -2696,9 +2767,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package refine @@ -2707,9 +2778,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package winner @@ -2729,9 +2800,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
(use-package eyebrowse @@ -2742,9 +2813,9 @@ proced is an top like utility that runs inside of emacs. The following sets auto
This interferes with too many other packages. See https://github.com/alpaker/Fill-Column-Indicator/issues/21 for more details @@ -2766,9 +2837,9 @@ This interferes with too many other packages. See
(use-package overseer) @@ -2777,12 +2848,12 @@ This interferes with too many other packages. See
(use-package bind-key) @@ -2790,9 +2861,9 @@ This interferes with too many other packages. See
(use-package which-key @@ -2805,9 +2876,9 @@ This interferes with too many other packages. See
(use-package hydra @@ -2817,47 +2888,77 @@ This interferes with too many other packages. See ("C-c 6" . imalison:compile/body)) :config (progn - (defhydra imalison:hydra-font-resize - nil - "Resize Font" - ("-" imalison:font-size-decr "Decrease") - ("d" imalison:font-size-decr "Decrease") - ("=" imalison:font-size-incr "Increase") - ("+" imalison:font-size-incr "Increase") - ("i" imalison:font-size-incr "Increase") - ("h" imalison:set-huge-font-size "Huge") - ("f" set-frame-font "Set Frame Font") - ("0" imalison:font-size-reset "Reset to default size")) ++
(defhydra imalison:hydra-font-resize + nil + "Resize Font" + ("-" imalison:font-size-decr "Decrease") + ("d" imalison:font-size-decr "Decrease") + ("=" imalison:font-size-incr "Increase") + ("+" imalison:font-size-incr "Increase") + ("i" imalison:font-size-incr "Increase") + ("h" imalison:set-huge-font-size "Huge") + ("f" set-frame-font "Set Frame Font") + ("0" imalison:font-size-reset "Reset to default size"))
(defhydra imalison:hydra-yank + nil + "Yank text" + ("p" imalison:copy-buffer-file-path "Projectile path") + ("f" imalison:copy-buffer-file-path-full "Full path") + ("n" imalison:copy-buffer-file-name "File name") + ("b" imalison:copy-current-git-branch "Git Branch")) ++
(defun imalison:make-test () + (interactive) + (let ((default-directory (projectile-project-root))) + (imalison:named-compile "make test"))) + +(defun imalison:glide-up () + (interactive) + (imalison:named-compile "glide up")) + +(defhydra imalison:compile nil "Compile" + ("s" imalison:projectile-helm-command-from-zsh "Select a command from shell history") + ("c" imalison:named-compile "Enter Custom Command") + ("t" imalison:make-test "Test") + ("u" imalison:glide-up "Update Dependencies")) +;; The following parens close the use-package/progn created several blocks above +)) ++
This ensures that C-x C-c will always kill emacs, even if we are running in server mode.
@@ -2868,9 +2969,9 @@ This ensures that C-x C-c will always kill emacs, even if we are running in servI can't shake the habit of using this keybinding for undo. I should really use the default of C-/.
@@ -2894,9 +2995,9 @@ I can't shake the habit of using this keybinding for undo. I should really use tGo the other way when you use capital O.
@@ -2907,9 +3008,9 @@ Go the other way when you use capital O.(bind-key "C-c SPC" 'imalison:mark-ring) @@ -2917,9 +3018,9 @@ Go the other way when you use capital O.
(bind-key "C-x p" 'pop-to-mark-command) @@ -2938,9 +3039,9 @@ Go the other way when you use capital O.
This might be useless, but I believe that it is a macro that converts between bind-key and global-set-key forms. @@ -2956,9 +3057,9 @@ bind-key and global-set-key forms.
(when (equal system-type 'darwin) @@ -2969,12 +3070,12 @@ bind-key and global-set-key forms.