Revert "html update"
[clinton/website/site/unknownlamer.org.git] / planner-cke.el.html
1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml">
5 <head>
6 <title>planner-cke.el</title>
7 <meta name="generator" content="muse.el" />
8 <meta http-equiv="Content-Type"
9 content="text/html; charset=utf-8" />
10 <link href="http://feeds.unknownlamer.org/rss/site-updates"
11 rel="alternate" type="application/rss+xml" title="Updates Feed" />
12
13 <link rel="stylesheet" href="default.css" />
14 </head>
15 <body>
16 <h1>planner-cke.el</h1>
17 <div class="contents">
18 <dl>
19 </dl>
20 </div>
21
22
23 <!-- Page published by Emacs Muse begins here --><p>;;; Planner Mode Settings
24 (require 'planner)</p>
25
26 <p>;;; Basic Config
27 (setq planner-carry-tasks-forward 1)
28 (setq planner-project &quot;clintons-plans&quot;)</p>
29
30 <p>(setq planner-use-other-window nil)</p>
31
32 <p>;;; Planner template
33 (setq planner-day-page-template
34 <p style="text-align: center;">
35 &quot;* Tasks\n\n\n* Schedule\n\n\n* Notes\n\n\n* Timeclock\n\n\n* Accomplishments\n\n&quot;)
36 </p>
37
38 <p>;;; General Key Bindings
39 (global-set-key [?\C-c ?p ?p] #'plan)
40 (global-set-key [?\C-c ?p ?d] #'planner-goto-today)
41 (global-set-key [?\C-c ?p ?b] #'planner-create-task-from-buffer)
42 (global-set-key [?\C-c ?p ?B] #'cke-planner-create-task-from-buffer-extended)
43 (global-set-key [?\C-c ?p ?t] #'planner-create-task)
44 (global-set-key [?\C-c ?p ?T] #'cke-planner-create-task-extended)
45 (global-set-key [?\C-c ?r] #'remember)</p>
46
47 <p>;; My emacs runs continually and this ensures that my todo list will
48 ;; be in front of me when I wake up in the morning
49 (add-hook 'midnight-hook #'(lambda ()
50 <p style="text-align: center;">
51 ;; Rebind hook to nil to supress prompts
52 ;; for auto created cyclic tasks
53 (let ((planner-create-task-hook nil)
54 ;; Only try to create cyclic tasks
55 ;; when new page is created
56 ;; automatically because it is
57 ;; annoying as hell to have the
58 ;; prompts for my cyclic tasks to
59 ;; come up when scheduling future
60 ;; tasks.
61 (planner-mode-hook (cons #'planner-cyclic-create-tasks-maybe
62 planner-mode-hook)))
63 (plan))))
64 </p>
65
66 <p>;;; Extra task interfaces
67 (require 'planner-w3m)
68 (require 'planner-bibtex)
69 (require 'planner-bookmark)</p>
70
71 <p>(require 'planner-publish)</p>
72
73 <p>(setq planner-html-inner-header
74 <p style="text-align: center;">
75 &quot;&lt;calendar arrows=\&quot;t\&quot;&gt;
76 &quot;)
77 </p>
78
79 <p>(setq planner-calendar-prev-month-button
80 <p style="text-align: center;">
81 &quot;&lt;&lt;&quot;)
82 (setq planner-calendar-next-month-button
83 &quot;&gt;&gt;&quot;)
84 </p>
85
86 <p>;;; Remember
87 (require 'remember-planner)
88 (setq remember-handler-functions '(remember-planner-append))
89 (setq remember-annotation-functions planner-annotation-functions)</p>
90
91 <p>;; Local Keybindings
92 (define-key planner-mode-map [?\C-c ?n] #'planner-create-note-from-task)
93 (define-key planner-mode-map [?\C-c ?d] #'planner-deadline-change)</p>
94
95 <p>(require 'planner-gnus)
96 (planner-gnus-insinuate)</p>
97
98 <p>;; Prompt for a deadline in addition to start date when creating new tasks
99 (require 'planner-deadline)</p>
100
101 <p>(planner-calendar-insinuate)
102 (define-key global-map [?\C-c ?p ?c] #'calendar)</p>
103
104
105 <p>;;; Ranking customizations
106 (require 'planner-rank)</p>
107
108 <p>;; Asks for importance before deadline to allow adding importance to
109 ;; tasks without a deadline.
110 (defun cke-planner-deadline-add (date)
111 <blockquote>
112 <p class="quoted">(interactive (list (planner-read-date nil t)))
113 ;; Overload this for the extent because I don't care
114 ;; about manually setting the urgency; a task lacking a
115 ;; deadline is for me one with 'average' urgency.
116 (cond (date (planner-deadline-add date))
117 (t
118 (flet ((planner-rank-read-importance-and-urgency
119 ()
120 (list
121 (string-to-number
122 (read-string &quot;Importance: &quot;
123 nil
124 nil
125 (number-to-string
126 planner-rank-default-importance)))
127 planner-rank-default-urgency)))
128 (planner-rank-change)))))</p>
129 </blockquote>
130
131 <p>(defun cke-planner-call-extended (fun)
132 <blockquote>
133 <p class="quoted">(let ((planner-create-task-hook
134 (cons #'(lambda ()
135 (call-interactively #'cke-planner-deadline-add))
136 planner-create-task-hook)))
137 (call-interactively fun)))</p>
138 </blockquote>
139
140 <p>(defun cke-planner-create-task-extended ()
141 <blockquote>
142 <p class="quoted">&quot;Prompt for deadline and/or importance when creating a task&quot;
143 (interactive)
144 (cke-planner-call-extended #'planner-create-task))</p>
145 </blockquote>
146
147 <p>(defun cke-planner-create-task-from-buffer-extended ()
148 <blockquote>
149 <p class="quoted">&quot;Prompt for deadline and/or importance when creating a task from a buffer&quot;
150 (interactive)
151 (cke-planner-call-extended #'planner-create-task-from-buffer))</p>
152 </blockquote>
153
154 <p>(setq planner-sort-tasks-key-function
155 <p style="text-align: center;">
156 <a name="'planner-sort-tasks-by-rank)" id="'planner-sort-tasks-by-rank)"></a>
157 </p>
158
159 <p>(setq planner-rank-importance-vs-urgency-factor 1.5)</p>
160
161 <p>(setq planner-rank-priority-A-valve 6.49)
162 (setq planner-rank-priority-B-valve 4.49)</p>
163
164 <p>;;; note: tenative
165 ;(setq planner-rank-deadline-urgency-map-list '(-1 0 4 10 21 30 90 180 365))</p>
166
167 <p>(define-key planner-mode-map [?\C-c ?i] #'planner-rank-change)</p>
168
169 <p>;;; Cyclic Tasks
170 (require 'planner-cyclic)</p>
171
172 <p>(setq planner-cyclic-diary-file &quot;~/plans/diary.cyclic-tasks&quot;)</p>
173
174 <p>;; Cyclic tasks are only created when #'plan is run by midnight-mode
175 (remove-hook 'planner-mode-hook 'planner-cyclic-create-tasks-maybe)</p>
176
177 <p>;;; Task IDs
178 (require 'planner-id)</p>
179
180 <p>(setq planner-id-tracking-file &quot;~/plans/.planner-id&quot;)</p>
181
182
183 <p>;;; Experimental
184 (defun cke-planner-get-annot ()
185 <blockquote>
186 <p class="quoted">(interactive)
187 (kill-new (or (run-hook-with-args-until-success
188 'planner-annotation-functions)
189 &quot;&quot;)))</p>
190 </blockquote>
191
192 <p>(define-key global-map [?\C-c ?p ?a] #'cke-planner-get-annot)</p>
193
194 <p>(require 'planner-schedule)
195 ;(require 'planner-timeclock)
196 ;(require 'planner-timeclock-summary)</p>
197
198 <p>(setq timeclock-file (cke-personal-file &quot;timelog&quot;))</p>
199
200 <p>;(planner-timeclock-summary-insinuate)</p>
201
202 <p>(define-key planner-mode-map [?\C-c ?\C-o] #'(lambda ()
203 <p style="text-align: center;">
204 (interactive)
205 (planner-task-open)
206 (timeclock-out)))
207 </p>
208
209 <p>(require 'planner-calendar)</p>
210
211 <p>(setq planner-calendar-today-page-name &quot;index&quot;)</p>
212
213 <p>;; 2018-10-26 seems to be broken...
214 ;(eval-after-load &quot;muse-publish&quot;</p>
215
216
217
218 <p>(require 'planner-accomplishments)</p>
219
220 <p>(setq planner-accomplishments-status-display
221 <p style="text-align: center;">
222 '((&quot;_&quot; . &quot;Unfinished&quot;)
223 ; (&quot;o&quot; . &quot;In progress&quot;)
224 ; (&quot;D&quot; . &quot;Delegated&quot;)
225 (&quot;P&quot; . &quot;Postponed&quot;)
226 (&quot;X&quot; . &quot;Completed&quot;)
227 (&quot;C&quot; . &quot;Cancelled&quot;)))
228 </p>
229
230 <p>(planner-accomplishments-insinuate)</p>
231
232 <p>;;; Special task creation functions</p>
233
234 <p>(defun cke-planner-create-book-tasks-range (title start end)
235 <blockquote>
236 <p class="quoted">&quot;Create undated tasks for reading individual sections of a
237 book&quot;
238 (interactive &quot;MTitle: \nnStart: \nnEnd: &quot;)
239 (dotimes (chapter-base (- (1+ end) start))
240 (planner-create-task (format &quot;Reading: %s: Chapter %d&quot;
241 title (+ chapter-base start))
242 nil nil &quot;Reading&quot; &quot;P&quot;)))</p>
243 </blockquote>
244
245 <p>(defun cke-planner-create-book-tasks (title chapters)
246 <blockquote>
247 <p class="quoted">&quot;Create undated tasks for reading individual sections of a
248 book&quot;
249 (interactive &quot;MTitle: \nnChapters: &quot;)
250 (cke-planner-create-book-tasks-range title 1 chapters))</p>
251 </blockquote>
252
253 <p>(defun cke-planner-create-bicycle-light-tasks ()
254 <blockquote>
255 <p class="quoted">(interactive)
256 (let ((cke-date (planner-read-date))
257 (planner-default-task-priority &quot;A&quot;))
258 (mapc (lambda (task-description)
259 (planner-create-task task-description cke-date nil &quot;Bicycle&quot;))
260 '(&quot;Charge headlight&quot;
261 &quot;Charge LD-600 AAAs&quot;
262 &quot;Charge LD-1000 AAs&quot;))))</p>
263 </blockquote>
264
265 <p>(global-set-key [?\C-c ?p ?e ?b] #'cke-planner-create-book-tasks)
266 (global-set-key [?\C-c ?p ?e ?B] #'cke-planner-create-book-tasks-range)
267 (global-set-key [?\C-c ?p ?e ?l] #'cke-planner-create-bicycle-light-tasks)</p>
268
269
270 <p>;;; Diary Integration
271 ;; (require 'planner-diary)</p>
272
273 <p>(setq diary-file &quot;~/plans/diary&quot;)
274 ;; (add-hook 'diary-display-hook 'fancy-diary-display)</p>
275
276 <p>;; (setq planner-diary-string &quot;* Schedule&quot;)
277 ;; (setq planner-diary-use-diary t)
278 ;; (planner-diary-insinuate)</p>
279
280 <p>;;; Appointments
281 (require 'planner-appt)</p>
282
283 <p>(setq planner-appt-task-use-appointments-section-flag t)</p>
284
285 <p>(planner-appt-use-tasks)
286 (planner-appt-insinuate)</p>
287
288 <p>;;; BBDB
289 (require 'planner-bbdb)</p>
290
291 <p>;;; VC Integration
292 (require 'planner-log-edit)</p>
293
294 <p>;;; Misc Local Keybindings
295 (define-key planner-mode-map [?\C-c (control shift ?p)] #'planner-task-pending)</p>
296
297 <p>;;; Faces
298 (custom-set-faces
299 <blockquote>
300 <p class="quoted">'(planner-cancelled-task-face ((t (:foreground &quot;gray70&quot; :strike-through &quot;red&quot; :height 0.85))))
301 '(planner-completed-task-face ((t (:foreground &quot;gray70&quot; :strike-through &quot;green&quot; :height 0.85))))
302 '(planner-low-priority-task-face ((t (:foreground &quot;cyan&quot;)))))</p>
303 </blockquote>
304
305 <p>;;; Works in Progress</p>
306
307 <p>;; Next
308 ;; 1. overlay modification hooks
309 ;; a. behavior
310 ;; b. modifying overlay when text length changes
311 ;; 2. regex matching
312 ;; a. match groups
313 ;; 3. integrate with planner
314 ;; a. use planner deadline functions to match task deadline
315 ;; b. insert overlay
316 ;; i. manage overlay size when task is changed
317 ;; c. hook into planner
318 ;; 4. Cleanup
319 ;; a. create a category for the deadline overlay
320 ;; i. move properties from function to plist on category
321 (defun cke-planner-overlay-test ()
322 <blockquote>
323 <p class="quoted">(save-selected-window
324 (switch-to-buffer (get-buffer-create &quot;<em>foo</em>&quot;))
325 (let ((cke-overlay (or (car (overlays-at 8))
326 (make-overlay 8 13))))
327 (overlay-put cke-overlay 'before-string &quot;foo1&quot;)
328 (overlay-put cke-overlay 'invisible t))))</p>
329 </blockquote>
330
331 <p>;; Version control integration
332 (defun vc-darcs-init-version ()
333 <blockquote>
334 <p class="quoted">nil)</p>
335 </blockquote>
336
337 <p>;; this needs to only try to check in new files of the planner
338 ;; project, and then only when they are real files and not transient
339 ;; report buffers
340 (defadvice planner-prepare-file (after cke-planner-darcs-add
341 <p style="text-align: center;">
342 disable)
343 &quot;Add empty planner files to the current darcs repo if the
344 planner projects under vc&quot;
345 (set-buffer-modified-p t)
346 (save-buffer)
347 (when (and (buffer-file-name)
348 (eq (muse-project-of-file (buffer-file-name))
349 planner-project))
350 (let ((vc-default-init-version nil))
351 (if (not (condition-case nil
352 (vc-register nil nil)
353 (error t)))
354 (vc-checkin (buffer-file-name) nil &quot;Initial Checkin&quot;)))))
355 </p>
356
357 <p>(ad-unadvise #'planner-prepare-file)</p>
358 <!-- Page published by Emacs Muse ends here -->
359
360 <p class="cke-buttons">
361 <!-- validating badges, any browser, etc -->
362 <a href="http://validator.w3.org/check/referer"><img
363 src="http://www.w3.org/Icons/valid-xhtml10"
364 alt="Valid XHTML 1.0!" /></a>
365
366 <a href="http://www.anybrowser.org/campaign/"><img
367 src="img/buttons/w3c_ab.png" alt="[ Viewable With Any Browser
368 ]" /></a>
369
370 <a href="http://www.debian.org/"><img
371 src="img/buttons/debian.png" alt="[ Powered by Debian ]" /></a>
372
373 <a href="http://hcoop.net/">
374 <img src="img/buttons/hcoop.png"
375 alt="[ Hosted by HCoop]" />
376 </a>
377
378 <a href="http://www.fsf.org/register_form?referrer=114">
379 <img src="img/buttons/fsf_member.png"
380 alt="[ FSF Associate Member ]" />
381 </a>
382 </p>
383
384 <p class="cke-footer">Mike: I WAS NOT MICROWAVED.
385 </p>
386 <p class="cke-timestamp">Last Modified:
387 October 26, 2018</p>
388 </body>
389 </html>