turn off temporary debug
[dot-emacs] / my-init.org
1 #+TITLE: My Personal Init Customization
2 #+OPTIONS: toc:nil num:nil ^:nil
3 * copyright
4 # Copyright (C) 2016 Ian Kelling
5
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19 * things that should be at the beginning
20 #+begin_src emacs-lisp
21 ;; todo, evaluating this manually disables debug on error instead of toggling it
22 ;(toggle-debug-on-error) ;uncomment to help debug and catch errors
23
24
25 #+end_src
26
27
28 packages installed from package manager: i pretty much prioritize repos this way: gnu, then melpa, then marmalade.
29
30 package-activated-list:
31 ac-dabbrev ac-haskell-process ack-and-a-half alect-themes auctex bash-completion bbdb csv-mode cyberpunk-theme dot-mode expand-region f find-file-in-project flycheck foreign-regexp ggtags ghc gnuplot-mode goto-chg haskell-mode heroku-theme highlight-indentation highlight-symbol htmlize inf-ruby info+ inkpot-theme jedi auto-complete jedi-core epc ctable concurrent key-chord leuven-theme logstash-conf magit git-commit magit-popup misc-fns mouse+ naquadah-theme nginx-mode occidental-theme org paredit pcsv php-mode pkg-info epl popup py-autopep8 python-environment deferred python-info python-mode rainbow-mode rust-mode rw-hunspell s smartparens smex smooth-scroll sr-speedbar strings swiper ivy tabulated-list tangotango-theme thingatpt+ undo-tree vimrc-mode volatile-highlights web-mode with-editor dash async ws-butler yasnippet
32
33 alternate keyboards
34 #+begin_src emacs-lisp
35 ;; todo, figure out an easy way to disable this when using external keyboard
36 (if (display-graphic-p)
37 (setq
38 enter-key (kbd "<return>")
39 s-enter-key (kbd "<S-return>")
40 c-m-enter-key (kbd "<C-M-return>")
41 m-enter (kbd "<M-return>")
42 c-enter (kbd "<C-return>"))
43 (setq
44 enter-key (kbd "C-m")
45 s-enter-key (kbd "C-8")
46 c-m-enter-key (kbd "C-M-8")
47 m-enter (kbd "M-m")
48 c-enter (kbd "C-8")))
49
50 (setq x200 (string= (system-name) "x2"))
51 (setq search-key (if x200 "<menu>" "<kp-add>"))
52 (setq shell-key (if x200 "<S-menu>" "<S-kp-equal>"))
53 #+end_src
54
55 - Ubiquitous Packages which should be loaded on startup rather than
56 autoloaded on demand since they are likely to be used in every
57 session.
58 #+name: starter-kit-load-on-startup
59 #+begin_src emacs-lisp
60 (require 'saveplace)
61 (require 'ffap)
62 (require 'uniquify)
63 (require 'ansi-color)
64 (require 'recentf)
65
66 #+end_src
67
68
69 - Better to have a list of packages in here vs installed manually.
70 However, I install manually because sometimes there are two
71 versions and it is not necessarily easy to reconcile that.
72 #+begin_src emacs-lisp
73 ;; based on marmalage website front page.
74 (require 'package)
75
76 ;; little kit to help remove a down server
77 ;; (setq package-archives nil)
78
79 (add-to-list 'package-archives
80 '("marmalade" .
81 "http://marmalade-repo.org/packages/"))
82
83 (add-to-list 'package-archives
84 '("melpa" . "http://melpa.milkbox.net/packages/") t)
85
86 ;; if this is a new machine/config, get package list
87 ;; not sure why we need it, but it is recommended in starter kit,
88 ;; and doesn't seem like a bad thing
89 (unless package-archive-contents (package-refresh-contents))
90
91 #+end_src
92
93
94 keep our init.el clean, by moving customization elisp to it's own file
95 #+name: m-x-customize-customizations
96 #+begin_src emacs-lisp
97 (setq custom-file "~/.emacs.d/custom.el")
98 (load custom-file 'noerror)
99 #+end_src
100
101 undo tree stuff
102 #+begin_src emacs-lisp
103 ;; more resilient undo-tree-history if we have their locations set up front.
104 (setq undo-tree-history-directory-alist '(("." . "~/.undo-tree-history")))
105 ;; Undo in region just happens accidentally, and throws me off, and it's been buggy in the past
106 (setq undo-tree-enable-undo-in-region nil)
107 #+end_src
108
109 * Stuff that I do not recommend that others use without reading,
110 understanding, and customizing themselves are
111
112 all mouse stuff disabled till i have time to figure it out again.
113 #+begin_src emacs-lisp :tangle no
114 (defun xterm-mouse-translate-1 (&optional extension)
115 (save-excursion
116 (let* ((event (xterm-mouse-event extension))
117 (ev-command (nth 0 event))
118 (ev-data (nth 1 event))
119 (ev-where (nth 1 ev-data))
120 (vec (vector event))
121 (is-down (string-match "down-" (symbol-name ev-command))))
122
123 (cond
124 ((null event) nil) ;Unknown/bogus byte sequence!
125 (is-down
126 (setf (terminal-parameter nil 'xterm-mouse-last-down) event)
127 vec)
128 (t
129 (let* ((down (terminal-parameter nil 'xterm-mouse-last-down))
130 (down-data (nth 1 down))
131 (down-where (nth 1 down-data)))
132 (setf (terminal-parameter nil 'xterm-mouse-last-down) nil)
133 (cond
134 ((null down)
135 ;; This is an "up-only" event. Pretend there was an up-event
136 ;; right before and keep the up-event for later.
137 (push event unread-command-events)
138 (vector (cons (intern (replace-regexp-in-string
139 "\\`\\([ACMHSs]-\\)*" "\\&down-"
140 (symbol-name ev-command) t))
141 (cdr event))))
142 ((equal ev-where down-where) vec)
143 (t
144 (let ((drag (if (symbolp ev-where)
145 0 ;FIXME: Why?!?
146 (list (intern (replace-regexp-in-string
147 "\\`\\([ACMHSs]-\\)*" "\\&drag-"
148 (symbol-name ev-command) t))
149 down-data ev-data))))
150 (if (null track-mouse)
151 (vector drag)
152 (push drag unread-command-events)
153 (vector (list 'mouse-movement ev-data))))))))))))
154
155 #+end_src
156 * how to find auto-saved files that need recovering
157 find a recently dated file in ~/.emacs.d/auto-save-list/, and see the files listed in it.
158 #file# is an auto-save file. It may or may not be different than the file is corresponds to.
159 If it is different, emacs will give a message about recovering it when you open it.
160
161
162
163 * TODO shell mode reverse search hides 2nd+ line of multi-line result
164 * TODO report bug in latest emacs,
165 c-c ', does't exit org-mode src editing mode.
166 * TODO button for switching to scratch buffer
167 * TODO figure out browsing files with broken nfs mount
168 causes emacs to freeze until I kill -9 it.
169 * TODO make a keybind to print var under cursor
170 and actually, putting the start of it in th emodeline might be cool
171 * TODO fix undo tree files literering filesystem
172 * TODO c-<delete> in shell mode should send over
173 previous line if current line is empty
174 * TODO make c-m-s be just a control key for easier use
175 * TODO bind a in group mode of gnus to c-u a,
176 also, make a default for number of articles
177 * TODO make auto-complete be on by default in sql-mode
178 * TODO make an easy bind for open previous buffer
179 * TODO i think my autosave for sudo-edit might be too fast
180 it sometimes leaves #_asdfjasdf files littered
181 * TODO readline-compleste doesn't work when you cat a file without a newline,
182 and so the prompt is messed up. not sure exactly what needs to be in end, or if its anything
183 * TODO figure out how to paste a path into find file
184 probably have to use the old kind of find file
185 * TODO readline-complete doesn't escape special chars in filenames
186 * TODO readline-complete dev
187
188
189
190 ** misc fixes
191
192 bad code, the comment this relates to was removed, but not the comment
193 /* If waiting for this channel, arrange to return as
194 soon as no more input to be processed. No more
195 waiting. */
196
197
198 (status_notify): New arg WAIT_PROC. this is unused, this is a bug.
199 The change in status_notify's return is just passing more information
200 from what it did already. No changes at all inside this function.
201
202 * TODO consider whether to bind indent-for-tab-command
203 I removed it from m-tab for terminal compatibility.
204 It's the default tab command, which yasnippet replaces.
205 * TODO readline-complete: remove the hardcoded rlc-no-readline-hook
206 * TODO isearch doesn't automatically wrap in info
207 * TODO look into fixing shell mode reverse search
208 and why auto-complete dies
209 caveat is that it doesn't work well with certain unusual prompts, for example if $/# is not used at the end
210 see if we can load history, or reverse search with history commands
211 * TODO keybinds for s-delete/tab etc
212 * TODO fix bbdb info packaging in melpa
213 * TODO figure out why my emacs startup script doesn't work from dmenu
214 * TODO post idea to make customize group show function var names so we can read doc strings
215 * TODO report/fix bug that kill-whole-line doesn't work right with append kill
216 * TODO make bash keybind for copy paste interoperate with x windows
217 * TODO fix org stderr redirection
218 make this produce output of "ok"
219 #+begin_src sh
220 echo ok >&2
221
222 #+end_src
223 * TODO make ido keybinds better
224 * TODO fix indenting in org
225
226 (defun my-org-indent-region (start end)
227 "Indent region."
228 (interactive "r")
229 (save-excursion
230 (let ((line-end (org-current-line end)))
231 (goto-char start)
232 (while (< (org-current-line) line-end)
233 (cond ((org-in-src-block-p) (org-babel-do-in-edit-buffer (indent-according-to-mode)))
234 (t (call-interactively 'org-indent-line)))
235 (move-beginning-of-line 2)))))
236
237
238
239 org-indent-region is broken for source blocks
240 the above function works, but has several problems.
241 first: it should not have separate logic from org-indent-line
242 second: it runs way too slow, mainly the command
243 (org-babel-do-in-edit-buffer (indent-according-to-mode)))
244
245
246 * TODO figure out newline in prompt shell issue
247 setting this before readline-complete is loaded allows completion to work,
248 but auto-completion still fails. Need to debug readline-complete to figure this out.
249 (setq shell-prompt-pattern "^[^#$%>]*[#$]\n")
250 * TODO setup bind for find tag / lisp function at point
251
252 * TODO org-delete-char should also work for the delete/backspace keys!
253 fix and send patch
254
255 * TODO checkout projectile / graphene's project settings
256
257 * TODO check up on recent changes to 3rd party default configs
258 - last checked apr 24
259 https://github.com/eschulte/emacs24-starter-kit/commits/master
260
261 last checked mayish
262 https://github.com/bbatsov/prelude
263 - redefined mouse functions from this file
264
265 * TODO figure out how to setup emacs to format text nicely like thunderbird
266 * TODO it appears impossible make C-[ not be the same as escape
267 * TODO movement within info buffer after opening a link doesn't cancel isearch
268 leads to many frustrations
269 * TODO fix org resolve clock message. it is innacurate
270 i is not the same, becuase it does not make org realize there is an active clock
271
272 * TODO add apropos commands to help prefix, from
273 http://stackoverflow.com/questions/3124844/what-are-your-favorite-global-key-bindings-in-emacs
274 * TODO my autosave goes into an endless prompting loop
275 when running save buffer, and the buffer has been changed
276 outside of emacs
277 * TODO smart peren does not see ?\\) as a valid paren
278
279 * TODO why does org-end-of-line not go all the way to the end on a closed headline?
280 * TODO org makes random ... things, and delete right before them does ctrl-i
281 * TODO try mark word, which might be a useful keybind
282 * TODO fix org-cycle: it assumes which key it is bound to for its last alternative
283 * TODO checkout lisp-complete-symbol to augment auto-complete
284 * TODO learn dired.
285 * TODO emacs keylogger to optimize key binds
286 * TODO remap/investigate find tag, find tag at point
287 * TODO set key to cycle buffers by mode, example below
288
289 (defun cycle-buffer-by-mode (p-mode)
290 "Cycle buffers by mode name"
291 (interactive)
292 (dolist (buffer (buffer-list))
293 (with-current-buffer buffer
294 (when (buffer-live-p buffer)
295 (if (string-match p-mode mode-name) ;(regexp-quote p-mode)
296 (setq switch2buffer buffer)))))
297 (when (boundp 'switch2buffer)
298 (switch-to-buffer switch2buffer)))
299
300 And I have bound this to my F9 key
301
302 (global-set-key [f9] '(lambda () (interactive) (cycle-buffer-by-mode "Shell$")))
303
304 * TODO test out usefulness of forward/back sexp in different languages
305
306 * TODO major mode settings to check out in future
307 ** emacs24 starter kit
308 - Nxhtml -- utilities for web development
309 [[http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html][Nxhtml]] is a large package of utilities for web development and for
310 embedding multiple major modes in a single buffer.
311
312 Nxhtml is not installed in this version of the starter-kit by default,
313 for information on installing nxhtml see [[http://www.emacswiki.org/emacs/NxhtmlMode][EmacsWiki-Nxhtml]].
314
315 web-mode is competing package and actively developed, so i'm using that instead
316
317
318 (dolist (package '(yaml-mode js2-mode))
319 (unless (package-installed-p package)
320
321 - Associate modes with file extensions
322
323 (add-to-list 'auto-mode-alist '("COMMIT_EDITMSG$" . diff-mode))
324 (add-to-list 'auto-mode-alist '("\\.css$" . css-mode))
325 (require 'yaml-mode)
326 (add-to-list 'auto-mode-alist '("\\.ya?ml$" . yaml-mode))
327 (add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
328 (add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
329 (add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode))
330 ;; (add-to-list 'auto-mode-alist '("\\.xml$" . nxml-mode))
331
332 - clojure in starter-kit-lisp.org
333
334 - others = gnus, js, publish, perl, python, perl, ruby
335 they each have their own starter kit file.
336
337 - snippets for various modes other than org-mode
338
339 * TODO update yasnippet documentation
340 yas expand key customization is rediculously hard to figure out
341 and completely undocumented
342 * TODO fix org source indenting, send patch
343 * TODO check out bundling aka compiling yasnippet
344 * TODO try xml/html mode url func
345
346 (defun view-url ()
347 "Open a new buffer containing the contents of URL."
348 (interactive)
349 (let* ((default (thing-at-point-url-at-point))
350 (url (read-from-minibfer "URL: " default)))
351 (switch-to-buffer (url-retrieve-synchronously url))
352 (rename-buffer url t)
353 ;; TODO: switch to nxml/nxhtml mode
354 (cond ((search-forward "<?xml" nil t) (xml-mode))
355 ((search-forward "<html" nil t) (html-mode)))))
356
357 * TODO flyspell-buffer automatically
358
359 * TODO respond to ediff thread
360 * TODO fix horizontal mouse resizing
361 resizing a window horizontally with the mouse should be allowed in more places
362
363 * TODO try using / making abbreviations
364
365 * abbreviations
366 #+begin_src emacs-lisp
367
368 ;; turn on abbrev mode globally
369 (setq-default abbrev-mode t)
370
371 #+end_src
372 default abbreviation mode file is .emacs.d/abbrev_defs.
373 add-global-abbrev, add-mode-abbrev for expansion at point
374 if all else fails, edit the abbrev file
375
376 * auto-complete
377
378 #+begin_src emacs-lisp
379 ;; auto-completion in minibuffer
380 (icomplete-mode)
381
382 (require 'auto-complete-config)
383 (ac-config-default)
384
385
386 ;; complete after 1 char instead of default 2
387 (setq ac-auto-start 1)
388 (setq ac-delay 0.001)
389
390 (add-to-list 'ac-modes 'org-mode 'sql-mode)
391
392 (defun ac-common-setup ()
393 (add-to-list 'ac-sources 'ac-source-yasnippet))
394
395 ;; for org mode completion source taken from wiki.
396 ;; it did not work. no idea why. todo, investigate
397 ;; the ac-sources code is at http://www.emacswiki.org/emacs/AutoCompleteSources
398 ;; i've deleted it here so as to save space and not spam this file
399 ;;(defun my-ac-org-mode ()
400 ;; (setq ac-sources (append ac-sources '(ac-source-org))))
401
402
403 ;; this makes the org-self-insert command not do a flyspell spell check.
404 ;; low priority thing to look into sometime
405 (ac-flyspell-workaround)
406
407
408 (define-key ac-completing-map (kbd "<up>") nil)
409 (define-key ac-completing-map (kbd "<down>") nil)
410 (define-key ac-completing-map (kbd "<S-return>") 'ac-expand)
411 (define-key ac-completing-map "\t" 'ac-complete)
412 (define-key ac-completing-map (kbd "<tab>") 'ac-complete)
413
414
415
416 #+end_src
417 * auto-complete readline-complete
418 #+begin_src emacs-lisp
419
420 (add-to-list 'load-path "~/.emacs.d/src/readline-complete")
421 (require 'readline-complete)
422 ;; not sure how I made these, but I deleted, and
423 ;; it would be nice to make them again sometime
424 ;;(require 'src-loaddefs)
425
426 ;; disabled cuz broken
427 ;; redefining function in readline-complete so ac-complete only uses readline as a source
428 (defun ac-rlc-setup-sources ()
429 "Add me to shell-mode-hook!"
430 (setq ac-sources '(ac-source-shell)))
431 (add-hook 'shell-mode-hook 'ac-rlc-setup-sources)
432
433 ;; generally unnecessary, but why not
434 (setq explicit-shell-file-name "bash")
435
436 ;; readline-complete says to add this line.
437 ;; however, it messes up my procfs directory tracking hook
438 ;; because get-process doesn't notice the child shell.
439 ;; instead, I've removed export EMACS=t from
440 ;; comint-exec-1 (the function which initially sets it)
441 ;; by finding it in emacs sources and redefinind it here
442 ;; and done stty echo in my bashrc
443 ;;(setq explicit-bash-args '("-c" "export EMACS=; stty echo; bash"))
444
445 (setenv "EMACS" "")
446 (setq explicit-bash-args nil)
447 (setq comint-process-echoes t)
448
449 (add-to-list 'ac-modes 'shell-mode)
450
451 ;; readline-complete recommends this (i assume this format),
452 ;; but greping finds no reference in emacs or my .emacs.d
453 ;; so I'm assuming it is for an older emacs
454 ;;(setq explicit-ssh-args '("-t"))
455
456 (add-hook 'shell-mode-hook
457 (lambda ()
458 (define-key shell-mode-map (kbd "<tab>") 'auto-complete)))
459
460
461 #+end_src
462 #+RESULTS:
463 : comint-exec-1
464
465 debugging
466
467
468 * auto save & backup
469
470 there is a bug that when emacs has been running for a long time,
471 auto-save-timeout never happens simply by waiting.
472 doing something like an M-x function will trigger it.
473 Todo: report this bug.
474
475 #+begin_src emacs-lisp
476
477 ;; enable auto-save hook
478 (setq auto-save-timeout 1) ; idle time before auto-save.
479
480
481 ;; main hook for my auto save
482 (add-hook 'auto-save-hook 'my-auto-save)
483 ;; additional hook to try to deal with emacs not auto-saving when a buffer isn't active
484 (add-hook 'window-configuration-change-hook 'my-auto-save)
485
486
487 (defun my-auto-save ()
488 (if (and my-as (buffer-file-name) (buffer-modified-p))
489 (let (message-log-max)
490 ;; a bit of a hack to partially suppress the constant saving in the echo area
491 (with-temp-message ""
492 (basic-save-buffer)))))
493
494 (defun my-as-off ()
495 (interactive)
496 (setq my-as nil))
497
498 (defun my-as-on ()
499 (interactive)
500 (setq my-as t))
501
502 ;; based on suggestion in the emacs docs, redefine these 2 functions
503 ;; to avoid prompt spamming the user when we do auto-save
504 (defun ask-user-about-supersession-threat (fn)
505 (discard-input)
506 (message
507 "File for %s has changed on disk outside of emacs. Auto-save is overwriting it, however
508 a backup is being created in case that is not what you intended." buffer-file-name)
509 (setq buffer-backed-up nil))
510
511 (defadvice ask-user-about-lock (before lock-deactivate-as activate)
512 (make-local-variable 'my-as)
513 (setq my-as nil)
514 (message "proper autosave has been turned off for this buffer because of lock file problem.
515 In this buffer, do M-x my-as-on to reenable"))
516
517 ;; todo, this doesn't work consistently to override the auto-save message
518 (defalias 'do-auto-save-original (symbol-function 'do-auto-save))
519 (defun do-auto-save (&optional no-message current-only)
520 "This function has been modified to wrap the original so that NO-MESSAGE
521 is always set to t, since we auto-save a lot, it spams otherwise.
522 The original doc string is as follows:
523
524 Auto-save all buffers that need it.
525 This is all buffers that have auto-saving enabled
526 and are changed since last auto-saved.
527 Auto-saving writes the buffer into a file
528 so that your editing is not lost if the system crashes.
529 This file is not the file you visited; that changes only when you save.
530 Normally we run the normal hook `auto-save-hook' before saving.
531
532
533 A non-nil NO-MESSAGE argument means do not print any message if successful.
534 A non-nil CURRENT-ONLY argument means save only current buffer."
535 (interactive)
536 (do-auto-save-original t current-only))
537
538 ;; enable MY auto-save
539 (my-as-on)
540
541 #+end_src
542
543
544 backups, separate from auto-save
545
546 #+begin_src emacs-lisp
547
548 ;; set backup file location
549 (setq backup-directory-alist '(("." . "~/.editor-backups")))
550 (setq auto-save-file-name-transforms
551 '((".*" "~/.editor-backups/" t)))
552
553 (setq version-control t ;; Use version numbers for backups
554 kept-new-versions 100
555 kept-old-versions 2
556 delete-old-versions t ;; delete old versions silently
557 ;; assume hard linked files are done on purpose, don't screw them up
558 backup-by-copying-when-linked t)
559
560 ;; todo, the time needs to be an integer, not a vector type thing
561 (defun constant-backup ()
562 "Backup conditioned on some time passing since last one.
563 Hooked into 'before-save-hook."
564 (cl-flet ((b-time (minutes)
565 (< last-backup-time
566 (- (current-time) (* 60 minutes)))))
567 (when (or (not (boundp 'last-backup-time)) (and (< (buffer-size) 10000000) (b-time 5)) (b-time 30))
568 (setq buffer-backed-up nil)
569 (setq-local last-backup-time (current-time)))))
570
571 ;; make a backup on auto-save, because the backup feature is not
572 ;; utilized with my-auto-save, only normal interactive save.
573 ;; todo, enable when fixed
574 ;;(add-hook 'before-save-hook 'constant-backup)
575
576 (add-hook 'auto-save-hook 'auto-save-size-limit)
577
578 (defun auto-save-size-limit ()
579 (when (and (not backup-inhibited) (> (buffer-size) 2000000))
580 (message "Backups disabled for this buffer due to size > 2 megs")
581 (make-local-variable 'backup-inhibited)
582 (setq backup-inhibited t)))
583
584 #+end_src
585
586
587
588 background:
589 the faq suggests to auto-save using
590 (setq auto-save-visited-file-name t)
591 and to toggle auto-saving in the current buffer, type `M-x auto-save-mode'
592
593 however, this is buggy.
594 it leaves around lock files, which can be disabled with
595 (setq create-lockfiles nil)
596 but it is also buggy on other things that appear to hook onto file saving
597 so i created my own function, which originally had bugs,
598 but new emacs version fixed all that, yay!.
599
600
601 ; not using, but here for documentation,
602 ; alternate way to enable and specify how long between autosaves.
603 ; number of input events between autosave.
604 ; lowest bound of functionality is actually about 15 input events
605 ;(setq auto-save-interval
606 ** todo keep an eye out for why/when and fix the fact that normal auto-save files are being made soemtimes
607 they are #filename#
608 seems they are created
609
610 * bbdb
611 #+begin_src emacs-lisp
612 ;; based on bbdb manual
613 ;; also has instructions to initialize upon launching gnus, etc
614 ;; but I figure try this to make sure everything works all the time first
615 (require 'bbdb)
616 (bbdb-initialize 'message)
617
618 ;; recommended by gnus,
619 ;; but seems like it could be good to have set for other stuff
620 (setq user-full-name "Ian Kelling"
621 user-mail-address "ian@iankelling.org")
622 ;; general email setting? recommended by mu4e
623 (setq message-kill-buffer-on-exit t)
624
625
626 ;; based on emacs24-starter-kit
627 (setq bbdb-offer-save 'auto
628 bbdb-notice-auto-save-file t
629 bbdb-expand-mail-aliases t
630 bbdb-canonicalize-redundant-nets-p t
631 bbdb-complete-name-allow-cycling t)
632
633 ;; use d instead
634 (add-hook 'bbdb-mode-hook
635 (lambda () (define-key bbdb-mode-map (kbd "C-k") nil)))
636
637 (add-to-list 'load-path "~/.emacs.d/src/bbdb-csv-import")
638 (require 'bbdb-csv-import)
639 #+end_src
640
641 * bookmark settings
642 #+begin_src emacs-lisp
643 ; save bookmarks whenever they are changed instead of just when emacs quits
644 (setq bookmark-save-flag 1)
645 ; increase bookmark context size for better functionality
646 (setq bookmark-search-size 2000)
647 #+end_src
648 * c-like settings
649 #+begin_src emacs-lisp
650 ;; change last thing from gnu.
651 ;; notably this avoids brace indent after if, and 4 space indent
652 (setq c-default-style '((java-mode . "java")
653 (awk-mode . "awk")
654 (other . "stroustrup")))
655 ;; for emacs itself, use
656 ;; (setq c-default-style '((java-mode . "java")
657 ;; (awk-mode . "awk")
658 ;; (other . "gnu")))
659 ;; (setq-default c-basic-offset 2)
660 #+end_src
661 * color theme
662
663 A Theme builder is available at http://elpa.gnu.org/themes/ along with
664 a list of pre-built themes at http://elpa.gnu.org/themes/view.html and
665 themes are available through ELPA.
666
667
668 interesting light themes
669
670
671 #+begin_src emacs-lisp
672 (defun override-theme (arg)
673 (interactive)
674 (while custom-enabled-themes
675 (disable-theme (car custom-enabled-themes)))
676 (load-theme arg t))
677 (setq color-theme-is-global t)
678
679 (defun toggle-night ()
680 (interactive)
681 (if (equal (car custom-enabled-themes) 'naquadah)
682 (override-theme 'leuven)
683 (override-theme 'naquadah)))
684
685
686 (override-theme 'leuven) ;; org mode features, with monitor darkened. part of org-mode i think
687
688
689
690 ;; disable color thing with this:
691 ;;(disable-theme (car custom-enabled-themes))
692
693 ;; decent dark themes
694
695 ;;(override-theme 'tangotango)
696 ;;(override-theme 'deeper-blue)
697 ;;(override-theme 'tango-dark)
698 ;;(override-theme 'tsdh-dark)
699
700 ;;(override-theme 'heroku)
701 ;;(override-theme 'inkpot) ;; part of inkpot-theme package
702 ;;(override-theme 'naquadah) ; org mode features, part of naquadah-theme package
703 ;;(override-theme 'spolsky) ;; part of sublime-themes package
704 ;;(override-theme 'twilight-anti-bright) ;; from twilight-anti-bright-theme package
705
706 ;; interesting but not usable colors
707 ;;(override-theme 'cyberpunk) ; cool org mode features, from cyberpunk-theme package
708 ;;(override-theme 'wombat) ; cursor not visible enough. from a wombat package, not sure which
709 ;;(override-theme 'misterioso) ; cursor not visible enough
710
711
712
713 ;;decent light themes
714 ;;(override-theme 'alect-light) ; theres a -alt version, don't see a dif. could use this without dimming. from alect-something package
715 ;;(override-theme 'occidental) ; from occidental-theme package
716
717
718 ;;color-theme is deprecated in emacs 24.
719
720 ;; theme packages i tried then removed:
721 ;; ignored ones that didn't use the new theme engine
722
723 ;;66 packages (zenburn-theme-2.1, zen-and-art-theme-1.0.1, waher-theme-20130917.7, ujelly-theme-1.0.35, twilight-theme-1.0.0, twilight-bright-theme-20130605.143, twilight-anti-bright-theme-20120713.316, tronesque-theme-1.3, tron-theme-12, toxi-theme-0.1.0, tommyh-theme-1.2, tango-2-theme-1.0.0, sunny-day-theme-20131203.1250, sublime-themes-20140117.323, subatomic-theme-20131011.1048, soothe-theme-0.3.16, soft-morning-theme-20131211.1342, soft-charcoal-theme-20130924.1206, sea-before-storm-theme-0.3, purple-haze-theme-20130929.1751, phoenix-dark-pink-theme-20130905.941, phoenix-dark-mono-theme-20130306.1215, pastels-on-dark-theme-0.3, obsidian-theme-20130920.937, nzenburn-theme-20130513, noctilux-theme-20131019.31, mustang-theme-20130920.939, monokai-theme-0.0.10, molokai-theme-20130828.0, late-night-theme-0.0, jujube-theme-0.1, ir-black-theme-20130302.2355, gruvbox-theme-20131229.1458, gruber-darker-theme-0.6, grandshell-theme-20140118.1003, github-theme-0.0.3, gandalf-theme-0.1, flatland-theme-20131204.858, django-theme-20131022.202, deep-thought-theme-0.1.1, dakrone-theme-20131212.1159, colorsarenice-theme-20131128.1106, color-theme-wombat+-0.0.2, color-theme-wombat-0.0.1, color-theme-twilight-0.1, color-theme-tango-0.0.2, color-theme-solarized-20120301, color-theme-sanityinc-solarized-2.25, color-theme-railscasts-0.0.2, color-theme-monokai-0.0.5, color-theme-molokai-0.1, color-theme-ir-black-1.0.1, color-theme-heroku-1.0.0, color-theme-github-0.0.3, color-theme-eclipse-0.0.2, color-theme-dpaste-0.0.1, color-theme-dawn-night-1.0, color-theme-colorful-obsolescence-0.0.1, color-theme-cobalt-0.0.2, color-theme-20080305.34, clues-theme-20130908.801, busybee-theme-20130920.942, bubbleberry-theme-0.1.2, assemblage-theme-20130715.621, anti-zenburn-theme-20140104.1542, ample-zen-theme-0.2)
724
725
726
727 #+end_src
728
729 * yasnippet
730 cd ~/.emacs.d/src
731 git clone --recursive https://github.com/capitaomorte/yasnippet
732 touch snippets/.yas-make-groups
733
734 This all makes it so I can look through the default snippets
735 in the menu bar, but they don't show up elsewhere, because they are
736 mostly things I don't want.
737
738 #+begin_src emacs-lisp
739
740 (require 'yasnippet)
741 ;; this needs to be before yas-global-mode
742 (setq yas-snippet-dirs (list "~/.emacs.d/snippets"))
743 (yas-global-mode 1)
744
745 (setq
746 yas-also-auto-indent-first-line t
747 yas-choose-tables-first t
748 yas-use-menu (quote full)
749 ;; this sets ido-prompt as first function
750 yas-prompt-functions
751 '(yas-ido-prompt yas-dropdown-prompt yas-x-prompt yas-completing-prompt yas-no-prompt))
752
753 ;; todo, explore this option for wrapping region
754 ;; '(yas/wrap-around-region t))
755
756 #+end_src
757
758 #+RESULTS:
759 | yas-ido-prompt | yas-dropdown-prompt | yas-x-prompt | yas-completing-prompt | yas-no-prompt |
760
761 * cross session settings
762 #+begin_src emacs-lisp
763
764 ;; Save a list of recent files visited.
765 (recentf-mode 1)
766 (setq recentf-max-saved-items 200
767 recentf-max-menu-items 15)
768
769
770 (setq save-place t
771 save-place-version-control 'nospecial
772 save-place-limit 40000
773 save-place-file "~/.emacs.d/places")
774
775
776
777 ;; savehist keeps track of some history
778 ;; search entries
779 (setq savehist-additional-variables '(kill-ring search-ring regexp-search-ring)
780 ;; save every minute
781 savehist-autosave-interval 60
782 ;; keep the home clean
783 savehist-file "~/.emacs.d/.savehist")
784 (savehist-mode 1)
785
786 #+end_src
787
788 * ediff
789 #+begin_src emacs-lisp
790 ;; ediff-buffers is the main command to use
791
792 ;; ediff - don't start another frame for the control panel
793 ;; unfortunately, this doesn't allow me to use 2 frames for the diff buffers
794 ;; so disable this temporarily with the next line if you want that
795 ;; sometime I should setup 2 functions to explicitly do each type
796 (setq ediff-window-setup-function 'ediff-setup-windows-plain)
797 ;;(setq ediff-window-setup-function 'ediff-setup-windows-default)
798
799 ;; do side by side diffs
800 (setq ediff-split-window-function 'split-window-horizontally)
801
802
803 #+end_src
804
805
806
807 Things I tried which didn't work, which intuitively I think should work better: I can open the second diff buffer in a new frame, and close it's window in the first frame after starting ediff, but when I hit n to go to the next diff, it restores the window in the first frame. Another thing I tried is to open 2 new frames and set them up as I want. However, if I try to open the *Ediff Control Panel* buffer in a different window from its original one, my mouse jumps to one of the diff frames, or if that isn't visible, the buffer just hangs until I select the original ediff control panel window. This seems like a bug to me. I am using a very recent development version of emacs.
808
809 * dired
810 #+begin_src emacs-lisp
811
812 ;; dired - reuse current buffer by pressing 'a'
813 (put 'dired-find-alternate-file 'disabled nil)
814 #+end_src
815
816 * disabled but saved for documentation purposes
817 :PROPERTIES:
818 :tangle: no
819 :END:
820 ** org mode website
821
822 #+begin_src emacs-lisp
823 ;; use org-publish-current-project with a project file open
824 (setq org-publish-project-alist
825 '(("org"
826 :base-directory "/a/h/src"
827 :publishing-directory "/a/h/output"
828 :base-extension "org"
829 ;;:publishing-function org-org-publish-to-org
830 :publishing-function org-html-publish-to-html
831 :preserve-breaks t
832 :html-postamble "Everything here is <a rel=\"license\"
833 href=\"http://creativecommons.org/licenses/by-sa/4.0/\"><img
834 alt=\"Creative Commons License\" style=\"border-width:0\"
835 src=\"http://i.creativecommons.org/l/by-sa/4.0/80x15.png\" /></a>"
836 :html-head "<link rel=\"stylesheet\"
837 href=\"style.css\"
838 type=\"text/css\"/>"
839 :htmlized-source t)
840 ("othersrc"
841 :base-directory "/a/h/src"
842 :base-extension "css\\|el\\|"
843 :publishing-directory "/a/h/output"
844 :publishing-function org-publish-attachment)
845 ("other"
846 :base-directory "/a/h/other"
847 :base-extension ".*"
848 :publishing-directory "/a/h/output"
849 :publishing-function org-publish-attachment)))
850 ;; default is xhtml-strict. don't really care, but this is more common
851 (setq org-html-doctype "html4-strict")
852
853 ;; this is needed for worg
854 ;; todo: for my own site, I need to define the css in a separate file
855 ;; in order to use this setting. see the variable help for info
856 (setq org-export-htmlize-output-type t)
857
858
859 #+end_src
860
861 ** bash-completion
862 #+begin_src emacs-lisp
863 ;; this eventually gets set in
864 ;; comint-dynamic-complete-functions
865 ;; (car comint-dynamic-complete-functions)
866 (autoload 'bash-completion-dynamic-complete "bash-completion"
867 "BASH completion hook")
868 (add-hook 'shell-dynamic-complete-functions
869 'bash-completion-dynamic-complete)
870
871 ;; this appears useless, but was in the recommended init code
872 (add-hook 'shell-command-complete-functions
873 'bash-completion-dynamic-complete)
874
875 (defun ac-rlc-setup-sources ()
876 "Add me to shell-mode-hook!"
877 (setq ac-sources '(ac-source-shell)))
878 (add-hook 'shell-mode-hook 'ac-rlc-setup-sources)
879
880 #+end_src
881
882 ** ace-jump
883 It is an awesome mode for keyboard navigation.
884 However, using the mouse takes less thought and works as well,
885 especially with my foot mouse ;)
886
887 #+begin_src emacs-lisp
888
889
890
891
892 ;; this has a problem that it doesn't work with emacsclient, so I'm using a more standard method
893 ;; This has the benefit of working with less fuss otherwise, I think.
894 ;; no method works on a terminal
895 ;; makes C-i and tab be distinct. same deal is done for c-m
896 ;;(setq local-function-key-map (delete '(tab . [9]) local-function-key-map))
897 ;; (define-key input-decode-map (kbd "C-i") [f15])
898 ;; (define-key input-decode-map (kbd "<f15>") [?\C-i])
899 ;; (define-key input-decode-map (kbd "<tab>") [?\C-i])
900 ;; (global-set-key (kbd "<f15>") 'query-replace)
901
902
903 ; not using ace jump mode, but if mouse is ever not good,
904 ; here is config for it
905 (require 'ace-jump-mode)
906 (eval-after-load "ace-jump-mode"
907 '(ace-jump-mode-enable-mark-sync))
908 (define-key global-map (kbd "") 'ace-jump-mode)
909
910
911
912 ;; revert buffers automatically when underlying files are changed externally
913 ;; too dangerous, and thus disabled.
914 ;; do m-x auto-revert-mode to auto-rever a specific buffer
915 ;;(global-auto-revert-mode t)
916
917
918 ;; whitespace-mode config. minimal for bad whitespace
919 ;(setq whitespace-line-column 80) ; for style of lines-tail, but I have it disabled
920 (setq whitespace-style '(face tabs empty trailing))
921 ;to enable whitespace mode
922 (whitespace-mode +1)
923
924
925
926 (defun org-set-mark-command (arg)
927 "Do set-mark-command and then org-show-context if the point
928 moves to invisible text."
929 (interactive "P")
930 (let ((initial-point (point)))
931 (setq this-command 'set-mark-command)
932 (set-mark-command (arg))
933 (if (and (not (= (point) initial-point))
934 (or (outline-invisible-p) (org-invisible-p2)))
935 (org-show-context 'mark-goto))))
936
937 (defun org-exchange-point-and-mark (&optional arg)
938 (interactive "P")
939 (let ((initial-point (point)))
940 (exchange-point-and-mark)
941 (if (and (not (= (point) initial-point))
942 (or (outline-invisible-p) (org-invisible-p2)))
943 (org-show-context 'mark-goto))))
944
945
946 (defun toggle-mode-line ()
947 "Toggle mode line on and off."
948 (interactive)
949 (if mode-line-format
950 (progn (setq my-saved-mode-line-format mode-line-format)
951 (setq mode-line-format nil))
952 (setq mode-line-format my-saved-mode-line-format))
953 (force-mode-line-update))
954 (toggle-mode-line)
955 (global-set-key (kbd "M-m") 'toggle-mode-line)
956 (add-hook 'after-change-major-mode-hook
957 (lambda () (setq my-saved-mode-line-format mode-line-format)
958 (setq mode-line-format nil)))
959
960
961 #+end_src
962
963 ** Copy mode-line to the top
964 #+begin_src emacs-lisp
965 ;; Copy mode-line to the top
966 (setq-default header-line-format mode-line-format
967 mode-line-format nil)
968 ;; copied the mode-line theme into the header theme, else it is unreadable
969 ;; this goes after loading the theme
970 (let ((class '((class color) (min-colors 89))))
971 (custom-theme-set-faces
972 'leuven
973 `(header-line ((,class (:box (:line-width 1 :color "#1A2F54") :foreground "#85CEEB" :background "#335EA8"))))))
974
975 #+end_src
976
977 ** tab bindings for when I wanted to make tab be for search
978 #+begin_src emacs-lisp
979
980 (define-key emacs-lisp-mode-map (kbd "<tab>") nil)
981 (define-key button-buffer-map "\t" nil)
982 (define-key button-buffer-map (kbd "f") 'forward-button)
983 (define-key Info-mode-map "\t" nil)
984 (define-key widget-keymap "\t" nil)
985 (define-key widget-keymap (kbd "<tab>") nil)
986
987 (add-hook 'compilation-mode-hook (lambda ()
988 (define-key compilation-mode-map (kbd "<tab>") nil)
989 (define-key compilation-mode-map "\t" nil)))
990
991 ;; unbind c-i for yas. it already separately binds <tab>
992 (add-hook 'yas-minor-mode-hook (lambda ()
993 (define-key yas-minor-mode-map "\t" nil)))
994
995 (add-hook 'haskell-interactive-mode-hook
996 (lambda ()
997 (define-key haskell-interactive-mode-map "\t" nil)
998 (define-key haskell-interactive-mode-map (kbd "<tab>") 'haskell-interactive-mode-tab)))
999
1000 (define-key minibuffer-local-must-match-map "\t" nil)
1001 (define-key minibuffer-local-must-match-map (kbd "<tab>") 'minibuffer-complete)
1002 (define-key minibuffer-local-completion-map (kbd "<tab>") 'minibuffer-complete)
1003 (define-key minibuffer-local-completion-map "\t" 'minibuffer-complete)
1004
1005 (add-hook 'ido-setup-hook
1006 (lambda()
1007 (define-key ido-completion-map (kbd "<tab>") 'ido-complete)
1008 (define-key ido-completion-map "\t" nil)))
1009
1010 #+end_src
1011
1012 ** kill buffer and window
1013 #+begin_src emacs-lisp
1014 (defun kill-buffer-and-window ()
1015 "Close the current window and kill the buffer it's visiting."
1016 (interactive)
1017 (progn
1018 (kill-buffer)
1019 (delete-window)))
1020 #+end_src
1021 ** sending multiple commands to a comint buffer
1022 without waiting for commands to finish is unreliable.
1023 seems like 1 in 100 times, an invisible command to restore prompt didn't work
1024 #+begin_src emacs-lisp
1025 (setq shell-unset-prompt "unset PROMPT_COMMAND; unset PS1")
1026 (setq shell-set-prompt "PROMPT_COMMAND=prompt_command")
1027
1028 (if (boundp 'shell-unset-prompt)
1029 (send-invisible-string proc shell-unset-prompt))
1030 (if (boundp 'shell-set-prompt)
1031 (send-invisible-string proc shell-set-prompt))
1032
1033
1034 (defun send-invisible-string (proc string)
1035 "Like send-invisible, but non-interactive"
1036 (comint-snapshot-last-prompt)
1037 (funcall comint-input-sender proc string))
1038
1039 #+end_src
1040
1041
1042
1043 ** mu4e
1044
1045 alsot tried notmuch, it had some glitches, and it's config
1046 has a list of folders which i'd rather not publish, so it's config is archived.
1047
1048 #+begin_src emacs-lisp
1049 (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")
1050 (require 'mu4e)
1051 (setq send-mail-function (quote sendmail-send-it) ;; common to gnus also
1052 mu4e-sent-folder "/Sent Items"
1053 mu4e-drafts-folder "/Drafts"
1054 mu4e-trash-folder "/Trash"
1055 mu4e-refile-folder "/Archive"
1056 mu4e-get-mail-command "offlineimap"
1057 mu4e-update-interval 60
1058 mu4e-sent-messages-behavior 'delete
1059 mu4e-use-fancy-chars t
1060 mu4e-confirm-quit nil
1061 mu4e-headers-leave-behavior 'apply ;; dont ask
1062 mu4e-headers-fields (delq (assoc :mailing-list mu4e-headers-fields) mu4e-headers-fields)
1063 ;; a bit faster than the default 500
1064 mu4e-headers-results-limit 80)
1065
1066 (define-key mu4e-headers-mode-map (kbd "<return>") 'mu4e-headers-view-message)
1067
1068 (defun my-mu4e-to ()
1069 "inspired by mu4e info manual"
1070 (--reduce-from (if (mu4e-message-contact-field-matches
1071 mu4e-compose-parent-message :to (cadr it))
1072 (concat (car it) (cadr it))
1073 acc)
1074 '("Ian Kelling <ian@iankelling.org")
1075 ;;'(("Ian Kelling " "<alternate1@example.com>")
1076 ;; ("Ian Kelling " "<alternate2@example.com>"))
1077 ))
1078
1079 (add-hook 'mu4e-compose-pre-hook 'my-mu4e-to)
1080
1081 (add-to-list 'mu4e-view-actions
1082 '("ViewInBrowser" . mu4e-action-view-in-browser) t)
1083 (setq mu4e-maildir-shortcuts
1084 '( ("/INBOX" . ?i)
1085 ("/bog" . ?b)
1086 ("/Drafts" . ?d)))
1087
1088 #+end_src
1089
1090
1091
1092
1093 ** org-mode auto-complete source
1094
1095 todo, someday take a look at this. it is broken.
1096
1097 ;(defvar ac-source-eshell-pcomplete
1098 ; '((candidates . (pcomplete-completions))))
1099 ;(defun ac-complete-eshell-pcomplete ()
1100 ; (interactive)
1101 ; (auto-complete '(ac-source-eshell-pcomplete)))
1102
1103 ;(add-hook 'org-mode-hook (lambda () (setq ac-sources (cons 'ac-source-eshell-pcomplete ac-sources))))
1104 ;(add-to-list 'ac-modes 'eshell-mode)
1105
1106
1107 ** gnus nice unicode
1108
1109
1110 this looks nice, but it lags gnus just a bit
1111 #+begin_src emacs-lisp
1112
1113 (defun gnus-pretty-chars-setup ()
1114 (when window-system
1115 (setq gnus-sum-thread-tree-indent " "
1116 gnus-sum-thread-tree-root "● "
1117 gnus-sum-thread-tree-false-root "◯ "
1118 gnus-sum-thread-tree-single-indent "◎ "
1119 gnus-sum-thread-tree-leaf-with-other "├─► "
1120 gnus-sum-thread-tree-vertical "│"
1121 gnus-sum-thread-tree-single-leaf "╰─► ")))
1122 ;; dunno why, but this didn't work just setting on startup
1123 (add-hook 'gnus-startup-hook 'gnus-pretty-chars-setup)
1124
1125 #+end_src
1126
1127 ** readline complete fix, replaced with proper solution
1128
1129 i had commented out a few lines here, but instead I am setting in my profile
1130 the environment variable I commented out here. Yes, that is not the best explanation, but I will probably delete this as
1131 old history anyways.
1132 #+begin_src emacs-lisp
1133
1134 (defun comint-exec-1 (name buffer command switches)
1135 (let ((process-environment
1136 (nconc
1137 ;; If using termcap, we specify `emacs' as the terminal type
1138 ;; because that lets us specify a width.
1139 ;; If using terminfo, we specify `dumb' because that is
1140 ;; a defined terminal type. `emacs' is not a defined terminal type
1141 ;; and there is no way for us to define it here.
1142 ;; Some programs that use terminfo get very confused
1143 ;; if TERM is not a valid terminal type.
1144 ;; ;; There is similar code in compile.el.
1145 (if (and (boundp 'system-uses-terminfo) system-uses-terminfo)
1146 (list "TERM=dumb" "TERMCAP="
1147 (format "COLUMNS=%d" (window-width)))
1148 (list "TERM=emacs"
1149 (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width))))
1150 ;; ian: commented this out
1151 ;;(unless (getenv "EMACS")
1152 ;; (list "EMACS=t"))
1153 (list (format "INSIDE_EMACS=%s,comint" emacs-version))
1154 process-environment))
1155 (default-directory
1156 (if (file-accessible-directory-p default-directory)
1157 default-directory
1158 "/"))
1159 proc decoding encoding changed)
1160 (let ((exec-path (if (and command (file-name-directory command))
1161 ;; If the command has slashes, make sure we
1162 ;; first look relative to the current directory.
1163 (cons default-directory exec-path) exec-path)))
1164 (setq proc (apply 'start-file-process name buffer command switches)))
1165 ;; Some file name handler cannot start a process, fe ange-ftp.
1166 (unless (processp proc) (error "No process started"))
1167 (let ((coding-systems (process-coding-system proc)))
1168 (setq decoding (car coding-systems)
1169 encoding (cdr coding-systems)))
1170 ;; Even if start-file-process left the coding system for encoding data
1171 ;; sent from the process undecided, we had better use the same one
1172 ;; as what we use for decoding. But, we should suppress EOL
1173 ;; conversion.
1174 (if (and decoding (not encoding))
1175 (setq encoding (coding-system-change-eol-conversion decoding 'unix)
1176 changed t))
1177 (if changed
1178 (set-process-coding-system proc decoding encoding))
1179 proc))
1180 #+end_src
1181 ** misc
1182 #+begin_src emacs-lisp
1183
1184 ; todo, is this require things necessary?
1185 ; (require 'flyspell)
1186
1187
1188
1189 ; whenever M-tab is completion, swap it with tab
1190 ;(define-key emacs-lisp-mode-map (kbd "<tab>") 'completion-at-point)
1191 ;(define-key emacs-lisp-mode-map (kbd "C-M-i") 'indent-for-tab-command)
1192 ;(define-key lisp-interaction-mode-map (kbd "<tab>") 'completion-at-point)
1193 ;(define-key lisp-interaction-mode-map (kbd "C-M-i") 'indent-for-tab-command)
1194 ;the global tab keyind. for some reason this totally screws up mini-buffer tab.
1195 ; disabled until I actually find myself using this, and find a fix for the above problem
1196 ;(global-set-key (kbd "<tab>") 'complete-symbol)
1197
1198
1199 ; todo, see how mastering emacs defines this function
1200 ;(global-set-key (kbd "M-j") 'ido-goto-symbol)
1201
1202
1203 ; todo, make my custom overlays have an underline if they are
1204 ; overriding a paren matching overlay
1205 ; make right click set the mark
1206 ; make search tab do completion instead of meta-tab
1207 ; in isearch, move C-y to C-v
1208 ; in isearch, move c-s to c-f
1209
1210 ; some testing to figure out the underlining when paren highlight conflicts
1211 ; (let ((extra-overlays (overlays-at (1+ end-point))))
1212 ; (when extra-overlays (print extra-overlays)))
1213
1214
1215
1216
1217 ; commented out because it messes up yank-pop.
1218 ; todo, fix it someday
1219 ; make yank linewise if it ends in a newline
1220 ;(defadvice yank (before linewise-yank-advice activate)
1221 ; (let ((arg (ad-get-arg 0)))
1222 ; (when (string-match "\n[ \t]*$" (current-kill (cond
1223 ;; ((listp arg) 0)
1224 ;; ((eq arg '-) -2)
1225 ;; (t (1- arg))) t))
1226 ;; (move-beginning-of-line nil))))
1227
1228
1229
1230 ; todo, look into augmenting auto-complete with hippie expand.
1231 ; starter kit has some hippie expand settings to look into:
1232 ; (when (boundp 'hippie-expand-try-functions-list)
1233 ; (delete 'try-expand-line hippie-expand-try-functions-list)
1234 ; (delete 'try-expand-list hippie-expand-try-functions-list))
1235
1236
1237 ;; hippie expand is dabbrev expand on steroids
1238 ;(setq hippie-expand-try-functions-list '(try-expand-dabbrev
1239 ; try-expand-dabbrev-all-buffers
1240 ; try-expand-dabbrev-from-kill
1241 ; try-complete-file-name-partially
1242 ; try-complete-file-name
1243 ; try-expand-all-abbrevs
1244 ; try-expand-list
1245 ; try-expand-line
1246 ; try-complete-lisp-symbol-partially
1247 ; try-complete-lisp-symbol))
1248 ;; use hippie-expand instead of dabbrev
1249 ;(global-set-key (kbd "M-/") 'hippie-expand)
1250
1251
1252 ; commented because i haven't had time to check it out yet
1253 ;; shorter aliases for ack-and-a-half commands
1254 ;(defalias 'ack 'ack-and-a-half)
1255 ;(defalias 'ack-same 'ack-and-a-half-same)
1256 ;(defalias 'ack-find-file 'ack-and-a-half-find-file)
1257 ;(defalias 'ack-find-file-same 'ack-and-a-half-find-file-same)
1258
1259
1260
1261
1262 ; todo. take a look at fixing this
1263 ;delete-old-versions t ; fix description in http://www.emacswiki.org/emacs/ForceBackups
1264
1265
1266
1267
1268 ;; prelude uses paredit mode.
1269 ;; paredit has some useful stuff but also annoying stuff.
1270 ;; if I ever do a ton of lisp coding, I should look into it
1271
1272
1273
1274
1275
1276
1277 ; random notes and example code
1278
1279
1280 ; usefull thing
1281 ;(map 'list #'list tabSwapKeys (reverse (getBinds tabSwapKeys)))
1282
1283 ; example of getting keymap info
1284 ;(car (car (minor-mode-key-binding (kbd "C-/") t)))
1285 ;(cdr (car (minor-mode-key-binding (kbd "C-/") t)))
1286 ;(global-key-binding (kbd "C-M-i") t)
1287 ;(minor-mode-key-binding (kbd "<tab>") t)
1288 ;(local-key-binding (kbd "C-M-i") t)
1289 ;(current-minor-mode-maps)
1290 ;(cdr (assq 'undo-tree-mode minor-mode-map-alist))
1291
1292
1293 ; center on incremental search, instead of being at top or bottom of screen.
1294 ; i'm hoping that setting Isearch Allow Scroll is good enough to fix this annoyance
1295 ;from http://stackoverflow.com/questions/11052678/emacs-combine-iseach-forward-and-recenter-top-bottom
1296
1297 ;example of constant definition of an overlay and propreries
1298 ;(defface mouse-flash-position '((t (:background "Yellow")))
1299 ; "*Face used to highlight mouse position temporarily."
1300 ; :group 'mouse)
1301 ;(defface mouse-flash-position '((t (:background "Yellow")))
1302 ; "*Face used to highlight mouse position temporarily."
1303 ; :group 'mouse)
1304 ;(defconst mouse-flash-posn-overlay
1305 ; ;; Create and immediately delete, to get "overlay in no buffer".
1306 ; (let ((ol (make-overlay (point-min) (point-max))))
1307 ; ;(delete-overlay ol)
1308 ; ;(overlay-put ol 'face 'mouse-flash-position)
1309 ; (overlay-put ol 'mouse-face 'mouse-flash-position)
1310 ; (overlay-put ol 'priority 1000000)
1311 ; ol)
1312 ; "Overlay to highlight current mouse position.")
1313
1314
1315 ;tip, put the last interactive command as elisp on the kill ring:
1316 ;C-x <ESC> <ESC> C-a C-k C-g
1317
1318 ; example of overlay testing
1319 ;(setq foo (make-overlay 2 3 nil t nil))
1320 ;(setq foo2 (make-overlay 3 4 nil t nil))
1321 ;(overlay-put foo 'face '(:background "red3" :foreground "black"))
1322 ;(overlay-put foo2 'face '(:background "red1" :foreground "black"))
1323 ;(overlay-put foo 'face 'visible-mark-face)
1324 ;(overlay-put foo 'face visible-mark-face2)
1325
1326
1327 #+end_src
1328
1329
1330 ** SQL
1331
1332 disabled, as I haven't used it in a long time. I think it was good for learning some sql stuff.
1333 #+begin_src emacs-lisp :tangle no
1334 (require 'sqlup-mode)
1335 (add-hook 'sql-mode-hook 'sqlup-mode)
1336 (add-hook 'sql-interactive-mode-hook 'sqlup-mode)
1337
1338 (setq sql-product 'postgres)
1339 #+end_src
1340
1341
1342 * elisp settings
1343 #+begin_src emacs-lisp
1344 ; when manually evaluating lisp, go into debugger on error
1345 (setq eval-expression-debug-on-error t)
1346 ;reminder of useful var: debug-on-error
1347 #+end_src
1348
1349
1350
1351
1352
1353 * gnus
1354
1355 good info http://www.emacswiki.org/emacs/GnusTutorial
1356 good info http://www.emacs.uniyar.ac.ru/doc/em24h/emacs183.htm
1357
1358 searching / accessing old mailing list messages:
1359 http://wiki.list.org/display/DOC/How+do+I+make+the+archives+searchable
1360 3 options suggested. nabble is very good, and you can even reply directly from their web interface with your own email
1361 address.
1362 google with site:example.com/archive works
1363 However, it has the downside of relying on a 3rd party running unreleased software.
1364 mail-archive.com and gmane.org search do not work.
1365
1366 Some lists mirror to a newsgroup via gmane, and then mirror the newsgroup via a google group, which has good search
1367 ability, and you can post via the newsgroup.
1368
1369 Downsides of nabble/google. Doesn't integrate with normal email programs, and lock in. They store and show you what you
1370 have and haven't read, what messages you've sent, etc. migrating that data to a normal mail program is undocumented and
1371 unsupported.
1372
1373 mailmans normal public archives are a bit obfuscated, but there is also a "private" archive, available to subscribers,
1374 which is not obfuscated, and can be easily imported to your local email program.
1375 you have to sub and log in to the web interfact to access it, and then the url is unpublished, but follows a format,
1376 which is documented in a few places around the web like
1377 https://mail.python.org/pipermail/mailman-users/2005-September/046757.html
1378 its form is:
1379 https://lists.fedorahosted.org/mailman/private/hyperkitty-devel.mbox/hyperkitty-devel.mbox
1380 http://www.example.com/mailman/private/<listname>.mbox/<listname>.mbox
1381 if you copy the url after logging in, and pass it to this function, it will print the transformed url
1382 lurl() { local x="${1#*/options/}"; x="${x%%/*}.mbox"; echo "${1%/mailman/*}/mailman/private/$x/$x"; }
1383
1384 Then you can download that url. Actually downloading the url is something firefox doesn't make the easiest out of the box.
1385 Here are some options:
1386 - paste in the url bar, the save the page
1387 as a file after it loads.
1388 - use downthemall extension or similar and paste the url in it.
1389 - put it in an html page as
1390 a link (or a small javascript program which will display input as a link), then right click and save as.
1391 wget won't work because you need to have (i assume) the authorization cookie mailman gives your browser
1392
1393 people have written various tools to de-obfuscate the normal public archives and sometimes import them to a mail
1394 program. It seems they were not aware of the private archive. However, these tools are probably still useful to automate
1395 things. None of them has a lot of usage, so I decided it was not worth the risk of hitting bugs vs doing a few extra clicks.
1396
1397 this was the most interesting one I found within a few minutes of googling.
1398 https://github.com/wcdolphin/mailman-downloader
1399
1400 Once you have an mbox file, there are rather straightforward ways to get it into any mail program, but I will cover
1401 gnus, which I use and is a bit tricky.
1402
1403 gnus has a native search (limited, too slow for body text searches), and external search engine integration.
1404 gnus manual recommends converting to maildir for searching local mail, but importing lots of maildir messages to gnus
1405 takes 10+ minutes, so scratch that option. it suggests 2 alternate options
1406 mairix. for mbox, it doesn't integrate 100% with gnus, it copies the search results to a mbox
1407 and tells gnus to make a group of that mbox and display it. This means the read state won't be persistent, but otherwise
1408 works great.
1409
1410 local imap server which will use the mbox and provide search.
1411 dovecot is modular, theres a dovecot-common which uses recommends to install i guess it's most used modules. Its
1412 description is completely not useful. Anyways, I'm not sure if there is any benefit to installing this over just the
1413 module we need.
1414 pi dovecot-imapd
1415
1416 dovecot by default also makes a an inbox folder based on the normal local mail location /var/mail/<username>
1417 those locations are adjustable and well documented via the var mail_location in
1418 /etc/dovecot/conf.d/10-mail.conf
1419 I forward my local mail, didn't see immediately how to turn off the inbox, but it will always be empty, so I left as
1420 is. you could make the var be empty, which apparently has the same effect.
1421
1422 Originally just linked the default location ~/.mail, but I changed to altering the config since ~/.mail since it seems
1423 other things like postfix use that location
1424
1425 based on http://roland.entierement.nu/blog/2010/09/08/gnus-dovecot-offlineimap-search-a-howto.html
1426 other links that poped up contained outdated, innacurate information
1427 http://sachachua.com/blog/2008/05/geek-how-to-use-offlineimap-and-the-dovecot-mail-server-to-read-your-gmail-in-emacs-efficiently/
1428 http://www.emacswiki.org/emacs/JamesFerguson
1429 http://www.sanityinc.com/articles/read-mailing-lists-in-emacs-over-imap/
1430
1431 Within emacs you can move messages between mbox and maildir etc, which is a nice flexibility.
1432
1433
1434
1435 doc group for mbox:
1436 in gnus, do gnus-group-make-doc-group (G f in groups buffer) and point to the file
1437
1438 info about groups created within gnus is stored in ~/.newsrc.eld
1439 also stored is a duplication of what email messages are read/unread,
1440 what newsgroups are subsribed to and read/unread,
1441 probably more stuff, everything that gnus saves.
1442
1443
1444 searching the body of the messages, i cut off after a few minutes.
1445 i can grep the file in just a couple seconds
1446
1447
1448 random side note
1449 we can also get mbox from gmane
1450 http://notmuchmail.org/howto/#index7h2
1451
1452
1453 gnus can't search mboxes except with its builtin search which is extremely slow. mairix can do mbox files from the command
1454 line, but not from within gnus, but from mairix.el, which can then open the results in gnus
1455
1456 mbox can be converted to maildir easily, but gnus loads lots of maildir messages extremely slow. it parses all the
1457 headers and generates a nov file for each.
1458
1459 nnfolder-generate-active-file
1460
1461 to reset things, when changing mail group. I duno all the proper way, but it works to delete
1462 ~/Mail ~/.newsrc.eld ~/.dribble (or something)
1463
1464
1465 ** mail sources vs select methods background
1466 I found this very confusing when first reading through the manual. "mail sources" is a term that does not simply mean
1467 sources of mail, it is much narrower for gnus. sources of mail can be either "mail sources" or select methods. Mail
1468 sources will move mail to ~/Mail (not sure what format), and split it into groups according to variables. You can use
1469 "mail sources" for maildir / imap, but those can also be read via select methods, which do not move the mail from their
1470 location, but use them in their native format. This is what I want to do, and I can simply ignore mail
1471 sources. Confusing terminology is that "fetching mail" "scanning mail", lots of things mail doesn't mean all mail, it
1472 means specifically from "mail sources". The words "articles" and "news" is used in connection with select methods, aka my actual mail.
1473
1474
1475
1476 ** caching background
1477
1478 caching:
1479 there is also ~/News/cache, filled with a bunch of articles, like 300 megs. can't figure out why.
1480 Grepped for caching in the manual, found 2 main things.
1481 cache is for 2 purposes. to cache locally, and to keep articles from expiring, called persistence
1482 gnus-use-cache, which puts things if they are
1483 gnus-cache-enter-articles
1484 things go in cache when they are marked certain ways by default, ticked and dormant
1485 and read articles are moved out of the cache
1486 still no idea why i have a bunch in the cache, but I set a var so that my mail won't get cached
1487 I'm gonna delete the cache, and check on it later see what exactly is going in there
1488 And of course, I moved ~/News to my encrypted drive and symlinked it
1489
1490
1491 * haskell
1492 :LOGBOOK:
1493 :END:
1494
1495 useful comint-shell mode commands. If not prefaced with *, it means it is not in the haskell custom repl
1496 *todo: setup haskell c-t toggle arrow keys
1497 tab completion
1498 C-q insert prev arg
1499 C-( history search
1500 c-m-left/right move to next/prev prompts
1501 *c-enter, multi-line input
1502 *s-delete, send input across windows. (i can implement this)
1503 *c-m-l clear screen
1504 *haskell-process-interrupt, c-cc terminate job (i can implement this maybe)
1505
1506 nice bash/readline functions missing in comint:
1507 yank-nth-arg
1508 operate-get-next
1509 menu-complete
1510
1511 usefull comint commands:
1512 c-cl : list historic command in temp buffer
1513 C-c C-o comint-delete-output
1514 comint-restore-input, todo: put this on a randomish c-c key
1515
1516
1517
1518 todo:
1519 checkout haskell repl functions:
1520 c-cv haskell-check, hlint
1521 C-M-q prog-indent-sexp
1522 c-c. haskell-mode-format-imports
1523 C-c M-/ haskell-doc-check-active
1524 haskell-process-generate-tags
1525 haskell-process-cabal-build
1526 haskell-cabal-command.. or something
1527 haskell-process-restart
1528 C-h v haskell-process-log
1529 C-h v haskell-process-show-debug-tips
1530
1531 various not immediately useful functions:
1532 haskell-process-add-dependency
1533 haskell-process-touch-buffer
1534 haskell-process-cd
1535 haskell-process-unignore
1536 haskell-process-reload-devel-main
1537
1538
1539 rebind
1540 home: C-a haskell-interactive-mode-beginning
1541 c-return: C-j haskell-interactive-mode-newline-indent
1542 up/down: <C-down> haskell-interactive-mode-history-next
1543
1544 todo haskell mode better binds for:
1545 'haskell-process-load-file
1546 'haskell-process-do-type
1547 'haskell-process-do-info
1548 'inferior-haskell-send-decl
1549
1550
1551 commands which don't work in haskell-interactive-mode(hi) vs inferior-haskell-mode(ih, default)
1552 functions not in hi:
1553 inferior-haskell-find-definition, use tags instead
1554 inferior-haskell-find-haddock, todo, test if this works
1555
1556 redefined ih to hi
1557 switch-to-haskell -> 'haskell-interactive-switch
1558 haskell-process-load-file -> inferior-haskell-load-file
1559 haskell-process-do-type -> inferior-haskell-type
1560 switch-to-haskell -> haskell-interactive-switch
1561 inferior-haskell-load-file -> 'haskell-process-load-file
1562
1563
1564 haskell-mode installation from source, based on its readme
1565 in the git directory,
1566 make all
1567
1568 #+begin_src emacs-lisp
1569
1570
1571
1572 ;; remove default option to not link the file
1573 (setq haskell-compile-command "ghc -Wall -ferror-spans -fforce-recomp %s")
1574 (add-hook 'haskell-indentation-mode-hook
1575 (lambda ()
1576 (define-key haskell-indentation-mode-map [?\C-d] nil)
1577 (define-key haskell-indentation-mode-map
1578 (kbd "<deletechar>")
1579 'haskell-indentation-delete-char)))
1580
1581 ;;copied from haskell-mode docs in order to use the new, better, nondefault
1582 ;;interactive mode.
1583 (eval-after-load "haskell-mode"
1584 '(progn
1585 (define-key haskell-mode-map (kbd "C-x C-d") nil)
1586 (define-key haskell-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
1587 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-file)
1588 (define-key haskell-mode-map (kbd "C-c C-b") 'haskell-interactive-switch)
1589 (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
1590 (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
1591 (define-key haskell-mode-map (kbd "C-c M-.") nil)
1592 (define-key haskell-mode-map (kbd "C-c C-d") nil)))
1593
1594 ;; ghc-mod install http://www.mew.org/~kazu/proj/ghc-mod/en/emacs.html
1595 ;; todo, try this out
1596 ;; (autoload 'ghc-init "ghc" nil t)
1597 ;;(add-hook 'haskell-mode-hook (lambda () (ghc-init) (flymake-mode)))
1598
1599
1600
1601 (add-to-list 'load-path "~/.emacs.d/src/ghci-completion")
1602 ;; from the package readme for ghci-completion
1603 (require 'ghci-completion)
1604 (add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion)
1605
1606
1607 ;; disable some rebinds. they are set to appropriate keys in the keybinds section
1608 (eval-after-load "haskell-mode"
1609 '(progn
1610 (define-key haskell-mode-map (kbd "C-a") 'nil)
1611 (define-key haskell-mode-map (kbd "C-j") 'nil)))
1612
1613 (defun pretty-lambdas-haskell ()
1614 (font-lock-add-keywords
1615 nil `((,(concat "(?\\(" (regexp-quote "\\") "\\)")
1616 (0 (progn (compose-region (match-beginning 1) (match-end 1)
1617 ,(make-char 'greek-iso8859-7 107))
1618 nil))))))
1619 ;; from haskell-mode manual
1620 (add-hook 'haskell-mode-hook 'turn-on-haskell-decl-scan)
1621 (when (window-system)
1622 (add-hook 'haskell-mode-hook 'pretty-lambdas-haskell))
1623
1624 ;; added from haskell-mode website install instructions
1625 ;(load "/usr/share/emacs/site-lisp/haskell-mode/haskell-site-file")
1626 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
1627 ;;the three indentation modules are mutually exclusive - add at most one. Trying out the "most advanced"
1628 (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
1629 ;;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
1630 ;;(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent)
1631
1632
1633 ;; todo, set this to some other key
1634 ;; (local-set-key (kbd "C-e") 'my-haskell-load-and-run)
1635
1636 (defun my-haskell-load-and-run ()
1637 "Loads and runs the current Haskell file."
1638 (interactive)
1639 (let ((start-buffer (current-buffer)))
1640 (inferior-haskell-load-and-run inferior-haskell-run-command)
1641 (sleep-for 0 100)
1642 (end-of-buffer)
1643 (pop-to-buffer start-buffer)))
1644
1645 ;; show haskell function in mode line
1646 ;; todo, this broke after updating emacs
1647 ;;(eval-after-load "which-func"
1648 ;; '(add-to-list 'which-func-modes 'haskell-mode))
1649
1650
1651
1652 (add-hook 'interactive-haskell-mode-hook 'ac-haskell-process-setup)
1653 (add-hook 'haskell-interactive-mode-hook 'ac-haskell-process-setup)
1654 (eval-after-load "auto-complete"
1655 '(add-to-list 'ac-modes 'haskell-interactive-mode))
1656
1657 (add-hook 'haskell-mode-hook
1658 (lambda () (define-key haskell-mode-map (kbd "C-(")
1659 (lambda () (interactive)
1660 (basic-save-buffer)
1661 (haskell-compile)
1662 (run-with-timer .3 nil 'repeat-shell)))))
1663 (add-hook 'haskell-cabal-mode-hook
1664 (lambda () (define-key haskell-cabal-mode-map (kbd "C-(") 'haskell-compile)))
1665
1666
1667
1668 (add-hook 'haskell-interactive-mode-hook
1669 (lambda ()
1670 (define-key haskell-interactive-mode-map "\r" nil)
1671 (define-key haskell-interactive-mode-map (kbd "<return>") 'haskell-interactive-mode-return)))
1672 (add-hook 'haskell-indentation-mode-hook (lambda () (define-key haskell-indentation-mode-map "\r" nil)))
1673
1674
1675
1676 (add-hook 'haskell-interactive-mode-hook
1677 (lambda ()
1678 (define-key haskell-interactive-mode-map (kbd "<C-M-return>") 'haskell-interactive-mode-newline-indent)))
1679
1680 #+end_src
1681
1682 #+RESULTS:
1683 | (lambda nil (define-key haskell-interactive-mode-map (kbd <C-M-return>) (quote haskell-interactive-mode-newline-indent))) | (lambda nil (define-key haskell-interactive-mode-map \n nil) (define-key haskell-interactive-mode-map (kbd <return>) (quote haskell-interactive-mode-return))) | ac-haskell-process-setup |
1684
1685 * ido
1686 #+begin_src emacs-lisp
1687
1688 ;; easier to read, and more than the default 12
1689 (setq ido-separator nil)
1690 (setq ido-max-prospects 20)
1691
1692 (ido-mode t)
1693 (ido-everywhere t) ;; file dialogs
1694
1695 ;; do out of order matching when all else fails
1696 (setq ido-enable-flex-matching t
1697 ido-create-new-buffer 'always ;; create new buffer/file without asking
1698 ido-use-filename-at-point 'guess ;; use filename at point if it makes sense
1699 ido-save-directory-list-file "~/.emacs.d/.ido.last"
1700 ido-default-file-method 'selected-window) ;; make duplicate windows
1701 ;; todo, the next 2 functions seem to do roughly the same.
1702 ;; figure out which one is better. the first comes from emacs starter kit,
1703 ;; i forget about the second.
1704 (defun ido-imenu ()
1705 "Update the imenu index and then use ido to select a symbol to navigate to.
1706 Symbols matching the text at point are put first in the completion list."
1707 (interactive)
1708 (imenu--make-index-alist)
1709 (let ((name-and-pos '())
1710 (symbol-names '()))
1711 (cl-flet ((addsymbols (symbol-list)
1712 (when (listp symbol-list)
1713 (dolist (symbol symbol-list)
1714 (let ((name nil) (position nil))
1715 (cond
1716 ((and (listp symbol) (imenu--subalist-p symbol))
1717 (addsymbols symbol))
1718
1719 ((listp symbol)
1720 (setq name (car symbol))
1721 (setq position (cdr symbol)))
1722
1723 ((stringp symbol)
1724 (setq name symbol)
1725 (setq position (get-text-property 1 'org-imenu-marker symbol))))
1726
1727 (unless (or (null position) (null name))
1728 (add-to-list 'symbol-names name)
1729 (add-to-list 'name-and-pos (cons name position))))))))
1730 (addsymbols imenu--index-alist))
1731 ;; If there are matching symbols at point, put them at the beginning of `symbol-names'.
1732 (let ((symbol-at-point (thing-at-point 'symbol)))
1733 (when symbol-at-point
1734 (let* ((regexp (concat (regexp-quote symbol-at-point) "$"))
1735 (matching-symbols (delq nil (mapcar (lambda (symbol)
1736 (if (string-match regexp symbol) symbol))
1737 symbol-names))))
1738 (when matching-symbols
1739 (sort matching-symbols (lambda (a b) (> (length a) (length b))))
1740 (mapc (lambda (symbol) (setq symbol-names (cons symbol (delete symbol symbol-names))))
1741 matching-symbols)))))
1742 (let* ((selected-symbol (ido-completing-read "Symbol? " symbol-names))
1743 (position (cdr (assoc selected-symbol name-and-pos))))
1744 (goto-char position))))
1745
1746 (defun ido-goto-symbol (&optional symbol-list)
1747 "Refresh imenu and jump to a place in the buffer using Ido."
1748 (interactive)
1749 (unless (featurep 'imenu)
1750 (require 'imenu nil t))
1751 (cond
1752 ((not symbol-list)
1753 (let ((ido-mode ido-mode)
1754 (ido-enable-flex-matching
1755 (if (boundp 'ido-enable-flex-matching)
1756 ido-enable-flex-matching t))
1757 name-and-pos symbol-names position)
1758 (unless ido-mode
1759 (ido-mode 1)
1760 (setq ido-enable-flex-matching t))
1761 (while (progn
1762 (imenu--cleanup)
1763 (setq imenu--index-alist nil)
1764 (ido-goto-symbol (imenu--make-index-alist))
1765 (setq selected-symbol
1766 (ido-completing-read "Symbol? " symbol-names))
1767 (string= (car imenu--rescan-item) selected-symbol)))
1768 (unless (and (boundp 'mark-active) mark-active)
1769 (push-mark nil t nil))
1770 (setq position (cdr (assoc selected-symbol name-and-pos)))
1771 (cond
1772 ((overlayp position)
1773 (goto-char (overlay-start position)))
1774 (t
1775 (goto-char position)))))
1776 ((listp symbol-list)
1777 (dolist (symbol symbol-list)
1778 (let (name position)
1779 (cond
1780 ((and (listp symbol) (imenu--subalist-p symbol))
1781 (ido-goto-symbol symbol))
1782 ((listp symbol)
1783 (setq name (car symbol))
1784 (setq position (cdr symbol)))
1785 ((stringp symbol)
1786 (setq name symbol)
1787 (setq position
1788 (get-text-property 1 'org-imenu-marker symbol))))
1789 (unless (or (null position) (null name)
1790 (string= (car imenu--rescan-item) name))
1791 (add-to-list 'symbol-names (substring-no-properties name))
1792 (add-to-list 'name-and-pos (cons (substring-no-properties name) position))))))))
1793
1794 #+end_src
1795
1796 * isearch
1797 #+begin_src emacs-lisp
1798 (setq
1799 isearch-allow-scroll t
1800 search-ring-update t) ;; dont start an edit when going to previous search
1801
1802 (defun isearch-yank-regexp (regexp)
1803 "Pull REGEXP into search regexp."
1804 (let ((isearch-regexp nil)) ;; Dynamic binding of global.
1805 (isearch-yank-string regexp))
1806 (isearch-search-and-update))
1807
1808 (defun isearch-yank-symbol (&optional partialp backward)
1809 "Put symbol at current point into search string.
1810
1811 If PARTIALP is non-nil, find all partial matches."
1812 (interactive "P")
1813
1814 (let (from to bound sym)
1815 (setq sym
1816 ; this block taken directly from find-tag-default
1817 ; we couldn't use the function because we need the internal from and to values
1818 (when (or (progn
1819 ;; Look at text around `point'.
1820 (save-excursion
1821 (skip-syntax-backward "w_") (setq from (point)))
1822 (save-excursion
1823 (skip-syntax-forward "w_") (setq to (point)))
1824 (> to from))
1825 ;; Look between `line-beginning-position' and `point'.
1826 (save-excursion
1827 (and (setq bound (line-beginning-position))
1828 (skip-syntax-backward "^w_" bound)
1829 (> (setq to (point)) bound)
1830 (skip-syntax-backward "w_")
1831 (setq from (point))))
1832 ;; Look between `point' and `line-end-position'.
1833 (save-excursion
1834 (and (setq bound (line-end-position))
1835 (skip-syntax-forward "^w_" bound)
1836 (< (setq from (point)) bound)
1837 (skip-syntax-forward "w_")
1838 (setq to (point)))))
1839 (buffer-substring-no-properties from to)))
1840 (cond ((null sym)
1841 (message "No symbol at point"))
1842 ((null backward)
1843 (goto-char (1+ from)))
1844 (t
1845 (goto-char (1- to))))
1846 (isearch-search)
1847 (if partialp
1848 (isearch-yank-string sym)
1849 (isearch-yank-regexp
1850 (concat "\\_<" (regexp-quote sym) "\\_>")))))
1851
1852 (defun isearch-current-symbol (&optional partialp)
1853 "Incremental search forward with symbol under point.
1854
1855 Prefixed with \\[universal-argument] will find all partial
1856 matches."
1857 (interactive "P")
1858 (let ((start (point)))
1859 (isearch-forward-regexp nil 1)
1860 (isearch-yank-symbol partialp)))
1861 ;; todo, make this
1862
1863 (defun isearch-backward-current-symbol (&optional partialp)
1864 "Incremental search backward with symbol under point.
1865
1866 Prefixed with \\[universal-argument] will find all partial
1867 matches."
1868 (interactive "P")
1869 (let ((start (point)))
1870 (isearch-backward-regexp nil 1)
1871 (isearch-yank-symbol partialp)))
1872
1873
1874
1875 ; lets look through emacs starter kit before we throw this out.
1876
1877
1878 ; automatically wrap to the top of the buffer when isearch fails
1879 (defadvice isearch-search (after isearch-no-fail activate)
1880 (unless isearch-success
1881 (ad-disable-advice 'isearch-search 'after 'isearch-no-fail)
1882 (ad-activate 'isearch-search)
1883 (isearch-repeat (if isearch-forward 'forward))
1884 (ad-enable-advice 'isearch-search 'after 'isearch-no-fail)
1885 (ad-activate 'isearch-search)))
1886
1887 ;; Activate occur easily inside isearch
1888 (define-key isearch-mode-map (kbd "C-o")
1889 (lambda () (interactive)
1890 (let ((case-fold-search isearch-case-fold-search))
1891 (occur (if isearch-regexp
1892 isearch-string
1893 (regexp-quote isearch-string))))))
1894
1895
1896 #+end_src
1897
1898 * lisp / elisp mode setings
1899 #+begin_src emacs-lisp
1900
1901 (add-hook 'emacs-lisp-mode-hook 'starter-kit-remove-elc-on-save)
1902 (defun starter-kit-remove-elc-on-save ()
1903 "If you're saving an elisp file, likely the .elc is no longer valid."
1904 (make-local-variable 'after-save-hook)
1905 (add-hook 'after-save-hook
1906 (lambda ()
1907 (if (file-exists-p (concat buffer-file-name "c"))
1908 (delete-file (concat buffer-file-name "c"))))))
1909
1910
1911 (defun emacs-lisp-mode-defaults ()
1912 ;; checkdoc has an annoying feature that wants a header and footer
1913 ;; in every elisp buffer as if they all were packages
1914 ;; todo, see if there is a way
1915 ;; to make checkdoc usable instead of just disabling it as I do here
1916 (if (boundp 'flycheck-checkers)
1917 (setq flycheck-checkers (remove 'emacs-lisp-checkdoc flycheck-checkers)))
1918 (eldoc-mode 1))
1919 (add-hook 'emacs-lisp-mode-hook 'emacs-lisp-mode-defaults)
1920
1921 (define-key lisp-mode-map (kbd "<M-up>") 'backward-up-list)
1922 (define-key lisp-mode-map (kbd "<M-down>") 'down-list)
1923 (define-key emacs-lisp-mode-map (kbd "<M-up>") 'backward-up-list)
1924 (define-key emacs-lisp-mode-map (kbd "<M-down>") 'down-list)
1925 (define-key emacs-lisp-mode-map (kbd "<M-escape>") 'find-function-at-point)
1926
1927 ;; interactive modes don't need whitespace checks
1928 (defun interactive-lisp-coding-defaults ()
1929 (whitespace-mode -1))
1930 (setq prelude-interactive-lisp-coding-hook 'prelude-interactive-lisp-coding-defaults)
1931
1932
1933 ;; ielm is an interactive Emacs Lisp shell
1934 (defun ielm-mode-defaults ()
1935 (run-hooks 'prelude-interactive-lisp-coding-hook)
1936 (turn-on-eldoc-mode))
1937 (add-hook 'ielm-mode-hook 'ielm-mode-defaults)
1938
1939 #+end_src
1940
1941
1942 * java eclim
1943
1944 based on https://github.com/senny/emacs-eclim
1945
1946
1947 eclim: eclipse completion, searching, validation, etc inside emacs
1948 install
1949 #+begin_src sh :tangle no
1950 cd ~/opt
1951 git clone git://github.com/ervandew/eclim.git
1952 cd eclim
1953 pi ant
1954 ant -Declipse.home=/a/opt/eclipse
1955 #+end_src
1956
1957
1958 currently makes emacs hang a bunch. dunno why. just using eclipse instead
1959 #+begin_src emacs-lisp :tangle no
1960 (require 'eclim)
1961 (global-eclim-mode)
1962
1963 ;; just do java
1964 (setq eclim-accepted-file-regexps
1965 '("\\.java"))
1966
1967 (custom-set-variables
1968 '(eclim-eclipse-dirs '("/a/opt/eclipse"))
1969 '(eclim-executable "/a/opt/eclipse/eclim"))
1970
1971 (setq help-at-pt-display-when-idle t)
1972 (setq help-at-pt-timer-delay 0.1)
1973 (help-at-pt-set-timer)
1974
1975 ;; dunno if this line is needed
1976 (require 'eclimd)
1977 (setq eclimd-default-workspace "/a/bin/eclipse-workspace")
1978
1979 ;;add the emacs-eclim source
1980 (require 'ac-emacs-eclim-source)
1981 (add-hook 'java-mode-hook 'ac-emacs-eclim-java-setup)
1982
1983 #+end_src
1984
1985 #+RESULTS:
1986 | ac-emacs-eclim-java-setup |
1987
1988 * mediawiki
1989 #+begin_src emacs-lisp
1990
1991 (add-to-list 'load-path "~/.emacs.d/src/mediawiki-el")
1992 (eval-after-load "mediawiki"
1993 '(progn
1994 (remove-hook 'outline-minor-mode-hook 'mediawiki-outline-magic-keys)
1995 (add-hook 'mediawiki-mode-hook
1996 (lambda () (define-key mediawiki-mode-map (kbd "C-(") 'mediawiki-save-reload)))
1997
1998 ;; mediawiki mode has a bug that it will claim an edit conflict unless you reload after saving.
1999 ;; I also like to save with no edit summary for previewing on my local mw instance
2000 (defun mediawiki-save-reload ()
2001 (interactive)
2002 (and (mediawiki-save "") (mediawiki-reload)))))
2003 #+end_src
2004 * modes with little configuration needed
2005 #+begin_src emacs-lisp
2006
2007 (load-file "/a/h/iank-mod.el")
2008
2009 (require 'ws-butler)
2010 (ws-butler-global-mode)
2011
2012
2013 (require 'nginx-mode)
2014 ;;The mode should automatically activate for files called nginx.conf and files under /etc/nginx - if not, you can add something like this to your init file:
2015 ;;(add-to-list 'auto-mode-alist '("/etc/nginx/sites-available/.*" . nginx-mode))
2016
2017 ;; todo, put this on a hook with prog mode
2018 ;;(highlight-indentation-mode 1)
2019
2020 (add-hook 'auto-revert-tail-mode-hook
2021 (lambda ()
2022 (when (string=
2023 buffer-file-name
2024 "/var/log/cloudman/development/cm-service.log")
2025 (setq-local prev-auto-revert-max 0)
2026 ;; set buffer-local hook
2027 (add-hook 'after-revert-hook 'tail-colorize nil t))))
2028 (defun tail-colorize ()
2029 (ansi-color-apply-on-region prev-auto-revert-max (point-max))
2030 (setq-local prev-auto-revert-max (point-max)))
2031
2032
2033 ;; gnu global
2034 (require 'ggtags)
2035 (add-hook 'c-mode-common-hook
2036 (lambda () (ggtags-mode 1)
2037 (setq c-label-minimum-indentation 0)))
2038
2039 ;; specific to my unusual keybind setup, you may want to
2040 ;; pick different keys
2041 (define-key ggtags-mode-map (kbd "C-M-o") 'ggtags-find-tag-dwim)
2042 (define-key ggtags-mode-map (kbd "C-M-m") 'ggtags-grep)
2043
2044 (defun gtags-update-single(filename)
2045 "Update Gtags database for changes in a single file"
2046 (interactive)
2047 (start-process "update-gtags" "update-gtags" "bash" "-c" (concat "cd " ggtags-project-root " ; gtags --single-update " filename )))
2048
2049 (defun gtags-update-current-file()
2050 (interactive)
2051 (let ((rel-filename (replace-regexp-in-string
2052 ggtags-project-root "."
2053 (buffer-file-name (current-buffer)))))
2054 (gtags-update-single rel-filename)))
2055
2056 (defun gtags-update-hook()
2057 "Update GTAGS file incrementally upon saving a file"
2058 (when (and ggtags-mode ggtags-project-root)
2059 (gtags-update-current-file)))
2060
2061 (add-hook 'after-save-hook 'gtags-update-hook)
2062
2063 ;; i'd like to make some elisp which modifies a keymap to remove
2064 ;; all binds which don't match a predicate.
2065 ;; I tried setting a keymap to a new keymap,
2066 ;; but that didn't register as functional.
2067 ;; so I'd need to modify the list in place.
2068
2069 (require 'magit)
2070
2071
2072 ;; http://ergoemacs.org/emacs/emacs_CSS_colors.html
2073 ;; there's also rainbow mode, which seems to only work for specific colors? it didn't work at all for me in a css file.
2074 ;; todo, do config group on it, and try out one of those colors.
2075 (defun xah-syntax-color-hsl ()
2076 "Syntax color hex color spec such as 「hsl(0,90%,41%)」 in current buffer."
2077 (interactive)
2078 (font-lock-add-keywords
2079 nil
2080 '(("hsl( *\\([0-9]\\{1,3\\}\\) *, *\\([0-9]\\{1,3\\}\\)% *, *\\([0-9]\\{1,3\\}\\)% *)"
2081 (0 (put-text-property
2082 (+ (match-beginning 0) 3)
2083 (match-end 0)
2084 'face (list :background
2085 (concat "#" (mapconcat 'identity
2086 (mapcar
2087 (lambda (x) (format "%02x" (round (* x 255))))
2088 (color-hsl-to-rgb
2089 (/ (string-to-number (match-string-no-properties 1)) 360.0)
2090 (/ (string-to-number (match-string-no-properties 2)) 100.0)
2091 (/ (string-to-number (match-string-no-properties 3)) 100.0)
2092 ) )
2093 "" )) ; "#00aa00"
2094 ))))) )
2095 (font-lock-fontify-buffer)
2096 )
2097
2098 (add-hook 'css-mode-hook 'xah-syntax-color-hsl)
2099 (add-hook 'php-mode-hook 'xah-syntax-color-hsl)
2100 (add-hook 'html-mode-hook 'xah-syntax-color-hsl)
2101
2102
2103 ;; message mode prompted me on first message.
2104 ;; a function which describes options then sets this
2105 ;; the other options were to use smtp directly or pass to another mail client
2106 ;; here we use the standard sendmail interface, which I use postfix for
2107 (setq send-mail-function (quote sendmail-send-it))
2108
2109 (add-to-list 'load-path "~/.emacs.d/src/spray")
2110 (require 'spray)
2111 (global-set-key (kbd "C-M-w") 'spray-mode)
2112 ;; remember, h/l = move. f/s = faster/slower, space = pause, all others quit
2113
2114 ;; delete active selection with self-insert commands
2115 (delete-selection-mode t)
2116
2117 ;; Transparently open compressed files
2118 (auto-compression-mode t)
2119
2120 ;; Highlight matching parenthesesq when the pointq is on them.
2121 ;; not needed since smart paren mode?
2122 ;; (show-paren-mode 1)
2123
2124
2125 ;; not documented, but looking at the source, I find this
2126 ;; stops me from being asked what command on every C-c-c
2127 ;; when doing a latex document.
2128 (setq TeX-command-force "LaTeX")
2129
2130 ;; dot mode, repeats last action
2131 (require 'dot-mode)
2132 (add-hook 'find-file-hooks 'dot-mode-on)
2133
2134
2135 ;; clean up obsolete buffers automatically at midnight
2136 (require 'midnight)
2137
2138
2139 ;; disabled because it takes 400ms on startup
2140 ;; ;; emacs regexes are too limited.
2141 ;; (require 'foreign-regexp)
2142 ;; ;; perl is most powerful, but javascript is pretty close and
2143 ;; ;; I'd rather know javascript stuff than perl
2144 ;; (custom-set-variables
2145 ;; '(foreign-regexp/regexp-type 'javascript) ;; Choose by your preference.
2146 ;; '(reb-re-syntax 'foreign-regexp)) ;; Tell re-builder to use foreign regexp.
2147 ;; ;; it would be nice to add documentation to do this for more commands to that package
2148 ;; ;; disabled because it's too slow. but I'd still m-x it for advanced replacements
2149 ;; ;;(define-key global-map [remap isearch-forward-regexp] 'foreign-regexp/isearch-forward)
2150
2151
2152 ;; saner regex syntax
2153 (require 're-builder)
2154 (setq reb-re-syntax 'string)
2155
2156
2157 ;; use shift + arrow keys to switch between visible buffers
2158 ;; todo, set these keys to something else
2159 (require 'windmove)
2160 (windmove-default-keybindings)
2161
2162
2163 ;; show the name of the current function definition in the modeline
2164 (require 'which-func)
2165 (setq which-func-modes t)
2166 (which-function-mode 1)
2167
2168
2169 ;; enable winner-mode to manage window configurations
2170 (winner-mode +1)
2171
2172 ;; meaningful names for buffers with the same name
2173 (require 'uniquify)
2174 (setq uniquify-buffer-name-style 'forward
2175 uniquify-separator "/"
2176 ;; for sdx work. until I figure out a better way.
2177 ;; maybe something like projectile can do it,
2178 ;; or hacking around the status bar
2179 uniquify-min-dir-content 2
2180 uniquify-after-kill-buffer-p t ; rename after killing uniquified
2181 uniquify-ignore-buffers-re "^\\*") ; don't muck with special buffers
2182
2183
2184 ;; makefiles require tabs
2185 ;; todo: find a makefile indent function that works,
2186 ;; best I could find is this one which means don't indent at all
2187 ;;
2188 (add-hook 'makefile-mode-hook
2189 (lambda ()
2190 (setq indent-tabs-mode t)
2191 (setq indent-line-function (lambda () 'no-indent))))
2192
2193
2194 ;; todo, turn on auto-fill just for txt files
2195 ;;(add-hook 'text-mode-hook 'turn-on-auto-fill)
2196 (add-hook 'text-mode-hook 'turn-on-flyspell)
2197
2198
2199 ;; auto indent shell script comments
2200 (setq sh-indent-comment t)
2201
2202 ;; random extra highlights
2203 (require 'volatile-highlights)
2204 (volatile-highlights-mode t)
2205
2206
2207 ;; make help buffers smaller when it makes sense
2208 (temp-buffer-resize-mode 1)
2209
2210
2211 (require 'info+)
2212 ;; based on suggestions in info+.el, I also installed misc-fns, strings, and thingatpt+
2213 ;; remove some bad keybinds from info+
2214 (define-key Info-mode-map [mouse-4] nil)
2215 (define-key Info-mode-map [mouse-5] nil)
2216
2217
2218 (require 'smooth-scroll)
2219 ;; long gnus summary buffers lags too much with this,
2220 ;; but I like it enough to leave it enabled by default
2221 ;; and crank up the step size to be faster
2222 ;; and it doesn't have a way to enable it only for certain modes etc.
2223 ;; todo sometime, make it work for certain modes only
2224 (smooth-scroll-mode t)
2225 ;; its too slow with the default of 2
2226 (setq smooth-scroll/vscroll-step-size 7)
2227 ;; sublimity doesn't work as good going fast by default
2228 ;; smooth-scrolling.el, does not do smooth scrolling. its about cursor location
2229
2230
2231 (setq sh-here-document-word "'EOF'")
2232
2233 (setq tramp-default-method "ssh")
2234 #+end_src
2235 * misc general settings
2236
2237 #+begin_src emacs-lisp
2238
2239 (setq vc-follow-symlinks t)
2240
2241 ;; give us a shell to start instead of scratch
2242 ;;(setq initial-buffer-choice (lambda () (new-shell)))
2243
2244 ;; disable this nasty function, as I always use a gui
2245 (defun suspend-frame() (interactive))
2246
2247 ;; to reopen just ido-switch-buffer (c-l), *scratch*
2248 ;; (kill-buffer "*scratch*")
2249
2250 ;; Seed the random-number generator
2251 (random t)
2252
2253 ;; easier to remember than keybinds
2254 (defalias 'scrypt 'mml-secure-message-encrypt-pgpmime)
2255 (defalias 'sign 'mml-secure-message-sign-pgpmime)
2256 (defun encrypt ()
2257 (interactive)
2258 (mml-secure-message-encrypt-pgpmime 'dontsign))
2259
2260 ;; don't highlight the region.
2261 (set-face-background 'region nil)
2262
2263 ;; this fixes save error for python example code
2264 (define-coding-system-alias 'UTF-8 'utf-8)
2265
2266 ;; i don't use frame titles, but if I ever do
2267 ;; this starter kit setting is probably good
2268 (if window-system (setq frame-title-format '(buffer-file-name "%f" ("%b"))))
2269
2270 (set-terminal-coding-system 'utf-8)
2271 (set-keyboard-coding-system 'utf-8)
2272 (prefer-coding-system 'utf-8)
2273
2274 ;; remove ugly 3d box feature
2275 (set-face-attribute 'mode-line nil :box nil)
2276
2277 (add-to-list 'default-frame-alist
2278 '(font . "DejaVu Sans Mono-11"))
2279 ; the default will jump 2 sizes.
2280 (setq text-scale-mode-step 1.1)
2281 (setq font-lock-maximum-decoration t
2282 inhibit-startup-message t
2283 transient-mark-mode t
2284 delete-by-moving-to-trash t
2285 shift-select-mode nil
2286 truncate-partial-width-windows nil
2287 uniquify-buffer-name-style 'forward
2288 oddmuse-directory "~/.emacs.d/oddmuse"
2289 echo-keystrokes 0.1
2290 mark-ring-max 160
2291 sort-fold-case t ; case insensitive line sorting
2292 global-mark-ring-max 1000
2293 ;; the bell seems to lag the ui
2294 ;;visible-bell t
2295 case-replace nil
2296 revert-without-query '(".*")
2297 ;; don't pause display code on input.
2298 ;; smoother display performance at slight cost of input performance
2299 redisplay-dont-pause t
2300 font-lock-maximum-decoration t) ; probably default and not necesary
2301
2302
2303 (setq-default indent-tabs-mode nil ;; don't use tabs to indent
2304 cursor-type 'box
2305 fill-column 72
2306
2307 ;; wrap at word boundaries instead of mid-word
2308 word-wrap t
2309 imenu-auto-rescan t
2310 indicate-empty-lines t) ; mark end of buffer
2311
2312
2313 (blink-cursor-mode '(-4))
2314 (menu-bar-mode -1)
2315 (tool-bar-mode -1)
2316 (set-scroll-bar-mode 'left)
2317
2318
2319 ;; enable various commands
2320 (put 'narrow-to-region 'disabled nil)
2321 (put 'narrow-to-page 'disabled nil)
2322 (put 'narrow-to-defun 'disabled nil)
2323 (put 'upcase-region 'disabled nil)
2324 (put 'downcase-region 'disabled nil)
2325 (put 'scroll-left 'disabled nil)
2326 ;; these from graphene, haven't read about them yet
2327 (put 'ido-complete 'disabled nil)
2328 (put 'ido-exit-minibuffer 'disabled nil)
2329 (put 'dired-find-alternate-file 'disabled nil)
2330 (put 'autopair-newline 'disabled nil)
2331
2332
2333
2334 ;;disable and minimize various prompts/messages
2335 (fset 'yes-or-no-p 'y-or-n-p)
2336 (setq confirm-nonexistent-file-or-buffer nil
2337 inhibit-startup-message t
2338 inhibit-startup-echo-area-message t
2339 inhibit-startup-screen t
2340 compilation-read-command nil ;; just don't compile with unsafe file local vars
2341 kill-buffer-query-functions (remq 'process-kill-buffer-query-function
2342 kill-buffer-query-functions))
2343
2344
2345 ;; exit without bothering me
2346 ;; http://stackoverflow.com/questions/2706527/make-emacs-stop-asking-active-processes-exist-kill-them-and-exit-anyway/2708042#2708042
2347 (add-hook 'comint-exec-hook
2348 (lambda () (set-process-query-on-exit-flag (get-buffer-process (current-buffer)) nil)))
2349 ;; based on save-buffers-kill-emacs help string, don't ask about clients when exiting
2350 ;; apparently this would need to be in some later hook. dunno where is best, but this works
2351 (defadvice save-buffers-kill-emacs (before no-client-prompt-advice activate)
2352 (setq kill-emacs-query-functions (delq 'server-kill-emacs-query-function kill-emacs-query-functions)))
2353
2354
2355
2356 ;; (custom-set-faces
2357 ;; ;; setting header-line-format to " " as a hack for a top margin the oly thning I could find to do a top margin
2358 ;; '(header-line ((t (:background "default" :foreground "default" :overline nil :underline nil))))
2359 ;; ;; don't highlight the region
2360 ;; '(region ((t nil))))
2361 (setq-default header-line-format " ")
2362
2363
2364 (setq initial-scratch-message nil)
2365 #+end_src
2366
2367
2368 vertical margin background.
2369 google turned up: http://lists.gnu.org/archive/html/help-gnu-emacs/2014-03/msg00544.html
2370 the xresource doesn't work for me, probably an xmonad thing.
2371
2372 figured out I needed to customize the header line face. To find the face, M-x list-faces-display or just google / search
2373 info,
2374 then M-x customize-face
2375 header-line
2376 unchecked some stuff so that it inherits from default.
2377
2378 * misc function definitions
2379 #+begin_src emacs-lisp
2380
2381
2382
2383
2384
2385 (defun next-backup-dir ()
2386 "In a directory listing from rsync -n,
2387 Go to the next directory based on where the cursor is."
2388 (interactive)
2389 (let* ((start-col (current-column))
2390 (end-col (progn (skip-chars-forward "^/\n") (current-column)))
2391 (dir (progn
2392 (beginning-of-line 1)
2393 (buffer-substring-no-properties (point) (+ (point) end-col)))))
2394 (message dir)
2395 (forward-line 1)
2396 (while (and (not (eobp))
2397 (string= dir (buffer-substring-no-properties (point) (+ (point) end-col))))
2398 (forward-line 1))
2399 (forward-char-same-line start-col)))
2400 ;; copy paste this for fast keybind
2401 ;;(local-set-key (kbd "<kp-enter>"))
2402
2403
2404 (defun goto-buffer-or-find-file (file-name)
2405 "If buffer is with FILE-NAME exists, go to it, else open the file using full path."
2406 (interactive)
2407 (let ((b (get-buffer (file-name-nondirectory file-name))))
2408 (if b
2409 (switch-to-buffer b)
2410 (find-file file-name))))
2411
2412
2413
2414
2415 ;; todo, i think this is broken. perhaps the last goto-char is not accounting for buffer or something
2416 (defun unpop-global-mark ()
2417 "Unpop off global mark ring. Does nothing if mark ring is empty."
2418 (interactive)
2419 (when global-mark-ring
2420 (setq global-mark-ring (cons (copy-marker (mark-marker)) global-mark-ring))
2421 (let ((lm (car (last global-mark-ring))))
2422 (set-marker (mark-marker) (marker-position lm) (marker-buffer lm)))
2423 (when (null (mark t)) (ding))
2424 (setq global-mark-ring (nbutlast global-mark-ring))
2425 (goto-char (marker-position (mark-marker)))))
2426
2427 (defun indent-buffer ()
2428 "Indents the entire buffer."
2429 (interactive)
2430 (cond ((derived-mode-p 'org-mode)
2431 (org-indent-region (point-min) (point-max)))
2432 ((derived-mode-p 'python-mode)
2433 (py-autopep8))
2434 (t
2435 (indent-region (point-min) (point-max)))))
2436
2437
2438 ;; TODO doesn't work with uniquify
2439 (defun rename-file-and-buffer ()
2440 "Renames current buffer and file it is visiting."
2441 (interactive)
2442 (let ((name (buffer-name))
2443 (filename (buffer-file-name)))
2444 (if (not (and filename (file-exists-p filename)))
2445 (message "Buffer '%s' is not visiting a file!" name)
2446 (let ((new-name (read-file-name "New name: " filename)))
2447 (cond ((get-buffer new-name)
2448 (message "A buffer named '%s' already exists!" new-name))
2449 (t
2450 (rename-file name new-name 1)
2451 (rename-buffer new-name)
2452 (set-visited-file-name new-name)
2453 (set-buffer-modified-p nil)))))))
2454
2455
2456
2457 (defun sudo-edit (&optional arg)
2458 (interactive "P")
2459 (if (or arg (not buffer-file-name))
2460 (find-file (concat "/sudo:root@localhost:" (ido-read-file-name "File: ")))
2461 (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
2462
2463
2464
2465 (defun backward-symbol (arg)
2466 (interactive "p")
2467 (forward-symbol (- arg)))
2468
2469 #+end_src
2470
2471 * mode line
2472 #+begin_src emacs-lisp
2473
2474 ; -----------------------------
2475 ; fixing up the mode line
2476 ; modified from mastering emacs blog
2477 ; ----------------------------
2478
2479 (defvar mode-line-cleaner-alist
2480 `((auto-complete-mode . "")
2481 (yas/minor-mode . "")
2482 (paredit-mode . "")
2483 (auto-fill-function . "")
2484 (eldoc-mode . "")
2485 (abbrev-mode . "")
2486 (flyspell-mode . "")
2487 (glasses-mode . "")
2488 (dot-mode . "")
2489 (yas-global-mode . "")
2490 (yas-minor-mode . "")
2491 (undo-tree-mode . "")
2492 (volatile-highlights-mode . "")
2493 (highlight-symbol-mode . "")
2494 ;; Major modes
2495 (lisp-interaction-mode . "λ")
2496 (hi-lock-mode . "")
2497 (python-mode . "Py")
2498 (emacs-lisp-mode . "EL")
2499 (nxhtml-mode . "nx"))
2500 "Alist for `clean-mode-line'.
2501
2502 When you add a new element to the alist, keep in mind that you
2503 must pass the correct minor/major mode symbol and a string you
2504 want to use in the modeline *in lieu of* the original.")
2505
2506
2507 (defun clean-mode-line ()
2508 (interactive)
2509 (loop for cleaner in mode-line-cleaner-alist
2510 do (let* ((mode (car cleaner))
2511 (mode-str (cdr cleaner))
2512 (old-mode-str (cdr (assq mode minor-mode-alist))))
2513 (when old-mode-str
2514 (setcar old-mode-str mode-str))
2515 ;; major mode
2516 (when (eq mode major-mode)
2517 (setq mode-name mode-str)))))
2518
2519 ; disabled
2520 ; (add-hook 'after-change-major-mode-hook 'clean-mode-line)
2521
2522
2523 ;;; alias the new `flymake-report-status-slim' to
2524 ;;; `flymake-report-status'
2525 (defalias 'flymake-report-status 'flymake-report-status-slim)
2526 (defun flymake-report-status-slim (e-w &optional status)
2527 "Show \"slim\" flymake status in mode line."
2528 (when e-w
2529 (setq flymake-mode-line-e-w e-w))
2530 (when status
2531 (setq flymake-mode-line-status status))
2532 (let* ((mode-line " Φ"))
2533 (when (> (length flymake-mode-line-e-w) 0)
2534 (setq mode-line (concat mode-line ":" flymake-mode-line-e-w)))
2535 (setq mode-line (concat mode-line flymake-mode-line-status))
2536 (setq flymake-mode-line mode-line)
2537 (force-mode-line-update)))
2538
2539
2540 (add-hook 'after-change-major-mode-hook (lambda ()
2541
2542 (setq mode-line-mule-info nil
2543 mode-line-position nil
2544 mode-line-modes nil))) ; todo, make only flymake status show up
2545
2546 #+end_src
2547
2548 * mouse related
2549 ** settings
2550 #+begin_src emacs-lisp
2551 (setq focus-follows-mouse t
2552 mouse-autoselect-window t
2553 xterm-mouse-mode t)
2554 #+end_src
2555 ** move-mouse-to-point
2556 todo, this is buggy with multiple windows open.
2557 #+begin_src emacs-lisp
2558 (defun move-mouse-to-point ()
2559 (interactive)
2560 (let* ((pos (posn-col-row (posn-at-point)))
2561 (x (+ (car pos) 2)) ; no idea why this is off by 1-2
2562 (y (cdr pos)))
2563 (set-mouse-position (selected-frame) x y)))
2564 #+end_src
2565 ** cursor highlight
2566 disabled until fixed
2567 #+begin_src emacs-lisp :tangle no
2568 (defun mouse-follow-cursor ()
2569 ;(if (not (equal this-command last-command)) (print this-command))
2570 ;debug
2571 ; (print this-command)
2572 (when (and this-command (not (string= this-command "show-pointer")))
2573 (let* ((pos (posn-col-row (posn-at-point)))
2574 (x (1+ (car pos))) ; no idea why this is off by 1
2575 (y (cdr pos)))
2576 (setq ignore-mouse-visibility t)
2577 (set-mouse-position (selected-frame) x y))
2578 ;(sleep-for 0 100)
2579 (frame-make-pointer-invisible)))
2580
2581 ; (when this-command
2582 ; (if (string= this-command "show-pointer")
2583 ; (frame-make-pointer-visible)
2584 ;))
2585
2586
2587
2588 (defun show-pointer ()
2589 (interactive)
2590 (if ignore-mouse-visibility
2591 (setq ignore-mouse-visibility nil)
2592 ; (print "visible")
2593 (frame-make-pointer-visible)))
2594
2595 (setq ignore-mouse-visibility t)
2596 ; disabled
2597 ; (global-set-key (kbd "<mouse-movement>") 'show-pointer)
2598
2599 ; (add-hook 'post-command-hook 'mouse-follow-cursor t)
2600
2601
2602 ; status. working, except that all scroll wheel actions send a mouse-movement command before doing their actual command, which makes the pointer flicker.
2603 ; this is just an artifact of xbindkeys. when i do my own mouse chip, it will fix this.
2604
2605 ; we could set track-mouse to nil, then do the command, then set it back. i like that idea a bit better.
2606 ; we could do the same thing in the other case of ignore-mouse-visibility.
2607
2608 ; there are also other issues, it doesn't work with changing buffers on a split screen.
2609 ; i think a good idea along with this would be for the cursor to follow the mouse all the time.
2610 ; i have done code for that in my mouse 1 function,
2611 ; i just need to read it again and try it out.
2612
2613
2614
2615
2616 ; this does not take care of scrolling,
2617 ; a post-command hook function below does,
2618 ; but it breaks when the frame is split.
2619 ; the bug is specifically in mouse-pixel-position
2620 ; todo, fix this eventually
2621 (defun mouse-highlight-event (event)
2622 (interactive "e")
2623 (when (or (not event) (mouse-movement-p event)
2624 (memq (car-safe event) '(switch-frame select-window)))
2625 (let ((pos (posn-point (event-end event))))
2626 (if (eq (overlay-buffer mouse-hi-ov) (current-buffer))
2627 (move-overlay mouse-hi-ov pos (1+ pos))
2628 (delete-overlay mouse-hi-ov)
2629 (setq mouse-hi-ov
2630 (make-overlay pos (1+ pos)))
2631 (overlay-put mouse-hi-ov
2632 'insert-in-front-hooks (list 'mouse-hi-modification))
2633 (overlay-put mouse-hi-ov 'priority 1001))
2634 (cond ((save-excursion (goto-char pos) (eolp))
2635 (overlay-put mouse-hi-ov 'face nil)
2636 (overlay-put mouse-hi-ov 'before-string
2637 (propertize
2638 " "
2639 'cursor t
2640 'face 'mouse-cursor-face)))
2641 (t
2642 (overlay-put mouse-hi-ov 'face 'mouse-cursor-face)
2643 (overlay-put mouse-hi-ov 'before-string nil))))))
2644
2645
2646 ; overlay changed hook function
2647 (defun mouse-hi-modification (ov timing beginning end &optional length)
2648 "Make an overlay of length 1 not expand when text is inserted at the front."
2649 (when timing
2650 (let ((start (overlay-start ov)))
2651 (move-overlay ov start (1+ start)))))
2652
2653
2654
2655
2656 (defun mouse-hi-command-hook ()
2657 ; not sure if I need to deal with case of a nil mouse position in some unforseen situation.
2658 (let ((x-y (cdr (mouse-pixel-position))))
2659 (when (wholenump (car x-y))
2660 (let ((pos (posn-point (posn-at-x-y (car x-y) (cdr x-y) nil t))))
2661 (when pos
2662 (if (eq (overlay-buffer mouse-hi-ov) (current-buffer))
2663 (move-overlay mouse-hi-ov pos (1+ pos))
2664 (delete-overlay mouse-hi-ov)
2665 (setq mouse-hi-ov
2666 (make-overlay pos (1+ pos)))
2667
2668 (overlay-put mouse-hi-ov 'priority 1001))
2669 (cond ((save-excursion (goto-char pos) (eolp))
2670
2671 (overlay-put mouse-hi-ov 'face nil)
2672 (overlay-put mouse-hi-ov 'before-string
2673 (propertize
2674 " "
2675 'cursor t
2676 'face 'mouse-cursor-face)))
2677 (t
2678 (overlay-put mouse-hi-ov 'face 'mouse-cursor-face)
2679 (overlay-put mouse-hi-ov 'before-string nil))))))))
2680 ; (pcase-let ((`(,_ ,x . ,y) (mouse-pixel-position)))
2681 ; (posn-point (posn-at-x-y x y)))))
2682 ; equivalent of above to find pos. todo, learn about the above syntax
2683
2684 (setq mouse-hi-ov (make-overlay 1 1))
2685 (delete-overlay mouse-hi-ov)
2686 ; initialized overlay
2687 ; temporarily set to nil instead of t because it is broken and
2688 ; also has a bug that makes emacs not remember the column when
2689 ; doing up and down movements.
2690 ; it also messes up yas/insert-snippet, dunno why.
2691 ; i should test out whether it is something in the post-command hook
2692 ; (setq track-mouse t)
2693 ;(add-hook 'post-command-hook 'mouse-hi-command-hook)
2694
2695 ;(mouse-hi-command-hook)
2696 ;(setq debug-on-error nil)
2697
2698 #+end_src
2699 ** mouse 1 drag func
2700 :PROPERTIES:
2701
2702 disabled as it breaks in newer emacs versions with this error, when
2703 clicking on info links
2704
2705 "and: Symbol's function definition is void: mouse--remap-link-click-p"
2706
2707 #+begin_src emacs-lisp :tangle no
2708
2709 ; Copied from mouse.el and modified.
2710 ; my modifications have comments prefaced by "ian"
2711 (defun mouse-drag-track (start-event &optional
2712 do-mouse-drag-region-post-process)
2713 "Track mouse drags by highlighting area between point and cursor.
2714 The region will be defined with mark and point.
2715 DO-MOUSE-DRAG-REGION-POST-PROCESS should only be used by
2716 `mouse-drag-region'."
2717 (mouse-minibuffer-check start-event)
2718 (setq mouse-selection-click-count-buffer (current-buffer))
2719 ; ian. removed as unneeded since I don't use TMM
2720 ;(deactivate-mark)
2721 (let* ((scroll-margin 0) ; Avoid margin scrolling (Bug#9541).
2722 (original-window (selected-window))
2723 ;; We've recorded what we needed from the current buffer and
2724 ;; window, now let's jump to the place of the event, where things
2725 ;; are happening.
2726 (_ (mouse-set-point start-event))
2727 (echo-keystrokes 0)
2728 (start-posn (event-start start-event))
2729 (start-point (posn-point start-posn))
2730 (start-window (posn-window start-posn))
2731 (start-window-start (window-start start-window))
2732 (start-hscroll (window-hscroll start-window))
2733 (bounds (window-edges start-window))
2734 (make-cursor-line-fully-visible nil)
2735 (top (nth 1 bounds))
2736 (bottom (if (window-minibuffer-p start-window)
2737 (nth 3 bounds)
2738 ;; Don't count the mode line.
2739 (1- (nth 3 bounds))))
2740 (on-link (and mouse-1-click-follows-link
2741 ;; Use start-point before the intangibility
2742 ;; treatment, in case we click on a link inside
2743 ;; intangible text.
2744 (mouse-on-link-p start-posn)))
2745 (click-count (1- (event-click-count start-event)))
2746 (remap-double-click (and on-link
2747 (eq mouse-1-click-follows-link 'double)
2748 (= click-count 1)))
2749 ;; Suppress automatic hscrolling, because that is a nuisance
2750 ;; when setting point near the right fringe (but see below).
2751 (auto-hscroll-mode-saved auto-hscroll-mode)
2752 (auto-hscroll-mode nil)
2753 moved-off-start event end end-point)
2754
2755 (setq mouse-selection-click-count click-count)
2756 ;; In case the down click is in the middle of some intangible text,
2757 ;; use the end of that text, and put it in START-POINT.
2758 (if (< (point) start-point)
2759 (goto-char start-point))
2760 (setq start-point (point))
2761 (if remap-double-click
2762 (setq click-count 0))
2763
2764 ;; Activate the region, using `mouse-start-end' to determine where
2765 ;; to put point and mark (e.g., double-click will select a word).
2766 (setq transient-mark-mode
2767 (if (eq transient-mark-mode 'lambda)
2768 '(only)
2769 (cons 'only transient-mark-mode)))
2770 (delete-overlay mouse-hi-ov) ; ian, added this.
2771
2772 (let ((range (mouse-start-end start-point start-point click-count)))
2773 (push-mark (nth 0 range) t t)
2774 (goto-char (nth 1 range)))
2775
2776 ;; Track the mouse until we get a non-movement event.
2777 (track-mouse
2778 (while (progn
2779 (setq event (read-event))
2780 (or (mouse-movement-p event)
2781 (memq (car-safe event) '(switch-frame select-window))))
2782 (unless (memq (car-safe event) '(switch-frame select-window))
2783 ;; Automatic hscrolling did not occur during the call to
2784 ;; `read-event'; but if the user subsequently drags the
2785 ;; mouse, go ahead and hscroll.
2786 (let ((auto-hscroll-mode auto-hscroll-mode-saved))
2787 (redisplay))
2788 (setq end (event-end event)
2789 end-point (posn-point end))
2790 ;; Note whether the mouse has left the starting position.
2791 (unless (eq end-point start-point)
2792 (setq moved-off-start t))
2793 (if (and (eq (posn-window end) start-window)
2794 (integer-or-marker-p end-point))
2795 (mouse--drag-set-mark-and-point start-point
2796 end-point click-count)
2797 (let ((mouse-row (cdr (cdr (mouse-position)))))
2798 (cond
2799 ((null mouse-row))
2800 ((< mouse-row top)
2801 (mouse-scroll-subr start-window (- mouse-row top)
2802 nil start-point))
2803 ((>= mouse-row bottom)
2804 (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
2805 nil start-point))))))
2806 (visible-mark-move-overlays))) ; ian, added this
2807
2808
2809 ;; Handle the terminating event if possible.
2810 (when (consp event)
2811 ;; Ensure that point is on the end of the last event.
2812 (when (and (setq end-point (posn-point (event-end event)))
2813 (eq (posn-window end) start-window)
2814 (integer-or-marker-p end-point)
2815 (/= start-point end-point))
2816 (mouse--drag-set-mark-and-point start-point
2817 end-point click-count))
2818
2819 ;; Find its binding.
2820 (let* ((fun (key-binding (vector (car event))))
2821 (do-multi-click (and (> (event-click-count event) 0)
2822 (functionp fun)
2823 (not (memq fun '(mouse-set-point
2824 mouse-set-region))))))
2825 (if (and (/= (mark) (point))
2826 (not do-multi-click))
2827
2828 ;; If point has moved, finish the drag.
2829 (let* (last-command this-command)
2830 (and mouse-drag-copy-region
2831 do-mouse-drag-region-post-process
2832 (let (deactivate-mark)
2833 (copy-region-as-kill (mark) (point)))))
2834
2835 ;; Otherwise, run binding of terminating up-event.
2836 (if do-multi-click
2837 (goto-char start-point)
2838 (deactivate-mark)
2839 (unless moved-off-start
2840 ;; ian: poping the mark is a poor choice of behavior.
2841 ;; we should delete the mark instead.
2842 ;; The first way I found to delete it is to pop it first
2843 (pop-mark)
2844 (setq mark-ring (nbutlast mark-ring))))
2845
2846 (when (and (functionp fun)
2847 (= start-hscroll (window-hscroll start-window))
2848 ;; Don't run the up-event handler if the window
2849 ;; start changed in a redisplay after the
2850 ;; mouse-set-point for the down-mouse event at
2851 ;; the beginning of this function. When the
2852 ;; window start has changed, the up-mouse event
2853 ;; contains a different position due to the new
2854 ;; window contents, and point is set again.
2855 (or end-point
2856 (= (window-start start-window)
2857 start-window-start)))
2858
2859 (when (and on-link
2860 (= start-point (point))
2861 (mouse--remap-link-click-p start-event event))
2862
2863 ;; If we rebind to mouse-2, reselect previous selected
2864 ;; window, so that the mouse-2 event runs in the same
2865 ;; situation as if user had clicked it directly. Fixes
2866 ;; the bug reported by juri@jurta.org on 2005-12-27.
2867 (if (or (vectorp on-link) (stringp on-link))
2868 (setq event (aref on-link 0))
2869 (select-window original-window)
2870 (setcar event 'mouse-2)
2871 ;; If this mouse click has never been done by the
2872 ;; user, it doesn't have the necessary property to be
2873 ;; interpreted correctly.
2874 (put 'mouse-2 'event-kind 'mouse-click)))
2875 (push event unread-command-events)))))))
2876 #+end_src
2877
2878 ** mouse 3
2879 #+begin_src emacs-lisp :tangle no
2880
2881
2882 (defun mouse3-range-mark (start click click-count)
2883 (let* ((range (mouse-start-end start click click-count))
2884 (beg (nth 0 range))
2885 (end (nth 1 range)))
2886 (cond ((<= click start)
2887 (set-mark beg))
2888 (t
2889 (set-mark end))))
2890 (visible-mark-move-overlays))
2891
2892
2893 (defun mouse3-set-mark (event)
2894 "in development"
2895 (interactive "e")
2896 (mouse-minibuffer-check event)
2897 ;; Use event-end in case called from mouse-drag-region.
2898 ;; If EVENT is a click, event-end and event-start give same value.
2899 (set-mark (posn-point (event-end event)))
2900 (visible-mark-move-overlays))
2901
2902
2903 (defun mouse3-func (start-event)
2904 "in development"
2905 (interactive "e")
2906
2907 (run-hooks 'mouse-leave-buffer-hook)
2908
2909 (mouse-minibuffer-check start-event)
2910 (setq mouse-selection-click-count-buffer (current-buffer))
2911 (push-mark (posn-point (event-end start-event)))
2912
2913 (let* ((scroll-margin 0) ; Avoid margin scrolling (Bug#9541).
2914 (original-window (selected-window))
2915 ;; We've recorded what we needed from the current buffer and
2916 ;; window, now let's jump to the place of the event, where things
2917 ;; are happening.
2918 ;(_ (mouse-set-point start-event)) ; ian: commented, replaced
2919 (echo-keystrokes 0)
2920 (start-posn (event-start start-event))
2921 (start-point (posn-point start-posn))
2922 (start-window (posn-window start-posn))
2923 (start-window-start (window-start start-window))
2924 (start-hscroll (window-hscroll start-window))
2925 (bounds (window-edges start-window))
2926 (make-cursor-line-fully-visible nil)
2927 (top (nth 1 bounds))
2928 (bottom (if (window-minibuffer-p start-window)
2929 (nth 3 bounds)
2930 ;; Don't count the mode line.
2931 (1- (nth 3 bounds))))
2932 (click-count (1- (event-click-count start-event)))
2933 ;; Suppress automatic hscrolling, because that is a nuisance
2934 ;; when setting point near the right fringe (but see below).
2935 (auto-hscroll-mode-saved auto-hscroll-mode)
2936 (auto-hscroll-mode nil)
2937 moved-off-start event end end-point)
2938
2939 (setq mouse-selection-click-count click-count)
2940 ;; In case the down click is in the middle of some intangible text,
2941 ;; use the end of that text, and put it in START-POINT.
2942 (if (< (mark) start-point) ; ian: change point to the mark
2943 (set-mark start-point)
2944 (visible-mark-move-overlays))
2945 (setq start-point (mark))
2946
2947 (delete-overlay mouse-hi-ov) ; ian, added this.
2948
2949 ;; Activate the region, using `mouse-start-end' to determine where
2950 ;; to put point and mark (e.g., double-click will select a word).
2951 (let ((range (mouse-start-end start-point start-point click-count)))
2952 (set-mark (nth 1 range)))
2953 (visible-mark-move-overlays)
2954
2955
2956 ;; Track the mouse until we get a non-movement event.
2957 (track-mouse
2958
2959 (while (progn
2960 (setq event (read-event))
2961 (or (mouse-movement-p event)
2962 (memq (car-safe event) '(switch-frame select-window))))
2963 (unless (memq (car-safe event) '(switch-frame select-window))
2964
2965 ;; Automatic hscrolling did not occur during the call to
2966 ;; `read-event'; but if the user subsequently drags the
2967 ;; mouse, go ahead and hscroll.
2968 (let ((auto-hscroll-mode auto-hscroll-mode-saved))
2969 (redisplay))
2970 (setq end (event-end event)
2971 end-point (posn-point end))
2972 ;; Note whether the mouse has left the starting position.
2973
2974 (unless (eq end-point start-point)
2975 (setq moved-off-start t))
2976 (if (and (eq (posn-window end) start-window)
2977 (integer-or-marker-p end-point))
2978 (mouse3-range-mark start-point end-point click-count); ian, set mark
2979
2980 ; do scrolling if needed
2981 (let ((mouse-row (cdr (cdr (mouse-position)))))
2982 (cond
2983 ((null mouse-row))
2984 ((< mouse-row top)
2985 (mouse-scroll-subr start-window (- mouse-row top)
2986 nil start-point))
2987 ((>= mouse-row bottom)
2988 (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
2989 nil start-point))))))))
2990
2991 ;; Handle the terminating event if possible.
2992 (when (consp event)
2993 ;; Ensure that point is on the end of the last event.
2994 (when (and (setq end-point (posn-point (event-end event)))
2995 (eq (posn-window end) start-window)
2996 (integer-or-marker-p end-point)
2997 (/= start-point end-point))
2998 ;(mouse--drag-set-mark-and-point start-point ; ian, set mark
2999 ;end-point click-count))
3000 (mouse3-range-mark start-point end-point click-count)); ian, set mark
3001
3002 ;; Find its binding.
3003 (let* ((fun (key-binding (vector (car event))))
3004 (do-multi-click (and (> (event-click-count event) 0)
3005 (functionp fun)
3006 (not (memq fun '(mouse3-set-mark))))))
3007 (if (and (/= end-point start-point)
3008 (not do-multi-click))
3009
3010 ;; If point has moved, finish the drag.
3011 (let* (last-command this-command)
3012 (and mouse-drag-copy-region
3013 do-mouse-drag-region-post-process
3014 (let (deactivate-mark)
3015 (copy-region-as-kill (mark) (point)))))
3016
3017 ;; Otherwise, run binding of terminating up-event.
3018 (when do-multi-click
3019 (set-mark start-point)) ; ian, change this. why?
3020 (visible-mark-move-overlays)
3021
3022
3023 (when (and (functionp fun)
3024 (= start-hscroll (window-hscroll start-window))
3025 ;; Don't run the up-event handler if the window
3026 ;; start changed in a redisplay after the
3027 ;; mouse-set-point for the down-mouse event at
3028 ;; the beginning of this function. When the
3029 ;; window start has changed, the up-mouse event
3030 ;; contains a different position due to the new
3031 ;; window contents, and point is set again.
3032 (or end-point
3033 (= (window-start start-window)
3034 start-window-start)))
3035
3036 (push event unread-command-events)))))))
3037
3038 #+end_src
3039
3040
3041
3042
3043
3044 * org mode
3045
3046 #+begin_src emacs-lisp
3047
3048 ;; todo work on org-cycle-emulate-tab
3049
3050 ;; todo, this doesn't work for a non-standard keybind
3051 ;;(setq org-special-ctrl-k t)
3052
3053 ;; todo, generally fix org mode keys
3054 ;; todo, org-mark-element, unbdind from M-h, bind to mark defun key
3055
3056 (org-babel-do-load-languages
3057 'org-babel-load-languages
3058 '((emacs-lisp . t)
3059 (sh . t)))
3060
3061 ;; make shell work like interactive bash shell
3062 (setq org-babel-default-header-args:sh
3063 '((:results . "output") (:shebang . "#!/bin/bash -l")))
3064
3065 ;; my patch to output stderr
3066 (setq org-babel-use-error-buffer nil)
3067
3068 ;
3069 ;; org-mode manual suggests these, but I haven't used them.
3070 ;;(global-set-key "\C-cl" 'org-store-link)
3071 ;;(global-set-key "\C-ca" 'org-agenda)
3072 ;; this got in the way of a haskell mode command
3073 ;;(global-set-key "\C-cb" 'org-iswitchb)
3074
3075
3076
3077 ;; org-src-tab-acts-natively t ; broken option. using next instead, todo fix
3078
3079 (setq org-src-fontify-natively t ; make babel blocks nice
3080 org-adapt-indentation nil
3081 org-src-preserve-indentation t
3082 ;; The most basic logging is to keep track of when a TODO item was finished.
3083 org-log-done 'time
3084 ;; use a drawer to keep the logs tidy
3085 org-log-into-drawer t
3086 org-extend-today-until 0
3087 org-startup-truncated nil
3088 org-clock-persist t
3089 org-clock-mode-line-total 'today
3090 ;; global STYLE property values for completion
3091 org-global-properties (quote (("STYLE_ALL" . "habit")))
3092 org-special-ctrl-a/e t ;; home and end work special in headlines
3093 org-completion-use-ido t
3094 org-catch-invisible-edits 'smart)
3095
3096 ;; non universally recommended settings
3097 (setq
3098 org-default-notes-file (concat org-directory "/a/t.org")
3099 org-agenda-files (quote ("/a/t.org"))
3100 org-mobile-directory "/p/org-mobile"
3101 org-mobile-inbox-for-pull "/p/from-mobile.org"
3102 org-directory "/p")
3103
3104 ;; modeilne populated from (org-clock-get-clocked-time)
3105 ;; which is populated from the var org-clock-total-time
3106 ;; which is populated by a function which starts from (org-clock-get-sum-start)
3107 ;;
3108
3109 (org-clock-persistence-insinuate)
3110
3111
3112 (defun time-to-org-day (time)
3113 (round (time-to-number-of-days
3114 (time-subtract time (list 0 (* 3600 org-extend-today-until) 0)))))
3115
3116
3117 (defun my-org-confirm-babel-evaluate (lang body)
3118 (not (or (string= (buffer-file-name) "/a/t.org")
3119 (string= (buffer-file-name) "/home/ian/.emacs.d/my-init.org")
3120 )))
3121 (setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)
3122
3123
3124 (defun org-time-stamp-with-time (arg)
3125 (interactive "P")
3126 ;; '(4) is the argument passed by universal prefix
3127 (org-time-stamp (if arg arg '(4)) t))
3128
3129 (defun ian-org-work-time ()
3130 (interactive)
3131 (save-excursion
3132 (set-buffer "t.org")
3133 (goto-char (org-find-entry-with-id "ian-identifier-1"))
3134 (org-clock-in)))
3135
3136 (defun ian-org-idle-time ()
3137 (interactive)
3138 (save-excursion
3139 (goto-char (org-find-entry-with-id "ian-identifier-2"))
3140 (set-buffer "t.org")
3141 (org-clock-in)))
3142
3143
3144
3145 ;; based on http://stackoverflow.com/questions/3758139/variable-pitch-for-org-mode-fixed-pitch-for-tables
3146 ;; keywords: proportional font, monospace
3147
3148 (defun variable-pitch-on ()
3149 (variable-pitch-mode 1))
3150 (add-hook 'fundamental-mode-hook 'variable-pitch-on)
3151 (add-hook 'org-mode-hook 'variable-pitch-on)
3152 (add-hook 'text-mode-hook 'variable-pitch-on)
3153
3154 (set-face-attribute 'org-table nil :family (face-attribute 'fixed-pitch :family))
3155 (set-face-attribute 'org-code nil :family (face-attribute 'fixed-pitch :family))
3156 (set-face-attribute 'org-formula nil :family (face-attribute 'fixed-pitch :family))
3157 (set-face-attribute 'org-link nil :family (face-attribute 'fixed-pitch :family))
3158 (set-face-attribute 'org-block nil :family (face-attribute 'fixed-pitch :family))
3159 (set-face-attribute 'org-block-background nil :family (face-attribute 'fixed-pitch :family))
3160 (set-face-attribute 'org-date nil :family (face-attribute 'fixed-pitch :family))
3161
3162
3163 (defun remove-org-binds ()
3164 (define-key org-mode-map (kbd "<M-return>") nil)
3165 (define-key org-mode-map (kbd "C-'") nil)
3166 (define-key org-mode-map (kbd "C-y") nil)
3167 (define-key org-mode-map (kbd "<C-return>") nil)
3168 (define-key org-mode-map (kbd "<C-M-kp-enter>") nil)
3169 (define-key org-mode-map (kbd "C-,") nil)
3170 (define-key org-mode-map (kbd "C-M-m") nil)
3171 (define-key org-mode-map (kbd "C-k") nil)
3172 (define-key org-mode-map (kbd "C-j") nil)
3173 (define-key org-mode-map (kbd "C-M-i") nil)
3174 (define-key org-mode-map (kbd "C-M-t") nil)
3175 (define-key org-mode-map (kbd "M-a") 'nil)
3176 (define-key org-mode-map (kbd "C-a") nil)
3177 (define-key org-mode-map (kbd "M-e") nil)
3178 (define-key org-mode-map (kbd "C-e") nil)
3179 (define-key org-mode-map (kbd "C-3") nil)
3180 (define-key org-mode-map (kbd "<M-left>") nil)
3181 (define-key org-mode-map (kbd "<M-right>") nil)
3182 (define-key org-mode-map (kbd "<S-return>") nil)
3183 (define-key org-mode-map (kbd "<tab>") nil)
3184 (define-key org-mode-map (kbd "<C-S-down>") nil)
3185 (define-key org-mode-map (kbd "<C-S-up>") nil)
3186 (define-key org-mode-map (kbd "<S-down>") nil)
3187 (define-key org-mode-map (kbd "<S-up>") nil)
3188 (define-key org-mode-map "\t" nil))
3189 (add-hook 'org-mode-hook 'remove-org-binds)
3190
3191 #+end_src
3192
3193
3194 * org drill
3195
3196
3197 #+begin_src emacs-lisp :tangle no
3198
3199 (setq
3200 ;; account actual time, not just scheduled time
3201 org-drill-adjust-intervals-for-early-and-late-repetitions-p t
3202
3203 ;; still show leeches, but warn
3204 org-drill-leech-method (quote warn)
3205 ;; increased from default 20
3206 org-drill-maximum-duration 60
3207 ;; especially when starting, I want to drill hard
3208 org-drill-maximum-items-per-session nil
3209 ;; don't prompt to save buffer, auto-save will do that
3210 org-drill-save-buffers-after-drill-sessions-p nil
3211 ;; this one deals with varying difficulty items better
3212 ;; sm2 is similar, but more simplistic
3213 org-drill-spaced-repetition-algorithm (quote simple8)
3214 )
3215 #+end_src
3216 ;; todo, make the prompting text reflect this number.
3217 ;; org-drill-failure-quality
3218
3219 * os specific settings
3220
3221 disabled cuz I have none yet
3222 #+begin_src emacs-lisp :tangle no
3223 (cond ((eq system-type 'darwin))
3224 ((eq system-type 'gnu/linux))
3225 ((eq system-type 'windows-nt))
3226 (t ))
3227 #+end_src
3228
3229
3230 * prog-mode-defaults
3231
3232 #+begin_src emacs-lisp
3233
3234
3235 (defun prog-mode-defaults ()
3236 "Default coding hook, useful with any programming language."
3237 ;; so that I can do completion before the dialog pops up
3238 (local-set-key (kbd "<tab>") 'auto-complete)
3239 ;; todo, this is causing error message on loading file, prolly not working
3240 ;;(flycheck-mode +1)
3241 (setq ac-sources (delq 'ac-source-dictionary ac-sources))
3242 (highlight-symbol-mode)
3243 (make-local-variable 'column-number-mode)
3244 (set (make-local-variable 'comment-auto-fill-only-comments) t)
3245 (auto-fill-mode t)
3246 (column-number-mode t)
3247 (turn-on-smartparens-mode)
3248
3249 ;; prettify lambdas
3250 (font-lock-add-keywords
3251 nil `(("(\\(lambda\\>\\)"
3252 (0 (progn (compose-region (match-beginning 1) (match-end 1)
3253 ,(make-char 'greek-iso8859-7 107))
3254 nil))))))
3255 (add-hook 'prog-mode-hook 'prog-mode-defaults)
3256
3257 ;; enable flyspell in prog mode. text mode is handled
3258 (add-hook 'prog-mode-hook 'flyspell-prog-mode)
3259
3260
3261
3262 #+end_src
3263
3264 ** yank auto-indent
3265 #+begin_src emacs-lisp
3266 ;; automatically indenting yanked text if in programming-modes
3267 (defvar yank-indent-modes
3268 '(LaTeX-mode TeX-mode)
3269 "Modes in which to indent regions that are yanked (or yank-popped).
3270 Only modes that don't derive from `prog-mode' should be listed here.")
3271
3272 (defvar yank-indent-blacklisted-modes
3273 '(python-mode slim-mode haml-mode)
3274 "Modes for which auto-indenting is suppressed.")
3275
3276 (defvar yank-advised-indent-threshold 2000
3277 "Threshold (# chars) over which indentation does not automatically occur.")
3278
3279 (defun yank-advised-indent-function (beg end)
3280 "Do indentation, as long as the region isn't too large."
3281 (if (<= (- end beg) yank-advised-indent-threshold)
3282 (indent-region beg end nil)))
3283
3284 (defadvice yank (after yank-indent activate)
3285 "If current mode is one of 'yank-indent-modes,
3286 indent yanked text (with prefix arg don't indent)."
3287 (if (and (not (ad-get-arg 0))
3288 (not (member major-mode yank-indent-blacklisted-modes))
3289 (or (derived-mode-p 'prog-mode)
3290 (member major-mode yank-indent-modes)))
3291 (let ((transient-mark-mode nil))
3292 (yank-advised-indent-function (region-beginning) (region-end)))))
3293
3294 (defadvice yank-pop (after yank-pop-indent activate)
3295 "If current mode is one of 'yank-indent-modes,
3296 indent yanked text (with prefix arg don't indent)."
3297 (if (and (not (ad-get-arg 0))
3298 (not (member major-mode yank-indent-blacklisted-modes))
3299 (or (derived-mode-p 'prog-mode)
3300 (member major-mode yank-indent-modes)))
3301 (let ((transient-mark-mode nil))
3302 (yank-advised-indent-function (region-beginning) (region-end)))))
3303
3304 #+end_src
3305
3306
3307 * shell mode
3308 #+begin_src emacs-lisp
3309 ;; avoid stupid git crap like "warning, terminal not fully functional"
3310 (setenv "PAGER" "cat")
3311 ;; don't store successive duplicates in comint command history
3312 (setq comint-input-ignoredups t)
3313
3314 (defun add-mode-line-dirtrack ()
3315 (add-to-list 'mode-line-buffer-identification
3316 '(:propertize (" " default-directory " ") face dired-directory)))
3317 (add-hook 'shell-mode-hook 'add-mode-line-dirtrack)
3318
3319
3320 ;; don't fully understand it, but it works.
3321 ;; http://www.emacswiki.org/emacs/ShellDirtrackByProcfs
3322 (defun track-shell-directory/procfs ()
3323 (shell-dirtrack-mode 0)
3324 (add-hook 'comint-preoutput-filter-functions
3325 (lambda (str)
3326 (prog1 str
3327 (when (string-match comint-prompt-regexp str)
3328 (cd (file-symlink-p
3329 (format "/proc/%s/cwd" (process-id
3330 (get-buffer-process
3331 (current-buffer)))))))))
3332 nil t))
3333 (setq comint-buffer-maximum-size 100000)
3334 (add-to-list 'comint-output-filter-functions 'comint-truncate-buffer)
3335 (defun new-shell ()
3336 (interactive)
3337 (shell (generate-new-buffer-name "*shell*")))
3338 ;;
3339 (defun shell-wrap (prefix)
3340 "wrap the shell function, automatically generate a new name for a prefix arg"
3341 (interactive "P")
3342 (if prefix
3343 (new-shell)
3344 (shell)))
3345
3346 (add-hook 'shell-mode-hook 'track-shell-directory/procfs)
3347 #+end_src
3348 * smartparens
3349 the melpa git version had a catastrophic bug I reported.
3350 downgraded to marmalade version and everything is working fine.
3351 #+begin_src emacs-lisp
3352 (require 'smartparens-config)
3353 (show-smartparens-global-mode t)
3354
3355
3356 (defun gp/sp/pair-on-newline-and-indent (id action context)
3357 "Open a new brace or bracket expression, with relevant newlines and indent. "
3358 (save-excursion
3359 (newline)
3360 (indent-according-to-mode))
3361 (indent-according-to-mode))
3362
3363 ;; when opening a pair, and then inserting a newline, push the closing pair to another newline
3364 (sp-pair "{" nil :post-handlers
3365 '(:add ((lambda (id action context)
3366 (gp/sp/pair-on-newline-and-indent id action context)) (kbd "<return>"))))
3367 (sp-pair "[" nil :post-handlers
3368 '(:add ((lambda (id action context)
3369 (gp/sp/pair-on-newline-and-indent id action context)) (kbd "<return>"))))
3370
3371
3372 ;; in my version, this is not a pairing.
3373 ;; not sure if it is in a future version since I reverted to marmalade
3374 ;; Don't need c-comments in strings -- they frustrate filename globs
3375 ;; (sp-pair "/*" nil :unless '(sp-in-string-p))
3376
3377 ;; Don't need quotes to pair next to words
3378 (sp-pair "\"" nil :unless '(sp-point-before-word-p sp-point-after-word-p))
3379 (sp-pair "'" nil :unless '(sp-point-before-word-p sp-point-after-word-p))
3380
3381
3382 ;; todo, testout these mode specific settings from graphene.
3383 ;; Ruby-specific pairs and handlers
3384 (require 'smartparens-ruby)
3385
3386 ;; Markdown
3387 (sp-local-pair '(markdown-mode gfm-mode) "*" "*"
3388 :unless '(sp-in-string-p)
3389 :actions '(insert wrap))
3390
3391 ;; Except in HTML
3392 (sp-local-pair 'html-mode "\"" nil :unless '(:rem sp-point-after-word-p))
3393 ;; CoffeeScript PyStrings
3394 (push 'coffee-mode sp-autoescape-string-quote-if-empty)
3395
3396
3397
3398 #+end_src
3399 * smex
3400 todo; check out smex-show-unbound-commands shows frequently used commands that have no key bindings.
3401 #+begin_src emacs-lisp
3402 ; these must be before smex-initialize
3403 (setq
3404 smex-save-file "~/.emacs.d/.smex-items")
3405
3406 (smex-initialize)
3407 #+end_src
3408 * speedbar
3409 (sr-speedbar-close)
3410 (sr-speedbar-open)
3411
3412 ** todo, disabled cuz of broken package
3413 #+begin_src emacs-lisp :tangle no
3414 (require 'sr-speedbar)
3415 (setq speedbar-hide-button-brackets-flag t ;; didn't notice a diff
3416 speedbar-file-unshown-regexp "flycheck-.*"
3417 sr-speedbar-width 40
3418 sr-speedbar-width-x 40
3419 sr-speedbar-auto-refresh nil
3420 sr-speedbar-skip-other-window-p t
3421 sr-speedbar-right-side nil
3422 speedbar-hide-button-brackets-flag nil)
3423 #+end_src
3424 * spell correction
3425 #+begin_src emacs-lisp
3426 (setq
3427 ispell-program-name "hunspell"
3428 ispell-silently-savep t) ; don't prompt to save personal dictionary
3429
3430 (require 'rw-hunspell)
3431 #+end_src
3432 rw-hunspell sets up hunspell dictionary automagically.
3433
3434
3435 Rant: Hunspell SHOULD be standard. its used by firefox and openoffice and
3436 osx. In contrast, the first few words I added to aspell dictionary were
3437 "emacs" "customizable" and "timestamp". Hunspell already has those,
3438 thank god.
3439
3440 ispell-personal-dictionary does not document where the hunspell
3441 dictionary goes by default, but it is ~/.hunspell_en_US for me
3442
3443
3444 * tex
3445 #+begin_src emacs-lisp
3446 (setq-default TeX-PDF-mode t) ; use pdf
3447
3448 ; more sensible defaults based on info manual quickstart
3449 (setq TeX-auto-save t)
3450 (setq TeX-parse-self t)
3451
3452
3453 #+end_src
3454 * undo tree
3455 #+begin_src emacs-lisp
3456
3457 ;; undo-tree checks for minor modes which override
3458 ;; its minor mode keymap, and sets global keybinds if
3459 ;; that happens. this will prevent that, but I have no
3460 ;; reason to do that, so it is commented.
3461 ;; (defun undo-tree-overridden-undo-bindings-p () nil)
3462
3463 ;; todo, send patch undo-tree-visualize should scroll with the scroll key, instead of just pgup pgdn (aka next/prior)
3464 (global-undo-tree-mode)
3465 ;; disabled due to bug, something like unknown entry in undo tree canary
3466 ;; (setq undo-tree-auto-save-history t)
3467 (setq undo-outer-limit 100000000 ; per undo command
3468 undo-limit 500000000 ; undo history limit
3469 undo-strong-limit 600000000) ; undo history limit plus some extra
3470
3471
3472 #+end_src
3473
3474 * visible mark mode
3475
3476 these colors were better for dark theme
3477 #+begin_src emacs-lisp :tangle no
3478
3479
3480
3481 (defface visible-mark-face1
3482 '((((type tty) (class mono)))
3483 (t (:background "LimeGreen"))) "")
3484 (defface visible-mark-face2
3485 '((((type tty) (class mono)))
3486 (t (:background "red4"))) "")
3487 (defface visible-mark-forward-face1
3488 '((((type tty) (class mono)))
3489 (t (:background "dark magenta"))) "")
3490 (defface visible-mark-active
3491 '((((type tty) (class mono)))
3492 (t (:background "gold"))) "")
3493 (defface mouse-cursor-face
3494 '((((type tty) (class mono)))
3495 (t (:background "DeepPink1"))) "")
3496
3497 #+end_src
3498
3499
3500 #+begin_src emacs-lisp
3501
3502 (add-to-list 'load-path "~/.emacs.d/src/visible-mark")
3503
3504 ;; since it is not easy to change the mark overlay priority, I change this one.
3505 (setq show-paren-priority 999)
3506
3507
3508 (defface visible-mark-active
3509 '((((type tty) (class mono)))
3510 (t (:background "magenta"))) "")
3511
3512
3513
3514 (defface mouse-cursor-face
3515 '((((type tty) (class mono)))
3516 (t (:background "DeepPink1"))) "")
3517
3518
3519 (require 'visible-mark)
3520
3521 (setq visible-mark-faces '(visible-mark-face1 visible-mark-face2))
3522 (setq visible-mark-forward-faces '(visible-mark-forward-face1))
3523
3524
3525 ; highlight the last 2 marks
3526 (setq visible-mark-max 2)
3527 ; highlight 1 forward mark
3528 (setq visible-mark-forward-max 1)
3529 ; globally activate visible-mark-mode
3530 (global-visible-mark-mode +1)
3531
3532
3533 ;; todo, it doesn't seem to be exposed in elisp, but it would be nice
3534 ;; if I could define overlay faces to use inverse foreground color
3535
3536
3537 #+end_src
3538
3539 #+RESULTS:
3540 : t
3541
3542
3543 * key binds. keep at end of file
3544 this should come at the end because it depends on key maps being
3545 created in earlier sections.
3546
3547 ** emacs keys notes
3548 commands not needed in ido mode and their replacement in ido mode
3549 spell check fix -> use current pattern and start new one
3550 narrow -> create subdirectory
3551 org-cycle -> M-s search recently used directory
3552 vert split Window -> create file instead of select match
3553 delete-other-windows -> open dired buffer
3554 delete current window -> delete buffer/file
3555 find file -> search within all subdirectories
3556
3557 forward/back error
3558
3559 buffer select -> toggle find file / buffer
3560 up/down -> next/previous history
3561 forward/back -> ido-forward/back
3562
3563
3564 right keyboard attributes: movement, involve typing words
3565 left keyboard attributes: non-typing universal non-movement
3566
3567
3568
3569
3570 todo
3571 fix global unpop mark ring
3572 setup helm
3573 learn cedet and projectile and helm
3574 setup key for pop-global-mark
3575 try out C-M-\ indent region
3576 set quoted insert to some obscure keybind
3577 make currently overrided M-u uppercase word into something obscure
3578 remember mode
3579 bind shell-command to something better
3580 investigate tags
3581 investigate keys in isearch mode and find file mode
3582 try out occur. M-s o
3583 investigate programming modes. M-g n/b next/previous error. gdb?
3584 investigate org mode keys
3585 learn version control
3586 learn mail
3587 check out imenu
3588 bind capitalize-word to something obscure
3589 sentance/paragraph movement/marking should be swapped with sexp/paren movement based on mode
3590 bind fill-paragraph to something obscure
3591 setup linewise paste
3592 install magit (git control)
3593 magpie expansion provides a completion key for acronym expansion based on buffer text
3594 learn ediff
3595 universal google
3596 figure out auto-indent
3597 learn eshell and prelude settings for it
3598 combine register prefix and c-x prefix
3599 note: remember to think of mouse & foot pedals
3600 commands to change: select other window: C-x o.
3601 ** prefix keybind changes
3602 #+begin_src emacs-lisp
3603
3604
3605 ; prefix key binds.
3606 ; good info http://www.masteringemacs.org/articles/2011/02/08/mastering-key-bindings-emacs/
3607 ; rebinding the prefix keys are tricky. apparently, some modes ignore any redefinition of a prefix key and use it explicitly,
3608 ; so you have to dig into their key maps and redo things.
3609 ; There are 2 simpler alternatives which have their own downsides.
3610 ; One is cua mode, which I do not like because it smashes 2 keybinds onto 1 and limits what you can do.
3611 ; The other is keyboard-translate, which translates the key presses before anything else.
3612 ; The downside is that it translates them when you aren't using them as a prefix.
3613 ; Since the swaps I'm using are all very accessible, the only downside is some mental jugling when reading docs etc about these keybinds.
3614
3615 ; I've seen this as an another suggestion, it was a total fail. The prefix command took over both keys.
3616 ; (define-key key-translation-map [f12] "\C-c")
3617 ; (define-key key-translation-map "\C-c" [left])
3618
3619
3620 ;idea to remove the hook later since it is only needed at startup.
3621 ; did not work however, and there is not a real need to fix it, so I did not investigate
3622 ;(defun removeSwapHook ()
3623 ; (remove-hook 'buffer-list-update-hook 'myKeySwap)
3624 ; (remove-hook 'change-major-mode-hook 'removeSwapHook))
3625 ;(add-hook 'change-major-mode-hook 'removeSwapHook)
3626
3627
3628 ; went through almost all the relevant standard hooks,
3629 ; this overcomes a known bug that (keyboard-translate) does not get applied when running emacs daemon
3630 (add-hook 'buffer-list-update-hook (lambda () (interactive)
3631 (keyboard-translate ?\C-x ?\C-s)
3632 (keyboard-translate ?\C-s ?\C-x)
3633 (keyboard-translate ?\C-c ?\C-d)
3634 (keyboard-translate ?\C-d ?\C-c)))
3635
3636
3637
3638 ; these all don't work
3639 ; don't know why this doesn't error but reversing the keys does
3640 ;(keyboard-translate ?\t ?\M-\t)
3641 ;(keyboard-translate [M-tab] [tab])
3642 ; from what i can tell, it wants to use a keyboard-translate-table,
3643 ; which is a char table, which is a vector indexed by chars,
3644 ; and mod+tab is not a char (it has too many bits), it is an integer
3645 ; it actually says it can hold vectors or strings, but that it is obsolete to do so
3646 ;(characterp ?\M-a)
3647 ;(characterp ?\C-a)
3648
3649
3650
3651 #+end_src
3652
3653 ** named commands
3654 *** tramp sudo
3655 /ssh:host|sudo:host:
3656 when in the same session, you can then do:
3657 /sudo:root@host:
3658
3659 *** org insert table row
3660 [org-shiftmetadown/up]
3661 *** toggle line continuation / truncation / wrap :drill:
3662 SCHEDULED: <2014-04-07 Mon>
3663 :PROPERTIES:
3664 :ID: 5f3f567a-0926-4d92-81f3-4e4cd6070af2
3665 :DRILL_LAST_INTERVAL: 28.6736
3666 :DRILL_REPEATS_SINCE_FAIL: 5
3667 :DRILL_TOTAL_REPEATS: 5
3668 :DRILL_FAILURE_COUNT: 1
3669 :DRILL_AVERAGE_QUALITY: 3.4
3670 :DRILL_EASE: 2.666
3671 :DRILL_LAST_QUALITY: 4
3672 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:37>
3673 :END:
3674 [toggle-truncate-lines]
3675 *** auto-save on/off :drill:
3676 SCHEDULED: <2014-05-13 Tue>
3677 :PROPERTIES:
3678 :ID: 462f859d-1a06-46a3-ac72-6ffe5b4417c9
3679 :DRILL_LAST_INTERVAL: 71.5839
3680 :DRILL_REPEATS_SINCE_FAIL: 4
3681 :DRILL_TOTAL_REPEATS: 4
3682 :DRILL_FAILURE_COUNT: 0
3683 :DRILL_AVERAGE_QUALITY: 4.75
3684 :DRILL_EASE: 4.85
3685 :DRILL_LAST_QUALITY: 5
3686 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:11>
3687 :END:
3688 [my-as-on/my-as-off]
3689 *** toggle menu bar
3690 [menu-bar-mode]
3691 *** show abbreviations :drill:
3692 SCHEDULED: <2014-03-24 Mon>
3693 :PROPERTIES:
3694 :ID: 479a2ced-b952-4088-a6e3-862cd37693a9
3695 :DRILL_LAST_INTERVAL: 32.7466
3696 :DRILL_REPEATS_SINCE_FAIL: 4
3697 :DRILL_TOTAL_REPEATS: 4
3698 :DRILL_FAILURE_COUNT: 0
3699 :DRILL_AVERAGE_QUALITY: 4.0
3700 :DRILL_EASE: 3.204
3701 :DRILL_LAST_QUALITY: 4
3702 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 18:03>
3703 :END:
3704 [list-abbrevs]
3705
3706 *** rename-file-and-buffer
3707 *** ediff-buffers
3708 *** refill-mode
3709 automatically balance a paragraph with newlines
3710 *** executable-make-buffer-file-executable-if-script-p
3711 make a script executable
3712 *** (setq lazy-highlight-cleanup nil)
3713 *** auto-revert-tail-mode
3714 tail a file
3715 *** trash-file-and-buffer
3716 #+begin_src emacs-lisp
3717 (defun trash-file-and-buffer ()
3718 "Removes file connected to current buffer and kills buffer."
3719 (interactive)
3720 (let ((filename (buffer-file-name))
3721 (buffer (current-buffer))
3722 (name (buffer-name)))
3723 (if (not (and filename (file-exists-p filename)))
3724 (error "Buffer '%s' is not visiting a file!" name)
3725 (delete-file filename)
3726 (kill-buffer buffer)
3727 (message "File '%s' successfully removed" filename))))
3728
3729 #+end_src
3730 *** what-line
3731 *** linum-mode
3732 line numbers
3733
3734 *** sgml-pretty-print
3735 format xml in nxml-mode
3736 *** visual-line-mode
3737 toggle word wrap.
3738 ** compound commands
3739 *** C-xc
3740 :PROPERTIES:
3741 :ID: d0802daa-9281-4a9f-ab4a-47d9f7ef7cfd
3742 :END:
3743 exit
3744 *** [C-x x] :drill:
3745 SCHEDULED: <2014-03-24 Mon>
3746 :PROPERTIES:
3747 :ID: 2f7d1353-3c20-4e00-95ea-1f84c4d87fc1
3748 :DRILL_LAST_INTERVAL: 32.7466
3749 :DRILL_REPEATS_SINCE_FAIL: 4
3750 :DRILL_TOTAL_REPEATS: 4
3751 :DRILL_FAILURE_COUNT: 0
3752 :DRILL_AVERAGE_QUALITY: 4.0
3753 :DRILL_EASE: 3.204
3754 :DRILL_LAST_QUALITY: 4
3755 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 18:03>
3756 :END:
3757 save file
3758 *** [C-x e] :drill:
3759 SCHEDULED: <2014-03-27 Thu>
3760 :PROPERTIES:
3761 :ID: b802eeb8-ddcd-4778-844a-b6e737b54d7d
3762 :DRILL_LAST_INTERVAL: 50.6823
3763 :DRILL_REPEATS_SINCE_FAIL: 3
3764 :DRILL_TOTAL_REPEATS: 3
3765 :DRILL_FAILURE_COUNT: 0
3766 :DRILL_AVERAGE_QUALITY: 5.0
3767 :DRILL_EASE: 5.815
3768 :DRILL_LAST_QUALITY: 5
3769 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
3770 :END:
3771 eval last sexp
3772 *** C-x u
3773 [undo-tree-visualize]
3774 *** C-j u/U
3775 [undo-tree save/restore state via register]
3776 *** C-c -
3777 [org insert table horizontal line or create list]
3778 *** [C-x tab] :drill:
3779 SCHEDULED: <2014-03-24 Mon>
3780 :PROPERTIES:
3781 :ID: ceb701d7-3d44-4781-ae23-7309ca887a01
3782 :DRILL_LAST_INTERVAL: 32.7466
3783 :DRILL_REPEATS_SINCE_FAIL: 4
3784 :DRILL_TOTAL_REPEATS: 4
3785 :DRILL_FAILURE_COUNT: 0
3786 :DRILL_AVERAGE_QUALITY: 4.0
3787 :DRILL_EASE: 3.204
3788 :DRILL_LAST_QUALITY: 4
3789 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:50>
3790 :END:
3791 dumb indent
3792
3793 [shift-left and shift-right are default for indenting by tab stop,
3794 and they are only defined as lambdas so I copy them here
3795 to use with up and down.
3796 #+begin_src emacs-lisp
3797 ;; condition cuz emacs24 release doesn't have this yet
3798 (when (boundp 'indent-rigidly-map)
3799 (define-key indent-rigidly-map (kbd "<C-left>")
3800 (lambda (beg end) (interactive "r")
3801 (let* ((current (indent-rigidly--current-indentation beg end))
3802 (next (indent--next-tab-stop current)))
3803 (indent-rigidly beg end (- next current)))))
3804
3805 (define-key indent-rigidly-map (kbd "<C-right>")
3806 (lambda (beg end) (interactive "r")
3807 (let* ((current (indent-rigidly--current-indentation beg end))
3808 (next (indent--next-tab-stop current 'prev)))
3809 (indent-rigidly beg end (- next current))))))
3810 #+end_src
3811 ]
3812 *** C-x *
3813 [calc-dispatch]
3814 *** C-x =
3815 [point information]
3816 *** C-x d
3817 [dired]
3818 *** C-xb
3819 [ibuffer]
3820 #+begin_src emacs-lisp
3821 (global-set-key (kbd "C-x C-b") 'ibuffer)
3822 #+end_src
3823 ** gnus
3824 searching overview.
3825 3 types:
3826 ingroup searching
3827 nnir searching with notmuch, specific group (not sure if it can do multiple)
3828 search all groups with mairix
3829 *** [a]
3830 compose new message
3831 *** [C-c C-c]
3832 send message
3833 *** [s]
3834 save newsrc file, alterations to groups.
3835 *** [g]
3836 gnus refresh / get new
3837 *** [m]
3838 gnus new message
3839 *** [F]
3840 gnus quoted reply all
3841 *** [e]
3842 gnus draft edit message
3843 *** [delete]
3844 gnus delete draft
3845 #+begin_src emacs-lisp
3846 (add-hook 'gnus-startup-hook
3847 (lambda ()
3848 (define-key gnus-summary-mode-map (kbd "<delete>") 'gnus-summary-delete-article)))
3849 #+end_src
3850
3851 *** [b]
3852 mairix search
3853 #+begin_src emacs-lisp
3854 (add-hook 'gnus-startup-hook
3855 (lambda ()
3856 (define-key gnus-group-mode-map "b" 'nnmairix-search)
3857 (define-key gnus-summary-mode-map "b" 'nnmairix-search)))
3858 #+end_src
3859 *** [B m]
3860 move message, or messages in region
3861 *** [#]
3862 mark article, move with B m
3863 *** [B delete]
3864 gnus delete draft
3865 *** [/ plus x a / b]
3866 search current group (or see info manual for more groups),
3867 using the gnus native search (its slow, do a notmuch or mairix search instead)
3868 x= extra (ie. to)
3869 todo; send in patch to make author search to in sent folder
3870 a = author
3871 / = subject
3872 b = body
3873 see C-h m for a full list
3874 *** [ G G ]
3875 do a nnir notmuch search, for the group on the current line
3876 *** [ A T ]
3877 jump to thread from nnir group
3878
3879 *** [marks]
3880 ! = saved for later
3881 E = expired
3882 M-& apply process mark to a non-process mark command
3883 *** [S D e]
3884 edit as new
3885 ** message mode
3886 *** [C-ck]
3887 discard message
3888 ** notmuch
3889 *** [space]
3890 notmuch advance to next message/thread
3891
3892 ** readline / bash / .inputrc
3893 *** [M-0-9]
3894 SCHEDULED: <2014-05-13 Tue>
3895 :PROPERTIES:
3896 :ID: dac68f2e-37c2-448e-861d-0554e51f1414
3897 :DRILL_LAST_INTERVAL: 71.5839
3898 :DRILL_REPEATS_SINCE_FAIL: 4
3899 :DRILL_TOTAL_REPEATS: 4
3900 :DRILL_FAILURE_COUNT: 0
3901 :DRILL_AVERAGE_QUALITY: 4.75
3902 :DRILL_EASE: 4.85
3903 :DRILL_LAST_QUALITY: 5
3904 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
3905 :END:
3906 bash digit-argument
3907
3908 removed drill from all these because I'm using emacs for shell now
3909 *** [C-2]
3910 SCHEDULED: <2014-03-15 Sat>
3911 :PROPERTIES:
3912 :ID: d2e87812-6ab7-432f-ad7c-4281c0e3b86b
3913 :DRILL_LAST_INTERVAL: 12.979
3914 :DRILL_REPEATS_SINCE_FAIL: 3
3915 :DRILL_TOTAL_REPEATS: 3
3916 :DRILL_FAILURE_COUNT: 0
3917 :DRILL_AVERAGE_QUALITY: 3.333
3918 :DRILL_EASE: 2.626
3919 :DRILL_LAST_QUALITY: 3
3920 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:00>
3921 :END:
3922 terminal X paste
3923 *** [C-3]
3924 SCHEDULED: <2014-03-15 Sat>
3925 :PROPERTIES:
3926 :ID: 3b156730-eb92-4149-b4ce-f93a9098d2b4
3927 :DRILL_LAST_INTERVAL: 12.979
3928 :DRILL_REPEATS_SINCE_FAIL: 3
3929 :DRILL_TOTAL_REPEATS: 3
3930 :DRILL_FAILURE_COUNT: 0
3931 :DRILL_AVERAGE_QUALITY: 3.333
3932 :DRILL_EASE: 2.626
3933 :DRILL_LAST_QUALITY: 3
3934 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:00>
3935 :END:
3936 terminal open file manager
3937 *** [C-q]
3938 SCHEDULED: <2014-03-12 Wed>
3939 :PROPERTIES:
3940 :ID: ed6a19de-d000-4469-9dd9-7b9e35f6c751
3941 :DRILL_LAST_INTERVAL: 2.8975
3942 :DRILL_REPEATS_SINCE_FAIL: 2
3943 :DRILL_TOTAL_REPEATS: 10
3944 :DRILL_FAILURE_COUNT: 12
3945 :DRILL_AVERAGE_QUALITY: 2.692
3946 :DRILL_EASE: 2.311
3947 :DRILL_LAST_QUALITY: 3
3948 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:33>
3949 :END:
3950 bash exchange-point-and-mark
3951
3952 *** [C-M-q]
3953 SCHEDULED: <2014-03-14 Fri>
3954 :PROPERTIES:
3955 :ID: 9827eb7e-532e-41fb-8d91-8c95c23553f5
3956 :DRILL_LAST_INTERVAL: 11.6739
3957 :DRILL_REPEATS_SINCE_FAIL: 3
3958 :DRILL_TOTAL_REPEATS: 3
3959 :DRILL_FAILURE_COUNT: 0
3960 :DRILL_AVERAGE_QUALITY: 3.333
3961 :DRILL_EASE: 2.626
3962 :DRILL_LAST_QUALITY: 4
3963 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
3964 :END:
3965 quoted insert
3966 *** [C-w]
3967 SCHEDULED: <2014-04-07 Mon>
3968 :PROPERTIES:
3969 :ID: 58fea89a-def9-4aac-95d4-fdd63fde8097
3970 :DRILL_LAST_INTERVAL: 28.6736
3971 :DRILL_REPEATS_SINCE_FAIL: 5
3972 :DRILL_TOTAL_REPEATS: 5
3973 :DRILL_FAILURE_COUNT: 1
3974 :DRILL_AVERAGE_QUALITY: 3.4
3975 :DRILL_EASE: 2.666
3976 :DRILL_LAST_QUALITY: 4
3977 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
3978 :END:
3979 bash kill-region
3980 *** [C-e]
3981 SCHEDULED: <2014-03-27 Thu>
3982 :PROPERTIES:
3983 :ID: 3ee7662f-3ac7-46ff-afe7-73244656d48b
3984 :DRILL_LAST_INTERVAL: 50.6823
3985 :DRILL_REPEATS_SINCE_FAIL: 3
3986 :DRILL_TOTAL_REPEATS: 3
3987 :DRILL_FAILURE_COUNT: 0
3988 :DRILL_AVERAGE_QUALITY: 5.0
3989 :DRILL_EASE: 5.815
3990 :DRILL_LAST_QUALITY: 5
3991 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
3992 :END:
3993 bash yank-last-arg
3994 *** C-r
3995 :PROPERTIES:
3996 :ID: 579a9008-0758-4ba9-a52f-175f264fe96a
3997 :END:
3998 bash history-search-backward
3999 *** [C-t]
4000 SCHEDULED: <2014-04-04 Fri>
4001 :PROPERTIES:
4002 :ID: 25e737fe-52c4-452b-ab93-037575375579
4003 :DRILL_LAST_INTERVAL: 26.2331
4004 :DRILL_REPEATS_SINCE_FAIL: 5
4005 :DRILL_TOTAL_REPEATS: 5
4006 :DRILL_FAILURE_COUNT: 1
4007 :DRILL_AVERAGE_QUALITY: 3.2
4008 :DRILL_EASE: 2.554
4009 :DRILL_LAST_QUALITY: 4
4010 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
4011 :END:
4012 shell-expand-line, expand like bash does u hit enter
4013 *** [C-a]
4014 SCHEDULED: <2014-04-06 Sun>
4015 :PROPERTIES:
4016 :ID: 384b3337-3cb0-4b3b-8a1a-8ae299ae212b
4017 :DRILL_LAST_INTERVAL: 27.9921
4018 :DRILL_REPEATS_SINCE_FAIL: 5
4019 :DRILL_TOTAL_REPEATS: 5
4020 :DRILL_FAILURE_COUNT: 1
4021 :DRILL_AVERAGE_QUALITY: 3.6
4022 :DRILL_EASE: 2.802
4023 :DRILL_LAST_QUALITY: 5
4024 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:37>
4025 :END:
4026 bash comment-line
4027 *** [C-s]
4028 SCHEDULED: <2014-03-10 Mon>
4029 :PROPERTIES:
4030 :ID: 4b5c71f9-6035-4b92-bcad-e400e5e25d66
4031 :DRILL_LAST_INTERVAL: 8.225
4032 :DRILL_REPEATS_SINCE_FAIL: 3
4033 :DRILL_TOTAL_REPEATS: 7
4034 :DRILL_FAILURE_COUNT: 4
4035 :DRILL_AVERAGE_QUALITY: 2.879
4036 :DRILL_EASE: 2.399
4037 :DRILL_LAST_QUALITY: 4
4038 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 20:57>
4039 :END:
4040 bash yank-nth-arg
4041 yank $1 of last argument, or nth if prefixed with a digit argument
4042 *** [C-d]
4043 SCHEDULED: <2014-03-12 Wed>
4044 :PROPERTIES:
4045 :ID: f5da97c1-6e3c-44dd-a2f1-7dacd7f523da
4046 :DRILL_LAST_INTERVAL: 9.8132
4047 :DRILL_REPEATS_SINCE_FAIL: 3
4048 :DRILL_TOTAL_REPEATS: 7
4049 :DRILL_FAILURE_COUNT: 3
4050 :DRILL_AVERAGE_QUALITY: 3.21
4051 :DRILL_EASE: 2.559
4052 :DRILL_LAST_QUALITY: 4
4053 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:04>
4054 :END:
4055 bash undo
4056 *** [C-f]
4057 SCHEDULED: <2014-05-13 Tue>
4058 :PROPERTIES:
4059 :ID: 0f1def18-0d94-45e7-b258-f621e67cefd7
4060 :DRILL_LAST_INTERVAL: 71.5839
4061 :DRILL_REPEATS_SINCE_FAIL: 4
4062 :DRILL_TOTAL_REPEATS: 4
4063 :DRILL_FAILURE_COUNT: 0
4064 :DRILL_AVERAGE_QUALITY: 4.75
4065 :DRILL_EASE: 4.85
4066 :DRILL_LAST_QUALITY: 5
4067 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:11>
4068 :END:
4069 bash menu-complete
4070 *** [C-g]
4071 SCHEDULED: <2014-03-10 Mon>
4072 :PROPERTIES:
4073 :ID: 263e9479-de1d-4e78-8600-5a0f3a8e2dd9
4074 :DRILL_LAST_INTERVAL: 8.0608
4075 :DRILL_REPEATS_SINCE_FAIL: 3
4076 :DRILL_TOTAL_REPEATS: 8
4077 :DRILL_FAILURE_COUNT: 5
4078 :DRILL_AVERAGE_QUALITY: 2.966
4079 :DRILL_EASE: 2.439
4080 :DRILL_LAST_QUALITY: 4
4081 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:04>
4082 :END:
4083 bash edit-and-execute-command
4084 *** C-z
4085 *** C-x
4086 emacs hard to rebind
4087 looks like it actually wouldn't be that hard.
4088 possibly take the output from bind -p, make all those keys undefined.
4089 *** C-c
4090 quit/cancel
4091 *** C-v
4092 yank, aka paste
4093 *** C-M-v
4094 yank-pop
4095 *** [C-b]
4096 SCHEDULED: <2014-03-14 Fri>
4097 :PROPERTIES:
4098 :ID: 1a688c40-4bba-4053-a28b-0e1e8d3f4985
4099 :DRILL_LAST_INTERVAL: 4.9208
4100 :DRILL_REPEATS_SINCE_FAIL: 2
4101 :DRILL_TOTAL_REPEATS: 8
4102 :DRILL_FAILURE_COUNT: 4
4103 :DRILL_AVERAGE_QUALITY: 3.066
4104 :DRILL_EASE: 2.487
4105 :DRILL_LAST_QUALITY: 3
4106 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:33>
4107 :END:
4108 bash menu-complete-backward
4109 *** tab
4110 completion
4111 *** [C-tab]
4112 SCHEDULED: <2014-03-14 Fri>
4113 :PROPERTIES:
4114 :ID: 75d57537-8a32-4a18-982e-6d6f756a9ba6
4115 :DRILL_LAST_INTERVAL: 12.2744
4116 :DRILL_REPEATS_SINCE_FAIL: 3
4117 :DRILL_TOTAL_REPEATS: 3
4118 :DRILL_FAILURE_COUNT: 2
4119 :DRILL_AVERAGE_QUALITY: 3.667
4120 :DRILL_EASE: 2.855
4121 :DRILL_LAST_QUALITY: 4
4122 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
4123 :END:
4124 terminal find
4125 *** [C-left/right]
4126 SCHEDULED: <2014-03-27 Thu>
4127 :PROPERTIES:
4128 :ID: 5587c07b-c003-470f-bef4-fa55f00524ff
4129 :DRILL_LAST_INTERVAL: 50.6823
4130 :DRILL_REPEATS_SINCE_FAIL: 3
4131 :DRILL_TOTAL_REPEATS: 3
4132 :DRILL_FAILURE_COUNT: 0
4133 :DRILL_AVERAGE_QUALITY: 5.0
4134 :DRILL_EASE: 5.815
4135 :DRILL_LAST_QUALITY: 5
4136 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
4137 :END:
4138 forward/backward-word
4139
4140 *** [C-u]
4141 SCHEDULED: <2014-03-19 Wed>
4142 :PROPERTIES:
4143 :ID: b5342b6b-f14f-4a6b-99d8-110fdef243f2
4144 :DRILL_LAST_INTERVAL: 24.3844
4145 :DRILL_REPEATS_SINCE_FAIL: 5
4146 :DRILL_TOTAL_REPEATS: 5
4147 :DRILL_FAILURE_COUNT: 2
4148 :DRILL_AVERAGE_QUALITY: 3.0
4149 :DRILL_EASE: 2.456
4150 :DRILL_LAST_QUALITY: 3
4151 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
4152 :END:
4153 bash backward-kill-word
4154 *** [C-i]
4155 SCHEDULED: <2014-03-14 Fri>
4156 :PROPERTIES:
4157 :ID: 6e306a04-8f21-4142-8c00-8a87a3544d6e
4158 :DRILL_LAST_INTERVAL: 11.6739
4159 :DRILL_REPEATS_SINCE_FAIL: 3
4160 :DRILL_TOTAL_REPEATS: 3
4161 :DRILL_FAILURE_COUNT: 0
4162 :DRILL_AVERAGE_QUALITY: 3.333
4163 :DRILL_EASE: 2.626
4164 :DRILL_LAST_QUALITY: 4
4165 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 20:58>
4166 :END:
4167 terminal find up
4168 [ terminal crap, duplicate of tab ]
4169 *** [C-o]
4170 SCHEDULED: <2014-03-15 Sat>
4171 :PROPERTIES:
4172 :ID: 40b6d9ce-2427-4905-b444-d6d90c5a4da4
4173 :DRILL_LAST_INTERVAL: 23.5247
4174 :DRILL_REPEATS_SINCE_FAIL: 4
4175 :DRILL_TOTAL_REPEATS: 4
4176 :DRILL_FAILURE_COUNT: 0
4177 :DRILL_AVERAGE_QUALITY: 3.5
4178 :DRILL_EASE: 2.73
4179 :DRILL_LAST_QUALITY: 3
4180 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:25>
4181 :END:
4182 bash operate-and-get-next, submit and bring up next item in history
4183 *** [C-p]
4184 SCHEDULED: <2014-03-11 Tue>
4185 :PROPERTIES:
4186 :ID: 4956027e-c5da-48de-8925-6f6b6dd98cec
4187 :DRILL_LAST_INTERVAL: 1.575
4188 :DRILL_REPEATS_SINCE_FAIL: 1
4189 :DRILL_TOTAL_REPEATS: 9
4190 :DRILL_FAILURE_COUNT: 8
4191 :DRILL_AVERAGE_QUALITY: 2.597
4192 :DRILL_EASE: 2.265
4193 :DRILL_LAST_QUALITY: 3
4194 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:38>
4195 :END:
4196 bash dabbrev-expand,
4197 complete historical command names
4198 *** C-h
4199 terminal incompatible junk
4200 *** [C-k]
4201 SCHEDULED: <2014-05-09 Fri>
4202 :PROPERTIES:
4203 :ID: f91ff161-8d8c-4f47-beb5-09f86bf774d5
4204 :DRILL_LAST_INTERVAL: 67.6174
4205 :DRILL_REPEATS_SINCE_FAIL: 4
4206 :DRILL_TOTAL_REPEATS: 4
4207 :DRILL_FAILURE_COUNT: 1
4208 :DRILL_AVERAGE_QUALITY: 4.75
4209 :DRILL_EASE: 4.85
4210 :DRILL_LAST_QUALITY: 5
4211 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
4212 :END:
4213 bash kill-line, to end of line
4214 *** [C-l]
4215 SCHEDULED: <2014-05-13 Tue>
4216 :PROPERTIES:
4217 :ID: 4798acc1-4fc8-406e-bc95-8131cfa255a5
4218 :DRILL_LAST_INTERVAL: 71.5839
4219 :DRILL_REPEATS_SINCE_FAIL: 4
4220 :DRILL_TOTAL_REPEATS: 4
4221 :DRILL_FAILURE_COUNT: 0
4222 :DRILL_AVERAGE_QUALITY: 4.75
4223 :DRILL_EASE: 4.85
4224 :DRILL_LAST_QUALITY: 5
4225 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:12>
4226 :END:
4227 bash clear screen
4228 *** [C-m]
4229 SCHEDULED: <2014-03-14 Fri>
4230 :PROPERTIES:
4231 :ID: 119a0a90-9253-4131-b0c8-5aa7d8cf2259
4232 :DRILL_LAST_INTERVAL: 11.6739
4233 :DRILL_REPEATS_SINCE_FAIL: 3
4234 :DRILL_TOTAL_REPEATS: 3
4235 :DRILL_FAILURE_COUNT: 0
4236 :DRILL_AVERAGE_QUALITY: 3.333
4237 :DRILL_EASE: 2.626
4238 :DRILL_LAST_QUALITY: 4
4239 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 20:58>
4240 :END:
4241 [--------]
4242 #+begin_src emacs-lisp
4243 (add-hook 'comint-mode-hook
4244 (lambda ()
4245 (define-key comint-mode-map "\C-m" nil)))
4246
4247 #+end_src
4248 *** [C-space]
4249 SCHEDULED: <2014-03-12 Wed>
4250 :PROPERTIES:
4251 :ID: 803e2480-4e11-41d0-a261-4f5930a7f9a9
4252 :DRILL_LAST_INTERVAL: 10.0687
4253 :DRILL_REPEATS_SINCE_FAIL: 3
4254 :DRILL_TOTAL_REPEATS: 6
4255 :DRILL_FAILURE_COUNT: 1
4256 :DRILL_AVERAGE_QUALITY: 2.875
4257 :DRILL_EASE: 2.397
4258 :DRILL_LAST_QUALITY: 3
4259 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:06>
4260 :END:
4261 bash set mark
4262 *** [C-delete]
4263 SCHEDULED: <2014-03-15 Sat>
4264 :PROPERTIES:
4265 :ID: 3d0c188b-3cf0-4f0a-83c8-78f6e4040ee5
4266 :DRILL_LAST_INTERVAL: 24.4352
4267 :DRILL_REPEATS_SINCE_FAIL: 4
4268 :DRILL_TOTAL_REPEATS: 4
4269 :DRILL_FAILURE_COUNT: 0
4270 :DRILL_AVERAGE_QUALITY: 3.75
4271 :DRILL_EASE: 2.929
4272 :DRILL_LAST_QUALITY: 4
4273 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:44>
4274 :END:
4275 bash delete word
4276 ** isearch
4277 *** [C-w] :drill:
4278 SCHEDULED: <2014-03-27 Thu>
4279 :PROPERTIES:
4280 :ID: f0e2b6e2-809b-40c2-8d72-0f7e35eda9b3
4281 :DRILL_LAST_INTERVAL: 50.6823
4282 :DRILL_REPEATS_SINCE_FAIL: 3
4283 :DRILL_TOTAL_REPEATS: 3
4284 :DRILL_FAILURE_COUNT: 0
4285 :DRILL_AVERAGE_QUALITY: 5.0
4286 :DRILL_EASE: 5.815
4287 :DRILL_LAST_QUALITY: 5
4288 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
4289 :END:
4290 paste word/char under cursor into isearch
4291 *** [M-n/p] :drill:
4292 SCHEDULED: <2014-03-27 Thu>
4293 :PROPERTIES:
4294 :ID: b3692e47-458e-41a0-b2be-c5f61b4eadbd
4295 :DRILL_LAST_INTERVAL: 50.6823
4296 :DRILL_REPEATS_SINCE_FAIL: 3
4297 :DRILL_TOTAL_REPEATS: 3
4298 :DRILL_FAILURE_COUNT: 0
4299 :DRILL_AVERAGE_QUALITY: 5.0
4300 :DRILL_EASE: 5.815
4301 :DRILL_LAST_QUALITY: 5
4302 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
4303 :END:
4304 next/previous isearch history
4305 *** [C-o] :drill:
4306 SCHEDULED: <2014-03-11 Tue>
4307 :PROPERTIES:
4308 :ID: 8e36b562-7e0c-45e6-a41b-3cd96c134b33
4309 :DRILL_LAST_INTERVAL: 19.9622
4310 :DRILL_REPEATS_SINCE_FAIL: 4
4311 :DRILL_TOTAL_REPEATS: 4
4312 :DRILL_FAILURE_COUNT: 0
4313 :DRILL_AVERAGE_QUALITY: 3.5
4314 :DRILL_EASE: 2.73
4315 :DRILL_LAST_QUALITY: 4
4316 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:30>
4317 :END:
4318 isearch-occur
4319 Activate occur easily inside isearch
4320 [
4321 from starter-kit
4322 #+begin_src emacs-lisp
4323 (define-key isearch-mode-map (kbd "C-o")
4324 (lambda () (interactive)
4325 (let ((case-fold-search isearch-case-fold-search))
4326 (occur (if isearch-regexp
4327 isearch-string
4328 (regexp-quote isearch-string))))))
4329 #+end_src
4330 ]
4331 *** [m-r]
4332 #+begin_src emacs-lisp
4333 (defun my-isearch-toggle-regexp ()
4334 (interactive)
4335 (isearch-toggle-regexp)
4336 (cond (isearch-regexp
4337 (global-set-key (kbd "C-r") 'isearch-backward-regexp)
4338 (define-key global-map (kbd search-key) 'isearch-forward-regexp))
4339 (t
4340 (global-set-key (kbd "C-r") 'isearch-backward)
4341 (define-key global-map (kbd search-key) 'isearch-forward))))
4342 (define-key isearch-mode-map (kbd "M-r") 'my-isearch-toggle-regexp)
4343 #+end_src
4344
4345 ** icomplete
4346 *** C-. C-,
4347 icomplete-forward/backward-completions
4348
4349 ** ido
4350 *** [C-j] :drill:
4351 SCHEDULED: <2014-04-01 Tue>
4352 :PROPERTIES:
4353 :ID: 9cc3392d-00a1-4564-8c57-b418a20d9235
4354 :DRILL_LAST_INTERVAL: 22.6411
4355 :DRILL_REPEATS_SINCE_FAIL: 5
4356 :DRILL_TOTAL_REPEATS: 6
4357 :DRILL_FAILURE_COUNT: 1
4358 :DRILL_AVERAGE_QUALITY: 2.833
4359 :DRILL_EASE: 2.378
4360 :DRILL_LAST_QUALITY: 3
4361 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:34>
4362 :END:
4363 ido-find-file create file
4364 *** [//] :drill:
4365 SCHEDULED: <2014-03-27 Thu>
4366 :PROPERTIES:
4367 :ID: 18ce7d51-93ca-4d41-8e8d-1958cff9c726
4368 :DRILL_LAST_INTERVAL: 50.6823
4369 :DRILL_REPEATS_SINCE_FAIL: 3
4370 :DRILL_TOTAL_REPEATS: 3
4371 :DRILL_FAILURE_COUNT: 0
4372 :DRILL_AVERAGE_QUALITY: 5.0
4373 :DRILL_EASE: 5.815
4374 :DRILL_LAST_QUALITY: 5
4375 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
4376 :END:
4377 ido goto root
4378 *** [C-k] :drill:
4379 :PROPERTIES:
4380 :ID: af4cc865-fe0c-424b-aa5b-2097320d6fb6
4381 :DRILL_LAST_INTERVAL: 0.0
4382 :DRILL_REPEATS_SINCE_FAIL: 0
4383 :DRILL_TOTAL_REPEATS: 5
4384 :DRILL_FAILURE_COUNT: 2
4385 :DRILL_AVERAGE_QUALITY: 3.083
4386 :DRILL_EASE: 2.496
4387 :DRILL_LAST_QUALITY: 2
4388 :DRILL_LAST_REVIEWED: <2014-04-14 Mon 11:31>
4389 :END:
4390 ido kill buffer/file
4391 *** [C-d] :drill:
4392 SCHEDULED: <2014-04-04 Fri>
4393 :PROPERTIES:
4394 :ID: c93d6e0c-ae33-45aa-9610-ce33cfc406a0
4395 :DRILL_LAST_INTERVAL: 25.8141
4396 :DRILL_REPEATS_SINCE_FAIL: 5
4397 :DRILL_TOTAL_REPEATS: 5
4398 :DRILL_FAILURE_COUNT: 1
4399 :DRILL_AVERAGE_QUALITY: 3.0
4400 :DRILL_EASE: 2.456
4401 :DRILL_LAST_QUALITY: 3
4402 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:37>
4403 :END:
4404 ido open dired buffer
4405 *** [M-d] :drill:
4406 SCHEDULED: <2014-03-11 Tue>
4407 :PROPERTIES:
4408 :ID: 8eab4299-207f-4a4a-a698-38f31cb5ff1b
4409 :DRILL_LAST_INTERVAL: 1.7651
4410 :DRILL_REPEATS_SINCE_FAIL: 1
4411 :DRILL_TOTAL_REPEATS: 6
4412 :DRILL_FAILURE_COUNT: 6
4413 :DRILL_AVERAGE_QUALITY: 2.583
4414 :DRILL_EASE: 2.258
4415 :DRILL_LAST_QUALITY: 3
4416 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:38>
4417 :END:
4418 ido search within all subdirectories
4419 *** [M-m] :drill:
4420 SCHEDULED: <2014-03-10 Mon>
4421 :PROPERTIES:
4422 :ID: cb7f6420-1f70-4ddb-ad73-83c3b22ef0e2
4423 :DRILL_LAST_INTERVAL: 7.6174
4424 :DRILL_REPEATS_SINCE_FAIL: 3
4425 :DRILL_TOTAL_REPEATS: 8
4426 :DRILL_FAILURE_COUNT: 4
4427 :DRILL_AVERAGE_QUALITY: 2.583
4428 :DRILL_EASE: 2.257
4429 :DRILL_LAST_QUALITY: 3
4430 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:01>
4431 :END:
4432 ido create subdirectory
4433 *** [M-s] :drill:
4434 SCHEDULED: <2014-04-01 Tue>
4435 :PROPERTIES:
4436 :ID: eb798918-4dd2-40e1-9d08-82ade145869d
4437 :DRILL_LAST_INTERVAL: 23.2268
4438 :DRILL_REPEATS_SINCE_FAIL: 5
4439 :DRILL_TOTAL_REPEATS: 6
4440 :DRILL_FAILURE_COUNT: 4
4441 :DRILL_AVERAGE_QUALITY: 3.083
4442 :DRILL_EASE: 2.496
4443 :DRILL_LAST_QUALITY: 3
4444 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:34>
4445 :END:
4446 ido search recently used directories
4447 *** [M-n/p] :drill:
4448 SCHEDULED: <2014-03-14 Fri>
4449 :PROPERTIES:
4450 :ID: db965c9e-feb0-4213-b631-7cfa0208cfdb
4451 :DRILL_LAST_INTERVAL: 23.0811
4452 :DRILL_REPEATS_SINCE_FAIL: 4
4453 :DRILL_TOTAL_REPEATS: 4
4454 :DRILL_FAILURE_COUNT: 1
4455 :DRILL_AVERAGE_QUALITY: 3.75
4456 :DRILL_EASE: 2.929
4457 :DRILL_LAST_QUALITY: 4
4458 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:36>
4459 :END:
4460 ido next/previous recently used directory
4461 *** [C-s]
4462 **** TODO implement this keybind, normally ctrl-space
4463 ido use current pattern and start a new one
4464 ** info
4465 *** [[]]
4466 goto next-prev node regardless of structure
4467 *** [f]
4468 goto cross reference
4469 *** [x]
4470 Info-follow-nearest-node
4471 #+begin_src emacs-lisp
4472 (define-key Info-mode-map "x" 'Info-follow-nearest-node)
4473 #+end_src
4474 m, f, n, p or ^ command, depending on where you click.
4475 ** auto-complete
4476 *** [S-return] :drill:
4477 SCHEDULED: <2014-03-11 Tue>
4478 :PROPERTIES:
4479 :ID: b9e47939-8033-4adc-8bf4-734b25f4fc47
4480 :DRILL_LAST_INTERVAL: 2.0943
4481 :DRILL_REPEATS_SINCE_FAIL: 1
4482 :DRILL_TOTAL_REPEATS: 7
4483 :DRILL_FAILURE_COUNT: 3
4484 :DRILL_AVERAGE_QUALITY: 2.633
4485 :DRILL_EASE: 2.282
4486 :DRILL_LAST_QUALITY: 3
4487 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:38>
4488 :END:
4489 ac-expand, then select next candidates
4490 *** [C-s] :drill:
4491 SCHEDULED: <2014-03-14 Fri>
4492 :PROPERTIES:
4493 :ID: 828416d4-7ce4-4817-aede-068b80f3041f
4494 :DRILL_LAST_INTERVAL: 23.0811
4495 :DRILL_REPEATS_SINCE_FAIL: 4
4496 :DRILL_TOTAL_REPEATS: 4
4497 :DRILL_FAILURE_COUNT: 1
4498 :DRILL_AVERAGE_QUALITY: 3.75
4499 :DRILL_EASE: 2.929
4500 :DRILL_LAST_QUALITY: 4
4501 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:38>
4502 :END:
4503 ac filter completions
4504 ** agenda
4505 *** [t] :drill:
4506 SCHEDULED: <2014-03-22 Sat>
4507 :PROPERTIES:
4508 :ID: 173e9cec-e401-4f03-90cc-72cba462b2f2
4509 :DRILL_LAST_INTERVAL: 31.1381
4510 :DRILL_REPEATS_SINCE_FAIL: 4
4511 :DRILL_TOTAL_REPEATS: 4
4512 :DRILL_FAILURE_COUNT: 0
4513 :DRILL_AVERAGE_QUALITY: 3.75
4514 :DRILL_EASE: 2.929
4515 :DRILL_LAST_QUALITY: 3
4516 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:50>
4517 :END:
4518 agenda cycle todo state
4519 ** org
4520 *** [C-c / t] :drill:
4521 SCHEDULED: <2014-03-13 Thu>
4522 :PROPERTIES:
4523 :ID: a5775c4f-c5d3-4024-a280-6628c5e7ab39
4524 :DRILL_LAST_INTERVAL: 10.7692
4525 :DRILL_REPEATS_SINCE_FAIL: 3
4526 :DRILL_TOTAL_REPEATS: 6
4527 :DRILL_FAILURE_COUNT: 1
4528 :DRILL_AVERAGE_QUALITY: 3.167
4529 :DRILL_EASE: 2.537
4530 :DRILL_LAST_QUALITY: 4
4531 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
4532 :END:
4533 show todo items
4534 *** [S-<tab>] :drill:
4535 SCHEDULED: <2014-03-27 Thu>
4536 :PROPERTIES:
4537 :ID: 1c1a4061-5cff-4826-aec2-8f677aab33a9
4538 :DRILL_LAST_INTERVAL: 50.6823
4539 :DRILL_REPEATS_SINCE_FAIL: 3
4540 :DRILL_TOTAL_REPEATS: 3
4541 :DRILL_FAILURE_COUNT: 0
4542 :DRILL_AVERAGE_QUALITY: 5.0
4543 :DRILL_EASE: 5.815
4544 :DRILL_LAST_QUALITY: 5
4545 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:44>
4546 :END:
4547 org-shifttab global visibility cycle / move table cell
4548 *** [C-cs] :drill:
4549 SCHEDULED: <2014-03-14 Fri>
4550 :PROPERTIES:
4551 :ID: 9ba74a38-655c-4f96-8443-b574ee25c544
4552 :DRILL_LAST_INTERVAL: 5.238
4553 :DRILL_REPEATS_SINCE_FAIL: 2
4554 :DRILL_TOTAL_REPEATS: 7
4555 :DRILL_FAILURE_COUNT: 2
4556 :DRILL_AVERAGE_QUALITY: 2.801
4557 :DRILL_EASE: 2.362
4558 :DRILL_LAST_QUALITY: 3
4559 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:33>
4560 :END:
4561 schedule todo item
4562 *** [C-cx p] :drill:
4563 SCHEDULED: <2014-03-15 Sat>
4564 :PROPERTIES:
4565 :ID: 4b486f48-219d-4517-96c2-83ef839abda5
4566 :DRILL_LAST_INTERVAL: 24.4352
4567 :DRILL_REPEATS_SINCE_FAIL: 4
4568 :DRILL_TOTAL_REPEATS: 4
4569 :DRILL_FAILURE_COUNT: 0
4570 :DRILL_AVERAGE_QUALITY: 3.75
4571 :DRILL_EASE: 2.929
4572 :DRILL_LAST_QUALITY: 4
4573 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:39>
4574 :END:
4575 org set property
4576 *** [C-c -] :drill:
4577 SCHEDULED: <2014-03-24 Mon>
4578 :PROPERTIES:
4579 :ID: 60e57e56-d815-4d9b-ba78-2a56164db209
4580 :DRILL_LAST_INTERVAL: 32.7466
4581 :DRILL_REPEATS_SINCE_FAIL: 4
4582 :DRILL_TOTAL_REPEATS: 4
4583 :DRILL_FAILURE_COUNT: 0
4584 :DRILL_AVERAGE_QUALITY: 4.0
4585 :DRILL_EASE: 3.204
4586 :DRILL_LAST_QUALITY: 4
4587 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:52>
4588 :END:
4589 org insert horizontal line
4590 *** [C-cq] :drill:
4591 SCHEDULED: <2014-03-24 Mon>
4592 :PROPERTIES:
4593 :ID: 6987ba15-fbc0-459b-bc27-cf9016baebc3
4594 :DRILL_LAST_INTERVAL: 32.7466
4595 :DRILL_REPEATS_SINCE_FAIL: 4
4596 :DRILL_TOTAL_REPEATS: 4
4597 :DRILL_FAILURE_COUNT: 0
4598 :DRILL_AVERAGE_QUALITY: 4.0
4599 :DRILL_EASE: 3.204
4600 :DRILL_LAST_QUALITY: 4
4601 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:50>
4602 :END:
4603 org tag
4604 ** calc
4605 i'd like to drill these sometime when I have space in my head, or I
4606 plan to use calc.
4607 *** space
4608 [enter input to the stack, or duplicate top stack item]
4609 *** C-M-i
4610 [cycle 3 elements on stack]
4611 *** tab
4612 [cycle 2 elements on stack]
4613 *** n
4614 [negate]
4615 *** _
4616 [begin negative number]
4617 *** /
4618 [reciprocal]
4619 *** x
4620 [calc named command]
4621 *** M-delete
4622 [delete 2nd from top of stack]
4623 *** C-u [-]0-9
4624 [0=whole stack, 1-9=that many, -1-9=that element]
4625 *** delete
4626 [remove from the top of the stack]
4627 *** '
4628 [algebraic mode. infix expressions are calculated when input to the stack]
4629 *** m a
4630 [auto algebraic mode]
4631 *** $,$$,$$$
4632 [top x of stack reference]
4633 *** s s/t/r/u
4634 [store to variable: store, top, retrieve, unstore. the quick variables 0-9 don't need s prefix]
4635 *** U/D
4636 [undo/redo]
4637 *** t p/n/]/y
4638 [trail prev/next/end/yankh]
4639 *** `
4640 [calc edit mode, to edit the top of stack]
4641
4642 ** single/special keys
4643 :PROPERTIES:
4644 :ID: beginning-of-keybind-table-data
4645 :END:
4646 *** [tab key]
4647 :PROPERTIES:
4648 :CUSTOM_ID: 6c10a716-1d8e-4ce4-8e26-64468f19c17a
4649 :END:
4650 isearch
4651 #+begin_src emacs-lisp
4652 (define-key isearch-mode-map (kbd "<tab>") 'isearch-query-replace)
4653 #+end_src
4654 *** tab
4655 :PROPERTIES:
4656 :ID: d93321a4-6732-421f-9c03-0073c4cbfdcb
4657 :CUSTOM_ID: 51ece189-1840-41a1-8ca0-19f9a0481895
4658 :END:
4659 isearch-forward
4660 #+begin_src emacs-lisp
4661 ;; explained in http://stackoverflow.com/questions/7411920/how-to-bind-search-and-search-repeat-to-c-f-in-emacs
4662 (global-set-key (kbd search-key) 'isearch-forward)
4663 (define-key isearch-mode-map "\t" nil)
4664 (define-key isearch-mode-map (kbd search-key) 'isearch-repeat-forward)
4665 ;; get rid of the standard completion binding, always use auto-complete
4666 ;; this didn't work very well
4667 ;;(global-set-key (kbd "TAB") 'auto-complete)
4668 (define-key global-map [remap completion-at-point] 'auto-complete)
4669
4670 #+end_src
4671
4672 *** end
4673 :PROPERTIES:
4674 :ID: 7e71b6fe-dcef-4f91-87d9-d996ddf7db5d
4675 :CUSTOM_ID: 00d589b7-2b8e-494c-b761-3afefebe6ec6
4676 :END:
4677 move-end-of-line
4678 #+begin_src emacs-lisp
4679 ;; taken from emacs wiki, along with home function
4680 ;; http://www.emacswiki.org/emacs/BackToIndentationOrBeginning
4681 (defun point-in-comment ()
4682 "Determine if the point is inside a comment"
4683 (interactive)
4684 (let ((syn (syntax-ppss)))
4685 (and (nth 8 syn)
4686 (not (nth 3 syn)))))
4687 (defun end-of-code-or-line (arg)
4688 "Move to end of line, or before start of comments depending on situation.
4689 Toggle back and forth positions if we are already at one.
4690 Comments are recognized in any mode that sets syntax-ppss
4691 properly."
4692 (interactive "P")
4693 (when (catch 'bol
4694 (let ((start (point))
4695 (bol (save-excursion
4696 (beginning-of-line)
4697 (point)))
4698 (eol (progn (move-end-of-line arg) (point))))
4699 (while (point-in-comment)
4700 (backward-char)
4701 (when (= (point) bol)
4702 (throw 'bol t)))
4703 (throw 'bol (and (not (= eol start)) (>= start (point))))))
4704 (move-end-of-line arg)))
4705
4706 (global-set-key (kbd "<end>") 'end-of-code-or-line)(add-hook 'org-mode-hook (lambda () (define-key org-mode-map (kbd "<end>") 'org-end-of-line)))
4707 #+end_src
4708
4709 *** home
4710 :PROPERTIES:
4711 :ID: f52de4a4-212c-4133-9038-2b652c739ad2
4712 :CUSTOM_ID: 7800e455-c3f6-4a8f-8907-b2292449ab67
4713 :END:
4714 back-to-indentation
4715 #+begin_src emacs-lisp
4716 (defun back-to-indentation-or-beginning ()
4717 (interactive)
4718 (if (= (point) (progn (back-to-indentation) (point)))
4719 (if (derived-mode-p 'org-mode)
4720 (org-beginning-of-line)
4721 (beginning-of-line))))
4722 (global-set-key (kbd "<home>") 'back-to-indentation-or-beginning)
4723
4724 #+end_src
4725
4726 *** [s-tab]
4727 :PROPERTIES:
4728 :CUSTOM_ID: 3072901e-5cf3-4d6e-9ac8-3ef64a5f6ad2
4729 :END:
4730 indent-buffer
4731 [
4732 #+begin_src emacs-lisp
4733 (global-set-key (kbd "<S-iso-lefttab>") 'indent-buffer)
4734 #+end_src
4735 ]
4736 *** [s-delete]
4737 :PROPERTIES:
4738 :CUSTOM_ID: e53728b6-054d-4443-a03e-6cf02d13724d
4739 :END:
4740 send-shell
4741 #+begin_src emacs-lisp
4742
4743 (global-set-key (kbd "<S-delete>") 'send-shell)
4744
4745 ;; optional variables used by send-shell
4746 (setq shell-send-yank-key nil)
4747
4748 (defun repeat-shell ()
4749 (interactive)
4750 "Repeat the last command in shell-mode, displaying the window if needed."
4751 (let ((shell-buffer (get-buffer "*shell*")))
4752 (if shell-buffer
4753 (buffer-window-show shell-buffer)
4754 (let ((original-buffer (current-buffer)))
4755 (funcall 'shell)
4756 (setq shell-buffer (current-buffer))
4757 (switch-to-buffer original-buffer)))
4758 (with-current-buffer shell-buffer
4759 (goto-char (point-max))
4760 (call-interactively 'comint-previous-input)
4761 ;; the t flag makes the buffer advance
4762 (comint-send-input nil t))))
4763
4764 (setq compilation-filenames '("Makefile" "makefile"))
4765
4766 (defun get-nearest-compilation-file ()
4767 "Search for the compilation file traversing up the directory tree."
4768 (interactive)
4769 (let ((dir default-directory)
4770 (parent-dir (file-name-directory (directory-file-name default-directory)))
4771 (nearest-compilation-file 'nil))
4772 (while (and (not (string= dir parent-dir))
4773 (not nearest-compilation-file))
4774 (dolist (filename compilation-filenames)
4775 (setq file-path (concat dir filename))
4776 (when (file-readable-p file-path)
4777 (setq nearest-compilation-file file-path)))
4778 (setq dir parent-dir
4779 parent-dir (file-name-directory (directory-file-name parent-dir))))
4780 nearest-compilation-file))
4781 (defun run ()
4782 (interactive)
4783 "call run-fun if it is set, else run make if there is a makefile,
4784 else save and repeat last shell command.
4785 run-fun is meant to store file local variables, which show how to
4786 do the main thing we want on this file, generally compile and
4787 run.
4788
4789 example of setting it in a file:
4790 ;; Local Variables:
4791 ;; run-fun: merge-test
4792 ;; End: "
4793 (basic-save-buffer)
4794 (if (and (boundp 'run-fun) run-fun)
4795 (funcall run-fun)
4796 (let ((makefile (get-nearest-compilation-file)))
4797 (if (and makefile (stringp mode-name) (string= mode-name "C/l"))
4798 (compile (format
4799 "make -f %s" (get-nearest-compilation-file)))
4800 (repeat-shell)))))
4801
4802
4803 (defun send-shell ()
4804 (interactive)
4805 (send-shell-buffer "*shell*" 'shell (kbd "C-v")))
4806
4807 (defun send-python ()
4808 (interactive)
4809 (send-shell-buffer "*Python*" 'py-shell (kbd "C-v")))
4810
4811
4812 (defun send-shell-buffer (buffer-name &optional init shell-send-yank-key)
4813 "Send current line or region to shell-mode buffer.
4814 When in shell-mode, copy the current line to the
4815 most recently visited visible window.
4816
4817 SHELL-SEND-YANK-KEY: key to use instead
4818 of yank to paste into recent window. This allows compatibility with
4819 modes like org-mode which have their own yank function."
4820 (if (string= (buffer-name) buffer-name)
4821 ;; this section is copied out of comint-send-input
4822 (progn
4823 (let ((proc (get-buffer-process (current-buffer))))
4824 (if (not proc) (user-error "Current buffer has no process")
4825 (widen)
4826
4827 (let* ((pmark (process-mark proc))
4828 (intxt (if (>= (point) (marker-position pmark))
4829 (progn (if comint-eol-on-send (end-of-line))
4830 (buffer-substring pmark (point)))
4831 (let ((copy (funcall comint-get-old-input)))
4832 (goto-char pmark)
4833 (insert copy)
4834 copy))))
4835
4836 (if (= (length intxt) 0)
4837 (kill-new (comint-previous-matching-input-string "." 1))
4838 (kill-new intxt)))))
4839 (kill-append "\n" nil)
4840 (select-window (previous-window nil nil 'visible))
4841 (if (and (boundp 'shell-send-yank-key) shell-send-yank-key)
4842 (call-interactively (global-key-binding shell-send-yank-key))
4843 (yank))
4844 (select-window (next-window nil nil 'visible)))
4845 (let (start end)
4846 (if mark-active
4847 (setq start (mark)
4848 end (point))
4849 (setq start (save-excursion (beginning-of-line) (point))
4850 end (save-excursion (end-of-line) (point)))
4851 (let (line-move-visual)
4852 (call-interactively 'next-line)))
4853 (send-comint-input buffer-name start end init))))
4854
4855 ;; supporting functions
4856
4857
4858 (defun send-comint-input (buffer-name start end &optional init)
4859 "Input the region to BUFFER-NAME, assuming it is a comint-derived buffer.
4860 Show BUFFER-NAME if it is not show.
4861 Call INIT if BUFFER-NAME does not exist."
4862 (let ((input (filter-buffer-substring start end))
4863 (buffer (get-buffer buffer-name)))
4864 (unless buffer
4865 (message "nobuffer")
4866 ;; save-excursion etc. don't work for (shell), so I do this instead
4867 (if init (let ((original-buffer (current-buffer)))
4868 (funcall init (and (boundp 'send-shell-buffer-name) send-shell-buffer-name))
4869 (switch-to-buffer original-buffer)
4870 (setq buffer (get-buffer buffer-name)))
4871 (error "No existing buffer found and no init function argument. ")))
4872 (buffer-window-show buffer)
4873 (with-current-buffer buffer
4874 (let ((proc (get-buffer-process buffer)))
4875 (goto-char (process-mark proc))
4876 (insert input)
4877 (comint-send-input nil t)))))
4878
4879 (defun buffer-window-show (&optional buffer action)
4880 "Like temp-buffer-window-show, but removed stuff
4881 relevant to it being temp or help."
4882 (let (window frame)
4883 (with-current-buffer buffer
4884 (when (let ((window-combination-limit
4885 ;; When `window-combination-limit' equals
4886 ;; `temp-buffer' or `temp-buffer-resize' and
4887 ;; `temp-buffer-resize-mode' is enabled in this
4888 ;; buffer bind it to t so resizing steals space
4889 ;; preferably from the window that was split.
4890 (if (or (eq window-combination-limit 'temp-buffer)
4891 (and (eq window-combination-limit
4892 'temp-buffer-resize)
4893 temp-buffer-resize-mode))
4894 t
4895 window-combination-limit)))
4896 ;; debug
4897 ;;(message "window-combination-limit")
4898 ;;(print window-combination-limit)
4899 (setq window (display-buffer buffer action)))
4900 (setq frame (window-frame window))
4901 (unless (eq frame (selected-frame))
4902 (raise-frame frame))
4903 (setq minibuffer-scroll-window window)
4904 (set-window-hscroll window 0)
4905 ;; Return the window.
4906 window))))
4907
4908
4909 ;; when poping help, etc, allow reusing a window in a different frame if it is visible
4910 ;; figured this out after spending quite a while reading doc string for display-buffer
4911 ;; which is the main function which uses this.
4912 ;; it will use other vars or its arg to override this,
4913 ;; but those things are often nil.
4914 ;; aha moments in reading it: ACTION = (FUNCTION-or-FUNCTIONLIST ALIST)
4915 ;; FRAME adds an association to ACTION's alist, but it's not used if ACTION arg is nil.
4916 (setq display-buffer-fallback-action `(,(car display-buffer-fallback-action) . '(reusable-frames . visible)))
4917 ;; stop splitting windows verticallly when I open a buffer or shell
4918 (setq split-height-threshold nil)
4919 #+end_src
4920
4921 *** s-left arrow
4922 :PROPERTIES:
4923 :CUSTOM_ID: d8c473ac-5507-4a6b-9e5a-46558c17b09f
4924 :END:
4925 shell
4926 #+begin_src emacs-lisp
4927 (global-set-key (kbd shell-key) 'shell-wrap)
4928 #+end_src
4929 *** s-right arrow
4930 :PROPERTIES:
4931 :CUSTOM_ID: 2365f5a7-b89a-4a97-b272-ac8ae9c2cc66
4932 :END:
4933 previous-buffer
4934 #+begin_src emacs-lisp
4935 (global-set-key (kbd "<S-kp-divide>") 'previous-buffer)
4936 #+end_src
4937 *** esc
4938 :PROPERTIES:
4939 :CUSTOM_ID: 60a56803-f38d-4d0a-8ed5-1c94ba97b6f6
4940 :END:
4941 *** return
4942 :PROPERTIES:
4943 :CUSTOM_ID: fab6adea-ed20-45ab-a0a3-776c68d5c3a5
4944 :END:
4945 new line
4946
4947 #+begin_src emacs-lisp
4948 ;; todo, this doesn't set the keybind for the help minibuffer
4949 (when (boundp 'icomplete-minibuffer-map)
4950 (define-key icomplete-minibuffer-map (kbd "<return>")
4951 'minibuffer-force-complete-and-exit))
4952
4953 (add-hook 'ido-setup-hook
4954 (lambda()
4955 (define-key ido-completion-map (kbd "<return>") 'ido-exit-minibuffer)))
4956 (define-key minibuffer-local-completion-map (kbd "<return>") 'exit-minibuffer)
4957
4958
4959 (define-key isearch-mode-map (kbd "<return>") 'isearch-exit)
4960 (define-key isearch-mode-map "\r" nil)
4961
4962
4963 (global-set-key (kbd "<return>") 'indent-new-comment-line)
4964 (define-key ac-completing-map (kbd "<return>") nil)
4965 (define-key ac-completing-map "\r" nil)
4966 (define-key minibuffer-local-map "\r" nil)
4967 (define-key minibuffer-local-map (kbd "<return>") 'exit-minibuffer)
4968 (define-key icomplete-minibuffer-map (kbd "C-j") 'exit-minibuffer)
4969 (define-key minibuffer-local-map (kbd "C-j") 'exit-minibuffer)
4970 (define-key minibuffer-local-must-match-map (kbd "C-j") 'exit-minibuffer)
4971 (define-key minibuffer-local-must-match-map "\r" nil)
4972 (define-key minibuffer-local-must-match-map (kbd "<return>")
4973 'minibuffer-complete-and-exit)
4974
4975 (add-hook 'Man-mode-hook
4976 (lambda ()
4977 (define-key Man-mode-map "\r" nil)
4978 (define-key Man-mode-map "x" 'man-follow)))
4979
4980 (add-hook 'comint-mode-hook
4981 (lambda ()
4982 (define-key comint-mode-map "\r" nil)
4983 (define-key comint-mode-map (kbd "<return>") 'comint-send-input)))
4984
4985 (add-hook 'org-mode-hook
4986 (lambda ()
4987 (define-key org-mode-map "\r" nil)
4988 (define-key org-mode-map (kbd "<return>") 'org-return-indent)))
4989
4990 (add-hook 'comint-mode-hook
4991 (lambda ()
4992 (define-key comint-mode-map "\C-m" nil)
4993 (define-key comint-mode-map "\C-d" nil)))
4994 ;; use space instead of enter in calc mode,
4995 ;; cuz it is not easy to rebind enter in calc mode
4996 #+end_src
4997
4998 *** [s-return] :drill:
4999 SCHEDULED: <2014-03-10 Mon>
5000 :PROPERTIES:
5001 auto-correct-prev-word
5002 :ID: db46193b-f202-4927-bc76-2ad74d9f0ed7
5003 :CUSTOM_ID: 819cfb55-3a2f-4f20-8591-f819d1a6869a
5004 :DRILL_LAST_INTERVAL: 7.9493
5005 :DRILL_REPEATS_SINCE_FAIL: 3
5006 :DRILL_TOTAL_REPEATS: 7
5007 :DRILL_FAILURE_COUNT: 4
5008 :DRILL_AVERAGE_QUALITY: 2.696
5009 :DRILL_EASE: 2.312
5010 :DRILL_LAST_QUALITY: 3
5011 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:05>
5012 :END:
5013 auto-correct-prev-word
5014 [
5015 #+begin_src emacs-lisp
5016 (global-set-key (kbd "<S-return>") 'flyspell-auto-correct-previous-word)
5017 #+end_src
5018 ]
5019
5020 *** down arrow
5021 :PROPERTIES:
5022 :CUSTOM_ID: 7a868484-9c63-4a73-abda-7751cb2c02be
5023 :END:
5024 mark
5025 #+begin_src emacs-lisp
5026 (global-set-key (kbd "<kp-enter>") 'set-mark-command)
5027 #+end_src
5028 *** s-down arrow
5029 :PROPERTIES:
5030 :CUSTOM_ID: 097b97e0-8ad8-40f7-8388-c4ace1706b38
5031 :END:
5032 extended command
5033 #+begin_src emacs-lisp
5034 (global-set-key (kbd "<S-kp-enter>") 'smex)
5035 #+end_src
5036 *** s-up arrow
5037
5038 ** mouse
5039 *** [mouse-2 mode line] :drill:
5040 SCHEDULED: <2014-03-17 Mon>
5041 :PROPERTIES:
5042 :ID: d79167ad-9782-40b3-8e40-55aaa8428dec
5043 :CUSTOM_ID: 69aaa631-6fb5-4beb-b2d8-c0f3d92c0a98
5044 :DRILL_LAST_INTERVAL: 15.2345
5045 :DRILL_REPEATS_SINCE_FAIL: 4
5046 :DRILL_TOTAL_REPEATS: 7
5047 :DRILL_FAILURE_COUNT: 2
5048 :DRILL_AVERAGE_QUALITY: 2.893
5049 :DRILL_EASE: 2.405
5050 :DRILL_LAST_QUALITY: 3
5051 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:06>
5052 :END:
5053 mouse-delete-other-windows
5054 *** C-mouse-2 mode line
5055 :PROPERTIES:
5056 :CUSTOM_ID: 501479ab-e1e2-497e-bd86-071f8afa3378
5057 :END:
5058 mouse-split-window-horizontally
5059 *** M-mouse-2 mode line
5060 :PROPERTIES:
5061 :CUSTOM_ID: 8de14d73-499e-406a-b5c4-e295e53d3f4c
5062 :END:
5063 *** S-mouse-2 mode line
5064 :PROPERTIES:
5065 :CUSTOM_ID: f389cdbb-186a-4cad-af45-b3c75a508275
5066 :END:
5067 *** C-M-mouse-2 mode line
5068 :PROPERTIES:
5069 :CUSTOM_ID: cb2be69c-f86c-4120-b7f2-1c09b7bcd816
5070 :END:
5071 *** C-S-mouse2 mode line
5072 :PROPERTIES:
5073 :CUSTOM_ID: 7b4eced3-ce5e-49ce-8bfe-8823e8f5f93e
5074 :END:
5075 *** [mouse-3 mode line] :drill:
5076 SCHEDULED: <2014-03-19 Wed>
5077 :PROPERTIES:
5078 :ID: 324e43e7-d468-4edc-b892-c1e249ff49fa
5079 :CUSTOM_ID: 917a1844-8c38-4f31-8616-50fc81334f2c
5080 :DRILL_LAST_INTERVAL: 27.607
5081 :DRILL_REPEATS_SINCE_FAIL: 4
5082 :DRILL_TOTAL_REPEATS: 4
5083 :DRILL_FAILURE_COUNT: 0
5084 :DRILL_AVERAGE_QUALITY: 3.5
5085 :DRILL_EASE: 2.73
5086 :DRILL_LAST_QUALITY: 3
5087 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:50>
5088 :END:
5089 mouse-delete-window
5090 *** C-mouse-3 mode line
5091 :PROPERTIES:
5092 :CUSTOM_ID: b36a218f-6a92-4594-940b-13ffdf79cc9c
5093 :END:
5094 *** M-mouse-3 mode line
5095 :PROPERTIES:
5096 :CUSTOM_ID: 11c48311-05a4-440e-b742-ec397f22f479
5097 :END:
5098 *** S-mouse-3 mode line
5099 :PROPERTIES:
5100 :CUSTOM_ID: 03768943-d8cd-4dcb-bc48-393e9a6bb31f
5101 :END:
5102 *** C-M-mouse-3 mode line
5103 :PROPERTIES:
5104 :CUSTOM_ID: ab213201-bab7-4d30-8f61-fee80e7f2c6f
5105 :END:
5106 *** C-S-mouse-3 mode line
5107 :PROPERTIES:
5108 :CUSTOM_ID: 0bcac7a3-2943-49b7-b281-d834d374caf9
5109 :END:
5110 *** mouse-1
5111 :PROPERTIES:
5112 :CUSTOM_ID: 4e60e2e4-8c2f-4450-8060-2d793ede530c
5113 :END:
5114 set cursor/mark
5115 *** [C-mouse-1] :drill:
5116 SCHEDULED: <2014-03-15 Sat>
5117 :PROPERTIES:
5118 :CUSTOM_ID: b661f84f-57df-4095-9dc1-d1a876a53ee5
5119 :ID: 6b82708e-d5de-48cc-8abd-225186eb8729
5120 :DRILL_LAST_INTERVAL: 24.4352
5121 :DRILL_REPEATS_SINCE_FAIL: 4
5122 :DRILL_TOTAL_REPEATS: 4
5123 :DRILL_FAILURE_COUNT: 0
5124 :DRILL_AVERAGE_QUALITY: 3.75
5125 :DRILL_EASE: 2.929
5126 :DRILL_LAST_QUALITY: 4
5127 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 18:03>
5128 :END:
5129 buffer list context menu
5130 *** M-mouse-1
5131 :PROPERTIES:
5132 :CUSTOM_ID: c71c8a71-7027-44f3-be19-1d3c18ff5129
5133 :END:
5134 *** S-mouse-1
5135 :PROPERTIES:
5136 :CUSTOM_ID: 84507cd6-8a75-4754-bf9e-5a30f57fa4ac
5137 :END:
5138 *** C-M-mouse-1
5139 :PROPERTIES:
5140 :CUSTOM_ID: 95eea58e-82b0-48a3-a7c8-0d17c50b7c2e
5141 :END:
5142 *** C-S-mouse-1
5143 :PROPERTIES:
5144 :CUSTOM_ID: 2d450c06-d9aa-4751-a926-0922c0c3a402
5145 :END:
5146 *** mouse-2
5147 :PROPERTIES:
5148 :CUSTOM_ID: 086b0b50-054f-462d-92fa-b27852f887b0
5149 :END:
5150 paste
5151 *** C-mouse-2
5152 :PROPERTIES:
5153 :CUSTOM_ID: 48b8de22-6638-44da-986f-16e0e69312dd
5154 :END:
5155 *** M-mouse-2
5156 :PROPERTIES:
5157 :CUSTOM_ID: fb315a27-6351-4ce2-9692-589608793c43
5158 :END:
5159 *** S-mouse-2
5160 :PROPERTIES:
5161 :CUSTOM_ID: 7cc73036-844b-44d3-afe1-1e76ee626b53
5162 :END:
5163 *** C-M-mouse-2
5164 :PROPERTIES:
5165 :CUSTOM_ID: 85f35287-5130-47ab-832d-af78dc2a3e70
5166 :END:
5167 *** C-S-mouse-2
5168 :PROPERTIES:
5169 :CUSTOM_ID: a27ad43f-3be2-4155-9a9f-c144170372ce
5170 :END:
5171 *** mouse-3
5172 :PROPERTIES:
5173 :CUSTOM_ID: 0481632e-9c50-4328-9365-c4b5bf967b66
5174 :END:
5175 set-mark
5176 #+begin_src emacs-lisp
5177 (define-key global-map [down-mouse-3] 'mouse3-func)
5178 (global-set-key [mouse-3] 'mouse3-set-mark)
5179 (global-set-key [drag-mouse-3] 'mouse3-set-mark)
5180 #+end_src
5181 *** [C-mouse-3] :drill:
5182 SCHEDULED: <2014-03-13 Thu>
5183 :PROPERTIES:
5184 :ID: b075e62c-55c6-46f5-a23a-4c4c5b9f267e
5185 :CUSTOM_ID: 9623c78f-7705-4cbe-a990-c24eb1067377
5186 :DRILL_LAST_INTERVAL: 22.1939
5187 :DRILL_REPEATS_SINCE_FAIL: 4
5188 :DRILL_TOTAL_REPEATS: 4
5189 :DRILL_FAILURE_COUNT: 0
5190 :DRILL_AVERAGE_QUALITY: 3.5
5191 :DRILL_EASE: 2.73
5192 :DRILL_LAST_QUALITY: 4
5193 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:38>
5194 :END:
5195 global menu
5196 *** M-mouse-3
5197 :PROPERTIES:
5198 :CUSTOM_ID: fb6f4840-7e44-4c94-b913-f2014fda3325
5199 :END:
5200 *** S-mouse-3
5201 :PROPERTIES:
5202 :CUSTOM_ID: a6d91332-c731-474c-9959-ddd03e8b2786
5203 :END:
5204 *** C-M-mouse-3
5205 :PROPERTIES:
5206 :CUSTOM_ID: 6b4d0e4d-1a2c-4e42-a925-e39548c4e264
5207 :END:
5208 *** C-S-mouse-3
5209 :PROPERTIES:
5210 :CUSTOM_ID: a983a7c5-c17e-4e08-b3e2-a45a44d7a2b6
5211 :END:
5212 *** [mouse-9]
5213 :PROPERTIES:
5214 :CUSTOM_ID: efaec161-b279-4129-86fd-b410430926e4
5215 :END:
5216 move-mouse-to-point
5217 [
5218 #+begin_src emacs-lisp
5219 (global-set-key (kbd "<mouse-6>") 'move-mouse-to-point)
5220 #+end_src
5221 ]
5222 *** C-mouse-9
5223 :PROPERTIES:
5224 :CUSTOM_ID: e055ae8a-cc94-4e0f-9e98-9cb62453b8d6
5225 :END:
5226 *** M-mouse-9
5227 :PROPERTIES:
5228 :CUSTOM_ID: 7d1c03a9-b153-47dc-a037-7ee333ca8da9
5229 :END:
5230 *** S-mouse-9
5231 :PROPERTIES:
5232 :CUSTOM_ID: 8f688d00-8cdb-4163-818c-a0cfba3b1c0a
5233 :END:
5234 *** C-M-mouse-9
5235 :PROPERTIES:
5236 :CUSTOM_ID: 90ce7df8-2346-4203-8ced-5da51c7c1bfc
5237 :END:
5238 *** C-S-mouse-9
5239 :PROPERTIES:
5240 :CUSTOM_ID: 0afdad0a-f9c4-4bfa-baa8-cc20d6cab628
5241 :END:
5242 *** mouse-8
5243 :PROPERTIES:
5244 :CUSTOM_ID: ea9d2415-0fd7-4f83-9867-a7a81899e74b
5245 :END:
5246 *** C-mouse-8
5247 :PROPERTIES:
5248 :CUSTOM_ID: dc2428d2-412c-4811-8327-3bb70bfa0e76
5249 :END:
5250 *** M-mouse-8
5251 :PROPERTIES:
5252 :CUSTOM_ID: 530ed41d-6ed6-4bcd-9df7-58ddbfe8b44a
5253 :END:
5254 *** S-mouse-8
5255 :PROPERTIES:
5256 :CUSTOM_ID: c7d388c3-f4a6-4489-b23a-20ebb7515430
5257 :END:
5258 *** C-M-mouse-8
5259 :PROPERTIES:
5260 :CUSTOM_ID: fc6ac9e8-fd9a-4270-9cd8-26713d6bc40f
5261 :END:
5262 *** C-S-mouse-8
5263 :PROPERTIES:
5264 :CUSTOM_ID: 401503ad-3750-4002-a28e-1f1345412bc6
5265 :END:
5266 *** 1/kp-end
5267 :PROPERTIES:
5268 :CUSTOM_ID: c306a3ef-4b81-4d54-a914-99f312d8f92f
5269 :END:
5270 *** C-1/kp-end
5271 :PROPERTIES:
5272 :CUSTOM_ID: 11059916-0a48-4f08-b85a-9b82243e4145
5273 :END:
5274 *** M-1/kp-end
5275 :PROPERTIES:
5276 :CUSTOM_ID: fddd8716-5b16-484e-9d70-358fea201d99
5277 :END:
5278 *** S-1/kp-end
5279 :PROPERTIES:
5280 :CUSTOM_ID: c6a7978b-a5cf-4ae7-b1d2-57ea72adb487
5281 :END:
5282 *** C-M-1/kp-end
5283 :PROPERTIES:
5284 :CUSTOM_ID: 376b8b84-ae1b-4bff-b1c8-263049186637
5285 :END:
5286 *** C-S-1/kp-end
5287 :PROPERTIES:
5288 :CUSTOM_ID: 4e8081cb-5692-4d2e-8657-c6c7931046fd
5289 :END:
5290 *** 2/kp-down
5291 :PROPERTIES:
5292 :CUSTOM_ID: a1108fd9-0df0-43ac-9dbb-0402d24f5b57
5293 :END:
5294 *** C-2/kp-down
5295 :PROPERTIES:
5296 :CUSTOM_ID: e9fe4916-14f5-4dc6-8dba-ed982b7172a1
5297 :END:
5298 *** M-2/kp-down
5299 :PROPERTIES:
5300 :CUSTOM_ID: 50db5a06-452e-491f-875b-3de936a4d04a
5301 :END:
5302 #+begin_src emacs-lisp
5303 ;; for when we have a standard keyboard which is not remapped
5304 (global-set-key (kbd "M-2") 'smex)
5305
5306 #+end_src
5307
5308 *** S-2/kp-down
5309 :PROPERTIES:
5310 :CUSTOM_ID: c3ad691b-0082-46f3-8588-ef2223eab643
5311 :END:
5312 *** C-M-2/kp-down
5313 :PROPERTIES:
5314 :CUSTOM_ID: 90963055-086b-4d96-8131-d890ff3cb597
5315 :END:
5316 *** C-S-2/kp-down
5317 :PROPERTIES:
5318 :CUSTOM_ID: 4d13741e-2207-4d2c-a719-e818bb9f3419
5319 :END:
5320 *** 3/kp-next
5321 :PROPERTIES:
5322 :CUSTOM_ID: b441f9e2-d035-4907-b947-0f3b4d6d062d
5323 :END:
5324 *** C-3/kp-next
5325 :PROPERTIES:
5326 :CUSTOM_ID: 3ea6ff26-4db4-46c8-b681-e08acd9b6a06
5327 :END:
5328 *** M-3/kp-next
5329 :PROPERTIES:
5330 :CUSTOM_ID: a376d2fb-999d-48fd-8c9e-36b7661c5ba7
5331 :END:
5332 *** S-3/kp-next
5333 :PROPERTIES:
5334 :CUSTOM_ID: 50b8356c-7ba5-4e89-b4d6-618f6c571678
5335 :END:
5336 *** C-M-3/kp-next
5337 :PROPERTIES:
5338 :CUSTOM_ID: cd997379-f611-4d06-91c7-ed6cabb618ee
5339 :END:
5340 *** C-S-3/kp-next
5341 :PROPERTIES:
5342 :CUSTOM_ID: 1c8941c9-3025-4dff-bcf3-09d8de44f44f
5343 :END:
5344 *** 4/kp-left
5345 :PROPERTIES:
5346 :ID: bef4fed5-5338-4c66-a759-13dc20ab9bfb
5347 :CUSTOM_ID: c44d0f65-9502-4cc6-9642-96d907f6b093
5348 :END:
5349 indent-region
5350 #+begin_src emacs-lisp
5351 (global-set-key (kbd "<kp-left>") 'indent-region)
5352 #+end_src
5353 *** C-4/kp-left
5354 :PROPERTIES:
5355 :CUSTOM_ID: dd0cd32a-1d62-4b19-9d4f-ee242fb7c7b9
5356 :END:
5357 *** M-4/kp-left
5358 :PROPERTIES:
5359 :CUSTOM_ID: 4f7c3799-28a7-4fc2-85fc-16d768d2047c
5360 :END:
5361 *** S-4/kp-left
5362 :PROPERTIES:
5363 :CUSTOM_ID: f84a7347-f88a-4888-bf5d-e15b98b5c3a2
5364 :END:
5365 *** C-M-4/kp-left
5366 :PROPERTIES:
5367 :CUSTOM_ID: 74a1afca-bd24-469b-93e9-7a9681a9e467
5368 :END:
5369 *** C-S-4/kp-left
5370 :PROPERTIES:
5371 :CUSTOM_ID: 6c822a4a-0e64-430b-8d21-46b387911f2f
5372 :END:
5373 *** 5/kp-begin
5374 :PROPERTIES:
5375 :ID: 0e93f6a0-3d6f-45b1-b14e-10abbdfa3ee4
5376 :CUSTOM_ID: 2458c6bc-7113-4d4b-bbdf-206e1cb842a7
5377 :END:
5378 mark-defun
5379 #+begin_src emacs-lisp
5380 (global-set-key (kbd "<kp-begin>") 'mark-defun)
5381 #+end_src
5382 *** C-5/kp-begin
5383 :PROPERTIES:
5384 :CUSTOM_ID: 39588066-77b8-4863-be0d-0f1fad8f0e2a
5385 :END:
5386 *** M-5/kp-begin
5387 :PROPERTIES:
5388 :CUSTOM_ID: b3542b42-9d71-4a3f-92b1-f79f275bcf52
5389 :END:
5390 *** S-5/kp-begin
5391 :PROPERTIES:
5392 :CUSTOM_ID: 66aed3e7-d7bb-4393-a95b-b90b3a410684
5393 :END:
5394 *** C-M-5/kp-begin
5395 :PROPERTIES:
5396 :CUSTOM_ID: 1060d464-eed3-4a17-a5c4-d8e8941f6925
5397 :END:
5398 *** C-S-5/kp-begin
5399 :PROPERTIES:
5400 :CUSTOM_ID: efd7867a-a87f-43ef-a849-0e4029431d7f
5401 :END:
5402 *** 6/kp-right
5403 :PROPERTIES:
5404 :ID: d156225a-b48e-45e2-80a7-ea1a7dbbc794
5405 :CUSTOM_ID: 3b79bc58-6067-43bd-9471-9d592744a25a
5406 :END:
5407 ibuffer
5408 #+begin_src emacs-lisp
5409 (global-set-key (kbd "<kp-right>") 'ibuffer)
5410 #+end_src
5411 *** C-6/kp-right
5412 :PROPERTIES:
5413 :CUSTOM_ID: 5592b3d3-7ade-4486-ac94-aed0aa3d78f5
5414 :END:
5415 *** M-6/kp-right
5416 :PROPERTIES:
5417 :CUSTOM_ID: c76bedd9-90a7-41fe-9327-607f88f60a3a
5418 :END:
5419 *** S-6/kp-right
5420 :PROPERTIES:
5421 :CUSTOM_ID: 8bbda9a2-7909-44fb-af24-a86dbbd5d16f
5422 :END:
5423 *** C-M-6/kp-right
5424 :PROPERTIES:
5425 :CUSTOM_ID: 7c5838f6-5cc9-4bbc-bd07-403cc009cf35
5426 :END:
5427 *** C-S-6/kp-right
5428 :PROPERTIES:
5429 :CUSTOM_ID: c6f2edc9-ffd3-400f-8014-bb92ea6e520b
5430 :END:
5431 *** 7/kp-home
5432 :PROPERTIES:
5433 :CUSTOM_ID: c98ba390-f2e3-4c14-8d41-142b54e76d77
5434 :END:
5435 *** C-7/kp-home
5436 :PROPERTIES:
5437 :CUSTOM_ID: 5597d00f-4a89-4af2-aac1-98808763744c
5438 :END:
5439 *** M-7/kp-home
5440 :PROPERTIES:
5441 :CUSTOM_ID: 5cbafd0e-0c8f-4e14-a24e-f847c341e5c1
5442 :END:
5443 *** S-7/kp-home
5444 :PROPERTIES:
5445 :CUSTOM_ID: 92f7d836-ae32-4bba-9120-72e747feb832
5446 :END:
5447 *** C-M-7/kp-home
5448 :PROPERTIES:
5449 :CUSTOM_ID: 30170d01-412e-4098-b27e-ed9294d8cf92
5450 :END:
5451 *** C-S-7/kp-home
5452 :PROPERTIES:
5453 :CUSTOM_ID: 81300d39-e60e-4b09-865e-584153f3b827
5454 :END:
5455 *** 8/kp-up
5456 :PROPERTIES:
5457 :CUSTOM_ID: 0591db2b-6c5c-4438-9451-dcd686170c9d
5458 :END:
5459 *** C-8/kp-up
5460 :PROPERTIES:
5461 :CUSTOM_ID: 028ad953-1641-4f0c-83c2-72787310e447
5462 :END:
5463 *** M-8/kp-up
5464 :PROPERTIES:
5465 :CUSTOM_ID: 7c55f717-1093-48a7-b764-8f788540a4d7
5466 :END:
5467 *** S-8/kp-up
5468 :PROPERTIES:
5469 :CUSTOM_ID: f477fa15-3f04-48f6-a66a-4ba6eb0475f1
5470 :END:
5471 *** C-M-8/kp-up
5472 :PROPERTIES:
5473 :CUSTOM_ID: f280c9ab-49a8-4399-987b-bfde07c339be
5474 :END:
5475 *** C-S-8/kp-up
5476 :PROPERTIES:
5477 :CUSTOM_ID: 68a316aa-a05d-4ab0-87e4-88e8f2613795
5478 :END:
5479 *** 9/kp-prior
5480 :PROPERTIES:
5481 :ID: f3c60889-d948-4144-b5b0-04aeeec95309
5482 :CUSTOM_ID: a3b51adb-4405-4d9f-9b88-a8faa479fbe7
5483 :END:
5484 delete-horizontal-space
5485 #+begin_src emacs-lisp
5486 (global-set-key (kbd "<kp-prior>") 'delete-horizontal-space)
5487 #+end_src
5488 *** C-9/kp-prior
5489 :PROPERTIES:
5490 :CUSTOM_ID: 2683f49c-a465-42d0-b85b-6aa345ac2213
5491 :END:
5492 *** M-9/kp-prior
5493 :PROPERTIES:
5494 :CUSTOM_ID: 91b0ee09-9eba-4b60-b05f-720eaca53065
5495 :END:
5496 *** S-9/kp-prior
5497 :PROPERTIES:
5498 :CUSTOM_ID: b79e626c-4425-409f-92ce-b88335629c34
5499 :END:
5500 *** C-M-9/kp-prior
5501 :PROPERTIES:
5502 :CUSTOM_ID: 4838285f-905b-4e18-8605-ff24a20ce9e1
5503 :END:
5504 *** C-S-9/kp-prior
5505 :PROPERTIES:
5506 :CUSTOM_ID: 763edfac-da7d-4360-a383-6a7f42cc2e02
5507 :END:
5508 *** 10/kp-insert
5509 :PROPERTIES:
5510 :CUSTOM_ID: 57e1a794-26f8-4fb6-b753-ef1ad1ff0af9
5511 :END:
5512 *** C-10/kp-insert
5513 :PROPERTIES:
5514 :CUSTOM_ID: 32426751-f87b-4fd5-b435-914ac8f54e5f
5515 :END:
5516 *** M-10/kp-insert
5517 :PROPERTIES:
5518 :CUSTOM_ID: 1b83659c-61dc-425f-bead-fc2a0d198dde
5519 :END:
5520 *** S-10/kp-insert
5521 :PROPERTIES:
5522 :CUSTOM_ID: d2f07180-2d20-4633-9c79-78f4d992f7a6
5523 :END:
5524 *** C-M-10/kp-insert
5525 :PROPERTIES:
5526 :CUSTOM_ID: 1f6eabdc-703c-4a05-829c-553ccf7d082d
5527 :END:
5528 *** C-S-10/kp-insert
5529 :PROPERTIES:
5530 :CUSTOM_ID: bb361418-370f-4b15-b7e1-8e85c7a6f032
5531 :END:
5532 *** 11/kp-subtract
5533 :PROPERTIES:
5534 :CUSTOM_ID: 0f84dddc-a1d2-428d-8c17-cf9ddbd24784
5535 :END:
5536 *** C-11/kp-subtract
5537 :PROPERTIES:
5538 :CUSTOM_ID: 4c3309ee-eb67-43ff-bc4a-44574b1c5e0f
5539 :END:
5540 *** M-11/kp-subtract
5541 :PROPERTIES:
5542 :CUSTOM_ID: e95a2822-5f0d-4b32-a17f-15d4650e086f
5543 :END:
5544 *** S-11/kp-subtract
5545 :PROPERTIES:
5546 :CUSTOM_ID: 667a9853-38c6-4bb2-8c01-6a30075929b4
5547 :END:
5548 *** C-M-11/kp-subtract
5549 :PROPERTIES:
5550 :CUSTOM_ID: d5b17698-9bfe-4bd7-af26-b5dd51684e7d
5551 :END:
5552 *** C-S-11/kp-subtract
5553 :PROPERTIES:
5554 :CUSTOM_ID: cfde57be-a728-4955-8b96-9ae5aa1cce01
5555 :END:
5556 *** 12/kp-add
5557 :PROPERTIES:
5558 :CUSTOM_ID: 5e7a0116-a847-4fec-81ed-a0286bb08ac5
5559 :END:
5560 *** C-12/kp-add
5561 :PROPERTIES:
5562 :CUSTOM_ID: 41dcdb69-8436-495b-9e55-a0cd623ac5aa
5563 :END:
5564 *** M-12/kp-add
5565 :PROPERTIES:
5566 :CUSTOM_ID: ebda57a2-cab3-4fed-b3b0-014a7e60c96f
5567 :END:
5568 *** S-12/kp-add
5569 :PROPERTIES:
5570 :CUSTOM_ID: 7e4c6085-cfbe-4c05-9edb-2aec2325f7b9
5571 :END:
5572 *** C-M-12/kp-add
5573 :PROPERTIES:
5574 :CUSTOM_ID: 7904cafb-7371-4bc9-a661-262d78f8f9b8
5575 :END:
5576 *** C-S-12/kp-add
5577 :PROPERTIES:
5578 :CUSTOM_ID: dcf498f0-5bcf-4402-bce0-561c11effb38
5579 :END:
5580 *** scroll
5581 :PROPERTIES:
5582 :CUSTOM_ID: 33433f0f-5b0e-46ba-8452-d2a51e54769b
5583 :END:
5584 up/dn / scroll
5585 on standard mouse, this scrolls,
5586 because we have the accuracy to pick things up and
5587 down easier, and because it is familiar.
5588 *** [C-scroll] :drill:
5589 SCHEDULED: <2014-03-27 Thu>
5590 :PROPERTIES:
5591 cycle recent buffers
5592 :ID: 678b14e8-e991-46da-84a0-50d142ecbbba
5593 :CUSTOM_ID: 16506ba5-e8f2-4aec-bc1b-d2854d4e504c
5594 :DRILL_LAST_INTERVAL: 50.6823
5595 :DRILL_REPEATS_SINCE_FAIL: 3
5596 :DRILL_TOTAL_REPEATS: 3
5597 :DRILL_FAILURE_COUNT: 0
5598 :DRILL_AVERAGE_QUALITY: 5.0
5599 :DRILL_EASE: 5.815
5600 :DRILL_LAST_QUALITY: 5
5601 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:36>
5602 :END:
5603 cursor up/down fast
5604 [
5605 #+begin_src emacs-lisp
5606 ;; compiling warns that next-line should be called interactively,
5607 ;; but we would have to do something dumb, like give it a
5608 ;; vector of keys in order to supply the 8 argument
5609 (defun down-fast ()
5610 (interactive)
5611 (next-line 8))
5612 (defun up-fast ()
5613 (interactive)
5614 (next-line -8))
5615
5616 (global-set-key (kbd "<C-up>") 'up-fast)
5617 (global-set-key (kbd "<C-down>") 'down-fast)
5618
5619 (add-hook 'comint-mode-hook
5620 (lambda ()
5621 (define-key comint-mode-map (kbd "<C-mouse-4>") 'comint-previous-prompt)
5622 (define-key comint-mode-map (kbd "<C-mouse-5>") 'comint-next-prompt)))
5623 #+end_src
5624 ]
5625
5626 *** [M-scroll]
5627 :PROPERTIES:
5628 :CUSTOM_ID: e1e2e253-450d-4620-af9e-78d378f49ad5
5629 :END:
5630 forward/back s-exp
5631 [
5632 #+begin_src emacs-lisp
5633 (global-set-key (kbd "<M-mouse-4>") 'backward-sexp)
5634 (global-set-key (kbd "<M-mouse-5>") 'forward-sexp)
5635 #+end_src
5636 ]
5637 *** [S-scroll] :drill:
5638 SCHEDULED: <2014-03-22 Sat>
5639 :PROPERTIES:
5640 expand region
5641 :ID: c2da442e-b8c0-4b8a-899f-989af89bd857
5642 :CUSTOM_ID: 74b2196a-345d-453a-b7be-1915360eb201
5643 :DRILL_LAST_INTERVAL: 27.0855
5644 :DRILL_REPEATS_SINCE_FAIL: 5
5645 :DRILL_TOTAL_REPEATS: 5
5646 :DRILL_FAILURE_COUNT: 2
5647 :DRILL_AVERAGE_QUALITY: 3.4
5648 :DRILL_EASE: 2.666
5649 :DRILL_LAST_QUALITY: 4
5650 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 02:26>
5651 :END:
5652 expand/contract region
5653 [
5654 #+begin_src emacs-lisp
5655 (global-set-key (kbd "<S-mouse-13>") 'my-contract-region)
5656 (global-set-key (kbd "<S-mouse-14>") 'er/expand-region)
5657 (global-set-key (kbd "<S-mouse-4>") 'my-contract-region)
5658 (global-set-key (kbd "<S-mouse-5>") 'er/expand-region)
5659 (global-set-key (kbd "<S-up>") 'my-contract-region)
5660 (global-set-key (kbd "<S-down>") 'er/expand-region)
5661
5662 (defun my-contract-region (arg)
5663 (interactive "p")
5664 (let ((current-prefix-arg '-))
5665 (call-interactively 'er/expand-region)))
5666 #+end_src
5667 ]
5668 *** [C-M-scroll] :drill:
5669 SCHEDULED: <2014-03-27 Thu>
5670 :PROPERTIES:
5671 scroll
5672 :ID: b94d89ed-5a06-4916-b5f5-e0bf1a552362
5673 :CUSTOM_ID: bd2ca117-408c-49fc-a5ac-a938be21dfc0
5674 :DRILL_LAST_INTERVAL: 50.6823
5675 :DRILL_REPEATS_SINCE_FAIL: 3
5676 :DRILL_TOTAL_REPEATS: 3
5677 :DRILL_FAILURE_COUNT: 0
5678 :DRILL_AVERAGE_QUALITY: 5.0
5679 :DRILL_EASE: 5.815
5680 :DRILL_LAST_QUALITY: 5
5681 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
5682 :END:
5683 scroll
5684 [
5685 background: I originally tried to make c-scroll be scroll
5686 , but this made
5687 for better compatibility with the standard mouse
5688 #+begin_src emacs-lisp
5689 (global-set-key (kbd "<C-M-mouse-4>") 'mwheel-scroll)
5690 (global-set-key (kbd "<C-M-mouse-5>") 'mwheel-scroll)
5691 ; (require 'smooth-scroll)
5692 ; (smooth-scroll-mode nil)
5693 ; (global-set-key (kbd "<C-M-mouse-4>") 'scroll-up-1)
5694 ;(global-set-key (kbd "<C-M-mouse-5>") 'scroll-down-1)
5695 #+end_src
5696 ]
5697 *** [C-S-scroll] :drill:
5698 SCHEDULED: <2014-03-18 Tue>
5699 :PROPERTIES:
5700 zoom
5701 :ID: 368f60cb-91e5-4694-b342-e0049e5d3e2c
5702 :CUSTOM_ID: a69254a4-cf2d-450f-b477-2694b44a7e0d
5703 :DRILL_LAST_INTERVAL: 9.2113
5704 :DRILL_REPEATS_SINCE_FAIL: 3
5705 :DRILL_TOTAL_REPEATS: 7
5706 :DRILL_FAILURE_COUNT: 3
5707 :DRILL_AVERAGE_QUALITY: 2.943
5708 :DRILL_EASE: 2.429
5709 :DRILL_LAST_QUALITY: 3
5710 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:34>
5711 :END:
5712 increase / decrease text size
5713 [
5714 #+begin_src emacs-lisp
5715 (global-set-key (kbd "<C-S-mouse-4>") 'text-scale-increase)
5716 (global-set-key (kbd "<C-S-mouse-5>") 'text-scale-decrease)
5717 (global-set-key (kbd "<C-S-mouse-13>") 'text-scale-increase)
5718 (global-set-key (kbd "<C-S-mouse-14>") 'text-scale-decrease)
5719 (global-set-key (kbd "<C-S-down>") 'text-scale-increase)
5720 (global-set-key (kbd "<C-S-up>") 'text-scale-decrease)
5721 #+end_src
5722 ]
5723 *** left-scroll
5724 :PROPERTIES:
5725 :CUSTOM_ID: d2d5c5c7-f0de-4e08-953b-d41d3e282ba7
5726 :END:
5727 left/right
5728 *** [C-left-scroll] :drill:
5729 SCHEDULED: <2014-03-27 Thu>
5730 :PROPERTIES:
5731 :CUSTOM_ID: 7bb95aa5-381e-454a-a6c6-aaeec728db08
5732 :ID: 04bdffa0-52fe-4d90-a222-a6e41d75b13b
5733 :DRILL_LAST_INTERVAL: 50.6823
5734 :DRILL_REPEATS_SINCE_FAIL: 3
5735 :DRILL_TOTAL_REPEATS: 3
5736 :DRILL_FAILURE_COUNT: 0
5737 :DRILL_AVERAGE_QUALITY: 5.0
5738 :DRILL_EASE: 5.815
5739 :DRILL_LAST_QUALITY: 5
5740 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:35>
5741 :END:
5742 back / forward word
5743 #+begin_src emacs-lisp
5744 (global-set-key (kbd "<C-left>") 'backward-symbol)
5745 (global-set-key (kbd "<C-right>") 'forward-symbol)
5746 #+end_src
5747 *** [M-left-scroll] :drill:
5748 :PROPERTIES:
5749 winner undo redo
5750 :CUSTOM_ID: 49db3764-b154-4cfc-8d0d-f0e0451815e3
5751 :ID: 97ef29fd-aea5-49ce-aff2-7a8c8d1b3d5d
5752 :DRILL_LAST_INTERVAL: 0.0
5753 :DRILL_REPEATS_SINCE_FAIL: 0
5754 :DRILL_TOTAL_REPEATS: 9
5755 :DRILL_FAILURE_COUNT: 10
5756 :DRILL_AVERAGE_QUALITY: 2.518
5757 :DRILL_EASE: 2.225
5758 :DRILL_LAST_QUALITY: 2
5759 :DRILL_LAST_REVIEWED: <2014-04-14 Mon 11:30>
5760 :END:
5761
5762 *** S-left-scroll
5763 :PROPERTIES:
5764 :CUSTOM_ID: ca5cdcd4-b3da-4d7b-86ab-4c7c0ac2caf7
5765 :END:
5766 ---
5767 unreachable
5768 *** C-M-left-scroll
5769 unreachable
5770 *** C-S-left-scroll
5771 :PROPERTIES:
5772 :CUSTOM_ID: 7b4f1f49-6d93-4210-a30c-8278d6e63655
5773 :ID: b6ea3b66-d9a6-4a33-ae1c-0464d118f006
5774 :END:
5775 unreachable
5776 ** left primary
5777 *** [C-2] :drill:
5778 SCHEDULED: <2014-04-04 Fri>
5779 :PROPERTIES:
5780 :ID: 845cf47f-22d5-4100-837d-fbc066e33c9c
5781 :CUSTOM_ID: 4f29b011-3844-4a4a-b75d-cdf8f49e9adb
5782 :DRILL_LAST_INTERVAL: 26.3927
5783 :DRILL_REPEATS_SINCE_FAIL: 5
5784 :DRILL_TOTAL_REPEATS: 6
5785 :DRILL_FAILURE_COUNT: 2
5786 :DRILL_AVERAGE_QUALITY: 3.25
5787 :DRILL_EASE: 2.58
5788 :DRILL_LAST_QUALITY: 4
5789 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
5790 :END:
5791 narrow-to-defun/subtree
5792 [
5793 #+begin_src emacs-lisp
5794 (global-unset-key (kbd "C-2"))
5795 (defun copy-symbol (&optional arg)
5796 "Copy symbol at point into kill-ring"
5797 (interactive "P")
5798 (kill-new (thing-at-point 'symbol)))
5799
5800 (global-set-key (kbd "C-2") 'copy-symbol)
5801
5802 (global-set-key (kbd "C-4") 'narrow-to-defun)
5803 (add-hook 'org-mode-hook
5804 (lambda () (local-set-key (kbd "C-4") 'org-narrow-to-subtree)))
5805 #+end_src
5806 ]
5807 *** M-2
5808 :PROPERTIES:
5809 :CUSTOM_ID: 53ecfda2-d9f6-4882-b7a2-9b3c859e3bcb
5810 :END:
5811 *** [C-M-2]
5812 :PROPERTIES:
5813 :CUSTOM_ID: 33c4996d-92bc-4df0-b005-11553677be13
5814 :END:
5815 ---
5816 [
5817 #+begin_src emacs-lisp
5818 (global-unset-key (kbd "C-M-2"))
5819 #+end_src
5820 ]
5821 *** C-S-2
5822 :PROPERTIES:
5823 :CUSTOM_ID: 43af8e87-216d-47f7-9779-48ef66c7ca5f
5824 :END:
5825 *** [C-3] :drill:
5826 SCHEDULED: <2014-03-27 Thu>
5827 :PROPERTIES:
5828 :ID: 9495ba60-017a-49b0-b0b6-366c3334e909
5829 :CUSTOM_ID: 7851a05e-7177-4a8f-af5a-3325a8f116fe
5830 :DRILL_LAST_INTERVAL: 50.6823
5831 :DRILL_REPEATS_SINCE_FAIL: 3
5832 :DRILL_TOTAL_REPEATS: 3
5833 :DRILL_FAILURE_COUNT: 0
5834 :DRILL_AVERAGE_QUALITY: 5.0
5835 :DRILL_EASE: 5.815
5836 :DRILL_LAST_QUALITY: 5
5837 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
5838 :END:
5839 dot-mode-execute
5840 [
5841 #+begin_src emacs-lisp
5842 (global-set-key (kbd "C-3") 'dot-mode-execute)
5843 #+end_src
5844 ]
5845 *** M-3
5846 :PROPERTIES:
5847 :CUSTOM_ID: ddceb843-06db-4078-914f-da225cac107e
5848 :END:
5849 *** [C-M-3] :drill:
5850 SCHEDULED: <2014-03-11 Tue>
5851 :PROPERTIES:
5852 :CUSTOM_ID: 9a00e17f-a1c9-48fc-b03b-c6a1a3cbda1c
5853 :ID: 75be5945-8bc4-4041-a44f-de2d9af66f4f
5854 :DRILL_LAST_INTERVAL: 19.6736
5855 :DRILL_REPEATS_SINCE_FAIL: 4
5856 :DRILL_TOTAL_REPEATS: 5
5857 :DRILL_FAILURE_COUNT: 1
5858 :DRILL_AVERAGE_QUALITY: 3.4
5859 :DRILL_EASE: 2.666
5860 :DRILL_LAST_QUALITY: 4
5861 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:48>
5862 :END:
5863 recenter-top-bottom
5864 [
5865 #+begin_src emacs-lisp
5866 (global-set-key (kbd "C-M-3") 'recenter-top-bottom)
5867 #+end_src
5868 ]
5869 *** C-S-3
5870 :PROPERTIES:
5871 :CUSTOM_ID: 224cf9b0-2e12-4cc7-a7e1-746784c87777
5872 :END:
5873 *** [C-q] :drill:
5874 SCHEDULED: <2014-03-27 Thu>
5875 :PROPERTIES:
5876 :ID: e7f30a61-8557-4b7e-898c-96db9d649f39
5877 :CUSTOM_ID: 679fd3cd-c43b-409c-be36-4175a5f27cd3
5878 :DRILL_LAST_INTERVAL: 50.6823
5879 :DRILL_REPEATS_SINCE_FAIL: 3
5880 :DRILL_TOTAL_REPEATS: 3
5881 :DRILL_FAILURE_COUNT: 0
5882 :DRILL_AVERAGE_QUALITY: 5.0
5883 :DRILL_EASE: 5.815
5884 :DRILL_LAST_QUALITY: 5
5885 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:42>
5886 :END:
5887 org-cycle, comint previous arg
5888 [
5889 #+begin_src emacs-lisp
5890 (add-hook 'org-mode-hook
5891 (lambda () (define-key org-mode-map (kbd "C-q") 'org-cycle)))
5892 (define-key widget-keymap (kbd "C-q") 'widget-forward)
5893 (add-hook 'comint-mode-hook
5894 (lambda () (define-key comint-mode-map (kbd "C-q") 'comint-insert-previous-argument)))
5895 #+end_src
5896 ]
5897 *** [M-q] :drill:
5898 SCHEDULED: <2014-03-19 Wed>
5899 :PROPERTIES:
5900 org-archive-to-archive-sibling
5901 :CUSTOM_ID: 72bada0e-5d62-4a8f-ae62-4972778ff1bc
5902 :ID: 4c8104f4-9251-4915-b076-6989c7cce3be
5903 :DRILL_LAST_INTERVAL: 10.3717
5904 :DRILL_REPEATS_SINCE_FAIL: 4
5905 :DRILL_TOTAL_REPEATS: 8
5906 :DRILL_FAILURE_COUNT: 6
5907 :DRILL_AVERAGE_QUALITY: 2.6
5908 :DRILL_EASE: 2.266
5909 :DRILL_LAST_QUALITY: 3
5910 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:35>
5911 :END:
5912 org-archive-to-archive-sibling
5913 [
5914 #+begin_src emacs-lisp
5915 (global-set-key (kbd "M-q") 'org-archive-to-archive-sibling)
5916 #+end_src
5917 ]
5918
5919 *** [C-M-q] :drill:
5920 SCHEDULED: <2014-03-12 Wed>
5921 :PROPERTIES:
5922 :ID: ab67e1da-41dd-40bd-96c1-556cafc6b630
5923 :DRILL_LAST_INTERVAL: 9.9427
5924 :DRILL_REPEATS_SINCE_FAIL: 3
5925 :DRILL_TOTAL_REPEATS: 6
5926 :DRILL_FAILURE_COUNT: 2
5927 :DRILL_AVERAGE_QUALITY: 3.104
5928 :DRILL_EASE: 2.506
5929 :DRILL_LAST_QUALITY: 4
5930 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 20:57>
5931 :CUSTOM_ID: 1f5e9b63-7ce0-445c-a426-b41839585d38
5932 :END:
5933 quoted-insert
5934 [
5935 #+begin_src emacs-lisp
5936 (global-set-key (kbd "C-M-q") 'quoted-insert)
5937 #+end_src
5938 ]
5939 *** C-S-q
5940 :PROPERTIES:
5941 :CUSTOM_ID: c16f1753-126b-499b-af0e-669129ccd3ea
5942 :END:
5943 *** [C-w]
5944 :PROPERTIES:
5945 :CUSTOM_ID: 20005b6d-9a9d-4b58-882c-7ce860c7a395
5946 :END:
5947 goto-t.org
5948 [
5949 #+begin_src emacs-lisp
5950 (global-set-key (kbd "C-w") (lambda () (interactive) (goto-buffer-or-find-file "/a/t.org")))
5951 #+end_src
5952 ]
5953 *** [M-w] :drill:
5954 SCHEDULED: <2014-03-18 Tue>
5955 :PROPERTIES:
5956 org-clock-in
5957 :ID: c271d82d-e40a-43c3-9c16-753633c1fc14
5958 :CUSTOM_ID: 331da6e5-7936-4663-8f58-9d8601b5915c
5959 :DRILL_LAST_INTERVAL: 41.7787
5960 :DRILL_REPEATS_SINCE_FAIL: 3
5961 :DRILL_TOTAL_REPEATS: 3
5962 :DRILL_FAILURE_COUNT: 0
5963 :DRILL_AVERAGE_QUALITY: 4.667
5964 :DRILL_EASE: 4.583
5965 :DRILL_LAST_QUALITY: 4
5966 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:36>
5967 :END:
5968 org-clock-in
5969 [
5970 #+begin_src emacs-lisp
5971 (global-set-key (kbd "M-w") 'org-clock-in)
5972 #+end_src
5973 ]
5974 *** C-M-w
5975 :PROPERTIES:
5976 :CUSTOM_ID: cede4936-de2f-404f-a0e6-264f08215a7c
5977 :END:
5978 *** C-S-w
5979 :PROPERTIES:
5980 :CUSTOM_ID: 3465b986-717a-43b4-910f-3d187789c027
5981 :END:
5982 *** [C-e]
5983 copy-line
5984 [
5985 #+begin_src emacs-lisp
5986 ; todo, make repeated calls to this append the kills
5987 (defun copy-line (&optional arg)
5988 "Copy lines (as many as prefix argument) in the kill ring.
5989 Ease of use features:
5990 - Move to start of next line.
5991 - Appends the copy on sequential calls.
5992 - Use newline as last char even on the last line of the buffer.
5993 - If region is active, copy its lines."
5994 (interactive "p")
5995 (let ((beg (line-beginning-position))
5996 (end (line-end-position (or arg 1))))
5997 (when mark-active
5998 (if (> (point) (mark))
5999 (setq beg (save-excursion (goto-char (mark)) (line-beginning-position)))
6000 (setq end (save-excursion (goto-char (mark)) (line-end-position)))))
6001 (if (eq last-command 'copy-line)
6002 (kill-append (buffer-substring beg end) (< end beg))
6003 (kill-ring-save beg end)))
6004 (kill-append "\n" nil)
6005 ;; dun need cuz I have yank-better
6006 ;;(beginning-of-line (or (and arg (1+ arg)) 2))
6007 (if (and arg (not (= 1 arg))) (message "%d lines copied" arg)))
6008
6009 (global-set-key (kbd "C-e") 'copy-line)
6010 #+end_src
6011 :PROPERTIES:
6012 :ID: 4ff8e0ad-15c0-4cb0-b6cc-314e7b5f80c0
6013 :CUSTOM_ID: 24e34f4b-d1e8-4380-933f-ab1f78ebc782
6014 :DRILL_LAST_INTERVAL: 2.4849
6015 :DRILL_REPEATS_SINCE_FAIL: 1
6016 :DRILL_TOTAL_REPEATS: 1
6017 :DRILL_FAILURE_COUNT: 0
6018 :DRILL_AVERAGE_QUALITY: 5.0
6019 :DRILL_EASE: 5.815
6020 :DRILL_LAST_QUALITY: 5
6021 :DRILL_LAST_REVIEWED: <2014-01-11 Sat 01:30>
6022 :END:
6023 ]
6024 *** [M-e] :drill:
6025 SCHEDULED: <2014-04-01 Tue>
6026 :PROPERTIES:
6027 org-clock-in-last
6028 :ID: 39424175-21e2-4126-9a51-dea451497841
6029 :CUSTOM_ID: 0a771449-0cd5-4dc9-82ca-bcac5f7abd17
6030 :DRILL_LAST_INTERVAL: 36.7949
6031 :DRILL_REPEATS_SINCE_FAIL: 4
6032 :DRILL_TOTAL_REPEATS: 4
6033 :DRILL_FAILURE_COUNT: 0
6034 :DRILL_AVERAGE_QUALITY: 4.0
6035 :DRILL_EASE: 3.204
6036 :DRILL_LAST_QUALITY: 3
6037 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:48>
6038 :END:
6039 org-clock-in-last
6040 [
6041 #+begin_src emacs-lisp
6042 (global-set-key (kbd "M-e") 'org-clock-in-last)
6043 #+end_src
6044 ]
6045 *** C-M-e
6046 :PROPERTIES:
6047 :CUSTOM_ID: 4a7a4324-e03d-43dc-8e9c-9622788519fb
6048 :END:
6049 *** C-S-e
6050 :PROPERTIES:
6051 :CUSTOM_ID: e202e1d5-b7ac-4171-b86a-b77592344f30
6052 :END:
6053 *** [C-r] :drill:
6054 SCHEDULED: <2014-04-07 Mon>
6055 :PROPERTIES:
6056 isearch-backward
6057 :ID: 39bcde9c-2b49-401e-9e81-ee42941233bf
6058 :CUSTOM_ID: 5c55f461-f43f-493d-81eb-1ca747175ef1
6059 :DRILL_LAST_INTERVAL: 42.8284
6060 :DRILL_REPEATS_SINCE_FAIL: 4
6061 :DRILL_TOTAL_REPEATS: 4
6062 :DRILL_FAILURE_COUNT: 0
6063 :DRILL_AVERAGE_QUALITY: 4.5
6064 :DRILL_EASE: 4.122
6065 :DRILL_LAST_QUALITY: 5
6066 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
6067 :END:
6068 isearch-backward
6069 [
6070 #+begin_src emacs-lisp
6071 (global-set-key (kbd "C-r") 'isearch-backward)
6072 (add-hook 'comint-mode-hook
6073 (lambda ()
6074 (define-key comint-mode-map (kbd "C-r") 'comint-history-isearch-backward-regexp)))
6075
6076 #+end_src
6077 ]
6078 *** [M-r] :drill:
6079 SCHEDULED: <2014-04-30 Wed>
6080 :PROPERTIES:
6081 org-clock-out
6082 :ID: dc2c7192-6cfb-4c06-bd17-ff2cef3b05a6
6083 :CUSTOM_ID: dd9575bd-e471-418e-9519-4fc2b874ddcd
6084 :DRILL_LAST_INTERVAL: 59.1432
6085 :DRILL_REPEATS_SINCE_FAIL: 4
6086 :DRILL_TOTAL_REPEATS: 4
6087 :DRILL_FAILURE_COUNT: 0
6088 :DRILL_AVERAGE_QUALITY: 4.25
6089 :DRILL_EASE: 3.59
6090 :DRILL_LAST_QUALITY: 3
6091 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
6092 :END:
6093 org-clock-out
6094 [
6095 #+begin_src emacs-lisp
6096 (global-set-key (kbd "M-r") 'org-clock-out)
6097 #+end_src
6098 ]
6099 *** C-M-r
6100 *** C-S-r
6101 :PROPERTIES:
6102 :CUSTOM_ID: 05e2290b-0d2c-407c-9bf0-adc7a008336b
6103 :END:
6104 *** [C-a] :drill:
6105 SCHEDULED: <2014-03-15 Sat>
6106 :PROPERTIES:
6107 copy-all
6108 :CUSTOM_ID: db4b76df-9420-4256-8242-dc44b56d55d7
6109 :ID: f6b2b504-b88d-418b-b6b0-5e0e582bd205
6110 :DRILL_LAST_INTERVAL: 24.4352
6111 :DRILL_REPEATS_SINCE_FAIL: 4
6112 :DRILL_TOTAL_REPEATS: 4
6113 :DRILL_FAILURE_COUNT: 0
6114 :DRILL_AVERAGE_QUALITY: 3.75
6115 :DRILL_EASE: 2.929
6116 :DRILL_LAST_QUALITY: 4
6117 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:39>
6118 :END:
6119 copy buffer
6120 [
6121 #+begin_src emacs-lisp
6122 (defun copy-all ()
6123 "Copy entire buffer to clipboard"
6124 (interactive)
6125 (clipboard-kill-ring-save (point-min) (point-max)))
6126 (global-set-key (kbd "C-a") 'copy-all)
6127 #+end_src
6128 ]
6129 *** [M-a] :drill:
6130 SCHEDULED: <2014-03-27 Thu>
6131 :PROPERTIES:
6132 kmacro-start-macro-or-in...
6133 :ID: 4019514b-abb1-464e-b4c9-d9ca39af2a82
6134 :CUSTOM_ID: e865a1e5-55bf-4a98-a0d0-cb05a88de352
6135 :DRILL_LAST_INTERVAL: 50.6823
6136 :DRILL_REPEATS_SINCE_FAIL: 3
6137 :DRILL_TOTAL_REPEATS: 3
6138 :DRILL_FAILURE_COUNT: 0
6139 :DRILL_AVERAGE_QUALITY: 5.0
6140 :DRILL_EASE: 5.815
6141 :DRILL_LAST_QUALITY: 5
6142 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
6143 :END:
6144 macro record
6145 [
6146 #+begin_src emacs-lisp
6147 (global-set-key (kbd "M-a") 'kmacro-start-macro-or-insert-counter)
6148
6149 #+end_src
6150 ]
6151 *** [C-M-a] :drill:
6152 SCHEDULED: <2014-03-27 Thu>
6153 :PROPERTIES:
6154 kmacro-end-or-call-macro
6155 :ID: 10cdc522-2bea-4601-acf9-ec81a52a34d8
6156 :CUSTOM_ID: c6278a5a-024f-4c80-a8d4-65f127fd24a8
6157 :DRILL_LAST_INTERVAL: 50.6823
6158 :DRILL_REPEATS_SINCE_FAIL: 3
6159 :DRILL_TOTAL_REPEATS: 3
6160 :DRILL_FAILURE_COUNT: 0
6161 :DRILL_AVERAGE_QUALITY: 5.0
6162 :DRILL_EASE: 5.815
6163 :DRILL_LAST_QUALITY: 5
6164 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:35>
6165 :END:
6166 macro end / call
6167 [
6168 #+begin_src emacs-lisp
6169 (global-set-key (kbd "C-M-a") 'kmacro-end-or-call-macro)
6170 (add-hook 'perl-mode-hook (lambda () (define-key perl-mode-map (kbd "C-M-a") nil)))
6171 (add-hook 'LaTeX-mode-hook (lambda () (define-key LaTeX-mode-map (kbd "C-M-a") nil)))
6172 (add-hook 'c-mode-hook
6173 (lambda () (define-key c-mode-map (kbd "C-M-a") nil)))
6174
6175 #+end_src
6176 ]
6177 *** C-S-a
6178 :PROPERTIES:
6179 :CUSTOM_ID: 649a3fe7-3932-475a-b23c-28db9874de27
6180 :END:
6181 *** C-s
6182 :PROPERTIES:
6183 C-x prefix
6184 :ID: e05a67d7-f7ee-4b23-afb1-0053d5eefb4c
6185 :CUSTOM_ID: 01da04da-cdba-493f-892b-c4c064cf937e
6186 :END:
6187 c-x prefix
6188
6189 *** M-s
6190 :PROPERTIES:
6191 :CUSTOM_ID: 5e4bf939-90a1-4ace-a7bf-add95c8596d2
6192 :END:
6193 *** [C-M-s] :drill:
6194 SCHEDULED: <2014-03-18 Tue>
6195 :PROPERTIES:
6196 split-window-vertically
6197 :ID: 18a271e1-c1d2-45e6-aed3-6b81b4b6ea71
6198 :CUSTOM_ID: 4b33022d-27f0-4d21-9931-2e2e692790e8
6199 :DRILL_LAST_INTERVAL: 26.5334
6200 :DRILL_REPEATS_SINCE_FAIL: 4
6201 :DRILL_TOTAL_REPEATS: 4
6202 :DRILL_FAILURE_COUNT: 0
6203 :DRILL_AVERAGE_QUALITY: 3.75
6204 :DRILL_EASE: 2.929
6205 :DRILL_LAST_QUALITY: 3
6206 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:46>
6207 :END:
6208 split-window-vertically
6209 [
6210 #+begin_src emacs-lisp
6211 (global-set-key (kbd "C-M-s") 'split-window-vertically)
6212 #+end_src
6213 ]
6214 *** C-S-s
6215 :PROPERTIES:
6216 :CUSTOM_ID: 901a2445-200c-42f2-91c6-4309d71b39dd
6217 :END:
6218 *** C-d
6219 :PROPERTIES:
6220 :CUSTOM_ID: b699614a-9994-4fe7-b2c6-f0fe81b7ad2b
6221 :END:
6222 C-c prefix
6223 *** [M-d] :drill:
6224 SCHEDULED: <2014-04-05 Sat>
6225 :PROPERTIES:
6226 whitespace-cleanup
6227 :ID: 58f5421a-9df0-44cd-acb9-d018ccdba58c
6228 :CUSTOM_ID: 06bcc5e2-f3a7-41c6-a793-ac6c9813fb6e
6229 :DRILL_LAST_INTERVAL: 27.3693
6230 :DRILL_REPEATS_SINCE_FAIL: 5
6231 :DRILL_TOTAL_REPEATS: 6
6232 :DRILL_FAILURE_COUNT: 2
6233 :DRILL_AVERAGE_QUALITY: 3.417
6234 :DRILL_EASE: 2.676
6235 :DRILL_LAST_QUALITY: 4
6236 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
6237 :END:
6238 whitespace-cleanup
6239 [
6240 #+begin_src emacs-lisp
6241 (global-set-key (kbd "M-d") 'whitespace-cleanup)
6242 #+end_src
6243 ]
6244 *** [C-M-d] :drill:
6245 SCHEDULED: <2014-03-19 Wed>
6246 :PROPERTIES:
6247 swap buffer
6248 :CUSTOM_ID: 8cf6053d-792b-4abd-a3a6-66efd7fbee68
6249 :ID: 747aabec-b164-4813-93c8-92d5c8778635
6250 :DRILL_LAST_INTERVAL: 9.5325
6251 :DRILL_REPEATS_SINCE_FAIL: 4
6252 :DRILL_TOTAL_REPEATS: 10
6253 :DRILL_FAILURE_COUNT: 8
6254 :DRILL_AVERAGE_QUALITY: 2.636
6255 :DRILL_EASE: 2.284
6256 :DRILL_LAST_QUALITY: 3
6257 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:35>
6258 :END:
6259 swap buffer across windows
6260 [
6261 from http://www.emacswiki.org/emacs/TransposeWindows
6262 #+begin_src emacs-lisp
6263 (setq swapping-buffer nil)
6264 (setq swapping-window nil)
6265 (defun swap-buffers-in-windows ()
6266 "Swap buffers between two windows"
6267 (interactive)
6268 (if (and swapping-window
6269 swapping-buffer)
6270 (let ((this-buffer (current-buffer))
6271 (this-window (selected-window)))
6272 (if (and (window-live-p swapping-window)
6273 (buffer-live-p swapping-buffer))
6274 (progn (switch-to-buffer swapping-buffer)
6275 (select-window swapping-window)
6276 (switch-to-buffer this-buffer)
6277 (select-window this-window)
6278 (message "Swapped buffers."))
6279 (message "Old buffer/window killed. Aborting."))
6280 (setq swapping-buffer nil)
6281 (setq swapping-window nil))
6282 (progn
6283 (setq swapping-buffer (current-buffer))
6284 (setq swapping-window (selected-window))
6285 (message "Buffer and window marked for swapping."))))
6286
6287 (global-set-key (kbd "C-M-d") 'swap-buffers-in-windows)
6288 #+end_src
6289 ]
6290 *** C-S-d
6291 :PROPERTIES:
6292 :CUSTOM_ID: d3166178-3d87-4caa-a937-9797fc2b6a39
6293 :END:
6294 *** [C-f]
6295 :PROPERTIES:
6296 :CUSTOM_ID: 2695ed8a-e0d3-4e84-8688-98e3c50723b0
6297 :END:
6298 kill-whole-line
6299 [
6300 #+begin_src emacs-lisp
6301 (global-set-key (kbd "C-f") 'kill-whole-line-wrapper)
6302 (defun kill-whole-line-wrapper (&optional arg)
6303 "If we are at the end of the file, kill backwards instead of doing nothing."
6304 (interactive "P")
6305 (if (= (point) (point-max))
6306 (kill-whole-line -1)
6307 (kill-whole-line arg)))
6308 #+end_src
6309 ]
6310 *** M-f
6311 :PROPERTIES:
6312 :CUSTOM_ID: 869f0aec-c739-4fb7-8e3a-8b55ab637765
6313 :END:
6314 *** [C-M-f]
6315 :PROPERTIES:
6316 :CUSTOM_ID: e7e4dd0b-418f-48ee-b366-9e733e3bec61
6317 :END:
6318 kill rest of line
6319 [
6320 #+begin_src emacs-lisp
6321
6322 (add-hook 'org-mode-hook
6323 (lambda ()
6324 (define-key org-mode-map (kbd "C-M-f") 'org-kill-line)))
6325
6326 (global-set-key (kbd "C-M-f") 'kill-line)
6327 #+end_src
6328 ]
6329 *** C-S-f
6330 :PROPERTIES:
6331 :CUSTOM_ID: a59eb2ca-9439-4836-81f9-384bc8c07739
6332 :END:
6333 *** [C-g]
6334 SCHEDULED: <2014-01-13 Mon>
6335 :PROPERTIES:
6336 other-window / cancel
6337 :ID: a4e9c495-02c1-432e-beba-12a9d4d61e8a
6338 :CUSTOM_ID: 4af40595-7010-4be6-8cfe-a43797ca6e33
6339 :DRILL_LAST_INTERVAL: 2.4849
6340 :DRILL_REPEATS_SINCE_FAIL: 1
6341 :DRILL_TOTAL_REPEATS: 1
6342 :DRILL_FAILURE_COUNT: 0
6343 :DRILL_AVERAGE_QUALITY: 5.0
6344 :DRILL_EASE: 5.815
6345 :DRILL_LAST_QUALITY: 5
6346 :DRILL_LAST_REVIEWED: <2014-01-11 Sat 01:41>
6347 :END:
6348 cancel / other window
6349 [
6350 #+begin_src emacs-lisp
6351 (global-set-key (kbd "C-g") 'other-window)
6352 #+end_src
6353 ]
6354 *** [M-g] :drill:
6355 SCHEDULED: <2014-03-13 Thu>
6356 :PROPERTIES:
6357 abort-recursive-edit
6358 :ID: 1e8e0c57-2885-4c0c-9b94-3ec0c02b706e
6359 :CUSTOM_ID: fb0b343f-fdff-463a-94f4-3152191e17c4
6360 :DRILL_LAST_INTERVAL: 22.1939
6361 :DRILL_REPEATS_SINCE_FAIL: 4
6362 :DRILL_TOTAL_REPEATS: 4
6363 :DRILL_FAILURE_COUNT: 0
6364 :DRILL_AVERAGE_QUALITY: 3.5
6365 :DRILL_EASE: 2.73
6366 :DRILL_LAST_QUALITY: 4
6367 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:33>
6368 :END:
6369 abort-recursive-edit
6370 [
6371 #+begin_src emacs-lisp
6372 (global-set-key (kbd "M-g") 'abort-recursive-edit)
6373 #+end_src
6374 ]
6375 *** [C-M-g]
6376 :PROPERTIES:
6377 :CUSTOM_ID: 327e18af-30b7-47e5-aa53-5f678788b4c1
6378 :END:
6379 gnus
6380 [
6381 #+begin_src emacs-lisp
6382 (global-set-key (kbd "C-M-g") 'gnus)
6383 #+end_src
6384 ]
6385 *** C-S-g
6386 :PROPERTIES:
6387 :CUSTOM_ID: 1d4edc55-7b30-4648-b869-b82f8f1d7b1a
6388 :END:
6389 *** C-z
6390 :PROPERTIES:
6391 undo-tree-undo
6392 :ID: 42d7f2bf-3ba3-488b-b501-bd4680dbb8de
6393 :CUSTOM_ID: 707c4938-a790-4da9-8230-61855ea57d09
6394 :END:
6395 [
6396 #+begin_src emacs-lisp
6397 (global-set-key (kbd "C-z") 'undo-tree-undo)
6398 #+end_src
6399 ]
6400 *** M-z
6401 :PROPERTIES:
6402 :CUSTOM_ID: a01c110e-9970-4571-84ab-379eecc7dd31
6403 :END:
6404 *** [C-M-z]
6405 *** C-S-z
6406 :PROPERTIES:
6407 :CUSTOM_ID: 3d56370d-11cd-4026-8e6b-3ae9b7b51714
6408 :END:
6409 *** C-x
6410 :PROPERTIES:
6411 :CUSTOM_ID: ec1403d3-528e-41b1-a195-5563bc93e124
6412 :END:
6413 kill-region
6414 #+begin_src emacs-lisp
6415 (global-set-key (kbd "C-s") 'kill-region)
6416 #+end_src
6417 *** [M-x] :drill:
6418 SCHEDULED: <2014-03-31 Mon>
6419 :PROPERTIES:
6420 :CUSTOM_ID: bb7c95d5-dd97-439d-bf1f-cdac98d11543
6421 :ID: 909cf249-c2f2-4251-bf18-c990ca9c6ff9
6422 :DRILL_LAST_INTERVAL: 21.5453
6423 :DRILL_REPEATS_SINCE_FAIL: 4
6424 :DRILL_TOTAL_REPEATS: 4
6425 :DRILL_FAILURE_COUNT: 0
6426 :DRILL_AVERAGE_QUALITY: 3.25
6427 :DRILL_EASE: 2.58
6428 :DRILL_LAST_QUALITY: 3
6429 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:33>
6430 :END:
6431 append-next-kill
6432 [
6433 #+begin_src emacs-lisp
6434 (global-set-key (kbd "M-x") 'append-next-kill)
6435 #+end_src
6436 ]
6437 *** [C-M-x] :drill:
6438 SCHEDULED: <2014-03-17 Mon>
6439 :PROPERTIES:
6440 append-next-kill
6441 :ID: b2b60fb4-95a3-4311-8ccd-7132f03ac9a8
6442 :CUSTOM_ID: c988370e-602c-431c-80a9-608459583f8b
6443 :DRILL_LAST_INTERVAL: 26.0772
6444 :DRILL_REPEATS_SINCE_FAIL: 4
6445 :DRILL_TOTAL_REPEATS: 4
6446 :DRILL_FAILURE_COUNT: 1
6447 :DRILL_AVERAGE_QUALITY: 3.5
6448 :DRILL_EASE: 2.73
6449 :DRILL_LAST_QUALITY: 3
6450 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:49>
6451 :END:
6452 cut-to-register
6453 [
6454 #+begin_src emacs-lisp
6455 ;; same args as copy-to-register
6456 (defun cut-to-register (register start end &optional delete-flag region)
6457 (interactive (list (register-read-with-preview "Cut to register: ")
6458 (region-beginning)
6459 (region-end)
6460 current-prefix-arg
6461 t))
6462 (copy-to-register register start end t region))
6463
6464 (global-set-key (kbd "C-M-x") 'cut-to-register)
6465 #+end_src
6466 ]
6467 *** C-S-x
6468 :PROPERTIES:
6469 :CUSTOM_ID: 0ce7383c-0776-407e-9ac5-981d1476f541
6470 :END:
6471 *** C-c
6472 :PROPERTIES:
6473 :ID: 5416e482-6f36-4d35-84c3-49bb184a53e9
6474 :CUSTOM_ID: 400f06e1-8e45-443c-8d7b-3d1bb1176aab
6475 :END:
6476 copy
6477 #+begin_src emacs-lisp
6478 (global-set-key (kbd "C-d") 'kill-ring-save)
6479 (add-hook 'c-mode-hook
6480 (lambda () (define-key c-mode-map (kbd "C-d") nil)))
6481 (add-hook 'comint-mode-hook
6482 (lambda ()
6483 (define-key comint-mode-map (kbd "C-d") nil)))
6484 ;; the base map is shared by many c-modes, like java
6485 (add-hook 'c-mode-hook
6486 (lambda ()
6487 (define-key c-mode-base-map "\C-d" nil)
6488 (define-key c-mode-base-map (kbd "<deletechar>") 'c-electric-delete-forward)))
6489
6490 #+end_src
6491 *** [M-c] :drill:
6492 SCHEDULED: <2014-03-24 Mon>
6493 :PROPERTIES:
6494 org-capture
6495 :ID: bf1cb358-ec72-425d-aebb-0c1f0ece7717
6496 :CUSTOM_ID: f4c3317a-a317-4d04-8cb7-e46d0716bf1d
6497 :DRILL_LAST_INTERVAL: 32.7466
6498 :DRILL_REPEATS_SINCE_FAIL: 4
6499 :DRILL_TOTAL_REPEATS: 4
6500 :DRILL_FAILURE_COUNT: 0
6501 :DRILL_AVERAGE_QUALITY: 4.0
6502 :DRILL_EASE: 3.204
6503 :DRILL_LAST_QUALITY: 4
6504 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:53>
6505 :END:
6506 org-capture
6507 [
6508 #+begin_src emacs-lisp
6509 (define-key global-map "\M-c" 'org-capture)
6510 #+end_src
6511 ]
6512 *** [C-M-c] :drill:
6513 SCHEDULED: <2014-03-24 Mon>
6514 :PROPERTIES:
6515 copy-to-register
6516 :ID: 956fd2ec-ad26-4842-b56c-f2165648c461
6517 :CUSTOM_ID: 0a151d99-47ae-4e8f-8407-82e77d24a3e7
6518 :DRILL_LAST_INTERVAL: 32.7466
6519 :DRILL_REPEATS_SINCE_FAIL: 4
6520 :DRILL_TOTAL_REPEATS: 4
6521 :DRILL_FAILURE_COUNT: 0
6522 :DRILL_AVERAGE_QUALITY: 4.0
6523 :DRILL_EASE: 3.204
6524 :DRILL_LAST_QUALITY: 4
6525 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:51>
6526 :END:
6527 copy-to-register
6528 [
6529 #+begin_src emacs-lisp
6530 (global-set-key (kbd "C-M-c") 'copy-to-register)
6531 #+end_src
6532 ]
6533 *** C-S-c
6534 :PROPERTIES:
6535 :CUSTOM_ID: b78d717f-cfb3-477a-b951-63f523635f5c
6536 :END:
6537 *** C-v
6538 :PROPERTIES:
6539 :CUSTOM_ID: 16411f68-7fe0-49e8-9a73-212471594f9e
6540 :END:
6541 yank
6542 #+begin_src emacs-lisp
6543 (global-set-key (kbd "C-v") 'yank-better)
6544
6545
6546
6547 (defun yank-better (arg)
6548 "Paste, linewise if our kill ends with a newline.
6549 I change the behavior of plain prefix. It makes it not do linewise paste,
6550 because sometimes you want to yank pop and a linewise paste screws that up.
6551 c-u with no number normally makes the point go before the yank.
6552 That is pointless for me, as it would be just as easier and less
6553 thought to pop the mark after yanking cuz it is set to before the mark."
6554 (interactive "*P")
6555 (if (and (not (equal arg '(4))) (string-suffix-p "\n" (current-kill 0 t)))
6556 (beginning-of-line))
6557 (if (and (stringp mode-name) (string= mode-name "Org"))
6558 (call-interactively 'org-yank)
6559 (setq this-command 'yank)
6560 (call-interactively 'yank (and (not (equal arg '(4)))))))
6561
6562 (put 'yank-better 'delete-selection 'yank)
6563 #+end_src
6564 *** [M-v] :drill:
6565 SCHEDULED: <2014-03-11 Tue>
6566 :PROPERTIES:
6567 insert-register
6568 :ID: 7e21df8d-fdf7-47ed-8648-f9d182445145
6569 :CUSTOM_ID: d67f6371-a13f-4a75-8d8c-e4013ff4e131
6570 :DRILL_LAST_INTERVAL: 2.2172
6571 :DRILL_REPEATS_SINCE_FAIL: 1
6572 :DRILL_TOTAL_REPEATS: 5
6573 :DRILL_FAILURE_COUNT: 2
6574 :DRILL_AVERAGE_QUALITY: 2.84
6575 :DRILL_EASE: 2.381
6576 :DRILL_LAST_QUALITY: 3
6577 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:38>
6578 :END:
6579 insert-register
6580 [
6581 #+begin_src emacs-lisp
6582 (global-set-key (kbd "M-v") 'insert-register)
6583 #+end_src
6584 ]
6585 *** [C-M-v] :drill:
6586 SCHEDULED: <2014-05-13 Tue>
6587 :PROPERTIES:
6588 yank pop
6589 :ID: e05d9d8f-1387-44b3-b348-a45cf6083bd2
6590 :CUSTOM_ID: 25f86658-9999-40f7-b3a4-615981751b93
6591 :DRILL_LAST_INTERVAL: 71.5839
6592 :DRILL_REPEATS_SINCE_FAIL: 4
6593 :DRILL_TOTAL_REPEATS: 4
6594 :DRILL_FAILURE_COUNT: 0
6595 :DRILL_AVERAGE_QUALITY: 4.75
6596 :DRILL_EASE: 4.85
6597 :DRILL_LAST_QUALITY: 5
6598 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
6599 :END:
6600 yank-pop
6601 [
6602 #+begin_src emacs-lisp
6603 (global-set-key (kbd "C-M-v") 'yank-pop)
6604 #+end_src
6605 ]
6606 *** C-S-v
6607 :PROPERTIES:
6608 :CUSTOM_ID: 6732ed10-a473-445d-b14a-5f4c17c6a3ef
6609 :END:
6610 *** [C-b] :drill:
6611 SCHEDULED: <2014-03-27 Thu>
6612 :PROPERTIES:
6613 delete-other-windows
6614 :ID: c9309da7-6801-4d94-a21e-140f4b258c28
6615 :CUSTOM_ID: e682305e-0110-4d2f-afbd-2c401bcb9313
6616 :DRILL_LAST_INTERVAL: 50.6823
6617 :DRILL_REPEATS_SINCE_FAIL: 3
6618 :DRILL_TOTAL_REPEATS: 3
6619 :DRILL_FAILURE_COUNT: 0
6620 :DRILL_AVERAGE_QUALITY: 5.0
6621 :DRILL_EASE: 5.815
6622 :DRILL_LAST_QUALITY: 5
6623 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:34>
6624 :END:
6625 delete-other-windows
6626 [
6627 #+begin_src emacs-lisp
6628 (global-set-key (kbd "C-b") 'delete-other-windows)
6629 #+end_src
6630 ]
6631 *** [M-b] :drill:
6632 SCHEDULED: <2014-04-07 Mon>
6633 :PROPERTIES:
6634 isearch-backward-current-symbol
6635 :CUSTOM_ID: 05e3d0db-36dc-455f-8bed-f87886ca6004
6636 :ID: 0272efdb-eb85-485c-b24f-410ceabeb330
6637 :DRILL_LAST_INTERVAL: 28.6736
6638 :DRILL_REPEATS_SINCE_FAIL: 5
6639 :DRILL_TOTAL_REPEATS: 5
6640 :DRILL_FAILURE_COUNT: 1
6641 :DRILL_AVERAGE_QUALITY: 3.4
6642 :DRILL_EASE: 2.666
6643 :DRILL_LAST_QUALITY: 4
6644 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
6645 :END:
6646 isearch-backward-current-symbol
6647 [
6648 #+begin_src emacs-lisp
6649 (global-set-key (kbd "M-b") 'isearch-backward-current-symbol)
6650 #+end_src
6651 ]
6652 *** [C-M-b] :drill:
6653 SCHEDULED: <2014-04-04 Fri>
6654 :PROPERTIES:
6655 isearch-current-symbol
6656 :ID: 235b96a8-e724-419d-8d07-8d0a021213eb
6657 :CUSTOM_ID: 6c63790c-28c1-4b73-96e2-ee859f57e734
6658 :DRILL_LAST_INTERVAL: 40.0706
6659 :DRILL_REPEATS_SINCE_FAIL: 4
6660 :DRILL_TOTAL_REPEATS: 4
6661 :DRILL_FAILURE_COUNT: 0
6662 :DRILL_AVERAGE_QUALITY: 3.75
6663 :DRILL_EASE: 2.929
6664 :DRILL_LAST_QUALITY: 3
6665 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 02:26>
6666 :END:
6667 isearch-current-symbol
6668 [
6669 #+begin_src emacs-lisp
6670 (global-set-key (kbd "C-M-b") 'isearch-current-symbol)
6671 #+end_src
6672 ]
6673 *** C-S-b
6674 :PROPERTIES:
6675 :CUSTOM_ID: a220d7e0-12df-4d37-a57a-266785e7f3c5
6676 :END:
6677 *** [C-tab] :drill:
6678 SCHEDULED: <2014-03-27 Thu>
6679 :PROPERTIES:
6680 yas-insert-snippet
6681 :CUSTOM_ID: edc45592-c69f-4439-8305-48f2c65696c3
6682 :ID: 92eac3e1-0675-4746-a130-7539f9bc213a
6683 :DRILL_LAST_INTERVAL: 50.6823
6684 :DRILL_REPEATS_SINCE_FAIL: 3
6685 :DRILL_TOTAL_REPEATS: 3
6686 :DRILL_FAILURE_COUNT: 0
6687 :DRILL_AVERAGE_QUALITY: 5.0
6688 :DRILL_EASE: 5.815
6689 :DRILL_LAST_QUALITY: 5
6690 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:42>
6691 :END:
6692 ---
6693 [
6694 in terminal, it's just TAB, duplicate keybind.
6695 ]
6696 *** [M-tab] :drill:
6697 SCHEDULED: <2014-03-14 Fri>
6698 :PROPERTIES:
6699 indent line
6700 :ID: 35b77d8a-9e69-4f8e-a2ac-c78fcf6dc1f5
6701 :CUSTOM_ID: 71264957-45fd-455a-a6d1-b08823c02d25
6702 :DRILL_LAST_INTERVAL: 23.0811
6703 :DRILL_REPEATS_SINCE_FAIL: 4
6704 :DRILL_TOTAL_REPEATS: 4
6705 :DRILL_FAILURE_COUNT: 1
6706 :DRILL_AVERAGE_QUALITY: 3.75
6707 :DRILL_EASE: 2.929
6708 :DRILL_LAST_QUALITY: 4
6709 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:35>
6710 :END:
6711 ---
6712 [
6713 in terminal it's duplicated of C-M-i
6714 ]
6715 *** C-M-tab
6716 :PROPERTIES:
6717 :CUSTOM_ID: 33b76824-317c-4657-8a5b-2b126b8f7fc9
6718 :END:
6719 *** C-S-tab
6720 :PROPERTIES:
6721 :CUSTOM_ID: 89d1aeca-47ed-4e4a-89d2-ff70c06e08c8
6722 :END:
6723 *** [C-delete] :drill:
6724 SCHEDULED: <2014-05-13 Tue>
6725 :PROPERTIES:
6726 kill-symbol
6727 :ID: bb7ae41f-8fab-42ee-9338-33dd22d7f173
6728 :CUSTOM_ID: 2688b61d-9fdd-44af-b9bd-b126f0da00bd
6729 :DRILL_LAST_INTERVAL: 71.5839
6730 :DRILL_REPEATS_SINCE_FAIL: 4
6731 :DRILL_TOTAL_REPEATS: 4
6732 :DRILL_FAILURE_COUNT: 0
6733 :DRILL_AVERAGE_QUALITY: 4.75
6734 :DRILL_EASE: 4.85
6735 :DRILL_LAST_QUALITY: 5
6736 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:12>
6737 :END:
6738 kill-symbol
6739 [
6740 #+begin_src emacs-lisp
6741 (global-set-key (kbd "<C-delete>") 'kill-symbol)
6742 (defun kill-symbol (arg)
6743 (interactive "p")
6744 (kill-region (point) (save-excursion (forward-symbol arg) (point))))
6745
6746 #+end_src
6747 ]
6748 *** M-delete
6749 :PROPERTIES:
6750 :CUSTOM_ID: 60747222-b0e5-4983-9bed-e6d44f65483a
6751 :END:
6752 *** [C-M-delete] :drill:
6753 SCHEDULED: <2014-03-24 Mon>
6754 :PROPERTIES:
6755 kill-sexp
6756 kill-sexp
6757 :CUSTOM_ID: 21876759-a8e6-4896-8a08-eda40d0eaff3
6758 :ID: 7f2797e1-dd39-4d0a-8b87-264e2757543b
6759 :DRILL_LAST_INTERVAL: 28.5089
6760 :DRILL_REPEATS_SINCE_FAIL: 5
6761 :DRILL_TOTAL_REPEATS: 5
6762 :DRILL_FAILURE_COUNT: 2
6763 :DRILL_AVERAGE_QUALITY: 3.6
6764 :DRILL_EASE: 2.802
6765 :DRILL_LAST_QUALITY: 4
6766 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 02:27>
6767 :END:
6768 kill-sexp
6769 [
6770 #+begin_src emacs-lisp
6771 (global-set-key (kbd "<C-M-delete>") 'kill-sexp)
6772 #+end_src
6773 ]
6774 *** C-S-delete
6775 :PROPERTIES:
6776 :CUSTOM_ID: 696e9e0f-f717-44cd-90e7-a73d76a58162
6777 :END:
6778
6779 *** [C-left-arrow] :drill:
6780 SCHEDULED: <2014-03-15 Sat>
6781 :PROPERTIES:
6782 compile
6783 :ID: fbc09f29-fb89-479f-b509-255352e4e9d1
6784 :CUSTOM_ID: b15da91f-0786-49d1-b0b9-331b3b94f6ae
6785 :DRILL_LAST_INTERVAL: 24.2738
6786 :DRILL_REPEATS_SINCE_FAIL: 4
6787 :DRILL_TOTAL_REPEATS: 4
6788 :DRILL_FAILURE_COUNT: 1
6789 :DRILL_AVERAGE_QUALITY: 4.0
6790 :DRILL_EASE: 3.204
6791 :DRILL_LAST_QUALITY: 5
6792 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:24>
6793 :END:
6794 compile / comint search
6795 [
6796 #+begin_src emacs-lisp
6797 (defun set-p (var)
6798 (and (bound-and-true-p var)
6799 (not (eq var 'unset))))
6800 (global-set-key (kbd "C-(") 'run)
6801
6802 ;; make compile work from the gtags root dir
6803 (defadvice compile (before pre-compile-advice activate)
6804 (basic-save-buffer)
6805 (when (set-p ggtags-project-root)
6806 (setq-local compile-saved-dir default-directory)
6807 (setq default-directory ggtags-project-root)))
6808 (defadvice compile (after post-compile-advice activate)
6809 (when (bound-and-true-p compile-saved-dir)
6810 (setq default-directory compile-saved-dir)))
6811
6812
6813 (add-hook 'c-mode-hook (lambda () (define-key c-mode-map (kbd "C-(") 'compile)))
6814 (add-hook 'comint-mode-hook
6815 (lambda ()
6816 (define-key isearch-mode-map (kbd "C-(") 'isearch-repeat-backward)
6817 (define-key comint-mode-map (kbd "C-(") 'isearch-backward)))
6818
6819 #+end_src
6820 ]
6821 *** M-left-arrow
6822 :PROPERTIES:
6823 :CUSTOM_ID: 73085b60-95f3-44bf-af71-70d6a7f9b9c6
6824 :END:
6825 *** [C-M-left-arrow] :drill:
6826 SCHEDULED: <2014-03-10 Mon>
6827 :PROPERTIES:
6828 org-shiftup
6829 :CUSTOM_ID: 13faf5d4-34be-4363-948d-4ff04a9f570b
6830 :ID: 39390478-6d33-460e-ab47-0dc6ac4c5249
6831 :DRILL_LAST_INTERVAL: 7.6079
6832 :DRILL_REPEATS_SINCE_FAIL: 3
6833 :DRILL_TOTAL_REPEATS: 7
6834 :DRILL_FAILURE_COUNT: 6
6835 :DRILL_AVERAGE_QUALITY: 2.886
6836 :DRILL_EASE: 2.402
6837 :DRILL_LAST_QUALITY: 3
6838 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:01>
6839 :END:
6840 org-shiftup
6841 [
6842 #+begin_src emacs-lisp
6843 (add-hook 'org-mode-hook
6844 (lambda () (define-key org-mode-map (kbd "C-M-(") 'org-shiftup)))
6845 #+end_src
6846 ]
6847 *** C-S-left-arrow
6848 :PROPERTIES:
6849 :CUSTOM_ID: 4e3a7ead-efb5-46d8-9465-1867d47e5ec2
6850 :END:
6851 *** [C-right-arrow] :drill:
6852 SCHEDULED: <2014-05-13 Tue>
6853 :PROPERTIES:
6854 paste selection
6855 :CUSTOM_ID: 3f3cac16-097d-451a-a14a-da7717d06730
6856 :ID: 1b0ac338-d87b-4a37-b192-bc4305a337cc
6857 :DRILL_LAST_INTERVAL: 71.5839
6858 :DRILL_REPEATS_SINCE_FAIL: 4
6859 :DRILL_TOTAL_REPEATS: 4
6860 :DRILL_FAILURE_COUNT: 0
6861 :DRILL_AVERAGE_QUALITY: 4.75
6862 :DRILL_EASE: 4.85
6863 :DRILL_LAST_QUALITY: 5
6864 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:11>
6865 :END:
6866 keyboard-yank-primary
6867 [
6868 #+begin_src emacs-lisp
6869 (defun keyboard-yank-primary ()
6870 (interactive)
6871 (let ((mouse-yank-at-point t))
6872 (mouse-yank-primary nil)))
6873 ;; paste selection
6874 (global-set-key (kbd "C-)") 'keyboard-yank-primary)
6875 #+end_src
6876 ]
6877 *** M-right-arrow
6878 :PROPERTIES:
6879 :CUSTOM_ID: 97a4513f-6837-47c5-9e2b-354542d67d29
6880 :END:
6881 *** C-M-right-arrow
6882 :PROPERTIES:
6883 org-shiftdown
6884 :CUSTOM_ID: 34e66314-1d97-4eeb-b704-fe0733849ae4
6885 :END:
6886 [
6887 #+begin_src emacs-lisp
6888 (add-hook 'org-mode-hook
6889 (lambda () (define-key org-mode-map (kbd "C-M-)") 'org-shiftdown)))
6890 #+end_src
6891 ]
6892 *** C-S-right-arrow
6893 :PROPERTIES:
6894 :CUSTOM_ID: f441e351-ccd7-4ac1-9a4d-a0a1dd17b73e
6895 :END:
6896 *** [C-backspace] :drill:
6897 SCHEDULED: <2014-05-13 Tue>
6898 :PROPERTIES:
6899 backward-kill-symbol
6900 :CUSTOM_ID: 85bb4701-42e6-4617-8de8-dfb1f03b0358
6901 :ID: 9c0e1f0a-7b45-4670-86a2-9df945142cbe
6902 :DRILL_LAST_INTERVAL: 71.5839
6903 :DRILL_REPEATS_SINCE_FAIL: 4
6904 :DRILL_TOTAL_REPEATS: 4
6905 :DRILL_FAILURE_COUNT: 0
6906 :DRILL_AVERAGE_QUALITY: 4.75
6907 :DRILL_EASE: 4.85
6908 :DRILL_LAST_QUALITY: 5
6909 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:12>
6910 :END:
6911 backward-kill-symbol
6912 [
6913 #+begin_src emacs-lisp
6914 (global-set-key (kbd "<C-backspace>") 'backward-kill-symbol)
6915 (add-hook 'comint-mode-hook
6916 (lambda ()
6917 (define-key comint-mode-map (kbd "<C-backspace>") 'backward-kill-word)))
6918 (defun backward-kill-symbol (arg)
6919 (interactive "p")
6920 (kill-region (point) (save-excursion (backward-symbol arg) (point))))
6921 #+end_src
6922 ]
6923 *** M-backspace
6924 :PROPERTIES:
6925 :CUSTOM_ID: d4b3e996-208a-4b6d-a747-076e56bd7da3
6926 :END:
6927 *** [C-M-backspace] :drill:
6928 SCHEDULED: <2014-03-18 Tue>
6929 :PROPERTIES:
6930 :ID: 1030c81d-2cc2-42ba-8aa5-fe98271a00f2
6931 :DRILL_LAST_INTERVAL: 26.5334
6932 :DRILL_REPEATS_SINCE_FAIL: 4
6933 :DRILL_TOTAL_REPEATS: 4
6934 :DRILL_FAILURE_COUNT: 0
6935 :DRILL_AVERAGE_QUALITY: 3.75
6936 :DRILL_EASE: 2.929
6937 :DRILL_LAST_QUALITY: 3
6938 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:46>
6939 :CUSTOM_ID: 606b0991-7431-4a8a-a909-b872e104cc88
6940 :END:
6941 backward-kill-sexp
6942 [
6943 #+begin_src emacs-lisp
6944 (global-set-key (kbd "<C-M-backspace>") 'backward-kill-sexp)
6945 #+end_src
6946 ]
6947 *** C-S-backspace
6948 :PROPERTIES:
6949 :CUSTOM_ID: 9c826109-76fd-403e-b15e-ceee5f925f6c
6950 :END:
6951 *** C-f7
6952 :PROPERTIES:
6953 :CUSTOM_ID: 8e4b9a2c-35ff-4300-91ff-65d19d6b2fde
6954 :END:
6955 *** M-f7
6956 :PROPERTIES:
6957 :CUSTOM_ID: 390a5b78-f5fe-41b6-bb36-ea9c81806989
6958 :END:
6959 *** C-M-f7
6960 :PROPERTIES:
6961 :CUSTOM_ID: a8e9d8e4-4f29-4da6-a7b8-3d136a3e1c18
6962 :END:
6963 *** C-S-f7
6964 :PROPERTIES:
6965 :CUSTOM_ID: 60bb5cd8-aeb3-4014-81f2-4cee72e9547c
6966 :END:
6967
6968 ** right primary
6969 *** [C-*] :drill:
6970 SCHEDULED: <2014-03-16 Sun>
6971 :PROPERTIES:
6972 split-window-horizontally
6973 :ID: c9f11b06-583f-48e5-8d0a-56107feb0010
6974 :CUSTOM_ID: f745b337-8b65-44cc-849a-5e0953c9ebd9
6975 :DRILL_LAST_INTERVAL: 13.9711
6976 :DRILL_REPEATS_SINCE_FAIL: 4
6977 :DRILL_TOTAL_REPEATS: 6
6978 :DRILL_FAILURE_COUNT: 3
6979 :DRILL_AVERAGE_QUALITY: 2.982
6980 :DRILL_EASE: 2.447
6981 :DRILL_LAST_QUALITY: 4
6982 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:04>
6983 :END:
6984 split-window-horizontally
6985 [
6986 #+begin_src emacs-lisp
6987 (global-set-key (kbd "C-*") 'split-window-horizontally)
6988 #+end_src
6989 ]
6990 *** M-*
6991 *** [C-M-*] :drill:
6992 SCHEDULED: <2014-03-17 Mon>
6993 :PROPERTIES:
6994 calc-dispatch
6995 :CUSTOM_ID: 5dbe3437-7364-4802-b558-00b2d5faacf6
6996 :ID: 2cffe3fb-a21a-4a49-83f8-65218c7a45a2
6997 :DRILL_LAST_INTERVAL: 15.2345
6998 :DRILL_REPEATS_SINCE_FAIL: 4
6999 :DRILL_TOTAL_REPEATS: 7
7000 :DRILL_FAILURE_COUNT: 2
7001 :DRILL_AVERAGE_QUALITY: 2.893
7002 :DRILL_EASE: 2.405
7003 :DRILL_LAST_QUALITY: 3
7004 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
7005 :END:
7006 calc-dispatch
7007 [
7008 #+begin_src emacs-lisp
7009 (global-set-key (kbd "C-M-*") 'calc-dispatch)
7010 #+end_src
7011 ]
7012 *** C-S-*
7013 :PROPERTIES:
7014 :CUSTOM_ID: 8c414142-8a42-46df-9ab2-898f1be636c8
7015 :END:
7016 *** [C-9] :drill:
7017 SCHEDULED: <2014-03-27 Thu>
7018 :PROPERTIES:
7019 :ID: eda4444e-f1c4-4db7-918d-96789f6a0b2b
7020 :CUSTOM_ID: 43d14154-2722-4ba5-b547-1b78c6274ebf
7021 :DRILL_LAST_INTERVAL: 50.6823
7022 :DRILL_REPEATS_SINCE_FAIL: 3
7023 :DRILL_TOTAL_REPEATS: 3
7024 :DRILL_FAILURE_COUNT: 0
7025 :DRILL_AVERAGE_QUALITY: 5.0
7026 :DRILL_EASE: 5.815
7027 :DRILL_LAST_QUALITY: 5
7028 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
7029 :END:
7030 delete-window-or-exit
7031 [
7032 #+begin_src emacs-lisp
7033 (global-set-key (kbd "C-9") 'delete-window-or-exit)
7034
7035 (defun delete-window-or-exit ()
7036 "Delete window or exit emacs."
7037 (interactive)
7038 (if (condition-case nil (delete-window) (error t))
7039 (if (or (boundp 'server-process) (> (length (frame-list)) 1))
7040 (delete-frame)
7041 (save-buffers-kill-terminal t))))
7042
7043 #+end_src
7044 ]
7045 *** [M-9] :drill:
7046 SCHEDULED: <2014-03-12 Wed>
7047 :PROPERTIES:
7048 kill-buffer-and-window
7049 :CUSTOM_ID: 9dc95338-4321-4354-9de2-69409f383a10
7050 :ID: 24b7dd06-c5cc-4264-954f-d8190d44c1bf
7051 :DRILL_LAST_INTERVAL: 20.7344
7052 :DRILL_REPEATS_SINCE_FAIL: 4
7053 :DRILL_TOTAL_REPEATS: 4
7054 :DRILL_FAILURE_COUNT: 0
7055 :DRILL_AVERAGE_QUALITY: 3.75
7056 :DRILL_EASE: 2.928
7057 :DRILL_LAST_QUALITY: 5
7058 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:33>
7059 :END:
7060 kill-buffer
7061 [
7062 #+begin_src emacs-lisp
7063 (defun kill-buffer-no-ido ()
7064 "kill-buffer, avoid the ido remapping"
7065 (interactive)
7066 (kill-buffer))
7067 (global-set-key (kbd "M-9") 'kill-buffer-no-ido)
7068 #+end_src
7069 ]
7070 strangely, in simple mode, this is overridden.
7071 I found this map to override, but it didn't work, so it seems its being bound some other way.
7072 I did a grep of the emacs sources, but couldn't find anything.
7073 (define-key universal-argument-map [?9] nil)
7074
7075 *** [C-M-9] :drill:
7076 SCHEDULED: <2014-03-17 Mon>
7077 :PROPERTIES:
7078 kill client buffer
7079 :ID: 2046ac28-1c06-410b-bdd9-39eaeada50c0
7080 :CUSTOM_ID: ffe9f636-31e5-48ba-b8fe-7c158ace744c
7081 :DRILL_LAST_INTERVAL: 25.6978
7082 :DRILL_REPEATS_SINCE_FAIL: 4
7083 :DRILL_TOTAL_REPEATS: 4
7084 :DRILL_FAILURE_COUNT: 0
7085 :DRILL_AVERAGE_QUALITY: 4.0
7086 :DRILL_EASE: 3.204
7087 :DRILL_LAST_QUALITY: 5
7088 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:41>
7089 :END:
7090 end server edit
7091 ,save & kill buffer it was opened externally via emacsclient
7092
7093 [
7094 #+begin_src emacs-lisp
7095 (defun server-edit-save ()
7096 (interactive)
7097 (save-buffer)
7098 (server-edit))
7099 (global-set-key (kbd "C-M-9") 'server-edit-save)
7100 #+end_src
7101 ]
7102 *** C-S-9
7103 :PROPERTIES:
7104 :CUSTOM_ID: 56d86cb3-cb86-42d8-9516-d7f2e086d88a
7105 :END:
7106 *** [C-u] :drill:
7107 SCHEDULED: <2014-03-27 Thu>
7108 :PROPERTIES:
7109 :ID: a254c137-8a33-440d-b71e-5fbf9a21e2f5
7110 :CUSTOM_ID: 327992c0-6eba-4935-aec1-49871c2a8619
7111 :DRILL_LAST_INTERVAL: 50.6823
7112 :DRILL_REPEATS_SINCE_FAIL: 3
7113 :DRILL_TOTAL_REPEATS: 3
7114 :DRILL_FAILURE_COUNT: 0
7115 :DRILL_AVERAGE_QUALITY: 5.0
7116 :DRILL_EASE: 5.815
7117 :DRILL_LAST_QUALITY: 5
7118 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:45>
7119 :END:
7120 universal-argument
7121 *** M-u
7122 *** [C-M-u] :drill:
7123 SCHEDULED: <2014-03-27 Thu>
7124 :PROPERTIES:
7125 search-keybind
7126 :ID: a2e31aed-143f-4aa2-841b-857729417993
7127 :CUSTOM_ID: 62735d64-b89a-46b7-b32e-2453b651039d
7128 :DRILL_LAST_INTERVAL: 50.6823
7129 :DRILL_REPEATS_SINCE_FAIL: 3
7130 :DRILL_TOTAL_REPEATS: 3
7131 :DRILL_FAILURE_COUNT: 0
7132 :DRILL_AVERAGE_QUALITY: 5.0
7133 :DRILL_EASE: 5.815
7134 :DRILL_LAST_QUALITY: 5
7135 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:43>
7136 :END:
7137 search-keybind
7138 [
7139 #+begin_src emacs-lisp
7140 (global-set-key (kbd "C-M-u") 'search-keybind)
7141
7142 (defun search-keybind (regexp &optional nlines)
7143 (interactive (occur-read-primary-args))
7144 (save-excursion
7145 (describe-bindings)
7146 (set-buffer "*Help*")
7147 (occur regexp)
7148 (delete-windows-on "*Help*")
7149 ))
7150 #+end_src
7151 ]
7152 *** C-S-u
7153 :PROPERTIES:
7154 :CUSTOM_ID: 7f72dfa0-ba8e-4cd5-b25b-8ff6066464e6
7155 :END:
7156 *** C-i
7157 :PROPERTIES:
7158 :CUSTOM_ID: 3124e200-1d6e-4ad2-9a36-0d03e1e7dc38
7159 :END:
7160 -----
7161 *** M-i
7162 :PROPERTIES:
7163 :CUSTOM_ID: 95ab2045-88bf-4656-b8b1-6cebc87b89e0
7164 :END:
7165 *** [C-M-i] :drill:
7166 SCHEDULED: <2014-03-17 Mon>
7167 :PROPERTIES:
7168 query-replace-regexp
7169 :CUSTOM_ID: a3260b61-7c51-4d97-9a91-3ed702c5ae29
7170 :ID: 93f569b8-4bc8-49e1-a38e-ced3d3198ce8
7171 :DRILL_LAST_INTERVAL: 26.3579
7172 :DRILL_REPEATS_SINCE_FAIL: 4
7173 :DRILL_TOTAL_REPEATS: 4
7174 :DRILL_FAILURE_COUNT: 1
7175 :DRILL_AVERAGE_QUALITY: 4.0
7176 :DRILL_EASE: 3.204
7177 :DRILL_LAST_QUALITY: 4
7178 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:45>
7179 :END:
7180 query-replace-regexp
7181 [
7182 #+begin_src emacs-lisp
7183 (global-set-key (kbd "C-M-i") 'query-replace-regexp)
7184 (add-hook 'flyspell-mode-hook
7185 (lambda () (define-key flyspell-mode-map (kbd "C-M-i") nil)))
7186 (add-hook 'text-mode-hook
7187 (lambda () (define-key text-mode-map (kbd "C-M-i") nil)))
7188
7189 #+end_src
7190 ]
7191 *** C-S-i
7192 :PROPERTIES:
7193 :CUSTOM_ID: 076edcc2-040e-4371-9851-4e587766e1fe
7194 :END:
7195 *** [C-o] :drill:
7196 SCHEDULED: <2014-05-13 Tue>
7197 :PROPERTIES:
7198 occur
7199 :ID: a502687a-24b4-4b73-9abc-bc85b89ab235
7200 :CUSTOM_ID: 82215193-63b3-4d63-8f70-d11a328fe72d
7201 :DRILL_LAST_INTERVAL: 71.5839
7202 :DRILL_REPEATS_SINCE_FAIL: 4
7203 :DRILL_TOTAL_REPEATS: 4
7204 :DRILL_FAILURE_COUNT: 0
7205 :DRILL_AVERAGE_QUALITY: 4.75
7206 :DRILL_EASE: 4.85
7207 :DRILL_LAST_QUALITY: 5
7208 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
7209 :END:
7210 occur
7211 [
7212 #+begin_src emacs-lisp
7213 (global-set-key (kbd "C-o") 'occur)
7214 #+end_src
7215 ]
7216 *** M-o
7217 :PROPERTIES:
7218 :CUSTOM_ID: 8c58b99d-b1e4-4270-8d4a-8ae72e2a6470
7219 :END:
7220 *** [C-M-o] :drill:
7221 SCHEDULED: <2014-03-12 Wed>
7222 :PROPERTIES:
7223 ido-goto-symbol
7224 :CUSTOM_ID: 05d1ef50-43ee-46d7-b1ad-dd952543ab45
7225 :ID: 6dfcaa31-d223-4a14-904e-2f2395b2cf75
7226 :DRILL_LAST_INTERVAL: 10.3122
7227 :DRILL_REPEATS_SINCE_FAIL: 4
7228 :DRILL_TOTAL_REPEATS: 9
7229 :DRILL_FAILURE_COUNT: 9
7230 :DRILL_AVERAGE_QUALITY: 2.994
7231 :DRILL_EASE: 2.453
7232 :DRILL_LAST_QUALITY: 4
7233 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
7234 :END:
7235 ido-goto-symbol
7236 [
7237 #+begin_src emacs-lisp
7238 (global-set-key (kbd "C-M-o") 'ido-goto-symbol)
7239 #+end_src
7240 ]
7241 *** C-S-o
7242 :PROPERTIES:
7243 :CUSTOM_ID: 7eacf048-4da8-4b2b-8a51-a4772111e285
7244 :END:
7245 *** [C-p] :drill:
7246 SCHEDULED: <2014-03-15 Sat>
7247 :PROPERTIES:
7248 move-mouse-to-point
7249 :ID: 6b1abcf6-7f95-45c4-a87f-0e86c43c5af1
7250 :CUSTOM_ID: 9c2e2ba9-f34e-48fe-b4ff-b9826882c1cc
7251 :DRILL_LAST_INTERVAL: 23.5247
7252 :DRILL_REPEATS_SINCE_FAIL: 4
7253 :DRILL_TOTAL_REPEATS: 4
7254 :DRILL_FAILURE_COUNT: 0
7255 :DRILL_AVERAGE_QUALITY: 3.5
7256 :DRILL_EASE: 2.73
7257 :DRILL_LAST_QUALITY: 3
7258 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:41>
7259 :END:
7260 move-mouse-to-point
7261 [
7262 #+begin_src emacs-lisp
7263 (global-set-key (kbd "C-p") 'move-mouse-to-point)
7264 #+end_src
7265 ]
7266 *** M-p
7267 *** [C-M-p] :drill:leech:
7268 :PROPERTIES:
7269 delete-horizontal-space
7270 :ID: e2972d5b-28e7-46aa-896f-66d68a6df0de
7271 :CUSTOM_ID: d55616d3-a3f6-4e83-8807-748578a7b726
7272 :DRILL_LAST_INTERVAL: 0.0
7273 :DRILL_REPEATS_SINCE_FAIL: 0
7274 :DRILL_TOTAL_REPEATS: 10
7275 :DRILL_FAILURE_COUNT: 16
7276 :DRILL_AVERAGE_QUALITY: 2.433
7277 :DRILL_EASE: 2.18
7278 :DRILL_LAST_QUALITY: 2
7279 :DRILL_LAST_REVIEWED: <2014-04-14 Mon 11:31>
7280 :END:
7281 delete-horizontal-space
7282 [
7283 #+begin_src emacs-lisp
7284 (global-set-key (kbd "C-M-p") 'delete-horizontal-space)
7285 #+end_src
7286 ]
7287 *** C-S-p
7288 :PROPERTIES:
7289 :CUSTOM_ID: f0cffe8d-d2cb-4f5d-a3f2-fa900e093ef7
7290 :END:
7291 *** [C-j] :drill:
7292 SCHEDULED: <2014-03-15 Sat>
7293 pop-to-mark
7294 [
7295 #+begin_src emacs-lisp
7296 (defun my-pop-to-mark-command ()
7297 "Jump to mark, and pop a new position for mark off the ring.
7298 \(Does not affect global mark ring\)."
7299 (interactive)
7300 (pop-to-mark-command)
7301 (if (and (derived-mode-p 'org-mode) (outline-invisible-p))
7302 (org-show-context 'mark-goto)))
7303
7304 (global-set-key (kbd "C-j") 'my-pop-to-mark-command)
7305 (define-key ido-common-completion-map (kbd "C-j") 'ido-select-text)
7306 (add-hook 'ido-setup-hook
7307 (lambda () (define-key ido-common-completion-map (kbd "C-j") 'ido-select-text)))
7308 (add-hook 'lisp-interaction-mode-hook
7309 (lambda ()
7310 (define-key lisp-interaction-mode-map (kbd "C-j") nil)))
7311
7312 #+end_src
7313 ]
7314 *** [M-j] :drill:
7315 SCHEDULED: <2014-03-13 Thu>
7316 :PROPERTIES:
7317 previous-error
7318 :ID: cb5f0e6f-815d-488f-bfb2-5d31bd5dc215
7319 :CUSTOM_ID: 474a3e12-95ac-4f43-b83a-36716f3e6f76
7320 :DRILL_LAST_INTERVAL: 21.5453
7321 :DRILL_REPEATS_SINCE_FAIL: 4
7322 :DRILL_TOTAL_REPEATS: 4
7323 :DRILL_FAILURE_COUNT: 0
7324 :DRILL_AVERAGE_QUALITY: 3.25
7325 :DRILL_EASE: 2.58
7326 :DRILL_LAST_QUALITY: 3
7327 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:39>
7328 :END:
7329 previous-error
7330 [
7331 #+begin_src emacs-lisp
7332 (global-set-key (kbd "M-j") 'previous-error)
7333 #+end_src
7334 ]
7335 *** [C-M-j]
7336
7337 register prefix
7338 [
7339 :PROPERTIES:
7340 :CUSTOM_ID: ebcf7c71-3c93-431b-af6b-7c5df7f2945e
7341 :ID: d2604f6e-341d-4d57-91c8-ec6f2cdeb901
7342 :DRILL_LAST_INTERVAL: 23.5247
7343 :DRILL_REPEATS_SINCE_FAIL: 4
7344 :DRILL_TOTAL_REPEATS: 4
7345 :DRILL_FAILURE_COUNT: 0
7346 :DRILL_AVERAGE_QUALITY: 3.5
7347 :DRILL_EASE: 2.73
7348 :DRILL_LAST_QUALITY: 3
7349 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:45>
7350 :END:
7351 #+begin_src emacs-lisp
7352 (define-key global-map (kbd "C-M-j") ctl-x-r-map)
7353 (define-key ctl-x-r-map "m" 'kmacro-to-register)
7354 #+end_src
7355 ]
7356
7357 *** C-S-j
7358 :PROPERTIES:
7359 :CUSTOM_ID: 381a6c7c-e763-4d9a-86f5-55a5e0afcee1
7360 :END:
7361 *** [C-k] :drill:
7362 SCHEDULED: <2014-05-13 Tue>
7363 :PROPERTIES:
7364 jump to register
7365 :CUSTOM_ID: 25a7ba1c-ddf3-47f1-9516-914a552e7a36
7366 :ID: 095be13e-f98c-4f42-9353-08329fa47d06
7367 :DRILL_LAST_INTERVAL: 71.5839
7368 :DRILL_REPEATS_SINCE_FAIL: 4
7369 :DRILL_TOTAL_REPEATS: 4
7370 :DRILL_FAILURE_COUNT: 0
7371 :DRILL_AVERAGE_QUALITY: 4.75
7372 :DRILL_EASE: 4.85
7373 :DRILL_LAST_QUALITY: 5
7374 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
7375 :END:
7376 jump-to-register
7377 [
7378 #+begin_src emacs-lisp
7379
7380 (global-set-key (kbd "C-k") 'jump-to-register)
7381 #+end_src
7382 ]
7383 *** [M-k] :drill:
7384 SCHEDULED: <2014-03-15 Sat>
7385 :PROPERTIES:
7386 next-error
7387 :ID: c9f19dcc-4c14-4bdd-b350-c426dff14189
7388 :CUSTOM_ID: a96691bb-9e4c-414b-a093-d9961d453e21
7389 :DRILL_LAST_INTERVAL: 24.4352
7390 :DRILL_REPEATS_SINCE_FAIL: 4
7391 :DRILL_TOTAL_REPEATS: 4
7392 :DRILL_FAILURE_COUNT: 0
7393 :DRILL_AVERAGE_QUALITY: 3.75
7394 :DRILL_EASE: 2.929
7395 :DRILL_LAST_QUALITY: 4
7396 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:40>
7397 :END:
7398 next-error
7399 [
7400 #+begin_src emacs-lisp
7401 (global-set-key (kbd "M-k") 'next-error)
7402 #+end_src
7403 ]
7404 *** [C-M-k] :drill:
7405 SCHEDULED: <2014-03-21 Fri>
7406 :PROPERTIES:
7407 man
7408 :CUSTOM_ID: f61ea4ea-4597-422e-b7e3-d3cfad82603d
7409 :ID: 4c874a82-22dd-4bc2-a0ac-24420c30b888
7410 :DRILL_LAST_INTERVAL: 29.8228
7411 :DRILL_REPEATS_SINCE_FAIL: 4
7412 :DRILL_TOTAL_REPEATS: 4
7413 :DRILL_FAILURE_COUNT: 0
7414 :DRILL_AVERAGE_QUALITY: 4.25
7415 :DRILL_EASE: 3.589
7416 :DRILL_LAST_QUALITY: 5
7417 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:46>
7418 :END:
7419 man
7420 [
7421 #+begin_src emacs-lisp
7422 (global-set-key (kbd "C-M-k") 'man)
7423 #+end_src
7424 ]
7425 *** C-S-k
7426 :PROPERTIES:
7427 :CUSTOM_ID: da51b99a-1782-45ad-92be-f4c0a645bea8
7428 :END:
7429 *** [C-l] :drill:
7430 SCHEDULED: <2014-05-13 Tue>
7431 :PROPERTIES:
7432 ido-switch-buffer
7433 :ID: 3c7fabd9-572d-4945-ab4b-d7a8dc2cd9c5
7434 :CUSTOM_ID: 8a7572bd-4b5e-4464-b937-3d35adb1783f
7435 :DRILL_LAST_INTERVAL: 71.5839
7436 :DRILL_REPEATS_SINCE_FAIL: 4
7437 :DRILL_TOTAL_REPEATS: 4
7438 :DRILL_FAILURE_COUNT: 0
7439 :DRILL_AVERAGE_QUALITY: 4.75
7440 :DRILL_EASE: 4.85
7441 :DRILL_LAST_QUALITY: 5
7442 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
7443 :END:
7444 ido-switch-buffer
7445 [
7446 #+begin_src emacs-lisp
7447 (global-set-key (kbd "C-l") 'ido-switch-buffer)
7448 #+end_src
7449 ]
7450 *** M-l
7451 :PROPERTIES:
7452 :CUSTOM_ID: 27f47c6c-36ad-430e-b4b0-5e96b635bf36
7453 :END:
7454
7455 *** [C-M-l] :drill:
7456 SCHEDULED: <2014-04-04 Fri>
7457 :PROPERTIES:
7458 move cursor top bottom mid
7459 :ID: 37a3ccad-9b61-44b0-bddb-219a024cd963
7460 :CUSTOM_ID: 24b660d4-3ec4-4416-8a6a-b8224ed1ee8b
7461 :DRILL_LAST_INTERVAL: 25.8141
7462 :DRILL_REPEATS_SINCE_FAIL: 5
7463 :DRILL_TOTAL_REPEATS: 5
7464 :DRILL_FAILURE_COUNT: 1
7465 :DRILL_AVERAGE_QUALITY: 3.0
7466 :DRILL_EASE: 2.456
7467 :DRILL_LAST_QUALITY: 3
7468 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
7469 :END:
7470 move cursor top bottom mid, comint clear screen
7471 [
7472 #+begin_src emacs-lisp
7473 (global-set-key (kbd "C-M-l") 'move-to-window-line-top-bottom)
7474 #+end_src
7475 ]
7476 *** C-S-l
7477 :PROPERTIES:
7478 :CUSTOM_ID: c355178f-c9b4-4ae7-9627-b4117fef45b9
7479 :END:
7480 *** [C-;] :drill:
7481 SCHEDULED: <2014-03-19 Wed>
7482 :PROPERTIES:
7483 comment-dwim
7484 :CUSTOM_ID: 7e3710eb-5460-4460-8bf0-488302e4ce35
7485 :ID: 1c1b7a4a-484b-4faf-ae20-65d096ff2574
7486 :DRILL_LAST_INTERVAL: 27.9041
7487 :DRILL_REPEATS_SINCE_FAIL: 4
7488 :DRILL_TOTAL_REPEATS: 4
7489 :DRILL_FAILURE_COUNT: 0
7490 :DRILL_AVERAGE_QUALITY: 4.0
7491 :DRILL_EASE: 3.204
7492 :DRILL_LAST_QUALITY: 4
7493 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:45>
7494 :END:
7495 used in flyspell, not sure what for, otherwise unbound
7496 *** M-;
7497 :PROPERTIES:
7498 :CUSTOM_ID: 211e76d9-d89a-4cc6-abce-69397d456fda
7499 :END:
7500 comment-dwim
7501 *** [C-M-;] :drill:
7502 SCHEDULED: <2014-04-07 Mon>
7503 :PROPERTIES:
7504 comment-current-line-dwim
7505 :ID: 9ff312cc-f460-4f5d-9e4b-37f7ed538209
7506 :CUSTOM_ID: 28680a96-5223-4632-80b9-b1facdd541e7
7507 :DRILL_LAST_INTERVAL: 42.8284
7508 :DRILL_REPEATS_SINCE_FAIL: 4
7509 :DRILL_TOTAL_REPEATS: 4
7510 :DRILL_FAILURE_COUNT: 0
7511 :DRILL_AVERAGE_QUALITY: 4.5
7512 :DRILL_EASE: 4.122
7513 :DRILL_LAST_QUALITY: 5
7514 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
7515 :END:
7516 comment-current-line-dwim
7517 [
7518 #+begin_src emacs-lisp
7519 (defun comment-current-line-dwim ()
7520 "Comment or uncomment the current line."
7521 (interactive)
7522 (save-excursion
7523 (push-mark (beginning-of-line) t t)
7524 (end-of-line)
7525 (comment-dwim nil))
7526 (move-beginning-of-line 2))
7527 (global-set-key (kbd "C-M-;") 'comment-current-line-dwim)
7528 #+end_src
7529 ]
7530 *** C-S-;
7531 :PROPERTIES:
7532 :CUSTOM_ID: c9f00d6c-f9d2-420f-a08e-21ea78023066
7533 :END:
7534 *** [C-m]
7535 :PROPERTIES:
7536 :CUSTOM_ID: deee53ba-dfa2-4910-894c-55ae98d11aa4
7537 :END:
7538 *** M-m
7539 :PROPERTIES:
7540 :CUSTOM_ID: f7237459-96b6-4de9-937f-5fbfa9ca5b1e
7541 :END:
7542 *** [C-M-m] :drill:
7543 SCHEDULED: <2014-03-11 Tue>
7544 :PROPERTIES:
7545 recursive grep
7546 :CUSTOM_ID: f283f705-cba0-45db-b80f-5d20415b2eee
7547 :ID: b952fa90-b492-4f85-9d8e-5cd24c060b94
7548 :DRILL_LAST_INTERVAL: 9.1491
7549 :DRILL_REPEATS_SINCE_FAIL: 3
7550 :DRILL_TOTAL_REPEATS: 7
7551 :DRILL_FAILURE_COUNT: 3
7552 :DRILL_AVERAGE_QUALITY: 2.924
7553 :DRILL_EASE: 2.42
7554 :DRILL_LAST_QUALITY: 3
7555 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:05>
7556 :END:
7557 recursive grep
7558 [
7559 #+begin_src emacs-lisp
7560 (define-key global-map (kbd "C-M-m") 'rgrep)
7561 #+end_src
7562 ]
7563 *** C-S-m
7564 :PROPERTIES:
7565 :CUSTOM_ID: dd3136a5-5383-4fc7-8c9f-fcbaba251a76
7566 :END:
7567 *** [C-,] :drill:
7568 SCHEDULED: <2014-05-13 Tue>
7569 :PROPERTIES:
7570 ido-find-file
7571 :CUSTOM_ID: 6cbf3a85-f260-453a-920b-850ff5e986b1
7572 :ID: df0f3769-bcfc-4cb9-8943-bb86dafb2711
7573 :DRILL_LAST_INTERVAL: 71.5839
7574 :DRILL_REPEATS_SINCE_FAIL: 4
7575 :DRILL_TOTAL_REPEATS: 4
7576 :DRILL_FAILURE_COUNT: 0
7577 :DRILL_AVERAGE_QUALITY: 4.75
7578 :DRILL_EASE: 4.85
7579 :DRILL_LAST_QUALITY: 5
7580 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
7581 :END:
7582 ido-find-file
7583 [
7584 #+begin_src emacs-lisp
7585 (global-set-key (kbd "C-,") 'ido-find-file)
7586 (add-hook 'flyspell-mode-hook
7587 (lambda () (define-key flyspell-mode-map (kbd "C-,") nil)))
7588 #+end_src
7589 ]
7590 *** M-,
7591 *** [C-M-,] :drill:
7592 SCHEDULED: <2014-03-19 Wed>
7593 :PROPERTIES:
7594 find-file-in-project
7595 :ID: fca85295-0567-4443-ac74-a54b93a2e603
7596 :CUSTOM_ID: bfdf6111-029d-462b-bcca-50a3ed2162d5
7597 :DRILL_LAST_INTERVAL: 24.3844
7598 :DRILL_REPEATS_SINCE_FAIL: 5
7599 :DRILL_TOTAL_REPEATS: 5
7600 :DRILL_FAILURE_COUNT: 2
7601 :DRILL_AVERAGE_QUALITY: 3.0
7602 :DRILL_EASE: 2.456
7603 :DRILL_LAST_QUALITY: 3
7604 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
7605 :END:
7606 find-file-in-project
7607 [
7608 #+begin_src emacs-lisp
7609 (global-set-key (kbd "C-M-,") 'find-file-in-project)
7610 #+end_src
7611 ]
7612 *** C-S-,
7613 :PROPERTIES:
7614 :CUSTOM_ID: 74a86b9e-9a56-4f5e-a6eb-9f2cd09da613
7615 :END:
7616 *** [C-.] :drill:
7617 SCHEDULED: <2014-03-27 Thu>
7618 :PROPERTIES:
7619 recentf-ido-find-file
7620 :CUSTOM_ID: 0675c171-8677-44a8-882c-e7ed42715e31
7621 :ID: a600d171-1964-4a81-a39e-cfac4716f96d
7622 :DRILL_LAST_INTERVAL: 50.6823
7623 :DRILL_REPEATS_SINCE_FAIL: 3
7624 :DRILL_TOTAL_REPEATS: 3
7625 :DRILL_FAILURE_COUNT: 0
7626 :DRILL_AVERAGE_QUALITY: 5.0
7627 :DRILL_EASE: 5.815
7628 :DRILL_LAST_QUALITY: 5
7629 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
7630 :END:
7631 find recent file
7632 [
7633 Taken from starter kit.
7634 #+begin_src emacs-lisp
7635 (defun recentf-ido-find-file ()
7636 "Find a recent file using Ido."
7637 (interactive)
7638 (let* ((file-assoc-list
7639 (mapcar (lambda (x)
7640 (cons (file-name-nondirectory x)
7641 x))
7642 recentf-list))
7643 (filename-list
7644 (remove-duplicates (mapcar #'car file-assoc-list)
7645 :test #'string=))
7646 (filename (ido-completing-read "Choose recent file: "
7647 filename-list
7648 nil
7649 t)))
7650 (when filename
7651 (find-file (cdr (assoc filename
7652 file-assoc-list))))))
7653
7654 (add-hook 'flyspell-mode-hook
7655 (lambda () (define-key flyspell-mode-map (kbd "C-.") nil)))
7656 (define-key dot-mode-map (kbd "C-.") nil)
7657 (global-set-key (kbd "C-.") 'recentf-ido-find-file)
7658 (add-hook 'php-mode-hook
7659 (lambda () (define-key php-mode-map (kbd "C-.") nil)))
7660 #+end_src
7661 ]
7662 *** M-.
7663 *** C-M-.
7664 :PROPERTIES:
7665 :CUSTOM_ID: 824d422c-67b6-4d68-af11-6a2135e528f5
7666 :END:
7667 -
7668 [
7669 #+begin_src emacs-lisp
7670 (define-key dot-mode-map (kbd "C-M-.") nil)
7671 ;; (global-set-key (kbd "C-M-.") 'execute-extended-command)
7672 #+end_src
7673 ]
7674 *** C-S-.
7675 :PROPERTIES:
7676 :CUSTOM_ID: 346effe7-027b-4c4a-a236-3bc6ef541a0c
7677 :END:
7678 *** [C-/] :drill:
7679 :PROPERTIES:
7680 :CUSTOM_ID: 941a7fa8-84b9-434d-89a0-1487385ec479
7681 :ID: 1bf4af8d-58bb-4b58-af60-2ed87f32f4eb
7682 :END:
7683 join lines
7684 [
7685 #+begin_src emacs-lisp
7686 (defun vim-style-join-line ()
7687 (interactive)
7688 (join-line '(4)))
7689 (global-set-key (kbd "C-/") 'vim-style-join-line)
7690 (define-key undo-tree-map (kbd "C-/") nil)
7691 #+end_src
7692 ]
7693 *** M-/
7694 :PROPERTIES:
7695 :CUSTOM_ID: f65acefa-7e11-438e-a59c-42a9c7c71607
7696 :END:
7697 *** [C-M-/] :drill:
7698 :PROPERTIES:
7699 :CUSTOM_ID: 37f67593-4f60-4d3b-9aad-6c9bc4882443
7700 :ID: c41dd5ab-619f-40fe-9471-9ba59d0fef46
7701 :END:
7702 copy-variable
7703 [
7704 #+begin_src emacs-lisp
7705 (defun copy-variable (variable)
7706 (interactive
7707 (let ((v (variable-at-point))
7708 (enable-recursive-minibuffers t)
7709 val)
7710 (setq val (completing-read (if (symbolp v)
7711 (format
7712 "Describe variable (default %s): " v)
7713 "Describe variable: ")
7714 obarray
7715 (lambda (vv)
7716 (or (get vv 'variable-documentation)
7717 (and (boundp vv) (not (keywordp vv)))))
7718 t nil nil
7719 (if (symbolp v) (symbol-name v))))
7720 (list (if (equal val "")
7721 v (intern val)))))
7722 (kill-new (symbol-value variable)))
7723 (global-set-key (kbd "C-M-/") 'copy-variable)
7724
7725 #+end_src
7726 ]
7727 *** C-S-/
7728 :PROPERTIES:
7729 :CUSTOM_ID: ff612b05-8a3f-4599-a95b-f8af19b71b47
7730 :END:
7731 *** [C-8] :drill:
7732 SCHEDULED: <2014-03-13 Thu>
7733 :PROPERTIES:
7734 calc-embedded-word
7735 :CUSTOM_ID: 251c4a1a-a683-4804-a706-d0d3752e42fa
7736 :ID: 8084cd41-1833-4e16-ac01-60a5738d0bf3
7737 :DRILL_LAST_INTERVAL: 22.2211
7738 :DRILL_REPEATS_SINCE_FAIL: 4
7739 :DRILL_TOTAL_REPEATS: 4
7740 :DRILL_FAILURE_COUNT: 1
7741 :DRILL_AVERAGE_QUALITY: 3.5
7742 :DRILL_EASE: 2.73
7743 :DRILL_LAST_QUALITY: 3
7744 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:35>
7745 :END:
7746 calc-embedded-word
7747 [
7748 #+begin_src emacs-lisp
7749 (global-set-key (kbd "C-8") 'calc-embedded-word)
7750 #+end_src
7751 ]
7752 *** M-8
7753 :PROPERTIES:
7754 :CUSTOM_ID: 34f4f850-c3e4-4724-aabc-08eee19f034a
7755 :END:
7756 *** C-M-8
7757 :PROPERTIES:
7758 :CUSTOM_ID: 52191c76-756e-4dcc-87a5-2b84c550db5f
7759 :END:
7760 *** C-S-8
7761 :PROPERTIES:
7762 :CUSTOM_ID: 3f677c1a-7011-467e-ae4c-4b944807376b
7763 :END:
7764 *** [C-up-arrow] :drill:
7765 SCHEDULED: <2014-03-14 Fri>
7766 :PROPERTIES:
7767 back defun/headline
7768 :CUSTOM_ID: f47d312a-063d-42ed-a352-176298a2cb0c
7769 :ID: 93fe8dac-4206-4131-9264-3411e6467b01
7770 :DRILL_LAST_INTERVAL: 23.4066
7771 :DRILL_REPEATS_SINCE_FAIL: 5
7772 :DRILL_TOTAL_REPEATS: 5
7773 :DRILL_FAILURE_COUNT: 3
7774 :DRILL_AVERAGE_QUALITY: 3.2
7775 :DRILL_EASE: 2.554
7776 :DRILL_LAST_QUALITY: 4
7777 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 18:04>
7778 :END:
7779 org prev headline
7780 [
7781 #+begin_src emacs-lisp
7782 (define-key undo-tree-map "\C-_" nil)
7783 ;; disabled just because i don't want to accidentally hit it
7784 (define-key global-map "\C-_" nil)
7785 (global-set-key (kbd "<C-_>") 'beginning-of-defun)
7786
7787 (add-hook 'org-mode-hook
7788 (lambda ()
7789 (define-key org-mode-map (kbd "\C-_") 'outline-previous-visible-heading)))
7790
7791 #+end_src
7792
7793
7794 ]
7795 *** M-up-arrow
7796 :PROPERTIES:
7797 :CUSTOM_ID: 30f87801-2c2d-4722-9348-fb38ea6c09b0
7798 :END:
7799 *** C-M-up-arrow
7800 *** C-S-up-arrow :drill:
7801 winner undo
7802 [
7803 #+begin_src emacs-lisp
7804 (global-set-key (kbd "<C-S-_>") 'winner-undo)
7805 #+end_src
7806 ]
7807 *** [C-down-arrow] :drill:
7808 SCHEDULED: <2014-03-13 Thu>
7809 :PROPERTIES:
7810 forward dfun/headline
7811 :CUSTOM_ID: 27435136-b3d7-4f25-aa85-2a7363a7f366
7812 :ID: da405d83-b0af-4778-9703-a3f109a1233d
7813 :DRILL_LAST_INTERVAL: 10.7692
7814 :DRILL_REPEATS_SINCE_FAIL: 3
7815 :DRILL_TOTAL_REPEATS: 6
7816 :DRILL_FAILURE_COUNT: 1
7817 :DRILL_AVERAGE_QUALITY: 3.167
7818 :DRILL_EASE: 2.537
7819 :DRILL_LAST_QUALITY: 4
7820 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
7821 :END:
7822 org next headline
7823 [
7824 #+begin_src emacs-lisp
7825 (global-set-key (kbd "<C-kp-enter>") 'end-of-defun)
7826
7827 (add-hook 'org-mode-hook
7828 (lambda ()
7829 (define-key org-mode-map (kbd "<C-kp-enter>") 'outline-next-visible-heading)))
7830
7831 #+end_src
7832
7833
7834 ]
7835 *** M-down-arrow
7836 *** [C-M-down-arrow] :drill:
7837 SCHEDULED: <2014-03-20 Thu>
7838 :PROPERTIES:
7839 toggle-mark-activation
7840 :ID: c57f3bab-8ea1-423d-b759-e1ec2586753c
7841 :CUSTOM_ID: 3bcb35fd-6d54-4213-b94f-2739c0bc0041
7842 :DRILL_LAST_INTERVAL: 17.6506
7843 :DRILL_REPEATS_SINCE_FAIL: 4
7844 :DRILL_TOTAL_REPEATS: 7
7845 :DRILL_FAILURE_COUNT: 4
7846 :DRILL_AVERAGE_QUALITY: 3.661
7847 :DRILL_EASE: 2.851
7848 :DRILL_LAST_QUALITY: 5
7849 :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
7850 :END:
7851 toggle-mark-activation
7852 [
7853 #+begin_src emacs-lisp
7854 (defun toggle-mark-activation ()
7855 (interactive)
7856 (if mark-active
7857 (deactivate-mark t)
7858 (activate-mark)))
7859
7860 (global-set-key (kbd "<C-M-kp-enter>") 'toggle-mark-activation)
7861 #+end_src
7862 ]
7863 winner redo
7864 [
7865 #+begin_src emacs-lisp
7866 (global-set-key (kbd "<C-S-kp-enter>") 'winner-redo)
7867 #+end_src
7868 ]
7869
7870 *** [C-S-down-arrow] :drill:
7871 SCHEDULED: <2014-03-19 Wed>
7872 :PROPERTIES:
7873 smex-major-mode-commands
7874 :CUSTOM_ID: 1434bdd0-c5a8-4c96-9b92-9474e88fd1c5
7875 :ID: 1e992e46-ec69-416c-b7d7-7c87da109b43
7876 :DRILL_LAST_INTERVAL: 24.3844
7877 :DRILL_REPEATS_SINCE_FAIL: 5
7878 :DRILL_TOTAL_REPEATS: 5
7879 :DRILL_FAILURE_COUNT: 2
7880 :DRILL_AVERAGE_QUALITY: 3.0
7881 :DRILL_EASE: 2.456
7882 :DRILL_LAST_QUALITY: 3
7883 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 02:28>
7884 :END:
7885 m-x for major mode
7886 [
7887 #+begin_src emacs-lisp
7888 (global-set-key (kbd "<C-S-kp-enter>") 'smex-major-mode-commands)
7889 #+end_src
7890 ]
7891 *** C-lbracket
7892 :PROPERTIES:
7893 :CUSTOM_ID: 9d9916dd-3280-47dd-aab1-cd28d5ebfe15
7894 :END:
7895 ----
7896 *** M-lbracket
7897 *** [C-M-lbracket] :drill:
7898 SCHEDULED: <2014-03-15 Sat>
7899 :PROPERTIES:
7900 scroll-right
7901 :CUSTOM_ID: 7411b1a5-c8fa-4bcc-8788-798e5635dd62
7902 :ID: 0bf13532-1df9-4eb3-953c-10901f2a5da5
7903 :DRILL_LAST_INTERVAL: 23.5247
7904 :DRILL_REPEATS_SINCE_FAIL: 4
7905 :DRILL_TOTAL_REPEATS: 4
7906 :DRILL_FAILURE_COUNT: 0
7907 :DRILL_AVERAGE_QUALITY: 3.5
7908 :DRILL_EASE: 2.73
7909 :DRILL_LAST_QUALITY: 3
7910 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:25>
7911 :END:
7912 scroll-right
7913 [
7914 #+begin_src emacs-lisp
7915 (global-set-key (kbd "C-M-[") 'scroll-right)
7916 #+end_src
7917 ]
7918 *** C-S-lbracket
7919 *** [C-rbracket]
7920 :PROPERTIES:
7921 :CUSTOM_ID: 21b38c6b-3a46-4a08-8eca-d44abb148287
7922 :END:
7923 fill-paragraph
7924 #+begin_src emacs-lisp
7925 (global-set-key (kbd "C-]") 'fill-paragraph)
7926 #+end_src
7927 *** M-rbracket
7928 *** [C-M-rbracket] :drill:
7929 SCHEDULED: <2014-03-15 Sat>
7930 :PROPERTIES:
7931 scroll-left
7932 :CUSTOM_ID: c9c18f48-d0ca-4a1b-a751-7165f40118a3
7933 :ID: ff008422-b6f5-4770-9e53-e6acdac90b45
7934 :DRILL_LAST_INTERVAL: 24.4352
7935 :DRILL_REPEATS_SINCE_FAIL: 4
7936 :DRILL_TOTAL_REPEATS: 4
7937 :DRILL_FAILURE_COUNT: 0
7938 :DRILL_AVERAGE_QUALITY: 3.75
7939 :DRILL_EASE: 2.929
7940 :DRILL_LAST_QUALITY: 4
7941 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:44>
7942 :END:
7943 scroll-left
7944 [
7945 #+begin_src emacs-lisp
7946 (global-set-key (kbd "C-M-]") 'scroll-left)
7947 #+end_src
7948 ]
7949 *** C-S-rbracket
7950 :PROPERTIES:
7951 :CUSTOM_ID: d42245ca-3246-477b-bda9-8776cd668cd1
7952 :END:
7953 *** [C-return] :drill:
7954 SCHEDULED: <2014-03-12 Wed>
7955 :PROPERTIES:
7956 newline next line
7957 :ID: 20e450f0-6467-40f2-bd1b-b4038693e73f
7958 :CUSTOM_ID: baf7ea5a-d16d-4fee-a6ce-542cc11beb97
7959 :DRILL_LAST_INTERVAL: 20.7344
7960 :DRILL_REPEATS_SINCE_FAIL: 4
7961 :DRILL_TOTAL_REPEATS: 4
7962 :DRILL_FAILURE_COUNT: 0
7963 :DRILL_AVERAGE_QUALITY: 3.75
7964 :DRILL_EASE: 2.928
7965 :DRILL_LAST_QUALITY: 5
7966 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:29>
7967 :END:
7968 newline-anywhere
7969 [
7970 #+begin_src emacs-lisp
7971 (defun newline-anywhere ()
7972 "Add a newline from anywhere in the line."
7973 (interactive)
7974 (end-of-line)
7975 (newline-and-indent))
7976 (global-set-key (kbd "<C-return>") 'newline-anywhere)
7977
7978 #+end_src
7979 ]
7980 *** [M-return] :drill:
7981 SCHEDULED: <2014-03-11 Tue>
7982 :PROPERTIES:
7983 non-indented newline
7984 :ID: 4fc4d372-765e-4e2e-87f4-0a0e1fd93f34
7985 :CUSTOM_ID: e6895ad3-a2c8-46c8-abbc-1bba94a88596
7986 :DRILL_LAST_INTERVAL: 19.9622
7987 :DRILL_REPEATS_SINCE_FAIL: 4
7988 :DRILL_TOTAL_REPEATS: 4
7989 :DRILL_FAILURE_COUNT: 0
7990 :DRILL_AVERAGE_QUALITY: 3.5
7991 :DRILL_EASE: 2.73
7992 :DRILL_LAST_QUALITY: 4
7993 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:30>
7994 :END:
7995 plain newline
7996 [
7997 #+begin_src emacs-lisp
7998 (defun plain-newline ()
7999 (interactive)
8000 (insert "\n"))
8001 (global-set-key (kbd "<M-return>") 'plain-newline)
8002 #+end_src
8003 ]
8004
8005 *** C-M-return
8006 :PROPERTIES:
8007 open newline on previous line
8008 :CUSTOM_ID: 2a8fc6ea-a550-4437-9e35-3b3f2776788a
8009 :END:
8010 [
8011 #+begin_src emacs-lisp
8012 (defun newline-anywhere-previous ()
8013 "Add a newline from anywhere in the line."
8014 (interactive)
8015 (forward-line -1)
8016 (end-of-line)
8017 (newline-and-indent))
8018 (global-set-key (kbd "<C-M-return>") 'newline-anywhere-previous)
8019 #+end_src
8020 ]
8021 *** C-S-return
8022 :PROPERTIES:
8023 :CUSTOM_ID: 787cc59e-ce0f-4291-a9d5-fd4e14b0b83b
8024 :END:
8025 *** [C-space] :drill:
8026 SCHEDULED: <2014-03-18 Tue>
8027 :PROPERTIES:
8028 org-edit-special
8029 :CUSTOM_ID: 132daa1a-8e5f-47f1-a28d-35bee873aeac
8030 :ID: 3204f2ca-10b2-469b-8b70-fb660e35478a
8031 :DRILL_LAST_INTERVAL: 41.7787
8032 :DRILL_REPEATS_SINCE_FAIL: 3
8033 :DRILL_TOTAL_REPEATS: 3
8034 :DRILL_FAILURE_COUNT: 0
8035 :DRILL_AVERAGE_QUALITY: 4.667
8036 :DRILL_EASE: 4.583
8037 :DRILL_LAST_QUALITY: 4
8038 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:44>
8039 :END:
8040 org-edit-special
8041 [
8042 #+begin_src emacs-lisp
8043 ;; (kbd "<C-space>") does not work, (kbd "C-SPC") should work
8044 (add-hook 'org-mode-hook
8045 (lambda ()
8046 (define-key org-mode-map (kbd "C-SPC") 'org-edit-special)
8047 ;; org-src-mode-map is broken in git version of emacs.
8048 ;; temporarily use this for exiting edit-special mode.
8049 (global-set-key (kbd "C-M--") 'org-edit-src-exit)
8050 (define-key org-src-mode-map (kbd "C-SPC") 'org-edit-src-exit)))
8051 #+end_src
8052 ]
8053 *** M-space
8054 :PROPERTIES:
8055 :CUSTOM_ID: bbffb12e-03f2-4a26-a9e4-fd263ad6b518
8056 :END:
8057 *** C-M-space
8058 :PROPERTIES:
8059 spell check word
8060 :CUSTOM_ID: 02359b66-bf6e-4f41-9f03-e83fcbe3e68c
8061 :END:
8062 [
8063 before or under cursor
8064 #+begin_src emacs-lisp
8065 (global-set-key (kbd "C-M-SPC") 'ispell-word)
8066 #+end_src
8067 ]
8068 *** C-S-space
8069 :PROPERTIES:
8070 :CUSTOM_ID: a28e904f-f2bd-48d3-9718-af3f541e611e
8071 :END:
8072 ** left secondary
8073 *** C-=
8074 :PROPERTIES:
8075 :CUSTOM_ID: 6b01dcdd-d1c1-4e3f-9e28-9c3574682f95
8076 :END:
8077 *** M-=
8078 :PROPERTIES:
8079 :CUSTOM_ID: 6a63486f-ea5b-4ece-a535-5277022e0cde
8080 :END:
8081 *** C-M-=
8082 :PROPERTIES:
8083 :CUSTOM_ID: 1e245ef6-5bdb-4f99-b8e2-f5d45a7c0847
8084 :END:
8085 *** C-S-=
8086 :PROPERTIES:
8087 :CUSTOM_ID: 0f9aa2b8-83c7-433c-80e0-f90ee802365f
8088 :END:
8089 *** C-1
8090 :PROPERTIES:
8091 :CUSTOM_ID: 06374c1c-025b-47c2-90b2-82f37031093b
8092 :END:
8093 *** M-1
8094 :PROPERTIES:
8095 :CUSTOM_ID: 51810ebd-52f3-4e68-9434-e2347a834787
8096 :END:
8097 *** C-M-1
8098 :PROPERTIES:
8099 :CUSTOM_ID: 9207526f-a925-4ecc-bd30-98cbd580d67a
8100 :END:
8101 *** C-S-1
8102 :PROPERTIES:
8103 :CUSTOM_ID: 58a7a929-50b5-4393-9b08-59ad2039b263
8104 :END:
8105 *** C-4
8106 :PROPERTIES:
8107 :CUSTOM_ID: 24a0c3c4-bce7-4a94-8a31-e5259387c573
8108 :END:
8109 *** M-4
8110 :PROPERTIES:
8111 :CUSTOM_ID: 2d4fa927-2140-424b-9990-e8f2c3424e57
8112 :END:
8113 *** C-M-4 :drill:
8114 widen
8115 [
8116 :PROPERTIES:
8117 :CUSTOM_ID: 3ff50f5f-f286-4a73-962b-58dbcf3b09b1
8118 :ID: addc832b-5547-4d45-a1f5-3e9283920612
8119 :END:
8120 #+begin_src emacs-lisp
8121 (global-set-key (kbd "C-M-4") 'widen)
8122 #+end_src
8123 ]
8124 *** C-S-4
8125 :PROPERTIES:
8126 :CUSTOM_ID: ba9ed568-7ba1-4283-b4c7-57fcb9a5a477
8127 :END:
8128 *** C-5
8129 :PROPERTIES:
8130 :CUSTOM_ID: 83bc2d8a-a225-4b6f-ab98-f47aa6d1e73f
8131 :END:
8132 *** M-5
8133 :PROPERTIES:
8134 :CUSTOM_ID: 1b8f04c3-91b5-43cd-8a1a-94c8105eff24
8135 :END:
8136 *** C-M-5
8137 :PROPERTIES:
8138 :CUSTOM_ID: fab28de6-7fe4-45d7-a856-5d29a9085f5d
8139 :END:
8140 *** C-S-5
8141 :PROPERTIES:
8142 :CUSTOM_ID: b22cdf04-bc77-493b-a65c-5992befc1a62
8143 :END:
8144 *** [C-tab-key] :drill:
8145 SCHEDULED: <2014-03-12 Wed>
8146 :PROPERTIES:
8147 query-replace
8148 :CUSTOM_ID: 68313551-90cd-47a6-8170-1745348add17
8149 :ID: 5b315ca6-c623-4b23-bef3-31b325591d01
8150 :DRILL_LAST_INTERVAL: 20.9905
8151 :DRILL_REPEATS_SINCE_FAIL: 4
8152 :DRILL_TOTAL_REPEATS: 4
8153 :DRILL_FAILURE_COUNT: 2
8154 :DRILL_AVERAGE_QUALITY: 3.5
8155 :DRILL_EASE: 2.73
8156 :DRILL_LAST_QUALITY: 3
8157 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:32>
8158 :END:
8159 query-replace
8160 [
8161 #+begin_src emacs-lisp
8162
8163 (global-set-key (kbd "<C-kp-add>") 'query-replace)
8164 #+end_src
8165 ]
8166 *** M-tab-key
8167 *** C-M-tab-key
8168 *** C-S-tab-key
8169 *** [C-t] :drill:
8170 SCHEDULED: <2014-03-24 Mon>
8171 :PROPERTIES:
8172 org change todo state
8173 :ID: b9a6ec32-9b64-403f-be09-73769f778d1f
8174 :CUSTOM_ID: aaac3048-9125-4fd5-b8f2-21bafcc1ff1c
8175 :DRILL_LAST_INTERVAL: 32.7466
8176 :DRILL_REPEATS_SINCE_FAIL: 4
8177 :DRILL_TOTAL_REPEATS: 4
8178 :DRILL_FAILURE_COUNT: 0
8179 :DRILL_AVERAGE_QUALITY: 4.0
8180 :DRILL_EASE: 3.204
8181 :DRILL_LAST_QUALITY: 4
8182 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:53>
8183 :END:
8184 org cycle todo / toggle comint motion
8185 [
8186 #+begin_src emacs-lisp
8187 (add-hook 'org-mode-hook
8188 (lambda ()
8189 (define-key org-mode-map (kbd "C-t") 'org-todo)))
8190
8191 (defun my-comint-previous-input (arg)
8192 (interactive "*p")
8193 (if (comint-after-pmark-p)
8194 (comint-previous-input arg)
8195 (forward-line -1)))
8196
8197 (defun my-comint-next-input (arg)
8198 (interactive "*p")
8199 (if (comint-after-pmark-p)
8200 (comint-next-input arg)
8201 (forward-line)))
8202
8203 (add-hook 'comint-mode-hook
8204 (lambda ()
8205 (define-key comint-mode-map (kbd "C-t") 'comint-toggle-arrow-keys)
8206 (define-key comint-mode-map (kbd "<up>") 'my-comint-previous-input)
8207 (define-key comint-mode-map (kbd "<down>") 'my-comint-next-input)))
8208
8209
8210 (defun comint-toggle-arrow-keys ()
8211 (interactive)
8212 (toggle-arrow-keys comint-mode-map))
8213
8214 (setq-default comint-arrow-movement nil)
8215 (defun toggle-arrow-keys (map)
8216 (cond ((lookup-key map (kbd "<up>"))
8217 (setq-local comint-arrow-movement t)
8218 (define-key map (kbd "<up>") nil)
8219 (define-key map (kbd "<down>") nil))
8220 (t
8221 (setq-local comint-arrow-movement nil)
8222 (define-key map (kbd "<up>") 'my-comint-previous-input)
8223 (define-key map (kbd "<down>") 'my-comint-next-input)
8224 (goto-char (point-max)))))
8225
8226 (defun ian-sign-email ()
8227 (interactive)
8228 (insert "Ian Kelling
8229 https://iankelling.org"))
8230
8231 (eval-after-load "message"
8232 '(define-key message-mode-map (kbd "C-t") 'ian-sign-email))
8233 #+end_src
8234 Thanks for the update. I will be enjoying it.
8235
8236 #+RESULTS:
8237 : comint-toggle-arrow-keys
8238 ]
8239 *** M-t
8240 :PROPERTIES:
8241 :CUSTOM_ID: 4542dc3a-d876-4726-8c8e-61c7c9cecd64
8242 :END:
8243 *** [C-M-t] :drill:
8244 SCHEDULED: <2014-03-15 Sat>
8245 :PROPERTIES:
8246 org insert timestamp
8247 :ID: ed43d561-cf73-4123-8cf2-12e184f99e0f
8248 :CUSTOM_ID: 5bc609b1-9428-4b82-a55d-811fefe65331
8249 :DRILL_LAST_INTERVAL: 23.5247
8250 :DRILL_REPEATS_SINCE_FAIL: 4
8251 :DRILL_TOTAL_REPEATS: 4
8252 :DRILL_FAILURE_COUNT: 0
8253 :DRILL_AVERAGE_QUALITY: 3.5
8254 :DRILL_EASE: 2.73
8255 :DRILL_LAST_QUALITY: 3
8256 :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:41>
8257 :END:
8258 org timestamp
8259 [
8260 #+begin_src emacs-lisp
8261 (global-set-key (kbd "C-M-t") 'org-time-stamp-with-time)
8262 #+end_src
8263 ]
8264 *** C-S-t
8265 :PROPERTIES:
8266 :CUSTOM_ID: 6a6fcd06-5822-4a3d-8e2e-1fc0f64357b2
8267 :END:
8268 *** C-home
8269 :PROPERTIES:
8270 :CUSTOM_ID: 1919659a-b466-4519-9276-8bf06a916066
8271 :END:
8272 start of buffer
8273 *** M-home
8274 :PROPERTIES:
8275 :CUSTOM_ID: 29a3b536-201d-4499-b131-afe58e6f45b4
8276 :END:
8277 *** C-M-home
8278 :PROPERTIES:
8279 :CUSTOM_ID: d9df9b43-357a-43e1-bb1c-47d61f095738
8280 :END:
8281 *** C-S-home
8282 :PROPERTIES:
8283 :CUSTOM_ID: a91ee772-a59c-4083-a65c-6f9b294b517c
8284 :END:
8285 *** C-end
8286 :PROPERTIES:
8287 :CUSTOM_ID: 0a7bd629-cbcc-4761-8fe2-cc9370b985a4
8288 :END:
8289 end of buffer
8290 *** M-end
8291 :PROPERTIES:
8292 :CUSTOM_ID: 1c215db5-a50c-4718-868a-871d69acf117
8293 :END:
8294 *** C-M-end
8295 :PROPERTIES:
8296 :CUSTOM_ID: cf2df317-a0b1-41e6-9919-67e77bb796f8
8297 :END:
8298 *** C-S-end
8299 :PROPERTIES:
8300 :CUSTOM_ID: a4721bb0-9cbc-4f3c-b292-645d5121c839
8301 :END:
8302 *** C-f9
8303 :PROPERTIES:
8304 :CUSTOM_ID: 014536d9-68e3-46f5-9594-e74fe64f4d9e
8305 :END:
8306 *** M-f9
8307 :PROPERTIES:
8308 :CUSTOM_ID: 6dee0f1b-3680-4a72-8a80-e31b9c7c219d
8309 :END:
8310 *** C-M-f9
8311 :PROPERTIES:
8312 :CUSTOM_ID: f5e835dd-e2b8-42eb-b7f1-9ec76c7dfcb8
8313 :END:
8314 *** C-S-f9
8315 :PROPERTIES:
8316 :CUSTOM_ID: c3aba493-9e85-40b7-989d-7e17ba2b55a7
8317 :END:
8318 ** right secondary
8319 *** C-6
8320 :PROPERTIES:
8321 :CUSTOM_ID: e44e584b-d925-4036-9ad5-a90d02e74bef
8322 :END:
8323 save-buffers-kill-emacs
8324 [
8325 #+begin_src emacs-lisp
8326 (global-set-key (kbd "C-6") 'save-buffers-kill-emacs)
8327 #+end_src
8328 ]
8329 *** M-6
8330 *** [C-M-6] :drill:
8331 :PROPERTIES:
8332 :CUSTOM_ID: da73de75-0914-4f48-81d5-9b408433b14b
8333 :ID: bcf78e2e-810e-4a6d-9056-bd488aaa373b
8334 :END:
8335 insert-small-copyright
8336 [
8337 #+begin_src emacs-lisp
8338 (defun insert-small-copyright ()
8339 (interactive)
8340 (beginning-of-line)
8341 (let ((beg (point)))
8342 (insert "Copyright (C) 2016 Ian Kelling\nThis program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>")
8343 (comment-region beg (point))))
8344
8345 (global-set-key (kbd "C-M-6") 'insert-small-copyright)
8346 #+end_src
8347 ]
8348 *** C-S-6
8349 *** C-7
8350 *** M-7
8351 *** [C-M-7] :drill:
8352 :PROPERTIES:
8353 :CUSTOM_ID: a68c6b8e-9911-475e-ab35-e239771fe881
8354 :ID: ae9704b8-1492-4dc0-806a-dd3407526733
8355 :END:
8356 insert-full-copyright
8357 [
8358 #+begin_src emacs-lisp
8359 (defun insert-full-copyright ()
8360 (interactive)
8361 (beginning-of-line)
8362 (let ((beg (point)))
8363 (insert "Copyright (C) 2016 Ian Kelling\n")
8364 (insert "\n")
8365 (insert "This program is free software: you can redistribute it and/or modify\n")
8366 (insert "it under the terms of the GNU General Public License as published by\n")
8367 (insert "the Free Software Foundation, either version 3 of the License, or\n")
8368 (insert "(at your option) any later version.\n")
8369 (insert "\n")
8370 (insert "This program is distributed in the hope that it will be useful,\n")
8371 (insert "but WITHOUT ANY WARRANTY; without even the implied warranty of\n")
8372 (insert "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n")
8373 (insert "GNU General Public License for more details.\n")
8374 (insert "\n")
8375 (insert "You should have received a copy of the GNU General Public License\n")
8376 (insert "along with this program. If not, see <http://www.gnu.org/licenses/>.\n")
8377 (comment-region beg (point))))
8378
8379 (global-set-key (kbd "C-M-7") 'insert-full-copyright)
8380
8381 #+end_src
8382 ]
8383 *** C-S-7
8384 :PROPERTIES:
8385 :CUSTOM_ID: 05f5737b-a320-403c-a8f1-fa0a02f679e1
8386 :END:
8387 *** C-0
8388 :PROPERTIES:
8389 :CUSTOM_ID: 96ae2fcc-3a0c-40c4-aef8-06aff3fd42be
8390 :END:
8391 text-scale-reset
8392 [
8393 #+begin_src emacs-lisp
8394 (defun text-scale-reset ()
8395 (interactive)
8396 (text-scale-set 0))
8397 (global-set-key (kbd "C-0") 'text-scale-reset)
8398 #+end_src
8399 ]
8400 *** M-0
8401 :PROPERTIES:
8402 :CUSTOM_ID: c5735fdf-d0d9-468c-917c-3936e409a2bc
8403 :END:
8404 *** C-M-0
8405 :PROPERTIES:
8406 :CUSTOM_ID: 0e7f83a5-600e-4016-af98-95904300c016
8407 :END:
8408 insert-apache
8409 [
8410 #+begin_src emacs-lisp
8411 (defun insert-apache ()
8412 (interactive)
8413 (beginning-of-line)
8414 (let ((beg (point)))
8415 (insert "Copyright (C) 2016 Ian Kelling\n")
8416 (insert "\n")
8417 (insert "Licensed under the Apache License, Version 2.0 (the \"License\");\n")
8418 (insert "you may not use this file except in compliance with the License.\n")
8419 (insert "You may obtain a copy of the License at\n")
8420 (insert "\n")
8421 (insert " http://www.apache.org/licenses/LICENSE-2.0\n")
8422 (insert "\n")
8423 (insert "Unless required by applicable law or agreed to in writing, software\n")
8424 (insert "distributed under the License is distributed on an \"AS IS\" BASIS,\n")
8425 (insert "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n")
8426 (insert "See the License for the specific language governing permissions and\n")
8427 (insert "limitations under the License.\n")
8428 (comment-region beg (point))))
8429 (global-set-key (kbd "C-M-0") 'insert-apache)
8430 #+end_src
8431 ]
8432
8433 *** C-S-0
8434 :PROPERTIES:
8435 :CUSTOM_ID: d1706bc7-7cf0-4b49-87d0-15bf76eaca5f
8436 :END:
8437 *** C--
8438 :PROPERTIES:
8439 :CUSTOM_ID: 3713b701-b31a-4612-b663-f232005b4122
8440 :END:
8441 *** M--
8442 :PROPERTIES:
8443 :CUSTOM_ID: ca833b78-b279-4d1f-b1c9-6c70fdf20f57
8444 :END:
8445 *** C-M--
8446 :PROPERTIES:
8447 :CUSTOM_ID: 6febc7ea-9cc7-488c-af34-538b8e69633b
8448 :END:
8449 org-edit-src-exit
8450 *** C-S--
8451 :PROPERTIES:
8452 :CUSTOM_ID: c73af1d7-61f2-4c1b-935e-43f077d8d915
8453 :END:
8454 *** [C-y] :drill:
8455 SCHEDULED: <2014-03-27 Thu>
8456 :PROPERTIES:
8457 :ID: 4c0f74f8-04ed-40d8-8ec3-6e2bed03c2b9
8458 :CUSTOM_ID: 97aee7f1-3647-4602-a65a-45e8a3aa3a7c
8459 :DRILL_LAST_INTERVAL: 50.6823
8460 :DRILL_REPEATS_SINCE_FAIL: 3
8461 :DRILL_TOTAL_REPEATS: 3
8462 :DRILL_FAILURE_COUNT: 0
8463 :DRILL_AVERAGE_QUALITY: 5.0
8464 :DRILL_EASE: 5.815
8465 :DRILL_LAST_QUALITY: 5
8466 :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:45>
8467 :END:
8468 undo-tree-redo
8469 [
8470 #+begin_src emacs-lisp
8471 (global-set-key (kbd "C-y") 'undo-tree-redo)
8472 #+end_src
8473
8474 ]
8475 *** M-y
8476 :PROPERTIES:
8477 :CUSTOM_ID: 35072ca8-7fd6-4a64-bc7a-2636de575bd1
8478 :END:
8479 *** C-M-y
8480 *** C-S-y
8481 :PROPERTIES:
8482 :CUSTOM_ID: 964fa784-37e3-48c6-af4b-c7e91f67a93a
8483 :END:
8484 *** C-\
8485 :PROPERTIES:
8486 sr-speedbar-toggle
8487 :CUSTOM_ID: b8ad3ee9-7bf6-4069-a300-49cd298008a7
8488 :END:
8489 [
8490 #+begin_src emacs-lisp
8491 (global-set-key (kbd "C-\\") 'sr-speedbar-toggle)
8492 #+end_src
8493 ]
8494 *** M-\
8495 :PROPERTIES:
8496 :CUSTOM_ID: c1d53d84-b8a9-49cb-bfd6-4420931c8873
8497 :END:
8498 *** [C-M-\] :drill:
8499 SCHEDULED: <2014-03-21 Fri>
8500 :PROPERTIES:
8501 mark-defun
8502 :ID: d45bce17-45bc-41f0-8994-aa7bc3b2fa92
8503 :CUSTOM_ID: 6a583354-48f8-4503-bf87-b8ba56411435
8504 :DRILL_LAST_INTERVAL: 11.7003
8505 :DRILL_REPEATS_SINCE_FAIL: 4
8506 :DRILL_TOTAL_REPEATS: 9
8507 :DRILL_FAILURE_COUNT: 6
8508 :DRILL_AVERAGE_QUALITY: 2.815
8509 :DRILL_EASE: 2.369
8510 :DRILL_LAST_QUALITY: 3
8511 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
8512 :END:
8513 mark-defun
8514 [
8515 #+begin_src emacs-lisp
8516 (global-set-key (kbd "C-M-\\") 'mark-defun)
8517 #+end_src
8518 ]
8519 *** C-S-\
8520 :PROPERTIES:
8521 :CUSTOM_ID: 30edfb48-852f-4f2c-ba38-2635927d4950
8522 :END:
8523 *** C-h
8524 :PROPERTIES:
8525 :CUSTOM_ID: 3c5f241f-fc62-459d-ab85-6b7c1fb04801
8526 :END:
8527 help-prefix
8528
8529 *** M-h
8530 :PROPERTIES:
8531 :CUSTOM_ID: 6df13b90-490b-4cca-a49d-4f2e3ce5bea3
8532 :END:
8533 *** C-M-h
8534 :PROPERTIES:
8535 :CUSTOM_ID: 47f0d1f3-78ea-49d7-a6d7-06627ca745bd
8536 :END:
8537 *** C-S-h
8538 :PROPERTIES:
8539 :CUSTOM_ID: 3be3db5c-9905-474b-b773-1aee515625f5
8540 :END:
8541 *** C-'
8542 :PROPERTIES:
8543 :CUSTOM_ID: 9f252721-a2d5-46c6-b268-8ed597256229
8544 :END:
8545 eval-expression
8546 [
8547 #+begin_src emacs-lisp
8548 (global-set-key (kbd "C-'") 'eval-expression)
8549 #+end_src
8550 ]
8551 *** M-'
8552 :PROPERTIES:
8553 :CUSTOM_ID: f00b9c88-68bb-4831-872f-afb5ff82c104
8554 :END:
8555 *** C-M-'
8556 :PROPERTIES:
8557 :CUSTOM_ID: 0d39d36c-115a-4570-b4b1-818718409a49
8558 :END:
8559 *** C-S-'
8560 :PROPERTIES:
8561 :CUSTOM_ID: 230f50ef-48fd-4f13-aa62-e4a492c4515d
8562 :END:
8563 *** [C-n] :drill:
8564 SCHEDULED: <2014-04-07 Mon>
8565 :PROPERTIES:
8566 unpop-to-mark-command
8567 :CUSTOM_ID: 52ebb720-589b-485c-89dc-0dfb78e6dad4
8568 :ID: 32f1c87d-ee1f-4117-8059-32fd8facbeff
8569 :DRILL_LAST_INTERVAL: 42.8284
8570 :DRILL_REPEATS_SINCE_FAIL: 4
8571 :DRILL_TOTAL_REPEATS: 4
8572 :DRILL_FAILURE_COUNT: 0
8573 :DRILL_AVERAGE_QUALITY: 4.5
8574 :DRILL_EASE: 4.122
8575 :DRILL_LAST_QUALITY: 5
8576 :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
8577 :END:
8578 unpop to mark
8579 [
8580 #+begin_src emacs-lisp
8581 (defun unpop-to-mark-command ()
8582 "Unpop off mark ring. Does nothing if mark ring is empty."
8583 (interactive)
8584 (when mark-ring
8585 (let ((pos (marker-position (car (last mark-ring)))))
8586 (if (not (= (point) pos))
8587 (goto-char pos)
8588 (setq mark-ring (cons (copy-marker (mark-marker)) mark-ring))
8589 (set-marker (mark-marker) pos)
8590 (setq mark-ring (nbutlast mark-ring))
8591 (goto-char (marker-position (car (last mark-ring))))))))
8592
8593 (global-set-key (kbd "C-n") 'unpop-to-mark-command)
8594 #+end_src
8595 ]
8596 *** M-n
8597 :PROPERTIES:
8598 :CUSTOM_ID: 00c2ab64-696d-4492-8236-f7ebc12e4a93
8599 :END:
8600 *** [C-M-n] :drill:
8601 SCHEDULED: <2014-03-17 Mon>
8602 :PROPERTIES:
8603 narrow-to-region
8604 :ID: 59e48dcc-434b-4c96-bdb3-c083c41ae8b3
8605 :CUSTOM_ID: 43997316-8d3f-4750-873b-ade09628fdd5
8606 :DRILL_LAST_INTERVAL: 7.6409
8607 :DRILL_REPEATS_SINCE_FAIL: 3
8608 :DRILL_TOTAL_REPEATS: 8
8609 :DRILL_FAILURE_COUNT: 4
8610 :DRILL_AVERAGE_QUALITY: 2.59
8611 :DRILL_EASE: 2.261
8612 :DRILL_LAST_QUALITY: 3
8613 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:34>
8614 :END:
8615 narrow-to-region
8616 [
8617 #+begin_src emacs-lisp
8618 (global-set-key (kbd "C-M-n") 'narrow-to-region)
8619 #+end_src
8620 ]
8621 *** C-S-n
8622 :PROPERTIES:
8623 :CUSTOM_ID: f01c2c61-f606-49ea-885a-63a831eaae3d
8624 :END:
8625 *** C-rshift
8626 *** M-rshift
8627 *** C-M-rshift
8628 *** C-S-rshift
8629 *** [C-escape] :drill:
8630 SCHEDULED: <2014-04-05 Sat>
8631 :PROPERTIES:
8632 find-tag
8633 :ID: a6dd7e4c-1831-4493-bbfd-557dc2f9c856
8634 :CUSTOM_ID: 6901fa1b-c827-4525-b24b-bdb8fe5f638b
8635 :DRILL_LAST_INTERVAL: 27.3693
8636 :DRILL_REPEATS_SINCE_FAIL: 5
8637 :DRILL_TOTAL_REPEATS: 6
8638 :DRILL_FAILURE_COUNT: 2
8639 :DRILL_AVERAGE_QUALITY: 3.417
8640 :DRILL_EASE: 2.676
8641 :DRILL_LAST_QUALITY: 4
8642 :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:37>
8643 :END:
8644 find-tag
8645 [
8646 #+begin_src emacs-lisp
8647 (global-set-key (kbd "<C-escape>") 'find-tag)
8648 #+end_src
8649 ]
8650 *** M-escape
8651 :PROPERTIES:
8652 :ID: 7224837b-addc-4c82-8313-467c6dcb7a52
8653 :CUSTOM_ID: f505f1b9-82f6-4139-9e3e-78df548175ec
8654 :END:
8655 *** C-M-escape
8656 :PROPERTIES:
8657 :CUSTOM_ID: d77136c5-4aec-4f02-8b4b-e417249fbac1
8658 :END:
8659 *** C-S-escape
8660 :PROPERTIES:
8661 :CUSTOM_ID: d61ae40a-3f2d-4ef6-a515-8864a7d7c8ea
8662 :END:
8663 * keybind table src
8664 :PROPERTIES:
8665 :CUSTOM_ID: ff8f3092-187a-4b2c-940f-01743f7a51b6
8666 :END:
8667 not necessary to have at the end, but its convenient to have it next
8668 to its output.
8669 #+NAME: keybind-table-generator
8670 #+BEGIN_SRC emacs-lisp :results silent
8671 (defun org-custom-id-get (&optional pom create prefix)
8672 "Get the CUSTOM_ID property of the entry at point-or-marker POM.
8673 If POM is nil, refer to the entry at point.
8674 If the entry does not have a CUSTOM_ID, the function returns nil.
8675 However, when CREATE is non nil, create an ID if none is present already.
8676 PREFIX will be passed through to `org-id-new'.
8677 In any case, the CUSTOM_ID of the entry is returned."
8678 (org-with-point-at pom
8679 (let ((id (org-entry-get nil "CUSTOM_ID")))
8680 (cond
8681 ((and id (stringp id) (string-match "\\S-" id))
8682 id)
8683 (create
8684 (setq id (org-id-new prefix))
8685 (org-entry-put pom "CUSTOM_ID" id)
8686 (org-id-add-location id (buffer-file-name (buffer-base-buffer)))
8687 id)))))
8688
8689 (defun get-title()
8690 (interactive)
8691 (let ((title (plist-get (cadr (org-element-at-point)) ':title)))
8692 ;; remove brackets from [title]
8693 (string-match "[^[ ][^]]*" title)
8694 (setq title (match-string 0 title))
8695 (print title)
8696 title))
8697
8698
8699 (defun org-dblock-write:keybind-dblock (arg)
8700 (let (output)
8701 (save-excursion
8702 (goto-char (org-find-entry-with-id "beginning-of-keybind-table-data"))
8703 (let* ((table-level (org-current-level))
8704 (keybind-level (1+ table-level))
8705 (prefixes (list "C-M-S-" "C-M-" "C-S-" "M-S-" "M-" "C-" "S-"))
8706 table-title
8707 previous-prefixes
8708 )
8709 (while (>= (org-current-level) table-level)
8710 (setq table-title (get-title))
8711 (outline-next-heading)
8712 (let (found-prefixes
8713 found-all-prefixes)
8714 ;; go through the first few elements of the table to find out what column headings aka prefixes it should have
8715 (save-excursion
8716 (while (not found-all-prefixes)
8717 (let ((prefixes-copy prefixes)
8718 current-prefix
8719 found-prefix)
8720 (while (and prefixes-copy (not found-prefix))
8721 (setq current-prefix (car prefixes-copy))
8722 (when (and (> (length (get-title)) (length current-prefix))
8723 (string= (substring (get-title) 0 (length current-prefix)) current-prefix))
8724 (setq found-prefix t))
8725 (setq prefixes-copy (cdr prefixes-copy)))
8726 (unless found-prefix
8727 (setq current-prefix ""))
8728 (if (and found-prefixes (string= (car (last found-prefixes)) current-prefix))
8729 (setq found-all-prefixes t)
8730 (push current-prefix found-prefixes)))
8731 (outline-next-heading)))
8732 (setq found-prefixes (reverse found-prefixes))
8733
8734 ;; start a new table or repeat the prefixes in the current table
8735
8736 (if (or (not previous-prefixes) (equal previous-prefixes found-prefixes))
8737 (setq output (concat output "|-|\n| "))
8738 (setq output (concat output "|-|\n\n|-|\n| ")))
8739 (setq output (concat output table-title " | "))
8740 (setq previous-prefixes found-prefixes)
8741
8742 ;; add the prefixes
8743 (dolist (prefix found-prefixes)
8744 (setq output (concat output prefix "|")))
8745 (setq output (concat output "\n|-|\n"))
8746
8747
8748 (let (subtree-end)
8749 (while (>= (org-current-level) keybind-level)
8750 (dotimes (i (length found-prefixes))
8751 ;; add keybind name
8752 (when (= i 0)
8753 (setq output (concat output "| " (substring (get-title) (length (car found-prefixes))) " | ")))
8754 ;; add keybinds by searching for regex [keybind] to the start of the next heading
8755 (save-excursion
8756 (outline-next-heading)
8757 (setq subtree-end (point)))
8758 ;; skip over scheduled line
8759 (re-search-forward "^SCHEDULED:" subtree-end t)
8760
8761 ;; see comment after source block to understand this regex
8762 (re-search-forward "^\\s-*\\([^*: ].*?$\\)" subtree-end t)
8763 (let ((m (match-string 1)))
8764 (when m
8765 (setq output (concat output "[[#" (org-custom-id-get (point) 'create) "][" m "]]")))
8766 (setq output (concat output " | ")))
8767 ;; advance to next keybind
8768 (outline-next-heading))
8769 (setq output (concat output "\n"))
8770 ))))))
8771 (setq output (concat output "|-|"))
8772 (insert output))
8773 (org-table-map-tables 'org-table-align 'quietly))
8774
8775
8776 #+END_SRC
8777 after source block due to bad parsing of comments in non emacs lisp mode
8778 some easily forgotten regex elements. whitespace: \\s-
8779 non-greedy star: *?
8780 subexpression for close bracket char or nothing: \\(\\]\\|\\)
8781
8782 * keybind tables
8783 dunno why but it takes doing ctrl-c twice to update this
8784 #+BEGIN: keybind-dblock
8785 |---------------------+------------------------|
8786 | single/special keys | |
8787 |---------------------+------------------------|
8788 | tab key | [[#6c10a716-1d8e-4ce4-8e26-64468f19c17a][isearch]] |
8789 | tab | [[#51ece189-1840-41a1-8ca0-19f9a0481895][isearch-forward]] |
8790 | end | [[#00d589b7-2b8e-494c-b761-3afefebe6ec6][move-end-of-line]] |
8791 | home | [[#7800e455-c3f6-4a8f-8907-b2292449ab67][back-to-indentation]] |
8792 | s-tab | [[#3072901e-5cf3-4d6e-9ac8-3ef64a5f6ad2][indent-buffer]] |
8793 | s-delete | [[#e53728b6-054d-4443-a03e-6cf02d13724d][send-shell]] |
8794 | s-left arrow | [[#d8c473ac-5507-4a6b-9e5a-46558c17b09f][shell]] |
8795 | s-right arrow | [[#2365f5a7-b89a-4a97-b272-ac8ae9c2cc66][previous-buffer]] |
8796 | esc | |
8797 | return | [[#fab6adea-ed20-45ab-a0a3-776c68d5c3a5][new line]] |
8798 | s-return | [[#819cfb55-3a2f-4f20-8591-f819d1a6869a][auto-correct-prev-word]] |
8799 | down arrow | [[#7a868484-9c63-4a73-abda-7751cb2c02be][mark]] |
8800 | s-down arrow | [[#097b97e0-8ad8-40f7-8388-c4ace1706b38][extended command]] |
8801 | s-up arrow | |
8802 |---------------------+------------------------|
8803
8804 |-------------------+----------------------------+---------------------------------+--------------------+---------------+-------------------+-------------|
8805 | mouse | | C- | M- | S- | C-M- | C-S- |
8806 |-------------------+----------------------------+---------------------------------+--------------------+---------------+-------------------+-------------|
8807 | mouse-2 mode line | [[#69aaa631-6fb5-4beb-b2d8-c0f3d92c0a98][mouse-delete-other-windows]] | [[#501479ab-e1e2-497e-bd86-071f8afa3378][mouse-split-window-horizontally]] | | | | |
8808 | mouse-3 mode line | [[#917a1844-8c38-4f31-8616-50fc81334f2c][mouse-delete-window]] | | | | | |
8809 | mouse-1 | [[#4e60e2e4-8c2f-4450-8060-2d793ede530c][set cursor/mark]] | [[#b661f84f-57df-4095-9dc1-d1a876a53ee5][buffer list context menu]] | | | | |
8810 | mouse-2 | [[#086b0b50-054f-462d-92fa-b27852f887b0][paste]] | | | | | |
8811 | mouse-3 | [[#0481632e-9c50-4328-9365-c4b5bf967b66][set-mark]] | [[#9623c78f-7705-4cbe-a990-c24eb1067377][global menu]] | | | | |
8812 | mouse-9 | [[#efaec161-b279-4129-86fd-b410430926e4][move-mouse-to-point]] | | | | | |
8813 | mouse-8 | | | | | | |
8814 | 1/kp-end | | | | | | |
8815 | 2/kp-down | | | | | | |
8816 | 3/kp-next | | | | | | |
8817 | 4/kp-left | [[#c44d0f65-9502-4cc6-9642-96d907f6b093][indent-region]] | | | | | |
8818 | 5/kp-begin | [[#2458c6bc-7113-4d4b-bbdf-206e1cb842a7][mark-defun]] | | | | | |
8819 | 6/kp-right | [[#3b79bc58-6067-43bd-9471-9d592744a25a][ibuffer]] | | | | | |
8820 | 7/kp-home | | | | | | |
8821 | 8/kp-up | | | | | | |
8822 | 9/kp-prior | [[#a3b51adb-4405-4d9f-9b88-a8faa479fbe7][delete-horizontal-space]] | | | | | |
8823 | 10/kp-insert | | | | | | |
8824 | 11/kp-subtract | | | | | | |
8825 | 12/kp-add | | | | | | |
8826 | scroll | [[#33433f0f-5b0e-46ba-8452-d2a51e54769b][up/dn / scroll]] | [[#16506ba5-e8f2-4aec-bc1b-d2854d4e504c][cycle recent buffers]] | [[#e1e2e253-450d-4620-af9e-78d378f49ad5][forward/back s-exp]] | [[#74b2196a-345d-453a-b7be-1915360eb201][expand region]] | [[#bd2ca117-408c-49fc-a5ac-a938be21dfc0][scroll]] | [[#a69254a4-cf2d-450f-b477-2694b44a7e0d][zoom]] |
8827 | left-scroll | [[#d2d5c5c7-f0de-4e08-953b-d41d3e282ba7][left/right]] | [[#7bb95aa5-381e-454a-a6c6-aaeec728db08][back / forward word]] | [[#49db3764-b154-4cfc-8d0d-f0e0451815e3][winner undo redo]] | [[#ca5cdcd4-b3da-4d7b-86ab-4c7c0ac2caf7][---]] | [[#32c00bb2-3e5a-4670-8849-04d23b9f8364][forward/back sexp]] | [[#7b4f1f49-6d93-4210-a30c-8278d6e63655][unreachable]] |
8828 |-------------------+----------------------------+---------------------------------+--------------------+---------------+-------------------+-------------|
8829
8830 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8831 | left primary | C- | M- | C-M- | C-S- |
8832 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8833 | 2 | [[#4f29b011-3844-4a4a-b75d-cdf8f49e9adb][narrow-to-defun/subtree]] | | [[#33c4996d-92bc-4df0-b005-11553677be13][---]] | |
8834 | 3 | [[#7851a05e-7177-4a8f-af5a-3325a8f116fe][dot-mode-execute]] | | [[#9a00e17f-a1c9-48fc-b03b-c6a1a3cbda1c][recenter-top-bottom]] | |
8835 | q | [[#679fd3cd-c43b-409c-be36-4175a5f27cd3][org-cycle, comint previous arg]] | [[#72bada0e-5d62-4a8f-ae62-4972778ff1bc][org-archive-to-archive-sibling]] | [[#1f5e9b63-7ce0-445c-a426-b41839585d38][quoted-insert]] | |
8836 | w | [[#20005b6d-9a9d-4b58-882c-7ce860c7a395][goto-t.org]] | [[#331da6e5-7936-4663-8f58-9d8601b5915c][org-clock-in]] | | |
8837 | e | [[#24e34f4b-d1e8-4380-933f-ab1f78ebc782][copy-line]] | [[#0a771449-0cd5-4dc9-82ca-bcac5f7abd17][org-clock-in-last]] | | |
8838 | r | [[#5c55f461-f43f-493d-81eb-1ca747175ef1][isearch-backward]] | [[#dd9575bd-e471-418e-9519-4fc2b874ddcd][org-clock-out]] | | |
8839 | a | [[#db4b76df-9420-4256-8242-dc44b56d55d7][copy-all]] | [[#e865a1e5-55bf-4a98-a0d0-cb05a88de352][kmacro-start-macro-or-in...]] | [[#c6278a5a-024f-4c80-a8d4-65f127fd24a8][kmacro-end-or-call-macro]] | |
8840 | s | [[#01da04da-cdba-493f-892b-c4c064cf937e][C-x prefix]] | | [[#4b33022d-27f0-4d21-9931-2e2e692790e8][split-window-vertically]] | |
8841 | d | [[#b699614a-9994-4fe7-b2c6-f0fe81b7ad2b][C-c prefix]] | [[#06bcc5e2-f3a7-41c6-a793-ac6c9813fb6e][whitespace-cleanup]] | [[#8cf6053d-792b-4abd-a3a6-66efd7fbee68][swap buffer]] | |
8842 | f | [[#2695ed8a-e0d3-4e84-8688-98e3c50723b0][kill-whole-line]] | | [[#e7e4dd0b-418f-48ee-b366-9e733e3bec61][kill rest of line]] | |
8843 | g | [[#4af40595-7010-4be6-8cfe-a43797ca6e33][other-window / cancel]] | [[#fb0b343f-fdff-463a-94f4-3152191e17c4][abort-recursive-edit]] | [[#327e18af-30b7-47e5-aa53-5f678788b4c1][gnus]] | |
8844 | z | [[#707c4938-a790-4da9-8230-61855ea57d09][undo-tree-undo]] | | | |
8845 | x | [[#ec1403d3-528e-41b1-a195-5563bc93e124][kill-region]] | [[#bb7c95d5-dd97-439d-bf1f-cdac98d11543][append-next-kill]] | [[#c988370e-602c-431c-80a9-608459583f8b][append-next-kill]] | |
8846 | c | [[#400f06e1-8e45-443c-8d7b-3d1bb1176aab][copy]] | [[#f4c3317a-a317-4d04-8cb7-e46d0716bf1d][org-capture]] | [[#0a151d99-47ae-4e8f-8407-82e77d24a3e7][copy-to-register]] | |
8847 | v | [[#16411f68-7fe0-49e8-9a73-212471594f9e][yank]] | [[#d67f6371-a13f-4a75-8d8c-e4013ff4e131][insert-register]] | [[#25f86658-9999-40f7-b3a4-615981751b93][yank pop]] | |
8848 | b | [[#e682305e-0110-4d2f-afbd-2c401bcb9313][delete-other-windows]] | [[#05e3d0db-36dc-455f-8bed-f87886ca6004][isearch-backward-current-symbol]] | [[#6c63790c-28c1-4b73-96e2-ee859f57e734][isearch-current-symbol]] | |
8849 | tab | [[#edc45592-c69f-4439-8305-48f2c65696c3][yas-insert-snippet]] | [[#71264957-45fd-455a-a6d1-b08823c02d25][indent line]] | | |
8850 | delete | [[#2688b61d-9fdd-44af-b9bd-b126f0da00bd][kill-symbol]] | | [[#21876759-a8e6-4896-8a08-eda40d0eaff3][kill-sexp]] | |
8851 | left-arrow | [[#b15da91f-0786-49d1-b0b9-331b3b94f6ae][compile]] | | [[#13faf5d4-34be-4363-948d-4ff04a9f570b][org-shiftup]] | |
8852 | right-arrow | [[#3f3cac16-097d-451a-a14a-da7717d06730][paste selection]] | | [[#34e66314-1d97-4eeb-b704-fe0733849ae4][org-shiftdown]] | |
8853 | backspace | [[#85bb4701-42e6-4617-8de8-dfb1f03b0358][backward-kill-symbol]] | | [[#606b0991-7431-4a8a-a909-b872e104cc88][backward-kill-sexp]] | |
8854 | f7 | | | | |
8855 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8856 | right primary | C- | M- | C-M- | C-S- |
8857 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8858 | * | [[#f745b337-8b65-44cc-849a-5e0953c9ebd9][split-window-horizontally]] | | [[#5dbe3437-7364-4802-b558-00b2d5faacf6][calc-dispatch]] | |
8859 | 9 | [[#43d14154-2722-4ba5-b547-1b78c6274ebf][delete-window-or-exit]] | [[#9dc95338-4321-4354-9de2-69409f383a10][kill-buffer-and-window]] | [[#ffe9f636-31e5-48ba-b8fe-7c158ace744c][kill client buffer]] | |
8860 | u | [[#327992c0-6eba-4935-aec1-49871c2a8619][universal-argument]] | | [[#62735d64-b89a-46b7-b32e-2453b651039d][search-keybind]] | |
8861 | i | [[#3124e200-1d6e-4ad2-9a36-0d03e1e7dc38][-----]] | | [[#a3260b61-7c51-4d97-9a91-3ed702c5ae29][query-replace-regexp]] | |
8862 | o | [[#82215193-63b3-4d63-8f70-d11a328fe72d][occur]] | | [[#05d1ef50-43ee-46d7-b1ad-dd952543ab45][ido-goto-symbol]] | |
8863 | p | [[#9c2e2ba9-f34e-48fe-b4ff-b9826882c1cc][move-mouse-to-point]] | | [[#d55616d3-a3f6-4e83-8807-748578a7b726][delete-horizontal-space]] | |
8864 | j | [[#ebcf7c71-3c93-431b-af6b-7c5df7f2945e][register prefix]] | [[#474a3e12-95ac-4f43-b83a-36716f3e6f76][previous-error]] | | |
8865 | k | [[#25a7ba1c-ddf3-47f1-9516-914a552e7a36][jump to register]] | [[#a96691bb-9e4c-414b-a093-d9961d453e21][next-error]] | [[#f61ea4ea-4597-422e-b7e3-d3cfad82603d][man]] | |
8866 | l | [[#8a7572bd-4b5e-4464-b937-3d35adb1783f][ido-switch-buffer]] | | [[#24b660d4-3ec4-4416-8a6a-b8224ed1ee8b][move cursor top bottom mid]] | |
8867 | ; | [[#7e3710eb-5460-4460-8bf0-488302e4ce35][comment-dwim]] | | [[#28680a96-5223-4632-80b9-b1facdd541e7][comment-current-line-dwim]] | |
8868 | m | [[#deee53ba-dfa2-4910-894c-55ae98d11aa4][pop-to-mark]] | | [[#f283f705-cba0-45db-b80f-5d20415b2eee][recursive grep]] | |
8869 | , | [[#6cbf3a85-f260-453a-920b-850ff5e986b1][ido-find-file]] | | [[#bfdf6111-029d-462b-bcca-50a3ed2162d5][find-file-in-project]] | |
8870 | . | [[#0675c171-8677-44a8-882c-e7ed42715e31][recentf-ido-find-file]] | | [[#824d422c-67b6-4d68-af11-6a2135e528f5][-]] | |
8871 | / | [[#941a7fa8-84b9-434d-89a0-1487385ec479][join lines]] | | [[#37f67593-4f60-4d3b-9aad-6c9bc4882443][copy-variable]] | |
8872 | 8 | [[#251c4a1a-a683-4804-a706-d0d3752e42fa][calc-embedded-word]] | | | |
8873 | up-arrow | [[#f47d312a-063d-42ed-a352-176298a2cb0c][back defun/headline]] | | | |
8874 | down-arrow | [[#27435136-b3d7-4f25-aa85-2a7363a7f366][forward dfun/headline]] | | [[#3bcb35fd-6d54-4213-b94f-2739c0bc0041][toggle-mark-activation]] | [[#1434bdd0-c5a8-4c96-9b92-9474e88fd1c5][smex-major-mode-commands]] |
8875 | lbracket | [[#9d9916dd-3280-47dd-aab1-cd28d5ebfe15][----]] | | [[#7411b1a5-c8fa-4bcc-8788-798e5635dd62][scroll-right]] | |
8876 | rbracket | [[#21b38c6b-3a46-4a08-8eca-d44abb148287][fill-paragraph]] | | [[#c9c18f48-d0ca-4a1b-a751-7165f40118a3][scroll-left]] | |
8877 | return | [[#baf7ea5a-d16d-4fee-a6ce-542cc11beb97][newline next line]] | [[#e6895ad3-a2c8-46c8-abbc-1bba94a88596][non-indented newline]] | [[#2a8fc6ea-a550-4437-9e35-3b3f2776788a][open newline on previous line]] | |
8878 | space | [[#132daa1a-8e5f-47f1-a28d-35bee873aeac][org-edit-special]] | | [[#02359b66-bf6e-4f41-9f03-e83fcbe3e68c][spell check word]] | |
8879 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8880 | left secondary | C- | M- | C-M- | C-S- |
8881 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8882 | = | | | | |
8883 | 1 | | | | |
8884 | 4 | | | [[#3ff50f5f-f286-4a73-962b-58dbcf3b09b1][widen]] | |
8885 | 5 | | | | |
8886 | tab-key | [[#68313551-90cd-47a6-8170-1745348add17][query-replace]] | | | |
8887 | t | [[#aaac3048-9125-4fd5-b8f2-21bafcc1ff1c][org change todo state]] | | [[#5bc609b1-9428-4b82-a55d-811fefe65331][org insert timestamp]] | |
8888 | home | [[#1919659a-b466-4519-9276-8bf06a916066][start of buffer]] | | | |
8889 | end | [[#0a7bd629-cbcc-4761-8fe2-cc9370b985a4][end of buffer]] | | | |
8890 | f9 | | | | |
8891 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8892 | right secondary | C- | M- | C-M- | C-S- |
8893 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8894 | 6 | [[#e44e584b-d925-4036-9ad5-a90d02e74bef][save-buffers-kill-emacs]] | | [[#da73de75-0914-4f48-81d5-9b408433b14b][insert-small-copyright]] | |
8895 | 7 | | | [[#a68c6b8e-9911-475e-ab35-e239771fe881][insert-full-copyright]] | |
8896 | 0 | | | | |
8897 | - | | | | |
8898 | y | [[#97aee7f1-3647-4602-a65a-45e8a3aa3a7c][undo-tree-redo]] | | | |
8899 | \ | [[#b8ad3ee9-7bf6-4069-a300-49cd298008a7][sr-speedbar-toggle]] | | [[#6a583354-48f8-4503-bf87-b8ba56411435][mark-defun]] | |
8900 | h | [[#3c5f241f-fc62-459d-ab85-6b7c1fb04801][help-prefix]] | | | |
8901 | ' | [[#9f252721-a2d5-46c6-b268-8ed597256229][eval-expression]] | | | |
8902 | n | [[#52ebb720-589b-485c-89dc-0dfb78e6dad4][unpop-to-mark-command]] | | [[#43997316-8d3f-4750-873b-ade09628fdd5][narrow-to-region]] | |
8903 | rshift | | | | |
8904 | escape | [[#6901fa1b-c827-4525-b24b-bdb8fe5f638b][find-tag]] | | | |
8905 |-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
8906 #+END:
8907
8908 * persistent registers
8909 This needs to be at the end, because I visit a file, thus setting a
8910 mode, and the mode hook needs to be setup before that.
8911
8912 I'm using persistent registers instead of bookmarks. I dun use them
8913 much, so the added hassle of having to set it within this file is
8914 worth the benefit of only having one concept in my mind.
8915 #+begin_src emacs-lisp
8916 (dolist
8917 (r `((?i (file . ,"~/.emacs.d/my-init.org"))
8918 ))
8919 (set-register (car r) (cadr r)))
8920 #+end_src
8921
8922 * keybind notes
8923 common keys, which would be better off doing swaps than rebinds:
8924 c-x prefix -> c-s
8925 c-c prefix -> c-d
8926 yank c-y -> c-c
8927 search c-s -> kp-add
8928 kill line c-k -> c-f
8929 undo c-_ -> c-z
8930 set-mark-command c-@ -> kp-enter
8931 quoted-insert c-q -> c-m-q
8932 recenter-top-bottom c-l -> c-m-3
8933 kill-region c-w -> c-x
8934
8935 commands to make less accessible
8936 narrow-to-defun/subtree -> M-2 maybe
8937 occur
8938
8939 command to make more accessible, ...
8940
8941
8942 * misc useful functions I'd rather have in a list than burried
8943 #+begin_src emacs-lisp :tangle no
8944 ;; these are usefull with (goto-char)
8945 ;; find named entity, other than headline
8946 (org-find-entry-with-id "string-number-or-symbol")
8947
8948 (org-find-exact-headline-in-buffer "heading" nil t)
8949
8950 (byte-recompile-file (expand-file-name "~/.emacs.d/my-init.el") t 0)
8951 (byte-recompile-directory (expand-file-name "~/.emacs.d") 0)
8952 (byte-recompile-directory (expand-file-name "~/.emacs.d/src/haskell-mode") 0)
8953
8954 ;; remove any indent level which is throughout the buffer
8955 (org-do-remove-indentation)
8956
8957 #+end_src
8958
8959 * TESTING / DEVELOPMENT AREA
8960
8961 :PROPERTIES:
8962 :tangle: no
8963 :END:
8964 ** new
8965 #+begin_src emacs-lisp
8966
8967
8968 #+end_src
8969
8970 ** key logging
8971 this article convinced me that trying to experiment with modal editing is a waste.
8972 http://chrisdone.com/posts/speculations-on-exclusive-editing
8973 I want to record my emacs commands simply to find optimiaztions, like if I often do some M-x command and should bind it
8974 to a key.
8975
8976
8977 #+begin_src emacs-lisp :tangle no
8978
8979 (setq keylog-list nil)
8980 (setq keylog-mode nil)
8981
8982 (defun keylog-save ()
8983
8984 ;; Check that the lock file does not exist
8985 (when (keyfreq-file-is-unlocked)
8986 ;; Lock the file
8987 (keyfreq-file-claim-lock)
8988
8989 ;; Check that we have the lock
8990 (if (eq (keyfreq-file-owner) (emacs-pid))
8991 (unwind-protect
8992 (progn
8993 ;; Load values and merge them with the current keyfreq-table
8994 (keyfreq-table-load table)
8995
8996 ;; Write the new frequencies
8997 (with-temp-file keyfreq-file
8998 (prin1 (cdr (keyfreq-list table 'no-sort)) (current-buffer))))
8999
9000 ;; Release the lock and reset the hash table.
9001 (keyfreq-file-release-lock)
9002 (clrhash table))
9003 )))
9004
9005 (defun my-keylogger-function ()
9006 (setq keylog-list (cons (list (current-time) current-prefix-arg this-command) keylog-list)))
9007 (add-hook 'pre-command-hook 'my-keylogger-function)
9008
9009 #+end_src
9010
9011 in a lisp expression, ; \\[ throws off forward-sexp
9012 when not in emacs lisp mode,
9013 even with (with-syntax-table emacs-lisp-mode-syntax-table
9014 forward-sexp)
9015 which is found in preceding-sexp
9016 potentially a bug, either in with-syntax-table, or
9017 in scan-lists, which is implemented in C
9018
9019
9020
9021
9022 why did it go to the init file?
9023 change EDITOR to emacsclient
9024 xserver-xorg-core=2:1.14.3-3ubuntu2
9025 (setq-default header-line-format nil) ; Copy mode-line
9026 (setq-default mode-line-format nil) ;
9027
9028
9029 #+RESULTS:
9030 : set-food-completions
9031
9032
9033
9034 useless gnus group keys:
9035 a
9036 c
9037
9038
9039 (add-to-list 'load-path "~/.emacs.d/emacs/site-lisp/org")
9040
9041 #+begin_src emacs-lisp
9042 (add-hook 'org-mode-hook
9043 (lambda () (define-key org-mode-map (kbd "C-y") nil)))
9044
9045 #+end_src
9046
9047
9048
9049
9050 (defun comint-send-string (process string)
9051 "Like `process-send-string', but also does extra bookkeeping for Comint mode."
9052 (if process
9053 (with-current-buffer (if (processp process)
9054 (process-buffer process)
9055 (get-buffer process))
9056 (comint-snapshot-last-prompt))
9057 (comint-snapshot-last-prompt))
9058 (process-send-string process string))
9059
9060
9061 * python
9062 todo: get smart-operator to work
9063 todo, checkout https://github.com/python-rope/ropemacs refactoring python,
9064 todo, try py-autopep8, autoformatter
9065 todo, check out some python linting stuff. pychecker is one, others are in *packages*
9066 todo, finish reading through python-mode.el functions
9067 ;; todo, figure out multi-line input in shell mode
9068
9069
9070 usefull m-x commands:
9071 m-x py-describe-mode: doc for mode which is extensive
9072 m-x py-sort-imports
9073 m-x py-guess-indent-offset: setup indent for code i didn't write
9074
9075 possibly usefull commands:
9076 found via looking through python-mode.el, quit like 1/4 through, cuz its tedious, last spot was at:
9077 (defun py-comment-region (beg end &optional arg)
9078 after finding py-describe-mode, it seemed to do a good job of documenting all the most important stuff
9079
9080 py-switch-to-python
9081 python-shell-completion-complete-or-indent may be usefull to get completion working in the shell
9082 py-insert-default-shebang
9083 py-electric-*
9084 py-indent-line-outmost
9085 py-newline-and-close-block
9086 py-indent-and-forward (indent line, move to next)
9087 py-fill-*
9088 py-which-function (for showing in the modeline)
9089 py-help-at-point
9090 py-execute-import-or-reload
9091 py-execute-def-or-class
9092 various pdb functions
9093
9094
9095 installing jedi
9096 #+begin_src sh :tangle no
9097 pi python-pip
9098 s pip install jedi virtualenv
9099 #+end_src
9100 then do m-x jedi:install-server
9101
9102
9103
9104 disabled because it takes 152 ms to load,
9105 and I don't know how to do it conditioally
9106 #+begin_src emacs-lisp :tangle no
9107
9108 ;; change from default python3 to be compatibile with Pywikibot
9109 (setq py-shell-name "/usr/bin/python")
9110 (require 'python-mode)
9111
9112 (setq py-autopep8-options '("--max-line-length=110"))
9113
9114 (defun py-execute-block-or-clause-create-shell ()
9115 (interactive)
9116 (cond ((get-buffer "*Python*")
9117 (py--execute-prepare "block-or-clause")
9118 (py-execute-block-or-clause)
9119 (call-interactively 'next-line))
9120 (t
9121 (py-shell)
9122 ;; py-shell starts the shell but not display the buffer on the first run
9123 ;; subsequent runs, it does. I grabbed this command from inside to
9124 ;; do just the relevant part from the second run, as a hack.
9125 ;; todo: report a bug on this
9126 (py--shell-manage-windows py-buffer-name))))
9127 (setq py-tab-shifts-region-p t)
9128 (setq py-tab-indents-region-p t)
9129
9130 (defun py-run ()
9131 "default action to run the current buffer"
9132 (basic-save-buffer)
9133 (py-execute-buffer))
9134
9135
9136 (add-hook 'python-mode-hook
9137 (lambda ()
9138 (setq run-fun 'py-run)
9139 (define-key python-mode-map (kbd "C-M-a") nil)
9140 (define-key python-mode-map (kbd "C-M-d") nil)
9141 (define-key python-mode-map (kbd "C-M-e") nil)
9142 (define-key python-mode-map (kbd "C-M-h") nil)
9143 (define-key python-mode-map (kbd "C-M-i") nil)
9144 (define-key python-mode-map (kbd "C-M-u") nil)
9145 (define-key python-mode-map (kbd "C-M-x") nil)
9146 (define-key python-mode-map (kbd "<tab>") 'indent-for-tab-command)
9147 (define-key python-mode-map (kbd "C-j") nil)
9148 (define-key python-mode-map (kbd "<C-backspace>") nil)
9149 ;;(define-key python-mode-map (kbd "C-(") (lambda () (interactive) (basic-save-buffer) (py-execute-buffer)))
9150 ;; fix default return bindings
9151 (define-key python-mode-map (kbd "C-j") nil)
9152 (define-key python-mode-map (kbd "RET") nil)
9153 (define-key python-mode-map (kbd "<return>") 'py-newline-and-indent)
9154 (define-key python-mode-map (kbd "<M-tab>") 'py-indent-line)
9155 (define-key python-mode-map (kbd "C-M-(") 'py-shift-left)
9156 (define-key python-mode-map (kbd "C-M-)") 'py-shift-right)
9157 (define-key python-mode-map (kbd "<home>") 'py-beginning-of-line)
9158 (define-key python-mode-map (kbd "<end>") 'py-end-of-line)
9159 (define-key python-mode-map (kbd "C-t") 'py-execute-block-or-clause-create-shell)
9160 (define-key python-mode-map (kbd "<S-delete>") 'py-ian-execute-line-or-region)
9161 ;; python mode adds these to this list, which is normally empty.
9162 ;; it makes my send-python function not reuse an existing python shell window
9163 ;; there are other ways to override this, but I don't know of any other value of
9164 ;; having this set.
9165 (setq same-window-buffer-names (delete "*Python*" same-window-buffer-names))
9166 (setq same-window-buffer-names (delete "*IPython*" same-window-buffer-names))))
9167
9168 ;; i dunno, why, but this didn't work:
9169 ;; and we can't eval-after-load cuz it is part of the greater python mode file
9170 (add-hook 'py-shell-hook
9171 (lambda ()
9172 (define-key py-shell-map "\r" nil)
9173 (define-key py-shell-map (kbd "<return>") 'comint-send-input)
9174 (define-key py-shell-map (kbd "C-t") 'py-shell-toggle-arrow-keys)
9175 (define-key py-shell-map "\C-d" nil)
9176 (define-key py-shell-map (kbd "<up>") 'my-comint-previous-input)
9177 (define-key py-shell-map (kbd "<down>") 'my-comint-next-input)))
9178
9179
9180 (defun py-ian-execute-line-or-region ()
9181 (interactive)
9182 (cond ((get-buffer "*Python*")
9183 (if mark-active
9184 (py-execute-region)
9185 (py-execute-statement))
9186 (call-interactively 'next-line))
9187 (t (py-shell))))
9188
9189 ;; http://tkf.github.io/emacs-jedi/latest/
9190 (add-hook 'python-mode-hook 'jedi:setup)
9191 (setq jedi:complete-on-dot t)
9192
9193 (defun py-shell-toggle-arrow-keys ()
9194 (interactive)
9195 (toggle-arrow-keys py-shell-map))
9196
9197 #+end_src
9198
9199
9200 ;; py-shell window stuff
9201 ;; it splits the window if the shell is in a different frame
9202 ;; which seems to be a bug, but it can be fixed with this option
9203 ;; (setq py-keep-windows-configuration 'force)
9204 ;; however, with py-execute-block-or-clause, if the shell is in a different frame,
9205 ;; you get errors "buffer is read only", when the point is near the beginning of a command
9206 ;; todo: test with emacs -Q and file a bug
9207 ;; if you execute py-execute-... without a python shell open,
9208 ;; it starts one, doesn't display it, and subsequent py-execute commands
9209 ;; give error "buffer is read only"
9210 ;; these functions fix / improve these problems
9211
9212
9213 ** initial python-mode setup
9214
9215 python-mode seems to be the most canonical package, based on
9216 https://docs.python.org/devguide/emacs.html
9217 much more feature rich than the emacs built in one.
9218
9219 getting it, it wants you to setup an account on launchpad by default,
9220 there is some way to get anonymous bzr access, but google didn't answer it right away,
9221 so fuck it, ill go the happy path.
9222
9223 based on error messages,
9224 add public ssh key to https://launchpad.net/people/+me
9225 bzr launchpad-login iank
9226 cd ~/.emacs.d/src/
9227 bzr branch lp:python-mode
9228
9229 add lines from INSTALL to init
9230
9231
9232 ** background on packages
9233 jedi appears most popular based on github stats
9234 pysmell appears dead
9235 ac-python appears dead
9236 https://github.com/proofit404/anaconda-mode seems to be kicking along
9237
9238
9239 ** misc notes:
9240
9241 python-mode has a TON of functions that are just aliases or verbatim wrappers of other functions.
9242 also has undocumented/unused vars all around. it is quite annoying.
9243
9244 the dedicated argument to py-shell does nothing,
9245 and py-dedicated-shell just sets that, so it is a waste
9246
9247
9248 ** background on sending to python shell
9249
9250 using the builtin python execute shell functions, sending one line doesn't really work well.
9251 The bulit in functions don't wait for further input if a block is not closed.
9252 And doing a copy/paste thing gets messed up because of indents.
9253 With some hacking, I could probably do copy/paste and remove indents, only to a
9254 certain level if we have entered a block and are waiting to finish it.
9255 But just doing the builtin execute block is a decent work around.
9256
9257
9258 Here is the scrapped function for single line built in sending to shell.
9259
9260
9261 (setq w32-enable-num-lock nil)
9262 (global-set-key (kbd "<num_lock>") 'left-char)
9263
9264
9265 (defun sqlup-find-correct-keywords ()
9266 "If emacs is handling the logic for syntax highlighting of SQL keywords, then we piggyback on top of that logic. If not, we use an sql-mode function to create a list of regular expressions and use that."
9267 (mapcar 'car (sql-add-product-keywords sql-product '())))
9268
9269
9270 largest subarray sum, array of pos and neg ints.