dotfiles/index.html

7191 lines
426 KiB
HTML
Raw Normal View History

2016-10-19 18:25:46 -06:00
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
2016-11-07 17:41:36 -07:00
<!-- 2016-11-07 Mon 16:42 -->
2016-11-03 18:28:22 -06:00
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
2016-10-19 18:25:46 -06:00
<title></title>
2016-11-03 18:28:22 -06:00
<meta name="generator" content="Org mode" />
<meta name="author" content="Ivan Malison" />
2016-10-19 18:25:46 -06:00
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
2016-11-03 18:28:22 -06:00
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
2016-10-19 18:25:46 -06:00
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
2016-11-03 18:28:22 -06:00
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
2016-10-19 18:25:46 -06:00
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
2016-11-03 18:28:22 -06:00
.org-svg { width: 90%; }
2016-10-19 18:25:46 -06:00
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.js"></script>
<script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script>
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</head>
<body>
<div id="content">
2016-10-19 19:13:32 -06:00
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org1d9016d">1. About</a></li>
<li><a href="#org71ad59a">2. Highlights</a>
2016-10-24 17:04:28 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org22ede5b">2.1. How I generate </a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org0f501cd">2.1.1. Git Hooks</a></li>
<li><a href="#org742aaa6">2.1.2. Read The Org</a></li>
<li><a href="#org9fea203">2.1.3. Heading Links</a></li>
<li><a href="#orgf1fa6b1">2.1.4. Set Background Color Source Blocks</a></li>
2016-10-24 17:04:28 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orga89a882">2.2. My functions section</a></li>
<li><a href="#orgd5fbd20">2.3. Configuration of My Own Packages</a></li>
<li><a href="#orgfba0b80">2.4. Programming Language Configurations</a></li>
<li><a href="#org32d26ac">2.5. org-mode</a></li>
2016-10-24 17:04:28 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org497d359">3. HTML Headers</a></li>
<li><a href="#orga9525a1">4. Early</a>
2016-10-24 17:04:28 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orgb8f6275">4.1. Lexical Binding</a></li>
<li><a href="#org2910556">4.2. Security</a></li>
<li><a href="#org1ece809">4.3. ELPA Archive Setup</a></li>
<li><a href="#org2c05047">4.4. Bootstrap Package Loading</a></li>
<li><a href="#orgc40c29d">4.5. Setup auto-compile</a></li>
<li><a href="#orgad1c6bd">4.6. Prefer Newer Versions</a></li>
<li><a href="#orgfd4893e">4.7. Custom Files</a></li>
<li><a href="#org7113c7a">4.8. emit</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orga1bd701">4.8.1. <span class="todo TODO">TODO</span> this needs to be done better, but it works for now</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orgdff330e">4.9. Benchmarking</a></li>
<li><a href="#orgc19a07f">4.10. GUI Disables</a></li>
<li><a href="#org6c8dff3">4.11. Byte-Compiler</a></li>
<li><a href="#orgf5b63c5">4.12. exec-path-from-shell</a></li>
<li><a href="#orga2b2176">4.13. noflet</a></li>
<li><a href="#org71395bb">4.14. Non-Forking Shell Command To String</a></li>
<li><a href="#org2f00c8d">4.15. Set EMACS environment variable</a></li>
2016-10-24 16:41:42 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orgf5497be">5. Functions</a>
2016-10-24 16:41:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org7fe147c">5.1. Join Paths</a></li>
<li><a href="#orgf95e2f4">5.2. Variables</a></li>
<li><a href="#orgd274c68">5.3. Use Package Wrapper With Local Load Path Support</a></li>
<li><a href="#org6f53325">5.4. Required Packages</a>
2016-10-24 16:41:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org91b1713">5.4.1. s</a></li>
<li><a href="#org9ccebcf">5.4.2. dash</a></li>
<li><a href="#orgd68c199">5.4.3. gh</a></li>
<li><a href="#org79f86e8">5.4.4. shut-up</a></li>
<li><a href="#org224e02d">5.4.5. pcache</a></li>
<li><a href="#orgb8982bd">5.4.6. parse-csv</a></li>
<li><a href="#org324e444">5.4.7. emit</a></li>
<li><a href="#orgd46c880">5.4.8. request</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orgdf8f747">5.5. Named Build</a></li>
<li><a href="#orgd275a2d">5.6. Emacs Version Predicate</a></li>
<li><a href="#org333613e">5.7. Compose Functions</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orge8f1a24">5.7.1. A version supporting macros</a></li>
<li><a href="#org6c9feea">5.7.2. Arbitrary arguments at every step</a></li>
<li><a href="#org9f4bfa7">5.7.3. Simpler unary version</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org5a1339c">5.8. With Advice</a></li>
<li><a href="#orgb4bffd4">5.9. Make Interactive</a></li>
<li><a href="#org30f903c">5.10. Advice Add Around Builder</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org951f001">5.10.1. Kill New</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orgf8b3892">5.11. Let Around</a></li>
<li><a href="#orgc11b3e9">5.12. Let Around Advice</a></li>
<li><a href="#orgb5f319a">5.13. Let Advise</a></li>
<li><a href="#org035f4cc">5.14. Compose Around Builder</a></li>
<li><a href="#org116ecbf">5.15. Measure Time</a></li>
<li><a href="#orgbc3406b">5.16. Add Files to <code>org-agenda-files</code></a></li>
<li><a href="#org565e767">5.17. Get String From File</a></li>
<li><a href="#orga164e82">5.18. Get Current Location</a></li>
<li><a href="#org2749713">5.19. Haversine distance</a></li>
<li><a href="#org45489a4">5.20. Font Size</a></li>
<li><a href="#orgfa1a6a5">5.21. Message Result Builder</a></li>
<li><a href="#org215891c">5.22. Custom <code>shell-command-on-region</code></a></li>
<li><a href="#orgd8c27d5">5.23. Copy String Functions</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orgd5ab604">5.23.1. Copy portions of the buffer file name</a></li>
<li><a href="#orgfd5139a">5.23.2. Copy the current branch using magit</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org0967548">5.24. Named Compile</a></li>
<li><a href="#org3e46735">5.25. Replace Escape Sequences</a></li>
<li><a href="#orga4f4e31">5.26. Download a File Into a Buffer</a></li>
<li><a href="#org08db55d">5.27. Concat With Symbols</a></li>
<li><a href="#org6ee1224">5.28. Edit a script on PATH</a></li>
<li><a href="#org342cd0e">5.29. Toggle lexical binding in the current buffer</a></li>
<li><a href="#orgf614de8">5.30. Sync kill ring with copyq</a></li>
<li><a href="#org6c3bfb7">5.31. helm-zsh-history</a>
2016-10-24 14:34:33 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orgc8fcfb2">5.31.1. Use projectile as default directory</a></li>
2016-10-24 14:34:33 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org4871e0a">5.32. Other</a></li>
<li><a href="#org5627af6">5.33. Keyboard Macros</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org85acc04">5.33.1. For editing literate config</a>
2016-10-27 04:02:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org8caba57">5.33.1.1. extract-current-sexp-to-src-block</a></li>
<li><a href="#org5f85bda">5.33.1.2. name-source-block-for-use-package-name</a></li>
<li><a href="#org79cefc4">5.33.1.3. extract-and-name-use-package-block</a></li>
2016-10-27 04:02:42 -06:00
</ul>
</li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org234eeb8">6. General</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orgf669303">6.1. User Info</a></li>
<li><a href="#orgbe2cdf3">6.2. Sane Defaults</a></li>
<li><a href="#orgfcaff93">6.3. Line Numbers</a></li>
<li><a href="#orgd388f85">6.4. Backups</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org6eb091c">6.4.1. Put them all in one directory</a></li>
<li><a href="#org6785778">6.4.2. Completely disable backups</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orgc4a8964">6.5. Prompts</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org0c54167">6.5.1. No popup frames</a></li>
<li><a href="#orgabf3f51">6.5.2. boolean (yes-or-no)</a></li>
<li><a href="#orgb04dd33">6.5.3. No dialog boxes</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org91fec3a">6.6. Splitting</a></li>
<li><a href="#org0646289">6.7. Buffer Display</a>
2016-11-04 19:29:15 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org22fb634">6.7.1. ewmctrl</a></li>
<li><a href="#orgbfd5a65">6.7.2. Handle xrefs annoying dedicated window garbage</a></li>
<li><a href="#orgceeefd6">6.7.3. display-buffer-alist</a></li>
2016-11-04 19:29:15 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orgee245dc">6.8. Fill Setup</a></li>
<li><a href="#orgd54a0c8">6.9. Show Trailing Whitespace</a>
2016-10-21 23:27:35 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org6ec9a61">6.9.1. Disable</a></li>
2016-10-21 23:27:35 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org364a515">6.10. Encoding</a></li>
<li><a href="#org29486cf">6.11. Visible Bell</a></li>
<li><a href="#orgd489cb5">6.12. Configure <code>vc</code></a></li>
<li><a href="#org9db7b83">6.13. Time in Mode Line</a></li>
<li><a href="#org665c7e5">6.14. Kill Ring</a></li>
<li><a href="#org3b8d062">6.15. Subword</a></li>
<li><a href="#orge5fa494">6.16. Scratch Buffer</a></li>
<li><a href="#org55d555c">6.17. Don't prompt about local variables</a></li>
<li><a href="#org09377fd">6.18. proced</a></li>
<li><a href="#orgc98413a">6.19. Set default browser</a></li>
<li><a href="#org25cd420">6.20. Set epa program</a></li>
<li><a href="#orgcf30f94">6.21. Make files executable</a></li>
<li><a href="#org16de45e">6.22. Misc</a></li>
<li><a href="#org08efe55">6.23. paradox</a></li>
<li><a href="#org491c22d">6.24. diminish</a></li>
<li><a href="#org83a2ce4">6.25. edit-server</a></li>
<li><a href="#orgd4d5090">6.26. load-dir</a></li>
<li><a href="#org892331e">6.27. server</a></li>
<li><a href="#orge2aec7f">6.28. list-environment</a></li>
<li><a href="#org27b0bd4">6.29. bug-hunter</a></li>
<li><a href="#org3667d2c">6.30. shackle</a></li>
<li><a href="#org6a77bcf">6.31. beacon</a></li>
<li><a href="#orgd007395">6.32. iregister</a></li>
<li><a href="#org808e042">6.33. discover-my-major</a></li>
<li><a href="#org732105b">6.34. refine</a></li>
<li><a href="#org29f1f1e">6.35. winner</a></li>
<li><a href="#org7e2186f">6.36. eyebrowse</a></li>
<li><a href="#orgbef7ff2">6.37. stream</a></li>
<li><a href="#org11183fe">6.38. tile</a></li>
<li><a href="#orgdcbe5a3">6.39. fill-column-indicator</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org519d284">7. Keybindings</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org0e4df70">7.1. god-mode</a></li>
<li><a href="#orgcd8dc22">7.2. bind-key</a></li>
<li><a href="#org3adb05c">7.3. which-key</a></li>
<li><a href="#org6b22f47">7.4. hydra</a>
2016-10-25 15:21:45 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org2755cce">7.4.1. Font Settings</a></li>
<li><a href="#org52d3036">7.4.2. Yanking</a></li>
<li><a href="#orgb8a2944">7.4.3. Compile</a></li>
2016-10-25 15:21:45 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org7559199">7.5. kill-emacs</a></li>
<li><a href="#org3320e03">7.6. imenu</a></li>
<li><a href="#orgeabdc8d">7.7. undo</a></li>
<li><a href="#org74481ac">7.8. other-window</a></li>
<li><a href="#orgbad3994">7.9. Mark ring</a></li>
<li><a href="#org26328f5">7.10. Other bindings</a></li>
<li><a href="#org806ba03">7.11. global-set-key-to-use-package</a></li>
<li><a href="#org28416eb">7.12. OSX</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org4906306">8. Navigation</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org520e2dc">8.1. zop-to-char</a></li>
<li><a href="#org5ba327f">8.2. helm</a></li>
<li><a href="#org87e938d">8.3. helm-projectile</a></li>
<li><a href="#org666741d">8.4. projectile</a></li>
<li><a href="#org96aafbb">8.5. ido</a></li>
<li><a href="#orgedace46">8.6. avy</a></li>
<li><a href="#orgc78a6a6">8.7. ace-window</a></li>
<li><a href="#org870ca45">8.8. neotree</a></li>
<li><a href="#orgfdccea5">8.9. jump-char</a></li>
<li><a href="#org5edb64b">8.10. flimenu</a></li>
<li><a href="#org6ac3e6d">8.11. swiper</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orgf771ea7">9. Completion</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org6c817a3">9.1. company</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orgbf9fac9">9.1.1. company-flx</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org26d5976">9.2. auto-complete</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org961ec1a">10. Text Manipulation</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org1f43ab3">10.1. smartparens</a></li>
<li><a href="#org8055eec">10.2. multiple-cursors</a></li>
<li><a href="#org4a41918">10.3. expand-region</a></li>
<li><a href="#org7dc98dc">10.4. multi-line</a></li>
<li><a href="#orgde4edd1">10.5. comment-dwim-2</a></li>
<li><a href="#orgf8d26ff">10.6. unfill</a></li>
<li><a href="#orgdb278f0">10.7. cliphist</a></li>
<li><a href="#org9abbb00">10.8. electric-operator-mode</a></li>
<li><a href="#org9bef5c2">10.9. string-inflection</a></li>
<li><a href="#orge7fc5a9">10.10. yasnippet</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org1230b7c">11. Source Control</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org7ca9d93">11.1. magit</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org29dc1ac">11.1.1. magithub</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org6e15620">11.2. git-link</a></li>
<li><a href="#org7ef0469">11.3. magit-gitflow</a></li>
<li><a href="#org8dee9ed">11.4. git-timemachine</a></li>
<li><a href="#org4d44d8a">11.5. git-gutter</a></li>
<li><a href="#orgebeb6c9">11.6. gitolite-clone</a></li>
<li><a href="#orgb34abf5">11.7. gitconfig-mode</a></li>
<li><a href="#org5e1cef8">11.8. gitignore-mode</a></li>
<li><a href="#org4ec6ffa">11.9. github</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orgb308ebd">11.9.1. github-search</a></li>
<li><a href="#org8f89010">11.9.2. github-clone</a></li>
<li><a href="#org59a7783">11.9.3. github-notifier</a></li>
<li><a href="#org4744870">11.9.4. github-browse-file</a></li>
<li><a href="#org2e4be17">11.9.5. magit-gh-pulls</a></li>
<li><a href="#orgbb23b42">11.9.6. gist</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orge7019e6">12. Major Modes</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org61db33d">12.1. Programming</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org114248e">12.1.1. python</a>
2016-10-27 04:02:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orge02e26e">12.1.1.1. pyimport</a></li>
<li><a href="#org3d3f656">12.1.1.2. jedi</a></li>
2016-10-27 04:02:42 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org37d652f">12.1.2. go</a>
2016-10-27 04:02:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org4f8f737">12.1.2.1. Show diffs of testify output</a></li>
2016-10-27 04:02:42 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orgb148ab2">12.1.3. emacs-lisp</a>
2016-10-27 04:02:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org01da19e">12.1.3.1. elisp-slime-nav</a></li>
<li><a href="#org403b4b5">12.1.3.2. macrostep</a></li>
<li><a href="#orgd568a42">12.1.3.3. emr</a></li>
<li><a href="#orgb33db65">12.1.3.4. Editing configuration</a></li>
<li><a href="#orgfc5e1b6">12.1.3.5. Checkdoc</a></li>
<li><a href="#org0794e92">12.1.3.6. edebug</a></li>
<li><a href="#org33cb5be">12.1.3.7. overseer</a></li>
<li><a href="#org631c294">12.1.3.8. Misc</a></li>
<li><a href="#orge2cd40c">12.1.3.9. Show result of eval-last-sexp inline</a></li>
<li><a href="#org5280c7e">12.1.3.10. Reevalute defvars when running eval-last-sexp</a></li>
<li><a href="#orge44dfae">12.1.3.11. Init hook</a></li>
<li><a href="#orgaff4c0b">12.1.3.12. Keybinds</a></li>
2016-10-27 04:02:42 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org63714d6">12.1.4. clojure</a>
2016-10-27 04:02:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org0001958">12.1.4.1. cider</a></li>
<li><a href="#org0ec2665">12.1.4.2. clj-refactor</a></li>
2016-10-27 04:02:42 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org83ca539">12.1.5. scala</a></li>
<li><a href="#orgb7fdf82">12.1.6. js</a></li>
<li><a href="#orgab4305c">12.1.7. rust</a></li>
<li><a href="#org2af1ed3">12.1.8. haskell</a>
2016-10-27 04:02:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orge1148d4">12.1.8.1. intero</a></li>
<li><a href="#orgff24eca">12.1.8.2. hindent</a></li>
<li><a href="#orgb1ed759">12.1.8.3. ghc-mod</a></li>
<li><a href="#org4ab15e4">12.1.8.4. company-ghc</a></li>
2016-10-27 04:02:42 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orgafbed89">12.1.9. C/C++</a></li>
<li><a href="#org9de9eb9">12.1.10. C#</a></li>
<li><a href="#org646a931">12.1.11. racket</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org1fc22e4">12.2. Data/Config/Protocol</a>
2016-10-24 16:41:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org6342258">12.2.1. thrift</a></li>
<li><a href="#org57acb63">12.2.2. protobuf</a></li>
<li><a href="#orgcd3e232">12.2.3. json-mode</a></li>
<li><a href="#org6824725">12.2.4. yaml-mode</a></li>
<li><a href="#org7fac312">12.2.5. es-mode</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orgfb8b17c">12.3. Document</a>
2016-10-24 16:41:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org75eab54">12.3.1. org</a>
2016-10-27 04:02:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orgedda48f">12.3.1.1. config</a></li>
<li><a href="#orgd778f6b">12.3.1.2. Use frames</a></li>
<li><a href="#org23e81de">12.3.1.3. Set Background Color of Source Blocks for Export</a></li>
<li><a href="#org9d75c53">12.3.1.4. Use my own default naming scheme for org-headings</a></li>
<li><a href="#org12da2be">12.3.1.5. org-projectile</a></li>
<li><a href="#orgc5f339f">12.3.1.6. org-notify</a></li>
<li><a href="#org59cafd0">12.3.1.7. org-reveal</a></li>
<li><a href="#org0f33b1d">12.3.1.8. org-caldav</a></li>
2016-10-27 04:02:42 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orgcea2fdc">12.3.2. TeX</a>
2016-10-27 04:02:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org1d2e3d9">12.3.2.1. latex</a></li>
<li><a href="#org44ed89d">12.3.2.2. auctex-latexmk</a></li>
<li><a href="#org54a3fbe">12.3.2.3. company-auctex</a></li>
2016-10-27 04:02:42 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org27a30b9">12.3.3. markdown-mode</a></li>
<li><a href="#orgbf12f9c">12.3.4. plantuml-mode</a></li>
<li><a href="#org06ebc26">12.3.5. wsd-mode</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org4e72f3b">12.4. Utility</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org9fb0ed7">12.4.1. restclient</a></li>
<li><a href="#orga69cfb5">12.4.2. jq-mode</a></li>
2016-10-24 16:41:42 -06:00
</ul>
</li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org6850bc7">13. Programming</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org22fca9c">13.1. realgud</a></li>
<li><a href="#org51a55fa">13.2. emr</a></li>
<li><a href="#orga4d3c60">13.3. semantic</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org5402a2c">14. Utility</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orgc779e73">14.1. term</a></li>
<li><a href="#org6a3210d">14.2. term-manager</a></li>
<li><a href="#org7786fc9">14.3. term-projectile</a></li>
<li><a href="#org354660f">14.4. crux</a></li>
<li><a href="#org425e3cc">14.5. kde-connect</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org47fd3bb">15. Chat</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org634edb8">15.1. erc</a></li>
<li><a href="#org4884c23">15.2. bitlbee</a></li>
<li><a href="#org053434d">15.3. slack</a></li>
2016-10-24 16:41:42 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org623b149">16. Cooperation</a>
2016-10-19 19:13:32 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#orgc51ea69">16.1. togetherly</a></li>
<li><a href="#org0472356">16.2. floobits</a></li>
<li><a href="#orgb21f677">16.3. rudel</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org2ba4721">17. Other</a>
2016-10-24 16:41:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org8f223aa">17.1. anzu</a></li>
<li><a href="#orge36be9f">17.2. fontawesome</a></li>
<li><a href="#org4e4def1">17.3. shell-history</a></li>
<li><a href="#orgffa4cfe">17.4. iedit</a></li>
<li><a href="#orgd0b718c">17.5. tramp</a></li>
<li><a href="#org88a9f0a">17.6. flycheck</a></li>
<li><a href="#orgc3712ff">17.7. narrow-indirect</a></li>
<li><a href="#org3037cb4">17.8. editorconfig</a></li>
<li><a href="#org9e99c31">17.9. dtrt-indent</a></li>
<li><a href="#org8314d58">17.10. indent-guide</a></li>
<li><a href="#org2fb4c0c">17.11. rainbow-delimiters</a></li>
<li><a href="#org7340d9a">17.12. undo-tree</a></li>
<li><a href="#orgb13a5c0">17.13. recentf</a></li>
<li><a href="#orgaaeaccd">17.14. key-chord</a></li>
<li><a href="#org3b2526f">17.15. nodejs-repl</a></li>
<li><a href="#org3b64257">17.16. calc-mode</a></li>
<li><a href="#org9fc9618">17.17. helm-spotify</a></li>
<li><a href="#org81a9682">17.18. jabber</a></li>
<li><a href="#org7afe28d">17.19. htmlize</a></li>
<li><a href="#org76abb68">17.20. calfw</a></li>
<li><a href="#orga23f16b">17.21. clocker</a></li>
<li><a href="#org7cce35b">17.22. deft</a></li>
<li><a href="#org33fa300">17.23. epg</a></li>
<li><a href="#org189f034">17.24. pinentry</a></li>
<li><a href="#org3c268c1">17.25. twittering-mode</a></li>
<li><a href="#org738a4ef">17.26. matrix-client</a></li>
<li><a href="#org352343f">17.27. mu4e</a></li>
<li><a href="#orga4229b1">17.28. gmail-message-mode</a></li>
<li><a href="#org88dd022">17.29. ham-mode</a></li>
<li><a href="#orge1045db">17.30. alert</a></li>
<li><a href="#org74c2e86">17.31. sauron</a></li>
<li><a href="#org3e5eef3">17.32. screenshot</a></li>
<li><a href="#org742ffc0">17.33. libmpdee</a></li>
<li><a href="#org10879c5">17.34. flyspell</a></li>
<li><a href="#orgb098f01">17.35. web-mode</a></li>
<li><a href="#org5146a46">17.36. helm-themes</a></li>
<li><a href="#org4521b95">17.37. helm-swoop</a></li>
<li><a href="#org9a19687">17.38. perspective</a></li>
<li><a href="#org684d047">17.39. smex</a></li>
<li><a href="#orged9c9c5">17.40. java</a></li>
<li><a href="#orgee46155">17.41. android-mode</a></li>
<li><a href="#orgdaef7c8">17.42. gradle-mode</a></li>
<li><a href="#org6cdf599">17.43. jsx-mode</a></li>
<li><a href="#org870ad40">17.44. css</a></li>
<li><a href="#org9d3ca7b">17.45. robe</a></li>
<li><a href="#org4340d0c">17.46. rinari</a></li>
<li><a href="#orgaa2f0ae">17.47. helm-gtags</a></li>
<li><a href="#orgeb48f55">17.48. sgml-mode</a></li>
<li><a href="#org3d02571">17.49. evil</a></li>
<li><a href="#org3c8e9ee">17.50. hackernews</a></li>
2016-10-24 16:41:42 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orga62475c">18. Appearance</a>
2016-10-24 16:41:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org940e21a">18.1. Basic Config</a></li>
<li><a href="#orgcacde38">18.2. Themes</a></li>
<li><a href="#org400950c">18.3. all-the-icons</a></li>
<li><a href="#orgfcffce3">18.4. spaceline</a>
2016-10-24 16:41:42 -06:00
<ul>
2016-11-07 17:41:36 -07:00
<li><a href="#org40a9f3e">18.4.1. Disable sRGB colorspace to make powerline separators work</a></li>
<li><a href="#org9adbec1">18.4.2. config</a></li>
2016-10-24 16:41:42 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org29751a9">18.5. page-break-lines</a></li>
<li><a href="#org8a58304">18.6. helm-themes</a></li>
<li><a href="#org9a5e492">18.7. window-number</a></li>
<li><a href="#org4439943">18.8. Whitespace Setup</a></li>
<li><a href="#orge985cd6">18.9. Colorize Compliation Buffers</a></li>
<li><a href="#org0de4d7b">18.10. Automatic Theme Changer</a></li>
<li><a href="#org24eafcb">18.11. Fix <code>ansi-term</code> Colors</a></li>
<li><a href="#org53bf161">18.12. After <code>load-theme</code> hook</a></li>
<li><a href="#orgd0b889c">18.13. Frame Initialization</a></li>
2016-10-24 16:41:42 -06:00
</ul>
</li>
2016-11-07 17:41:36 -07:00
<li><a href="#orga17c277">19. Post Init Custom</a></li>
2016-10-19 19:13:32 -06:00
</ul>
</div>
</div>
2016-10-24 22:17:35 -06:00
<p>
I suggest you read this document at <a href="http://ivanmalison.github.io/dotfiles/">http://ivanmalison.github.io/dotfiles/</a> or,
of course, in emacs, as the internal links that follow are unlikely to work
anywhere else (including, for example, at <a href="https://github.com/IvanMalison/dotfiles">https://github.com/IvanMalison/dotfiles</a>).
</p>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org1d9016d" class="outline-2">
<h2 id="org1d9016d"><span class="section-number-2">1</span> About</h2>
2016-10-19 19:13:32 -06:00
<div class="outline-text-2" id="text-1">
<p>
2016-10-24 22:17:35 -06:00
This is my emacs configuration in literate form. It aspires to be
like the incredibly well commented literate configurations of <a href="http://pages.sachachua.com/.emacs.d/Sacha.html">Sacha Chua</a> and
<a href="http://doc.rix.si/cce/cce.html">Ryan Rix</a>, but I haven't quite gotten around to polishing it to the point that
those two have. Still, there are definitely a few sections of which I am quite
proud, and that others may find to be useful.
2016-10-19 19:13:32 -06:00
</p>
</div>
2016-10-25 15:21:45 -06:00
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org71ad59a" class="outline-2">
<h2 id="org71ad59a"><span class="section-number-2">2</span> Highlights</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-2">
2016-10-24 17:04:28 -06:00
<p>
These sections are the ones that have the most potential to be interesting to
others:
</p>
2016-10-19 19:13:32 -06:00
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org22ede5b" class="outline-3">
<h3 id="org22ede5b"><span class="section-number-3">2.1</span> How I generate <a href="http://ivanmalison.github.io/dotfiles/">http://ivanmalison.github.io/dotfiles/</a></h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-2-1">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org0f501cd" class="outline-4">
<h4 id="org0f501cd"><span class="section-number-4">2.1.1</span> Git Hooks</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-2-1-1">
<p>
I wrote a <a href="https://github.com/IvanMalison/dotfiles/tree/master/dotfiles/emacs.d/bin">githook and an installer script</a> that automatically update index.html
at the root of the repository by running <code>org-html-export-to-html</code> 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 <a href="https://github.com/IvanMalison/dotfiles/blob/16a4f6c3aadef39a45d30c15e8637b40858721ea/dotfiles/emacs.d/bin/util.sh#L4">here</a> and
should be relatively easy to change.
</p>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org742aaa6" class="outline-4">
<h4 id="org742aaa6"><span class="section-number-4">2.1.2</span> <a href="https://github.com/fniessen/org-html-themes">Read The Org</a></h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-2-1-2">
<p>
I use <a href="https://github.com/fniessen">fniessen</a>'s ReadTheOrg theme which can be found at <a href="https://github.com/fniessen/org-html-themes">https://github.com/fniessen/org-html-themes</a>.
</p>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9fea203" class="outline-4">
<h4 id="org9fea203"><span class="section-number-4">2.1.3</span> Heading Links</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-2-1-3">
<p>
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 <code>org-export-get-reference</code>.
</p>
<p>
2016-11-07 17:41:36 -07:00
See how <a href="#org9d75c53">this link</a> (which is just a normal internal link in the original
2016-10-25 15:21:45 -06:00
document) takes you to <a href="http://ivanmalison.github.io/dotfiles/#usemyowndefaultnamingschemefororgheadings">http://ivanmalison.github.io/dotfiles/#usemyowndefaultnamingschemefororgheadings</a>.
</p>
<p>
In case you haven't noticed, that is where you should go grab the code that does
this.
</p>
<p>
I'm considering turning this snippet in to a package, so please let me know if
that is something you are interested in.
</p>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgf1fa6b1" class="outline-4">
<h4 id="orgf1fa6b1"><span class="section-number-4">2.1.4</span> Set Background Color Source Blocks</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-2-1-4">
<p>
2016-11-07 17:41:36 -07:00
For some reason, org-mode uses all of your currently active fontification when exporting EXCEPT for background color. <a href="#org23e81de">This</a> modification fixes this.
2016-10-25 15:21:45 -06:00
</p>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orga89a882" class="outline-3">
<h3 id="orga89a882"><span class="section-number-3">2.2</span> <a href="#orgf5497be">My functions section</a></h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-2-2">
2016-10-24 17:04:28 -06:00
<p>
2016-10-24 17:18:33 -06:00
&#x2026;has a bunch of generally useful functions:
2016-10-24 17:04:28 -06:00
</p>
<ul class="org-ul">
2016-10-25 15:21:45 -06:00
<li><a href="https://github.com/IvanMalison/emit/blob/2e4d788abd68bac538acb06443179b8d5885052e/emit.el#L104">emit-prefix-selector</a> (SUPER USEFUL, moved to emit) See <a href="https://github.com/IvanMalison/emit#prefix-selector">README</a> for explantion</li>
2016-11-07 17:41:36 -07:00
<li><a href="#org45489a4">Font Size</a> functions and an <a href="#org5bf36cf">Awesome Hydra</a> for them</li>
<li><a href="#org4fa4949">Download a file into a buffer</a> (curl straight into a file)</li>
<li><a href="#org0babcbf">Edit a script on $PATH</a></li>
<li><a href="#org52d3036">Copy Portions of Buffer File Path Hydra</a> and the associated <a href="#orgd8c27d5">Copy String Functions</a></li>
<li><a href="#org04b3f49">Named Build of Builder Macros</a> (<a href="https://github.com/IvanMalison/emit#named-builder">README</a>) and <a href="#org7839c46">A Compose Supporting Macros</a> (<a href="https://github.com/IvanMalison/emit#compose">README</a>)</li>
2016-10-24 17:18:33 -06:00
</ul>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd5fbd20" class="outline-3">
<h3 id="orgd5fbd20"><span class="section-number-3">2.3</span> Configuration of My Own Packages</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-2-3">
2016-10-24 17:18:33 -06:00
<ul class="org-ul">
2016-11-07 17:41:36 -07:00
<li><a href="#org7786fc9">term-projectile</a> and <a href="#org6a3210d">term-manager</a></li>
<li><a href="#org12da2be">org-projectile</a></li>
<li><a href="#org7dc98dc">multi-line</a></li>
<li><a href="#orgb308ebd">github-search</a></li>
<li><a href="#org5edb64b">flimenu</a></li>
<li><a href="#org11183fe">tile</a></li>
2016-10-24 17:04:28 -06:00
</ul>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgfba0b80" class="outline-3">
<h3 id="orgfba0b80"><span class="section-number-3">2.4</span> <a href="#orgab66b5f">Programming Language Configurations</a></h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-2-4">
2016-10-24 17:18:33 -06:00
<p>
2016-11-07 17:41:36 -07:00
My programming language major mode configurations can all be found <a href="#orgab66b5f">here</a>.
2016-10-24 17:18:33 -06:00
</p>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org32d26ac" class="outline-3">
<h3 id="org32d26ac"><span class="section-number-3">2.5</span> <a href="#org75eab54">org-mode</a></h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-2-5">
2016-10-24 17:18:33 -06:00
<p>
2016-11-07 17:41:36 -07:00
My <a href="#org75eab54">org-mode</a> configuration is pretty comprehensive, but not super well commented.
2016-10-24 17:18:33 -06:00
</p>
</div>
2016-10-24 17:04:28 -06:00
</div>
</div>
2016-10-24 17:18:33 -06:00
2016-11-07 17:41:36 -07:00
<div id="outline-container-org497d359" class="outline-2">
<h2 id="org497d359"><span class="section-number-2">3</span> HTML Headers</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-3">
2016-10-24 17:04:28 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orga9525a1" class="outline-2">
<h2 id="orga9525a1"><span class="section-number-2">4</span> Early</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-4">
2016-10-19 19:13:32 -06:00
<p>
The configurations in this section need to occur early in emacs startup for some reason or another.
</p>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb8f6275" class="outline-3">
<h3 id="orgb8f6275"><span class="section-number-3">4.1</span> Lexical Binding</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-4-1">
2016-10-19 19:13:32 -06:00
<p>
This makes it so that the file that is produced from tangling this
file uses lexical scoping.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp"><span style="font-weight: bold; font-style: italic;">;;; </span><span style="font-weight: bold; font-style: italic;">-*- lexical-binding: t -*-</span>
(<span style="font-weight: bold;">setq-default</span> lexical-binding t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org2910556" class="outline-3">
<h3 id="org2910556"><span class="section-number-3">4.2</span> Security</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-4-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:secure</span> t)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:use-https-and-tls</span> ()
(<span style="font-weight: bold;">setq</span> tls-checktrust t)
(<span style="font-weight: bold;">let</span> ((trustfile
(replace-regexp-in-string
<span style="font-style: italic;">"\\\\"</span> <span style="font-style: italic;">"/"</span>
(replace-regexp-in-string
<span style="font-style: italic;">"\n"</span> <span style="font-style: italic;">""</span>
(shell-command-to-string <span style="font-style: italic;">"python -m certifi"</span>)))))
(<span style="font-weight: bold;">setq</span> tls-program
(list
(format <span style="font-style: italic;">"gnutls-cli%s --x509cafile %s -p %%p %%h"</span>
(<span style="font-weight: bold;">if</span> (eq window-system 'w32) <span style="font-style: italic;">".exe"</span> <span style="font-style: italic;">""</span>) trustfile)))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:test-security</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let</span> ((bad-hosts
(<span style="font-weight: bold;">loop</span> for bad
in `(<span style="font-style: italic;">"https://wrong.host.badssl.com/"</span>
<span style="font-style: italic;">"https://self-signed.badssl.com/"</span>)
if (<span style="font-weight: bold;">condition-case</span> _e
(url-retrieve
bad (<span style="font-weight: bold;">lambda</span> (_retrieved) t))
(<span style="font-weight: bold;">error</span> nil))
collect bad)))
(<span style="font-weight: bold;">if</span> bad-hosts
(<span style="font-weight: bold;">error</span> (format <span style="font-style: italic;">"tls misconfigured; retrieved %s ok"</span>
bad-hosts))
(url-retrieve <span style="font-style: italic;">"https://badssl.com"</span>
(<span style="font-weight: bold;">lambda</span> (_retrieved) t)))))
(<span style="font-weight: bold;">when</span> imalison:secure (imalison:use-https-and-tls))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org1ece809" class="outline-3">
<h3 id="org1ece809"><span class="section-number-3">4.3</span> ELPA Archive Setup</h3>
2016-11-07 12:57:02 -07:00
<div class="outline-text-3" id="text-4-3">
<p>
The org archive does not support https, so we set http as the protocol explicitly.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="linenr"> 1: </span>(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">package</span>)
<span class="linenr"> 2: </span>
<span class="linenr"> 3: </span>(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:build-archive-uri</span> (uri protocol)
<span class="linenr"> 4: </span> (<span style="font-weight: bold;">unless</span> protocol (<span style="font-weight: bold;">setq</span> protocol (<span style="font-weight: bold;">if</span> imalison:secure <span style="font-style: italic;">"https"</span> <span style="font-style: italic;">"http"</span>)))
<span class="linenr"> 5: </span> (format <span style="font-style: italic;">"%s://%s"</span> protocol uri))
<span class="linenr"> 6: </span>
<span class="linenr"> 7: </span>(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:melpa-uri</span> nil)
<span class="linenr"> 8: </span>(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:package-archive-triples</span>
<span class="linenr"> 9: </span> `((<span style="font-style: italic;">"elpa"</span> <span style="font-style: italic;">"tromey.com/elpa/"</span> <span style="font-style: italic;">"http"</span>)
<span class="linenr">10: </span> (<span style="font-style: italic;">"org"</span> <span style="font-style: italic;">"orgmode.org/elpa/"</span> <span style="font-style: italic;">"http"</span>)
<span class="linenr">11: </span> (<span style="font-style: italic;">"melpa"</span> ,(<span style="font-weight: bold;">or</span> imalison:melpa-uri <span style="font-style: italic;">"melpa.org/packages/"</span>) nil)
<span class="linenr">12: </span> (<span style="font-style: italic;">"melpa-stable"</span> <span style="font-style: italic;">"stable.melpa.org/packages/"</span> nil)))
<span class="linenr">13: </span>
<span class="linenr">14: </span>(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:add-package-archive</span> (archive-name archive-uri)
<span class="linenr">15: </span> (add-to-list 'package-archives
<span class="linenr">16: </span> `(,archive-name . ,archive-uri) t))
<span class="linenr">17: </span>
<span class="linenr">18: </span>(<span style="font-weight: bold;">cl-loop</span> for package-triple in imalison:package-archive-triples
<span class="linenr">19: </span> do (<span style="font-weight: bold;">cl-destructuring-bind</span> (archive-name archive-uri protocol) package-triple
<span class="linenr">20: </span> (imalison:add-package-archive
<span class="linenr">21: </span> archive-name (imalison:build-archive-uri archive-uri protocol))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org2c05047" class="outline-3">
<h3 id="org2c05047"><span class="section-number-3">4.4</span> Bootstrap Package Loading</h3>
2016-11-07 12:57:02 -07:00
<div class="outline-text-3" id="text-4-4">
<p>
Its 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
are installed so my version of <code>ensure-packages-installed</code> is really
only used to download use-package itself.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">ensure-packages-installed</span> (packages)
(<span style="font-weight: bold;">unless</span> package-archive-contents
(package-refresh-contents))
(mapcar
(<span style="font-weight: bold;">lambda</span> (package)
(<span style="font-weight: bold;">if</span> (package-installed-p package)
package
(<span style="font-weight: bold;">progn</span> (message (format <span style="font-style: italic;">"Installing package %s."</span> package))
(package-install package))))
packages))
</pre>
</div>
<p>
Ensure that use-package is installed.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(package-initialize t)
(ensure-packages-installed '(<span style="font-weight: bold;">use-package</span>))
</pre>
</div>
<p>
use-package is only needed at compile time.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">eval-when-compile</span> (<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">use-package</span>))
</pre>
</div>
<p>
Ensure by default since most of the package for which I use use-package need to be downloaded. ensure can be disabled explicitly with a <code>:ensure nil</code>.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> use-package-always-ensure t)
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgc40c29d" class="outline-3">
<h3 id="orgc40c29d"><span class="section-number-3">4.5</span> Setup auto-compile</h3>
2016-11-07 12:57:02 -07:00
<div class="outline-text-3" id="text-4-5">
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">auto-compile</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:ensure</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(auto-compile-on-load-mode)
(auto-compile-on-save-mode)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgad1c6bd" class="outline-3">
<h3 id="orgad1c6bd"><span class="section-number-3">4.6</span> Prefer Newer Versions</h3>
2016-11-07 12:57:02 -07:00
<div class="outline-text-3" id="text-4-6">
2016-10-19 19:13:32 -06:00
<p>
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
possible.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> load-prefer-newer t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgfd4893e" class="outline-3">
<h3 id="orgfd4893e"><span class="section-number-3">4.7</span> Custom Files</h3>
2016-11-07 12:57:02 -07:00
<div class="outline-text-3" id="text-4-7">
2016-10-19 19:13:32 -06:00
<p>
The default value of <code>custom-file</code> is just the current user's <code>.emacs.d/init.el</code>
file. Emacs will add content to <code>custom-file</code> whenever a variable is customized
or marked as safe. When init.el is version controlled, it is quite annoying to
have random machine-generated variable settings amended to it because those
changes are often not worth keeping permanently, so we set a different custom
file here to avoid this situation.
</p>
<p>
custom-before.el is loaded before the rest of init.el, while custom-after.el is
loaded afterwards. this-machine.el has customizations that should only apply to
the current machine. custom-before and custom-after are not version controlled
in the dotfiles repo but they are shared across machines elsewhere.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">machine-custom</span> <span style="font-style: italic;">"~/.emacs.d/this-machine.el"</span>)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">custom-after-file</span> <span style="font-style: italic;">"~/.emacs.d/custom-after.el"</span>)
(<span style="font-weight: bold;">setq</span> custom-file <span style="font-style: italic;">"~/.emacs.d/custom-before.el"</span>)
(<span style="font-weight: bold;">when</span> (file-exists-p custom-file) (load custom-file))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org7113c7a" class="outline-3">
<h3 id="org7113c7a"><span class="section-number-3">4.8</span> emit</h3>
2016-11-07 12:57:02 -07:00
<div class="outline-text-3" id="text-4-8">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-orga1bd701" class="outline-4">
<h4 id="orga1bd701"><span class="section-number-4">4.8.1</span> <span class="todo TODO">TODO</span> this needs to be done better, but it works for now</h4>
2016-11-07 12:57:02 -07:00
<div class="outline-text-4" id="text-4-8-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">when</span> (file-exists-p <span style="font-style: italic;">"~/.emacs.d/load.d/emit.el"</span>)
(load <span style="font-style: italic;">"~/.emacs.d/load.d/emit.el"</span>))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgdff330e" class="outline-3">
<h3 id="orgdff330e"><span class="section-number-3">4.9</span> Benchmarking</h3>
2016-11-07 12:57:02 -07:00
<div class="outline-text-3" id="text-4-9">
2016-10-19 19:13:32 -06:00
<p>
This appears here so that it can accurately benchmark as much of
startup as possible.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:do-benchmark</span>)
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">benchmark-init</span>
<span style="font-weight: bold;">:if</span> (<span style="font-weight: bold;">bound-and-true-p</span> imalison:do-benchmark)
<span style="font-weight: bold;">:demand</span> t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgc19a07f" class="outline-3">
<h3 id="orgc19a07f"><span class="section-number-3">4.10</span> GUI Disables</h3>
2016-11-07 12:57:02 -07:00
<div class="outline-text-3" id="text-4-10">
2016-10-19 19:13:32 -06:00
<p>
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
bunch of times.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">when</span> (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(<span style="font-weight: bold;">when</span> (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(<span style="font-weight: bold;">when</span> (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
2016-10-19 19:13:32 -06:00
</pre>
</div>
<p>
Tooltips are annoying:
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">if</span> (fboundp 'tooltip-mode) (tooltip-mode -1) (<span style="font-weight: bold;">setq</span> tooltip-use-echo-area t))'
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6c8dff3" class="outline-3">
<h3 id="org6c8dff3"><span class="section-number-3">4.11</span> Byte-Compiler</h3>
2016-11-07 12:57:02 -07:00
<div class="outline-text-3" id="text-4-11">
2016-10-19 19:13:32 -06:00
<p>
These definitions silence the byte-compiler.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">grep-find-ignored-directories</span> nil)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">grep-find-ignored-files</span> nil)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">ido-context-switch-command</span> nil)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">ido-cur-item</span> nil)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">ido-cur-list</span> nil)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">ido-default-item</span> nil)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">inherit-input-method</span> nil)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">oauth--token-data</span> nil)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">tls-checktrust</span> nil)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">tls-program</span> nil)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">url-callback-arguments</span> nil)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">url-callback-function</span> nil)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">url-http-extra-headers</span> nil)
2016-10-19 19:13:32 -06:00
</pre>
</div>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp"><span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">This variable doesn't exist in old versions of org-mode</span>
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">org-show-context-detail</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgf5b63c5" class="outline-3">
<h3 id="orgf5b63c5"><span class="section-number-3">4.12</span> exec-path-from-shell</h3>
2016-11-07 12:57:02 -07:00
<div class="outline-text-3" id="text-4-12">
2016-10-19 19:13:32 -06:00
<p>
Sets environment variables by starting a shell.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">exec-path-from-shell</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">For debugging</span>
(<span style="font-weight: bold;">when</span> nil
(message <span style="font-style: italic;">"path: %s, setup: %s"</span> (getenv <span style="font-style: italic;">"PATH"</span>)
(getenv <span style="font-style: italic;">"ENVIRONMENT_SETUP_DONE"</span>))
(<span style="font-weight: bold;">setq</span> exec-path-from-shell-debug t))
(<span style="font-weight: bold;">setq</span> exec-path-from-shell-arguments (list <span style="font-style: italic;">"-l"</span>))
(<span style="font-weight: bold;">setq</span> exec-path-from-shell-check-startup-files nil)
(add-to-list 'exec-path-from-shell-variables <span style="font-style: italic;">"SHELL"</span>)
(add-to-list 'exec-path-from-shell-variables <span style="font-style: italic;">"GOPATH"</span>)
(add-to-list 'exec-path-from-shell-variables <span style="font-style: italic;">"ENVIRONMENT_SETUP_DONE"</span>)
(add-to-list 'exec-path-from-shell-variables <span style="font-style: italic;">"PYTHONPATH"</span>)
(exec-path-from-shell-initialize)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orga2b2176" class="outline-3">
<h3 id="orga2b2176"><span class="section-number-3">4.13</span> noflet</h3>
2016-11-07 12:57:02 -07:00
<div class="outline-text-3" id="text-4-13">
2016-11-02 21:58:03 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">noflet</span>
<span style="font-weight: bold;">:demand</span> t)
2016-11-02 21:58:03 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org71395bb" class="outline-3">
<h3 id="org71395bb"><span class="section-number-3">4.14</span> Non-Forking Shell Command To String</h3>
2016-11-07 12:57:02 -07:00
<div class="outline-text-3" id="text-4-14">
2016-10-19 19:13:32 -06:00
<p>
Emacs' built in <code>shell-command-to-string</code> function has the downside that it
forks a new shell process every time it is executed. This means that any shell
startup cost is incurred when this function is called.
</p>
<p>
The following implementation uses eshell's <code>executable-find</code> to find the
binary (which is the only reason <code>shell-comand-to-string</code> is typically used
anyway), but it avoids incurring any shell-startup cost.
</p>
<p>
This was originally inspired by <a href="https://github.com/bbatsov/projectile/issues/1044">this issue</a>.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:call-process-to-string</span> (program <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">with-temp-buffer</span>
(apply 'call-process program nil (current-buffer) nil args)
(buffer-string)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:get-call-process-args-from-shell-command</span> (command)
(<span style="font-weight: bold;">cl-destructuring-bind</span>
(the-command . args) (split-string command <span style="font-style: italic;">" "</span>)
(<span style="font-weight: bold;">let</span> ((binary-path (executable-find the-command)))
(<span style="font-weight: bold;">when</span> binary-path
(cons binary-path args)))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:shell-command-to-string</span> (command)
(<span style="font-weight: bold;">let</span> ((call-process-args
(imalison:get-call-process-args-from-shell-command command)))
(<span style="font-weight: bold;">if</span> call-process-args
(apply 'imalison:call-process-to-string call-process-args)
(shell-command-to-string command))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
<p>
This makes it so that we always try to call-process instead of shell-command-to-sting. It may cause undesireable behavior.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:try-call-process</span> (command)
(<span style="font-weight: bold;">let</span> ((call-process-args
(imalison:get-call-process-args-from-shell-command command)))
(<span style="font-weight: bold;">if</span> call-process-args
(apply 'imalison:call-process-to-string call-process-args))))
2016-10-29 13:55:53 -06:00
</pre>
</div>
<p>
This had to be disabled because it was causing a bunch of issues with projectile.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(advice-add 'shell-command-to-string <span style="font-weight: bold;">:before-until</span> 'imalison:try-call-process)
2016-10-29 13:55:53 -06:00
</pre>
</div>
<p>
This solution only applies it to projectile-find-file
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:call-with-quick-shell-command</span> (fn <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">noflet</span> ((shell-command-to-string (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">or</span> (apply 'imalison:try-call-process args) (apply this-fn args))))
(apply fn args)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(advice-add 'projectile-find-file <span style="font-weight: bold;">:around</span> 'imalison:call-with-quick-shell-command)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org2f00c8d" class="outline-3">
<h3 id="org2f00c8d"><span class="section-number-3">4.15</span> Set EMACS environment variable</h3>
2016-11-02 21:58:03 -06:00
<div class="outline-text-3" id="text-4-15">
2016-10-19 19:13:32 -06:00
<p>
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
executable <a href="http://emacs.stackexchange.com/questions/6010/can-emacs-detect-the-path-of-its-executable">here</a>.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(setenv <span style="font-style: italic;">"EMACS"</span>
(file-truename (expand-file-name invocation-name invocation-directory)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
<p>
Update: It turns out that it is term-exec-1 that is causing this environment
variable to be set to something strange. When I tried to disable it, it seemed
to cause issues. Oh well&#x2026;
</p>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgf5497be" class="outline-2">
<h2 id="orgf5497be"><span class="section-number-2">5</span> Functions</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-5">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org7fe147c" class="outline-3">
<h3 id="org7fe147c"><span class="section-number-3">5.1</span> Join Paths</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-5-1">
2016-10-19 19:13:32 -06:00
<p>
Works in the same way as os.path.join in python
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:join-paths</span> (root <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> dirs)
(<span style="font-weight: bold;">let</span> ((result root))
(<span style="font-weight: bold;">cl-loop</span> for dir in dirs do
(<span style="font-weight: bold;">setq</span> result (concat (file-name-as-directory result) dir)))
result))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgf95e2f4" class="outline-3">
<h3 id="orgf95e2f4"><span class="section-number-3">5.2</span> Variables</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-5-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:projects-directory</span>
(imalison:join-paths (substitute-in-file-name <span style="font-style: italic;">"$HOME"</span>) <span style="font-style: italic;">"Projects"</span>))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:gpg-key</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd274c68" class="outline-3">
<h3 id="orgd274c68"><span class="section-number-3">5.3</span> Use Package Wrapper With Local Load Path Support</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-5-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(put 'imalison:use-package 'lisp-indent-function 'defun)
(put 'imalison:use-package* 'lisp-indent-function 'defun)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:use-package*</span> (package target-directory <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> forms)
(<span style="font-weight: bold;">let*</span> ((actual-target (<span style="font-weight: bold;">if</span> (file-exists-p target-directory)
2016-10-19 19:13:32 -06:00
target-directory
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">let</span> ((in-projects (imalison:join-paths imalison:projects-directory
target-directory)))
(<span style="font-weight: bold;">when</span> (file-exists-p in-projects)
in-projects))))
(additional-forms
(<span style="font-weight: bold;">when</span> actual-target
(list
<span style="font-weight: bold;">:load-path</span> actual-target
<span style="font-weight: bold;">:ensure</span> nil))))
`(<span style="font-weight: bold;">use-package</span> ,package
,@additional-forms ,@forms)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:use-package</span> (package <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> forms)
`(<span style="font-weight: bold;">imalison:use-package*</span> ,package ,(symbol-name package) ,@forms))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6f53325" class="outline-3">
<h3 id="org6f53325"><span class="section-number-3">5.4</span> Required Packages</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-5-4">
2016-10-19 19:13:32 -06:00
<p>
The packages in this section provide no functionality on their own,
but provide support for writing custom elisp.
</p>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org91b1713" class="outline-4">
<h4 id="org91b1713"><span class="section-number-4">5.4.1</span> s</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-5-4-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">s</span> <span style="font-weight: bold;">:demand</span> t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9ccebcf" class="outline-4">
<h4 id="org9ccebcf"><span class="section-number-4">5.4.2</span> dash</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-5-4-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">dash</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(dash-enable-font-lock)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd68c199" class="outline-4">
<h4 id="orgd68c199"><span class="section-number-4">5.4.3</span> gh</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-5-4-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:use-package*</span> gh <span style="font-style: italic;">"gh.el"</span>
<span style="font-weight: bold;">:demand</span> t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org79f86e8" class="outline-4">
<h4 id="org79f86e8"><span class="section-number-4">5.4.4</span> shut-up</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-5-4-4">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">shut-up</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:shut-up-around</span> (<span style="font-weight: bold;">function</span> <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">shut-up</span> (apply function args))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org224e02d" class="outline-4">
<h4 id="org224e02d"><span class="section-number-4">5.4.5</span> pcache</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-5-4-5">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">pcache</span>
<span style="font-weight: bold;">:demand</span> t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb8982bd" class="outline-4">
<h4 id="orgb8982bd"><span class="section-number-4">5.4.6</span> parse-csv</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-5-4-6">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">parse-csv</span>
<span style="font-weight: bold;">:demand</span> t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org324e444" class="outline-4">
<h4 id="org324e444"><span class="section-number-4">5.4.7</span> emit</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-5-4-7">
2016-10-19 19:13:32 -06:00
<p>
This is disabled for now until I figure out what to do with emit.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:use-package</span> emit
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:demand</span> t)
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">emit</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd46c880" class="outline-4">
<h4 id="orgd46c880"><span class="section-number-4">5.4.8</span> request</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-5-4-8">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">request</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgdf8f747" class="outline-3">
<h3 id="orgdf8f747"><span class="section-number-3">5.5</span> Named Build</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-5-5">
2016-10-19 19:13:32 -06:00
<p>
2016-11-07 17:41:36 -07:00
<a id="org04b3f49"></a>
2016-10-19 19:13:32 -06:00
imalison:named-build provides a way to invoke a macro in such a way
that the lambda that it produces is given a name.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:named-build</span> (name builder <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
`(<span style="font-weight: bold;">defalias</span> (<span style="font-weight: bold;">quote</span> ,name) (,builder ,@args)))
(put 'imalison:named-build 'lisp-indent-function 1)
2016-10-19 19:13:32 -06:00
</pre>
</div>
<p>
<code>imalison:named-builder-builder</code> builds a macro from another macro
that builds lambda functions. The arguments to the macro that results
are exactly the same as those of the original macro, except that the
first argument of the new macro is used to name the lambda produced by
the original macro (which is passed as the second argument to
<code>imalison:named-builder-builder</code>).
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:named-builder-builder</span> (named-builder-name builder-name)
`(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defmacro</span> ,named-builder-name (function-name <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(cons 'imalison:named-build
(cons function-name
(cons (<span style="font-weight: bold;">quote</span> ,builder-name) args))))
(put (<span style="font-weight: bold;">quote</span> ,named-builder-name) 'lisp-indent-function 1)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
<p>
<code>imalison:named-builder</code> runs <code>imalison:named-builder-builder</code> with the
convention that original macro to modify is the concatenation of the
new macro name and the -fn suffix.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:named-builder</span> (name)
`(<span style="font-weight: bold;">imalison:named-builder-builder</span>
,name ,(intern (concat (symbol-name name) <span style="font-style: italic;">"-fn"</span>))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd275a2d" class="outline-3">
<h3 id="orgd275a2d"><span class="section-number-3">5.6</span> Emacs Version Predicate</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-5-6">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:emacs-version-predicate-fn</span> (major-version minor-version)
`(<span style="font-weight: bold;">lambda</span> ()
(<span style="font-weight: bold;">or</span> (&gt; emacs-major-version ,major-version)
(<span style="font-weight: bold;">and</span> (&gt;= emacs-major-version ,major-version)
(&gt;= emacs-minor-version ,minor-version)))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:check-emacs-version</span> (major-version minor-version)
(funcall (<span style="font-weight: bold;">imalison:emacs-version-predicate-fn</span> major-version minor-version)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">imalison:named-builder</span> imalison:emacs-version-predicate)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org333613e" class="outline-3">
<h3 id="org333613e"><span class="section-number-3">5.7</span> Compose Functions</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-5-7">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-orge8f1a24" class="outline-4">
<h4 id="orge8f1a24"><span class="section-number-4">5.7.1</span> A version supporting macros</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-5-7-1">
2016-10-24 17:18:33 -06:00
<p>
2016-11-07 17:41:36 -07:00
<a id="org7839c46"></a>
2016-10-24 17:18:33 -06:00
</p>
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:help-function-arglist</span> (fn)
(<span style="font-weight: bold;">let</span> ((result (help-function-arglist fn)))
(<span style="font-weight: bold;">if</span> (eq result t) '(<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args) result)))
(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:compose-fn</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> funcs)
(<span style="font-weight: bold;">let*</span> ((last-function (car (last funcs)))
(arguments (imalison:help-function-arglist last-function))
(call-arguments (delq '<span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> arguments)))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">When we have an &amp;rest arguments there is no point in taking any</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">of the arguments by name, so we simply pass them all as an</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">argument list. See the comment below to understand how this</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">impacts the evaluation of the last function.</span>
(<span style="font-weight: bold;">when</span> (memq '<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> arguments)
(<span style="font-weight: bold;">setq</span> arguments '(<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args))
(<span style="font-weight: bold;">setq</span> call-arguments '(args)))
`(<span style="font-weight: bold;">imalison:compose-argspec</span> ,arguments ,call-arguments ,@funcs)))
(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:compose-argspec</span> (arguments call-arguments <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> funcs)
<span style="font-style: italic;">"Build a new function with NAME that is the composition of FUNCS."</span>
`(<span style="font-weight: bold;">lambda</span> ,arguments
(<span style="font-weight: bold;">imalison:compose-helper</span> ,funcs ,call-arguments)))
(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:compose-helper</span> (funcs arguments)
<span style="font-style: italic;">"Builds funcalls of FUNCS applied to the arg."</span>
(<span style="font-weight: bold;">if</span> (equal (length funcs) 1)
(<span style="font-weight: bold;">let</span> ((last-function (car funcs)))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">This hideous clause is here because it is the only way to</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">handle functions that take &amp;rest args.</span>
(<span style="font-weight: bold;">when</span> (memq '<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> (imalison:help-function-arglist last-function))
(<span style="font-weight: bold;">setq</span> last-function (apply-partially 'apply last-function)))
`(,last-function ,@arguments))
`(,(car funcs)
(<span style="font-weight: bold;">imalison:compose-helper</span> ,(cdr funcs) ,arguments))))
(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:compose-macro-fn</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
`(cons 'macro (<span style="font-weight: bold;">imalison:compose-fn</span> ,@args)))
(<span style="font-weight: bold;">imalison:named-builder</span> imalison:compose)
(<span style="font-weight: bold;">imalison:named-builder</span> imalison:compose-macro)
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6c9feea" class="outline-4">
<h4 id="org6c9feea"><span class="section-number-4">5.7.2</span> Arbitrary arguments at every step</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-5-7-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:make-list</span> (thing)
(<span style="font-weight: bold;">if</span> (listp thing)
2016-10-19 19:13:32 -06:00
thing
2016-11-07 12:57:02 -07:00
(list thing)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:compose-with-apply</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> funcs)
<span style="font-style: italic;">"Build a new function with NAME that is the composition of FUNCS."</span>
`(<span style="font-weight: bold;">lambda</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">imalison:compose-with-apply-helper</span> ,funcs)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:compose-with-apply-helper</span> (funcs)
<span style="font-style: italic;">"Builds funcalls of FUNCS applied to the arg."</span>
(<span style="font-weight: bold;">if</span> (equal (length funcs) 0)
(<span style="font-weight: bold;">quote</span> args)
`(apply ,(car funcs)
(imalison:make-list (<span style="font-weight: bold;">imalison:compose-with-apply-helper</span> ,(cdr funcs))))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-24 16:41:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9f4bfa7" class="outline-4">
<h4 id="org9f4bfa7"><span class="section-number-4">5.7.3</span> Simpler unary version</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-5-7-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:compose-unary</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> funcs)
<span style="font-style: italic;">"Build a new function with NAME that is the composition of FUNCS."</span>
`(<span style="font-weight: bold;">lambda</span> (arg)
(<span style="font-weight: bold;">imalison:compose-helper-unary</span> ,funcs)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:compose-helper-unary</span> (funcs)
<span style="font-style: italic;">"Builds funcalls of FUNCS applied to the arg."</span>
(<span style="font-weight: bold;">if</span> (equal (length funcs) 0)
2016-10-19 19:13:32 -06:00
'arg
2016-11-07 12:57:02 -07:00
`(funcall ,(car funcs) (<span style="font-weight: bold;">imalison:compose-helper-unary</span> ,(cdr funcs)))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
2016-10-24 16:41:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org5a1339c" class="outline-3">
<h3 id="org5a1339c"><span class="section-number-3">5.8</span> With Advice</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-5-8">
2016-11-02 19:12:58 -06:00
<p>
Taken from <a href="http://emacs.stackexchange.com/questions/16490/emacs-let-bound-advice">here</a>.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:with-advice</span> (args <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> body)
(<span style="font-weight: bold;">declare</span> (indent 1))
(<span style="font-weight: bold;">let</span> ((fun-name (car args))
(advice (cadr args))
(orig-sym (make-symbol <span style="font-style: italic;">"orig"</span>)))
`(<span style="font-weight: bold;">cl-letf*</span> ((,orig-sym (symbol-function ',fun-name))
((symbol-function ',fun-name)
(<span style="font-weight: bold;">lambda</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(apply ,advice ,orig-sym args))))
,@body)))
2016-11-02 19:12:58 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb4bffd4" class="outline-3">
<h3 id="orgb4bffd4"><span class="section-number-3">5.9</span> Make Interactive</h3>
2016-11-02 19:12:58 -06:00
<div class="outline-text-3" id="text-5-9">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:make-interactive-fn</span> (<span style="font-weight: bold;">function</span>)
`(<span style="font-weight: bold;">lambda</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">interactive</span>)
(apply ,function args)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">imalison:named-builder</span> imalison:make-interactive)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org30f903c" class="outline-3">
<h3 id="org30f903c"><span class="section-number-3">5.10</span> Advice Add Around Builder</h3>
2016-11-02 19:12:58 -06:00
<div class="outline-text-3" id="text-5-10">
2016-10-19 19:13:32 -06:00
<p>
For composing functions with an apply so that they can be used with
the <code>:around</code> keyword of advice-add.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:advice-add-around-builder-fn</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> functions)
`(<span style="font-weight: bold;">imalison:compose-argspec</span>
(<span style="font-weight: bold;">function</span> <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args) (<span style="font-weight: bold;">function</span> args) ,@functions apply))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">imalison:named-builder</span> imalison:advice-add-around-builder)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org951f001" class="outline-4">
<h4 id="org951f001"><span class="section-number-4">5.10.1</span> Kill New</h4>
2016-11-02 19:12:58 -06:00
<div class="outline-text-4" id="text-5-10-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:advice-add-around-builder</span> imalison:kill-new-around kill-new)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
2016-10-24 16:41:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgf8b3892" class="outline-3">
<h3 id="orgf8b3892"><span class="section-number-3">5.11</span> Let Around</h3>
2016-11-02 19:12:58 -06:00
<div class="outline-text-3" id="text-5-11">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:let-around-fn</span> (orig-func <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> forms)
(<span style="font-weight: bold;">let*</span> ((orig-interactive-form (interactive-form orig-func))
(docstring-form (format <span style="font-style: italic;">"Call `</span><span style="font-weight: bold; font-style: italic; text-decoration: underline;">%s</span><span style="font-style: italic;">' with bindings: %s."</span> orig-func forms))
(additional-forms (list docstring-form)))
(<span style="font-weight: bold;">when</span> orig-interactive-form
(nconc additional-forms (list orig-interactive-form)))
`(<span style="font-weight: bold;">lambda</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
2016-10-19 19:13:32 -06:00
,@additional-forms
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">let</span> ,forms
(apply (<span style="font-weight: bold;">quote</span> ,orig-func) args)))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">imalison:named-builder</span> imalison:let-around)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgc11b3e9" class="outline-3">
<h3 id="orgc11b3e9"><span class="section-number-3">5.12</span> Let Around Advice</h3>
2016-11-02 19:12:58 -06:00
<div class="outline-text-3" id="text-5-12">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:let-advise-around-fn</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> forms)
`(<span style="font-weight: bold;">lambda</span> (orig-func <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">let</span> ,forms
(apply orig-func args))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">imalison:named-builder</span> imalison:let-advise-around)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb5f319a" class="outline-3">
<h3 id="orgb5f319a"><span class="section-number-3">5.13</span> Let Advise</h3>
2016-11-02 19:12:58 -06:00
<div class="outline-text-3" id="text-5-13">
2016-11-07 16:01:14 -07:00
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:let-advise</span> (advised-function <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> forms)
(<span style="font-weight: bold;">let</span> ((advice-fn-name (imalison:concat-symbols
<span style="font-style: italic;">"around-advice-"</span> advised-function)))
`(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">imalison:let-advise-around</span> ,advice-fn-name ,@forms)
(advice-add (<span style="font-weight: bold;">quote</span> ,advised-function) <span style="font-weight: bold;">:around</span> (<span style="font-weight: bold;">quote</span> ,advice-fn-name)))))
(put 'imalison:let-advise 'lisp-indent-function 1)
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org035f4cc" class="outline-3">
<h3 id="org035f4cc"><span class="section-number-3">5.14</span> Compose Around Builder</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-14">
2016-10-19 19:13:32 -06:00
<p>
2016-11-07 16:01:14 -07:00
For composing functions with an apply so that they can be used with the <code>:around</code> keyword of advice-add.
2016-10-19 19:13:32 -06:00
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp"><span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">TODO/XXX: Isn't this just apply? why doesn't apply work here</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:around-identity</span> (fn <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(apply fn args))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:compose-around-builder-fn</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> functions)
`(<span style="font-weight: bold;">imalison:compose-fn</span> ,@functions imalison:around-identity))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">imalison:named-builder</span> imalison:compose-around-builder)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org116ecbf" class="outline-3">
<h3 id="org116ecbf"><span class="section-number-3">5.15</span> Measure Time</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-15">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:measure-time</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> body)
<span style="font-style: italic;">"Measure and return the running time of the code block."</span>
(<span style="font-weight: bold;">declare</span> (indent defun))
(<span style="font-weight: bold;">let</span> ((start (make-symbol <span style="font-style: italic;">"start"</span>)))
`(<span style="font-weight: bold;">let</span> ((,start (float-time)))
2016-10-19 19:13:32 -06:00
,@body
2016-11-07 12:57:02 -07:00
(- (float-time) ,start))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgbc3406b" class="outline-3">
<h3 id="orgbc3406b"><span class="section-number-3">5.16</span> Add Files to <code>org-agenda-files</code></h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-16">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:add-to-org-agenda-files</span> (incoming-files)
(<span style="font-weight: bold;">setq</span> org-agenda-files
(delete-dups
(<span style="font-weight: bold;">cl-loop</span> for filepath in (append org-agenda-files incoming-files)
when (<span style="font-weight: bold;">and</span> filepath (file-exists-p (file-truename filepath)))
collect (file-truename filepath)))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org565e767" class="outline-3">
<h3 id="org565e767"><span class="section-number-3">5.17</span> Get String From File</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-17">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:get-string-from-file</span> (file-path)
<span style="font-style: italic;">"Return file-path's file content."</span>
(<span style="font-weight: bold;">with-temp-buffer</span>
(insert-file-contents file-path)
(buffer-string)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orga164e82" class="outline-3">
<h3 id="orga164e82"><span class="section-number-3">5.18</span> Get Current Location</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-18">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:get-lat-long</span> ()
(<span style="font-weight: bold;">condition-case</span> _ex
(mapcar 'string-to-number (s-split <span style="font-style: italic;">","</span> (s-trim (shell-command-to-string
<span style="font-style: italic;">"whereami"</span>))))
(<span style="font-weight: bold;">error</span> (list 37.7879312624533 -122.402388853402))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org2749713" class="outline-3">
<h3 id="org2749713"><span class="section-number-3">5.19</span> Haversine distance</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-19">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:sin2</span> (p)
(<span style="font-weight: bold;">let</span> ((sin-p (sin p)))
(* sin-p sin-p) ))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:haversine-distance</span>
(left-lat-long right-lat-long <span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> radius)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Default to earth radius in km</span>
(<span style="font-weight: bold;">unless</span> radius (<span style="font-weight: bold;">setq</span> radius 6378.1))
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">cl-destructuring-bind</span> (left-lat left-long) left-lat-long
(<span style="font-weight: bold;">cl-destructuring-bind</span> (right-lat right-long) right-lat-long
(<span style="font-weight: bold;">let</span> ((l1 (<span style="font-weight: bold;">degrees-to-radians</span> left-lat))
(f1 (<span style="font-weight: bold;">degrees-to-radians</span> left-long))
(l2 (<span style="font-weight: bold;">degrees-to-radians</span> right-lat))
(f2 (<span style="font-weight: bold;">degrees-to-radians</span> right-long)) )
(* 2 radius
(asin
(sqrt
(+ (imalison:sin2 (/ (- f2 f1) 2))
(* (cos f2) (cos f1) (imalison:sin2 (/ (- l2 l1) 2))) ))))))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org45489a4" class="outline-3">
<h3 id="org45489a4"><span class="section-number-3">5.20</span> Font Size</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-20">
2016-10-19 19:13:32 -06:00
<p>
This was taken from <a href="http://emacs.stackexchange.com/questions/7583/transiently-adjust-text-size-in-mode-line-and-minibuffer">here</a> but it has diverged significantly from the original.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:default-font-size-pt</span>
(<span style="font-weight: bold;">cond</span> ((eq system-type 'darwin) 120)
((eq system-type 'gnu/linux) 105)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:huge-font-size</span> 280)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:current-font-size</span> ()
(plist-get (custom-face-attributes-get 'default nil) <span style="font-weight: bold;">:height</span>))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:set-font-size</span> (size)
(<span style="font-weight: bold;">interactive</span> (list (string-to-number (read-string <span style="font-style: italic;">"Enter a font size: "</span>))))
(set-face-attribute 'default nil <span style="font-weight: bold;">:height</span> size))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:set-huge-font-size</span> ()
(<span style="font-weight: bold;">interactive</span>)
(imalison:set-font-size imalison:huge-font-size))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">cl-defun</span> <span style="font-weight: bold;">imalison:modify-font-size</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> (arg 10))
(<span style="font-weight: bold;">interactive</span> <span style="font-style: italic;">"p"</span>)
(imalison:set-font-size (+ (imalison:current-font-size) arg)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:font-size-incr</span> ()
(<span style="font-weight: bold;">interactive</span>)
(imalison:modify-font-size +10))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:font-size-decr</span> ()
(<span style="font-weight: bold;">interactive</span>)
(imalison:modify-font-size -10))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:font-size-reset</span> ()
(<span style="font-weight: bold;">interactive</span>)
(imalison:set-font-size imalison:default-font-size-pt))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgfa1a6a5" class="outline-3">
<h3 id="orgfa1a6a5"><span class="section-number-3">5.21</span> Message Result Builder</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-21">
2016-10-19 19:13:32 -06:00
<p>
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.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:message-result-builder</span> (new-function-name function-to-call <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
`(<span style="font-weight: bold;">defun</span> ,new-function-name ()
(<span style="font-weight: bold;">interactive</span>)
(message <span style="font-style: italic;">"%s"</span> (apply (<span style="font-weight: bold;">quote</span> ,function-to-call) (list ,@args)))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
<p>
This interactive functions allows the user the select a function to invoke using a freshly minted imalison:message-result-builder
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:message-result-builder-runtime</span> (<span style="font-weight: bold;">function</span> <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">lambda</span> ()
(<span style="font-weight: bold;">interactive</span>)
(message <span style="font-style: italic;">"%s"</span> (apply function-to-call args))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:message-function-result</span> (<span style="font-weight: bold;">function</span>)
(<span style="font-weight: bold;">interactive</span> (find-function-read))
(message <span style="font-style: italic;">"%s"</span> (funcall function)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org215891c" class="outline-3">
<h3 id="org215891c"><span class="section-number-3">5.22</span> Custom <code>shell-command-on-region</code></h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-22">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:copy-shell-command-on-region</span> (start end command)
(<span style="font-weight: bold;">interactive</span> (list (region-beginning) (region-end)
(read-shell-command <span style="font-style: italic;">"Shell command on region: "</span>)))
(<span style="font-weight: bold;">let</span> ((original-buffer (current-buffer)))
(<span style="font-weight: bold;">with-temp-buffer</span>
(<span style="font-weight: bold;">let</span> ((temp-buffer (current-buffer)))
(<span style="font-weight: bold;">with-current-buffer</span> original-buffer
(shell-command-on-region start end command temp-buffer))
(<span style="font-weight: bold;">let</span> ((min (point-min))
(max (point-max)))
(kill-ring-save min max)
(buffer-substring min max))))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:shell-command-on-region-replace</span> (start end command)
(<span style="font-weight: bold;">interactive</span> (list (region-beginning) (region-end)
(read-shell-command <span style="font-style: italic;">"Shell command on region: "</span>)))
(shell-command-on-region start end command nil t))
(<span style="font-weight: bold;">emit-prefix-selector</span> imalison:shell-command-on-region
2016-10-19 19:13:32 -06:00
imalison:copy-shell-command-on-region
2016-11-07 12:57:02 -07:00
imalison:shell-command-on-region-replace)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd8c27d5" class="outline-3">
<h3 id="orgd8c27d5"><span class="section-number-3">5.23</span> Copy String Functions</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-23">
2016-10-19 19:13:32 -06:00
<p>
A macro for composing functions together to build an interactive command to copy a string to the kill ring.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:compose-copy-builder-fn</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> funcs)
`(<span style="font-weight: bold;">imalison:make-interactive-fn</span>
(<span style="font-weight: bold;">imalison:compose-fn</span> kill-new ,@funcs)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">imalison:named-builder</span> imalison:compose-copy-builder)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd5ab604" class="outline-4">
<h4 id="orgd5ab604"><span class="section-number-4">5.23.1</span> Copy portions of the buffer file name</h4>
2016-11-07 16:01:14 -07:00
<div class="outline-text-4" id="text-5-23-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:copy-buffer-file-path-builder</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
`(<span style="font-weight: bold;">imalison:compose-copy-builder</span> ,@args buffer-file-name))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">imalison:copy-buffer-file-path-builder</span> imalison:copy-buffer-file-path-full)
(<span style="font-weight: bold;">imalison:copy-buffer-file-path-builder</span> imalison:copy-buffer-file-name
file-name-nondirectory)
(<span style="font-weight: bold;">imalison:copy-buffer-file-path-builder</span> imalison:copy-buffer-file-path
2016-10-19 19:13:32 -06:00
car
projectile-make-relative-to-root
2016-11-07 12:57:02 -07:00
list)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgfd5139a" class="outline-4">
<h4 id="orgfd5139a"><span class="section-number-4">5.23.2</span> Copy the current branch using magit</h4>
2016-11-07 16:01:14 -07:00
<div class="outline-text-4" id="text-5-23-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:compose-copy-builder</span> imalison:copy-current-git-branch
magit-get-current-branch)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org0967548" class="outline-3">
<h3 id="org0967548"><span class="section-number-3">5.24</span> Named Compile</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-24">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:named-compile</span> (command)
(<span style="font-weight: bold;">interactive</span>
(list
(<span style="font-weight: bold;">let</span> ((command (eval compile-command)))
(<span style="font-weight: bold;">if</span> (<span style="font-weight: bold;">or</span> compilation-read-command current-prefix-arg)
(compilation-read-command command)
command))))
(compilation-start command nil (<span style="font-weight: bold;">lambda</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(format <span style="font-style: italic;">"*compilation %s*"</span> command))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3e46735" class="outline-3">
<h3 id="org3e46735"><span class="section-number-3">5.25</span> Replace Escape Sequences</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-25">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:replace-escape-sequences</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">shut-up</span>
(<span style="font-weight: bold;">let*</span> ((delimited (<span style="font-weight: bold;">and</span> transient-mark-mode mark-active))
(beg (<span style="font-weight: bold;">when</span> delimited (region-beginning)))
(end (<span style="font-weight: bold;">when</span> delimited (region-end))))
(<span style="font-weight: bold;">save-excursion</span>
(perform-replace <span style="font-style: italic;">"\\t"</span> <span style="font-style: italic;">" "</span> nil nil delimited nil nil beg end nil))
(<span style="font-weight: bold;">save-excursion</span>
(perform-replace <span style="font-style: italic;">"\\n"</span> <span style="font-style: italic;">"\n"</span> nil nil delimited nil nil beg end nil)))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orga4f4e31" class="outline-3">
<h3 id="orga4f4e31"><span class="section-number-3">5.26</span> Download a File Into a Buffer</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-26">
2016-10-24 17:18:33 -06:00
<p>
2016-11-07 17:41:36 -07:00
<a id="org4fa4949"></a>
2016-10-24 17:18:33 -06:00
</p>
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:download-to-buffer</span> (uri)
(<span style="font-weight: bold;">interactive</span> (list (read-string <span style="font-style: italic;">"Enter uri: "</span>)))
(request uri
<span style="font-weight: bold;">:parser</span> 'buffer-string
<span style="font-weight: bold;">:success</span> (<span style="font-weight: bold;">cl-function</span>
(<span style="font-weight: bold;">lambda</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;key</span> data <span style="font-weight: bold; text-decoration: underline;">&amp;allow-other-keys</span>)
(<span style="font-weight: bold;">let</span> ((created-buffer (get-buffer-create uri)))
(<span style="font-weight: bold;">with-current-buffer</span> created-buffer
(insert data))
(switch-to-buffer created-buffer))))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org08db55d" class="outline-3">
<h3 id="org08db55d"><span class="section-number-3">5.27</span> Concat With Symbols</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-27">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:maybe-symbol-name</span> (arg)
(<span style="font-weight: bold;">if</span> (symbolp arg)
(symbol-name arg)
arg))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:concat-symbols</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(intern (mapconcat 'imalison:maybe-symbol-name args <span style="font-style: italic;">""</span>)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6ee1224" class="outline-3">
<h3 id="org6ee1224"><span class="section-number-3">5.28</span> Edit a script on PATH</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-28">
2016-10-24 17:18:33 -06:00
<p>
2016-11-07 17:41:36 -07:00
<a id="org0babcbf"></a> Note that you'll need to make sure that emacs properly inherits
the path variable for this work. Check out my <a href="#orgf5b63c5">exec-path-from-shell</a> config for
2016-10-24 17:18:33 -06:00
details.
</p>
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:get-executables-at-path</span> (filepath)
(<span style="font-weight: bold;">when</span> (<span style="font-weight: bold;">and</span> (file-exists-p filepath) (f-directory? filepath))
(<span style="font-weight: bold;">--filter</span> (<span style="font-weight: bold;">let</span> ((fullpath (imalison:join-paths filepath <span style="font-weight: bold; font-style: italic;">it</span>)))
(<span style="font-weight: bold;">and</span> (file-executable-p fullpath)
(not (f-directory? fullpath))))
(directory-files filepath))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:get-executables-on-path</span> ()
(mapcan 'imalison:get-executables-at-path (eshell-parse-colon-path (getenv <span style="font-style: italic;">"PATH"</span>))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:edit-script</span> ()
(<span style="font-weight: bold;">interactive</span>)
(find-file (executable-find
(ido-completing-read <span style="font-style: italic;">"Select a script to edit: "</span>
(imalison:get-executables-on-path)))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org342cd0e" class="outline-3">
<h3 id="org342cd0e"><span class="section-number-3">5.29</span> Toggle lexical binding in the current buffer</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-29">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:toggle-lexical-binding</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let</span> ((new-binding (not lexical-binding)))
(message <span style="font-style: italic;">"Setting lexical-binding to: %s"</span> new-binding)
(<span style="font-weight: bold;">setq</span> lexical-binding new-binding)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgf614de8" class="outline-3">
<h3 id="orgf614de8"><span class="section-number-3">5.30</span> Sync kill ring with copyq</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-30">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:copyq-get</span> (i)
(imalison:shell-command-to-string (format <span style="font-style: italic;">"copyq eval read(%s)"</span> i)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:copyq-sync</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let</span> ((missing-items (<span style="font-weight: bold;">cl-loop</span> for i from 0 to (string-to-number
(imalison:shell-command-to-string <span style="font-style: italic;">"copyq eval size()"</span>))
for item = (imalison:copyq-get i)
when (not (member item kill-ring))
collect item)))
(<span style="font-weight: bold;">setq</span> kill-ring (nconc kill-ring missing-items))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">when</span> (executable-find <span style="font-style: italic;">"copyq"</span>)
(run-with-idle-timer 10 nil 'imalison:copyq-sync))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6c3bfb7" class="outline-3">
<h3 id="org6c3bfb7"><span class="section-number-3">5.31</span> helm-zsh-history</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-31">
2016-10-19 19:13:32 -06:00
<p>
2016-10-24 14:29:32 -06:00
This was stolen from <a href="https://github.com/jwiegley/dot-emacs">https://github.com/jwiegley/dot-emacs</a>
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">helm-c-source-zsh-history</span>
'((name . <span style="font-style: italic;">"Zsh History"</span>)
(candidates . helm-c-zsh-history-set-candidates)
(action . ((<span style="font-style: italic;">"Execute Command"</span> . helm-c-zsh-history-action)))
(volatile)
(requires-pattern . 3)
(delayed)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">helm-c-zsh-history-set-candidates</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> request-prefix)
(<span style="font-weight: bold;">let</span> ((pattern (replace-regexp-in-string
<span style="font-style: italic;">" "</span> <span style="font-style: italic;">".*"</span>
(<span style="font-weight: bold;">or</span> (<span style="font-weight: bold;">and</span> request-prefix
(concat request-prefix
<span style="font-style: italic;">" "</span> helm-pattern))
helm-pattern))))
(<span style="font-weight: bold;">with-current-buffer</span> (find-file-noselect <span style="font-style: italic;">"~/.zsh_history"</span> t t)
(auto-revert-mode -1)
(goto-char (point-max))
(<span style="font-weight: bold;">loop</span> for pos = (re-search-backward pattern nil t)
2016-10-24 14:29:32 -06:00
while pos
2016-11-07 12:57:02 -07:00
collect (replace-regexp-in-string
<span style="font-style: italic;">"\\`:.+?;"</span> <span style="font-style: italic;">""</span>
(buffer-substring (line-beginning-position)
(line-end-position)))))))
2016-10-24 14:29:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">helm-c-zsh-history-action</span> (candidate)
(imalison:named-compile candidate))
2016-10-24 14:29:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">helm-command-from-zsh</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">helm</span>)
(helm-other-buffer 'helm-c-source-zsh-history <span style="font-style: italic;">"*helm zsh history*"</span>))
2016-10-24 14:29:32 -06:00
</pre>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgc8fcfb2" class="outline-4">
<h4 id="orgc8fcfb2"><span class="section-number-4">5.31.1</span> Use projectile as default directory</h4>
2016-11-07 16:01:14 -07:00
<div class="outline-text-4" id="text-5-31-1">
2016-10-24 14:34:33 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:let-around</span> imalison:projectile-helm-command-from-zsh helm-command-from-zsh
(default-directory (projectile-project-root)))
2016-10-24 14:34:33 -06:00
</pre>
2016-10-24 14:29:32 -06:00
</div>
2016-10-24 14:34:33 -06:00
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4871e0a" class="outline-3">
<h3 id="org4871e0a"><span class="section-number-3">5.32</span> Other</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-32">
2016-10-24 14:29:32 -06:00
<p>
2016-10-19 19:13:32 -06:00
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.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">random-choice</span> (choices)
(nth (random (length choices)) choices))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">display-prefix</span> (arg)
<span style="font-style: italic;">"Display the value of the raw prefix arg."</span>
(<span style="font-weight: bold;">interactive</span> <span style="font-style: italic;">"p"</span>)
(message <span style="font-style: italic;">"%s"</span> arg))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:uuid</span> ()
(<span style="font-weight: bold;">interactive</span>)
(s-replace <span style="font-style: italic;">"\n"</span> <span style="font-style: italic;">""</span> (shell-command-to-string <span style="font-style: italic;">"uuid"</span>)))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:disable-linum-mode</span> ()
(linum-mode 0))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:disable-smartparens-mode</span> ()
(smartparens-mode 0))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:insert-uuid</span> ()
(<span style="font-weight: bold;">interactive</span>)
(insert (imalison:uuid)))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:compare-int-list</span> (a b)
(<span style="font-weight: bold;">when</span> (<span style="font-weight: bold;">and</span> a b)
(<span style="font-weight: bold;">cond</span> ((&gt; (car a) (car b)) 1)
((&lt; (car a) (car b)) -1)
(t (imalison:compare-int-list (cdr a) (cdr b))))))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">get-date-created-from-agenda-entry</span> (agenda-entry)
(org-time-string-to-time
(org-entry-get (get-text-property 1 'org-marker agenda-entry) <span style="font-style: italic;">"CREATED"</span>)))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">defvar-setq</span> (name value)
`(<span style="font-weight: bold;">if</span> (boundp (<span style="font-weight: bold;">quote</span> ,name))
(<span style="font-weight: bold;">setq</span> ,name ,value)
(<span style="font-weight: bold;">defvar</span> ,name ,value)))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">eval-region-or-last-sexp</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">if</span> (region-active-p) (call-interactively 'eval-region)
(call-interactively 'eval-last-sexp)))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">undo-redo</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> arg)
(<span style="font-weight: bold;">interactive</span> <span style="font-style: italic;">"P"</span>)
(<span style="font-weight: bold;">if</span> arg (undo-tree-redo) (undo-tree-undo)))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">up-list-region</span> ()
(<span style="font-weight: bold;">interactive</span>)
(up-list) (set-mark-command nil) (backward-sexp))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">up-list-back</span> ()
(<span style="font-weight: bold;">interactive</span>)
(up-list) (backward-sexp))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">frame-exists</span> ()
(cl-find-if
(<span style="font-weight: bold;">lambda</span> (frame)
(assoc 'display (frame-parameters frame))) <span style="font-weight: bold;">(frame-list)))</span>
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">make-frame-if-none-exists</span> ()
(<span style="font-weight: bold;">let*</span> ((existing-frame (frame-exists)))
(<span style="font-weight: bold;">if</span> existing-frame
2016-10-19 19:13:32 -06:00
existing-frame
2016-11-07 12:57:02 -07:00
(make-frame-on-display (getenv <span style="font-style: italic;">"DISPLAY"</span>)))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">make-frame-if-none-exists-and-focus</span> ()
(make-frame-visible (select-frame (make-frame-if-none-exists))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">notification-center</span> (title message)
(<span style="font-weight: bold;">cl-flet</span> ((encfn (s) (encode-coding-string s (keyboard-coding-system))))
(shell-command
(format <span style="font-style: italic;">"osascript -e 'display notification \"%s\" with title \"%s\"'"</span>
(encfn message) (encfn title)))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">growl-notify</span> (title message)
(shell-command (format <span style="font-style: italic;">"grownotify -t %s -m %s"</span> title message)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">notify-send</span> (title message)
(shell-command (format <span style="font-style: italic;">"notify-send -u critical %s %s"</span> title message)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">notify-function</span>
(<span style="font-weight: bold;">cond</span> ((eq system-type 'darwin) 'notification-center)
((eq system-type 'gnu/linux) 'notify-send)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">emit-prefix-selector</span> imalison:mark-ring
2016-10-19 19:13:32 -06:00
helm-mark-ring
2016-11-07 12:57:02 -07:00
helm-global-mark-ring)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org5627af6" class="outline-3">
<h3 id="org5627af6"><span class="section-number-3">5.33</span> Keyboard Macros</h3>
2016-11-07 16:01:14 -07:00
<div class="outline-text-3" id="text-5-33">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org85acc04" class="outline-4">
<h4 id="org85acc04"><span class="section-number-4">5.33.1</span> For editing literate config</h4>
2016-11-07 16:01:14 -07:00
<div class="outline-text-4" id="text-5-33-1">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org8caba57" class="outline-5">
<h5 id="org8caba57"><span class="section-number-5">5.33.1.1</span> extract-current-sexp-to-src-block</h5>
2016-11-07 16:01:14 -07:00
<div class="outline-text-5" id="text-5-33-1-1">
2016-10-19 19:13:32 -06:00
<p>
This keyboard macro extracts the current sexp to an emacs-lisp source block of its own
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(fset 'extract-current-sexp-to-src-block
[?\C-a return ?\C-p ?# ?+ ?E ?N ?D ?_ ?S ?R ?C return ?# ?+ ?B ?E ?G ?I ?N ?_ ?S ?R ?C ? ?e ?m ?a ?c ?s ?- ?l ?i ?s ?p ?\C-a ?\C-p ?\C- ?\C-n ?\C-e ?\M-w ?\C-n ?\C-a ?\C-\M-f return ?\C-y])
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org5f85bda" class="outline-5">
<h5 id="org5f85bda"><span class="section-number-5">5.33.1.2</span> name-source-block-for-use-package-name</h5>
2016-11-07 16:01:14 -07:00
<div class="outline-text-5" id="text-5-33-1-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(fset 'name-source-block-for-use-package-name
[?\C-c ?\' ?\M-&lt; ?\C-s ?u ?s ?e ?- ?p ?a ?c ?k return ?\C-\M-f ?\C-f ?\C- ?\C-\M-f ?\M-w ?\C-c ?\' ?\C-r ?B ?E ?G ?I ?N return ?\C-a ?\C-p ?\C-e return ?* ? ?\C-y])
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org79cefc4" class="outline-5">
<h5 id="org79cefc4"><span class="section-number-5">5.33.1.3</span> extract-and-name-use-package-block</h5>
2016-11-07 16:01:14 -07:00
<div class="outline-text-5" id="text-5-33-1-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(fset 'extract-and-name-use-package-block
[?\C-a return ?\C-p ?# ?+ ?E ?N ?D ?_ ?S ?R ?C return ?# ?+ ?B ?E ?G ?I ?N ?_ ?S ?R ?C ? ?e ?m ?a ?c ?s ?- ?l ?i ?s ?p ?\C-a ?\C-p ?\C- ?\C-n ?\C-e ?\M-w ?\C-n ?\C-a ?\C-\M-f return ?\C-y ?\C-p ?\C-p ?\C-c ?\' ?\M-&lt; ?\C-s ?u ?s ?e ?- ?p ?a ?c ?k return ?\C-\M-f ?\C-f ?\C- ?\C-\M-f ?\M-w ?\C-c ?\' ?\C-r ?B ?E ?G ?I ?N return ?\C-a ?\C-p ?\C-e return ?* ? ?\C-y])
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-10-19 19:13:32 -06:00
</div>
2016-10-24 16:41:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org234eeb8" class="outline-2">
<h2 id="org234eeb8"><span class="section-number-2">6</span> General</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-6">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-orgf669303" class="outline-3">
<h3 id="orgf669303"><span class="section-number-3">6.1</span> User Info</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-6-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> user-full-name
(replace-regexp-in-string <span style="font-style: italic;">"\n$"</span> <span style="font-style: italic;">""</span> (shell-command-to-string
<span style="font-style: italic;">"git config --get user.name"</span>)))
(<span style="font-weight: bold;">setq</span> user-mail-address
(replace-regexp-in-string <span style="font-style: italic;">"\n$"</span> <span style="font-style: italic;">""</span> (shell-command-to-string
<span style="font-style: italic;">"git config --get user.email"</span>)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgbe2cdf3" class="outline-3">
<h3 id="orgbe2cdf3"><span class="section-number-3">6.2</span> Sane Defaults</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-6-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp"><span class="linenr">1: </span>(global-auto-revert-mode)
<span class="linenr">2: </span>(show-paren-mode 1)
<span class="linenr">3: </span>(<span style="font-weight: bold;">setq</span> reb-re-syntax 'string)
<span id="coderef-ad-redefinition-action" class="coderef-off"><span class="linenr">4: </span>(<span style="font-weight: bold;">setq</span> ad-redefinition-action 'accept)</span>
<span class="linenr">5: </span>(<span style="font-weight: bold;">setq-default</span> find-file-visit-truename t)
<span class="linenr">6: </span>(<span style="font-weight: bold;">setq</span> large-file-warning-threshold (* 25 1024 1024))
<span class="linenr">7: </span>(<span style="font-weight: bold;">setq</span> line-move-visual t)
<span class="linenr">8: </span>(<span style="font-weight: bold;">setq</span> require-final-newline t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
<p>
<a href="#coderef-ad-redefinition-action"class="coderef" onmouseover="CodeHighlightOn(this, 'coderef-ad-redefinition-action');" onmouseout="CodeHighlightOff(this, 'coderef-ad-redefinition-action');">This</a> is set because <a href="#coderef-y-or-n-p-only"class="coderef" onmouseover="CodeHighlightOn(this, 'coderef-y-or-n-p-only');" onmouseout="CodeHighlightOff(this, 'coderef-y-or-n-p-only');">this alias</a> causes annoying messaging at startup.
</p>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgfcaff93" class="outline-3">
<h3 id="orgfcaff93"><span class="section-number-3">6.3</span> Line Numbers</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-6-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(line-number-mode t)
(column-number-mode t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
<p>
Linum can be really slow on large files so it does not make sense to
have it on by default. Its probably safe to turn it on when in a
programming mode.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(global-linum-mode -1)
(add-hook 'prog-mode-hook (<span style="font-weight: bold;">lambda</span> () (linum-mode t)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd388f85" class="outline-3">
<h3 id="orgd388f85"><span class="section-number-3">6.4</span> Backups</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-6-4">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org6eb091c" class="outline-4">
<h4 id="org6eb091c"><span class="section-number-4">6.4.1</span> Put them all in one directory</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-6-4-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defconst</span> <span style="font-weight: bold; font-style: italic;">emacs-tmp-dir</span>
(format <span style="font-style: italic;">"%s/%s%s/"</span> temporary-file-directory <span style="font-style: italic;">"emacs"</span> (user-uid)))
(<span style="font-weight: bold;">setq</span> backup-directory-alist `((<span style="font-style: italic;">".*"</span> . ,emacs-tmp-dir)))
(<span style="font-weight: bold;">setq</span> auto-save-file-name-transforms `((<span style="font-style: italic;">".*"</span> ,emacs-tmp-dir t)))
(<span style="font-weight: bold;">setq</span> auto-save-list-file-prefix emacs-tmp-dir)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6785778" class="outline-4">
<h4 id="org6785778"><span class="section-number-4">6.4.2</span> Completely disable backups</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-6-4-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> backup-inhibited t)
(<span style="font-weight: bold;">setq</span> make-backup-files nil)
(<span style="font-weight: bold;">setq</span> auto-save-default nil)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgc4a8964" class="outline-3">
<h3 id="orgc4a8964"><span class="section-number-3">6.5</span> Prompts</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-6-5">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org0c54167" class="outline-4">
<h4 id="org0c54167"><span class="section-number-4">6.5.1</span> No popup frames</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-6-5-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> ns-pop-up-frames nil)
(<span style="font-weight: bold;">setq</span> pop-up-frames nil)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgabf3f51" class="outline-4">
<h4 id="orgabf3f51"><span class="section-number-4">6.5.2</span> boolean (yes-or-no)</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-6-5-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp"><span class="linenr"> 1: </span>(<span style="font-weight: bold;">defadvice</span> <span style="font-weight: bold;">yes-or-no-p</span> (around prevent-dialog activate)
<span class="linenr"> 2: </span> <span style="font-style: italic;">"Prevent yes-or-no-p from activating a dialog"</span>
<span class="linenr"> 3: </span> (<span style="font-weight: bold;">let</span> ((use-dialog-box nil))
<span class="linenr"> 4: </span> ad-do-it))
2016-10-19 19:13:32 -06:00
<span class="linenr"> 5: </span>
2016-11-07 12:57:02 -07:00
<span class="linenr"> 6: </span>(<span style="font-weight: bold;">defadvice</span> <span style="font-weight: bold;">y-or-n-p</span> (around prevent-dialog-yorn activate)
<span class="linenr"> 7: </span> <span style="font-style: italic;">"Prevent y-or-n-p from activating a dialog"</span>
<span class="linenr"> 8: </span> (<span style="font-weight: bold;">let</span> ((use-dialog-box nil))
<span class="linenr"> 9: </span> ad-do-it))
2016-10-19 19:13:32 -06:00
<span class="linenr">10: </span>
2016-11-07 12:57:02 -07:00
<span id="coderef-y-or-n-p-only" class="coderef-off"><span class="linenr">11: </span>(<span style="font-weight: bold;">defalias</span> '<span style="font-weight: bold;">yes-or-no-p</span> 'y-or-n-p)</span>
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb04dd33" class="outline-4">
<h4 id="orgb04dd33"><span class="section-number-4">6.5.3</span> No dialog boxes</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-6-5-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> use-dialog-box nil)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org91fec3a" class="outline-3">
<h3 id="org91fec3a"><span class="section-number-3">6.6</span> Splitting</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-6-6">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">split-horizontally-for-temp-buffers</span> () (split-window-horizontally))
(add-hook 'temp-buffer-setup-hook 'split-horizontally-for-temp-buffers)
(<span style="font-weight: bold;">setq</span> split-height-threshold nil)
(<span style="font-weight: bold;">setq</span> split-width-threshold 160)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org0646289" class="outline-3">
<h3 id="org0646289"><span class="section-number-3">6.7</span> Buffer Display</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-6-7">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org22fb634" class="outline-4">
<h4 id="org22fb634"><span class="section-number-4">6.7.1</span> ewmctrl</h4>
2016-11-04 19:29:15 -06:00
<div class="outline-text-4" id="text-6-7-1">
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">ewmctrl</span>
<span style="font-weight: bold;">:demand</span> t)
2016-11-04 19:29:15 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgbfd5a65" class="outline-4">
<h4 id="orgbfd5a65"><span class="section-number-4">6.7.2</span> Handle xrefs annoying dedicated window garbage</h4>
2016-11-04 19:29:15 -06:00
<div class="outline-text-4" id="text-6-7-2">
2016-11-04 18:39:39 -06:00
<div class="org-src-container">
2016-11-07 17:03:59 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">xref--show-pos-in-buf</span> (pos buf select)
(<span style="font-weight: bold;">let</span> ((xref-buf (current-buffer))
win)
(<span style="font-weight: bold;">with-selected-window</span>
(display-buffer buf)
(xref--goto-char pos)
(run-hooks 'xref-after-jump-hook)
(<span style="font-weight: bold;">let</span> ((buf (current-buffer)))
(<span style="font-weight: bold;">setq</span> win (selected-window))
(<span style="font-weight: bold;">with-current-buffer</span> xref-buf
(<span style="font-weight: bold;">setq-local</span> other-window-scroll-buffer buf))))
(<span style="font-weight: bold;">when</span> select
(select-window win))))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgceeefd6" class="outline-4">
<h4 id="orgceeefd6"><span class="section-number-4">6.7.3</span> display-buffer-alist</h4>
2016-11-07 17:03:59 -07:00
<div class="outline-text-4" id="text-6-7-3">
<div class="org-src-container">
2016-11-07 16:44:00 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:use-frames-only</span>)
2016-11-04 19:29:15 -06:00
2016-11-07 17:41:36 -07:00
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:use-frames-only</span> nil)
2016-11-07 14:23:25 -07:00
2016-11-07 17:41:36 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:use-frames-only</span> ()
(<span style="font-weight: bold;">or</span> imalison:use-frames-only
(member (getenv <span style="font-style: italic;">"XDG_CURRENT_DESKTOP"</span>) '(<span style="font-style: italic;">"XMonad"</span>))))
2016-11-07 14:23:25 -07:00
2016-11-07 17:41:36 -07:00
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:use-new-frame-or-window</span> nil)
2016-11-07 14:23:25 -07:00
2016-11-07 17:41:36 -07:00
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:use-new-frame-or-window-next-command</span> nil)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:other-window-or-frame-next-command</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">setq</span> imalison:use-new-frame-or-window-next-command t))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:use-other-frame-or-window</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">or</span>
(<span style="font-weight: bold;">when</span> imalison:use-new-frame-or-window-next-command
(<span style="font-weight: bold;">setq</span> imalison:use-new-frame-or-window-next-command nil)
t)
imalison:use-new-frame-or-window))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:display-buffer</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">if</span> (imalison:use-other-frame-or-window args)
(apply 'imalison:display-buffer-other-frame-or-window args)
(apply 'display-buffer-same-window args)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:display-buffer-other-frame-or-window</span> (buffer <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">if</span> (imalison:use-frames-only)
(display-buffer buffer '((display-buffer-reuse-window
display-buffer-pop-up-frame)
(reusable-frames . t)
(inhibit-same-window . t)) <span style="font-weight: bold;">t)</span>
(apply 'display-buffer-reuse-window args)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:split-window-right</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">if</span> (imalison:use-frames-only)
(make-frame)
(split-window-right)))
2016-11-07 14:23:25 -07:00
2016-11-07 17:41:36 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:other-window</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">interactive</span>
(list 1))
(<span style="font-weight: bold;">if</span> (imalison:use-frames-only)
(apply 'other-frame args)
(apply 'other-window args)))
2016-11-07 16:25:24 -07:00
2016-11-07 17:41:36 -07:00
(<span style="font-weight: bold;">when</span> imalison:use-frames-only
(<span style="font-weight: bold;">setq</span> pop-up-frames 'graphic-only)
2016-11-07 16:44:00 -07:00
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-c s"</span> 'imalison:other-window-or-frame-next-command)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-x o"</span> 'imalison:other-window)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-x 3"</span> 'imalison:split-window-right)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-x O"</span> (<span style="font-weight: bold;">lambda</span> () (<span style="font-weight: bold;">interactive</span>) (imalison:other-window -1)))
(<span style="font-weight: bold;">setq</span> display-buffer-alist
'((<span style="font-style: italic;">".*popup\*"</span> . (display-buffer-pop-up-window))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">XXX: This was a failed attempt to get magit-commit to properly use</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">frames.</span>
2016-11-07 15:03:08 -07:00
2016-11-07 16:44:00 -07:00
(<span style="font-style: italic;">".*magit-diff.*"</span> . ((display-buffer-pop-up-window)
((reusable-frames . 0)
(inhibit-switch-frame . t)
(inhibit-same-window . t))))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(".*COMMIT_.*MSG.*" . ((display-buffer-pop-up-frame)</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">((reusable-frames . 0)</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(inhibit-same-window . t))))</span>
(<span style="font-style: italic;">".*"</span> . ((imalison:display-buffer display-buffer-same-window
display-buffer-pop-up-frame)
((reusable-frames . t)))))))
2016-11-04 19:29:15 -06:00
</pre>
</div>
2016-11-04 18:39:39 -06:00
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgee245dc" class="outline-3">
<h3 id="orgee245dc"><span class="section-number-3">6.8</span> Fill Setup</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-8">
2016-10-19 19:13:32 -06:00
<p>
Get rid of nags about requiring setences to end with two spaces.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> sentence-end-double-space nil)
2016-10-19 19:13:32 -06:00
</pre>
</div>
<p>
Set the default fill-column
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq-default</span> fill-column 80)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd54a0c8" class="outline-3">
<h3 id="orgd54a0c8"><span class="section-number-3">6.9</span> Show Trailing Whitespace</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-9">
2016-10-19 19:13:32 -06:00
<p>
2016-10-21 22:51:05 -06:00
Trailing 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
with random whitespace ALL over the place.
2016-10-19 19:13:32 -06:00
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq-default</span> show-trailing-whitespace t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-21 22:51:05 -06:00
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6ec9a61" class="outline-4">
<h4 id="org6ec9a61"><span class="section-number-4">6.9.1</span> Disable</h4>
2016-11-04 18:39:39 -06:00
<div class="outline-text-4" id="text-6-9-1">
2016-10-21 23:27:35 -06:00
<p>
Unfortunately, this setting can get annoying in a lot of modes, which is why I
use this hook to disable it in those modes
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:disable-show-trailing-whitespace</span> ()
(<span style="font-weight: bold;">setq</span> show-trailing-whitespace nil))
2016-10-21 23:27:35 -06:00
</pre>
2016-10-21 22:51:05 -06:00
</div>
2016-10-21 23:27:35 -06:00
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org364a515" class="outline-3">
<h3 id="org364a515"><span class="section-number-3">6.10</span> Encoding</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-10">
2016-10-19 19:13:32 -06:00
<p>
2016-10-21 22:51:05 -06:00
UTF-8 everywhere
2016-10-19 19:13:32 -06:00
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:set-coding-systems</span> ()
(<span style="font-weight: bold;">interactive</span>)
(set-language-environment <span style="font-style: italic;">"Latin-1"</span>)
(set-default-coding-systems 'utf-8)
(<span style="font-weight: bold;">unless</span> (eq system-type 'windows-nt)
(set-selection-coding-system 'utf-8))
(set-terminal-coding-system 'utf-8)
(<span style="font-weight: bold;">setq</span> locale-coding-system 'utf-8)
(prefer-coding-system 'utf-8))
(imalison:set-coding-systems)
2016-10-19 19:13:32 -06:00
</pre>
</div>
<p>
2016-10-21 22:51:05 -06:00
Disable CJK coding/encoding (Chinese/Japanese/Korean characters)
2016-10-19 19:13:32 -06:00
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> utf-translate-cjk-mode nil)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org29486cf" class="outline-3">
<h3 id="org29486cf"><span class="section-number-3">6.11</span> Visible Bell</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-11">
2016-10-21 22:51:05 -06:00
<p>
This is set to true to disable the annoying audible bell that plays
whenever there is an error.
</p>
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> visible-bell t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd489cb5" class="outline-3">
<h3 id="orgd489cb5"><span class="section-number-3">6.12</span> Configure <code>vc</code></h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-12">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> vc-follow-symlinks t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9db7b83" class="outline-3">
<h3 id="org9db7b83"><span class="section-number-3">6.13</span> Time in Mode Line</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-13">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> display-time-default-load-average nil)
(<span style="font-weight: bold;">setq</span> display-time-interval 1)
(<span style="font-weight: bold;">setq</span> display-time-format <span style="font-style: italic;">"%a|%m-%d|%r"</span>)
(display-time-mode 1)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org665c7e5" class="outline-3">
<h3 id="org665c7e5"><span class="section-number-3">6.14</span> Kill Ring</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-14">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> kill-ring-max 1000)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3b8d062" class="outline-3">
<h3 id="org3b8d062"><span class="section-number-3">6.15</span> Subword</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-15">
2016-10-21 22:51:05 -06:00
<p>
This makes <code>forward-word</code> and <code>backward-word</code> understand snake and camel case.
</p>
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> c-subword-mode t)
(global-subword-mode)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orge5fa494" class="outline-3">
<h3 id="orge5fa494"><span class="section-number-3">6.16</span> Scratch Buffer</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-16">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> initial-scratch-message <span style="font-style: italic;">""</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org55d555c" class="outline-3">
<h3 id="org55d555c"><span class="section-number-3">6.17</span> Don't prompt about local variables</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-17">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">risky-local-variable-p</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
nil)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org09377fd" class="outline-3">
<h3 id="org09377fd"><span class="section-number-3">6.18</span> proced</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-18">
2016-10-21 22:51:05 -06:00
<p>
proced is an top like utility that runs inside of emacs. The following sets auto updating automatically and makes the update interval faster.
</p>
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">proced</span>)
(<span style="font-weight: bold;">setq</span> proced-auto-update-interval 1)
(add-hook 'proced-mode-hook (<span style="font-weight: bold;">lambda</span> () (proced-toggle-auto-update +1)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgc98413a" class="outline-3">
<h3 id="orgc98413a"><span class="section-number-3">6.19</span> Set default browser</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-19">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">when</span> (equal system-type 'gnu/linux)
(<span style="font-weight: bold;">setq</span> browse-url-browser-function 'browse-url-generic
browse-url-generic-program <span style="font-style: italic;">"google-chrome-stable"</span>))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org25cd420" class="outline-3">
<h3 id="org25cd420"><span class="section-number-3">6.20</span> Set epa program</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-20">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> epg-gpg-program <span style="font-style: italic;">"gpg"</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgcf30f94" class="outline-3">
<h3 id="orgcf30f94"><span class="section-number-3">6.21</span> Make files executable</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-21">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
2016-10-21 22:51:05 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org16de45e" class="outline-3">
<h3 id="org16de45e"><span class="section-number-3">6.22</span> Misc</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-22">
2016-10-21 22:51:05 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">iedit-toggle-key-default</span> nil)
(put 'set-goal-column 'disabled nil)
(auto-fill-mode -1)
(<span style="font-weight: bold;">setq</span> indent-tabs-mode nil)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">setq</span> confirm-nonexistent-file-or-buffer nil)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">No prompt for killing a buffer with processes attached.</span>
(<span style="font-weight: bold;">setq</span> kill-buffer-query-functions
(remq 'process-kill-buffer-query-function
kill-buffer-query-functions))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">setq</span> inhibit-startup-message t
inhibit-startup-echo-area-message t)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">This makes it so that emacs --daemon puts its files in ~/.emacs.d/server</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(setq server-use-tcp t)</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Make buffer names unique.</span>
(<span style="font-weight: bold;">setq</span> uniquify-buffer-name-style 'forward)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Don't disable commands...</span>
(<span style="font-weight: bold;">setq</span> disabled-command-function nil)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Make forward word understand camel and snake case.</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Preserve pastes from OS when saving a new item to the kill</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">ring. Why wouldn't this be enabled by default?</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">setq-default</span> cursor-type 'box)
(<span style="font-weight: bold;">setq-default</span> cursor-in-non-selected-windows 'bar)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">when</span> nil <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Causing too many annoying issues</span>
(add-hook 'after-init-hook '(lambda () (<span style="font-weight: bold;">setq</span> debug-on-error t))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Make mouse scrolling less jumpy.</span>
(<span style="font-weight: bold;">setq</span> mouse-wheel-scroll-amount '(1 ((shift) . 1)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">setq</span> ediff-split-window-function 'split-window-horizontally)
(<span style="font-weight: bold;">setq</span> ediff-window-setup-function 'ediff-setup-windows-plain)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Disable this per major mode or maybe using file size if it causes</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">performance issues?</span>
(<span style="font-weight: bold;">setq</span> imenu-auto-rescan t)
(<span style="font-weight: bold;">setq</span> imenu-max-item-length 300)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(put 'narrow-to-region 'disabled nil)
(put 'narrow-to-page 'disabled nil)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">setq</span> echo-keystrokes 0.25)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">text mode stuff:</span>
(remove-hook 'text-mode-hook #'turn-on-auto-fill)
(add-hook 'text-mode-hook 'turn-on-visual-line-mode)
(<span style="font-weight: bold;">setq</span> sentence-end-double-space nil)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">y and n instead of yes and no</span>
2016-10-19 19:13:32 -06:00
</pre>
</div>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq-default</span> c-basic-offset 4
2016-10-19 19:13:32 -06:00
tab-width 4
2016-11-07 12:57:02 -07:00
indent-tabs-mode t)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(add-hook 'prog-mode-hook (<span style="font-weight: bold;">lambda</span> () (auto-fill-mode -1)))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(add-hook 'prog-mode-hook 'flyspell-prog-mode)</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(add-hook 'prog-mode-hook (lambda () (highlight-lines-matching-regexp</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">".\\{81\\}" 'hi-blue)))</span>
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org08efe55" class="outline-3">
<h3 id="org08efe55"><span class="section-number-3">6.23</span> paradox</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-23">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">paradox</span>
<span style="font-weight: bold;">:defer</span> 10
<span style="font-weight: bold;">:commands</span> (paradox-upgrade-packages paradox-list-packages)
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">gh</span>)
(<span style="font-weight: bold;">setq</span> paradox-execute-asynchronously t
paradox-github-token (gh-auth-get-oauth-token))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org491c22d" class="outline-3">
<h3 id="org491c22d"><span class="section-number-3">6.24</span> diminish</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-24">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">diminish</span>
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:packages-to-diminish</span>
'(auto-revert-mode smartparens-mode eldoc-mode tern-mode js2-refactor-mode))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">cl-loop</span> for package in imalison:packages-to-diminish
do (diminish package))
(eval-after-load 'subword '(diminish 'subword-mode))
(eval-after-load 'simple '(diminish 'visual-line-mode))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org83a2ce4" class="outline-3">
<h3 id="org83a2ce4"><span class="section-number-3">6.25</span> edit-server</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-25">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">edit-server</span>
<span style="font-weight: bold;">:commands</span> edit-server-start
<span style="font-weight: bold;">:defer</span> 1
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(edit-server-start)
(<span style="font-weight: bold;">setq</span> edit-server-new-frame nil)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd4d5090" class="outline-3">
<h3 id="orgd4d5090"><span class="section-number-3">6.26</span> load-dir</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-26">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">load-dir</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> load-dir-debug nil)
(add-to-list 'load-dirs <span style="font-style: italic;">"~/.emacs.d/load.d"</span>)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">site-lisp</span> <span style="font-style: italic;">"/usr/share/emacs24/site-lisp/"</span>)
(<span style="font-weight: bold;">when</span> (file-exists-p site-lisp) (add-to-list 'load-dirs site-lisp))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org892331e" class="outline-3">
<h3 id="org892331e"><span class="section-number-3">6.27</span> server</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-27">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">server</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">unless</span> (server-running-p) (server-start))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orge2aec7f" class="outline-3">
<h3 id="orge2aec7f"><span class="section-number-3">6.28</span> list-environment</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-28">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">list-environment</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org27b0bd4" class="outline-3">
<h3 id="org27b0bd4"><span class="section-number-3">6.29</span> bug-hunter</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-29">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">bug-hunter</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3667d2c" class="outline-3">
<h3 id="org3667d2c"><span class="section-number-3">6.30</span> shackle</h3>
2016-11-04 18:39:39 -06:00
<div class="outline-text-3" id="text-6-30">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">shackle</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(diminish 'shackle-mode)
(<span style="font-weight: bold;">when</span> nil <span style="font-weight: bold; font-style: italic;">; </span><span style="font-weight: bold; font-style: italic;">disabled for now</span>
(shackle-mode))
(<span style="font-weight: bold;">setq</span> shackle-inhibit-window-quit-on-same-windows t)
(<span style="font-weight: bold;">setq</span> shackle-default-rule '(<span style="font-weight: bold;">:same</span> t))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-10-21 22:51:05 -06:00
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6a77bcf" class="outline-3">
<h3 id="org6a77bcf"><span class="section-number-3">6.31</span> beacon</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-6-31">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">beacon</span>
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"C-c b"</span> . beacon-blink)
<span style="font-weight: bold;">:config</span>
(beacon-mode 1))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd007395" class="outline-3">
<h3 id="orgd007395"><span class="section-number-3">6.32</span> iregister</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-6-32">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">iregister</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org808e042" class="outline-3">
<h3 id="org808e042"><span class="section-number-3">6.33</span> discover-my-major</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-6-33">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">discover-my-major</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org732105b" class="outline-3">
<h3 id="org732105b"><span class="section-number-3">6.34</span> refine</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-6-34">
2016-10-21 22:51:05 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">refine</span>
<span style="font-weight: bold;">:disabled</span> t)
2016-10-21 22:51:05 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org29f1f1e" class="outline-3">
<h3 id="org29f1f1e"><span class="section-number-3">6.35</span> winner</h3>
2016-11-02 19:06:04 -06:00
<div class="outline-text-3" id="text-6-35">
2016-11-02 19:05:02 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">winner</span>
<span style="font-weight: bold;">:after</span> hydra
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:commands</span> (winner-undo winner-redo)
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">bind-key</span>
<span style="font-style: italic;">"C-c q"</span>
(<span style="font-weight: bold;">defhydra</span> imalison:winner-hydra ()
<span style="font-style: italic;">"Winner"</span>
(<span style="font-style: italic;">"p"</span> winner-undo <span style="font-style: italic;">"back"</span>)
(<span style="font-style: italic;">"n"</span> winner-redo <span style="font-style: italic;">"forward"</span> <span style="font-weight: bold;">:exit</span> t)))
(winner-mode 1)))
2016-10-21 22:51:05 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org7e2186f" class="outline-3">
<h3 id="org7e2186f"><span class="section-number-3">6.36</span> eyebrowse</h3>
2016-11-02 19:06:04 -06:00
<div class="outline-text-3" id="text-6-36">
2016-10-27 03:20:21 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">eyebrowse</span>
<span style="font-weight: bold;">:defer</span> 1
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span> (eyebrowse-mode +1)))
2016-10-27 03:20:21 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgbef7ff2" class="outline-3">
<h3 id="orgbef7ff2"><span class="section-number-3">6.37</span> stream</h3>
2016-11-02 19:06:04 -06:00
<div class="outline-text-3" id="text-6-37">
2016-11-02 21:25:56 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">stream</span>)
2016-11-03 18:30:08 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org11183fe" class="outline-3">
<h3 id="org11183fe"><span class="section-number-3">6.38</span> tile</h3>
2016-11-03 18:30:08 -06:00
<div class="outline-text-3" id="text-6-38">
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:use-package</span> tile
<span style="font-weight: bold;">:after</span> hydra
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"C-c t"</span> . imalison:hydra-tile/body)
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:tall-tile-strategy</span> (tile-split-n-tall 3))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:wide-tile-strategy</span> tile-wide)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:master-tile-strategy</span> (tile-argument-buffer-fetcher
<span style="font-weight: bold;">:layout</span> tile-master-left))
(<span style="font-weight: bold;">defhydra</span> imalison:hydra-tile
2016-11-02 21:52:49 -06:00
nil
2016-11-07 12:57:02 -07:00
<span style="font-style: italic;">"tile"</span>
(<span style="font-style: italic;">"t"</span> (tile <span style="font-weight: bold;">:strategy</span> imalison:tall-tile-strategy))
(<span style="font-style: italic;">"w"</span> (tile <span style="font-weight: bold;">:strategy</span> imalison:wide-tile-strategy))
(<span style="font-style: italic;">"m"</span> (tile <span style="font-weight: bold;">:strategy</span> imalison:master-tile-strategy))
(<span style="font-style: italic;">"s"</span> tile-select)
(<span style="font-style: italic;">"0"</span> (tile <span style="font-weight: bold;">:strategy</span> tile-one))
(<span style="font-style: italic;">"n"</span> tile)
(<span style="font-style: italic;">"l"</span> winner-undo))
(<span style="font-weight: bold;">setq</span> tile-cycler
(tile-strategies <span style="font-weight: bold;">:strategies</span>
(list imalison:tall-tile-strategy
2016-11-04 18:39:39 -06:00
imalison:master-tile-strategy
imalison:wide-tile-strategy
2016-11-07 12:57:02 -07:00
tile-one)))))
2016-11-02 21:25:56 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgdcbe5a3" class="outline-3">
<h3 id="orgdcbe5a3"><span class="section-number-3">6.39</span> fill-column-indicator</h3>
2016-11-03 18:30:08 -06:00
<div class="outline-text-3" id="text-6-39">
2016-10-19 19:13:32 -06:00
<p>
This interferes with too many other packages. See
<a href="https://github.com/alpaker/Fill-Column-Indicator/issues/21">https://github.com/alpaker/Fill-Column-Indicator/issues/21</a> for more details
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">fill-column-indicator</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">fci-on-off-fci-before-company</span> (command)
(<span style="font-weight: bold;">when</span> (string= <span style="font-style: italic;">"show"</span> command)
(turn-off-fci-mode))
(<span style="font-weight: bold;">when</span> (string= <span style="font-style: italic;">"hide"</span> command)
(turn-on-fci-mode)))
(advice-add 'company-call-frontends <span style="font-weight: bold;">:before</span> #'fci-on-off-fci-before-company)
(add-hook 'prog-mode-hook 'fci-mode)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org519d284" class="outline-2">
<h2 id="org519d284"><span class="section-number-2">7</span> Keybindings</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-7">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org0e4df70" class="outline-3">
<h3 id="org0e4df70"><span class="section-number-3">7.1</span> god-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-7-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">god-mode</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(global-set-key (kbd <span style="font-style: italic;">"&lt;escape&gt;"</span>) 'god-local-mode)))
2016-10-29 03:19:43 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgcd8dc22" class="outline-3">
<h3 id="orgcd8dc22"><span class="section-number-3">7.2</span> bind-key</h3>
2016-10-29 03:19:43 -06:00
<div class="outline-text-3" id="text-7-2">
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">bind-key</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3adb05c" class="outline-3">
<h3 id="org3adb05c"><span class="section-number-3">7.3</span> which-key</h3>
2016-10-29 03:19:43 -06:00
<div class="outline-text-3" id="text-7-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">which-key</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> which-key-idle-delay .50)
(diminish 'which-key-mode)
(which-key-mode)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6b22f47" class="outline-3">
<h3 id="org6b22f47"><span class="section-number-3">7.4</span> hydra</h3>
2016-10-29 03:19:43 -06:00
<div class="outline-text-3" id="text-7-4">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">hydra</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:bind</span> ((<span style="font-style: italic;">"C-c f"</span> . imalison:hydra-font/body)
(<span style="font-style: italic;">"C-c y"</span> . imalison:hydra-yank/body)
(<span style="font-style: italic;">"C-c 6"</span> . imalison:compile/body))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
2016-10-25 15:21:45 -06:00
</pre>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org2755cce" class="outline-4">
<h4 id="org2755cce"><span class="section-number-4">7.4.1</span> Font Settings</h4>
2016-10-29 03:19:43 -06:00
<div class="outline-text-4" id="text-7-4-1">
2016-10-25 15:21:45 -06:00
<p>
2016-11-07 17:41:36 -07:00
<a id="org5bf36cf"></a>
2016-10-25 15:21:45 -06:00
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defhydra</span> imalison:hydra-font
2016-10-25 15:21:45 -06:00
nil
2016-11-07 12:57:02 -07:00
<span style="font-style: italic;">"Font Settings"</span>
(<span style="font-style: italic;">"-"</span> imalison:font-size-decr <span style="font-style: italic;">"Decrease"</span>)
(<span style="font-style: italic;">"d"</span> imalison:font-size-decr <span style="font-style: italic;">"Decrease"</span>)
(<span style="font-style: italic;">"="</span> imalison:font-size-incr <span style="font-style: italic;">"Increase"</span>)
(<span style="font-style: italic;">"+"</span> imalison:font-size-incr <span style="font-style: italic;">"Increase"</span>)
(<span style="font-style: italic;">"i"</span> imalison:font-size-incr <span style="font-style: italic;">"Increase"</span>)
(<span style="font-style: italic;">"h"</span> imalison:set-huge-font-size <span style="font-style: italic;">"Huge"</span>)
(<span style="font-style: italic;">"a"</span> imalison:appearance <span style="font-style: italic;">"Set Default Appearance"</span>)
(<span style="font-style: italic;">"f"</span> set-frame-font <span style="font-style: italic;">"Set Frame Font"</span>)
(<span style="font-style: italic;">"t"</span> helm-themes <span style="font-style: italic;">"Choose Emacs Theme"</span>)
(<span style="font-style: italic;">"0"</span> imalison:font-size-reset <span style="font-style: italic;">"Reset to default size"</span>))
2016-10-25 15:21:45 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org52d3036" class="outline-4">
<h4 id="org52d3036"><span class="section-number-4">7.4.2</span> Yanking</h4>
2016-10-29 03:19:43 -06:00
<div class="outline-text-4" id="text-7-4-2">
2016-10-25 15:21:45 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defhydra</span> imalison:hydra-yank
2016-10-25 15:21:45 -06:00
nil
2016-11-07 12:57:02 -07:00
<span style="font-style: italic;">"Yank text"</span>
(<span style="font-style: italic;">"p"</span> imalison:copy-buffer-file-path <span style="font-style: italic;">"Projectile path"</span>)
(<span style="font-style: italic;">"f"</span> imalison:copy-buffer-file-path-full <span style="font-style: italic;">"Full path"</span>)
(<span style="font-style: italic;">"n"</span> imalison:copy-buffer-file-name <span style="font-style: italic;">"File name"</span>)
(<span style="font-style: italic;">"b"</span> imalison:copy-current-git-branch <span style="font-style: italic;">"Git Branch"</span>))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb8a2944" class="outline-4">
<h4 id="orgb8a2944"><span class="section-number-4">7.4.3</span> Compile</h4>
2016-10-29 03:19:43 -06:00
<div class="outline-text-4" id="text-7-4-3">
2016-10-25 15:21:45 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:make-test</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let</span> ((default-directory (projectile-project-root)))
(imalison:named-compile <span style="font-style: italic;">"make test"</span>)))
2016-10-25 15:21:45 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:glide-up</span> ()
(<span style="font-weight: bold;">interactive</span>)
(imalison:named-compile <span style="font-style: italic;">"glide up"</span>))
2016-10-25 15:21:45 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defhydra</span> imalison:compile nil <span style="font-style: italic;">"Compile"</span>
(<span style="font-style: italic;">"p"</span> imalison:projectile-helm-command-from-zsh <span style="font-style: italic;">"Run a command in projectile root"</span>)
(<span style="font-style: italic;">"d"</span> helm-command-from-zsh <span style="font-style: italic;">"Run a command in default directory"</span>)
(<span style="font-style: italic;">"c"</span> imalison:named-compile <span style="font-style: italic;">"Enter Custom Command"</span>)
(<span style="font-style: italic;">"t"</span> imalison:make-test <span style="font-style: italic;">"Test"</span>)
(<span style="font-style: italic;">"u"</span> imalison:glide-up <span style="font-style: italic;">"Update Dependencies"</span>))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">The following parens close the use-package/progn created several blocks above</span>
))
2016-10-25 15:21:45 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org7559199" class="outline-3">
<h3 id="org7559199"><span class="section-number-3">7.5</span> kill-emacs</h3>
2016-10-29 03:19:43 -06:00
<div class="outline-text-3" id="text-7-5">
2016-10-19 19:13:32 -06:00
<p>
This ensures that C-x C-c will always kill emacs, even if we are running in server mode.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-x C-c"</span> 'kill-emacs)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3320e03" class="outline-3">
<h3 id="org3320e03"><span class="section-number-3">7.6</span> imenu</h3>
2016-10-29 03:19:43 -06:00
<div class="outline-text-3" id="text-7-6">
2016-10-19 19:13:32 -06:00
<p>
imenu is the best. This should be a default binding.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-x C-i"</span> 'imenu)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgeabdc8d" class="outline-3">
<h3 id="orgeabdc8d"><span class="section-number-3">7.7</span> undo</h3>
2016-10-29 03:19:43 -06:00
<div class="outline-text-3" id="text-7-7">
2016-10-19 19:13:32 -06:00
<p>
I can't shake the habit of using this keybinding for undo. I should really use the default of C-/.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C--"</span> 'undo)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org74481ac" class="outline-3">
<h3 id="org74481ac"><span class="section-number-3">7.8</span> other-window</h3>
2016-10-29 03:19:43 -06:00
<div class="outline-text-3" id="text-7-8">
2016-10-19 19:13:32 -06:00
<p>
Go the other way when you use capital O.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-x O"</span> (<span style="font-weight: bold;">lambda</span> () (<span style="font-weight: bold;">interactive</span>) (other-window -1)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgbad3994" class="outline-3">
<h3 id="orgbad3994"><span class="section-number-3">7.9</span> Mark ring</h3>
2016-10-29 03:19:43 -06:00
<div class="outline-text-3" id="text-7-9">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-c SPC"</span> 'imalison:mark-ring)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org26328f5" class="outline-3">
<h3 id="org26328f5"><span class="section-number-3">7.10</span> Other bindings</h3>
2016-10-29 03:19:43 -06:00
<div class="outline-text-3" id="text-7-10">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-x p"</span> 'pop-to-mark-command)
(<span style="font-weight: bold;">setq</span> set-mark-command-repeat-pop t)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-x C-b"</span> 'buffer-menu)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-x C-r"</span> (<span style="font-weight: bold;">lambda</span> () (<span style="font-weight: bold;">interactive</span>) (revert-buffer t t)))
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-x w"</span> 'whitespace-mode)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"M-n"</span> 'forward-paragraph)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"M-p"</span> 'backward-paragraph)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-M-&lt;backspace&gt;"</span> 'backward-kill-sexp)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"s-&lt;return&gt;"</span> 'toggle-frame-fullscreen)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"M-|"</span> 'imalison:shell-command-on-region)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"C-x 9"</span> 'previous-buffer)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"s-v"</span> 'clipboard-yank)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org806ba03" class="outline-3">
<h3 id="org806ba03"><span class="section-number-3">7.11</span> global-set-key-to-use-package</h3>
2016-10-29 03:19:43 -06:00
<div class="outline-text-3" id="text-7-11">
2016-10-19 19:13:32 -06:00
<p>
This might be useless, but I believe that it is a macro that converts between
bind-key and global-set-key forms.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(fset 'global-set-key-to-use-package
(<span style="font-weight: bold;">lambda</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> arg) <span style="font-style: italic;">"Keyboard macro."</span> (<span style="font-weight: bold;">interactive</span> <span style="font-style: italic;">"p"</span>)
(kmacro-exec-ring-item
(<span style="font-weight: bold;">quote</span> ([1 67108896 19 100 6 23 40 19 41 return
backspace 32 46 6 4] 0 <span style="font-style: italic;">"%d"</span>)) arg)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org28416eb" class="outline-3">
<h3 id="org28416eb"><span class="section-number-3">7.12</span> OSX</h3>
2016-10-29 03:19:43 -06:00
<div class="outline-text-3" id="text-7-12">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">when</span> (equal system-type 'darwin)
(<span style="font-weight: bold;">setq</span> mac-option-modifier 'meta)
(<span style="font-weight: bold;">setq</span> mac-command-modifier 'super))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4906306" class="outline-2">
<h2 id="org4906306"><span class="section-number-2">8</span> Navigation</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-8">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org520e2dc" class="outline-3">
<h3 id="org520e2dc"><span class="section-number-3">8.1</span> zop-to-char</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-8-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">zop-to-char</span>
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"M-z"</span> . zop-to-char)
<span style="font-weight: bold;">:init</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> zop-to-char-kill-keys '(?\C-k))
(<span style="font-weight: bold;">setq</span> zop-to-char-quit-at-point-keys '(?\r))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org5ba327f" class="outline-3">
<h3 id="org5ba327f"><span class="section-number-3">8.2</span> helm</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-8-2">
2016-10-19 19:13:32 -06:00
<p>
I use helm for almost all emacs completion
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp"><span class="linenr"> 1: </span>(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">helm-config</span>
<span class="linenr"> 2: </span> <span style="font-weight: bold;">:ensure</span> helm
<span class="linenr"> 3: </span> <span style="font-weight: bold;">:demand</span> t
<span class="linenr"> 4: </span> <span style="font-weight: bold;">:bind</span> ((<span style="font-style: italic;">"M-y"</span> . helm-show-kill-ring)
<span class="linenr"> 5: </span> (<span style="font-style: italic;">"M-x"</span> . helm-M-x)
<span class="linenr"> 6: </span> (<span style="font-style: italic;">"C-x C-i"</span> . helm-imenu)
<span class="linenr"> 7: </span> (<span style="font-style: italic;">"C-h a"</span> . helm-apropos)
<span class="linenr"> 8: </span> (<span style="font-style: italic;">"C-c C-h"</span> . helm-org-agenda-files-headings)
<span class="linenr"> 9: </span> (<span style="font-style: italic;">"C-c ;"</span> . helm-recentf))
<span class="linenr">10: </span> <span style="font-weight: bold;">:diminish</span> helm-mode
<span class="linenr">11: </span> <span style="font-weight: bold;">:config</span>
<span class="linenr">12: </span> (<span style="font-weight: bold;">progn</span>
<span class="linenr">13: </span> (<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">helm-org</span>)
<span id="coderef-helm split window" class="coderef-off"><span class="linenr">14: </span> (<span style="font-weight: bold;">setq</span> helm-split-window-default-side 'same)</span>
2016-10-19 19:13:32 -06:00
<span class="linenr">15: </span>
2016-11-07 12:57:02 -07:00
<span class="linenr">16: </span> (<span style="font-weight: bold;">cl-defun</span> <span style="font-weight: bold;">helm-org-headings-in-buffer</span> ()
<span class="linenr">17: </span> (<span style="font-weight: bold;">interactive</span>)
<span class="linenr">18: </span> (helm <span style="font-weight: bold;">:sources</span> (helm-source-org-headings-for-files
<span class="linenr">19: </span> (list (projectile-completing-read
<span class="linenr">20: </span> <span style="font-style: italic;">"File to look at headings from: "</span>
<span class="linenr">21: </span> (projectile-all-project-files))))
<span class="linenr">22: </span> <span style="font-weight: bold;">:candidate-number-limit</span> 99999
<span class="linenr">23: </span> <span style="font-weight: bold;">:buffer</span> <span style="font-style: italic;">"*helm org inbuffer*"</span>))
2016-10-19 19:13:32 -06:00
<span class="linenr">24: </span>
2016-11-07 12:57:02 -07:00
<span class="linenr">25: </span> (<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">helm-descbinds</span>
<span class="linenr">26: </span> <span style="font-weight: bold;">:demand</span> t
<span class="linenr">27: </span> <span style="font-weight: bold;">:config</span> (helm-descbinds-mode 1))
2016-10-19 19:13:32 -06:00
<span class="linenr">28: </span>
2016-11-07 12:57:02 -07:00
<span class="linenr">29: </span> (<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">helm-ag</span>
<span class="linenr">30: </span> <span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"C-c p 1"</span> . imalison:set-helm-ag-extra-options)
<span class="linenr">31: </span> <span style="font-weight: bold;">:preface</span>
<span class="linenr">32: </span> (<span style="font-weight: bold;">progn</span>
<span class="linenr">33: </span> (<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:set-helm-ag-extra-options</span> ()
<span class="linenr">34: </span> (<span style="font-weight: bold;">interactive</span>)
<span class="linenr">35: </span> (<span style="font-weight: bold;">let</span> ((option (read-string <span style="font-style: italic;">"Extra options: "</span> (<span style="font-weight: bold;">or</span> helm-ag--extra-options <span style="font-style: italic;">""</span>)
<span class="linenr">36: </span> 'helm-ag--extra-options-history)))
<span class="linenr">37: </span> (<span style="font-weight: bold;">setq</span> helm-ag--extra-options option))))
<span class="linenr">38: </span> <span style="font-weight: bold;">:config</span>
<span class="linenr">39: </span> (<span style="font-weight: bold;">progn</span>
<span class="linenr">40: </span> (<span style="font-weight: bold;">setq</span> helm-ag-always-set-extra-option nil)))
<span class="linenr">41: </span> (helm-mode 1)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
<p>
<a href="#coderef-helm split window"class="coderef" onmouseover="CodeHighlightOn(this, 'coderef-helm split window');" onmouseout="CodeHighlightOff(this, 'coderef-helm split window');">Ensure that helm buffers are started in the window that currently holds the focus</a>
</p>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org87e938d" class="outline-3">
<h3 id="org87e938d"><span class="section-number-3">8.3</span> helm-projectile</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-8-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">helm-projectile</span>
<span style="font-weight: bold;">:commands</span> (helm-projectile-on)
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> helm-projectile-projects-map
(<span style="font-style: italic;">"M-s"</span> . imalison:switch-to-project-and-search)
(<span style="font-style: italic;">"M-t"</span> . imalison:helm-term-projectile))
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:invalidate-cache-and-open-file</span> (_dir)
(projectile-invalidate-cache nil)
(projectile-find-file))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:switch-to-project-and-search</span> (dir)
(<span style="font-weight: bold;">let</span> ((default-directory dir)
(projectile-require-project-root nil)
(helm-action-buffer <span style="font-style: italic;">"this-buffer-should-not-exist"</span>))
(helm-projectile-ag)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:helm-term-projectile</span> (dir)
(<span style="font-weight: bold;">let</span> ((default-directory dir)
(projectile-require-project-root nil)
(helm-action-buffer <span style="font-style: italic;">"this-buffer-should-not-exist"</span>))
(term-projectile-forward))))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(helm-delete-action-from-source <span style="font-style: italic;">"Search in Project"</span>
helm-source-projectile-projects)
(helm-delete-action-from-source <span style="font-style: italic;">"Open term for project"</span>
helm-source-projectile-projects)
(helm-add-action-to-source <span style="font-style: italic;">"Search in Project"</span>
2016-10-19 19:13:32 -06:00
'imalison:switch-to-project-and-search
2016-11-07 12:57:02 -07:00
helm-source-projectile-projects)
(helm-add-action-to-source <span style="font-style: italic;">"Open term for project"</span>
2016-10-19 19:13:32 -06:00
'imalison:helm-term-projectile
2016-11-07 12:57:02 -07:00
helm-source-projectile-projects)
(helm-add-action-to-source <span style="font-style: italic;">"Invalidate Cache and Open File"</span>
2016-10-19 19:13:32 -06:00
'imalison:invalidate-cache-and-open-file
2016-11-07 12:57:02 -07:00
helm-source-projectile-projects)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org666741d" class="outline-3">
<h3 id="org666741d"><span class="section-number-3">8.4</span> projectile</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-8-4">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">projectile</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:bind</span> ((<span style="font-style: italic;">"C-x f"</span> . projectile-find-file-in-known-projects)
(<span style="font-style: italic;">"C-c p f"</span> . imalison:projectile-find-file))
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:do-ag-default-directory</span> ()
(<span style="font-weight: bold;">interactive</span>)
(helm-do-ag default-directory (car (projectile-parse-dirconfig-file))))
(<span style="font-weight: bold;">emit-prefix-selector</span> imalison:do-ag
2016-10-19 19:13:32 -06:00
helm-projectile-ag
imalison:do-ag-default-directory
2016-11-07 12:57:02 -07:00
helm-do-ag)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">emit-prefix-selector</span> imalison:projectile-find-file
2016-10-19 19:13:32 -06:00
projectile-find-file
2016-11-07 12:57:02 -07:00
projectile-find-file-other-window)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">imalison:let-around</span> imalison:set-options-do-ag
2016-10-19 19:13:32 -06:00
imalison:do-ag
2016-11-07 12:57:02 -07:00
(helm-ag-always-set-extra-option t))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:projectile-make-all-subdirs-projects</span> (directory)
(<span style="font-weight: bold;">cl-loop</span> for file-info in (directory-files-and-attributes directory)
do (<span style="font-weight: bold;">when</span> (nth 1 file-info)
(write-region <span style="font-style: italic;">""</span> nil
(expand-file-name
(concat directory <span style="font-style: italic;">"/"</span>
(nth 0 file-info) <span style="font-style: italic;">"/.projectile"</span>)))))))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">persp-projectile</span>
<span style="font-weight: bold;">:commands</span> projectile-persp-switch-project)
(projectile-global-mode)
(<span style="font-weight: bold;">setq</span> projectile-require-project-root nil)
(<span style="font-weight: bold;">setq</span> projectile-enable-caching nil)
(<span style="font-weight: bold;">setq</span> projectile-completion-system 'helm)
(add-to-list 'projectile-globally-ignored-files <span style="font-style: italic;">"Godeps"</span>)
(<span style="font-weight: bold;">shut-up</span> (helm-projectile-on))
(diminish 'projectile-mode)
(<span style="font-weight: bold;">bind-key*</span> <span style="font-style: italic;">"C-c p s"</span> 'imalison:do-ag)
(<span style="font-weight: bold;">bind-key*</span> <span style="font-style: italic;">"C-c p S"</span> 'imalison:set-options-do-ag)
(<span style="font-weight: bold;">bind-key*</span> <span style="font-style: italic;">"C-c p f"</span> 'imalison:projectile-find-file)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org96aafbb" class="outline-3">
<h3 id="org96aafbb"><span class="section-number-3">8.5</span> ido</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-8-5">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">ido</span>
<span style="font-weight: bold;">:commands</span> ido-mode
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(ido-mode 1)
(<span style="font-weight: bold;">setq</span> ido-auto-merge-work-directories-length -1
2016-10-27 17:08:00 -06:00
ido-default-buffer-method 'selected-window
ido-use-virtual-buffers t
ido-use-filename-at-point nil
2016-11-07 12:57:02 -07:00
ido-create-new-buffer 'always)
(ido-everywhere 1)
(<span style="font-weight: bold;">setq</span> ido-enable-flex-matching t)
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">flx</span>)
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">flx-ido</span>
<span style="font-weight: bold;">:commands</span> flx-ido-mode
<span style="font-weight: bold;">:init</span> (flx-ido-mode 1)
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">disable ido faces to see flx highlights.</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">This makes flx-ido much faster.</span>
(<span style="font-weight: bold;">setq</span> gc-cons-threshold 20000000)
(<span style="font-weight: bold;">setq</span> ido-use-faces nil)))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">ido-ubiquitous</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:commands</span> (ido-ubiquitous-mode))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">ido-vertical-mode</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(ido-vertical-mode 1)
(<span style="font-weight: bold;">setq</span> ido-vertical-define-keys 'C-n-C-p-up-and-down)))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">flx-ido</span>)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgedace46" class="outline-3">
<h3 id="orgedace46"><span class="section-number-3">8.6</span> avy</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-8-6">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">avy</span>
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">emit-prefix-selector</span> imalison:avy
2016-10-19 19:13:32 -06:00
avy-goto-word-1
2016-11-07 12:57:02 -07:00
avy-goto-char))
<span style="font-weight: bold;">:bind</span> ((<span style="font-style: italic;">"C-j"</span> . imalison:avy)
(<span style="font-style: italic;">"M-g l"</span> . avy-goto-line)
(<span style="font-style: italic;">"C-'"</span> . avy-goto-char-2)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgc78a6a6" class="outline-3">
<h3 id="orgc78a6a6"><span class="section-number-3">8.7</span> ace-window</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-8-7">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">ace-window</span>
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">emit-prefix-selector</span> imalison:ace-window
2016-10-19 19:13:32 -06:00
ace-select-window
2016-11-07 12:57:02 -07:00
ace-swap-window)
<span style="font-weight: bold;">:config</span> (<span style="font-weight: bold;">setq</span> aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"C-c w"</span> . imalison:ace-window))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org870ca45" class="outline-3">
<h3 id="org870ca45"><span class="section-number-3">8.8</span> neotree</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-8-8">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">neotree</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgfdccea5" class="outline-3">
<h3 id="orgfdccea5"><span class="section-number-3">8.9</span> jump-char</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-8-9">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">jump-char</span>
<span style="font-weight: bold;">:bind</span> ((<span style="font-style: italic;">"C-;"</span> . jump-char-forward)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org5edb64b" class="outline-3">
<h3 id="org5edb64b"><span class="section-number-3">8.10</span> flimenu</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-8-10">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:use-package</span> flimenu
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(flimenu-global-mode)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6ac3e6d" class="outline-3">
<h3 id="org6ac3e6d"><span class="section-number-3">8.11</span> swiper</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-8-11">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">swiper</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"C-s"</span> . swiper))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgf771ea7" class="outline-2">
<h2 id="orgf771ea7"><span class="section-number-2">9</span> Completion</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-9">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org6c817a3" class="outline-3">
<h3 id="org6c817a3"><span class="section-number-3">9.1</span> company</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-9-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">company</span>
<span style="font-weight: bold;">:commands</span> company-mode imalison:company
<span style="font-weight: bold;">:bind</span> ((<span style="font-style: italic;">"C-\\"</span> . imalison:company))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">emit-prefix-selector</span> imalison:company
2016-10-19 19:13:32 -06:00
company-complete
2016-11-07 12:57:02 -07:00
company-yasnippet)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">setq</span> company-idle-delay .25)
(global-company-mode)
(diminish 'company-mode))
<span style="font-weight: bold;">:init</span>
(add-hook 'prog-mode-hook (<span style="font-weight: bold;">lambda</span> () (company-mode t))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgbf9fac9" class="outline-4">
<h4 id="orgbf9fac9"><span class="section-number-4">9.1.1</span> company-flx</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-9-1-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">company-flx</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:after</span> company
<span style="font-weight: bold;">:config</span>
(company-flx-mode +1))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org26d5976" class="outline-3">
<h3 id="org26d5976"><span class="section-number-3">9.2</span> auto-complete</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-9-2">
2016-10-19 19:13:32 -06:00
<p>
I don't use auto-complete at all, so I have set up a hook to automatically disable it whenever it is enabled to avoid creating conflicting popups when company is activated.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">auto-complete</span>
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:auto-complete-hook</span> ()
(debug)
(<span style="font-weight: bold;">warn</span> <span style="font-style: italic;">"auto-complete-mode was activated, but is being automatically disabled."</span>)
(<span style="font-weight: bold;">let</span> ((auto-complete-mode-hook nil))
(auto-complete-mode -1))))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(add-hook 'auto-complete-mode-hook 'imalison:auto-complete-hook)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org961ec1a" class="outline-2">
<h2 id="org961ec1a"><span class="section-number-2">10</span> Text Manipulation</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-10">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org1f43ab3" class="outline-3">
<h3 id="org1f43ab3"><span class="section-number-3">10.1</span> smartparens</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-10-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">smartparens</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:diminish</span> smartparens-mode
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> smartparens-mode-map
(<span style="font-style: italic;">"H-z"</span> . sp-kill-symbol)
(<span style="font-style: italic;">"C-)"</span> . sp-forward-slurp-sexp)
(<span style="font-style: italic;">"C-}"</span> . sp-forward-barf-sexp)
(<span style="font-style: italic;">"C-("</span> . sp-backward-slurp-sexp)
(<span style="font-style: italic;">"C-{"</span> . sp-backward-barf-sexp))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">smartparens-config</span>)
(smartparens-global-mode 1)
(sp-use-smartparens-bindings)
(<span style="font-weight: bold;">unbind-key</span> <span style="font-style: italic;">"C-M-&lt;backspace&gt;"</span> smartparens-mode-map)
(<span style="font-weight: bold;">unbind-key</span> <span style="font-style: italic;">"C-&lt;backspace&gt;"</span> smartparens-mode-map)
(<span style="font-weight: bold;">unbind-key</span> <span style="font-style: italic;">"M-&lt;backspace&gt;"</span> smartparens-mode-map)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org8055eec" class="outline-3">
<h3 id="org8055eec"><span class="section-number-3">10.2</span> multiple-cursors</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-10-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">multiple-cursors</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">phi-search-mc</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:config</span>
(phi-search-mc/setup-keys))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">mc-extras</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:config</span>
(define-key mc/keymap (kbd <span style="font-style: italic;">"C-. ="</span>) 'mc/compare-chars)))
<span style="font-weight: bold;">:bind</span>
((<span style="font-style: italic;">"C-c m a"</span> . mc/mark-all-like-this)
(<span style="font-style: italic;">"C-c m m"</span> . mc/mark-all-like-this-dwim)
(<span style="font-style: italic;">"C-c m l"</span> . mc/edit-lines)
(<span style="font-style: italic;">"C-c m n"</span> . mc/mark-next-like-this)
(<span style="font-style: italic;">"C-c m p"</span> . mc/mark-previous-like-this)
(<span style="font-style: italic;">"C-c m s"</span> . mc/mark-sgml-tag-pair)
(<span style="font-style: italic;">"C-c m d"</span> . mc/mark-all-like-this-in-defun)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4a41918" class="outline-3">
<h3 id="org4a41918"><span class="section-number-3">10.3</span> expand-region</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-10-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">expand-region</span>
<span style="font-weight: bold;">:commands</span> er/expand-region
<span style="font-weight: bold;">:config</span> (<span style="font-weight: bold;">setq</span> expand-region-contract-fast-key <span style="font-style: italic;">"j"</span>)
<span style="font-weight: bold;">:bind</span> ((<span style="font-style: italic;">"C-c k"</span> . er/expand-region)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org7dc98dc" class="outline-3">
<h3 id="org7dc98dc"><span class="section-number-3">10.4</span> multi-line</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-10-4">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:use-package</span> multi-line
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"C-c d"</span> . multi-line))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgde4edd1" class="outline-3">
<h3 id="orgde4edd1"><span class="section-number-3">10.5</span> comment-dwim-2</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-10-5">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">comment-dwim-2</span>
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"M-;"</span> . comment-dwim-2))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgf8d26ff" class="outline-3">
<h3 id="orgf8d26ff"><span class="section-number-3">10.6</span> unfill</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-10-6">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">unfill</span>
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"M-q"</span> . unfill-toggle))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgdb278f0" class="outline-3">
<h3 id="orgdb278f0"><span class="section-number-3">10.7</span> cliphist</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-10-7">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">cliphist</span>
<span style="font-weight: bold;">:config</span> (<span style="font-weight: bold;">setq</span> cliphist-use-ivy t))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9abbb00" class="outline-3">
<h3 id="org9abbb00"><span class="section-number-3">10.8</span> electric-operator-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-10-8">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">electric-operator</span>
<span style="font-weight: bold;">:config</span>
(add-hook 'python-mode-hook #'electric-operator-mode))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9bef5c2" class="outline-3">
<h3 id="org9bef5c2"><span class="section-number-3">10.9</span> string-inflection</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-10-9">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">string-inflection</span>
<span style="font-weight: bold;">:commands</span> string-inflection-toggle
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"C-c l"</span> . string-inflection-toggle))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orge7fc5a9" class="outline-3">
<h3 id="orge7fc5a9"><span class="section-number-3">10.10</span> yasnippet</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-10-10">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">yasnippet</span>
<span style="font-weight: bold;">:defer</span> 5
<span style="font-weight: bold;">:commands</span> (yas-global-mode)
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(yas-global-mode)
(diminish 'yas-minor-mode)
(add-hook 'term-mode-hook (<span style="font-weight: bold;">lambda</span>() (yas-minor-mode -1)))
(<span style="font-weight: bold;">setq</span> yas-prompt-functions
(cons 'yas-ido-prompt
(cl-delete 'yas-ido-prompt yas-prompt-functions)))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org1230b7c" class="outline-2">
<h2 id="org1230b7c"><span class="section-number-2">11</span> Source Control</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-11">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org7ca9d93" class="outline-3">
<h3 id="org7ca9d93"><span class="section-number-3">11.1</span> magit</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-11-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">magit</span>
<span style="font-weight: bold;">:commands</span> magit-status
<span style="font-weight: bold;">:bind</span> ((<span style="font-style: italic;">"C-x g"</span> . imalison:magit-status))
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">emit-let-around</span> imalison:magit-status-traditional
2016-10-28 15:34:49 -06:00
magit-status
2016-11-07 12:57:02 -07:00
(magit-display-buffer-function
'magit-display-buffer-traditional))
(<span style="font-weight: bold;">emit-prefix-selector</span> imalison:magit-status
2016-10-28 15:34:49 -06:00
magit-status
2016-11-07 12:57:02 -07:00
imalison:magit-status-traditional)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:after-magit-visit-file</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">when</span> (derived-mode-p 'org-mode)
(org-show-context 'magit-goto))))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
2016-11-07 16:01:14 -07:00
(<span style="font-weight: bold;">when</span> (imalison:use-frames-only)
2016-11-07 16:04:37 -07:00
(<span style="font-weight: bold;">setq</span> magit-commit-show-diff t))
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">unbind-key</span> <span style="font-style: italic;">"C-j"</span> magit-status-mode-map)
(<span style="font-weight: bold;">unbind-key</span> <span style="font-style: italic;">"C-j"</span> magit-hunk-section-map)
(<span style="font-weight: bold;">unbind-key</span> <span style="font-style: italic;">"C-j"</span> magit-file-section-map)
(<span style="font-weight: bold;">setq</span> magit-last-seen-setup-instructions <span style="font-style: italic;">"1.4.0"</span>
2016-10-28 15:34:49 -06:00
magit-display-buffer-function
2016-11-07 12:57:02 -07:00
'magit-display-buffer-same-window-except-diff-v1)
(magit-auto-revert-mode)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">TODO: Is this necessary now that signing is a git default</span>
(<span style="font-weight: bold;">when</span> (<span style="font-weight: bold;">bound-and-true-p</span> imalison:gpg-key)
(add-to-list 'magit-commit-arguments
(format <span style="font-style: italic;">"--gpg-sign=%s"</span> imalison:gpg-key)))
(add-to-list 'org-show-context-detail '(magit-goto . lineage))
(advice-add 'magit-diff-visit-file <span style="font-weight: bold;">:after</span> 'imalison:after-magit-visit-file)
2016-11-07 16:01:14 -07:00
(add-hook 'magit-popup-mode-hook 'imalison:disable-show-trailing-whitespace)))
2016-11-07 12:57:02 -07:00
</pre>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org29dc1ac" class="outline-4">
<h4 id="org29dc1ac"><span class="section-number-4">11.1.1</span> magithub</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-11-1-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">magithub</span>
<span style="font-weight: bold;">:if</span> (executable-find <span style="font-style: italic;">"hub"</span>)
<span style="font-weight: bold;">:after</span> magit)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6e15620" class="outline-3">
<h3 id="org6e15620"><span class="section-number-3">11.2</span> git-link</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-11-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">git-link</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> git-link-use-commit t)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org7ef0469" class="outline-3">
<h3 id="org7ef0469"><span class="section-number-3">11.3</span> magit-gitflow</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-11-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">magit-gitflow</span>
<span style="font-weight: bold;">:diminish</span> magit-gitflow-mode
<span style="font-weight: bold;">:after</span> magit
<span style="font-weight: bold;">:init</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> magit-gitflow-popup-key <span style="font-style: italic;">"C-k"</span>))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(add-hook 'magit-mode-hook 'turn-on-magit-gitflow)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org8dee9ed" class="outline-3">
<h3 id="org8dee9ed"><span class="section-number-3">11.4</span> git-timemachine</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-11-4">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">git-timemachine</span>
<span style="font-weight: bold;">:commands</span> git-timemachine)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4d44d8a" class="outline-3">
<h3 id="org4d44d8a"><span class="section-number-3">11.5</span> git-gutter</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-11-5">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">git-gutter</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(global-git-gutter-mode -1)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgebeb6c9" class="outline-3">
<h3 id="orgebeb6c9"><span class="section-number-3">11.6</span> gitolite-clone</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-11-6">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">gitolite-clone</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">gitolite-clone-force-refresh</span> ()
(<span style="font-weight: bold;">interactive</span>)
(gitolite-clone-get-projects nil nil t))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb34abf5" class="outline-3">
<h3 id="orgb34abf5"><span class="section-number-3">11.7</span> gitconfig-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-11-7">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">gitconfig-mode</span>
<span style="font-weight: bold;">:mode</span> <span style="font-style: italic;">"\\.?gitconfig.?.*\\'"</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org5e1cef8" class="outline-3">
<h3 id="org5e1cef8"><span class="section-number-3">11.8</span> gitignore-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-11-8">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">gitignore-mode</span>
<span style="font-weight: bold;">:mode</span> <span style="font-style: italic;">"\\.?gitignore.?.*\\'"</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4ec6ffa" class="outline-3">
<h3 id="org4ec6ffa"><span class="section-number-3">11.9</span> github</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-11-9">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-orgb308ebd" class="outline-4">
<h4 id="orgb308ebd"><span class="section-number-4">11.9.1</span> github-search</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-11-9-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:use-package</span> github-search
<span style="font-weight: bold;">:commands</span> (github-search-clone-repo github-search-user-clone-repo)
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:get-appropriate-path-from-gh-repo-for-go</span> (repo)
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">go-mode</span>)
(imalison:get-go-src <span style="font-style: italic;">"github.com"</span> (<span style="font-weight: bold;">oref</span> (<span style="font-weight: bold;">oref</span> repo <span style="font-weight: bold;">:owner</span>) <span style="font-weight: bold;">:login</span>)
(<span style="font-weight: bold;">oref</span> repo <span style="font-weight: bold;">:name</span>)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:get-projects-directory-target-from-repo</span> (repo)
(<span style="font-weight: bold;">let</span> ((prospective-path
(<span style="font-weight: bold;">if</span> (equal (<span style="font-weight: bold;">oref</span> repo language) <span style="font-style: italic;">"Go"</span>)
(imalison:get-appropriate-path-from-gh-repo-for-go repo)
(imalison:join-paths imalison:projects-directory (<span style="font-weight: bold;">oref</span> repo <span style="font-weight: bold;">:name</span>)))))
(<span style="font-weight: bold;">if</span> (file-exists-p prospective-path)
(funcall 'github-search-prompt-for-target-directory repo)
prospective-path))))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> github-search-get-target-directory-for-repo-function
'imalison:get-projects-directory-target-from-repo)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org8f89010" class="outline-4">
<h4 id="org8f89010"><span class="section-number-4">11.9.2</span> github-clone</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-11-9-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:use-package*</span> github-clone <span style="font-style: italic;">"~/Projects/github-clone.el"</span>
<span style="font-weight: bold;">:commands</span> (github-clone-add-parent-remote
2016-10-19 19:13:32 -06:00
github-clone-add-source-remote
github-clone-fork-remote
github-clone-add-existing-remote
2016-11-07 12:57:02 -07:00
github-clone))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org59a7783" class="outline-4">
<h4 id="org59a7783"><span class="section-number-4">11.9.3</span> github-notifier</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-11-9-3">
2016-10-19 19:13:32 -06:00
<p>
This is disabled because it was causing too many issues with my
modeline and with excessive http requests to github.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">github-notifier</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(advice-add 'github-notifier-update <span style="font-weight: bold;">:around</span> 'imalison:shut-up-around)
(github-notifier-mode)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4744870" class="outline-4">
<h4 id="org4744870"><span class="section-number-4">11.9.4</span> github-browse-file</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-11-9-4">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">github-browse-file</span>
<span style="font-weight: bold;">:commands</span> github-browse-file)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org2e4be17" class="outline-4">
<h4 id="org2e4be17"><span class="section-number-4">11.9.5</span> magit-gh-pulls</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-11-9-5">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">magit-gh-pulls</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:diminish</span> magit-gh-pulls-mode
<span style="font-weight: bold;">:after</span> magit
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(add-hook 'magit-mode-hook 'turn-on-magit-gh-pulls)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgbb23b42" class="outline-4">
<h4 id="orgbb23b42"><span class="section-number-4">11.9.6</span> gist</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-11-9-6">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">gist</span>
<span style="font-weight: bold;">:commands</span> (gist-region gist-region-private gist-buffer gist-buffer-private
2016-10-19 19:13:32 -06:00
gist-region-or-buffer gist-region-or-buffer-private
gist-list-user gist-list gist-fetch gist-star
2016-11-07 12:57:02 -07:00
gist-unstar gist-list-starred gist-fork))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orge7019e6" class="outline-2">
<h2 id="orge7019e6"><span class="section-number-2">12</span> Major Modes</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-12">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org61db33d" class="outline-3">
<h3 id="org61db33d"><span class="section-number-3">12.1</span> Programming</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-12-1">
2016-10-24 17:18:33 -06:00
<p>
2016-11-07 17:41:36 -07:00
<a id="orgab66b5f"></a>
2016-10-24 17:18:33 -06:00
</p>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org114248e" class="outline-4">
<h4 id="org114248e"><span class="section-number-4">12.1.1</span> python</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-1-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">python</span>
<span style="font-weight: bold;">:commands</span> python-mode
<span style="font-weight: bold;">:mode</span> (<span style="font-style: italic;">"\\.py\\'"</span> . python-mode)
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:python-mode</span> ()
(<span style="font-weight: bold;">setq</span> show-trailing-whitespace t)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">TODO: This was likely fixed and can probably be removed</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Somehow this is sometimes set to jedi:ac-setup which we</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">don't want. This binding avoids starting auto-complete mode.</span>
(<span style="font-weight: bold;">let</span> ((jedi:setup-function nil))
(jedi:setup))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">XXX: This has become pretty annoying</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(add-hook 'before-save-hook 'pyimport-remove-unused t t)</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Ensure company is active</span>
(company-mode +1)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Only use company-jedi for completion</span>
(set (make-local-variable 'company-backends) '(company-jedi))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Remove default python completion, as we are going to rely on</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">company-jedi.</span>
(remove-hook 'completion-at-point-functions
'python-completion-complete-at-point 'local))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">sphinx-doc</span>)
(<span style="font-weight: bold;">unbind-key</span> <span style="font-style: italic;">"C-j"</span> python-mode-map)
(add-hook 'python-mode-hook #'imalison:python-mode)))
</pre>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orge02e26e" class="outline-5">
<h5 id="orge02e26e"><span class="section-number-5">12.1.1.1</span> pyimport</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-1-1">
2016-10-19 19:13:32 -06:00
<p>
Pyimport is disabled because it may be causing a performance problem.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">pyimport</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> python-mode-map
(<span style="font-style: italic;">"C-c C-i"</span> . pyimport-insert-missing))
<span style="font-weight: bold;">:commands</span> pyimport-remove-unused)
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3d3f656" class="outline-5">
<h5 id="org3d3f656"><span class="section-number-5">12.1.1.2</span> jedi</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-1-2">
2016-10-19 19:13:32 -06:00
<p>
The accepted way to use jedi if you prefer company to auto-complete is
simply to require the company jedi package, which is why we make no
reference to the jedi-core package.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">company-jedi</span>
<span style="font-weight: bold;">:after</span> python
<span style="font-weight: bold;">:commands</span> (jedi:goto-definition jedi-mode company-jedi)
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> python-mode-map
(<span style="font-style: italic;">"M-."</span> . jedi:goto-definition)
(<span style="font-style: italic;">"M-,"</span> . jedi:goto-definition-pop-marker))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> jedi:complete-on-dot t)
(<span style="font-weight: bold;">setq</span> jedi:imenu-create-index-function 'jedi:create-flat-imenu-index)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-10-24 16:41:42 -06:00
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org37d652f" class="outline-4">
<h4 id="org37d652f"><span class="section-number-4">12.1.2</span> go</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-1-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">go-mode</span>
<span style="font-weight: bold;">:mode</span> ((<span style="font-style: italic;">"\\.go\\'"</span> . go-mode))
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:glide-novendor</span> ()
(projectile-with-default-dir (projectile-project-root)
(shell-command-to-string <span style="font-style: italic;">"glide novendor"</span>)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:go-mode-create-imenu-index</span> ()
<span style="font-style: italic;">"Create and return an imenu index alist. Unlike the default</span>
<span style="font-style: italic;"> alist created by go-mode, this method creates an alist where</span>
<span style="font-style: italic;"> items follow a style that is consistent with other prog-modes."</span>
(<span style="font-weight: bold;">let*</span> ((patterns '((<span style="font-style: italic;">"type"</span> <span style="font-style: italic;">"^type *</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">(</span><span style="font-style: italic;">[</span><span style="font-style: italic;">^</span><span style="font-style: italic;"> \t\n\r\f]*</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">)</span><span style="font-style: italic;">"</span> 1)))
(type-index (imenu--generic-function patterns))
(func-index))
(<span style="font-weight: bold;">save-excursion</span>
(goto-char (point-min))
(<span style="font-weight: bold;">while</span> (re-search-forward go-func-meth-regexp (point-max) t)
(<span style="font-weight: bold;">let*</span> ((var (match-string-no-properties 1))
(func (match-string-no-properties 2))
(name (<span style="font-weight: bold;">if</span> var
(concat (substring var 0 -1) <span style="font-style: italic;">"."</span> func)
func))
(beg (match-beginning 0))
(marker (copy-marker beg))
(item (cons name marker)))
(<span style="font-weight: bold;">setq</span> func-index (cons item func-index)))))
(nconc type-index (list (cons <span style="font-style: italic;">"func"</span> func-index)))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:go-workspace-path</span> ()
(file-relative-name (projectile-project-root)
(concat (file-name-as-directory
(imalison:get-go-path)) <span style="font-style: italic;">"src"</span>)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:install-current-go-project</span> ()
(<span style="font-weight: bold;">interactive</span>)
(start-process
<span style="font-style: italic;">"go install"</span> <span style="font-style: italic;">"go install log"</span> <span style="font-style: italic;">"go"</span> <span style="font-style: italic;">"install"</span>
(concat (file-name-as-directory (imalison:go-workspace-path)) <span style="font-style: italic;">"..."</span>)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:get-go-path</span> ()
(<span style="font-weight: bold;">let</span> ((environment-go-path (getenv <span style="font-style: italic;">"GOPATH"</span>)))
(<span style="font-weight: bold;">if</span> environment-go-path
(file-name-as-directory (car (s-split <span style="font-style: italic;">":"</span> environment-go-path)))
<span style="font-style: italic;">"~/go"</span>)))
(<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">imalison:get-go-src</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> paths)
`(imalison:join-paths (imalison:get-go-path) <span style="font-style: italic;">"src"</span> ,@paths))
(<span style="font-weight: bold;">imalison:let-advise-around</span> imalison:advise-normal-go-command
(go-command <span style="font-style: italic;">"go"</span>))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:go-mode-hook</span> ()
(go-eldoc-setup)
(set (make-local-variable 'company-backends) '(company-go))
(make-local-variable 'projectile-globally-ignored-files)
(add-hook 'after-save-hook 'imalison:install-current-go-project nil
'yes-do-local)
(add-to-list 'projectile-globally-ignored-files
<span style="font-style: italic;">"vendor"</span>)))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">imalison:use-package*</span>
gotest <span style="font-style: italic;">"~/Projects/gotest.el"</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> go-mode-map
(<span style="font-style: italic;">"C-c t"</span> . imalison:gotest))
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">emit-prefix-selector</span> imalison:gotest
2016-10-19 19:13:32 -06:00
go-test-current-test
2016-11-07 12:57:02 -07:00
go-test-current-file)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:add-expected-test-name-for-suite</span> (suite-name test-name)
(<span style="font-weight: bold;">if</span> (&gt; (length suite-name) 0)
(concat <span style="font-style: italic;">" -run Test"</span> suite-name)
<span style="font-style: italic;">""</span>)))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> go-test-verbose t
2016-10-19 19:13:32 -06:00
go-test-additional-arguments-function
2016-11-07 12:57:02 -07:00
'imalison:add-expected-test-name-for-suite)))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">company-go</span>
<span style="font-weight: bold;">:config</span> (<span style="font-weight: bold;">setq</span> company-go-show-annotation t))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">go-projectile</span> <span style="font-weight: bold;">:demand</span> t)
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">go-eldoc</span> <span style="font-weight: bold;">:demand</span> t)
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">go-guru</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> go-mode-map
(<span style="font-style: italic;">"M-."</span> . go-guru-definition)
(<span style="font-style: italic;">"M-,"</span> . pop-tag-mark))
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:set-go-guru-scope</span> ()
(<span style="font-weight: bold;">setq</span> go-guru-scope (go-mode-parse-glide-novendor)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">go-mode-parse-glide-novendor</span> ()
(s-join <span style="font-style: italic;">","</span>
(<span style="font-weight: bold;">cl-loop</span> for path in (s-split <span style="font-style: italic;">"\n"</span> (imalison:glide-novendor))
collect (<span style="font-weight: bold;">if</span> (string-equal path <span style="font-style: italic;">"."</span>)
(imalison:go-workspace-path)
(s-replace <span style="font-style: italic;">"\./"</span> (imalison:go-workspace-path) path))))))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(advice-add 'go-guru--set-scope-if-empty <span style="font-weight: bold;">:before</span> 'imalison:set-go-guru-scope)
(advice-add 'go-guru-start <span style="font-weight: bold;">:before</span> 'imalison:set-go-guru-scope)
(advice-add 'go-guru-definition <span style="font-weight: bold;">:around</span> 'imalison:advise-normal-go-command)
(advice-add 'go-guru-definition <span style="font-weight: bold;">:before</span>
(<span style="font-weight: bold;">lambda</span> ()
(with-no-warnings
(ring-insert find-tag-marker-ring (point-marker)))))))
(advice-add 'go-import-add <span style="font-weight: bold;">:around</span> 'imalison:advise-normal-go-command)
(<span style="font-weight: bold;">setq</span> gofmt-command <span style="font-style: italic;">"goimports"</span>)
(add-hook 'go-mode-hook 'imalison:go-mode-hook)
(add-hook 'before-save-hook 'gofmt-before-save t)))
</pre>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4f8f737" class="outline-5">
<h5 id="org4f8f737"><span class="section-number-5">12.1.2.1</span> Show diffs of testify output</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-2-1">
2016-10-21 22:51:05 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:testify-ediff-buffers</span> nil)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:purge-ediff-buffers</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">cl-loop</span> for buffer in imalison:testify-ediff-buffers
do (kill-buffer buffer))
(<span style="font-weight: bold;">setq</span> imalison:testify-ediff-buffers nil))
(add-hook 'ediff-cleanup-hook 'imalison:purge-ediff-buffers)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:go-testify-show-ediff</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let</span> ((buffer (get-buffer-create <span style="font-style: italic;">"*Testify JSON*"</span>))
json-result)
(shell-command-on-region (point-min) (point-max) <span style="font-style: italic;">"parse_go_testify_for_emacs.py"</span> buffer)
(<span style="font-weight: bold;">with-current-buffer</span> buffer
(goto-char (point-min))
(<span style="font-weight: bold;">setq</span> json-result (json-read)))
(<span style="font-weight: bold;">let</span> ((actual-buffer (generate-new-buffer <span style="font-style: italic;">"*Testify Actual*"</span>))
(expected-buffer (generate-new-buffer <span style="font-style: italic;">"*Testify Expected*"</span>)))
(add-to-list 'imalison:testify-ediff-buffers actual-buffer)
(add-to-list 'imalison:testify-ediff-buffers expected-buffer)
(<span style="font-weight: bold;">with-current-buffer</span> actual-buffer
(insert (cdr (assoc 'actual json-result)))
(<span style="font-weight: bold;">with-current-buffer</span> expected-buffer
(insert (cdr (assoc 'expected json-result)))
(ediff-buffers actual-buffer expected-buffer))))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:go-testify-show-icdiff</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let</span> ((buffer (get-buffer-create <span style="font-style: italic;">"*Testify Comparison*"</span>)))
(shell-command-on-region (point-min) (point-max) <span style="font-style: italic;">"parse_go_testify_not_equal.py"</span> buffer)
(<span style="font-weight: bold;">with-current-buffer</span> buffer
(fundamental-ansi-mode))
(switch-to-buffer buffer)))
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb148ab2" class="outline-4">
<h4 id="orgb148ab2"><span class="section-number-4">12.1.3</span> emacs-lisp</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-1-3">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org01da19e" class="outline-5">
<h5 id="org01da19e"><span class="section-number-5">12.1.3.1</span> elisp-slime-nav</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-3-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">elisp-slime-nav</span>
<span style="font-weight: bold;">:commands</span> elisp-slime-nav-mode
<span style="font-weight: bold;">:config</span>
(diminish 'elisp-slime-nav-mode)
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">emit-prefix-selector</span> imalison:elisp-slime-nav
2016-10-19 19:13:32 -06:00
elisp-slime-nav-find-elisp-thing-at-point
2016-11-07 12:57:02 -07:00
elisp-slime-nav-describe-elisp-thing-at-point)
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> elisp-slime-nav-mode-map
(<span style="font-style: italic;">"M-."</span> . imalison:elisp-slime-nav)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org403b4b5" class="outline-5">
<h5 id="org403b4b5"><span class="section-number-5">12.1.3.2</span> macrostep</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-3-2">
2016-10-19 19:13:32 -06:00
<p>
Macrostep is an indespensible tool for writing emacs lisp macros. It lets you see pretty printed versions of the result of macro evaluation as the macro is evaluated
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">macrostep</span>
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> lisp-mode-shared-map
(<span style="font-style: italic;">"C-c e"</span> . macrostep-expand)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd568a42" class="outline-5">
<h5 id="orgd568a42"><span class="section-number-5">12.1.3.3</span> emr</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-3-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">emr</span>
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"M-RET"</span> . emr-show-refactor-menu)
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(add-hook 'prog-mode-hook 'emr-initialize)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb33db65" class="outline-5">
<h5 id="orgb33db65"><span class="section-number-5">12.1.3.4</span> Editing configuration</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-3-4">
2016-10-19 19:13:32 -06:00
<p>
Reduce indentation for some functions
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(put 'use-package 'lisp-indent-function 1)
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgfc5e1b6" class="outline-5">
<h5 id="orgfc5e1b6"><span class="section-number-5">12.1.3.5</span> Checkdoc</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-3-5">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> checkdoc-force-docstrings-flag nil
checkdoc-arguments-in-order-flag nil)
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org0794e92" class="outline-5">
<h5 id="org0794e92"><span class="section-number-5">12.1.3.6</span> edebug</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-3-6">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">edebug</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span> (<span style="font-weight: bold;">setq</span> edebug-trace t)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org33cb5be" class="outline-5">
<h5 id="org33cb5be"><span class="section-number-5">12.1.3.7</span> overseer</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-3-7">
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">overseer</span>)
2016-10-27 04:02:42 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org631c294" class="outline-5">
<h5 id="org631c294"><span class="section-number-5">12.1.3.8</span> Misc</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-3-8">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imenu-elisp-sections</span> ()
(<span style="font-weight: bold;">setq</span> imenu-prev-index-position-function nil)
(<span style="font-weight: bold;">setq</span> imenu-space-replacement nil)
(add-to-list 'imenu-generic-expression
`(<span style="font-style: italic;">"Package"</span>
,<span style="font-style: italic;">"(use-package </span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">(</span><span style="font-style: italic;">.+</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">)</span><span style="font-style: italic;">$"</span> 1))
(add-to-list 'imenu-generic-expression
`(<span style="font-style: italic;">"Section"</span>
,(concat <span style="font-style: italic;">";\\{1,4\\} =\\{10,80\\}\n;\\{1,4\\} \\{10,80\\}"</span>
<span style="font-style: italic;">"</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">(</span><span style="font-style: italic;">.+</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">)</span><span style="font-style: italic;">$"</span>) <span style="font-weight: bold;">1) t))</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:maybe-remove-flycheck-checkdoc-checker</span> ()
(<span style="font-weight: bold;">when</span> (s-starts-with? <span style="font-style: italic;">"*"</span> (buffer-name))
(flycheck-disable-checker 'emacs-lisp-checkdoc)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(add-hook 'emacs-lisp-mode-hook 'imenu-elisp-sections)
(add-hook 'emacs-lisp-mode-hook (<span style="font-weight: bold;">lambda</span> ()
(<span style="font-weight: bold;">setq</span> indent-tabs-mode nil)
(<span style="font-weight: bold;">setq</span> show-trailing-whitespace t)))
(add-hook 'flycheck-mode-hook 'imalison:maybe-remove-flycheck-checkdoc-checker)
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orge2cd40c" class="outline-5">
<h5 id="orge2cd40c"><span class="section-number-5">12.1.3.9</span> Show result of eval-last-sexp inline</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-3-9">
2016-10-19 19:13:32 -06:00
<p>
Taken from <a href="http://endlessparentheses.com/eval-result-overlays-in-emacs-lisp.html">http://endlessparentheses.com/eval-result-overlays-in-emacs-lisp.html</a>
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(autoload 'cider--make-result-overlay <span style="font-style: italic;">"cider-overlays"</span>)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:eval-overlay</span> (value point)
(cider--make-result-overlay (format <span style="font-style: italic;">"%S"</span> value)
<span style="font-weight: bold;">:where</span> point
<span style="font-weight: bold;">:duration</span> 'command)
value)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(advice-add 'eval-region <span style="font-weight: bold;">:around</span>
(<span style="font-weight: bold;">lambda</span> (f beg end <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> r)
(imalison:eval-overlay
(apply f beg end r)
end)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(advice-add 'eval-last-sexp <span style="font-weight: bold;">:filter-return</span>
(<span style="font-weight: bold;">lambda</span> (r)
(imalison:eval-overlay r (point))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(advice-add 'eval-defun <span style="font-weight: bold;">:filter-return</span>
(<span style="font-weight: bold;">lambda</span> (r)
(imalison:eval-overlay
2016-10-19 19:13:32 -06:00
r
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">save-excursion</span>
(end-of-defun)
(point)))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org5280c7e" class="outline-5">
<h5 id="org5280c7e"><span class="section-number-5">12.1.3.10</span> Reevalute defvars when running eval-last-sexp</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-3-10">
2016-11-02 19:05:02 -06:00
<p>
2016-11-02 19:23:03 -06:00
We noflet elisp&#x2013;preceding-sexp to munge defvars into sexps only for
eval-last-sexp.
2016-11-02 19:05:02 -06:00
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:maybe-setq-instead</span> (fn <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">noflet</span> ((elisp--preceding-sexp (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> preceding-args)
(<span style="font-weight: bold;">let*</span> ((preceding-sexp (apply this-fn preceding-args)))
(<span style="font-weight: bold;">if</span> (<span style="font-weight: bold;">and</span> (listp preceding-sexp) (equal (car preceding-sexp) 'defvar))
`(<span style="font-weight: bold;">setq</span> ,@(cdr preceding-sexp))
preceding-sexp))))
(apply fn args)))
2016-11-02 19:05:02 -06:00
2016-11-07 12:57:02 -07:00
(advice-add 'eval-last-sexp <span style="font-weight: bold;">:around</span> 'imalison:maybe-setq-instead)
2016-11-02 19:05:02 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orge44dfae" class="outline-5">
<h5 id="orge44dfae"><span class="section-number-5">12.1.3.11</span> Init hook</h5>
2016-11-02 19:05:02 -06:00
<div class="outline-text-5" id="text-12-1-3-11">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:check-parens</span> nil)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:maybe-check-parens</span> ()
(<span style="font-weight: bold;">if</span> imalison:check-parens
(check-parens)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:emacs-lisp-hook</span> ()
(elisp-slime-nav-mode t)
(add-hook 'write-file-functions 'imalison:maybe-check-parens nil t))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(add-hook 'emacs-lisp-mode-hook 'imalison:emacs-lisp-hook)
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgaff4c0b" class="outline-5">
<h5 id="orgaff4c0b"><span class="section-number-5">12.1.3.12</span> Keybinds</h5>
2016-11-02 19:05:02 -06:00
<div class="outline-text-5" id="text-12-1-3-12">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">emit-compose</span> imalison:copy-eval-last-sexp
kill-new prin1-to-string eval-last-sexp)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">emit-prefix-selector</span> imalison:eval-last-sexp
2016-10-19 19:13:32 -06:00
eval-region-or-last-sexp
2016-11-07 12:57:02 -07:00
imalison:copy-eval-last-sexp)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(define-key lisp-mode-shared-map (kbd <span style="font-style: italic;">"C-c C-c"</span>) 'eval-defun)
(define-key lisp-mode-shared-map (kbd <span style="font-style: italic;">"C-c o r"</span>) 'up-list-region)
(define-key lisp-mode-shared-map (kbd <span style="font-style: italic;">"C-c o o"</span>) 'up-list-back)
(define-key lisp-mode-shared-map (kbd <span style="font-style: italic;">"C-x C-e"</span>) 'imalison:eval-last-sexp)
(<span style="font-weight: bold;">unbind-key</span> <span style="font-style: italic;">"C-j"</span> lisp-interaction-mode-map)
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-10-24 16:41:42 -06:00
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org63714d6" class="outline-4">
<h4 id="org63714d6"><span class="section-number-4">12.1.4</span> clojure</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-1-4">
2016-10-19 19:13:32 -06:00
<p>
The following is taken from <a href="https://github.com/syl20bnr/spacemacs/blob/a650877bea582fed72bbca0dc1f80fcb2ec0e6d5/layers/+lang/clojure/funcs.el#L30">spacemacs</a>. It adds fancification to a clojure mode.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:clojure-fancify-symbols</span> (mode)
<span style="font-style: italic;">"Pretty symbols for Clojure's anonymous functions and sets,</span>
<span style="font-style: italic;"> like (&#955; [a] (+ a 5)), &#402;(+ % 5), and &#8712;{2 4 6}."</span>
(font-lock-add-keywords mode
`((<span style="font-style: italic;">"(</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">(</span><span style="font-style: italic;">fn</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">)</span><span style="font-style: italic;">[\n\[[:space:]]"</span>
(0 (<span style="font-weight: bold;">progn</span> (compose-region (match-beginning 1)
(match-end 1) <span style="font-style: italic;">"&#955;"</span>))))
(<span style="font-style: italic;">"(</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">(</span><span style="font-style: italic;">partial</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">)</span><span style="font-style: italic;">[\[[:space:]]"</span>
(0 (<span style="font-weight: bold;">progn</span> (compose-region (match-beginning 1)
(match-end 1) <span style="font-style: italic;">"&#420;"</span>))))
(<span style="font-style: italic;">"(</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">(</span><span style="font-style: italic;">comp</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">)</span><span style="font-style: italic;">[\n\[[:space:]]"</span>
(0 (<span style="font-weight: bold;">progn</span> (compose-region (match-beginning 1)
(match-end 1) <span style="font-style: italic;">"&#8728;"</span>))))
(<span style="font-style: italic;">"</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">(</span><span style="font-style: italic;">#</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">)</span><span style="font-style: italic;">("</span>
(0 (<span style="font-weight: bold;">progn</span> (compose-region (match-beginning 1)
(match-end 1) <span style="font-style: italic;">"&#402;"</span>))))
(<span style="font-style: italic;">"</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">(</span><span style="font-style: italic;">#</span><span style="font-weight: bold; font-style: italic;">\\</span><span style="font-weight: bold; font-style: italic;">)</span><span style="font-style: italic;">{"</span>
(0 (<span style="font-weight: bold;">progn</span> (compose-region (match-beginning 1)
(match-end 1) <span style="font-style: italic;">"&#8712;"</span>)))))))
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">clojure-mode</span>
<span style="font-weight: bold;">:commands</span> clojure-mode
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(add-to-list 'magic-mode-alist '(<span style="font-style: italic;">"#!.*boot\\s-*$"</span> . clojure-mode))
(add-to-list 'auto-mode-alist '(<span style="font-style: italic;">"\\.boot\\'"</span> . clojure-mode))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:clojure-mode-hook</span> ()
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(cljr-add-keybindings-with-prefix "C-c C-m")</span>
(clj-refactor-mode 1)
<span style="font-weight: bold; font-style: italic;">;;</span><span style="font-weight: bold; font-style: italic;">for adding require/use/import statements</span>
(yas-minor-mode 1))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:clojure-level-1-symobls</span>
'(describe <span style="font-weight: bold; font-style: italic;">it</span>)))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">cl-loop</span> for symbol in imalison:clojure-level-1-symobls
do (put-clojure-indent symbol 1))
(add-hook 'clojure-mode-hook 'imalison:clojure-mode-hook)
(<span style="font-weight: bold;">dolist</span> (m '(clojure-mode clojurescript-mode clojurec-mode clojurex-mode))
(imalison:clojure-fancify-symbols m))))
</pre>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org0001958" class="outline-5">
<h5 id="org0001958"><span class="section-number-5">12.1.4.1</span> cider</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-4-1">
2016-10-21 22:51:05 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">cider</span>
<span style="font-weight: bold;">:commands</span> (cider-jack-in)
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> cider-stacktrace-default-filters '(tooling dup)
2016-10-19 19:13:32 -06:00
cider-repl-pop-to-buffer-on-connect nil
cider-prompt-save-file-on-load nil
cider-repl-use-clojure-font-lock t
cider-prompt-for-symbol nil
2016-11-07 12:57:02 -07:00
cider-preferred-build-tool <span style="font-style: italic;">"boot"</span>)
(add-hook 'clojure-mode-hook 'cider-mode)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org0ec2665" class="outline-5">
<h5 id="org0ec2665"><span class="section-number-5">12.1.4.2</span> clj-refactor</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-4-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">clj-refactor</span>
<span style="font-weight: bold;">:commands</span> clj-refactor-mode)
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-10-24 16:41:42 -06:00
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org83ca539" class="outline-4">
<h4 id="org83ca539"><span class="section-number-4">12.1.5</span> scala</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-1-5">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">scala-mode</span>
<span style="font-weight: bold;">:mode</span> ((<span style="font-style: italic;">"\\.scala\\'"</span> . scala-mode)
(<span style="font-style: italic;">"\\.sc\\'"</span> . scala-mode))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">ensime</span>
<span style="font-weight: bold;">:pin</span> melpa-stable
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> ensime-mode-map
(<span style="font-style: italic;">"M-,"</span> . ensime-pop-find-definition-stack))
<span style="font-weight: bold;">:commands</span> ensime-mode
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> ensime-startup-snapshot-notification nil)))
(add-hook 'scala-mode-hook 'ensime-scala-mode-hook)
(<span style="font-weight: bold;">setq</span> scala-indent:align-parameters t)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb7fdf82" class="outline-4">
<h4 id="orgb7fdf82"><span class="section-number-4">12.1.6</span> js</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-1-6">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">tape-onlyify</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">save-excursion</span>
(move-end-of-line nil)
(re-search-backward <span style="font-style: italic;">"^test"</span>)
(forward-sexp)
(<span style="font-weight: bold;">if</span> (looking-at <span style="font-style: italic;">".only"</span>) (<span style="font-weight: bold;">progn</span> (zap-to-char 1 (string-to-char <span style="font-style: italic;">"("</span>)) (insert <span style="font-style: italic;">"("</span>))
(insert <span style="font-style: italic;">".only"</span>))))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">js2-mode</span>
<span style="font-weight: bold;">:commands</span> (js2-mode)
<span style="font-weight: bold;">:mode</span> <span style="font-style: italic;">"\\.js\\'"</span>
<span style="font-weight: bold;">:bind</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(("C-c b" . web-beautify-js)) TODO: to make this mode specific</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">and change binding</span>
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defvar-setq</span> imalison:identifier-count 0)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:console-log-unique</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let*</span> ((identifier-string (int-to-string imalison:identifier-count))
(uuid (imalison:uuid)))
(insert (format <span style="font-style: italic;">"console.log('%s//////////%s//////////');"</span> identifier-string uuid))
(<span style="font-weight: bold;">setq</span> imalison:identifier-count (+ imalison:identifier-count 1))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:js2-mode-hook</span> ()
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Sensible defaults</span>
(<span style="font-weight: bold;">setq</span> js2-bounce-indent-p nil
2016-10-19 19:13:32 -06:00
js2-indent-level 4
js2-basic-offset 4
js2-highlight-level 3
js2-include-node-externs t
js2-mode-show-parse-errors nil
js2-mode-show-strict-warnings nil
indent-tabs-mode nil
2016-11-07 12:57:02 -07:00
js2-indent-switch-body t)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(edconf-find-file-hook) ;; Make sure that editorconfig takes precedence</span>
(tern-mode t)
(<span style="font-weight: bold;">when</span> nil (skewer-mode)) <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">TODO: reenable</span>
(<span style="font-weight: bold;">setq</span> imenu-create-index-function
(<span style="font-weight: bold;">lambda</span> ()
(imalison:flatten-imenu-index
(js2-mode-create-imenu-index))))))
<span style="font-weight: bold;">:init</span>
(<span style="font-weight: bold;">progn</span>
(add-hook 'js2-mode-hook 'imalison:js2-mode-hook)
(add-hook 'js2-mode-hook 'js2-imenu-extras-mode)))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">js2-refactor</span>
<span style="font-weight: bold;">:after</span> js2-mode
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(js2r-add-keybindings-with-prefix <span style="font-style: italic;">"C-c C-m"</span>)
(add-hook 'js2-mode-hook #'js2-refactor-mode)))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">skewer-mode</span>
<span style="font-weight: bold;">:commands</span> skewer-mode
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(add-hook 'css-mode-hook #'skewer-css-mode)
(add-hook 'html-mode-hook #'skewer-html-mode)))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">tern</span>
<span style="font-weight: bold;">:commands</span> tern-mode
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">company-tern</span>
<span style="font-weight: bold;">:config</span> (add-to-list 'company-backends 'company-tern)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">delete-tern-process</span> ()
(<span style="font-weight: bold;">interactive</span>)
(delete-process <span style="font-style: italic;">"tern"</span>))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgab4305c" class="outline-4">
<h4 id="orgab4305c"><span class="section-number-4">12.1.7</span> rust</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-1-7">
2016-10-21 22:51:05 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">rust-mode</span>
<span style="font-weight: bold;">:mode</span> ((<span style="font-style: italic;">"\\.rs\\'"</span> . rust-mode))
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:rust-mode-hook</span> ()
(racer-mode 1)))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">flycheck-rust</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">racer</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> racer-cmd <span style="font-style: italic;">"~/.cargo/bin/racer"</span>)
(<span style="font-weight: bold;">setq</span> racer-rust-src-path <span style="font-style: italic;">"~/Projects/rust/src"</span>)))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">cargo</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(add-hook 'rust-mode-hook 'cargo-minor-mode)))
(add-hook 'rust-mode-hook 'imalison:rust-mode-hook)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org2af1ed3" class="outline-4">
<h4 id="org2af1ed3"><span class="section-number-4">12.1.8</span> haskell</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-1-8">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">haskell-mode</span>
<span style="font-weight: bold;">:commands</span> haskell-mode
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> haskell-mode-map
(<span style="font-style: italic;">"C-c h"</span> . haskell-hoogle))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> haskell-hoogle-command <span style="font-style: italic;">"hoogle"</span>)
(<span style="font-weight: bold;">setq</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Use notify.el (if you have it installed) at the end of running</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Cabal commands or generally things worth notifying.</span>
2016-10-25 15:20:13 -06:00
haskell-notify-p t
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Remove annoying error popups</span>
2016-10-25 15:20:13 -06:00
haskell-interactive-popup-errors nil
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Better import handling</span>
2016-10-25 15:20:13 -06:00
haskell-process-suggest-remove-import-lines t
haskell-process-auto-import-loaded-modules t
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Disable haskell-stylish-on-save, as it breaks flycheck highlighting.</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">NOTE: May not be true anymore - taksuyu 2015-10-06</span>
haskell-stylish-on-save nil)
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">flycheck</span>)
(delq 'haskell-stack-ghc flycheck-checkers)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
(<span style="font-weight: bold;">setq</span> haskell-tags-on-save t)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orge1148d4" class="outline-5">
<h5 id="orge1148d4"><span class="section-number-5">12.1.8.1</span> intero</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-8-1">
2016-10-19 19:13:32 -06:00
<p>
Intero seems to be causing hangs, so it has been disabled
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">intero</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:after</span> haskell-mode
<span style="font-weight: bold;">:config</span> (add-hook 'haskell-mode-hook 'intero-mode))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgff24eca" class="outline-5">
<h5 id="orgff24eca"><span class="section-number-5">12.1.8.2</span> hindent</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-8-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">hindent</span>
<span style="font-weight: bold;">:after</span> haskell-mode
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> hindent-style <span style="font-style: italic;">"chris-done"</span>)
(add-hook 'haskell-mode-hook 'hindent-mode)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb1ed759" class="outline-5">
<h5 id="orgb1ed759"><span class="section-number-5">12.1.8.3</span> ghc-mod</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-8-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">ghc</span>
<span style="font-weight: bold;">:after</span> haskell-mode
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> ghc-debug t)
(add-hook 'haskell-mode-hook 'ghc-init)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4ab15e4" class="outline-5">
<h5 id="org4ab15e4"><span class="section-number-5">12.1.8.4</span> company-ghc</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-1-8-4">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">company-ghc</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:config</span>
(add-to-list 'company-backends 'company-ghc))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-10-24 16:41:42 -06:00
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgafbed89" class="outline-4">
<h4 id="orgafbed89"><span class="section-number-4">12.1.9</span> C/C++</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-1-9">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">cc-mode</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:cc-mode-hook</span> ()
(<span style="font-weight: bold;">when</span> (derived-mode-p 'c-mode 'c++-mode 'java-mode 'asm-mode)
(ggtags-mode 1)))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">ggtags</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> ggtags-mode-map
(<span style="font-style: italic;">"C-c g s"</span> . ggtags-find-other-symbol)
(<span style="font-style: italic;">"C-c g h"</span> . ggtags-view-tag-history)
(<span style="font-style: italic;">"C-c g r"</span> . ggtags-find-reference)
(<span style="font-style: italic;">"C-c g f"</span> . ggtags-find-file)
(<span style="font-style: italic;">"C-c g c"</span> . ggtags-create-tags)
(<span style="font-style: italic;">"C-c g u"</span> . ggtags-update-tags)
(<span style="font-style: italic;">"M-,"</span> . pop-tag-mark)))
(add-hook 'c-mode-common-hook 'imalison:cc-mode-hook)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9de9eb9" class="outline-4">
<h4 id="org9de9eb9"><span class="section-number-4">12.1.10</span> C#</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-1-10">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">csharp-mode</span>
<span style="font-weight: bold;">:mode</span> <span style="font-style: italic;">"\\.cs\\'"</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org646a931" class="outline-4">
<h4 id="org646a931"><span class="section-number-4">12.1.11</span> racket</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-1-11">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">racket-mode</span>
<span style="font-weight: bold;">:mode</span> <span style="font-style: italic;">"\\.rkt\\'"</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org1fc22e4" class="outline-3">
<h3 id="org1fc22e4"><span class="section-number-3">12.2</span> Data/Config/Protocol</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-12-2">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org6342258" class="outline-4">
<h4 id="org6342258"><span class="section-number-4">12.2.1</span> thrift</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-2-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">thrift</span>
<span style="font-weight: bold;">:commands</span> thrift-mode
<span style="font-weight: bold;">:mode</span> ((<span style="font-style: italic;">"\\.thrift\\'"</span> . thrift-mode)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org57acb63" class="outline-4">
<h4 id="org57acb63"><span class="section-number-4">12.2.2</span> protobuf</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-2-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">protobuf-mode</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgcd3e232" class="outline-4">
<h4 id="orgcd3e232"><span class="section-number-4">12.2.3</span> json-mode</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-2-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">json-mode</span>
<span style="font-weight: bold;">:mode</span> <span style="font-style: italic;">"\\.json\\'"</span>
<span style="font-weight: bold;">:init</span>
(add-hook 'json-mode-hook
(<span style="font-weight: bold;">lambda</span> ()
(<span style="font-weight: bold;">setq</span> indent-tabs-mode nil)
(<span style="font-weight: bold;">setq</span> js-indent-level 4))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6824725" class="outline-4">
<h4 id="org6824725"><span class="section-number-4">12.2.4</span> yaml-mode</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-2-4">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">yaml-mode</span>
<span style="font-weight: bold;">:mode</span> ((<span style="font-style: italic;">"\\.yaml\\'"</span> . yaml-mode)
(<span style="font-style: italic;">"\\.yml\\'"</span> . yaml-mode)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org7fac312" class="outline-4">
<h4 id="org7fac312"><span class="section-number-4">12.2.5</span> es-mode</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-2-5">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">es-mode</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgfb8b17c" class="outline-3">
<h3 id="orgfb8b17c"><span class="section-number-3">12.3</span> Document</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-12-3">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org75eab54" class="outline-4">
<h4 id="org75eab54"><span class="section-number-4">12.3.1</span> org</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-3-1">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-orgedda48f" class="outline-5">
<h5 id="orgedda48f"><span class="section-number-5">12.3.1.1</span> config</h5>
2016-11-07 14:46:39 -07:00
<div class="outline-text-5" id="text-12-3-1-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">org</span>
<span style="font-weight: bold;">:ensure</span> org-plus-contrib
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">XXX: These should probably be moved to config, right?</span>
(<span style="font-weight: bold;">defvar-setq</span> org-startup-indented nil)
(<span style="font-weight: bold;">defvar-setq</span> org-startup-folded t)
(<span style="font-weight: bold;">defvar-setq</span> org-edit-src-content-indentation 0)
(<span style="font-weight: bold;">defvar-setq</span> org-src-preserve-indentation t)
(<span style="font-weight: bold;">defvar-setq</span> org-directory <span style="font-style: italic;">"~/Dropbox/org"</span>)
(<span style="font-weight: bold;">defvar-setq</span> org-mobile-inbox-for-pull <span style="font-style: italic;">"~/Dropbox/org/flagged.org"</span>)
(<span style="font-weight: bold;">defvar-setq</span> org-mobile-directory <span style="font-style: italic;">"~/Dropbox/Apps/MobileOrg"</span>)
(<span style="font-weight: bold;">setq</span> org-goto-interface 'outline-path-completion
2016-10-24 16:41:42 -06:00
org-goto-max-level 10
2016-11-07 12:57:02 -07:00
org-export-headline-levels 3)
(add-hook 'org-mode-hook 'imalison:disable-linum-mode)
(add-hook 'org-mode-hook (<span style="font-weight: bold;">lambda</span> () (<span style="font-weight: bold;">setq</span> org-todo-key-trigger t)))
(add-hook 'org-agenda-mode-hook 'imalison:disable-linum-mode)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">org-archive-if</span> (condition-function)
(<span style="font-weight: bold;">if</span> (funcall condition-function)
(<span style="font-weight: bold;">let</span> ((next-point-marker
(<span style="font-weight: bold;">save-excursion</span> (org-forward-heading-same-level 1) (point-marker))))
(org-archive-subtree)
(<span style="font-weight: bold;">setq</span> org-map-continue-from (marker-position next-point-marker)))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">org-archive-if-completed</span> ()
(<span style="font-weight: bold;">interactive</span>)
(org-archive-if 'org-entry-is-done-p))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">org-archive-completed-in-buffer</span> ()
(<span style="font-weight: bold;">interactive</span>)
(org-map-entries 'org-archive-if-completed))
(<span style="font-weight: bold;">cl-defun</span> <span style="font-weight: bold;">imalison:make-org-template</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;key</span> (content <span style="font-style: italic;">"%?"</span>))
(<span style="font-weight: bold;">with-temp-buffer</span>
(org-mode)
(insert content)
(org-set-property <span style="font-style: italic;">"CREATED"</span>
(<span style="font-weight: bold;">with-temp-buffer</span>
(org-insert-time-stamp
(org-current-effective-time) t t)))
(buffer-substring-no-properties (point-min) (point-max))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:make-org-template-from-file</span> (filename)
(imalison:make-org-template (imalison:get-string-from-file filename)))
(<span style="font-weight: bold;">cl-defun</span> <span style="font-weight: bold;">imalison:make-org-todo-template</span>
(<span style="font-weight: bold; text-decoration: underline;">&amp;key</span> (content <span style="font-style: italic;">"%?"</span>) (creation-state <span style="font-style: italic;">"TODO"</span>))
(<span style="font-weight: bold;">with-temp-buffer</span>
(org-mode)
(org-insert-heading)
(insert content)
(org-todo creation-state)
(org-set-property <span style="font-style: italic;">"CREATED"</span>
(<span style="font-weight: bold;">with-temp-buffer</span>
(org-insert-time-stamp
(org-current-effective-time) t t)))
(remove-hook 'post-command-hook 'org-add-log-note)
(<span style="font-weight: bold;">let</span> ((org-log-note-purpose 'state)
(org-log-note-return-to (point-marker))
(org-log-note-marker (<span style="font-weight: bold;">progn</span> (goto-char (org-log-beginning t))
(point-marker)))
(org-log-note-state creation-state))
(org-add-log-note))
(buffer-substring-no-properties (point-min) (point-max))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">org-todo-force-notes</span> ()
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let</span> ((org-todo-log-states
(mapcar (<span style="font-weight: bold;">lambda</span> (state)
(list state 'note 'time))
(apply 'append org-todo-sets))))
(<span style="font-weight: bold;">cond</span> ((eq major-mode 'org-mode) (org-todo))
((eq major-mode 'org-agenda-mode) (org-agenda-todo)))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">org-make-habit</span> ()
(<span style="font-weight: bold;">interactive</span>)
(org-set-property <span style="font-style: italic;">"STYLE"</span> <span style="font-style: italic;">"habit"</span>))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">org-insert-habit</span> ()
(<span style="font-weight: bold;">interactive</span>)
(org-insert-todo-heading nil)
(org-make-habit))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">org-todo-at-date</span> (date)
(<span style="font-weight: bold;">interactive</span> (list (org-time-string-to-time (org-read-date))))
(<span style="font-weight: bold;">cl-flet</span> ((org-current-effective-time (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> r) date)
(org-today (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> r) (time-to-days date)))
(<span style="font-weight: bold;">cond</span> ((eq major-mode 'org-mode) (org-todo))
((eq major-mode 'org-agenda-mode) (org-agenda-todo)))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:make-org-linked-todo-template</span> ()
(imalison:make-org-todo-template <span style="font-style: italic;">"%? %A"</span>))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">org-cmp-creation-times</span> (a b)
(<span style="font-weight: bold;">let</span> ((a-created (get-date-created-from-agenda-entry a))
(b-created (get-date-created-from-agenda-entry b)))
(imalison:compare-int-list a-created b-created)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">org-agenda-done</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> arg)
<span style="font-style: italic;">"Mark current TODO as done.</span>
<span style="font-style: italic;"> This changes the line at point, all other lines in the agenda referring to</span>
<span style="font-style: italic;"> the same tree node, and the headline of the tree node in the Org-mode file."</span>
(<span style="font-weight: bold;">interactive</span> <span style="font-style: italic;">"P"</span>)
(org-agenda-todo <span style="font-style: italic;">"DONE"</span>)))
<span style="font-weight: bold;">:commands</span> (org-mode org org-mobile-push org-mobile-pull org-agenda)
<span style="font-weight: bold;">:mode</span> (<span style="font-style: italic;">"\\.org\\'"</span> . org-mode)
<span style="font-weight: bold;">:bind</span> ((<span style="font-style: italic;">"C-c a"</span> . org-agenda)
(<span style="font-style: italic;">"C-c c"</span> . org-capture)
<span style="font-weight: bold;">:map</span> org-mode-map
(<span style="font-style: italic;">"C-c n t"</span> . org-insert-todo-heading)
(<span style="font-style: italic;">"C-c n s"</span> . org-insert-todo-subheading)
(<span style="font-style: italic;">"C-c n h"</span> . org-insert-habit)
(<span style="font-style: italic;">"C-c n m"</span> . org-make-habit)
(<span style="font-style: italic;">"C-c n l"</span> . org-store-link)
(<span style="font-style: italic;">"C-c n i"</span> . org-insert-link)
(<span style="font-style: italic;">"C-c C-t"</span> . org-todo)
(<span style="font-style: italic;">"C-c C-S-t"</span> . org-todo-force-notes)
(<span style="font-style: italic;">"M-."</span> . elisp-slime-nav-find-elisp-thing-at-point))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> org-global-properties
'(<span style="font-weight: bold;">quote</span> ((<span style="font-style: italic;">"Effort_ALL"</span> . <span style="font-style: italic;">"0:15 0:30 0:45 1:00 2:00 3:00 4:00 5:00 6:00 0:00"</span>)
(<span style="font-style: italic;">"STYLE_ALL"</span> . <span style="font-style: italic;">"habit"</span>))))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Record changes to todo states</span>
(<span style="font-weight: bold;">setq</span> org-todo-keywords
'((sequence <span style="font-style: italic;">"IDEA(i!)"</span> <span style="font-style: italic;">"RESEARCH(r!)"</span> <span style="font-style: italic;">"TODO(t!)"</span> <span style="font-style: italic;">"NEXT(n!)"</span>
<span style="font-style: italic;">"STARTED(s!)"</span> <span style="font-style: italic;">"WAIT(w!)"</span> <span style="font-style: italic;">"BACKLOG(b!)"</span> <span style="font-style: italic;">"|"</span>
<span style="font-style: italic;">"DONE(d!)"</span> <span style="font-style: italic;">"HANDLED(h!)"</span> <span style="font-style: italic;">"EXPIRED(e!)"</span> <span style="font-style: italic;">"CANCELED(c!)"</span>)))
(<span style="font-weight: bold;">defvar-setq</span> helm-org-headings-fontify t)
(<span style="font-weight: bold;">setq</span> org-todo-repeat-to-state <span style="font-style: italic;">"TODO"</span>)
(<span style="font-weight: bold;">setq</span> org-agenda-span 10)
(<span style="font-weight: bold;">setq</span> org-agenda-start-day <span style="font-style: italic;">"-2d"</span>)
(<span style="font-weight: bold;">setq</span> org-columns-default-format
<span style="font-style: italic;">"%80ITEM(Task) %10Effort(Effort){:} %10CLOCKSUM"</span>)
(add-to-list 'org-show-context-detail '(org-goto . lineage))
(sp-local-pair 'org-mode <span style="font-style: italic;">"~"</span> <span style="font-style: italic;">"~"</span>)
(add-to-list
'org-src-lang-modes '(<span style="font-style: italic;">"plantuml"</span> . plantuml))
(org-babel-do-load-languages
2016-10-19 19:13:32 -06:00
'org-babel-load-languages
2016-11-07 12:57:02 -07:00
'((sh . t)
(python . t)
(ruby . t)
(octave . t)
(sqlite . t)
(plantuml . t)))
(<span style="font-weight: bold;">setq</span> org-log-into-drawer t
2016-10-19 19:13:32 -06:00
org-log-reschedule t
org-log-redeadline t
2016-11-07 12:57:02 -07:00
org-treat-insert-todo-heading-as-state-change t)
(<span style="font-weight: bold;">when</span> nil
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Enable appointment notifications.</span>
(<span style="font-weight: bold;">defadvice</span> <span style="font-weight: bold;">org-agenda-to-appt</span> (before wickedcool activate)
<span style="font-style: italic;">"Clear the appt-time-msg-list."</span>
(<span style="font-weight: bold;">setq</span> appt-time-msg-list nil))
(appt-activate)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">org-agenda-to-appt-no-message</span> ()
(<span style="font-weight: bold;">shut-up</span> (org-agenda-to-appt)))
(run-at-time <span style="font-style: italic;">"00:00"</span> 60 'org-agenda-to-appt-no-message))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Override the key definition for org-exit</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">TODO why does this cause an error</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(define-key org-agenda-mode-map "x" #'org-agenda-done)</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">org-mode add-ons</span>
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">org-present</span>
<span style="font-weight: bold;">:commands</span> org-present)
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">org-pomodoro</span>
<span style="font-weight: bold;">:disabled</span> t)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">variable configuration</span>
(add-to-list 'org-modules 'org-habit)
(add-to-list 'org-modules 'org-expiry)
(add-to-list 'org-modules 'org-notify)
(<span style="font-weight: bold;">setq</span> org-src-fontify-natively t)
(<span style="font-weight: bold;">setq</span> org-habit-graph-column 50)
(<span style="font-weight: bold;">setq</span> org-habit-show-habits-only-for-today t)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">My priority system:</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">A - Absolutely MUST, at all costs, be completed by the provided</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">due date. TODO: implement some type of extreme nagging</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">system that alerts in an intrusive way for overdue A</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">priority tasks.</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">B - Should be given immediate attention if the due date is any</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">time in the next two days. Failure to meet due date would</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">be bad but not catastrophic.</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">C - The highest priority to which tasks for which failure to</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">complete on time would not have considerable significant</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">consequences. There is still significant reason to prefer</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">the completion of these tasks sooner rather than later.</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">D - Failure to complete within a few days (or ever) of any</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">deadline would be completely okay. As such, any deadline</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">present on such a task is necessarily self imposed. Still</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">probably worth doing</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">E - Potentially not even worth doing at all, but worth taking a</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">note about in case it comes up again, or becomes more</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">interesting later.</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">F - Almost certainly not worth attempting in the immediate future.</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Just brain dump.</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Priorities are somewhat contextual within each category. Things</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">in the gtd or work categories are generally regarded as much</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">more important than things with the same priority from the</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">dotfiles category.</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Items without deadlines or scheduled times of a given priority</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">can be regarded as less important than items that DO have</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">deadlines of that same priority.</span>
(<span style="font-weight: bold;">setq</span> org-lowest-priority 69) <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">The character E</span>
(<span style="font-weight: bold;">setq</span> org-completion-use-ido t)
(<span style="font-weight: bold;">setq</span> org-enforce-todo-dependencies t)
(<span style="font-weight: bold;">setq</span> org-deadline-warning-days 0)
(<span style="font-weight: bold;">setq</span> org-default-priority ?D)
(<span style="font-weight: bold;">setq</span> org-agenda-skip-scheduled-if-done t)
(<span style="font-weight: bold;">setq</span> org-agenda-skip-deadline-if-done t)
<span style="font-weight: bold; font-style: italic;">;;</span><span style="font-weight: bold; font-style: italic;">(add-to-list org-agenda-tag-filter-preset "+PRIORITY&lt;\"C\"")</span>
(<span style="font-weight: bold;">setq</span> org-imenu-depth 10)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Stop starting agenda from deleting frame setup!</span>
(<span style="font-weight: bold;">setq</span> org-agenda-window-setup 'other-window)
(define-key mode-specific-map [?a] 'org-agenda)
(<span style="font-weight: bold;">unbind-key</span> <span style="font-style: italic;">"C-j"</span> org-mode-map)
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">org-bullets</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(add-hook 'org-mode-hook (<span style="font-weight: bold;">lambda</span> () (org-bullets-mode 1)))))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">org-ehtml</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> org-ehtml-docroot (expand-file-name <span style="font-style: italic;">"~/Dropbox/org"</span>))
(<span style="font-weight: bold;">setq</span> org-ehtml-allow-agenda t)
(<span style="font-weight: bold;">setq</span> org-ehtml-editable-headlines t)
(<span style="font-weight: bold;">setq</span> org-ehtml-everything-editable t)))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Agenda setup.</span>
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:org-gtd-file</span> <span style="font-style: italic;">"~/org/gtd.org"</span>)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:org-habits-file</span> <span style="font-style: italic;">"~/org/habits.org"</span>)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:org-calendar-file</span> <span style="font-style: italic;">"~/org/calendar.org"</span>)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:org-inbox-file</span> <span style="font-style: italic;">"~/org/inbox.org"</span>)
(<span style="font-weight: bold;">unless</span> (boundp 'org-capture-templates)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">org-capture-templates</span> nil))
(imalison:add-to-org-agenda-files
(list imalison:org-gtd-file imalison:org-habits-file
imalison:org-calendar-file imalison:org-inbox-file))
(add-to-list 'org-capture-templates
`(<span style="font-style: italic;">"t"</span> <span style="font-style: italic;">"GTD Todo (Linked)"</span> entry (file ,imalison:org-gtd-file)
(<span style="font-weight: bold;">function</span> imalison:make-org-linked-todo-template)))
(add-to-list 'org-capture-templates
`(<span style="font-style: italic;">"g"</span> <span style="font-style: italic;">"GTD Todo"</span> entry (file ,imalison:org-gtd-file)
(<span style="font-weight: bold;">function</span> imalison:make-org-todo-template)))
(add-to-list 'org-capture-templates
`(<span style="font-style: italic;">"y"</span> <span style="font-style: italic;">"Calendar entry (Linked)"</span> entry
(file ,imalison:org-calendar-file)
<span style="font-style: italic;">"* %? %A</span>
<span style="font-style: italic;"> :PROPERTIES:</span>
<span style="font-style: italic;"> :CREATED: %U</span>
<span style="font-style: italic;"> :END:</span>
<span style="font-style: italic;">%^T"</span>))
(add-to-list 'org-capture-templates
`(<span style="font-style: italic;">"c"</span> <span style="font-style: italic;">"Calendar entry"</span> entry
(file ,imalison:org-calendar-file)
<span style="font-style: italic;">"* %?</span>
<span style="font-style: italic;"> :PROPERTIES:</span>
<span style="font-style: italic;"> :CREATED: %U</span>
<span style="font-style: italic;"> :END:</span>
<span style="font-style: italic;">%^T"</span>))
(add-to-list 'org-capture-templates
`(<span style="font-style: italic;">"h"</span> <span style="font-style: italic;">"Habit"</span> entry (file ,imalison:org-habits-file)
<span style="font-style: italic;">"* TODO</span>
<span style="font-style: italic;"> SCHEDULED: %^t</span>
<span style="font-style: italic;"> :PROPERTIES:</span>
<span style="font-style: italic;"> :CREATED: %U</span>
<span style="font-style: italic;"> :STYLE: habit</span>
<span style="font-style: italic;"> :END:"</span>))
(<span style="font-weight: bold;">let</span> ((this-week-high-priority
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">The &lt; in the following line works has behavior that is opposite</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">to what one might expect.</span>
'(tags-todo <span style="font-style: italic;">"+PRIORITY&lt;\"C\"+DEADLINE&lt;\"&lt;+1w&gt;\"DEADLINE&gt;\"&lt;+0d&gt;\""</span>
((org-agenda-overriding-header
<span style="font-style: italic;">"Upcoming high priority tasks:"</span>))))
(due-today '(tags-todo
<span style="font-style: italic;">"+DEADLINE=&lt;\"&lt;+0d&gt;\""</span>
((org-agenda-overriding-header
<span style="font-style: italic;">"Due today:"</span>))))
(recently-created '(tags-todo
<span style="font-style: italic;">"+CREATED=&gt;\"&lt;-3d&gt;\""</span>
((org-agenda-overriding-header <span style="font-style: italic;">"Recently created:"</span>)
(org-agenda-cmp-user-defined 'org-cmp-creation-times)
(org-agenda-sorting-strategy '(user-defined-down)))))
(next '(todo <span style="font-style: italic;">"NEXT"</span>))
(started '(todo <span style="font-style: italic;">"STARTED"</span>))
(missing-deadline
'(tags-todo <span style="font-style: italic;">"-DEADLINE={.}/!"</span>
((org-agenda-overriding-header
<span style="font-style: italic;">"These don't have deadlines:"</span>))))
(missing-priority
'(tags-todo <span style="font-style: italic;">"-PRIORITY={.}/!"</span>
((org-agenda-overriding-header
<span style="font-style: italic;">"These don't have priorities:"</span>)))))
(<span style="font-weight: bold;">setq</span> org-agenda-custom-commands
`((<span style="font-style: italic;">"M"</span> <span style="font-style: italic;">"Main agenda view"</span>
((agenda <span style="font-style: italic;">""</span>
((org-agenda-overriding-header <span style="font-style: italic;">"Agenda:"</span>)
(org-agenda-ndays 5)
(org-deadline-warning-days 0)))
2016-10-19 19:13:32 -06:00
,due-today
,next
,started
,this-week-high-priority
2016-11-07 12:57:02 -07:00
,recently-created)
nil nil)
,(cons <span style="font-style: italic;">"A"</span> (cons <span style="font-style: italic;">"High priority upcoming"</span> this-week-high-priority))
,(cons <span style="font-style: italic;">"d"</span> (cons <span style="font-style: italic;">"Overdue tasks and due today"</span> due-today))
,(cons <span style="font-style: italic;">"r"</span> (cons <span style="font-style: italic;">"Recently created"</span> recently-created))
(<span style="font-style: italic;">"h"</span> <span style="font-style: italic;">"A, B priority:"</span> tags-todo <span style="font-style: italic;">"+PRIORITY&lt;\"C\""</span>
((org-agenda-overriding-header
<span style="font-style: italic;">"High Priority:"</span>)))
(<span style="font-style: italic;">"c"</span> <span style="font-style: italic;">"At least priority C:"</span> tags-todo <span style="font-style: italic;">"+PRIORITY&lt;\"D\""</span>
((org-agenda-overriding-header
<span style="font-style: italic;">"At least priority C:"</span>))))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">What follows is a description of the significance of each of</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">the values available in `</span><span style="font-weight: bold; font-style: italic; text-decoration: underline;">org-todo-keywords</span><span style="font-weight: bold; font-style: italic;">'. All headings with</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">one of these keywords deal with the concept of the completion</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">of some task or collection of tasks to bring about a particular</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">state of affairs. In some cases, the actual tasks involved may</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">not be known at the time of task creation.</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Incomplete States:</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">IDEA - This TODO exists in only the most abstract sense: it is</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">an imagined state of affairs that requires tasks that are</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">either not yet known, or have not thoroughly been considered.</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">RESEARCH - This TODO needs to be investigated further before</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">action can be taken to achieve the desired outcome. It is not</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">known how much time and effort will be consumed in the actual</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">completion of the task.</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">TODO - The scope and work involved in this TODO are well</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">understood, but for some reason or another, it is not something</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">that should be attempted in the immediate future. Typically</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">this is because the task is not considered a top priority, but</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">it may also be for some other reason.</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">NEXT - This TODO is immediately actionable and should be</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">started in the immediate future.</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">STARTED - Work on this TODO has already started, further work</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">is immediately actionable.</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">WAIT - The work involved in this TODO is well understood, but</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">it is blocked for the time being.</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">BACKLOG - While technically actionable, this task is not only</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">not worth pursuing in the immediate future, but the foreseable</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">future. It exists as a task mostly as a note/reminder, in case</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">it becomes higher priority in the future.</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Complete States:</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">DONE - This TODO has been completed exactly as imagined.</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">HANDLED - This TODO was completed in spirit, though not by the</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">means that were originally imagined/outlined in the TODO.</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">EXPIRED - The owner of this TODO failed to take action on it</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">within the appropriate time period, and there is now no point in</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">attempting it.</span>
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">CANCELED - For whatever reason, this TODO should no longer be</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">attempted. This TODO is typically used in contrast to the</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">EXPIRED TODO to indicate that the owner is not necessarily to</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">blame.</span>
))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
2016-11-07 14:46:39 -07:00
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd778f6b" class="outline-5">
<h5 id="orgd778f6b"><span class="section-number-5">12.3.1.2</span> Use frames</h5>
2016-11-07 14:46:39 -07:00
<div class="outline-text-5" id="text-12-3-1-2">
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">org</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> org-src-window-setup 'current-window)
(<span style="font-weight: bold;">when</span> (imalison:use-frames-only)
(<span style="font-weight: bold;">progn</span>
(setcdr (assoc 'file org-link-frame-setup) 'find-file-other-frame)))))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org23e81de" class="outline-5">
<h5 id="org23e81de"><span class="section-number-5">12.3.1.3</span> Set Background Color of Source Blocks for Export</h5>
2016-11-07 14:46:39 -07:00
<div class="outline-text-5" id="text-12-3-1-3">
2016-10-25 15:21:45 -06:00
<p>
This was taken from <a href="http://emacs.stackexchange.com/questions/3374/set-the-background-of-org-exported-code-blocks-according-to-theme">here</a>.
</p>
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">org</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:org-inline-css-hook</span> (exporter)
<span style="font-style: italic;">"Insert custom inline css to automatically set the</span>
<span style="font-style: italic;">background of code to whatever theme I'm using's background"</span>
(<span style="font-weight: bold;">when</span> (eq exporter 'html)
(<span style="font-weight: bold;">let*</span> ((my-pre-bg (face-background 'default))
(my-pre-fg (face-foreground 'default)))
(<span style="font-weight: bold;">setq</span>
2016-10-19 19:13:32 -06:00
org-html-head-extra
2016-11-07 12:57:02 -07:00
(concat
2016-10-19 19:13:32 -06:00
org-html-head-extra
2016-11-07 12:57:02 -07:00
(format <span style="font-style: italic;">"&lt;style type=\"text/css\"&gt;\n pre.src {background-color: %s; color: %s;}&lt;/style&gt;\n"</span>
my-pre-bg my-pre-fg))))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(add-hook 'org-export-before-processing-hook 'imalison:org-inline-css-hook)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9d75c53" class="outline-5">
<h5 id="org9d75c53"><span class="section-number-5">12.3.1.4</span> Use my own default naming scheme for org-headings</h5>
2016-11-07 14:46:39 -07:00
<div class="outline-text-5" id="text-12-3-1-4">
2016-10-24 16:41:42 -06:00
<p>
First we define a function that will generate a sanitized version of the heading
as its link target.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:org-get-raw-value</span> (item)
(<span style="font-weight: bold;">when</span> (listp item)
(<span style="font-weight: bold;">let*</span> ((property-list (cadr item)))
(<span style="font-weight: bold;">when</span> property-list (plist-get property-list <span style="font-weight: bold;">:raw-value</span>)))))
2016-10-24 16:41:42 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:sanitize-name</span> (name)
(replace-regexp-in-string <span style="font-style: italic;">"[</span><span style="font-style: italic;">^</span><span style="font-style: italic;">[:alpha:]]"</span> <span style="font-style: italic;">""</span> (s-downcase name)))
2016-10-24 16:41:42 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:generate-name</span> (datum cache)
(<span style="font-weight: bold;">let</span> ((raw-value (imalison:org-get-raw-value datum)))
(<span style="font-weight: bold;">if</span> raw-value
(imalison:sanitize-name raw-value)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">This is the default implementation from org</span>
(<span style="font-weight: bold;">let</span> ((type (org-element-type datum)))
(format <span style="font-style: italic;">"org%s%d"</span>
(<span style="font-weight: bold;">if</span> type
(replace-regexp-in-string <span style="font-style: italic;">"-"</span> <span style="font-style: italic;">""</span> (symbol-name type))
<span style="font-style: italic;">"secondarystring"</span>)
(<span style="font-weight: bold;">incf</span> (gethash type cache 0)))))))
2016-10-24 16:41:42 -06:00
</pre>
</div>
<p>
This function replaces the default naming scheme with a call to
<code>imalison:generate-name</code>, and uses a slightly different uniquify approach.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">ox</span>
<span style="font-weight: bold;">:ensure</span> nil
2016-11-07 13:11:09 -07:00
<span style="font-weight: bold;">:demand</span> t
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">org-export-get-reference</span> (datum info)
<span style="font-style: italic;">"Return a unique reference for DATUM, as a string.</span>
<span style="font-style: italic;">DATUM is either an element or an object. INFO is the current</span>
<span style="font-style: italic;">export state, as a plist. Returned reference consists of</span>
<span style="font-style: italic;">alphanumeric characters only."</span>
(<span style="font-weight: bold;">let</span> ((type (org-element-type datum))
(cache (<span style="font-weight: bold;">or</span> (plist-get info <span style="font-weight: bold;">:internal-references</span>)
(<span style="font-weight: bold;">let</span> ((h (make-hash-table <span style="font-weight: bold;">:test</span> #'eq)))
(plist-put info <span style="font-weight: bold;">:internal-references</span> h)
h)))
(reverse-cache (<span style="font-weight: bold;">or</span> (plist-get info <span style="font-weight: bold;">:taken-internal-references</span>)
(<span style="font-weight: bold;">let</span> ((h (make-hash-table <span style="font-weight: bold;">:test</span> 'equal)))
(plist-put info <span style="font-weight: bold;">:taken-internal-references</span> h)
h))))
(<span style="font-weight: bold;">or</span> (gethash datum cache)
(<span style="font-weight: bold;">let*</span> ((name (imalison:generate-name datum cache))
(number (+ 1 (gethash name reverse-cache -1)))
(new-name (format <span style="font-style: italic;">"%s%s"</span> name (<span style="font-weight: bold;">if</span> (&lt; 0 number) number <span style="font-style: italic;">""</span>))))
(puthash name number reverse-cache)
(puthash datum new-name cache)
new-name)))))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org12da2be" class="outline-5">
<h5 id="org12da2be"><span class="section-number-5">12.3.1.5</span> org-projectile</h5>
2016-11-07 14:46:39 -07:00
<div class="outline-text-5" id="text-12-3-1-5">
2016-10-21 22:51:05 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:use-package</span> org-projectile
<span style="font-weight: bold;">:after</span> helm
<span style="font-weight: bold;">:bind</span> ((<span style="font-style: italic;">"C-c n p"</span> . imalison:helm-org-todo))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
2016-11-07 13:04:02 -07:00
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">org-projectile-helm</span>)
(org-projectile-prompt)
2016-11-07 12:57:02 -07:00
(add-to-list 'org-capture-templates
2016-11-07 13:04:02 -07:00
(org-projectile-project-todo-entry
2016-11-07 12:57:02 -07:00
<span style="font-style: italic;">"l"</span> <span style="font-style: italic;">"* TODO %? %a\n"</span> <span style="font-style: italic;">"Linked Project TODO"</span>))
2016-11-07 13:04:02 -07:00
(add-to-list 'org-capture-templates (org-projectile-project-todo-entry <span style="font-style: italic;">"p"</span>))
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">setq</span> org-confirm-elisp-link-function nil)
2016-11-07 13:04:02 -07:00
(imalison:add-to-org-agenda-files (org-projectile-todo-files))
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">helm-source</span>)
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">helm-org</span>)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:helm-org-todo</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> arg)
(<span style="font-weight: bold;">interactive</span> <span style="font-style: italic;">"P"</span>)
(helm <span style="font-weight: bold;">:sources</span> (list (helm-source-org-capture-templates)
2016-11-07 13:04:02 -07:00
(org-projectile-helm-source
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">if</span> arg (imalison:make-org-linked-todo-template)
(imalison:make-org-todo-template))))
<span style="font-weight: bold;">:candidate-number-limit</span> 99999
<span style="font-weight: bold;">:buffer</span> <span style="font-style: italic;">"*helm org capture templates*"</span>))))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgc5f339f" class="outline-5">
<h5 id="orgc5f339f"><span class="section-number-5">12.3.1.6</span> org-notify</h5>
2016-11-07 14:46:39 -07:00
<div class="outline-text-5" id="text-12-3-1-6">
2016-10-21 22:51:05 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">org-notify</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:after</span> org
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:org-notify-notification-handler</span> (plist)
(sauron-add-event 'org-notify 4 (format <span style="font-style: italic;">"%s, %s.\n"</span> (plist-get plist <span style="font-weight: bold;">:heading</span>)
(org-notify-body-text plist))))
(<span style="font-weight: bold;">setq</span> org-show-notification-handler 'imalison:org-notify-notification-handler)
(org-notify-add 'default '(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"1h"</span> <span style="font-weight: bold;">:actions</span> imalison:org-notify-notification-handler
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"2m"</span> <span style="font-weight: bold;">:duration</span> 60))
(org-notify-add 'default '(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"100m"</span> <span style="font-weight: bold;">:actions</span> imalison:org-notify-notification-handler
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"2m"</span> <span style="font-weight: bold;">:duration</span> 60))
(org-notify-add 'urgent-second '(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"3m"</span> <span style="font-weight: bold;">:actions</span> (-notify/window -ding)
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"15s"</span> <span style="font-weight: bold;">:duration</span> 10))
(org-notify-add 'minute '(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"5m"</span> <span style="font-weight: bold;">:actions</span> -notify/window
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"100s"</span> <span style="font-weight: bold;">:duration</span> 70))
(org-notify-add '12hours
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"3m"</span> <span style="font-weight: bold;">:actions</span> (-notify/window -ding)
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"15s"</span> <span style="font-weight: bold;">:duration</span> 10)
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"100m"</span> <span style="font-weight: bold;">:actions</span> -notify/window
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"2m"</span> <span style="font-weight: bold;">:duration</span> 60)
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"12h"</span> <span style="font-weight: bold;">:actions</span> -notify/window <span style="font-weight: bold;">:audible</span> nil
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"10m"</span> <span style="font-weight: bold;">:duration</span> 200))
(org-notify-add '5days
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"100m"</span> <span style="font-weight: bold;">:actions</span> -notify/window
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"2m"</span> <span style="font-weight: bold;">:duration</span> 60)
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"2d"</span> <span style="font-weight: bold;">:actions</span> -notify/window
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"15m"</span> <span style="font-weight: bold;">:duration</span> 100)
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"5d"</span> <span style="font-weight: bold;">:actions</span> -notify/window
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"2h"</span> <span style="font-weight: bold;">:duration</span> 200))
(org-notify-add 'long-20days
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"2d"</span> <span style="font-weight: bold;">:actions</span> -notify/window
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"15m"</span> <span style="font-weight: bold;">:duration</span> 60)
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"5d"</span> <span style="font-weight: bold;">:actions</span> -notify/window
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"2h"</span> <span style="font-weight: bold;">:duration</span> 60)
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"20d"</span> <span style="font-weight: bold;">:actions</span> -email <span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"2d"</span> <span style="font-weight: bold;">:audible</span> nil))
(org-notify-add 'long-50days
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"4d"</span> <span style="font-weight: bold;">:actions</span> -notify/window
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"30m"</span> <span style="font-weight: bold;">:duration</span> 100)
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"10d"</span> <span style="font-weight: bold;">:actions</span> -notify/window
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"4h"</span> <span style="font-weight: bold;">:duration</span> 200)
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"50d"</span> <span style="font-weight: bold;">:actions</span> -email <span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"3d"</span> <span style="font-weight: bold;">:audible</span> nil))
(org-notify-add 'long-100days
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"2d"</span> <span style="font-weight: bold;">:actions</span> -notify/window
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"1h"</span> <span style="font-weight: bold;">:duration</span> 200)
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"10d"</span> <span style="font-weight: bold;">:actions</span> -notify/window
<span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"10h"</span> <span style="font-weight: bold;">:duration</span> 300)
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"50d"</span> <span style="font-weight: bold;">:actions</span> -email <span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"3d"</span> <span style="font-weight: bold;">:audible</span> nil)
'(<span style="font-weight: bold;">:time</span> <span style="font-style: italic;">"100d"</span> <span style="font-weight: bold;">:actions</span> -email <span style="font-weight: bold;">:period</span> <span style="font-style: italic;">"5d"</span> <span style="font-weight: bold;">:audible</span> nil))
(org-notify-start 10)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org59cafd0" class="outline-5">
<h5 id="org59cafd0"><span class="section-number-5">12.3.1.7</span> org-reveal</h5>
2016-11-07 14:46:39 -07:00
<div class="outline-text-5" id="text-12-3-1-7">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">ox-reveal</span>
<span style="font-weight: bold;">:after</span> org
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">setq</span> org-reveal-root
(imalison:join-paths <span style="font-style: italic;">"file://"</span> imalison:projects-directory <span style="font-style: italic;">"reveal.js"</span>)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org0f33b1d" class="outline-5">
<h5 id="org0f33b1d"><span class="section-number-5">12.3.1.8</span> org-caldav</h5>
2016-11-07 14:46:39 -07:00
<div class="outline-text-5" id="text-12-3-1-8">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">org-caldav</span>
<span style="font-weight: bold;">:defer</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> org-caldav-url <span style="font-style: italic;">"https://www.google.com/calendar/dav"</span>
2016-10-19 19:13:32 -06:00
org-caldav-inbox imalison:org-inbox-file
2016-11-07 12:57:02 -07:00
org-caldav-files (list imalison:org-calendar-file)
org-icalendar-timezone <span style="font-style: italic;">"America/Los_Angeles"</span>)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-10-24 16:41:42 -06:00
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgcea2fdc" class="outline-4">
<h4 id="orgcea2fdc"><span class="section-number-4">12.3.2</span> TeX</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-3-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">tex</span>
<span style="font-weight: bold;">:ensure</span> auctex
<span style="font-weight: bold;">:commands</span> TeX-mode
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:TeX-mode-hook</span> ()
(turn-on-reftex)
(TeX-source-correlate-mode +1)
(TeX-PDF-mode +1)))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">unbind-key</span> <span style="font-style: italic;">"C-j"</span> TeX-mode-map)
(TeX-global-PDF-mode)
(<span style="font-weight: bold;">setq</span> TeX-auto-save t
2016-10-19 19:13:32 -06:00
TeX-parse-self t
TeX-save-query nil
2016-11-07 12:57:02 -07:00
TeX-PDF-mode t)
(TeX-global-PDF-mode t)
(add-hook 'TeX-mode-hook 'imalison:TeX-mode-hook)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org1d2e3d9" class="outline-5">
<h5 id="org1d2e3d9"><span class="section-number-5">12.3.2.1</span> latex</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-3-2-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">latex</span>
<span style="font-weight: bold;">:ensure</span> auctex
<span style="font-weight: bold;">:after</span> tex
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">unbind-key</span> <span style="font-style: italic;">"C-j"</span> LaTeX-mode-map)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org44ed89d" class="outline-5">
<h5 id="org44ed89d"><span class="section-number-5">12.3.2.2</span> auctex-latexmk</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-3-2-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">auctex-latexmk</span>
<span style="font-weight: bold;">:after</span> tex
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> auctex-latexmk-inherit-TeX-PDF-mode t)
(auctex-latexmk-setup)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org54a3fbe" class="outline-5">
<h5 id="org54a3fbe"><span class="section-number-5">12.3.2.3</span> company-auctex</h5>
2016-10-27 04:02:42 -06:00
<div class="outline-text-5" id="text-12-3-2-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">company-auctex</span>
<span style="font-weight: bold;">:after</span> tex
<span style="font-weight: bold;">:config</span>
(company-auctex-init))
2016-10-19 19:13:32 -06:00
</pre>
</div>
2016-10-27 04:02:42 -06:00
</div>
</div>
2016-10-24 16:41:42 -06:00
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org27a30b9" class="outline-4">
<h4 id="org27a30b9"><span class="section-number-4">12.3.3</span> markdown-mode</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-3-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">markdown-mode</span>
<span style="font-weight: bold;">:init</span>
(<span style="font-weight: bold;">progn</span>
(add-hook 'markdown-mode-hook 'imalison:disable-linum-mode)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgbf12f9c" class="outline-4">
<h4 id="orgbf12f9c"><span class="section-number-4">12.3.4</span> plantuml-mode</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-3-4">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">plantuml-mode</span>
<span style="font-weight: bold;">:commands</span> plantuml-mode
<span style="font-weight: bold;">:mode</span> (<span style="font-style: italic;">"\\.puml\\'"</span> <span style="font-style: italic;">"\\.plantuml\\'"</span>)
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">cond</span> ((equal system-type 'darwin)
(<span style="font-weight: bold;">let*</span> ((plantuml-dir
(s-trim (shell-command-to-string <span style="font-style: italic;">"brew --prefix plantuml"</span>)))
(filename
(<span style="font-weight: bold;">when</span> (file-exists-p plantuml-dir)
(<span style="font-weight: bold;">--first</span> (s-ends-with? <span style="font-style: italic;">".jar"</span> <span style="font-weight: bold; font-style: italic;">it</span>) (directory-files plantuml-dir))))
(filepath (<span style="font-weight: bold;">when</span> filename
(imalison:join-paths plantuml-dir filename))))
(<span style="font-weight: bold;">setq</span> plantuml-jar-path filepath
org-plantuml-jar-path filepath)))
((equal system-type 'gnu/linux)
(<span style="font-weight: bold;">let</span> ((filepath <span style="font-style: italic;">"/opt/plantuml/plantuml.jar"</span>))
(<span style="font-weight: bold;">setq</span> plantuml-jar-path filepath
org-plantuml-jar-path filepath))))
(add-to-list
'org-src-lang-modes '(<span style="font-style: italic;">"plantuml"</span> . plantuml))))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org06ebc26" class="outline-4">
<h4 id="org06ebc26"><span class="section-number-4">12.3.5</span> wsd-mode</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-3-5">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">wsd-mode</span>
<span style="font-weight: bold;">:commands</span> (wsd-mode))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4e72f3b" class="outline-3">
<h3 id="org4e72f3b"><span class="section-number-3">12.4</span> Utility</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-12-4">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org9fb0ed7" class="outline-4">
<h4 id="org9fb0ed7"><span class="section-number-4">12.4.1</span> restclient</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-4-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">restclient</span>
<span style="font-weight: bold;">:mode</span> ((<span style="font-style: italic;">"\\.restclient\\'"</span> . restclient-mode))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">company-restclient</span>)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orga69cfb5" class="outline-4">
<h4 id="orga69cfb5"><span class="section-number-4">12.4.2</span> jq-mode</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-12-4-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">jq-mode</span>
<span style="font-weight: bold;">:mode</span> <span style="font-style: italic;">"\\.jq\\'"</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6850bc7" class="outline-2">
<h2 id="org6850bc7"><span class="section-number-2">13</span> Programming</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-13">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org22fca9c" class="outline-3">
<h3 id="org22fca9c"><span class="section-number-3">13.1</span> realgud</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-13-1">
2016-10-19 19:13:32 -06:00
<p>
realgud provides debugging support with many external debuggers in emacs
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">realgud</span>
<span style="font-weight: bold;">:defer</span> 10)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org51a55fa" class="outline-3">
<h3 id="org51a55fa"><span class="section-number-3">13.2</span> emr</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-13-2">
2016-10-19 19:13:32 -06:00
<p>
emr (emacs refactor) provides support for refactoring in many programming languages
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">emr</span>
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> prog-mode-map
(<span style="font-style: italic;">"M-RET"</span> . emr-show-refactor-menu))
<span style="font-weight: bold;">:config</span> (emr-initialize))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orga4d3c60" class="outline-3">
<h3 id="orga4d3c60"><span class="section-number-3">13.3</span> semantic</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-13-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">semantic</span>
<span style="font-weight: bold;">:commands</span> semantic-mode
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(add-hook 'prog-mode-hook 'semantic-mode)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org5402a2c" class="outline-2">
<h2 id="org5402a2c"><span class="section-number-2">14</span> Utility</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-14">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-orgc779e73" class="outline-3">
<h3 id="orgc779e73"><span class="section-number-3">14.1</span> term</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-14-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">term</span>
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> term-raw-escape-map
(<span style="font-style: italic;">"M-x"</span> . helm-M-x)
<span style="font-weight: bold;">:map</span> term-raw-map
(<span style="font-style: italic;">"M-x"</span> . helm-M-x))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(define-key term-raw-map (kbd <span style="font-style: italic;">"C-h"</span>) help-map)
(add-hook 'term-mode-hook 'imalison:disable-linum-mode)
(add-hook 'term-mode-hook 'imalison:disable-show-trailing-whitespace)
(<span style="font-weight: bold;">setq</span> term-buffer-maximum-size 0)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6a3210d" class="outline-3">
<h3 id="org6a3210d"><span class="section-number-3">14.2</span> term-manager</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-14-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:use-package</span> term-manager
<span style="font-weight: bold;">:defer</span> t
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:set-escape-char</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> _args)
(<span style="font-weight: bold;">let</span> (term-escape-char)
(term-set-escape-char ?\C-x))))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(advice-add
'term-manager-default-build-term <span style="font-weight: bold;">:after</span> 'imalison:set-escape-char)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org7786fc9" class="outline-3">
<h3 id="org7786fc9"><span class="section-number-3">14.3</span> term-projectile</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-14-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">imalison:use-package*</span> term-projectile <span style="font-style: italic;">"term-manager"</span>
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"C-c 7"</span> . imalison:term-hydra-global/body)
<span style="font-weight: bold;">:commands</span> (term-projectile-forward term-projectile-backward
2016-10-19 19:13:32 -06:00
term-projectile-default-directory-forward
term-projectile-default-directory-backward
term-projectile-create-new
2016-11-07 12:57:02 -07:00
term-projectile-create-new-default-directory)
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">emit-prefix-selector</span> imalison:term
2016-10-19 19:13:32 -06:00
term-projectile-forward
2016-11-07 12:57:02 -07:00
term-projectile-create-new)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:term-hydra-original-default-directory</span>)
(<span style="font-weight: bold;">defhydra</span> imalison:term-hydra-default-directory
(<span style="font-weight: bold;">:body-pre</span>
(term-projectile-default-directory-forward-restored))
<span style="font-style: italic;">"term - default-directory"</span>
(<span style="font-style: italic;">"s"</span> term-projectile-switch-to)
(<span style="font-style: italic;">"f"</span> term-projectile-default-directory-forward-restored)
(<span style="font-style: italic;">"b"</span> term-projectile-default-directory-backward-restored)
(<span style="font-style: italic;">"c"</span> term-projectile-default-directory-create-new-restored)
(<span style="font-style: italic;">"d"</span> term-projectile-default-directory-forward-restored)
(<span style="font-style: italic;">"g"</span> imalison:term-hydra-global/body-restored <span style="font-weight: bold;">:exit</span> t)
(<span style="font-style: italic;">"p"</span> imalison:term-hydra-projectile/body-restored <span style="font-weight: bold;">:exit</span> t))
(<span style="font-weight: bold;">defhydra</span> imalison:term-hydra-projectile
(<span style="font-weight: bold;">:body-pre</span>
(<span style="font-weight: bold;">progn</span>
(term-projectile-forward-restored)))
<span style="font-style: italic;">"term - projectile"</span>
(<span style="font-style: italic;">"s"</span> term-projectile-switch-to)
(<span style="font-style: italic;">"f"</span> term-projectile-forward-restored)
(<span style="font-style: italic;">"b"</span> term-projectile-backward-restored)
(<span style="font-style: italic;">"c"</span> term-projectile-create-new-restored)
(<span style="font-style: italic;">"d"</span> imalison:term-hydra-default-directory/body-restored <span style="font-weight: bold;">:exit</span> t)
(<span style="font-style: italic;">"g"</span> imalison:term-hydra-global/body-restored <span style="font-weight: bold;">:exit</span> t)
(<span style="font-style: italic;">"p"</span> term-projectile-forward-restored))
(<span style="font-weight: bold;">defhydra</span> imalison:term-hydra-global
(<span style="font-weight: bold;">:body-pre</span>
(<span style="font-weight: bold;">progn</span> (<span style="font-weight: bold;">setq</span> imalison:term-hydra-original-default-directory
default-directory)))
<span style="font-style: italic;">"term - global"</span>
(<span style="font-style: italic;">"s"</span> term-projectile-switch-to)
(<span style="font-style: italic;">"f"</span> term-projectile-global-forward-restored)
(<span style="font-style: italic;">"b"</span> term-projectile-global-backward-restored)
(<span style="font-style: italic;">"c"</span> term-projectile-global-create-new-restored)
(<span style="font-style: italic;">"d"</span> imalison:term-hydra-default-directory/body-restored <span style="font-weight: bold;">:exit</span> t)
(<span style="font-style: italic;">"g"</span> term-projectile-global-forward-restored)
(<span style="font-style: italic;">"p"</span> imalison:term-hydra-projectile/body-restored <span style="font-weight: bold;">:exit</span> t))
(mapcar (<span style="font-weight: bold;">lambda</span> (term-projectile-function)
(<span style="font-weight: bold;">defalias</span> (imalison:concat-symbols term-projectile-function '-restored)
(<span style="font-weight: bold;">lambda</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let</span> ((default-directory imalison:term-hydra-original-default-directory))
(apply term-projectile-function args)))))
'(term-projectile-default-directory-forward
2016-10-19 19:13:32 -06:00
term-projectile-default-directory-backward
term-projectile-default-directory-create-new
term-projectile-forward
term-projectile-backward
term-projectile-create-new
term-projectile-global-forward
term-projectile-global-backward
term-projectile-global-create-new
imalison:term-hydra-global/body
imalison:term-hydra-projectile/body
2016-11-07 12:57:02 -07:00
imalison:term-hydra-default-directory/body))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org354660f" class="outline-3">
<h3 id="org354660f"><span class="section-number-3">14.4</span> crux</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-14-4">
2016-10-19 19:13:32 -06:00
<p>
crux-reopen-as-root-mode makes it so that any file owned by root will automatically be opened as the root user.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">crux</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:bind</span> ((<span style="font-style: italic;">"C-c C-s"</span> . crux-sudo-edit)
(<span style="font-style: italic;">"C-c C-r"</span> . crux-eval-and-replace)
(<span style="font-style: italic;">"C-c o"</span> . crux-open-with))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(crux-reopen-as-root-mode)))
2016-10-23 20:02:56 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org425e3cc" class="outline-3">
<h3 id="org425e3cc"><span class="section-number-3">14.5</span> kde-connect</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-14-5">
2016-10-23 20:02:56 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">kdeconnect</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org47fd3bb" class="outline-2">
<h2 id="org47fd3bb"><span class="section-number-2">15</span> Chat</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-15">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org634edb8" class="outline-3">
<h3 id="org634edb8"><span class="section-number-3">15.1</span> erc</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-15-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">erc</span>
<span style="font-weight: bold;">:commands</span> erc
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(add-to-list 'erc-modules 'notifications)</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">logging:</span>
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">erc-colorize</span>
<span style="font-weight: bold;">:config</span>
(erc-colorize-mode 1))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4884c23" class="outline-3">
<h3 id="org4884c23"><span class="section-number-3">15.2</span> bitlbee</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-15-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">bitlbee</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">bitlbee-password</span> <span style="font-style: italic;">"geheim"</span>)
(add-hook 'erc-join-hook 'bitlbee-identify)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">bitlbee-identify</span> ()
<span style="font-style: italic;">"If we're on the bitlbee server, send the identify command to the</span>
<span style="font-style: italic;"> &amp;bitlbee channel."</span>
(<span style="font-weight: bold;">when</span> (<span style="font-weight: bold;">and</span> (string= <span style="font-style: italic;">"localhost"</span> erc-session-server)
(string= <span style="font-style: italic;">"&amp;bitlbee"</span> (buffer-name)))
(erc-message <span style="font-style: italic;">"PRIVMSG"</span> (format <span style="font-style: italic;">"%s identify %s"</span>
(erc-default-target)
bitlbee-password))))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org053434d" class="outline-3">
<h3 id="org053434d"><span class="section-number-3">15.3</span> slack</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-15-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">slack</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org623b149" class="outline-2">
<h2 id="org623b149"><span class="section-number-2">16</span> Cooperation</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-16">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-orgc51ea69" class="outline-3">
<h3 id="orgc51ea69"><span class="section-number-3">16.1</span> togetherly</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-16-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">togetherly</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org0472356" class="outline-3">
<h3 id="org0472356"><span class="section-number-3">16.2</span> floobits</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-16-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">floobits</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb21f677" class="outline-3">
<h3 id="orgb21f677"><span class="section-number-3">16.3</span> rudel</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-16-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">rudel</span>
<span style="font-weight: bold;">:disabled</span> t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org2ba4721" class="outline-2">
<h2 id="org2ba4721"><span class="section-number-2">17</span> Other</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-17">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org8f223aa" class="outline-3">
<h3 id="org8f223aa"><span class="section-number-3">17.1</span> anzu</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">anzu</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(global-anzu-mode +1)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(custom-set-variables
'(anzu-mode-lighter <span style="font-style: italic;">""</span>)
'(anzu-deactivate-region t)
'(anzu-search-threshold 1000)
'(anzu-replace-threshold 50)
'(anzu-replace-to-string-separator <span style="font-style: italic;">" =&gt; "</span>))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(define-key isearch-mode-map [remap isearch-query-replace]
#'anzu-isearch-query-replace)
(define-key isearch-mode-map [remap isearch-query-replace-regexp]
#'anzu-isearch-query-replace-regexp)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orge36be9f" class="outline-3">
<h3 id="orge36be9f"><span class="section-number-3">17.2</span> fontawesome</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">fontawesome</span>
<span style="font-weight: bold;">:commands</span> helm-fontawesome)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4e4def1" class="outline-3">
<h3 id="org4e4def1"><span class="section-number-3">17.3</span> shell-history</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-3">
2016-10-19 19:13:32 -06:00
<p>
I think that shell-history is causing projectile to be very slow so I have disabled it.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">shell-history</span>
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:disabled</span> t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgffa4cfe" class="outline-3">
<h3 id="orgffa4cfe"><span class="section-number-3">17.4</span> iedit</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-4">
2016-10-19 19:13:32 -06:00
<p>
2016-11-07 17:41:36 -07:00
I don't use iedit directly, but it is used by <a href="#orgd568a42">emr</a> and I need to disable <code>iedit-toggle-key-default</code> or else a buffer pops up complaing that the key has been bound to something else
2016-10-19 19:13:32 -06:00
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">iedit</span>
<span style="font-weight: bold;">:defer</span> t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd0b718c" class="outline-3">
<h3 id="orgd0b718c"><span class="section-number-3">17.5</span> tramp</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-5">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">tramp</span>
<span style="font-weight: bold;">:commands</span> tramp
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">setq</span> tramp-default-method <span style="font-style: italic;">"scp"</span>))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org88a9f0a" class="outline-3">
<h3 id="org88a9f0a"><span class="section-number-3">17.6</span> flycheck</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-6">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">flycheck</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">flycheck-package</span>
<span style="font-weight: bold;">:config</span> (flycheck-package-setup))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">imalison:use-package</span> flycheck-cask
<span style="font-weight: bold;">:after</span> flycheck
<span style="font-weight: bold;">:config</span>
(add-hook 'flycheck-mode-hook #'flycheck-cask-setup))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(add-to-list 'flycheck-emacs-lisp-checkdoc-variables
'sentence-end-double-space)
(global-flycheck-mode))
<span style="font-weight: bold;">:diminish</span> flycheck-mode)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgc3712ff" class="outline-3">
<h3 id="orgc3712ff"><span class="section-number-3">17.7</span> narrow-indirect</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-7">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">narrow-indirect</span>
<span style="font-weight: bold;">:init</span>
(<span style="font-weight: bold;">progn</span>
(define-key ctl-x-4-map <span style="font-style: italic;">"nd"</span> 'ni-narrow-to-defun-indirect-other-window)
(define-key ctl-x-4-map <span style="font-style: italic;">"nn"</span> 'ni-narrow-to-region-indirect-other-window)
(define-key ctl-x-4-map <span style="font-style: italic;">"np"</span> 'ni-narrow-to-page-indirect-other-window)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3037cb4" class="outline-3">
<h3 id="org3037cb4"><span class="section-number-3">17.8</span> editorconfig</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-8">
2016-10-19 19:13:32 -06:00
<p>
I had to disable this mode because something that it does messes with coding settings and makes it so that I have to select the appropriate encoding every time I save gpg encrypted files.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">editorconfig</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(add-to-list 'editorconfig-exclude-modes '(org-mode))
(editorconfig-mode 1)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9e99c31" class="outline-3">
<h3 id="org9e99c31"><span class="section-number-3">17.9</span> dtrt-indent</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-9">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">dtrt-indent</span>
<span style="font-weight: bold;">:commands</span> 'dtrt-indent-mode
<span style="font-weight: bold;">:init</span> (add-hook 'prog-mode-hook 'dtrt-indent-mode)
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> dtrt-indent-active-mode-line-info <span style="font-style: italic;">" [&#10236;]"</span>)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org8314d58" class="outline-3">
<h3 id="org8314d58"><span class="section-number-3">17.10</span> indent-guide</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-10">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">indent-guide</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(indent-guide-global-mode -1)
(<span style="font-weight: bold;">setq</span> indent-guide-delay 0.1)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org2fb4c0c" class="outline-3">
<h3 id="org2fb4c0c"><span class="section-number-3">17.11</span> rainbow-delimiters</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-11">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">rainbow-delimiters</span>
<span style="font-weight: bold;">:commands</span> rainbow-delimiters-mode
<span style="font-weight: bold;">:init</span>
(<span style="font-weight: bold;">progn</span>
(add-hook 'prog-mode-hook (<span style="font-weight: bold;">lambda</span> () (rainbow-delimiters-mode t)))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org7340d9a" class="outline-3">
<h3 id="org7340d9a"><span class="section-number-3">17.12</span> undo-tree</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-12">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">undo-tree</span>
<span style="font-weight: bold;">:disabled</span> t <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">this has been getting pretty annoying</span>
<span style="font-weight: bold;">:bind</span> ((<span style="font-style: italic;">"C--"</span> . undo-redo)
(<span style="font-style: italic;">"C-c u"</span> . undo-tree-visualize)
(<span style="font-style: italic;">"C-c r"</span> . undo-tree-redo))
<span style="font-weight: bold;">:config</span>
(diminish 'undo-tree-mode)
<span style="font-weight: bold;">:init</span>
(<span style="font-weight: bold;">progn</span>
<span style="font-weight: bold; font-style: italic;">;;</span><span style="font-weight: bold; font-style: italic;">(setq undo-tree-visualizer-diff t) ;; This causes performance problems</span>
(global-undo-tree-mode)
(<span style="font-weight: bold;">setq</span> undo-tree-visualizer-timestamps t)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb13a5c0" class="outline-3">
<h3 id="orgb13a5c0"><span class="section-number-3">17.13</span> recentf</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-13">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">recentf</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> recentf-max-saved-items 1000
recentf-max-menu-items 1000)
(advice-add 'recentf-cleanup <span style="font-weight: bold;">:around</span> 'imalison:shut-up-around)
(recentf-mode 1)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgaaeaccd" class="outline-3">
<h3 id="orgaaeaccd"><span class="section-number-3">17.14</span> key-chord</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-14">
2016-10-19 19:13:32 -06:00
<p>
I have currently disabled key-chord because it may cause typing lag.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">key-chord</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:disable-keychord-around</span> (<span style="font-weight: bold;">function</span> <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(<span style="font-weight: bold;">let</span> ((key-chord-mode-was-enabled (<span style="font-weight: bold;">bound-and-true-p</span> key-chord-mode)))
(<span style="font-weight: bold;">when</span> key-chord-mode-was-enabled (key-chord-mode -1))
(<span style="font-weight: bold;">condition-case</span> err (<span style="font-weight: bold;">progn</span> (apply function args)) (<span style="font-weight: bold;">error</span>))
(<span style="font-weight: bold;">when</span> key-chord-mode-was-enabled (key-chord-mode 1))))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(advice-add 'key-chord-mode <span style="font-weight: bold;">:around</span> 'imalison:shut-up-around)
(key-chord-mode 1)
(advice-add 'imalison:avy <span style="font-weight: bold;">:around</span> 'imalison:disable-keychord-around)
(key-chord-define-global <span style="font-style: italic;">"tg"</span> 'imalison:term-hydra/body)
(key-chord-define-global <span style="font-style: italic;">"pj"</span> 'imalison:projectile-find-file)
(key-chord-define-global <span style="font-style: italic;">"p["</span> 'projectile-switch-project)
(key-chord-define-global <span style="font-style: italic;">"fj"</span> 'imalison:do-ag)
(key-chord-define-global <span style="font-style: italic;">"jh"</span> 'imalison:avy)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3b2526f" class="outline-3">
<h3 id="org3b2526f"><span class="section-number-3">17.15</span> nodejs-repl</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-15">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">nodejs-repl</span>
<span style="font-weight: bold;">:commands</span> nodejs-repl)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3b64257" class="outline-3">
<h3 id="org3b64257"><span class="section-number-3">17.16</span> calc-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-16">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">calc-mode</span>
<span style="font-weight: bold;">:ensure</span> nil
<span style="font-weight: bold;">:commands</span> calc
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> calc-context-sensitive-enter t)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9fc9618" class="outline-3">
<h3 id="org9fc9618"><span class="section-number-3">17.17</span> helm-spotify</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-17">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">helm-spotify</span>
<span style="font-weight: bold;">:commands</span> helm-spotify)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org81a9682" class="outline-3">
<h3 id="org81a9682"><span class="section-number-3">17.18</span> jabber</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-18">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">jabber</span>
<span style="font-weight: bold;">:commands</span> jabber-connect
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> jabber-alert-presence-hooks nil)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">jabber-message-content-message</span> (from buffer text)
(<span style="font-weight: bold;">when</span> (<span style="font-weight: bold;">or</span> jabber-message-alert-same-buffer
(not (memq (selected-window) (get-buffer-window-list buffer))))
(<span style="font-weight: bold;">if</span> (jabber-muc-sender-p from)
(format <span style="font-style: italic;">"%s: %s"</span> (jabber-jid-resource from) text)
(format <span style="font-style: italic;">"%s: %s"</span> (jabber-jid-displayname from) text))))
(<span style="font-weight: bold;">setq</span> jabber-alert-message-function 'jabber-message-content-message)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org7afe28d" class="outline-3">
<h3 id="org7afe28d"><span class="section-number-3">17.19</span> htmlize</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-19">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">htmlize</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org76abb68" class="outline-3">
<h3 id="org76abb68"><span class="section-number-3">17.20</span> calfw</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-20">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">calfw</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">calfw-org</span>)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orga23f16b" class="outline-3">
<h3 id="orga23f16b"><span class="section-number-3">17.21</span> clocker</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-21">
2016-10-19 19:13:32 -06:00
<p>
Not really sure what this is
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">clocker</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org7cce35b" class="outline-3">
<h3 id="org7cce35b"><span class="section-number-3">17.22</span> deft</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-22">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">deft</span>
<span style="font-weight: bold;">:commands</span> deft
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> deft-default-extension <span style="font-style: italic;">"org"</span>)
(<span style="font-weight: bold;">setq</span> deft-extensions '(<span style="font-style: italic;">"org"</span>))
(<span style="font-weight: bold;">setq</span> deft-use-filter-string-for-filename t)
(<span style="font-weight: bold;">setq</span> deft-file-naming-rules '((noslash . <span style="font-style: italic;">"_"</span>)
(nospace . <span style="font-style: italic;">"_"</span>)
(case-fn . downcase)))
(<span style="font-weight: bold;">setq</span> deft-directory <span style="font-style: italic;">"~/SparkleShare/org/notes"</span>)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org33fa300" class="outline-3">
<h3 id="org33fa300"><span class="section-number-3">17.23</span> epg</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-23">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">epg</span>
<span style="font-weight: bold;">:after</span> shut-up
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">shut-up</span>
(epa-file-enable)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org189f034" class="outline-3">
<h3 id="org189f034"><span class="section-number-3">17.24</span> pinentry</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-24">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">pinentry</span>
<span style="font-weight: bold;">:defer</span> 5
<span style="font-weight: bold;">:config</span>
(pinentry-start))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3c268c1" class="outline-3">
<h3 id="org3c268c1"><span class="section-number-3">17.25</span> twittering-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-25">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">twittering-mode</span>
<span style="font-weight: bold;">:commands</span> twittering-mode)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org738a4ef" class="outline-3">
<h3 id="org738a4ef"><span class="section-number-3">17.26</span> matrix-client</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-26">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">matrix-client</span>
<span style="font-weight: bold;">:disabled</span> t <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">fails to load eieio on startup</span>
)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org352343f" class="outline-3">
<h3 id="org352343f"><span class="section-number-3">17.27</span> mu4e</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-27">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">eval-when-compile</span>
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">s</span>)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">mu4e-elisp-directory</span>
(s-trim (shell-command-to-string <span style="font-style: italic;">"mu4e_directory"</span>))))
(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">mu4e</span>
<span style="font-weight: bold;">:load-path</span> mu4e-elisp-directory
<span style="font-weight: bold;">:ensure</span> nil
<span style="font-weight: bold;">:commands</span> (mu4e mu4e-view-message-with-msgid mu4e-update-index email)
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"C-c 0"</span> . email)
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">email</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> arg)
(<span style="font-weight: bold;">interactive</span> <span style="font-style: italic;">"P"</span>)
(<span style="font-weight: bold;">if</span> (string-equal (persp-name persp-curr) <span style="font-style: italic;">"email"</span>)
(<span style="font-weight: bold;">progn</span> (delete-other-windows) (mu4e))
(<span style="font-weight: bold;">progn</span>
(persp-switch <span style="font-style: italic;">"email"</span>)
(<span style="font-weight: bold;">when</span> (<span style="font-weight: bold;">or</span> (not (mu4e-running-p)) arg)
(delete-other-windows) (mu4e)))))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">enable inline images</span>
(<span style="font-weight: bold;">setq</span> mu4e-view-show-images t)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">show images</span>
(<span style="font-weight: bold;">setq</span> mu4e-show-images t)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Try to display html as text</span>
(<span style="font-weight: bold;">setq</span> mu4e-view-prefer-html nil)
(<span style="font-weight: bold;">setq</span> mu4e-html2text-command <span style="font-style: italic;">"html2text -width 80 -nobs -utf8"</span>)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">use imagemagick, if available</span>
(<span style="font-weight: bold;">when</span> (fboundp 'imagemagick-register-types)
(imagemagick-register-types))
(<span style="font-weight: bold;">setq</span> mail-user-agent 'mu4e-user-agent)
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">org-mu4e</span>)
(<span style="font-weight: bold;">setq</span> mu4e-compose-complete-only-after nil)
(<span style="font-weight: bold;">setq</span> mu4e-maildir <span style="font-style: italic;">"~/Mail"</span>)
(<span style="font-weight: bold;">setq</span> mu4e-drafts-folder <span style="font-style: italic;">"/[Gmail].Drafts"</span>)
(<span style="font-weight: bold;">setq</span> mu4e-sent-folder <span style="font-style: italic;">"/[Gmail].Sent Mail"</span>)
(<span style="font-weight: bold;">setq</span> mu4e-trash-folder <span style="font-style: italic;">"/[Gmail].Trash"</span>)
(<span style="font-weight: bold;">setq</span> mu4e-sent-messages-behavior 'delete)
(<span style="font-weight: bold;">setq</span> mu4e-headers-skip-duplicates t)
(<span style="font-weight: bold;">setq</span> mu4e-update-interval (* 60 20))
(<span style="font-weight: bold;">setq</span> message-kill-buffer-on-exit t)
(<span style="font-weight: bold;">setq</span> mail-user-agent 'mu4e-user-agent) <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">make mu4e the default mail client</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">don't save message to Sent Messages, Gmail/IMAP takes care of this</span>
(<span style="font-weight: bold;">setq</span> mu4e-sent-messages-behavior 'delete)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">allow for updating mail using 'U' in the main view:</span>
(<span style="font-weight: bold;">setq</span> mu4e-get-mail-command <span style="font-style: italic;">"timeout 60 offlineimap"</span>)
(add-hook 'mu4e-compose-mode-hook
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">my-do-compose-stuff</span> () (flyspell-mode)))
(add-to-list 'mu4e-headers-actions '(<span style="font-style: italic;">"view in browser"</span> . mu4e-action-view-in-browser))
(add-to-list 'mu4e-view-actions '(<span style="font-style: italic;">"view in browser"</span> . mu4e-action-view-in-browser))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">mu4e-view</span> (msg headersbuf)
<span style="font-style: italic;">"Display the message MSG in a new buffer, and keep in sync with HDRSBUF.</span>
<span style="font-style: italic;"> 'In sync' here means that moving to the next/previous message in</span>
<span style="font-style: italic;"> the the message view affects HDRSBUF, as does marking etc.</span>
<span style="font-style: italic;"> As a side-effect, a message that is being viewed loses its 'unread'</span>
<span style="font-style: italic;"> marking if it still had that."</span>
(<span style="font-weight: bold;">let*</span> ((embedded <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">is it as an embedded msg (ie. message/rfc822 att)?</span>
(<span style="font-weight: bold;">when</span> (gethash (mu4e-message-field msg <span style="font-weight: bold;">:path</span>)
mu4e~path-parent-docid-map) <span style="font-weight: bold;">t))</span>
(buf
(<span style="font-weight: bold;">if</span> embedded
(mu4e~view-embedded-winbuf)
(get-buffer-create mu4e~view-buffer-name))))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">note: mu4e~view-mark-as-read will pseudo-recursively call mu4e-view again</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">by triggering mu4e~view again as it marks the message as read</span>
(<span style="font-weight: bold;">with-current-buffer</span> buf
(switch-to-buffer buf)
(<span style="font-weight: bold;">setq</span> mu4e~view-msg msg)
<span style="font-weight: bold; font-style: italic;">;;</span><span style="font-weight: bold; font-style: italic;">(or embedded (not (mu4e~view-mark-as-read msg)))</span>
(<span style="font-weight: bold;">when</span> (<span style="font-weight: bold;">or</span> (mu4e~view-mark-as-read msg) t)
(<span style="font-weight: bold;">let</span> ((inhibit-read-only t))
(erase-buffer)
(mu4e~delete-all-overlays)
(insert (mu4e-view-message-text msg))
(goto-char (point-min))
(mu4e~fontify-cited)
(mu4e~fontify-signature)
(mu4e~view-make-urls-clickable)
(mu4e~view-show-images-maybe msg)
(<span style="font-weight: bold;">setq</span>
2016-10-19 19:13:32 -06:00
mu4e~view-buffer buf
2016-11-07 12:57:02 -07:00
mu4e~view-headers-buffer headersbuf)
(<span style="font-weight: bold;">when</span> embedded (local-set-key <span style="font-style: italic;">"q"</span> 'kill-buffer-and-window))
(mu4e-view-mode))))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">smtpmail</span>)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">alternatively, for emacs-24 you can use:</span>
(<span style="font-weight: bold;">setq</span> message-send-mail-function 'smtpmail-send-it
2016-10-19 19:13:32 -06:00
smtpmail-stream-type 'starttls
2016-11-07 12:57:02 -07:00
smtpmail-default-smtp-server <span style="font-style: italic;">"smtp.gmail.com"</span>
smtpmail-smtp-server <span style="font-style: italic;">"smtp.gmail.com"</span>
smtpmail-smtp-service 587)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orga4229b1" class="outline-3">
<h3 id="orga4229b1"><span class="section-number-3">17.28</span> gmail-message-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-28">
2016-10-19 19:13:32 -06:00
<p>
This is useful with server mode when editing gmail messages. I think that it is not currently working, or it may need to be manually enabled.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">gmail-message-mode</span>
<span style="font-weight: bold;">:demand</span> t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org88dd022" class="outline-3">
<h3 id="org88dd022"><span class="section-number-3">17.29</span> ham-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-29">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">ham-mode</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> ham-mode-html-to-markdown-command '(<span style="font-style: italic;">"pandoc"</span> <span style="font-style: italic;">"--from"</span> <span style="font-style: italic;">"html"</span> <span style="font-style: italic;">"--to"</span> <span style="font-style: italic;">"markdown"</span> file))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orge1045db" class="outline-3">
<h3 id="orge1045db"><span class="section-number-3">17.30</span> alert</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-30">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">alert</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">alert-notifier-notify</span> (info)
(<span style="font-weight: bold;">if</span> alert-notifier-command
(<span style="font-weight: bold;">let</span> ((args
(list <span style="font-style: italic;">"-title"</span> (alert-encode-string (plist-get info <span style="font-weight: bold;">:title</span>))
<span style="font-style: italic;">"-activate"</span> <span style="font-style: italic;">"org.gnu.Emacs"</span>
<span style="font-style: italic;">"-message"</span> (alert-encode-string (plist-get info <span style="font-weight: bold;">:message</span>))
<span style="font-style: italic;">"-execute"</span> (format <span style="font-style: italic;">"\"%s\""</span> (switch-to-buffer-command (plist-get info <span style="font-weight: bold;">:buffer</span>))))))
(apply #'call-process alert-notifier-command nil nil nil args))
(alert-message-notify info)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">switch-to-buffer-command</span> (buffer-name)
(emacsclient-command (format <span style="font-style: italic;">"(switch-to-buffer \\\"%s\\\")"</span> buffer-name)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">emacsclient-command</span> (command)
(format <span style="font-style: italic;">"emacsclient --server-file='%s' -e '%s'"</span> server-name command))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">setq</span> alert-default-style 'notifier)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org74c2e86" class="outline-3">
<h3 id="org74c2e86"><span class="section-number-3">17.31</span> sauron</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-31">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">sauron</span>
<span style="font-weight: bold;">:defer</span> 5
<span style="font-weight: bold;">:commands</span> (sauron-start sauron-start-hidden)
<span style="font-weight: bold;">:init</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">when</span> (eq system-type 'darwin)
(<span style="font-weight: bold;">setq</span> sauron-modules '(sauron-erc sauron-org sauron-notifications
sauron-twittering sauron-jabber sauron-identica))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">sauron-dbus-start</span> ()
nil)
(makunbound 'dbus-path-emacs)))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(sauron-start-hidden)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">This should really check (featurep 'dbus) but for some reason</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">this is always true even if support is not there.</span>
(<span style="font-weight: bold;">setq</span> sauron-prio-sauron-started 2)
(<span style="font-weight: bold;">setq</span> sauron-min-priority 3)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(setq sauron-dbus-cookie t) ;; linux only?</span>
(<span style="font-weight: bold;">setq</span> sauron-separate-frame nil)
(<span style="font-weight: bold;">setq</span> sauron-nick-insensitivity 1)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">sauron:jabber-notify</span> (origin priority message <span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> properties)
(funcall notify-function <span style="font-style: italic;">"gtalk"</span> message))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">sauron:erc-notify</span> (origin priority message <span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> properties)
(<span style="font-weight: bold;">let</span> ((event (plist-get properties <span style="font-weight: bold;">:event</span>)))
(funcall notify-function <span style="font-style: italic;">"IRC"</span> message)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">sauron:mu4e-notify</span> (origin priority message <span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> properties)
nil)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">sauron:dbus-notify</span> (origin priority message <span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> properties)
(funcall notify-function <span style="font-style: italic;">"GMail"</span> message))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">sauron:dispatch-notify</span> (origin priority message <span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> properties)
(<span style="font-weight: bold;">let</span> ((handler (<span style="font-weight: bold;">cond</span> ((string= origin <span style="font-style: italic;">"erc"</span>) 'sauron:erc-notify)
((string= origin <span style="font-style: italic;">"jabber"</span>) 'sauron:jabber-notify)
((string= origin <span style="font-style: italic;">"mu4e"</span>) 'sauron:mu4e-notify)
((string= origin <span style="font-style: italic;">"dbus"</span>) 'sauron:dbus-notify)
(t (<span style="font-weight: bold;">lambda</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> r) nil)))))
(funcall handler origin priority message properties)))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Prefering alert.el for now ;; (add-hook 'sauron-event-added-functions 'sauron:dispatch-notify)</span>
(sauron-start-hidden)
(add-hook 'sauron-event-added-functions 'sauron-alert-el-adapter)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3e5eef3" class="outline-3">
<h3 id="org3e5eef3"><span class="section-number-3">17.32</span> screenshot</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-32">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">screenshot</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org742ffc0" class="outline-3">
<h3 id="org742ffc0"><span class="section-number-3">17.33</span> libmpdee</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-33">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">libmpdee</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org10879c5" class="outline-3">
<h3 id="org10879c5"><span class="section-number-3">17.34</span> flyspell</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-34">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">flyspell</span>
<span style="font-weight: bold;">:disabled</span> t <span style="font-weight: bold; font-style: italic;">; </span><span style="font-weight: bold; font-style: italic;">kind of annoying</span>
<span style="font-weight: bold;">:preface</span> (<span style="font-weight: bold;">setq</span> flyspell-issue-welcome-flag nil)
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(diminish 'flyspell-mode)
(<span style="font-weight: bold;">bind-key</span> <span style="font-style: italic;">"M-s"</span> 'flyspell-correct-word-before-point flyspell-mode-map)
(<span style="font-weight: bold;">unbind-key</span> <span style="font-style: italic;">"C-;"</span> flyspell-mode-map)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">flyspell-emacs-popup-textual</span> (event poss word)
<span style="font-style: italic;">"A textual flyspell popup menu."</span>
(<span style="font-weight: bold;">let*</span> ((corrects (<span style="font-weight: bold;">if</span> flyspell-sort-corrections
(sort (car (cdr (cdr poss))) 'string&lt;)
(car (cdr (cdr poss)))))
(cor-menu (<span style="font-weight: bold;">if</span> (consp corrects)
(mapcar (<span style="font-weight: bold;">lambda</span> (correct)
(list correct correct))
corrects)
'()))
(affix (car (cdr (cdr (cdr poss)))))
2016-10-19 19:13:32 -06:00
show-affix-info
2016-11-07 12:57:02 -07:00
(base-menu (<span style="font-weight: bold;">let</span> ((save (<span style="font-weight: bold;">if</span> (<span style="font-weight: bold;">and</span> (consp affix) show-affix-info)
(list
(list (concat <span style="font-style: italic;">"Save affix: "</span>
(car affix))
'save)
'(<span style="font-style: italic;">"Accept (session)"</span> session)
'(<span style="font-style: italic;">"Accept (buffer)"</span> buffer))
'((<span style="font-style: italic;">"Save word"</span> save)
(<span style="font-style: italic;">"Accept (session)"</span> session)
(<span style="font-style: italic;">"Accept (buffer)"</span> buffer)))))
(<span style="font-weight: bold;">if</span> (consp cor-menu)
(append cor-menu (cons <span style="font-style: italic;">""</span> save))
save)))
(menu (mapcar
(<span style="font-weight: bold;">lambda</span> (arg) (<span style="font-weight: bold;">if</span> (consp arg) (car arg) arg))
base-menu)))
(cadr (assoc (popup-menu* menu <span style="font-weight: bold;">:scroll-bar</span> t) base-menu))))
(fset 'flyspell-emacs-popup 'flyspell-emacs-popup-textual)))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgb098f01" class="outline-3">
<h3 id="orgb098f01"><span class="section-number-3">17.35</span> web-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-35">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">web-mode</span>
<span style="font-weight: bold;">:mode</span> ((<span style="font-style: italic;">"\\.tmpl\\'"</span> . web-mode)
(<span style="font-style: italic;">"\\.cql\\'"</span> . web-mode))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defvar-setq</span> web-mode-content-types-alist
'((<span style="font-style: italic;">"gtl"</span> . <span style="font-style: italic;">"\\.tmpl\\'"</span>)
(<span style="font-style: italic;">"gtl"</span> . <span style="font-style: italic;">"\\.cql\\'"</span>)))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org5146a46" class="outline-3">
<h3 id="org5146a46"><span class="section-number-3">17.36</span> helm-themes</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-36">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">helm-themes</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4521b95" class="outline-3">
<h3 id="org4521b95"><span class="section-number-3">17.37</span> helm-swoop</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-37">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">helm-swoop</span>
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"C-S-s"</span> . helm-swoop)
<span style="font-weight: bold;">:commands</span> helm-swoop)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9a19687" class="outline-3">
<h3 id="org9a19687"><span class="section-number-3">17.38</span> perspective</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-38">
2016-10-19 19:13:32 -06:00
<p>
I've disabled perspective because I just don't use it much.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">perspective</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(persp-mode)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">persp-get-perspectives-for-buffer</span> (buffer)
<span style="font-style: italic;">"Get the names of all of the perspectives of which `buffer` is a member."</span>
(<span style="font-weight: bold;">cl-loop</span> for perspective being the hash-value of perspectives-hash
if (member buffer (persp-buffers perspective))
collect (persp-name perspective)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">persp-pick-perspective-by-buffer</span> (buffer)
<span style="font-style: italic;">"Select a buffer and go to the perspective to which that buffer</span>
<span style="font-style: italic;"> belongs. If the buffer belongs to more than one perspective</span>
<span style="font-style: italic;"> completion will be used to pick the perspective to switch to.</span>
<span style="font-style: italic;"> Switch the focus to the window in which said buffer is displayed</span>
<span style="font-style: italic;"> if such a window exists. Otherwise display the buffer in whatever</span>
<span style="font-style: italic;"> window is active in the perspective."</span>
(<span style="font-weight: bold;">interactive</span> (list (funcall persp-interactive-completion-function
<span style="font-style: italic;">"Buffer: "</span> (mapcar 'buffer-name (buffer-list)))))
(<span style="font-weight: bold;">let*</span> ((perspectives (persp-get-perspectives-for-buffer (get-buffer buffer)))
(perspective (<span style="font-weight: bold;">if</span> (&gt; (length perspectives) 1)
(funcall persp-interactive-completion-function
(format <span style="font-style: italic;">"Select the perspective in which you would like to visit %s."</span>
buffer)
perspectives)
(car perspectives))))
(<span style="font-weight: bold;">if</span> (string= (persp-name persp-curr) perspective)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">This allows the opening of a single buffer in more than one window</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">in a single perspective.</span>
(switch-to-buffer buffer)
(<span style="font-weight: bold;">progn</span>
(persp-switch perspective)
(<span style="font-weight: bold;">if</span> (get-buffer-window buffer)
(set-frame-selected-window nil (get-buffer-window buffer))
(switch-to-buffer buffer))))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">persp-mode-switch-buffers</span> (arg)
(<span style="font-weight: bold;">interactive</span> <span style="font-style: italic;">"P"</span>)
(<span style="font-weight: bold;">if</span> arg (call-interactively 'ido-switch-buffer)
(call-interactively 'persp-pick-perspective-by-buffer)))
(define-key persp-mode-map (kbd <span style="font-style: italic;">"C-x b"</span>) 'persp-mode-switch-buffers))
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"C-c 9"</span> . persp-switch))
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org684d047" class="outline-3">
<h3 id="org684d047"><span class="section-number-3">17.39</span> smex</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-39">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">smex</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Using helm-M-x instead</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:commands</span> smex
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">This is here because smex feels like part of ido</span>
<span style="font-weight: bold;">:bind</span> (<span style="font-style: italic;">"M-x"</span> . smex))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orged9c9c5" class="outline-3">
<h3 id="orged9c9c5"><span class="section-number-3">17.40</span> java</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-40">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(add-hook 'java-mode-hook
(<span style="font-weight: bold;">lambda</span> ()
(<span style="font-weight: bold;">setq</span> c-basic-offset 4
2016-10-19 19:13:32 -06:00
tab-width 4
2016-11-07 12:57:02 -07:00
indent-tabs-mode t)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgee46155" class="outline-3">
<h3 id="orgee46155"><span class="section-number-3">17.41</span> android-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-41">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">android-mode</span>
<span style="font-weight: bold;">:after</span> s
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> android-mode-sdk-dir
(s-trim (shell-command-to-string <span style="font-style: italic;">"android_sdk_directory"</span>)))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgdaef7c8" class="outline-3">
<h3 id="orgdaef7c8"><span class="section-number-3">17.42</span> gradle-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-42">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">gradle-mode</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org6cdf599" class="outline-3">
<h3 id="org6cdf599"><span class="section-number-3">17.43</span> jsx-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-43">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">jsx-mode</span>
<span style="font-weight: bold;">:mode</span> <span style="font-style: italic;">"\\.jsx\\'"</span>)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org870ad40" class="outline-3">
<h3 id="org870ad40"><span class="section-number-3">17.44</span> css</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-44">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(eval-after-load 'css-mode
'(define-key css-mode-map (kbd <span style="font-style: italic;">"C-c b"</span>) 'web-beautify-css))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9d3ca7b" class="outline-3">
<h3 id="org9d3ca7b"><span class="section-number-3">17.45</span> robe</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-45">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">robe</span>
<span style="font-weight: bold;">:commands</span> robe-mode
<span style="font-weight: bold;">:init</span>
(<span style="font-weight: bold;">progn</span> (add-hook 'ruby-mode-hook 'robe-mode)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4340d0c" class="outline-3">
<h3 id="org4340d0c"><span class="section-number-3">17.46</span> rinari</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-46">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">rinari</span>
<span style="font-weight: bold;">:after</span> ruby-mode)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgaa2f0ae" class="outline-3">
<h3 id="orgaa2f0ae"><span class="section-number-3">17.47</span> helm-gtags</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-47">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">helm-gtags</span>
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> helm-gtags-ignore-case t
2016-10-19 19:13:32 -06:00
helm-gtags-auto-update t
helm-gtags-use-input-at-cursor t
helm-gtags-pulse-at-cursor t
2016-11-07 12:57:02 -07:00
helm-gtags-prefix-key <span style="font-style: italic;">"\C-cg"</span>
helm-gtags-suggested-key-mapping t)
(<span style="font-weight: bold;">cl-loop</span> for hook in '(dired-mode-hook eshell-mode-hook c-mode-hook
c++-mode-hook asm-mode-hook)
do (add-hook hook 'helm-gtags-mode)))
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> helm-gtags-mode-map
(<span style="font-style: italic;">"C-c g a"</span> . helm-gtags-tags-in-this-function)
(<span style="font-style: italic;">"C-j"</span> . helm-gtags-select)
(<span style="font-style: italic;">"M-."</span> . helm-gtags-dwim)
(<span style="font-style: italic;">"M-,"</span> . helm-gtags-pop-stack)
(<span style="font-style: italic;">"C-c &lt;"</span> . helm-gtags-previous-history)
(<span style="font-style: italic;">"C-c &gt;"</span> . helm-gtags-next-history)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgeb48f55" class="outline-3">
<h3 id="orgeb48f55"><span class="section-number-3">17.48</span> sgml-mode</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-48">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">sgml-mode</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">:bind ("C-c b" . web-beautify-html) TODO: mode specific, change binding</span>
<span style="font-weight: bold;">:commands</span> sgml-mode)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3d02571" class="outline-3">
<h3 id="org3d02571"><span class="section-number-3">17.49</span> evil</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-49">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">evil</span> <span style="font-weight: bold;">:commands</span> (evil-mode))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org3c8e9ee" class="outline-3">
<h3 id="org3c8e9ee"><span class="section-number-3">17.50</span> hackernews</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-17-50">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">hackernews</span> <span style="font-weight: bold;">:commands</span> hackernews)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
2016-10-24 16:41:42 -06:00
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orga62475c" class="outline-2">
<h2 id="orga62475c"><span class="section-number-2">18</span> Appearance</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-18">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org940e21a" class="outline-3">
<h3 id="org940e21a"><span class="section-number-3">18.1</span> Basic Config</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> inhibit-startup-screen t)
(blink-cursor-mode -1)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgcacde38" class="outline-3">
<h3 id="orgcacde38"><span class="section-number-3">18.2</span> Themes</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-2">
2016-10-19 19:13:32 -06:00
<p>
Ensure all themes that I use are installed:
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">solarized-theme</span>
<span style="font-weight: bold;">:init</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">setq</span> solarized-high-contrast-mode-line t)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defvar-setq</span> packages-appearance
'(monokai-theme solarized-theme zenburn-theme base16-theme molokai-theme
2016-10-19 19:13:32 -06:00
tango-2-theme gotham-theme sublime-themes rainbow-delimiters waher-theme
ample-theme material-theme zerodark-theme color-theme-modern leuven-theme
2016-11-07 12:57:02 -07:00
spacemacs-theme gruvbox-theme forest-blue-theme flatland-theme afternoon-theme))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(ensure-packages-installed packages-appearance)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org400950c" class="outline-3">
<h3 id="org400950c"><span class="section-number-3">18.3</span> all-the-icons</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-3">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">all-the-icons</span>
<span style="font-weight: bold;">:demand</span> t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgfcffce3" class="outline-3">
<h3 id="orgfcffce3"><span class="section-number-3">18.4</span> spaceline</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-4">
2016-11-07 17:41:36 -07:00
</div><div id="outline-container-org40a9f3e" class="outline-4">
<h4 id="org40a9f3e"><span class="section-number-4">18.4.1</span> Disable sRGB colorspace to make powerline separators work</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-18-4-1">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> ns-use-srgb-colorspace nil)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9adbec1" class="outline-4">
<h4 id="org9adbec1"><span class="section-number-4">18.4.2</span> config</h4>
2016-10-25 15:21:45 -06:00
<div class="outline-text-4" id="text-18-4-2">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">spaceline-config</span>
<span style="font-weight: bold;">:ensure</span> spaceline
<span style="font-weight: bold;">:commands</span> spaceline-compile
<span style="font-weight: bold;">:preface</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">spaceline-gh-notifier-disable-default-notifier-modeline</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(delq 'github-notifier-mode-line global-mode-string)))
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(advice-add 'github-notifier-mode <span style="font-weight: bold;">:after</span>
'spaceline-gh-notifier-disable-default-notifier-modeline)
(advice-add 'github-notifier-update <span style="font-weight: bold;">:after</span>
'spaceline-gh-notifier-disable-default-notifier-modeline)
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">setq</span> powerline-default-separator (random-choice '(butt slant wave)))
(<span style="font-weight: bold;">setq</span> spaceline-workspace-numbers-unicode t
spaceline-window-numbers-unicode t)
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">if</span> (display-graphic-p)
(<span style="font-weight: bold;">setq-default</span> powerline-default-separator 'wave)
(<span style="font-weight: bold;">setq-default</span> powerline-default-separator 'utf-8))
2016-10-21 22:51:05 -06:00
2016-11-07 12:57:02 -07:00
(spaceline-define-segment imalison:muni
<span style="font-style: italic;">"Display the number of minutes until the next muni train comes"</span>
(format <span style="font-style: italic;">"&#128647;%s"</span> (imalison:get-cached-muni-time))
<span style="font-weight: bold;">:when</span> active)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(spaceline-define-segment spaceline-gh-notifier
<span style="font-style: italic;">"Display the number of github notifications the user has"</span>
(format <span style="font-style: italic;">"&#9993;%s"</span> github-notifier-unread-count)
<span style="font-weight: bold;">:when</span> (&gt; github-notifier-unread-count 0))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(advice-add 'pl/separator-height <span style="font-weight: bold;">:around</span>
(<span style="font-weight: bold;">lambda</span> (<span style="font-weight: bold;">function</span> <span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> args)
(+ (apply function args) 10)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">This needs to be executed after setting the font because the separators</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">need to get regenerated</span>
(advice-add 'imalison:set-font-size <span style="font-weight: bold;">:after</span> 'spaceline-compile)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(spaceline-helm-mode)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">'spaceline-gh-notifier and 'imalison:muni disabled for now</span>
(spaceline-spacemacs-theme)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org29751a9" class="outline-3">
<h3 id="org29751a9"><span class="section-number-3">18.5</span> page-break-lines</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-5">
2016-10-24 17:23:47 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">page-break-lines</span>
<span style="font-weight: bold;">:defer</span> 1
<span style="font-weight: bold;">:diminish</span> (page-break-lines-mode)
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
2016-11-07 16:44:00 -07:00
(add-to-list 'page-break-lines-modes 'prog-mode)
2016-11-07 12:57:02 -07:00
(global-page-break-lines-mode +1)))
2016-10-24 17:23:47 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org8a58304" class="outline-3">
<h3 id="org8a58304"><span class="section-number-3">18.6</span> helm-themes</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-6">
2016-10-19 19:13:32 -06:00
<p>
helm-themes provides an easy way to switch between emacs-themes.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">helm-themes</span>
<span style="font-weight: bold;">:after</span> helm)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org9a5e492" class="outline-3">
<h3 id="org9a5e492"><span class="section-number-3">18.7</span> window-number</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-7">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">window-number</span>
<span style="font-weight: bold;">:defer</span> t)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org4439943" class="outline-3">
<h3 id="org4439943"><span class="section-number-3">18.8</span> Whitespace Setup</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-8">
2016-10-19 19:13:32 -06:00
<p>
Make whitespace-mode use just basic coloring:
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> whitespace-style
'(spaces tabs newline space-mark tab-mark newline-mark))
2016-10-19 19:13:32 -06:00
</pre>
</div>
<p>
Set the character used to represent spaces to ·, and the character used for tabs to be ▷.
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">setq</span> whitespace-display-mappings
'((space-mark 32 [183] [46])
(tab-mark 9 [9655 9] [92 9])))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orge985cd6" class="outline-3">
<h3 id="orge985cd6"><span class="section-number-3">18.9</span> Colorize Compliation Buffers</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-9">
2016-10-19 19:13:32 -06:00
<p>
2016-10-25 18:48:32 -06:00
This automatically applies ansi-color interpretation of terminal escape
sequences to compilation buffers.
2016-10-19 19:13:32 -06:00
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:colorize-compilation-buffer</span> ()
(<span style="font-weight: bold;">let</span> ((was-read-only buffer-read-only))
(<span style="font-weight: bold;">unwind-protect</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">when</span> was-read-only
(read-only-mode -1))
(ansi-color-apply-on-region (point-min) (point-max)))
(<span style="font-weight: bold;">when</span> was-read-only
(read-only-mode +1)))))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(add-hook 'compilation-filter-hook 'imalison:colorize-compilation-buffer)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org0de4d7b" class="outline-3">
<h3 id="org0de4d7b"><span class="section-number-3">18.10</span> Automatic Theme Changer</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-10">
2016-10-19 19:13:32 -06:00
<p>
Disabled for now
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">use-package</span> <span style="font-weight: bold; text-decoration: underline;">theme-changer</span>
<span style="font-weight: bold;">:disabled</span> t
<span style="font-weight: bold;">:config</span>
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">destructuring-bind</span> (latitude longitude)
(imalison:get-lat-long)
(<span style="font-weight: bold;">setq</span> calendar-latitude latitude)
(<span style="font-weight: bold;">setq</span> calendar-longitude longitude))))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org24eafcb" class="outline-3">
<h3 id="org24eafcb"><span class="section-number-3">18.11</span> Fix <code>ansi-term</code> Colors</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-11">
2016-10-19 19:13:32 -06:00
<p>
For some reason, loading certain themes can cause colors in
<code>ansi-term-color-vector</code> to be undefined. The following code handles restoring
the original <code>ansi-term-color-vector</code> state. The code is exectued in a
load-theme hook (See the heading below).
</p>
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">term</span>)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:ansi-term-color-vector</span> ansi-term-color-vector)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:ansi-term-color-vector-broken?</span> ()
(<span style="font-weight: bold;">--some</span> (<span style="font-weight: bold;">or</span> (eq <span style="font-weight: bold; font-style: italic;">it</span> 'unspecified) (not (symbolp <span style="font-weight: bold; font-style: italic;">it</span>)))
(append ansi-term-color-vector nil)))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:restore-ansi-term-color-vector</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> force)
(<span style="font-weight: bold;">when</span> (<span style="font-weight: bold;">or</span> force (imalison:ansi-term-color-vector-broken?))
(<span style="font-weight: bold;">setq</span> ansi-term-color-vector imalison:ansi-term-color-vector)))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-org53bf161" class="outline-3">
<h3 id="org53bf161"><span class="section-number-3">18.12</span> After <code>load-theme</code> hook</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-12">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:light-theme</span> 'solarized-light)
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:dark-theme</span> 'material)
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:after-load-theme</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> _args)
(<span style="font-weight: bold;">when</span> (fboundp 'powerline-reset)
(powerline-reset))
(set-face-background 'fringe (face-background 'default))
(imalison:restore-ansi-term-color-vector))
2016-10-19 19:13:32 -06:00
2016-11-07 12:57:02 -07:00
(advice-add 'load-theme <span style="font-weight: bold;">:after</span> #'imalison:after-load-theme)
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orgd0b889c" class="outline-3">
<h3 id="orgd0b889c"><span class="section-number-3">18.13</span> Frame Initialization</h3>
2016-10-25 15:21:45 -06:00
<div class="outline-text-3" id="text-18-13">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">imalison:linum-format</span>)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:format-linum</span> (line-text)
(propertize (format imalison:linum-format line-text) 'face 'linum))
(make-variable-buffer-local 'imalison:linum-format)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:linum-before-numbering-hook</span> ()
(<span style="font-weight: bold;">setq</span> imalison:linum-format
(concat <span style="font-style: italic;">"%"</span> (number-to-string
(max (length
(number-to-string
(count-lines (point-min) (point-max)))) 3)) <span style="font-style: italic;">"d"</span>)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:remove-fringe-and-hl-line-mode</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;rest</span> _stuff)
(<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">if</span> (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(<span style="font-weight: bold;">if</span> (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(<span style="font-weight: bold;">if</span> (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(<span style="font-weight: bold;">defvar-setq</span> linum-format 'imalison:format-linum)
(add-hook 'linum-before-numbering-hook 'imalison:linum-before-numbering-hook)
(<span style="font-weight: bold;">setq</span> left-margin-width 0)
(<span style="font-weight: bold;">defvar-setq</span> hl-line-mode nil))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">imalison:appearance</span> (<span style="font-weight: bold; text-decoration: underline;">&amp;optional</span> frame)
(<span style="font-weight: bold;">interactive</span> (list nil))
(<span style="font-weight: bold;">if</span> (display-graphic-p)
(<span style="font-weight: bold;">progn</span>
(<span style="font-weight: bold;">condition-case</span> error
(set-face-attribute 'default nil <span style="font-weight: bold;">:font</span> <span style="font-style: italic;">"source code pro"</span>)
('error (message <span style="font-style: italic;">"Error: %s, when setting font"</span> error)))
(set-face-attribute 'default nil <span style="font-weight: bold;">:weight</span> 'semi-bold)
(set-face-attribute
'default nil <span style="font-weight: bold;">:height</span> imalison:default-font-size-pt))
(<span style="font-weight: bold;">progn</span>
(load-theme 'source-code-pro t)
(message <span style="font-style: italic;">"not setting font"</span>)))
(<span style="font-weight: bold;">setq</span> powerline-default-separator (<span style="font-weight: bold;">if</span> (display-graphic-p) 'wave 'utf-8))
(load-theme imalison:dark-theme t)
(spaceline-compile)
(imalison:remove-fringe-and-hl-line-mode))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">This is needed because you can't set the font or theme at daemon start-up.</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(when (display-graphic-p) (imalison:appearance))</span>
(add-hook 'after-init-hook 'imalison:appearance)
(add-hook 'after-make-frame-functions 'imalison:appearance)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">TODO/XXX: why do we immediately remove this hook?</span>
(remove-hook 'after-make-frame-functions 'imalison:appearance)
</pre>
</div>
</div>
</div>
</div>
2016-11-07 17:41:36 -07:00
<div id="outline-container-orga17c277" class="outline-2">
<h2 id="orga17c277"><span class="section-number-2">19</span> Post Init Custom</h2>
2016-10-25 15:21:45 -06:00
<div class="outline-text-2" id="text-19">
2016-10-19 19:13:32 -06:00
<div class="org-src-container">
2016-11-07 12:57:02 -07:00
<pre class="src src-emacs-lisp">(<span style="font-weight: bold;">when</span> (file-exists-p custom-after-file) (load custom-after-file))
(<span style="font-weight: bold;">when</span> (file-exists-p machine-custom) (load machine-custom))
2016-10-19 19:13:32 -06:00
</pre>
</div>
</div>
</div>
2016-10-19 18:25:46 -06:00
</div>
<div id="postamble" class="status">
<p class="author">Author: Ivan Malison</p>
2016-11-07 17:41:36 -07:00
<p class="date">Created: 2016-11-07 Mon 16:42</p>
2016-10-19 18:25:46 -06:00
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>
</html>