|
1 |
| -<?xml version="1.0" encoding="iso-8859-1"?> |
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3 |
| - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 | +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
4 | 4 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
5 | 5 | <head>
|
6 | 6 | <title>Starter Kit Defuns</title>
|
7 |
| -<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/> |
8 |
| -<meta name="title" content="Starter Kit Defuns"/> |
9 |
| -<meta name="generator" content="Org-mode"/> |
10 |
| -<meta name="generated" content="2011-12-23 11:23:57 MST"/> |
11 |
| -<meta name="author" content="Eric Schulte"/> |
12 |
| -<meta name="description" content=""/> |
13 |
| -<meta name="keywords" content=""/> |
| 7 | +<!-- 2014-10-13 Mon 22:00 --> |
| 8 | +<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> |
| 9 | +<meta name="generator" content="Org-mode" /> |
14 | 10 | <style type="text/css">
|
15 | 11 | <!--/*--><![CDATA[/*><!--*/
|
16 |
| - html { font-family: Times, serif; font-size: 12pt; } |
17 | 12 | .title { text-align: center; }
|
18 |
| - .todo { color: red; } |
| 13 | + .todo { font-family: monospace; color: red; } |
19 | 14 | .done { color: green; }
|
20 |
| - .tag { background-color: #add8e6; font-weight:normal } |
21 |
| - .target { } |
| 15 | + .tag { background-color: #eee; font-family: monospace; |
| 16 | + padding: 2px; font-size: 80%; font-weight: normal; } |
22 | 17 | .timestamp { color: #bebebe; }
|
23 | 18 | .timestamp-kwd { color: #5f9ea0; }
|
24 |
| - .right {margin-left:auto; margin-right:0px; text-align:right;} |
25 |
| - .left {margin-left:0px; margin-right:auto; text-align:left;} |
26 |
| - .center {margin-left:auto; margin-right:auto; text-align:center;} |
27 |
| - p.verse { margin-left: 3% } |
| 19 | + .right { margin-left: auto; margin-right: 0px; text-align: right; } |
| 20 | + .left { margin-left: 0px; margin-right: auto; text-align: left; } |
| 21 | + .center { margin-left: auto; margin-right: auto; text-align: center; } |
| 22 | + .underline { text-decoration: underline; } |
| 23 | + #postamble p, #preamble p { font-size: 90%; margin: .2em; } |
| 24 | + p.verse { margin-left: 3%; } |
28 | 25 | pre {
|
29 |
| - border: 1pt solid #AEBDCC; |
30 |
| - background-color: #F3F5F7; |
31 |
| - padding: 5pt; |
32 |
| - font-family: courier, monospace; |
33 |
| - font-size: 90%; |
34 |
| - overflow:auto; |
| 26 | + border: 1px solid #ccc; |
| 27 | + box-shadow: 3px 3px 3px #eee; |
| 28 | + padding: 8pt; |
| 29 | + font-family: monospace; |
| 30 | + overflow: auto; |
| 31 | + margin: 1.2em; |
35 | 32 | }
|
36 |
| - table { border-collapse: collapse; } |
37 |
| - td, th { vertical-align: top; } |
38 |
| - th.right { text-align:center; } |
39 |
| - th.left { text-align:center; } |
40 |
| - th.center { text-align:center; } |
41 |
| - td.right { text-align:right; } |
42 |
| - td.left { text-align:left; } |
43 |
| - td.center { text-align:center; } |
| 33 | + pre.src { |
| 34 | + position: relative; |
| 35 | + overflow: visible; |
| 36 | + padding-top: 1.2em; |
| 37 | + } |
| 38 | + pre.src:before { |
| 39 | + display: none; |
| 40 | + position: absolute; |
| 41 | + background-color: white; |
| 42 | + top: -10px; |
| 43 | + right: 10px; |
| 44 | + padding: 3px; |
| 45 | + border: 1px solid black; |
| 46 | + } |
| 47 | + pre.src:hover:before { display: inline;} |
| 48 | + pre.src-sh:before { content: 'sh'; } |
| 49 | + pre.src-bash:before { content: 'sh'; } |
| 50 | + pre.src-emacs-lisp:before { content: 'Emacs Lisp'; } |
| 51 | + pre.src-R:before { content: 'R'; } |
| 52 | + pre.src-perl:before { content: 'Perl'; } |
| 53 | + pre.src-java:before { content: 'Java'; } |
| 54 | + pre.src-sql:before { content: 'SQL'; } |
| 55 | + |
| 56 | + table { border-collapse:collapse; } |
| 57 | + caption.t-above { caption-side: top; } |
| 58 | + caption.t-bottom { caption-side: bottom; } |
| 59 | + td, th { vertical-align:top; } |
| 60 | + th.right { text-align: center; } |
| 61 | + th.left { text-align: center; } |
| 62 | + th.center { text-align: center; } |
| 63 | + td.right { text-align: right; } |
| 64 | + td.left { text-align: left; } |
| 65 | + td.center { text-align: center; } |
44 | 66 | dt { font-weight: bold; }
|
45 |
| - div.figure { padding: 0.5em; } |
46 |
| - div.figure p { text-align: center; } |
47 |
| - div.inlinetask { |
48 |
| - padding:10px; |
49 |
| - border:2px solid gray; |
50 |
| - margin:10px; |
| 67 | + .footpara:nth-child(2) { display: inline; } |
| 68 | + .footpara { display: block; } |
| 69 | + .footdef { margin-bottom: 1em; } |
| 70 | + .figure { padding: 1em; } |
| 71 | + .figure p { text-align: center; } |
| 72 | + .inlinetask { |
| 73 | + padding: 10px; |
| 74 | + border: 2px solid gray; |
| 75 | + margin: 10px; |
51 | 76 | background: #ffffcc;
|
52 | 77 | }
|
| 78 | + #org-div-home-and-up |
| 79 | + { text-align: right; font-size: 70%; white-space: nowrap; } |
53 | 80 | textarea { overflow-x: auto; }
|
54 |
| - .linenr { font-size:smaller } |
55 |
| - .code-highlighted {background-color:#ffff00;} |
56 |
| - .org-info-js_info-navigation { border-style:none; } |
57 |
| - #org-info-js_console-label { font-size:10px; font-weight:bold; |
58 |
| - white-space:nowrap; } |
59 |
| - .org-info-js_search-highlight {background-color:#ffff00; color:#000000; |
60 |
| - font-weight:bold; } |
| 81 | + .linenr { font-size: smaller } |
| 82 | + .code-highlighted { background-color: #ffff00; } |
| 83 | + .org-info-js_info-navigation { border-style: none; } |
| 84 | + #org-info-js_console-label |
| 85 | + { font-size: 10px; font-weight: bold; white-space: nowrap; } |
| 86 | + .org-info-js_search-highlight |
| 87 | + { background-color: #ffff00; color: #000000; font-weight: bold; } |
61 | 88 | /*]]>*/-->
|
62 |
| -</style><link rel="stylesheet" href="emacs.css" type="text/css"/> |
63 |
| -<style type="text/css"> |
64 |
| - pre{background:#232323; color:#E6E1DC;} |
65 |
| - code{font-size:10pt; color:#353535;} |
66 |
| - .outline-text-2{margin-left: 1em;} |
67 |
| - .outline-text-3{margin-left: 2em;} |
68 |
| - .outline-text-3{margin-left: 3em;} |
69 | 89 | </style>
|
70 | 90 | <script type="text/javascript">
|
| 91 | +/* |
| 92 | +@licstart The following is the entire license notice for the |
| 93 | +JavaScript code in this tag. |
| 94 | +
|
| 95 | +Copyright (C) 2012-2013 Free Software Foundation, Inc. |
| 96 | +
|
| 97 | +The JavaScript code in this tag is free software: you can |
| 98 | +redistribute it and/or modify it under the terms of the GNU |
| 99 | +General Public License (GNU GPL) as published by the Free Software |
| 100 | +Foundation, either version 3 of the License, or (at your option) |
| 101 | +any later version. The code is distributed WITHOUT ANY WARRANTY; |
| 102 | +without even the implied warranty of MERCHANTABILITY or FITNESS |
| 103 | +FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. |
| 104 | +
|
| 105 | +As additional permission under GNU GPL version 3 section 7, you |
| 106 | +may distribute non-source (e.g., minimized or compacted) forms of |
| 107 | +that code without the copy of the GNU GPL normally required by |
| 108 | +section 4, provided you include this license notice and a URL |
| 109 | +through which recipients can access the Corresponding Source. |
| 110 | +
|
| 111 | +
|
| 112 | +@licend The above is the entire license notice |
| 113 | +for the JavaScript code in this tag. |
| 114 | +*/ |
71 | 115 | <!--/*--><![CDATA[/*><!--*/
|
72 | 116 | function CodeHighlightOn(elem, id)
|
73 | 117 | {
|
|
89 | 133 | }
|
90 | 134 | /*]]>*///-->
|
91 | 135 | </script>
|
92 |
| - |
93 | 136 | </head>
|
94 | 137 | <body>
|
95 |
| - |
96 |
| -<div id="preamble"> |
97 |
| - |
98 |
| -</div> |
99 |
| - |
100 | 138 | <div id="content">
|
101 | 139 | <h1 class="title">Starter Kit Defuns</h1>
|
102 |
| - |
103 |
| -<p>This is part of the <a href="starter-kit.html">Emacs Starter Kit</a>. |
| 140 | +<p> |
| 141 | +This is part of the <a href="starter-kit.html">Emacs Starter Kit</a>. |
104 | 142 | </p>
|
105 | 143 |
|
106 |
| -<div id="outline-container-1" class="outline-2"> |
| 144 | +<div id="outline-container-sec-1" class="outline-2"> |
107 | 145 | <h2 id="sec-1">The starter-kit-coding-hook:</h2>
|
108 | 146 | <div class="outline-text-2" id="text-1">
|
109 |
| - |
110 |
| -<p>A single hook holding those functions which should be run in <b>every</b> |
| 147 | +<p> |
| 148 | +A single hook holding those functions which should be run in <b>every</b> |
111 | 149 | code buffer.
|
112 | 150 | </p>
|
| 151 | + |
113 | 152 | <p>
|
114 | 153 | We have a number of turn-on-* functions since it's advised that lambda
|
115 | 154 | functions not go in hooks. Repeatedly evaling an add-to-list with a
|
116 | 155 | hook value will repeatedly add it since there's no way to ensure that
|
117 | 156 | a lambda doesn't already exist in the list.
|
118 | 157 | </p>
|
119 | 158 |
|
| 159 | +<div class="org-src-container"> |
120 | 160 |
|
| 161 | +<pre class="src src-emacs-lisp" id="starter-kit-hook-functions">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">starter-kit-local-column-number-mode</span> () |
| 162 | + (make-local-variable 'column-number-mode) |
| 163 | + (column-number-mode t)) |
121 | 164 |
|
122 |
| -<pre class="src src-emacs-lisp"><span class="org-starter-kit-paren">(</span><span class="org-keyword">defun</span> <span class="org-function-name">starter-kit-local-column-number-mode</span> <span class="org-starter-kit-paren">()</span> |
123 |
| - <span class="org-starter-kit-paren">(</span>make-local-variable 'column-number-mode<span class="org-starter-kit-paren">)</span> |
124 |
| - <span class="org-starter-kit-paren">(</span>column-number-mode t<span class="org-starter-kit-paren">))</span> |
| 165 | +(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">starter-kit-local-comment-auto-fill</span> () |
| 166 | + (set (make-local-variable 'comment-auto-fill-only-comments) t) |
| 167 | + (auto-fill-mode t)) |
125 | 168 |
|
126 |
| -<span class="org-starter-kit-paren">(</span><span class="org-keyword">defun</span> <span class="org-function-name">starter-kit-local-comment-auto-fill</span> <span class="org-starter-kit-paren">()</span> |
127 |
| - <span class="org-starter-kit-paren">(</span>set <span class="org-starter-kit-paren">(</span>make-local-variable 'comment-auto-fill-only-comments<span class="org-starter-kit-paren">)</span> t<span class="org-starter-kit-paren">)</span> |
128 |
| - <span class="org-starter-kit-paren">(</span>auto-fill-mode t<span class="org-starter-kit-paren">))</span> |
| 169 | +(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">starter-kit-turn-on-save-place-mode</span> () |
| 170 | + (setq save-place t)) |
129 | 171 |
|
130 |
| -<span class="org-starter-kit-paren">(</span><span class="org-keyword">defun</span> <span class="org-function-name">starter-kit-turn-on-save-place-mode</span> <span class="org-starter-kit-paren">()</span> |
131 |
| - <span class="org-starter-kit-paren">(</span>setq save-place t<span class="org-starter-kit-paren">))</span> |
132 |
| - |
133 |
| -<span class="org-starter-kit-paren">(</span><span class="org-keyword">defun</span> <span class="org-function-name">starter-kit-turn-on-whitespace</span> <span class="org-starter-kit-paren">()</span> |
134 |
| - <span class="org-starter-kit-paren">(</span>whitespace-mode t<span class="org-starter-kit-paren">))</span> |
| 172 | +(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">starter-kit-turn-on-whitespace</span> () |
| 173 | + (whitespace-mode t)) |
135 | 174 | </pre>
|
| 175 | +</div> |
136 | 176 |
|
| 177 | +<div class="org-src-container"> |
137 | 178 |
|
138 |
| - |
139 |
| -<pre class="src src-emacs-lisp"><span class="org-starter-kit-paren">(</span>add-hook 'starter-kit-coding-hook 'starter-kit-local-column-number-mode<span class="org-starter-kit-paren">)</span> |
| 179 | +<pre class="src src-emacs-lisp" id="starter-kit-add-local-column-number-mode">(add-hook 'starter-kit-coding-hook 'starter-kit-local-column-number-mode) |
140 | 180 | </pre>
|
| 181 | +</div> |
141 | 182 |
|
| 183 | +<div class="org-src-container"> |
142 | 184 |
|
143 |
| - |
144 |
| -<pre class="src src-emacs-lisp"><span class="org-starter-kit-paren">(</span>add-hook 'starter-kit-coding-hook 'starter-kit-local-comment-auto-fill<span class="org-starter-kit-paren">)</span> |
| 185 | +<pre class="src src-emacs-lisp" id="start-kit-add-local-comment-auto-fill">(add-hook 'starter-kit-coding-hook 'starter-kit-local-comment-auto-fill) |
145 | 186 | </pre>
|
| 187 | +</div> |
146 | 188 |
|
| 189 | +<div class="org-src-container"> |
147 | 190 |
|
148 |
| - |
149 |
| -<pre class="src src-emacs-lisp"><span class="org-starter-kit-paren">(</span><span class="org-keyword">when</span> <span class="org-starter-kit-paren">(</span>window-system<span class="org-starter-kit-paren">)</span> |
150 |
| - <span class="org-starter-kit-paren">(</span>add-hook 'starter-kit-coding-hook 'starter-kit-pretty-lambdas<span class="org-starter-kit-paren">))</span> |
| 191 | +<pre class="src src-emacs-lisp" id="starter-kit-add-pretty-lambdas">(<span style="font-weight: bold;">when</span> (window-system) |
| 192 | + (add-hook 'starter-kit-coding-hook 'starter-kit-pretty-lambdas)) |
151 | 193 | </pre>
|
| 194 | +</div> |
152 | 195 |
|
| 196 | +<div class="org-src-container"> |
153 | 197 |
|
154 |
| - |
155 |
| -<pre class="src src-emacs-lisp"><span class="org-starter-kit-paren">(</span><span class="org-keyword">defun</span> <span class="org-function-name">run-starter-kit-coding-hook</span> <span class="org-starter-kit-paren">()</span> |
156 |
| - <span class="org-doc">"Enable things that are convenient across all coding buffers."</span> |
157 |
| - <span class="org-starter-kit-paren">(</span>run-hooks 'starter-kit-coding-hook<span class="org-starter-kit-paren">))</span> |
| 198 | +<pre class="src src-emacs-lisp" id="starter-kit-run-starter-kit-coding-hook">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">run-starter-kit-coding-hook</span> () |
| 199 | + <span style="font-style: italic;">"Enable things that are convenient across all coding buffers."</span> |
| 200 | + (run-hooks 'starter-kit-coding-hook)) |
158 | 201 | </pre>
|
| 202 | +</div> |
159 | 203 |
|
| 204 | +<div class="org-src-container"> |
| 205 | + |
| 206 | +<pre class="src src-emacs-lisp" id="starter-kit-recentf-ido-find-file">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">recentf-ido-find-file</span> () |
| 207 | + <span style="font-style: italic;">"Find a recent file using Ido."</span> |
| 208 | + (interactive) |
| 209 | + (<span style="font-weight: bold;">let*</span> ((file-assoc-list |
| 210 | + (mapcar (<span style="font-weight: bold;">lambda</span> (x) |
| 211 | + (cons (file-name-nondirectory x) |
| 212 | + x)) |
| 213 | + recentf-list)) |
| 214 | + (filename-list |
| 215 | + (remove-duplicates (mapcar #'car file-assoc-list) |
| 216 | + <span style="font-weight: bold;">:test</span> #'string=)) |
| 217 | + (filename (ido-completing-read <span style="font-style: italic;">"Choose recent file: "</span> |
| 218 | + filename-list |
| 219 | + nil |
| 220 | + t))) |
| 221 | + (<span style="font-weight: bold;">when</span> filename |
| 222 | + (find-file (cdr (assoc filename |
| 223 | + file-assoc-list)))))) |
| 224 | +</pre> |
| 225 | +</div> |
160 | 226 | </div>
|
161 | 227 | </div>
|
162 | 228 | </div>
|
163 |
| - |
164 | 229 | </body>
|
165 | 230 | </html>
|
0 commit comments