├── README.org ├── botler.el ├── colors.el ├── dustycloud.el ├── finalize.el ├── general.el ├── gpl-3.0.txt ├── hacks ├── shelly.el └── wisp2lisp.el ├── mode-line.el ├── modes ├── ace-jump.el ├── auto-complete.el ├── bbdb.el ├── beancount.el ├── browse-kill-ring.el ├── calfw.el ├── column-marker.el ├── company.el ├── css.el ├── debbugs.el ├── diminish.el ├── ediff.el ├── eldoc.el ├── elfeed.el ├── elget.el ├── emacspeak.el ├── emms.el ├── erc.el ├── eshell.el ├── eww-shr.el ├── exwm.el ├── flymake.el ├── geiser.el ├── guix.el ├── helm.el ├── highlight-parentheses.el ├── highlight-sexps.el ├── hy-mode.el ├── identica.el ├── ido.el ├── jedi.el ├── js-mode.el ├── ledger.el ├── longlines.el ├── magit.el ├── mediawiki.el ├── mozrepl.el ├── mu4e.el ├── muse.el ├── nodejs-repl.el ├── orderless.el ├── org-norang.el ├── org-roam.el ├── org.el ├── page-break-lines.el ├── paredit.el ├── php.el ├── planner.el ├── racket-mode.el ├── rainbow-delimiters.el ├── rainbow-identifiers.el ├── remember.el ├── rhtml.el ├── ri.el ├── scheme.el ├── shell.el ├── skribe-mode.el ├── slime.el ├── smartparens.el ├── smex.el ├── spaceline.el ├── switch-window.el ├── tramp.el ├── uniquify.el ├── vala.el ├── vertico.el ├── visual-regexp.el ├── w3m.el ├── weather.el ├── web-mode.el ├── wisp-mode.el ├── wordcount.el └── yasnippet.el └── yas-snippets ├── beancount-mode └── tr.yasnippet ├── ledger-mode └── a:b:c.yasnippet ├── org-mode ├── FUD ├── notes └── quote ├── python-mode ├── cc-cc0 ├── class.yasnippet └── def.yasnippet └── scheme-mode └── record /README.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Christine Lemmer-Webber's emacs config 2 | 3 | * Intro 4 | 5 | Welcome to my .emacs config. It's got some structure to it, but it's 6 | kind of grown organically over the years. Hopefully it's useful for 7 | you. Keep in mind, a lot of stuff in here is stuff that's probably 8 | been around since I started using emacs and had no idea what I was 9 | doing in 2003. I clean it up occasionally, but uh... expect cruft. 10 | 11 | So the way I install things currently is kind of goofy. I used to 12 | have multiple machines that all shared this config, but I mostly just 13 | use my laptop these days. Nonetheless, my .emacs looks more or less 14 | like this: 15 | 16 | #+BEGIN_SRC emacs-lisp 17 | ;; Load up the general config 18 | (load-file "~/.config/emacs/general.el") 19 | 20 | ;; El-get! This installs a bunch of the modes I use 21 | (load-file "~/.config/emacs/modes/elget.el") 22 | 23 | ;; Modes 24 | (load-file "~/.config/emacs/modes/bbdb.el") 25 | (load-file "~/.config/emacs/modes/column-marker.el") 26 | (load-file "~/.config/emacs/modes/css.el") 27 | (load-file "~/.config/emacs/modes/erc.el") 28 | (load-file "~/.config/emacs/modes/eshell.el") 29 | (load-file "~/.config/emacs/modes/flymake.el") 30 | (load-file "~/.config/emacs/modes/identica.el") 31 | (load-file "~/.config/emacs/modes/ledger.el") 32 | (load-file "~/.config/emacs/modes/longlines.el") 33 | (load-file "~/.config/emacs/modes/magit.el") 34 | (load-file "~/.config/emacs/modes/mozrepl.el") 35 | (load-file "~/.config/emacs/modes/yasnippet.el") 36 | (load-file "~/.config/emacs/modes/org.el") 37 | (load-file "~/.config/emacs/modes/php.el") 38 | (load-file "~/.config/emacs/modes/tramp.el") 39 | (load-file "~/.config/emacs/modes/visual-regexp.el") 40 | (load-file "~/.config/emacs/modes/w3m.el") 41 | (load-file "~/.config/emacs/modes/wordcount.el") 42 | (load-file "~/.config/emacs/modes/ido.el") 43 | (load-file "~/.config/emacs/modes/smex.el") 44 | (load-file "~/.config/emacs/modes/uniquify.el") 45 | (load-file "~/.config/emacs/modes/mu4e.el") 46 | (load-file "~/.config/emacs/modes/ediff.el") 47 | (load-file "~/.config/emacs/modes/ace-jump.el") 48 | (load-file "~/.config/emacs/modes/web-mode.el") 49 | 50 | ;; Install a custom mode line 51 | (load-file "~/.config/emacs/mode-line.el") 52 | 53 | ;; Finalize things 54 | (load-file "~/.config/emacs/finalize.el") 55 | 56 | ;; Some custom tools 57 | (load-file "~/devel/magit-review/magit-review.el") 58 | (load-file "~/devel/org-diet/org-diet.el") 59 | (load-file "~/.config/emacs/dustycloud.el") 60 | 61 | ;; Load colors and theme things 62 | (load-file "~/.config/emacs/colors.el") 63 | 64 | ;; Because I load different font sizes on different computers 65 | ; (set-default-font "inconsolata-12") 66 | (set-default-font "mono-9") 67 | #+END_SRC 68 | 69 | You can include whatever modes you want. But let's face it, people 70 | who aren't me will probably just pick and choose from this repo. 71 | Which makes sense! 72 | 73 | Anyway, maybe it's useful to you, maybe not. 74 | 75 | * Licensing 76 | 77 | All original code in here GPLv3 or later, as published by the FSF. 78 | You shoulda received a [[file:./gpl3.0.txt][copy of the GPL]] with this repository, but if 79 | not, check it out on the intarwebs: 80 | http://www.gnu.org/copyleft/gpl.html 81 | 82 | It's a bit more complicated because some of this stuff is snippets I 83 | took from emacswiki and other sources around the web. It should be 84 | all GPLv3+ but uh... 85 | 86 | Oh yeah, a couple of cool sources if you want to look into more stuff. 87 | Lots of this stuff borrowed from these places... 88 | - http://www.emacswiki.org/ 89 | - http://doc.norang.ca/org-mode.html 90 | - http://orgmode.org/worg/ 91 | 92 | This particular document waived into the public domain via: 93 | http://creativecommons.org/publicdomain/zero/1.0/ 94 | 95 | Have fun! 96 | -------------------------------------------------------------------------------- /botler.el: -------------------------------------------------------------------------------- 1 | (add-to-list 'load-path "~/elisp/emacs-jabber") 2 | (require 'jabber) 3 | 4 | (load-file "~/.emacs.d/emacs-jabberbot-login.el") 5 | 6 | (defun botler->appt-message-me (min-to-app new-time appt-msg) 7 | "Message me about an upcoming appointment." 8 | (let ((message-body 9 | (format "Appointment %s: %s%s" 10 | (if (string-equal "0" min-to-app) "now" 11 | (format "in %s minute%s" min-to-app 12 | (if (string-equal "1" min-to-app) "" "s"))) 13 | new-time appt-msg))) 14 | (jabber-send-sexp 15 | (jabber-find-connection "emacs@dustycloud.org") 16 | `(message ((to . "cwebber@dustycloud.org") 17 | (type . "normal")) 18 | (body () ,message-body))))) 19 | 20 | ; I don't care when people come online to my bot's roster. 21 | (setq jabber-alert-presence-hooks nil) 22 | 23 | (setq appt-disp-window-function 'botler->appt-message-me) 24 | (setq appt-delete-window-function (lambda ())) 25 | 26 | (setq appt-display-inverval 5) ; maybe 6 is better? 27 | 28 | (setq jabber-auto-reconnect t) 29 | -------------------------------------------------------------------------------- /colors.el: -------------------------------------------------------------------------------- 1 | ;;; Color theme setup, with cycling 2 | ;;; ----- 3 | 4 | (add-to-list 'load-path "~/devel/naquadah-theme/") 5 | (add-to-list 'load-path "~/devel/snowy-theme/") 6 | 7 | (require 'snowy-theme) 8 | (require 'naquadah-theme) 9 | ;; (load-theme 'snowy t) 10 | (load-theme 'naquadah t) 11 | 12 | (when (not window-system) 13 | (set-face-attribute 'region nil :background "blue")) 14 | 15 | ; Make the ansi-term blue not so painful 16 | (setq ansi-color-names-vector 17 | ["black" "red" "green" "yellow" "#729fcf" 18 | "magenta" "cyan" "white"]) 19 | (setq ansi-color-map (ansi-color-make-color-map)) 20 | 21 | (defun cwebber/medium-font () 22 | (interactive) 23 | (set-frame-font "Liberation Mono-12")) 24 | 25 | (defun cwebber/small-font () 26 | (interactive) 27 | (set-frame-font "Inconsolata-12")) 28 | -------------------------------------------------------------------------------- /dustycloud.el: -------------------------------------------------------------------------------- 1 | (setq dustycloud-content-dir "~/devel/dustycloud/posts/") 2 | 3 | (setq dustycloud-rst-snippet "${1:$(make-string (string-width yas/text) ?\=)} 4 | ${1:Title} 5 | ${1:$(make-string (string-width yas/text) ?\=)} 6 | 7 | :date: `(format-time-string \"\%Y-\%m-\%d \%H:\%M\")` 8 | :author: Christine Lemmer-Webber 9 | :tags: $2 10 | 11 | $0") 12 | 13 | (setq dustycloud-md-snippet "title: ${1:Title} 14 | date: `(format-time-string \"\%Y-\%m-\%d \%H:\%M\")` 15 | author: Christine Lemmer-Webber 16 | tags: $2 17 | --- 18 | $0") 19 | 20 | (setq dustycloud-html-snippet "title: ${1:Title} 21 | date: `(format-time-string \"\%Y-\%m-\%d \%H:\%M\")` 22 | author: Christine Lemmer-Webber 23 | tags: $2 24 | --- 25 | $0 26 | ") 27 | 28 | 29 | (defun dustycloud-compose () 30 | "Compose a new document for the dustycloud blog" 31 | (interactive) 32 | (let ((default-directory dustycloud-content-dir)) 33 | (call-interactively 'find-file)) 34 | (let ((file-extension 35 | (progn (string-match "\\.\\(html\\|rst\\|md\\)$" buffer-file-name) 36 | (match-string 1 buffer-file-name))) 37 | (yas/indent-line nil) 38 | (yas/wrap-around-region nil)) 39 | ;; Expand the appropriate snippet (or throw an error if unrecognized) 40 | (cond ((equal file-extension "rst") 41 | (yas-expand-snippet dustycloud-rst-snippet)) 42 | ((equal file-extension "md") 43 | (yas-expand-snippet dustycloud-md-snippet)) 44 | ((equal file-extension "html") 45 | (setq-local web-mode-disable-auto-indentation t) 46 | (yas-expand-snippet dustycloud-html-snippet)) 47 | (t 48 | (error "File extension not .md or .html"))))) 49 | 50 | 51 | (defun mediagoblin-compose () 52 | (interactive) 53 | (let ((dustycloud-content-dir "~/devel/mediagoblin-website/content/")) 54 | (dustycloud-compose))) 55 | -------------------------------------------------------------------------------- /finalize.el: -------------------------------------------------------------------------------- 1 | ;; Turn off menu-bar-mode. 2 | (let ((menu-bar-mode 0)) 3 | (call-interactively 'menu-bar-mode)) 4 | 5 | (calendar) 6 | -------------------------------------------------------------------------------- /general.el: -------------------------------------------------------------------------------- 1 | ;; ----- 2 | ;; Require misc stuff 3 | ;; ------ 4 | (require 'nxml-mode) 5 | (require 'python) 6 | (require 'ruby-mode) 7 | (require 'epa-file) 8 | (require 'ibuffer) 9 | (epa-file-enable) 10 | 11 | ;; ------ 12 | ;; Place backups in ~/.backups/ directory, like a civilized program. 13 | ;; ------ 14 | (if (file-directory-p "~/.backup") 15 | (setq backup-directory-alist '(("." . "~/.backup"))) 16 | (message "Directory does not exist: ~/.backup")) 17 | (setq backup-by-copying t ; Don't delink hardlinks 18 | delete-old-versions t ; Clean up the backups 19 | version-control t ; Use version numbers on backups, 20 | kept-new-versions 3 ; keep some new versions 21 | kept-old-versions 2) ; and some old ones, too 22 | ;; --------- 23 | 24 | ;; --------- 25 | ;; Make debian/ubuntu work nicely with cvs emacs 26 | ;; --------- 27 | ;; (let ((startup-file "/usr/share/emacs/site-lisp/debian-startup.el")) 28 | ;; (if (and (or (not (fboundp 'debian-startup)) 29 | ;; (not (boundp 'debian-emacs-flavor))) 30 | ;; (file-readable-p startup-file)) 31 | ;; (progn 32 | ;; (load-file startup-file) 33 | ;; (setq debian-emacs-flavor 'emacs22) 34 | ;; (debian-startup debian-emacs-flavor) 35 | ;; (mapcar '(lambda (f) 36 | ;; (and (not (string= (substring f -3) "/..")) 37 | ;; (file-directory-p f) 38 | ;; (add-to-list 'load-path f))) 39 | ;; (directory-files "/usr/share/emacs/site-lisp" t))))) 40 | 41 | ;; --------- 42 | ;; Generic keybindings 43 | ;; --------- 44 | 45 | ; (please move more here soon) 46 | (global-set-key (kbd "C-x C-b") 'ibuffer) 47 | (global-set-key (kbd "C-c fd") 'find-dired) 48 | (global-set-key (kbd "C-c d") 'diff-buffer-with-file) 49 | (global-set-key (kbd "C-c R") 'revert-buffer) 50 | 51 | ; These should be made more local when I figure out how 52 | 53 | ;; Life-hack keybindings 54 | 55 | (global-set-key (kbd "C-c lc") 'calendar) 56 | (global-set-key (kbd "C-c lp") 'plan) 57 | 58 | 59 | ;; ------ 60 | ;; General config BS 61 | ;; ------ 62 | 63 | (setq max-specpdl-size 9000) 64 | 65 | (when (not window-system) 66 | ;;allow you to see the region when in console mode 67 | (setq transient-mark-mode t)) 68 | 69 | ;; Shell stuff 70 | (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) 71 | 72 | (setq ispell-alternate-dictionary "/etc/dictionaries-common/words") 73 | 74 | (setq diary-file "~/org/diary") 75 | (setq tex-dvi-view-command 76 | (if (eq window-system 'x) "xdvi" "dvi2tty * | cat -s")) 77 | 78 | ; tab auto-completion cycling is evil. 79 | (setq pcomplete-cycle-completions nil) 80 | 81 | ;; Make sure that pressing middle mouse button pastes right at point, 82 | ;; not where the mouse cursor is. 83 | (setq mouse-yank-at-point t) 84 | 85 | ;; Don't show my password when I'm entering it, kthx. 86 | (add-hook 'comint-output-filter-functions 87 | 'comint-watch-for-password-prompt) 88 | 89 | 90 | (put 'downcase-region 'disabled nil) 91 | (put 'narrow-to-region 'disabled nil) 92 | (put 'upcase-region 'disabled nil) 93 | (setq inhibit-splash-screen t) 94 | 95 | (setq column-number-mode 1) 96 | 97 | (setq visual-line-fringe-indicators '(t t)) 98 | 99 | ; Don't switch to another frame with iswitchb 100 | (setq iswitchb-default-method 'samewindow) 101 | 102 | ; Use diff -u 103 | 104 | (setq diff-switches "-u") 105 | 106 | 107 | ;; ------ 108 | ;; Initialize some things 109 | ;; ------ 110 | 111 | ; (display-time) 112 | (server-start) 113 | 114 | ;; Mouse scrolling 115 | (mwheel-install) 116 | 117 | ;; Shift-arrowkey based movement 118 | (when (fboundp 'windmove-default-keybindings) 119 | (windmove-default-keybindings)) 120 | 121 | ;; ------ 122 | ;; Terminal / window specific stuff 123 | ;; ------ 124 | 125 | ;; Don't minimize my emacs! Honestly wtf 126 | (when window-system 127 | (progn 128 | (global-unset-key (kbd "C-z")) 129 | (global-unset-key (kbd "C-x C-z")) 130 | (setq scroll-bar-mode nil) 131 | (tool-bar-mode nil) 132 | (menu-bar-mode nil))) 133 | 134 | 135 | ;; --------- 136 | ;; Custom funcs 137 | ;; --------- 138 | 139 | (defun other-window-backward (&optional n) 140 | "Select Nth previous window." 141 | (interactive "P") 142 | (other-window (- (prefix-numeric-value n)))) 143 | 144 | (defun warn-if-symlink () 145 | (if (file-symlink-p buffer-file-name) 146 | ;progn here to execute both as part of else statement together 147 | (message "File is a symlink"))) 148 | 149 | (add-hook 'find-file-hooks 'warn-if-symlink) 150 | 151 | 152 | ;; creating a scratch buffer command 153 | (defun create-scratch-buffer nil 154 | "create a scratch buffer" 155 | (interactive) 156 | (switch-to-buffer (get-buffer-create "*scratch*")) 157 | (lisp-interaction-mode) 158 | (insert ";; This buffer is for notes you don't want to save, and for Lisp evaluation. 159 | ;; If you want to create a file, visit that file with C-x C-f, 160 | ;; then enter the text in that file's own buffer. 161 | 162 | ")) 163 | 164 | 165 | ;; If the *scratch* buffer is killed, recreate it automatically 166 | ;; FROM: Morten Welind 167 | ;;http://www.geocrawler.com/archives/3/338/1994/6/0/1877802/ 168 | (save-excursion 169 | (set-buffer (get-buffer-create "*scratch*")) 170 | (lisp-interaction-mode) 171 | (make-local-variable 'kill-buffer-query-functions) 172 | (add-hook 'kill-buffer-query-functions 'kill-scratch-buffer)) 173 | 174 | (defun kill-scratch-buffer () 175 | ;; The next line is just in case someone calls this manually 176 | (set-buffer (get-buffer-create "*scratch*")) 177 | ;; Kill the current (*scratch*) buffer 178 | (remove-hook 'kill-buffer-query-functions 'kill-scratch-buffer) 179 | (kill-buffer (current-buffer)) 180 | ;; Make a brand new *scratch* buffer 181 | (set-buffer (get-buffer-create "*scratch*")) 182 | (lisp-interaction-mode) 183 | (make-local-variable 'kill-buffer-query-functions) 184 | (add-hook 'kill-buffer-query-functions 'kill-scratch-buffer) 185 | ;; Since we killed it, don't let caller do that. 186 | nil) 187 | 188 | ;; Highlight previous (or current?) line 189 | (defun pg-uline (ulinechar) 190 | "Underline the current or the previous line with ULINECHAR" 191 | (interactive "cUnderline with:") 192 | (if (looking-at "^$") 193 | (next-line -1)) 194 | (end-of-line) 195 | (let ((linelen (current-column))) 196 | (insert "\n") 197 | (while (> linelen 0) 198 | (setq linelen (1- linelen)) 199 | (insert ulinechar))) 200 | (insert "\n")) 201 | 202 | (global-set-key (kbd "C-c u") 'pg-uline) 203 | 204 | 205 | ;; Swapping buffers! Can't live without this 206 | 207 | (setq cwebber/swapping-buffer nil) 208 | (setq cwebber/swapping-window nil) 209 | 210 | (defun cwebber/swap-buffers-in-windows () 211 | "Swap buffers between two windows" 212 | (interactive) 213 | (if (and cwebber/swapping-window 214 | cwebber/swapping-buffer) 215 | (let ((this-buffer (current-buffer)) 216 | (this-window (selected-window))) 217 | (if (and (window-live-p cwebber/swapping-window) 218 | (buffer-live-p cwebber/swapping-buffer)) 219 | (progn (switch-to-buffer cwebber/swapping-buffer) 220 | (select-window cwebber/swapping-window) 221 | (switch-to-buffer this-buffer) 222 | (select-window this-window) 223 | (message "Swapped buffers.")) 224 | (message "Old buffer/window killed. Aborting.")) 225 | (setq cwebber/swapping-buffer nil) 226 | (setq cwebber/swapping-window nil)) 227 | (progn 228 | (setq cwebber/swapping-buffer (current-buffer)) 229 | (setq cwebber/swapping-window (selected-window)) 230 | (message "Buffer and window marked for swapping.")))) 231 | 232 | (global-set-key (kbd "C-c p") 'cwebber/swap-buffers-in-windows) 233 | 234 | 235 | ;; other stuff 236 | 237 | (defun add-spaces-to-region (beginning end numspaces) 238 | "Add spaces to a whole region of text" 239 | (interactive "r\nnNumber of spaces: ") 240 | (save-excursion 241 | (goto-char beginning) 242 | (beginning-of-line) 243 | (while (< (point) end) 244 | (let ((bol-point 0) 245 | (eol-point 0)) 246 | (save-excursion 247 | (end-of-line) 248 | (setq eol-point (point)) 249 | (beginning-of-line) 250 | (setq bol-point (point))) 251 | (if (not (equal bol-point eol-point)) 252 | (progn 253 | (beginning-of-line) 254 | (dotimes (i numspaces) 255 | (insert " "))))) 256 | (forward-line) 257 | (beginning-of-line)))) 258 | 259 | (defun rename-buffer-with-directory (&optional arg) 260 | "Useful for when you're dealing with multiple files with the 261 | same name in different directories. No more file.txt<2>! 262 | 263 | Running this will append the previous directory to the end of 264 | the filename. So for example, if you opened the emacs 265 | ChangeLog (living in the emacs/ directory), you'll get 266 | 'ChangeLog(emacs/)'. Using a prefix arg will give you number 267 | of subdirectories, if you need it. 268 | 269 | If you are accessing a file over Tramp, it will add 'host:' to 270 | the parenthesis.. so if you were accessing 271 | /ssh:example.org:/home/foobar/emacs/ChangeLog, you'd get: 272 | 'ChangeLog(example.org:emacs/)'" 273 | (interactive "^p") 274 | (let ((dir-name nil) 275 | (split-path (eshell-split-path 276 | (file-name-directory (buffer-file-name)))) 277 | (tramp-data (condition-case nil 278 | (tramp-dissect-file-name (buffer-file-name)) 279 | (error nil)))) 280 | (setq dir-name 281 | (apply 'concat (nthcdr (- (length split-path) arg) split-path))) 282 | (rename-buffer 283 | (concat (file-name-nondirectory (buffer-file-name)) 284 | (if tramp-data 285 | (concat 286 | "(" (aref tramp-data 2) ":" dir-name ")") 287 | (concat "(" dir-name ")")))))) 288 | 289 | 290 | (defun insert-virtualenv-load-line (virtualenv-dir) 291 | (interactive "DVirtualenv directory: ") 292 | (let ((activate-file (expand-file-name (concat virtualenv-dir "./bin/activate_this.py")))) 293 | (if (file-exists-p activate-file) 294 | (insert 295 | (concat "execfile('" activate-file 296 | "', dict(__file__='" activate-file "'))")) 297 | (error "No ./bin/activate_this.py in that virtualenv (maybe update virtualenv?)")))) 298 | 299 | 300 | ; (global-set-key (kbd "C-c r") 'rename-buffer-with-directory) 301 | 302 | (defun blender-style () 303 | (interactive) 304 | (c-set-style "bsd") 305 | (setq indent-tabs-mode t) 306 | (setq tab-width 4) 307 | (setq c-basic-offset 4)) 308 | 309 | 310 | ;; En1arg3 y0ur w1|\|dow!!! 311 | (defun undo-or-shrink-horizontally () 312 | "Either undo or shrink horizontally, depending on whether we're 313 | in X or in a terminal" 314 | (interactive) 315 | (if (window-system) 316 | (shrink-window-horizontally) 317 | (undo))) 318 | 319 | (global-set-key (kbd "C-=") 'enlarge-window) 320 | (global-set-key (kbd "C--") 'shrink-window) 321 | (global-set-key (kbd "C-+") 'enlarge-window-horizontally) 322 | (global-set-key (kbd "C-_") 'undo-or-shrink-horizontally) 323 | (global-set-key (kbd "C-c x") 'execute-extended-command) 324 | (global-set-key [S-prior] 'beginning-of-buffer) 325 | (global-set-key [S-next] 'end-of-buffer) 326 | 327 | 328 | ;; Apparently I'm a crufty old timer who likes the way the old mouse 329 | ;; and x11 pasting worked. This sets it back 330 | 331 | (global-set-key [mouse-2] 'mouse-yank-at-click) 332 | 333 | (setq mouse-drag-copy-region t 334 | select-active-regions nil 335 | x-select-enable-primary t 336 | x-select-enable-clipboard nil) 337 | 338 | ;; I also like my scrollbars on the left, thanks! 339 | 340 | (set-scroll-bar-mode 'right) 341 | 342 | ;; ---------- 343 | ;; Mail stuff 344 | ;; ---------- 345 | 346 | (setq mail-source-movemail-program "/usr/bin/movemail") 347 | 348 | ; Randomly choose mail signature 349 | (setq cwebber-mail-sigs 350 | '("The bottom line." 351 | "http://dustycloud.org/")) 352 | 353 | (defun cwebber-random-mail-sig () 354 | (nth (random (length cwebber-mail-sigs)) 355 | cwebber-mail-sigs)) 356 | 357 | ;(setq mail-signature 'cwebber-random-mail-sig) 358 | ;(setq message-signature 'cwebber-random-mail-sig) 359 | (setq mail-signature nil) 360 | (setq message-signature nil) 361 | 362 | ;; --------- 363 | ;; Load some custom stuff 364 | ;; --------- 365 | 366 | (defun insert-ellipsis () 367 | (interactive) 368 | (insert "…")) 369 | (global-set-key (kbd "C-c ;") 'insert-ellipsis) 370 | 371 | ; Always compose mail with gnus. *ALWAYS*. 372 | (setq read-mail-command 'gnus) 373 | (setq mail-user-agent 'gnus-user-agent) 374 | 375 | ; Turn off tool-bar-mode, which is slow 376 | (call-interactively 'tool-bar-mode) 377 | 378 | ;; UTF-8 support 379 | (prefer-coding-system 'utf-8) 380 | (set-default-coding-systems 'utf-8) 381 | (set-terminal-coding-system 'utf-8) 382 | (set-keyboard-coding-system 'utf-8) 383 | 384 | (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) 385 | 386 | ;; copy-pasta 387 | (setq x-select-enable-clipboard t) 388 | 389 | ;; highlight current line 390 | ;; Kinda cool but not really needed right now 391 | ; (global-hl-line-mode +1) 392 | 393 | ; lock files borking git-annex-assistant autocommits. Disabling for now. 394 | ;; We can re-enable both of these once .gitignore support comes to git-annex 395 | (setq create-lockfiles nil) 396 | ; Similarly with auto-save files :( 397 | (setq auto-save-default nil) 398 | 399 | ;; How did electric-indent-mode get turned on? Why the hell would i want that 400 | (setq electric-indent-mode nil) 401 | 402 | ;; shift + arrow based window nav 403 | (windmove-default-keybindings) 404 | 405 | ;; Not sure where else to put this, but hey 406 | 407 | (defun open-srfi (srfi-num) 408 | "Open srfi at SRFI-NUM in eww" 409 | (interactive "nSRFI number: ") 410 | (eww (concat "http://srfi.schemers.org/srfi-" 411 | (int-to-string srfi-num) 412 | "/srfi-" 413 | (int-to-string srfi-num) ".html"))) 414 | 415 | ;; Heart-and-stars page breaks! 416 | 417 | (defun heart-and-stars-pagebreaks () 418 | "Replace that boring ^L character with a sparklebutt explosion" 419 | (interactive) 420 | (progn 421 | (unless buffer-display-table 422 | (setq buffer-display-table (make-display-table))) 423 | (aset buffer-display-table ?\^L 424 | (vconcat 425 | (mapcar (lambda (c) 426 | (make-glyph-code c 'escape-glyph)) 427 | ".✯⁂♥♥♥⁂✯."))))) 428 | 429 | (setq page-break-lines-char ?…) 430 | 431 | (defun insert-uuid () 432 | "Insert a uuid string at point" 433 | (interactive) 434 | (insert (org-id-uuid))) 435 | 436 | ;; The most important thing in this whole file 437 | (require 'tetris) 438 | (define-key tetris-mode-map (kbd "") 'tetris-rotate-next) 439 | 440 | ;; By default, we almost always want spaces not tabs. 441 | (setq indent-tabs-mode nil) 442 | 443 | ;; Don't annoy office mates 444 | (setq visible-bell t) 445 | 446 | ;; Don't produce weird hanging in comint buffers 447 | (setq comint-process-echoes nil) 448 | (defun disable-comint-process-echoes () 449 | (interactive) 450 | (setq comint-process-echoes nil)) 451 | 452 | (add-hook 'inferior-lisp-mode-hook 453 | 'disable-comint-process-echoes) 454 | 455 | ;; This is I guess how you turn on tab-based indentation in racket-mode... 456 | ;; doesn't seem to hurt anything else... 457 | (setq tab-always-indent 'complete) 458 | 459 | ;; Lambda insertion 460 | (defun cwebber/lambda-insert () 461 | (interactive) 462 | (insert-char ?\() 463 | (insert-char ?λ) 464 | (insert " (") 465 | (let ((return-to (point))) 466 | (insert "))") 467 | (goto-char return-to))) 468 | 469 | (global-set-key (kbd "C-c y") 'cwebber/lambda-insert) 470 | 471 | 472 | ;; Highlight glyphless characters, eg ZERO-WIDTH SPACE 473 | (set-face-background 'glyphless-char "red") 474 | 475 | 476 | ;; The old "open in firefox" code no longer seemed to work so trying this... 477 | (defun cwebber/open-in-firefox (url &optional new-window) 478 | ;; prevent someone passing in extra command line arguments as an attack 479 | (if (equal (substring-no-properties url 0 1) 480 | "-") 481 | (error "Attempted to open URL with preceding dashes")) 482 | (start-process (concat "firefox " url) 483 | nil 484 | (executable-find browse-url-firefox-program) 485 | (if new-window 486 | "--new-window" 487 | "--new-tab") 488 | url)) 489 | 490 | (setq browse-url-browser-function 'cwebber/open-in-firefox) 491 | 492 | 493 | ;; Make calendar show week numbers?! 494 | (setq calendar-week-start-day 1 495 | calendar-intermonth-text 496 | '(propertize 497 | (format "%2d" 498 | (car 499 | (calendar-iso-from-absolute 500 | (calendar-absolute-from-gregorian (list month day year))))) 501 | 'font-lock-face 'font-lock-function-name-face)) 502 | 503 | (setq kill-ring-max 256) 504 | 505 | ;; Only generate line numbers as needed... 506 | (setq linum-format 'dynamic) 507 | 508 | (defun narrow-to-sentence () 509 | (interactive) 510 | (backward-sentence) 511 | (let ((original-point (point))) 512 | (let ((start (point))) 513 | (forward-sentence) 514 | (narrow-to-region start (point))) 515 | (goto-char original-point))) 516 | 517 | (global-set-key (kbd "C-x n S") 'narrow-to-sentence) 518 | 519 | ;; How on earth did tabs start appearing in my code... 520 | (setq-default indent-tabs-mode nil) 521 | 522 | ;; Avoid bug that kills org-diet 523 | (setq font-lock-reference-face font-lock-constant-face) 524 | 525 | -------------------------------------------------------------------------------- /gpl-3.0.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /hacks/shelly.el: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cwebber/cwebbers-emacs-config/bacd9e5315f4472248ccae6cb6cdef11b666d9b2/hacks/shelly.el -------------------------------------------------------------------------------- /hacks/wisp2lisp.el: -------------------------------------------------------------------------------- 1 | (defun cwebber/wisp2lisp () 2 | (interactive) 3 | (begin-excursion 4 | (set-buffer "*wisp2lisp*") 5 | (erase-buffer)) 6 | (call-process "wisp2lisp" nil "*wisp2lisp*" nil (buffer-file-name)) 7 | (switch-to-buffer "*wisp2lisp*")) 8 | -------------------------------------------------------------------------------- /mode-line.el: -------------------------------------------------------------------------------- 1 | ; Make erc tracking come after everything else 2 | (setq erc-track-position-in-mode-line 'after-modes) 3 | 4 | ; Don't show me the time. 5 | ; ... not sure of a nicer way to do this :) 6 | (display-time-mode nil) 7 | 8 | ; borrowed heavily from 9 | ; http://emacs-fu.blogspot.com/2011/08/customizing-mode-line.html 10 | (setq-default mode-line-format 11 | (list 12 | '(:eval (when overwrite-mode 13 | (propertize 14 | "Ovr" 15 | 'face 'font-lock-preprocessor-face 16 | 'help-echo (concat "Buffer is in " 17 | (if overwrite-mode "overwrite" "insert") " mode")))) 18 | 19 | ;; was this buffer modified since the last save? 20 | '(:eval (when (buffer-modified-p) 21 | (propertize "Mod" 22 | 'face 'font-lock-warning-face 23 | 'help-echo "Buffer has been modified"))) 24 | 25 | ;; is this buffer read-only? 26 | '(:eval (when buffer-read-only 27 | (propertize "RO" 28 | 'face 'font-lock-type-face 29 | 'help-echo "Buffer is read-only"))) 30 | " " 31 | 32 | ;; the buffer name; the file name as a tool tip 33 | '(:eval (propertize "%b " 'face 'font-lock-keyword-face 34 | 'help-echo (buffer-file-name))) 35 | 36 | ;; line and column 37 | (propertize "%02l," 'face 'font-lock-type-face) 38 | ; warn if we go over 80 characters 39 | '(:eval (propertize "%02c" 'face 40 | (if (>= (current-column) 80) 41 | 'font-lock-warning-face 42 | 'font-lock-type-face))) 43 | " " 44 | 45 | mode-name 46 | 47 | " " 48 | 49 | '(global-mode-string global-mode-string) 50 | 51 | " " 52 | 53 | ;; revision control info 54 | '(vc-mode vc-mode) 55 | 56 | " " 57 | 58 | ;; '(:eval (when nyan-mode (list (nyan-create) " "))) 59 | 60 | '(:eval (when (and erc-track-mode cwebber/show-erc-in-mode-line) 61 | (list erc-modified-channels-object))) 62 | 63 | ;; i don't want to see minor-modes; but if you want, uncomment this: 64 | minor-mode-alist ;; list of minor modes 65 | "%-" ;; fill with '-' 66 | )) 67 | 68 | 69 | (defvar cwebber/show-erc-in-mode-line t) 70 | 71 | (defun cwebber/toggle-show-erc () 72 | (interactive) 73 | (if cwebber/show-erc-in-mode-line 74 | (setq cwebber/show-erc-in-mode-line nil) 75 | (setq cwebber/show-erc-in-mode-line t))) 76 | 77 | (global-set-key (kbd "C-c E") 'cwebber/toggle-show-erc) 78 | 79 | -------------------------------------------------------------------------------- /modes/ace-jump.el: -------------------------------------------------------------------------------- 1 | (define-key global-map (kbd "C-c C-SPC") 'ace-jump-mode) 2 | 3 | (define-key global-map (kbd "C-c j") 'ace-jump-mode) 4 | -------------------------------------------------------------------------------- /modes/auto-complete.el: -------------------------------------------------------------------------------- 1 | (require 'auto-complete) 2 | 3 | (add-hook 'after-init-hook 'global-auto-complete-mode) 4 | -------------------------------------------------------------------------------- /modes/bbdb.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; BBDB 3 | ;; --------- 4 | 5 | ;; Keeping contacts the Orwell way 6 | 7 | ;; Do we really need to run the latest version? 8 | ;(setq load-path (add-to-list 'load-path "~/elisp/bbdb/lisp/")) 9 | 10 | (require 'bbdb) 11 | ;;(bbdb-initialize 'gnus 'message) 12 | ;;(add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus) 13 | (global-set-key (kbd "C-c b") 'bbdb) 14 | -------------------------------------------------------------------------------- /modes/beancount.el: -------------------------------------------------------------------------------- 1 | (require 'beancount) 2 | 3 | (add-to-list 'auto-mode-alist '("\\.bnct\\'" . beancount-mode)) 4 | 5 | (defun beancount-indent-and-align (&optional arg) 6 | (interactive "P") 7 | (beancount-tab-dwim arg) 8 | (beancount-align-to-previous-number)) 9 | 10 | (define-key beancount-mode-map (kbd "TAB") 'beancount-indent-and-align) 11 | -------------------------------------------------------------------------------- /modes/browse-kill-ring.el: -------------------------------------------------------------------------------- 1 | (browse-kill-ring-default-keybindings) 2 | -------------------------------------------------------------------------------- /modes/calfw.el: -------------------------------------------------------------------------------- 1 | (require 'calfw) 2 | (require 'calfw-org) 3 | 4 | -------------------------------------------------------------------------------- /modes/column-marker.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; Column-marker 3 | ;; --------- 4 | 5 | (load "~/elisp/column-marker.el") 6 | (add-hook 'python-mode-hook 7 | (lambda () (interactive) (column-marker-1 80))) 8 | -------------------------------------------------------------------------------- /modes/company.el: -------------------------------------------------------------------------------- 1 | (require 'company) 2 | 3 | ;; For now, only the really cool kids (ok, geiser) get global-company-mode 4 | (setq global-company-mode nil) 5 | 6 | (setq company-backends 7 | '(geiser-company-backend 8 | company-elisp 9 | company-nxml company-css company-semantic company-capf 10 | (company-dabbrev-code company-gtags company-etags company-keywords) 11 | company-oddmuse company-files company-dabbrev)) 12 | -------------------------------------------------------------------------------- /modes/css.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; CSS Mode 3 | ;; --------- 4 | 5 | (load "~/elisp/css-mode.el") 6 | (autoload 'css-mode "css-mode" "CSS editing mode" t) 7 | (add-to-list 'auto-mode-alist '("\\.css\\'" . css-mode)) 8 | -------------------------------------------------------------------------------- /modes/debbugs.el: -------------------------------------------------------------------------------- 1 | (require 'debbugs) 2 | (require 'debbugs-gnu) 3 | (add-to-list 'debbugs-gnu-all-packages "guix-patches") 4 | -------------------------------------------------------------------------------- /modes/diminish.el: -------------------------------------------------------------------------------- 1 | (require 'diminish) 2 | 3 | (diminish 'eldoc-mode) 4 | (diminish 'yas-minor-mode) 5 | (diminish 'highlight-parentheses-mode) 6 | (diminish 'smartparens-mode) 7 | (diminish 'auto-complete-mode) 8 | (diminish 'auto-revert-mode) 9 | (diminish 'hs-minor-mode) 10 | -------------------------------------------------------------------------------- /modes/ediff.el: -------------------------------------------------------------------------------- 1 | ; Don't break out a separate frame for ediff 2 | (setq ediff-window-setup-function 'ediff-setup-windows-plain) 3 | 4 | ; Horizontal splitting really ought to be the default, honestly. 5 | (setq ediff-split-window-function 'split-window-horizontally) 6 | -------------------------------------------------------------------------------- /modes/eldoc.el: -------------------------------------------------------------------------------- 1 | (require 'eldoc) 2 | (add-hook 'emacs-lisp-mode-hook 'eldoc-mode) 3 | 4 | -------------------------------------------------------------------------------- /modes/elfeed.el: -------------------------------------------------------------------------------- 1 | (require 'elfeed) 2 | 3 | (setq elfeed-feeds 4 | '(;; programming or other blogs 5 | "http://wingolog.org/feed/atom" 6 | "http://planet.gnu.org/atom.xml" 7 | "http://lambda-the-ultimate.org/rss.xml" 8 | "http://nullprogram.com/feed/" 9 | "http://www.more-magic.net/feed.atom" 10 | "http://joeyh.name/blog/index.rss" 11 | "http://gondwanaland.com/mlog/feed/" 12 | "http://www.rants.org/feed/atom/" 13 | 14 | ;; Disabled, for now... 15 | ;; "http://nautil.us/rss/all" 16 | 17 | ;; comics 18 | "http://xkcd.com/atom.xml" 19 | "http://www.oursuperadventure.com/feed/" 20 | "http://feeds2.feedburner.com/sydneypadua/yBZX" ; 2dgoggles 21 | "http://www.octopuspie.com/feed/atom/")) 22 | 23 | (setq elfeed-show-entry-switch 24 | 'switch-to-buffer) 25 | -------------------------------------------------------------------------------- /modes/elget.el: -------------------------------------------------------------------------------- 1 | (require 'package) 2 | (add-to-list 'package-archives 3 | '("melpa" . "http://melpa.org/packages/")) 4 | (package-initialize) 5 | 6 | (add-to-list 'load-path "~/.emacs.d/el-get/el-get") 7 | 8 | (unless (require 'el-get nil t) 9 | (url-retrieve 10 | "https://raw.github.com/dimitri/el-get/master/el-get-install.el" 11 | (lambda (s) 12 | (let (el-get-master-branch) 13 | (goto-char (point-max)) 14 | (eval-print-last-sexp))))) 15 | 16 | (require 'el-get) 17 | 18 | ;; local sources 19 | (setq el-get-sources 20 | '((:name "yasnippet" 21 | :description "YASnippet is a template system for Emacs." 22 | :type git 23 | :url "https://github.com/capitaomorte/yasnippet") 24 | (:name "visual-regexp" 25 | :description "Visual regexps" 26 | :type git 27 | :url "https://github.com/benma/visual-regexp.el.git") 28 | (:name "dark-theme" 29 | :description "Dark theme" 30 | :type http 31 | :url "https://raw.github.com/suvayu/.emacs.d/master/themes/dark-emacs-theme.el") 32 | (:name "highlight-sexps" 33 | :description "Highlight sexps" 34 | :type http 35 | :url "http://david.rysdam.org/src/emacs/highlight-sexps.el") 36 | (:name "highlight-parentheses" 37 | :description "Highlight parentheses" 38 | :type git 39 | :url "https://github.com/nschum/highlight-parentheses.el.git") 40 | (:name "naquadah-theme" 41 | :description "Naquadah theme" 42 | :type git 43 | :url "https://github.com/jd/naquadah-theme.git") 44 | (:name "kivy-mode" 45 | :description "Kivy highlighting mode" 46 | :type http 47 | :url "https://raw.github.com/kivy/kivy/master/kivy/tools/highlight/kivy-mode.el") 48 | (:name "rainbow-delimeters" 49 | :description "Highlight rainbowz" 50 | :type http 51 | :url "http://github.com/jlr/rainbow-delimiters/raw/master/rainbow-delimiters.el") 52 | (:name "web-mode" 53 | :description "emacs major mode for html templates" 54 | :type git 55 | :url "https://github.com/fxbois/web-mode.git") 56 | (:name "org-reveal" 57 | :description "reveal.js stuff for orgmode" 58 | :type git 59 | :url "https://github.com/yjwen/org-reveal.git") 60 | ;; (:name "geiser" 61 | ;; :type elpa 62 | ;; :repo ("marmalade" . "http://marmalade-repo.org/packages/")) 63 | (:name "replace-color-themes" 64 | :type git 65 | :url "https://github.com/emacs-jp/replace-colorthemes.git") 66 | (:name "popup" 67 | :type elpa 68 | :repo ("marmalade" . "http://marmalade-repo.org/packages/")) 69 | ;; (:name "git-modes" 70 | ;; :type elpa 71 | ;; :repo ("marmalade" . "http://marmalade-repo.org/packages/")) 72 | ;; (:name "magit" 73 | ;; :type elpa 74 | ;; :repo ("marmalade" . "http://marmalade-repo.org/packages/")) 75 | ;; (:name "magit-annex" 76 | ;; :type elpa 77 | ;; :repo ("marmalade" . "http://marmalade-repo.org/packages/")) 78 | ;; (:name "timesheet" 79 | ;; :type elpa) 80 | 81 | 82 | 83 | ;; (:name magit 84 | ;; :website "https://github.com/magit/magit#readme" 85 | ;; :description "It's Magit! An Emacs mode for Git." 86 | ;; :type github 87 | ;; :pkgname "magit/magit" 88 | ;; :depends (cl-lib git-modes) 89 | ;; :info "." 90 | ;; :branch "next" 91 | ;; ;; let el-get care about autoloads so that it works with all OSes 92 | ;; :build (if (version<= "24.3" emacs-version) 93 | ;; `(("make" ,(format "EMACS=%s" el-get-emacs) "all")) 94 | ;; `(("make" ,(format "EMACS=%s" el-get-emacs) "docs"))) 95 | ;; :build/berkeley-unix (("touch" "`find . -name Makefile`") ("gmake"))) 96 | ;; (:name "cyberpunk-theme" 97 | ;; :description "Cyberpunk theme" 98 | ;; :type git 99 | ;; :url "https://github.com/n3mo/cyberpunk-theme.el.git") 100 | ;; (:name asciidoc 101 | ;; :type elpa 102 | ;; :after (lambda () 103 | ;; (autoload 'doc-mode "doc-mode" nil t) 104 | ;; (add-to-list 'auto-mode-alist '("\\.adoc$" . doc-mode)) 105 | ;; (add-hook 'doc-mode-hook '(lambda () 106 | ;; (turn-on-auto-fill) 107 | ;; (require 'asciidoc))))) 108 | ;(:name lisppaste :type elpa) 109 | ;(:name nxhtml :type elpa) 110 | ;(:name dictionary-el :type apt-get) 111 | ;(:name emacs-goodies-el :type apt-get) 112 | )) 113 | 114 | (setq my-packages 115 | (append 116 | '("el-get" "calfw" "ace-jump-mode" 117 | "paredit" "visual-regexp" "web-mode" "smex" 118 | "browse-kill-ring" "hy-mode" "rainbow-mode" 119 | ; "smartparens" 120 | ; "helm" 121 | "rainbow-delimeters" 122 | "jedi" "haskell-mode" 123 | ;; "geiser" 124 | "switch-window" 125 | "git-timemachine" 126 | "sicp") 127 | (mapcar 'el-get-source-name el-get-sources))) 128 | 129 | (el-get 'sync my-packages) 130 | -------------------------------------------------------------------------------- /modes/emacspeak.el: -------------------------------------------------------------------------------- 1 | (setq emacspeak-sounds-directory "/home/cwebber/programs/emacspeak_audio_icons/") -------------------------------------------------------------------------------- /modes/emms.el: -------------------------------------------------------------------------------- 1 | (require 'emms) 2 | (emms-all) 3 | (emms-default-players) 4 | -------------------------------------------------------------------------------- /modes/erc.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; ERC 3 | ;; --------- 4 | 5 | ;; (setq browse-url-browser-function 'w3m-browse-url) 6 | 7 | (setq erc-user-full-name user-full-name) 8 | 9 | (require 'erc-track) 10 | (erc-track-mode t) 11 | (setq erc-track-exclude-types '("JOIN" "NICK" "PART" 12 | "QUIT" "MODE")) 13 | 14 | (setq erc-log-channels-directory "~/.erc/logs/") 15 | (setq erc-save-buffer-on-part t) 16 | (setq erc-hide-timestamps t) 17 | (setq erc-join-buffer 'window-noselect) 18 | 19 | ; automatically log conversations 20 | (require 'erc-log) 21 | (erc-log-mode t) 22 | (add-hook 'erc-insert-post-hook 'erc-save-buffer-in-logs) 23 | (erc-scrolltobottom-mode t) 24 | (load-file "~/.erc/config.el") 25 | 26 | ; Truncate 27 | (add-hook 'erc-insert-post-hook 'erc-truncate-buffer) 28 | (setq erc-max-buffer-size 100000) 29 | -------------------------------------------------------------------------------- /modes/eshell.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; eshell 3 | ;; --------- 4 | 5 | (setq eshell-cmpl-cycle-completions nil) 6 | 7 | ;; eshell scrolling betterness 8 | (defun eshell-scroll-to-bottom (window display-start) 9 | (if (and window (window-live-p window)) 10 | (let ((resize-mini-windows nil)) 11 | (save-selected-window 12 | (select-window window) 13 | (save-restriction 14 | (widen) 15 | (when (> (point) eshell-last-output-start) ; we're editing a line. Scroll. 16 | (save-excursion 17 | (recenter -1) 18 | (sit-for 0)))))))) 19 | 20 | (defun eshell-add-scroll-to-bottom () 21 | (interactive) 22 | ;(make-local-hook 'window-scroll-functions) 23 | (add-hook 'window-scroll-functions 'eshell-scroll-to-bottom nil t)) 24 | 25 | (add-hook 'eshell-mode-hook 'eshell-add-scroll-to-bottom) 26 | 27 | ; Set the $PAGER to "" 28 | 29 | (defun eshell-unset-pager () 30 | (setenv "PAGER" "")) 31 | 32 | (add-hook 'eshell-mode-hook 'eshell-unset-pager) 33 | 34 | ; another emacswiki borrow 35 | 36 | ;; (require 'ansi-color) 37 | ;; (defun eshell-handle-ansi-color () 38 | ;; (ansi-color-apply-on-region eshell-last-output-start 39 | ;; eshell-last-output-end)) 40 | ;; (add-to-list 'eshell-output-filter-functions 'eshell-handle-ansi-color) 41 | -------------------------------------------------------------------------------- /modes/eww-shr.el: -------------------------------------------------------------------------------- 1 | ;; Increase contrast in eww stuff 2 | (setq shr-color-visible-luminance-min 70) 3 | -------------------------------------------------------------------------------- /modes/exwm.el: -------------------------------------------------------------------------------- 1 | (require 'exwm) 2 | 3 | (setq exwm-workspace-number 4) 4 | 5 | (require 'exwm-randr) 6 | (seq exwm-randr-workspace-output-list '()) 7 | 8 | 9 | (exwm-enable) 10 | -------------------------------------------------------------------------------- /modes/flymake.el: -------------------------------------------------------------------------------- 1 | ;;; -------- 2 | ;;; Flymake / Pyflakes 3 | ;;; -------- 4 | 5 | (when (load "flymake" t) 6 | (defun flymake-pyflakes-init () 7 | (let* ((temp-file (flymake-init-create-temp-buffer-copy 8 | 'flymake-create-temp-inplace)) 9 | (local-file (file-relative-name 10 | temp-file 11 | (file-name-directory buffer-file-name)))) 12 | (list "pyflakes" (list local-file)))) 13 | (add-to-list 'flymake-allowed-file-name-masks 14 | '("\\.py\\'" flymake-pyflakes-init))) 15 | 16 | (defun cwebber/safer-flymake-find-file-hook () 17 | "Don't barf if we can't open this flymake file" 18 | (let ((flymake-filename 19 | (flymake-create-temp-inplace (buffer-file-name) "flymake"))) 20 | (if (file-writable-p flymake-filename) 21 | (flymake-find-file-hook) 22 | (message 23 | (format 24 | "Couldn't enable flymake; permission denied on %s" flymake-filename))))) 25 | 26 | (add-hook 'find-file-hook 'cwebber/safer-flymake-find-file-hook) 27 | ;(remove-hook 'find-file-hook 'flymake-find-file-hook) 28 | (load-file "~/elisp/flymake-cursor.el") 29 | 30 | (setq flymake-allowed-file-name-masks 31 | '(("\\.py\\'" flymake-pyflakes-init) 32 | ;("\\.c\\'" flymake-simple-make-init) 33 | ;("\\.cpp\\'" flymake-simple-make-init) 34 | ;("\\.h\\'" flymake-master-make-header-init flymake-master-cleanup) 35 | ;("\\.xml\\'" flymake-xml-init) 36 | ;("\\.html?\\'" flymake-xml-init) 37 | ("\\.cs\\'" flymake-simple-make-init) 38 | ("\\.p[ml]\\'" flymake-perl-init) 39 | ;("\\.php[345]?\\'" flymake-php-init) 40 | ("\\.java\\'" flymake-simple-make-java-init flymake-simple-java-cleanup) 41 | ;("[0-9]+\\.tex\\'" flymake-master-tex-init flymake-master-cleanup) 42 | ;("\\.tex\\'" flymake-simple-tex-init) 43 | ("\\.idl\\'" flymake-simple-make-init))) 44 | -------------------------------------------------------------------------------- /modes/geiser.el: -------------------------------------------------------------------------------- 1 | (require 'geiser) 2 | (require 'geiser-guile) 3 | (setq geiser-default-implementation 'guile) 4 | (setq geiser-active-implementations '(guile mit racket)) 5 | (setq geiser-mode-smart-tab-p t) 6 | 7 | (defun cwebber/geiser-completion-prefs () 8 | (auto-complete-mode -1) 9 | (company-mode 1)) 10 | 11 | (add-hook 'geiser-mode-hook 'cwebber/geiser-completion-prefs) 12 | (add-hook 'geiser-repl-mode-hook 'cwebber/geiser-completion-prefs) 13 | 14 | ;;; This no longer works... 15 | ;; (setq geiser-guile-binary '("/home/cwebber/devel/guix/pre-inst-env" "guile")) 16 | 17 | ;; (with-eval-after-load 'geiser-guile 18 | ;; (add-to-list 'geiser-guile-load-path "~/devel/guix")) 19 | 20 | ;; (with-eval-after-load 'geiser-guile 21 | ;; (add-to-list 'geiser-guile-load-path "~/devel/guix") 22 | ;; (add-to-list 'geiser-guile-load-path "~/devel/nonguix")) 23 | 24 | 25 | (with-eval-after-load 'yasnippet 26 | (add-to-list 'yas-snippet-dirs "~/devel/guix/etc/snippets")) 27 | 28 | 29 | ;; a list of lists, for each of which the car being a directory that 30 | ;; has a project, the cdr is whatever other paths should also be added 31 | 32 | (setq cwebber/guile-projects 33 | '(("~/devel/guile-goblins") 34 | ("~/devel/guix-config" 35 | ;; "~/devel/guix" 36 | "~/devel/nonguix") 37 | ("~/devel/guix") 38 | ("~/work/guile-prescheme/") 39 | ("~/devel/guix" 40 | ;; "~/devel/nonguix" 41 | ) 42 | ("~/devel/brainy" 43 | "~/devel/guile-goblins") 44 | ("~/devel/spritely.institute") 45 | ("~/devel/guile-hoot/module") 46 | ("~/devel/spritely-papers" 47 | "~/devel/guile-goblins") 48 | ("~/devel/spritelyproject.org") 49 | ("~/devel/terminal-phase" 50 | "~/devel/guile-goblins" 51 | ) 52 | ("~/devel/dustycloud") 53 | ("~/devel/fantasary" 54 | "~/devel/guile-goblins") 55 | ("~/devel/chickflix" 56 | "~/devel/guile-goblins") 57 | ("~/devel/wasm4-wireworld" 58 | "~/devel/guile-hoot/module") 59 | ("~/devel/guile-syrup"))) 60 | 61 | (defun cwebber/setup-guile-project-paths () 62 | (catch 'done 63 | (dolist (project-info cwebber/guile-projects) 64 | (when (string-prefix-p (expand-file-name (car project-info)) 65 | (buffer-file-name)) 66 | (make-local-variable 'geiser-guile-load-path) 67 | (dolist (load-path project-info) 68 | (cl-pushnew (expand-file-name load-path) geiser-guile-load-path 69 | :test 'string-equal)) 70 | (message (concat "Setup geiser guile load-paths for: " (car project-info))) 71 | (throw 'done t))))) 72 | 73 | (add-hook 'geiser-mode-hook 'cwebber/setup-guile-project-paths) 74 | 75 | ; (let ((geiser-guile-binary '("guix" "environment" "-l" "/home/cwebber/devel/guile-goblins/guix.scm" "--" "/home/cwebber/devel/guile-goblins/pre-inst-env" "guile"))) 76 | ; (run-guile)) 77 | 78 | ;; One geiser per project 79 | ;;; (setq geiser-repl-per-project-p t) 80 | -------------------------------------------------------------------------------- /modes/guix.el: -------------------------------------------------------------------------------- 1 | ;; ;; paroneayea: it's a hack, but /run/current-system will exist on a 2 | ;; ;; GuixSD system and not on Debian. 3 | ;; ;; I hope such a test will never end up in any published software. 4 | ;; (if (not (file-exists-p "/run/current-system")) 5 | ;; (progn 6 | ;; (add-to-list 'load-path "/home/cwebber/devel/guix/emacs") 7 | ;; (setq guix-load-path "/home/cwebber/devel/guix/emacs") 8 | ;; (setq guix-guile-program 9 | ;; '("/home/cwebber/devel/guix/pre-inst-env" "guile")))) 10 | 11 | ;; (add-to-list 'load-path "/home/cwebber/devel/guix/emacs") 12 | ;; (setq guix-load-path "/home/cwebber/devel/guix/emacs") 13 | ;; (setq guix-guile-program '("/home/cwebber/devel/guix/pre-inst-env" "guile")) 14 | 15 | (require 'guix) 16 | ; (require 'guix-init nil t) 17 | ; (guix-emacs-autoload-packages) 18 | 19 | (global-set-key (kbd "C-c g") 'guix) 20 | 21 | ;; ;; guix-all-available-packages takes forever on my machine... 22 | ;; (setq geiser-connection-timeout 300000) 23 | -------------------------------------------------------------------------------- /modes/helm.el: -------------------------------------------------------------------------------- 1 | (require 'helm) 2 | ;; (require 'helm-pages) 3 | (helm-mode 1) 4 | 5 | ;; (global-set-key (kbd "C-x B") 'helm-buffers-list) 6 | ;; (global-set-kirey (kbd "M-s O") 'helm-occur) 7 | ;; (global-set-key (kbd "M-X") 'helm-M-x) 8 | ;; (global-set-key (kbd "C-c f h") 'helm-find-files) 9 | 10 | ;; (global-set-key (kbd "C-c h b") 'helm-buffers-list) 11 | ;; (global-set-key (kbd "C-c h f") 'helm-find-files) 12 | ;; (global-set-key (kbd "C-c h F") 'helm-find) 13 | ;; (global-set-key (kbd "C-c h o") 'helm-occur) 14 | ;; (global-set-key (kbd "C-c h p") 'helm-pages) 15 | ;; (global-set-key (kbd "C-c h x") 'helm-M-x) 16 | 17 | (global-set-key (kbd "C-x C-f") 'helm-find-files) 18 | -------------------------------------------------------------------------------- /modes/highlight-parentheses.el: -------------------------------------------------------------------------------- 1 | (require 'highlight-parentheses) 2 | 3 | (add-hook 'emacs-lisp-mode-hook 'highlight-parentheses-mode) 4 | (add-hook 'hy-mode-hook 'highlight-parentheses-mode) 5 | (add-hook 'lisp-mode-hook 'highlight-parentheses-mode) 6 | (add-hook 'inferior-lisp-mode-hook 'highlight-parentheses-mode) 7 | (add-hook 'scheme-mode-hook 'highlight-parentheses-mode) 8 | (add-hook 'racket-mode-hook 'highlight-parentheses-mode) 9 | 10 | ;; ; Use naquadah colors 11 | ;; (setq hl-paren-colors 12 | ;; (list 13 | ;; (naquadah-get-colors 'gradient-1) 14 | ;; (naquadah-get-colors 'gradient-2) 15 | ;; (naquadah-get-colors 'gradient-3) 16 | ;; (naquadah-get-colors 'gradient-4) 17 | ;; (naquadah-get-colors 'gradient-5) 18 | ;; (naquadah-get-colors 'gradient-6) 19 | ;; (naquadah-get-colors 'gradient-7) 20 | ;; (naquadah-get-colors 'gradient-8) 21 | ;; (naquadah-get-colors 'gradient-9) 22 | ;; (naquadah-get-colors 'gradient-10) 23 | ;; (naquadah-get-colors 'gradient-11) 24 | ;; )) 25 | 26 | (setq hl-paren-colors nil) 27 | 28 | ; Have a light first parenthesis background then unlimited slightly darker ones 29 | (setq cwebber/darker-highlight-parentheses 30 | (cons "#465255" 31 | (mapcar (lambda (x) "#3d4749") 32 | (number-sequence 1 100)))) 33 | ;; Lighter edition 34 | (setq cwebber/lighter-highlight-parentheses 35 | (cons "#c3ccce" 36 | (mapcar (lambda (x) "#d2dbdb") 37 | (number-sequence 1 100)))) 38 | 39 | (setq hl-paren-background-colors 40 | cwebber/darker-highlight-parentheses) 41 | 42 | 43 | (setq cwebber/known-lisp-modes '(lisp-mode 44 | emacs-lisp-mode scheme-mode 45 | hy-mode racket-mode)) 46 | 47 | (defun cwebber/reset-highlight-parentheses () 48 | (interactive) 49 | (mapc 50 | (lambda (buffer) 51 | (save-excursion 52 | (set-buffer buffer) 53 | (when (member major-mode cwebber/known-lisp-modes) 54 | ;; Toggle highlight-parentheses-mode off and on again to reset the colors 55 | (highlight-parentheses-mode) 56 | (highlight-parentheses-mode)))) 57 | (buffer-list))) 58 | 59 | (defun cwebber/enable-light-parentheses () 60 | (interactive) 61 | (setq hl-paren-background-colors 62 | cwebber/lighter-highlight-parentheses) 63 | (set-face-attribute 'sp-pair-overlay-face 64 | nil :background "old lace") 65 | (cwebber/reset-highlight-parentheses)) 66 | 67 | (defun cwebber/enable-dark-parentheses () 68 | (interactive) 69 | (setq hl-paren-background-colors 70 | cwebber/darker-highlight-parentheses) 71 | (set-face-attribute 'sp-pair-overlay-face 72 | nil :background "#443152") 73 | (cwebber/reset-highlight-parentheses)) 74 | 75 | (cwebber/enable-light-parentheses) 76 | 77 | ;; Make the parenthesis' matched by hl-paren-face bold. 78 | ;; 79 | ;; Not sure if I like this or not! It looks nice but moves around 80 | ;; the text a bit. 81 | ; (set-face-attribute 'hl-paren-face nil :bold t) 82 | 83 | -------------------------------------------------------------------------------- /modes/highlight-sexps.el: -------------------------------------------------------------------------------- 1 | ; (load-file "~/elisp/highlight-sexps.el") 2 | 3 | (setq hl-sexp-background-colors '("#313837" "#2e3435")) 4 | (add-hook 'lisp-mode-hook 'highlight-sexps-mode) 5 | (add-hook 'emacs-lisp-mode-hook 'highlight-sexps-mode) 6 | -------------------------------------------------------------------------------- /modes/hy-mode.el: -------------------------------------------------------------------------------- 1 | (setq hy-mode-inferior-lisp-command "/home/cwebber/env/xudd3/bin/hy") 2 | 3 | -------------------------------------------------------------------------------- /modes/identica.el: -------------------------------------------------------------------------------- 1 | (add-to-list 'load-path "~/elisp/emacs-oauth") 2 | 3 | (load-file "~/elisp/identica-mode/identica-mode.el") 4 | (require 'identica-mode) 5 | 6 | (setq identica-update-status-method 'edit-buffer) 7 | 8 | ;; ; We'll set the username here but NOT our password. 9 | ;; (setq identica-username nil) 10 | 11 | ; Let's not overload ourselves 12 | (setq identica-display-max-dents 500) 13 | -------------------------------------------------------------------------------- /modes/ido.el: -------------------------------------------------------------------------------- 1 | (ido-mode 1) 2 | 3 | (setq ido-enable-flex-matching t) 4 | (setq ido-everywhere t) 5 | (setq ido-use-filename-at-point 'guess) 6 | 7 | ;; Stop trying to find files in other directories 8 | (setq ido-auto-merge-work-directories-length -1) 9 | 10 | (setq ido-create-new-buffer 'always) 11 | (setq ido-file-extensions-order 12 | '(".org" ".txt" ".py" ".emacs" ".xml" ".el" ".ini" ".cfg" ".cnf")) 13 | 14 | ; Ignore object files 15 | (setq ido-ignore-extensions t) 16 | 17 | ;; Maybe we can disable tramp stuff via this? 18 | ;(setq ido-work-directory-list-ignore-regexps 19 | 20 | ; Always open in the same window 21 | (setq ido-default-buffer-method 'selected-window) 22 | 23 | ;;;;;;;;;;;;;; 24 | ;; imenu & ido 25 | ;;;;;;;;;;;;;; 26 | 27 | ; Thanks emacswiki.org! 28 | (defun ido-goto-symbol (&optional symbol-list) 29 | "Refresh imenu and jump to a place in the buffer using Ido." 30 | (interactive) 31 | (unless (featurep 'imenu) 32 | (require 'imenu nil t)) 33 | (cond 34 | ((not symbol-list) 35 | (let ((ido-mode ido-mode) 36 | (ido-enable-flex-matching 37 | (if (boundp 'ido-enable-flex-matching) 38 | ido-enable-flex-matching t)) 39 | name-and-pos symbol-names position) 40 | (unless ido-mode 41 | (ido-mode 1) 42 | (setq ido-enable-flex-matching t)) 43 | (while (progn 44 | (imenu--cleanup) 45 | (setq imenu--index-alist nil) 46 | (ido-goto-symbol (imenu--make-index-alist)) 47 | (setq selected-symbol 48 | (ido-completing-read "Symbol? " symbol-names)) 49 | (string= (car imenu--rescan-item) selected-symbol))) 50 | (unless (and (boundp 'mark-active) mark-active) 51 | (push-mark nil t nil)) 52 | (setq position (cdr (assoc selected-symbol name-and-pos))) 53 | (cond 54 | ((overlayp position) 55 | (goto-char (overlay-start position))) 56 | (t 57 | (goto-char position))))) 58 | ((listp symbol-list) 59 | (dolist (symbol symbol-list) 60 | (let (name position) 61 | (cond 62 | ((and (listp symbol) (imenu--subalist-p symbol)) 63 | (ido-goto-symbol symbol)) 64 | ((listp symbol) 65 | (setq name (car symbol)) 66 | (setq position (cdr symbol))) 67 | ((stringp symbol) 68 | (setq name symbol) 69 | (setq position 70 | (get-text-property 1 'org-imenu-marker symbol)))) 71 | (unless (or (null position) (null name) 72 | (string= (car imenu--rescan-item) name)) 73 | (add-to-list 'symbol-names name) 74 | (add-to-list 'name-and-pos (cons name position)))))))) 75 | 76 | (global-set-key (kbd "\C-ci") 'ido-goto-symbol) 77 | -------------------------------------------------------------------------------- /modes/jedi.el: -------------------------------------------------------------------------------- 1 | (add-hook 'python-mode-hook 'jedi:setup) 2 | (setq jedi:setup-keys t) ; optional 3 | (setq jedi:complete-on-dot t) ; optional 4 | -------------------------------------------------------------------------------- /modes/js-mode.el: -------------------------------------------------------------------------------- 1 | (require 'nodejs-repl) 2 | 3 | ;; (setq nodejs-repl-command "guix") 4 | ;; (setq nodejs-repl-arguments 5 | ;; '("environment" "--ad-hoc" "node" "--" "node")) 6 | 7 | (add-hook 'js-mode-hook 8 | (lambda () 9 | (define-key js-mode-map (kbd "C-x C-e") 'nodejs-repl-send-last-expression) 10 | (define-key js-mode-map (kbd "C-c C-r") 'nodejs-repl-send-region) 11 | (define-key js-mode-map (kbd "C-c C-l") 'nodejs-repl-load-file) 12 | (define-key js-mode-map (kbd "C-c C-z") 'nodejs-repl-switch-to-repl) 13 | ;; (define-key js-mode-map (kbd "C-c C-b") 'nodejs-repl-send-buffer) 14 | )) 15 | 16 | -------------------------------------------------------------------------------- /modes/ledger.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; Ledger 3 | ;; --------- 4 | ;; (setenv "LEDGER" "/home/cwebber/records/ledger.dat") 5 | ;; (load "~/elisp/ledger.el") 6 | 7 | ;; (defun my-open-my-ledger-file () 8 | ;; "Opens my usual ledger file ands sets up for ledgerin'." 9 | ;; (interactive) 10 | ;; (find-file "~/records/ledger.dat") 11 | ;; (end-of-buffer) 12 | ;; (ledger-mode)) 13 | ;; (global-set-key (kbd "C-c fl") 'my-open-my-ledger-file) 14 | 15 | ;;(add-to-list 'load-path "~/programs/ledger/lisp/") 16 | ;;(load-file "~/programs/ledger/lisp/ldg-new.el") 17 | (require 'ledger) 18 | (add-to-list 'auto-mode-alist '("\\.ldgr\\'" . ledger-mode)) 19 | 20 | (set-face-background 'ledger-font-highlight-face "#2a3031") 21 | 22 | -------------------------------------------------------------------------------- /modes/longlines.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; LongLines 3 | ;; --------- 4 | 5 | ;; act (more) like a word processor 6 | (load "~/elisp/longlines.el") 7 | (add-to-list 'auto-mode-alist '("\\.ll\\'" . text-mode)) 8 | (add-to-list 'auto-mode-alist '("\\.txt\\'" . text-mode)) 9 | -------------------------------------------------------------------------------- /modes/magit.el: -------------------------------------------------------------------------------- 1 | ;;; ------ 2 | ;;; Magit 3 | ;;; ------ 4 | 5 | ;(add-to-list 'load-path "~/elisp/magit/") 6 | (require 'magit) 7 | (setq magit-revert-item-confirm t) 8 | 9 | (setq git-commit-summary-max-length 79) 10 | 11 | ;; (add-to-list 'magit-log-section-arguments 12 | ;; "--show-signature") 13 | 14 | (require 'magit-annex) 15 | 16 | -------------------------------------------------------------------------------- /modes/mediawiki.el: -------------------------------------------------------------------------------- 1 | (setq mediawiki-site-alist 2 | '(("Wikipedia" . ("http://en.wikipedia.org/w/" nil nil "Main Page")) 3 | ("Teamspace" . ("http://teamspace.creativecommons.org/" nil nil "Main Page")) 4 | ("CCWiki" . ("http://wiki.creativecommons.org/" nil nil "Main Page")))) 5 | -------------------------------------------------------------------------------- /modes/mozrepl.el: -------------------------------------------------------------------------------- 1 | ;; -------- 2 | ;; Mozrepl 3 | ;; -------- 4 | 5 | (load-file "~/elisp/moz.el") 6 | (load-file "~/elisp/javascript.el") 7 | 8 | (require 'moz) 9 | (require 'json) 10 | 11 | (defun moz-update (&rest ignored) 12 | "Update the remote mozrepl instance" 13 | (interactive) 14 | (comint-send-string (inferior-moz-process) 15 | (concat "content.document.body.innerHTML=" 16 | (json-encode (buffer-string)) ";"))) 17 | 18 | (defun moz-enable-auto-update () 19 | "Automatically the remote mozrepl when this buffer changes" 20 | (interactive) 21 | (add-hook 'after-change-functions 'moz-update t t)) 22 | 23 | (defun moz-disable-auto-update () 24 | "Disable automatic mozrepl updates" 25 | (interactive) 26 | (remove-hook 'after-change-functions 'moz-update t)) 27 | 28 | (autoload 'moz-minor-mode "moz" "Mozilla Minor and Inferior Mozilla Modes" t) 29 | (add-hook 'javascript-mode-hook 'java-custom-setup) 30 | (defun javascript-custom-setup () (moz-minor-mode 1)) 31 | -------------------------------------------------------------------------------- /modes/mu4e.el: -------------------------------------------------------------------------------- 1 | (setq mu4e-maildir "~/Maildir" ;; top-level Maildir 2 | mu4e-sent-folder "/personal/sent-to-misc" ;; where do i keep sent mail? 3 | mu4e-drafts-folder "/personal/drafts" ;; where do i keep half-written mail? 4 | mu4e-trash-folder "/personal/trash") ;; where do i move deleted mail? 5 | 6 | ;; paroneayea: it's a hack, but /run/current-system will exist on a 7 | ;; GuixSD system and not on Debian. 8 | ;; I hope such a test will never end up in any published software. 9 | (if (file-exists-p "/run/current-system") 10 | (add-to-list 'load-path "~/.guix-profile/share/emacs/site-lisp/mu4e/")) 11 | ; (setq mu4e-mu-binary "/home/cwebber/programs/mu/mu/mu") 12 | 13 | (require 'mu4e) 14 | ; (require 'org-mu4e) 15 | (require 'mu4e-contrib) 16 | 17 | ; (setq mu4e-msg2pdf "/usr/bin/msg2pdf") 18 | (setq mu4e-msg2pdf "/home/cwebber/programs/mu/toys/msg2pdf/msg2pdf") 19 | 20 | (setq mu4e-get-mail-command "/home/cwebber/bin/fetch-mail.sh") 21 | (setq mu4e-html2text-command 'mu4e-shr2text) 22 | ;; (setq mu4e-html2text-command "html2text -utf8 -width 72") 23 | ;;;; When all goes badly: 24 | ;; (setq mu4e-html2text-command "cat") 25 | 26 | (setq mu4e-maildir-shortcuts 27 | '(("/personal/Inbox.General" . ?i) 28 | ("/personal/CC Staff" . ?c) 29 | ("/personal/Spam" . ?s) 30 | ("/personal/sent-to-misc" . ?S))) 31 | 32 | (setq smtpmail-queue-mail nil ;; start in non-queuing mode 33 | smtpmail-queue-dir "~/Maildir/queue/cur") 34 | 35 | (load-file "~/devel/mu4e-uqueue/mu4e-uqueue.el") 36 | (load-file "~/devel/mu4e-uqueue/uqueue-advice.el") 37 | 38 | (require 'mu4e-actions) 39 | 40 | (add-to-list 'mu4e-view-actions 41 | '("ViewInBrowser" . mu4e-action-view-in-browser) t) 42 | (add-to-list 'mu4e-view-actions 43 | '("GitApply" . mu4e-action-git-apply-patch) t) 44 | (add-to-list 'mu4e-view-actions 45 | '("MboxGitApply" . mu4e-action-git-apply-mbox) t) 46 | 47 | (setq mu4e-user-mail-address-list 48 | '("cwebber@dustycloud.org" 49 | "cwebber@mediagoblin.org")) 50 | (setq mu4e-compose-dont-reply-to-self t) 51 | 52 | (setq mu4e-compose-signature-auto-include nil) 53 | 54 | (global-set-key (kbd "C-c m q") 'mu4e-uqueue) 55 | (global-set-key (kbd "C-c q") 'mu4e-uqueue) 56 | 57 | ;; Only request contacts that have sent to us directly 58 | (setq mu4e-compose-complete-only-personal t) 59 | ;; Don't update contacts after every update 60 | (remove-hook 'mu4e-index-updated-hook 'mu4e~request-contacts) 61 | 62 | (setq mu4e-cache-maildir-list t) 63 | 64 | ;; (setq mu4e-contexts 65 | ;; (list (make-mu4e-context 66 | ;; :name "Any") 67 | ;; (make-mu4e-context 68 | ;; :name "Personal" 69 | ;; ;; we match based on the contact-fields of the message 70 | ;; :enter-func (lambda () (mu4e-message "Personal mail")) 71 | ;; :match-func (lambda (msg) 72 | ;; (when msg 73 | ;; (not (string-match-p "^/Spritely" (mu4e-message-field msg :maildir))))) 74 | ;; :vars '((user-mail-address . "cwebber@dustycloud.org"))) 75 | ;; (make-mu4e-context 76 | ;; :name "Work" 77 | ;; :enter-func (lambda () (mu4e-message "Work mail")) 78 | ;; :match-func (lambda (msg) 79 | ;; (when msg 80 | ;; (mu4e-message-contact-field-matches msg 81 | ;; :to "cwebber@dustycloud.org"))) 82 | ;; ) 83 | ;; ,(make-mu4e-context 84 | ;; :name "Work" 85 | ;; :enter-func (lambda () (mu4e-message "Switch to the Work context")) 86 | ;; ;; no leave-func 87 | ;; ;; we match based on the maildir of the message 88 | ;; ;; this matches maildir /Arkham and its sub-directories 89 | ;; :match-func (lambda (msg) 90 | ;; (when msg 91 | ;; (string-match-p "^/Arkham" (mu4e-message-field msg :maildir)))) 92 | ;; :vars '( ( user-mail-address . "aderleth@miskatonic.example.com" ) 93 | ;; ( user-full-name . "Alice Derleth" ) 94 | ;; ( message-user-organization . "Miskatonic University" ) 95 | ;; ( mu4e-compose-signature . 96 | ;; (concat 97 | ;; "Prof. Alice Derleth\n" 98 | ;; "Miskatonic University, Dept. of Occult Sciences\n")))) 99 | 100 | ;; ,(make-mu4e-context 101 | ;; :name "Cycling" 102 | ;; :enter-func (lambda () (mu4e-message "Switch to the Cycling context")) 103 | ;; ;; no leave-func 104 | ;; ;; we match based on the maildir of the message; assume all 105 | ;; ;; cycling-related messages go into the /cycling maildir 106 | ;; :match-func (lambda (msg) 107 | ;; (when msg 108 | ;; (string= (mu4e-message-field msg :maildir) "/cycling"))) 109 | ;; :vars '( ( user-mail-address . "aderleth@example.com" ) 110 | ;; ( user-full-name . "AliceD" ) 111 | ;; ( mu4e-compose-signature . nil))))) 112 | -------------------------------------------------------------------------------- /modes/muse.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; Muse 3 | ;; --------- 4 | 5 | ;;; Muse-mode 6 | (require 'muse) 7 | (require 'muse-mode) ; load authoring mode 8 | (require 'muse-html) ; load publishing styles I use 9 | (require 'muse-latex) 10 | (require 'muse-project) 11 | ;(setq muse-latex-header "./header.tex") 12 | 13 | (setq muse-project-alist 14 | '(("WikiPlanner" 15 | ("~/Plans" 16 | :default "Taskpool" 17 | :major-mode planner-mode 18 | :visit-link planner-visit-link) 19 | (:base "planner-xhtml" 20 | :path "~/Documents/planner/")) 21 | ("dustycloud" ; dustycloud.org stuff 22 | ("~/proj/dustycloud/" :default "index") 23 | (:base "xhtml" :path "~/Documents/dustycloud")))) 24 | 25 | ;; (add-to-list 'muse-publish-markup-regexps 26 | ;; '(2150 "^SP{\\(.*\\)}: \\(\\(?:.\\|.\n\\)*.\\)\\(?:\n\\|\\'\\)" 27 | ;; 0 actor)) 28 | 29 | ;; (add-to-list 'muse-publish-markup-functions 30 | ;; '(actor . muse-publish-markup-actor)) 31 | 32 | ;(add-hook 'muse-mode-hook 'ruler-mode) 33 | 34 | ;(require 'muse-latex) 35 | -------------------------------------------------------------------------------- /modes/nodejs-repl.el: -------------------------------------------------------------------------------- 1 | (require 'nodejs-repl) 2 | 3 | (add-hook 'js-mode-hook 4 | (lambda () 5 | (define-key js-mode-map (kbd "C-x C-e") 'nodejs-repl-send-last-expression) 6 | (define-key js-mode-map (kbd "C-c C-j") 'nodejs-repl-send-line) 7 | (define-key js-mode-map (kbd "C-c C-r") 'nodejs-repl-send-region) 8 | (define-key js-mode-map (kbd "C-c C-c") 'nodejs-repl-send-buffer) 9 | (define-key js-mode-map (kbd "C-c C-l") 'nodejs-repl-load-file) 10 | (define-key js-mode-map (kbd "C-c C-z") 'nodejs-repl-switch-to-repl))) 11 | 12 | -------------------------------------------------------------------------------- /modes/orderless.el: -------------------------------------------------------------------------------- 1 | (require 'orderless) 2 | 3 | (setq completion-styles '(orderless) 4 | completion-category-defaults nil) 5 | -------------------------------------------------------------------------------- /modes/org-norang.el: -------------------------------------------------------------------------------- 1 | ; Stuff from http://doc.norang.ca/org-mode.html 2 | ; GPLv3 stuff it says :) 3 | 4 | ;; Show all future entries for repeating tasks 5 | (setq org-agenda-repeating-timestamp-show-all t) 6 | 7 | ;; Show all agenda dates - even if they are empty 8 | (setq org-agenda-show-all-dates t) 9 | 10 | ;; Sorting order for tasks on the agenda 11 | (setq org-agenda-sorting-strategy 12 | (quote ((agenda habit-down time-up user-defined-up priority-down effort-up category-keep) 13 | (todo category-up priority-down effort-up) 14 | (tags category-up priority-down effort-up) 15 | (search category-up)))) 16 | 17 | ;; ;; Start the weekly agenda on Monday 18 | ;; (setq org-agenda-start-on-weekday 1) 19 | 20 | ;; ;; Enable display of the time grid so we can see the marker for the current time 21 | ;; (setq org-agenda-time-grid (quote ((daily today remove-match) 22 | ;; #("----------------" 0 16 (org-heading t)) 23 | ;; (830 1000 1200 1300 1500 1700)))) 24 | 25 | ;; Display tags farther right 26 | (setq org-agenda-tags-column -102) 27 | 28 | ;; 29 | ;; Agenda sorting functions 30 | ;; 31 | (setq org-agenda-cmp-user-defined 'bh/agenda-sort) 32 | 33 | (defun bh/agenda-sort (a b) 34 | "Sorting strategy for agenda items. 35 | Late deadlines first, then scheduled, then non-late deadlines" 36 | (let (result num-a num-b) 37 | (cond 38 | ; time specific items are already sorted first by org-agenda-sorting-strategy 39 | 40 | ; non-deadline and non-scheduled items next 41 | ((bh/agenda-sort-test 'bh/is-not-scheduled-or-deadline a b)) 42 | 43 | ; deadlines for today next 44 | ((bh/agenda-sort-test 'bh/is-due-deadline a b)) 45 | 46 | ; late deadlines next 47 | ((bh/agenda-sort-test-num 'bh/is-late-deadline '< a b)) 48 | 49 | ; scheduled items for today next 50 | ((bh/agenda-sort-test 'bh/is-scheduled-today a b)) 51 | 52 | ; late scheduled items next 53 | ((bh/agenda-sort-test-num 'bh/is-scheduled-late '> a b)) 54 | 55 | ; pending deadlines last 56 | ((bh/agenda-sort-test-num 'bh/is-pending-deadline '< a b)) 57 | 58 | ; finally default to unsorted 59 | (t (setq result nil))) 60 | result)) 61 | 62 | (defmacro bh/agenda-sort-test (fn a b) 63 | "Test for agenda sort" 64 | `(cond 65 | ; if both match leave them unsorted 66 | ((and (apply ,fn (list ,a)) 67 | (apply ,fn (list ,b))) 68 | (setq result nil)) 69 | ; if a matches put a first 70 | ((apply ,fn (list ,a)) 71 | (setq result -1)) 72 | ; otherwise if b matches put b first 73 | ((apply ,fn (list ,b)) 74 | (setq result 1)) 75 | ; if none match leave them unsorted 76 | (t nil))) 77 | 78 | (defmacro bh/agenda-sort-test-num (fn compfn a b) 79 | `(cond 80 | ((apply ,fn (list ,a)) 81 | (setq num-a (string-to-number (match-string 1 ,a))) 82 | (if (apply ,fn (list ,b)) 83 | (progn 84 | (setq num-b (string-to-number (match-string 1 ,b))) 85 | (setq result (if (apply ,compfn (list num-a num-b)) 86 | -1 87 | 1))) 88 | (setq result -1))) 89 | ((apply ,fn (list ,b)) 90 | (setq result 1)) 91 | (t nil))) 92 | 93 | (defun bh/is-not-scheduled-or-deadline (date-str) 94 | (and (not (bh/is-deadline date-str)) 95 | (not (bh/is-scheduled date-str)))) 96 | 97 | (defun bh/is-due-deadline (date-str) 98 | (string-match "Deadline:" date-str)) 99 | 100 | (defun bh/is-late-deadline (date-str) 101 | (string-match "In *\\(-.*\\)d\.:" date-str)) 102 | 103 | (defun bh/is-pending-deadline (date-str) 104 | (string-match "In \\([^-]*\\)d\.:" date-str)) 105 | 106 | (defun bh/is-deadline (date-str) 107 | (or (bh/is-due-deadline date-str) 108 | (bh/is-late-deadline date-str) 109 | (bh/is-pending-deadline date-str))) 110 | 111 | (defun bh/is-scheduled (date-str) 112 | (or (bh/is-scheduled-today date-str) 113 | (bh/is-scheduled-late date-str))) 114 | 115 | (defun bh/is-scheduled-today (date-str) 116 | (string-match "Scheduled:" date-str)) 117 | 118 | (defun bh/is-scheduled-late (date-str) 119 | (string-match "Sched\.\\(.*\\)x:" date-str)) 120 | -------------------------------------------------------------------------------- /modes/org-roam.el: -------------------------------------------------------------------------------- 1 | (require 'org-roam) 2 | (setq org-roam-directory (file-truename "~/org/roam")) 3 | (org-roam-db-autosync-mode) 4 | 5 | (define-key global-map "\C-cri" 'org-roam-node-insert) 6 | (define-key global-map "\C-crc" 'org-roam-capture) 7 | (define-key global-map "\C-crf" 'org-roam-node-find) 8 | (define-key global-map "\C-crl" 'org-roam-buffer-toggle) 9 | -------------------------------------------------------------------------------- /modes/org.el: -------------------------------------------------------------------------------- 1 | ;; -------- 2 | ;; Org mode 3 | ;; -------- 4 | 5 | (require 'org) 6 | (require 'org-id) 7 | ;; (require 'org-install) 8 | 9 | ; Load stuff from http://doc.norang.ca/org-mode.html 10 | (load-file "~/.config/emacs/modes/org-norang.el") 11 | 12 | (global-set-key (kbd "C-c a") 'org-agenda) 13 | 14 | ;; why did they unbind this 15 | (org-defkey org-mode-map [(control tab)] 'org-force-cycle-archived) 16 | 17 | (setq org-export-html-toplevel-hlevel 2) 18 | (setq org-export-babel-evaluate nil) 19 | (setq org-agenda-files "~/org/orgfiles.txt") 20 | (setq org-id-track-globally nil) 21 | (setq org-link-to-org-use-id nil) 22 | ;(setq org-id-locations-file "~/org/org-id-locations.txt") 23 | ;(setq org-agenda-include-diary t) 24 | (setq org-agenda-timegrid-use-ampm t) 25 | (setq org-agenda-include-diary nil) 26 | ; (setq org-hide-leading-stars t) 27 | (setq org-log-done nil) 28 | (setq org-agenda-skip-scheduled-if-deadline-is-shown t) 29 | 30 | (setq org-todo-keywords 31 | '((sequence "TODO(t)" "WAIT(w@)" "NEXT(n!)" "|" "DONE(d!)" "CANCELED(c@)"))) 32 | 33 | (setq org-todo-keyword-faces 34 | '(("CANCELED" . (:foreground "orange" :weight bold)) 35 | ("NEXT" . (:foreground "DeepPink2" :weight bold)) 36 | ("DONE-NOT-ME" . (:foreground "SpringGreen4" :weight bold)) 37 | ("PASSED-OFF" . (:foreground "peru" :weight bold)) 38 | ("CAL-CANCEL" . (:foreground "orange" :weight bold)) 39 | ("WAITING" . (:foreground "dodger blue" :weight bold)) 40 | ("WAIT" . (:foreground "dodger blue" :weight bold)) 41 | ("PAYMENT-WAITING" . (:foreground "orchid" :weight bold)) 42 | ("PAID" . (:foreground "sea green" :weight bold)) 43 | ("FOODLIST-OUT" . (:foreground "#4e9a06" :weight bold)) 44 | )) 45 | 46 | ; Complete with org-complete (does a fallback to hippie-expand automatically) 47 | ;(define-key org-mode-map "\M-/" 'org-complete) 48 | 49 | ;; We want the lowest and "default" priority to be E. That way 50 | ;; when we calculate the agenda, any task that isn't specifically 51 | ;; marked with a priority or SCHEDULED/DEADLINE won't show up. 52 | (setq org-default-priority ?E) 53 | (setq org-lowest-priority ?E) 54 | 55 | ;; These priority faces look good 56 | (setq org-priority-faces 57 | '((?A . "DeepPink1") 58 | (?B . "light sea green") 59 | (?C . "slate blue") 60 | (?D . "#f0640f"))) 61 | 62 | (require 'org-habit) 63 | (add-to-list 'org-modules 'org-habit) 64 | (setq org-habit-graph-column 60) 65 | (setq org-habit-show-done-always-green t) 66 | 67 | (define-key global-map "\C-cor" 'org-capture) 68 | ;(define-key global-map "\C-coc" 'org-capture) 69 | (define-key global-map "\C-col" 'org-store-link) 70 | (define-key global-map "\C-coj" 'org-clock-goto) 71 | (define-key global-map "\C-coJ" (lambda () (interactive) (org-clock-goto t))) 72 | 73 | (define-key global-map "\C-cod" 'org-diet-hacky-jump-to-today) 74 | ;(define-key global-map "\C-cob" 'org-iswitchb) 75 | 76 | (setq org-remember-delete-empty-lines-at-end nil) 77 | 78 | (setq org-capture-templates 79 | '(("t" "Todo" entry 80 | (file+headline "~/org/life.org" "Various Tasks") 81 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 82 | ("e" "Event" entry 83 | (file+headline "~/org/life.org" "Events") 84 | "* %^{Event}\n %^t\n %i\n %a\n\n%?" :prepend t :empty-lines 1) 85 | ("j" "Journal" entry 86 | (file+headline "~/org/journal.org" "") 87 | "* %U %?\n\n %i\n %a" :prepend t :empty-lines 1) 88 | ("w" "Weigh-in" entry 89 | (file+headline "~/org/diet.org" "Daily Logs") 90 | "* CAL-IN Diet for day %t 91 | %^{Weight}p 92 | | Food / Exercise | Calories | Quantity | Total | 93 | |-----------------+----------+----------+-------| 94 | | %? | | | | 95 | |-----------------+----------+----------+-------| 96 | | Total | | | | 97 | #+TBLFM: $4=$2*$3;%.0f::@>$4=vsum(@2$4..@-I$4) 98 | 99 | " 100 | :prepend t :empty-lines 1) 101 | ("W" "Weigh-in (no table)" entry 102 | (file+headline "~/org/diet.org" "Daily Logs") 103 | "* Diet for day %t 104 | %^{Weight}p 105 | " 106 | :prepend t :empty-lines 1) 107 | ("b" "Blood pressure" table-line 108 | (file+headline "~/org/bpressure.org" "Blood pressure table") 109 | "| %U | %^{systolic} | %^{diastolic} | %^{pulse} | %^{note} |") 110 | ("n" "Note" entry 111 | (file+headline "~/org/notes.org" "General Notes") 112 | "* %^{Title}\n :PROPERTIES:\n :CreationTime: %U\n :END:\n\n %i\n\n %a\n" 113 | :prepend t :empty-lines 1) 114 | ("i" "Idea" entry 115 | (file+headline "~/org/ideas.org" "") 116 | "* %^{Title}\n %i\n %a\n" :prepend t :empty-lines 1) 117 | ("p" "Purchase wishlist" entry 118 | (file+headline "~/org/consumerism.org" "Stuff to buy") 119 | "* TODO %^{Title}\n\n%?\n" :prepend t :empty-lines 1) 120 | ;; ("c" "CC work-related items") 121 | ;; ("ct" "CC Todo" entry 122 | ;; (file+headline "~/org/ccommons.org" "Various Tasks") 123 | ;; "* TODO %?\n %i\n %a" :prepend t :empty-lines 1) 124 | ;; ("ce" "CC Event" entry 125 | ;; (file+headline "~/org/ccommons.org" "Events") 126 | ;; "* %^{Event}\n %^t\n %i\n %a\n\n%?" :prepend t :empty-lines 1) 127 | ;; ("cn" "CC Note" entry 128 | ;; (file+headline "~/org/ccommons.org" "Various Notes") 129 | ;; "* %^{Title}\n :PROPERTIES:\n :CreationTime: %U\n :END:\n\n %i\n\n %a" 130 | ;; :prepend t :empty-lines 1) 131 | ;; ("cb" "CC Billable" entry 132 | ;; (file+headline "~/org/ccommons.org" "Billable Stuff") 133 | ;; "* %^{Title}\n :PROPERTIES:\n :CreationTime: %U\n :END:\n\n %i\n\n %a" 134 | ;; :prepend t :empty-lines 1) 135 | ("m" "MediaGoblin items") 136 | ("mt" "MediaGoblin TODO") 137 | ("mth" "MediaGoblin Todo: Hacking" entry 138 | (file+headline "~/org/mediagoblin.org" "Hacking Tasks") 139 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 140 | ("mtc" "MediaGoblin Todo: Community" entry 141 | (file+headline "~/org/mediagoblin.org" "Community Tasks") 142 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 143 | ("mta" "MediaGoblin Todo: Administration" entry 144 | (file+headline "~/org/mediagoblin.org" "Administrative Tasks") 145 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 146 | ("mtv" "MediaGoblin Todo: Various" entry 147 | (file+headline "~/org/mediagoblin.org" "Various Tasks") 148 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 149 | ("mtr" "MediaGoblin Todo: Review Queue" entry 150 | (file+headline "~/org/mediagoblin.org" "Review Queue") 151 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 152 | ("me" "MediaGoblin Event" entry 153 | (file+headline "~/org/mediagoblin.org" "Events") 154 | "* %^{Event}\n %^t\n %i\n %a\n\n%?" :prepend t :empty-lines 1) 155 | ("mn" "MediaGoblin Note" entry 156 | (file+headline "~/org/mediagoblin.org" "General Notes") 157 | "* %^{Title}\n :PROPERTIES:\n :CreationTime: %U\n :END:\n\n %i\n\n %a\n" 158 | :prepend t :empty-lines 1) 159 | ;; Digital Bazaar stuff 160 | ;; -------------------- 161 | ("d" "Digital Bazaar") 162 | ("dt" "Digital Bazaar Various Tasks" entry 163 | (file+headline "~/org/contracting/dbazaar.org" "Various Tasks") 164 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 165 | ("dp" "Digital Bazaar Projects") 166 | ("dpo" "DB Projects: ocap-ld" entry 167 | (file+headline "~/org/contracting/dbazaar.org" "ocap-ld") 168 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 169 | ("dpc" "DB Projects: House Clerk" entry 170 | (file+olp "~/org/contracting/dbazaar.org" 171 | "Projects" "Legislative data modeling") 172 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 173 | ;; Contracting stuff 174 | ;; ----------------- 175 | ("c" "Contracting") 176 | ;; General 177 | ("cg" "Contracting general") 178 | ("cgb" "Billing" entry 179 | (file+headline "~/org/contracting/contracting.org" "Billing") 180 | "* TODO Billing for %? 181 | ** TODO Get out invoice 182 | *** TODO Write it up 183 | *** TODO Send it in 184 | 185 | ** TODO Get paid 186 | ** TODO Record in [[file:~/org/finances.ldgr][ledger]] and [[~/org/finances.org][finances.org]] 187 | " 188 | :prepend t :empty-lines 1) 189 | ;; Open Tech Strategies 190 | ("cgt" "Contracting general TODO" entry 191 | (file+headline "~/org/contracting/contracting.org" "Various Tasks") 192 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 193 | ("co" "Open Tech Strategies") 194 | ("cot" "OTS Todo" entry 195 | (file+headline "~/org/contracting/opentechstrategies.org" "Various Tasks") 196 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 197 | ("coe" "OTS Event" entry 198 | (file+headline "~/org/contracting/opentechstrategies.org" "Events") 199 | "* %^{Event}\n %^t\n %i\n %a\n\n%?" :prepend t :empty-lines 1) 200 | ("con" "OTS Note" entry 201 | (file+headline "~/org/contracting/opentechstrategies.org" "Notes") 202 | "* %^{Title}\n :PROPERTIES:\n :CreationTime: %U\n :END:\n\n %i\n\n %a\n" 203 | :prepend t :empty-lines 1) 204 | ("cob" "OTS Billing" entry 205 | (file+headline "~/org/contracting/opentechstrategies.org" "Billing") 206 | "* TODO Billing for %? 207 | ** TODO Get out invoice 208 | *** TODO Write it up 209 | *** TODO Send it in 210 | 211 | ** TODO Get paid 212 | ** TODO Record in [[file:~/org/finances.ldgr][ledger]] and [[~/org/finances.org][finances.org]] 213 | " 214 | :prepend t :empty-lines 1) 215 | ("C" "Contact" entry 216 | (file+headline "~/org/contacts.org" "General") 217 | "* %(org-contacts-template-name) 218 | :PROPERTIES: 219 | :EMAIL: %^{Email} 220 | :CreationTime: %U 221 | :END: 222 | %?") 223 | ;; ("l" "Ledger entries") 224 | ;; ("le" "Expense (checking)" plain 225 | ;; (file "~/org/finances.ldgr") 226 | ;; "%(org-read-date) %^{Payee} 227 | ;; Expenses:%^{Account} %^{Amount} 228 | ;; Assets:Banking:Checking 229 | ;; ") 230 | ;; ("lc" "Cash expense" plain 231 | ;; (file "~/org/finances.ldgr") 232 | ;; "%(org-read-date) %^{Payee} 233 | ;; Expenses:%^{Account} %^{Amount} 234 | ;; Expenses:Cash 235 | ;; ") 236 | ;; ("x" "XUDD") 237 | ;; ("xt" "XUDD Todo" entry 238 | ;; (file+headline "~/org/xudd.org" "Tasks") 239 | ;; "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 240 | ;; ("xn" "XUDD Note" entry 241 | ;; (file+headline "~/org/xudd.org" "Notes") 242 | ;; "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 243 | ("s" "SocialWG tasks") 244 | ("sT" "SocialWG TODO" entry 245 | (file+headline "~/org/socialwg.org" "SocialWG Tasks") 246 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 247 | ("sp" "ActiviPy (Python) Todo" entry 248 | (file+headline "~/org/socialwg.org" "ActiviPy Tasks") 249 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 250 | ("sg" "Activitystuff (Guile) Todo" entry 251 | (file+headline "~/org/socialwg.org" "Activitystuff Tasks") 252 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 253 | ("r" "SpRitely tasks") 254 | ("rt" "Spritely Various Tasks" entry 255 | (file+headline "~/org/spritely.org" "Various Tasks") 256 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 257 | ("rg" "Goblins Tasks" entry 258 | (file+headline "~/org/spritely/goblins.org" "Various tasks") 259 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 260 | ("g" "Guile/Guix tasks") 261 | ("gt" "Guile Todo" entry 262 | (file+headline "~/org/guile.org" "Guile Tasks") 263 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1) 264 | ("gx" "Guix Todo" entry 265 | (file+headline "~/org/guile.org" "Guix Tasks") 266 | "* TODO %?\n %i\n %a\n" :prepend t :empty-lines 1))) 267 | 268 | (setq org-columns-default-format "%30ITEM %TODO %DEADLINE %TAGS") 269 | 270 | ; Always file things at the start of a tree rather than at the end 271 | (setq org-reverse-note-order t) 272 | 273 | (setq org-log-state-notes-into-drawer t) 274 | 275 | (setq org-refile-targets '((org-agenda-files . (:maxlevel . 8)))) 276 | (setq org-refile-use-outline-path 'file) 277 | ;; Don't take forever to refile 278 | (setq org-refile-use-cache t) 279 | 280 | ; Force task blocking (ie, block marking as done with subtasks open) 281 | (setq org-enforce-todo-dependencies t) 282 | ; ... but don't grey it out 283 | (setq org-agenda-dim-blocked-tasks nil) 284 | 285 | (defun cwebber/is-habit-p () 286 | (equal (org-entry-get (point) "STYLE") "habit")) 287 | 288 | (defun cwebber/skip-unless-habit () 289 | "Checks to see if the style at point is \"habit\"" 290 | (if (not (cwebber/is-habit-p)) 291 | ; Skip till the next heading 292 | (progn (outline-next-heading) (1- (point))))) 293 | 294 | ;;;; HACK 295 | (defun cwebber/skip-if-habit () 296 | "Checks to see if the style at point is \"habit\"" 297 | (if (cwebber/is-habit-p) 298 | ; Skip till the next heading 299 | (progn (outline-next-heading) (1- (point))))) 300 | 301 | ;; Custom agenda dispatch commands which allow you to look at 302 | ;; priorities while still being able to see when deadlines, appointments 303 | ;; are coming up. Very often you'll just be looking at the A or B tasks, 304 | ;; and when you clear off enough of those or have some time you might 305 | ;; look also at the C tasks 306 | ;; 307 | ;; Hit "C-c a" then one of the following key sequences... 308 | ;; - a for the A priority items, plus the agenda below it 309 | ;; - b for A-B priority items, plus the agenda below it 310 | ;; - c for A-C priority items, plus the agenda below it 311 | ;; - A for just the agenda 312 | ;; - t for just the A-C priority TODOs 313 | (setq org-agenda-custom-commands 314 | '(("N" todo "NEXT") 315 | ("h" "Habits" 316 | ((agenda 317 | "" 318 | ((org-habit-show-all-today t) 319 | (org-agenda-skip-function 'cwebber/skip-unless-habit) 320 | )))) 321 | ;;("a" "Agenda plus plus" 322 | ;; ((todo "NEXT") 323 | ;; (agenda ""))) 324 | ("a" "Agenda plus A items" 325 | ((tags-todo 326 | "+PRIORITY=\"A\"" 327 | ((org-agenda-sorting-strategy '(priority-down)))) 328 | (agenda ""))) 329 | ("b" "Agenda plus A+B items" 330 | ((tags-todo 331 | "+PRIORITY=\"A\"|+PRIORITY=\"B\"" 332 | ((org-agenda-sorting-strategy '(priority-down)))) 333 | (agenda ""))) 334 | ("c" "Agenda plus A+B+C items" 335 | ((tags-todo 336 | "+PRIORITY=\"A\"|+PRIORITY=\"B\"|+PRIORITY=\"C\"" 337 | ((org-agenda-sorting-strategy '(priority-down)))) 338 | (agenda ""))) 339 | ("d" "Agenda plus A+B+C+D items" 340 | ((tags-todo 341 | "+PRIORITY=\"A\"|+PRIORITY=\"B\"|+PRIORITY=\"C\"|+PRIORITY=\"D\"" 342 | ((org-agenda-sorting-strategy '(priority-down)))) 343 | (agenda ""))) 344 | ("A" "Agenda" 345 | ((agenda ""))) 346 | ("t" "Just TODO items" 347 | ((tags-todo 348 | "+PRIORITY=\"A\"|+PRIORITY=\"B\"|+PRIORITY=\"C\"" 349 | ((org-agenda-sorting-strategy '(priority-down)))))))) 350 | 351 | ; Make sure we don't block repeating tasks 352 | (defadvice org-block-todo-from-children-or-siblings-or-parent 353 | (around cwebber/dont-block-if-repeating) 354 | "Never block if this is a repeating task" 355 | (let ((org-enforce-todo-dependencies 356 | (not (org-get-repeat)))) 357 | ad-do-it)) 358 | 359 | (ad-activate 'org-block-todo-from-children-or-siblings-or-parent) 360 | 361 | ; It's just too hard to deal with daily repeating tasks (octavia) 362 | ; if you see them every day in the future 363 | ; I am not confident this is the right option though. 364 | (setq org-agenda-repeating-timestamp-show-all nil) 365 | 366 | ;; Commenting this out. It's been pretty annoying, tbh. 367 | ;;;; Start weekly view from... Monday. Used to be present day but life 368 | ;;;; has changed. 369 | ;; 370 | ;; (setq org-agenda-start-on-weekday 1) 371 | 372 | ;; Show two weeks at a time. TWO weeks! 373 | (setq org-agenda-span 'fortnight) 374 | 375 | ;; Useful functions 376 | 377 | (defun cwebber-org-update-roundup () 378 | (with-current-buffer (or (find-buffer-visiting "~/org/ccommons.org") 379 | (find-file-noselect "~/org/ccommons.org")) 380 | (save-excursion 381 | (beginning-of-buffer) 382 | (search-forward "\n* Roundup") 383 | (outline-next-heading) 384 | (backward-char) 385 | (let* ((roundup-entries 386 | (remove "" 387 | (split-string 388 | (shell-command-to-string 389 | "python ~/org/scripts/read_roundup_csv.py") "\n"))) 390 | (roundup-header-marker (point-marker)) 391 | (filed-roundup-ids 392 | (remove nil (org-map-entries 393 | '(org-entry-get (point) "ROUNDUPID") 394 | nil 'tree)))) 395 | (dolist (csvline roundup-entries) 396 | (let* ((split-entry (split-string csvline)) 397 | (entry-id (car split-entry)) 398 | (entry-title (combine-and-quote-strings (cdr split-entry)))) 399 | (if (not (member entry-id filed-roundup-ids)) 400 | (progn 401 | (insert "\n\n") 402 | (backward-char) 403 | (org-insert-subheading t) 404 | (insert (format "TODO [[roundup:%s]] %s" entry-id entry-title)) 405 | (org-entry-put (point) "ROUNDUPID" entry-id) 406 | (hide-subtree) 407 | (goto-char (marker-position roundup-header-marker)))))))))) 408 | 409 | 410 | (defun cwebber-org-pull-up-agenda (&optional open-same-window) 411 | "Switch to the org agenda, or prompt for new one if one does not exist" 412 | (interactive "P") 413 | (let ((agenda-buffer (get-buffer "*Org Agenda*"))) 414 | (if agenda-buffer 415 | (if open-same-window 416 | (switch-to-buffer agenda-buffer) 417 | (switch-to-buffer-other-window agenda-buffer)) 418 | (org-agenda)))) 419 | 420 | (define-key global-map "\C-coa" 'cwebber-org-pull-up-agenda) 421 | (define-key global-map [XF86Favorites] 'cwebber-org-pull-up-agenda) 422 | (define-key global-map [f5] 'cwebber-org-pull-up-agenda) 423 | 424 | 425 | ;; NEXT tag on TODO magic 426 | 427 | (defun cwebber/org-possibly-toggle-next-tag-based-on-todo-kewyord () 428 | (save-excursion 429 | (org-back-to-heading) 430 | (let ((todo-is-next (equal (org-get-todo-state) "NEXT")) 431 | (next-in-tags (member "NEXT" (org-get-tags)))) 432 | (if (or (and todo-is-next (not next-in-tags)) 433 | (and (not todo-is-next) next-in-tags)) 434 | (org-toggle-tag "NEXT"))))) 435 | 436 | (add-hook 'org-after-todo-state-change-hook 437 | 'cwebber/org-possibly-toggle-next-tag-based-on-todo-kewyord) 438 | 439 | ;; VOODOO MAGIC 440 | 441 | (setq cwebber/org-currently-in-NEXT-setting nil) 442 | 443 | (defun cwebber/org-repeating-tasks-with-NEXT () 444 | "Repeating entries set to NEXT should switch back to their old state when done 445 | 446 | When first setting to NEXT, it sets a property, ORIG-TODO-STATE 447 | If set to NEXT and it's being run again, it sets it back 448 | 449 | This uses DARK VOODOO MAGIC but it works" 450 | (let ((is-repeater (org-get-repeat)) 451 | (orig-todo-state (org-entry-get (point) "ORIG_TODO_STATE"))) 452 | (if is-repeater 453 | (cond (cwebber/org-currently-in-NEXT-setting nil) ; don't recurse :) 454 | ;; New state is NEXT, old state was something else 455 | ((and (equal org-state "NEXT") 456 | (not orig-todo-state)) 457 | (org-entry-put (point) "ORIG_TODO_STATE" org-last-state)) 458 | ((and (equal org-state "NEXT") 459 | orig-todo-state) 460 | (progn 461 | (org-entry-delete (point) "ORIG_TODO_STATE") 462 | (let ((cwebber/org-currently-in-NEXT-setting t)) 463 | (org-todo orig-todo-state)))))))) 464 | 465 | (add-hook 'org-after-todo-state-change-hook 466 | 'cwebber/org-repeating-tasks-with-NEXT) 467 | 468 | 469 | ;; ----------------- 470 | ;; Appointment stuff 471 | ;; ----------------- 472 | 473 | (defun cwebber/org-reset-appts () 474 | "For use on grumps only... this also reverts all files, but it does update the appt list" 475 | (interactive) 476 | (setq appt-time-msg-list nil) 477 | (flet ((yes-or-no-p (x) t)) 478 | (org-revert-all-org-buffers)) 479 | (org-agenda-to-appt)) 480 | 481 | (appt-activate) 482 | (org-agenda-to-appt) 483 | (require 'midnight) 484 | (setq midnight-mode t) 485 | (remove-hook 'midnight-hook 'clean-buffer-list) 486 | (add-hook 'midnight-hook 'org-agenda-to-appt) 487 | 488 | ;; ; This one is kinda annoying... 489 | ;; (add-hook 'org-finalize-agenda-hook 'org-agenda-to-appt) 490 | 491 | ;(setq org-clock-idle-time 15) 492 | (setq org-clock-idle-time nil) 493 | (setq org-clock-out-remove-zero-time-clocks nil) ;; turns out I hate this feature 494 | 495 | (setq org-agenda-clockreport-parameter-plist 496 | (quote (:link nil :maxlevel 5 :fileskip0 t :compact t :narrow 90 :tags "-nonbillable"))) 497 | 498 | (setq org-src-fontify-natively t) 499 | (setq org-src-tab-acts-natively t) 500 | 501 | ;; ----------- 502 | ;; Babel stuff 503 | ;; ----------- 504 | 505 | (require 'ob-python) 506 | ;; (require 'ob-sh) 507 | (require 'ob-gnuplot) 508 | (require 'ob-calc) 509 | 510 | ; Don't prompt me all the time about evaluating code blocks 511 | 512 | (setq org-confirm-babel-evaluate nil) 513 | 514 | (setq org-src-preserve-indentation nil) 515 | ;; only indent the headers of an entry 516 | (setq org-adapt-indentation 'headline-data) 517 | 518 | ;; ----------- 519 | ;; Other stuff 520 | ;; ----------- 521 | 522 | ;; Make windmove work in org-mode: 523 | (add-hook 'org-shiftup-final-hook 'windmove-up) 524 | (add-hook 'org-shiftleft-final-hook 'windmove-left) 525 | (add-hook 'org-shiftdown-final-hook 'windmove-down) 526 | (add-hook 'org-shiftright-final-hook 'windmove-right) 527 | 528 | (defun cwebber/set-back-open-line () 529 | (define-key org-mode-map (kbd "C-o") 'open-line)) 530 | 531 | (add-hook 'org-mode-hook 'cwebber/set-back-open-line) 532 | 533 | ; More desparate 534 | (defun org-open-line (n) 535 | (interactive "*p") 536 | (open-line n)) 537 | 538 | ; hacky diet stuff 539 | (defun org-diet-hacky-jump-to-today () 540 | "Really hacky function to jump to today based on the assumption 541 | that we can find the first Total line" 542 | (interactive) 543 | (find-file "~/org/diet.org") 544 | (beginning-of-buffer) 545 | (search-forward-regexp "^| Total") 546 | (beginning-of-line) 547 | (previous-line)) 548 | 549 | (defun cwebber/org-diet-copy-weight-to-dustycloud () 550 | (interactive) 551 | (save-excursion 552 | (let ((org-diet-open-in-browser-after-export nil)) 553 | (org-diet-expand-and-export-progress-template)) 554 | (shell-command "scp /tmp/org_diet_results.html /tmp/weight_month.png /tmp/weight_year.png dustycloud:/srv/dustycloud/static/tmp/") 555 | (browse-url "https://dustycloud.org/tmp/org_diet_results.html") 556 | (kill-buffer) 557 | (other-window -1))) 558 | 559 | (define-key global-map (kbd "C-c o W") 'cwebber/org-diet-copy-weight-to-dustycloud) 560 | 561 | 562 | ;; Open files with the programs I want. 563 | 564 | (setq org-file-apps 565 | '((auto-mode . emacs) 566 | ("\\.mm\\'" . default) 567 | ("\\.x?html?\\'" . "firefox %s") 568 | ("\\.pdf\\'" . "evince %s"))) 569 | 570 | ; pretty latex source blocks! 571 | ; hm, what to do in the new exporter? 572 | 573 | ;; (setq org-export-latex-listings 'minted) 574 | ;; (setq org-latex-to-pdf-process 575 | ;; '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" 576 | ;; "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" 577 | ;; "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) 578 | 579 | ;; (add-to-list 'org-export-latex-packages-alist 580 | ;; '("" "minted")) 581 | ;; (add-to-list 'org-export-latex-packages-alist 582 | ;; '("" "hyperref")) 583 | 584 | ; Also in latex, @alert@ 585 | ;;; Not working... why? 586 | ;; (add-to-list 'org-export-latex-emphasis-alist 587 | ;; '("@" "\\alert{%s}" nil)) 588 | 589 | ; Make org the default scratch 590 | 591 | (setq initial-major-mode 'org-mode) 592 | (with-current-buffer "*scratch*" 593 | (if (not (eq major-mode initial-major-mode)) 594 | (funcall initial-major-mode))) 595 | (setq initial-scratch-message 596 | (purecopy "\ 597 | # Scratch! 598 | # -------- 599 | # This buffer is for notes you don't want to save, etc. 600 | ")) 601 | 602 | 603 | (defun cwebber/org-tree-to-indirect-buffer-renamed (subname) 604 | "Like org-tree-to-indirect-buffer, with the option to give a \"subname\"" 605 | (interactive "sNew buffer subname?: ") 606 | (let ((orig-buffer-name (buffer-name (current-buffer)))) 607 | (org-tree-to-indirect-buffer) 608 | (other-window 1) 609 | (if (not (equal subname "")) 610 | (rename-buffer (format "%s(%s)" orig-buffer-name subname))))) 611 | 612 | (define-key org-mode-map (kbd "C-c C-x b") 'cwebber/org-tree-to-indirect-buffer-renamed) 613 | 614 | 615 | ;; -------------------- 616 | ;; Appointment property 617 | ;; -------------------- 618 | 619 | (defun cwebber-org-add-appointment () 620 | (interactive) 621 | (org-set-property 622 | "APPOINTMENT" 623 | (concat "<" (org-read-date t) ">"))) 624 | 625 | ;; ------------ 626 | ;; org-contacts 627 | ;; ------------ 628 | 629 | ;(require 'org-contacts) 630 | ;(setq org-contacts-files '("~/org/contacts.org")) 631 | ;(org-contacts-gnus-insinuate) 632 | 633 | 634 | ;; ----------------- 635 | ;; Smarter archiving 636 | ;; ----------------- 637 | 638 | (setq org-archive-default-command 'org-archive-subtree) 639 | 640 | (defun cwebber/org-archive-subtree-depending-on-property () 641 | "Conditionally archive the subtree to a file or archive sibling 642 | If the parent subtree has an ARCHIVE property, archive to a file. 643 | Otherwise, archive to an archive sibling." 644 | (interactive) 645 | (let* ((current-level (org-current-level)) 646 | (parent-archive-property 647 | (if current-level 648 | (save-excursion 649 | (org-up-heading-safe) 650 | (org-entry-get (point) "ARCHIVE"))))) 651 | (cond 652 | ; If there is no current level, do nothing 653 | ((not current-level) nil) 654 | ; If we're at the first level, subtree archive it 655 | ((or (eq current-level 1) 656 | (not parent-archive-property)) 657 | (let ((org-archive-default-command 'org-archive-to-archive-sibling)) 658 | (org-archive-subtree-default-with-confirmation))) 659 | ; Otherwise, archive to a file 660 | (t 661 | (let ((org-archive-default-command 'org-archive-subtree)) 662 | (org-archive-subtree-default-with-confirmation)))))) 663 | 664 | (define-key org-mode-map "\C-c\C-xA" 'cwebber/org-archive-subtree-depending-on-property) 665 | (define-key org-mode-map "\C-c\C-xa" 'cwebber/org-archive-subtree-depending-on-property) 666 | (define-key org-mode-map "\C-c\C-x\C-a" 'cwebber/org-archive-subtree-depending-on-property) 667 | (define-key org-mode-map "\C-c\C-x\C-s" 'cwebber/org-archive-subtree-depending-on-property) 668 | (define-key org-mode-map "\C-c$" 'cwebber/org-archive-subtree-depending-on-property) 669 | 670 | ;; I don't want a bookmark every time I capture things 671 | (setq org-capture-bookmark nil) 672 | 673 | ;; I hate that foo_bar becomes foo(subscript:bar) stuff 674 | (setq org-use-sub-superscripts '{}) 675 | 676 | ;;; org tree-slide 677 | 678 | (require 'org-tree-slide) 679 | (define-key org-mode-map (kbd "") 'org-tree-slide-mode) 680 | (define-key org-mode-map (kbd "S-") 'org-tree-slide-skip-done-toggle) 681 | 682 | 683 | ;; Upcase the org-mode export structures 684 | (setq org-structure-template-alist 685 | '(("a" . "EXPORT ascii") 686 | ("c" . "CENTER") 687 | ("C" . "COMMENT") 688 | ("e" . "EXAMPLE") 689 | ("E" . "EXPORT") 690 | ("h" . "EXPORT html") 691 | ("l" . "EXPORT latex") 692 | ("q" . "QUOTE") 693 | ("s" . "SRC") 694 | ("v" . "VERSE"))) 695 | -------------------------------------------------------------------------------- /modes/page-break-lines.el: -------------------------------------------------------------------------------- 1 | (require 'page-break-lines) 2 | (global-page-break-lines-mode) 3 | (setq page-break-lines-char (string-to-char "┄")) 4 | -------------------------------------------------------------------------------- /modes/paredit.el: -------------------------------------------------------------------------------- 1 | (require 'paredit) 2 | 3 | ; What's the chances I regret this :) 4 | (add-hook 'emacs-lisp-mode-hook 'paredit-mode) 5 | -------------------------------------------------------------------------------- /modes/php.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; PHP mode 3 | ;; --------- 4 | 5 | ; (load "~/elisp/php-mode.el") 6 | ;; (add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode)) 7 | ;; (add-to-list 'auto-mode-alist '("\\.php3\\'" . php-mode)) 8 | ;; (add-to-list 'auto-mode-alist '("\\.php4\\'" . php-mode)) 9 | 10 | -------------------------------------------------------------------------------- /modes/planner.el: -------------------------------------------------------------------------------- 1 | ;;; ------ 2 | ;;; Planner 3 | ;;; ------ 4 | 5 | (require 'planner) 6 | (define-key mode-specific-map [?n] 'planner-goto-today) 7 | (global-set-key (kbd " t") 'planner-create-task) 8 | (global-set-key (kbd " n") 'planner-create-note) 9 | (setq mark-diary-entries-in-calendar t) 10 | (setq planner-project "WikiPlanner") 11 | 12 | (setq planner-day-page-template 13 | "* Tasks\n\n\n* Schedule\n\n\n* Diet\n(See [[Recipes]] and [[Exercises]])\nWeigh-in: \n\n* Notes\n\n") 14 | 15 | (require 'planner-diary) 16 | 17 | (planner-diary-insinuate) 18 | (add-hook 'diary-display-hook 'fancy-diary-display) 19 | 20 | ;(require 'planner-timeclock) 21 | ;(require 'planner-deadline) 22 | ;(require 'planner-schedule) 23 | (require 'planner-cyclic) 24 | 25 | ;; Notes from Sacha 26 | ;;;;;;;;;;;;;;;;;;; 27 | ;; I've bound sacha/planner-what-am-i-supposed-to-be-doing to F9 F9. I 28 | ;; start out by clocking into the task (use planner-timeclock.el and 29 | ;; C-c TAB to mark a task as in progress). Then, when I find myself 30 | ;; getting distracted, I hit F9 F9 to see my current task in the 31 | ;; minibuffer. C-u F9 F9 jumps back to the task so that I can either 32 | ;; mark it as postponed. M-x planner-task-pending (bound to C-c C-p in 33 | ;; my local config) and M-x planner-task-done (C-c C-x) both clock out 34 | ;; of the task. If I want to jump back to the previous window 35 | ;; configuration from that planner page, I can just hit F9 F9 again. 36 | 37 | (defvar sacha/window-register "w" 38 | "Register for jumping back and forth between planner and wherever I am.") 39 | (defvar sacha/planner-current-task nil 40 | "Current task info.") 41 | (defadvice planner-task-in-progress (after sacha activate) 42 | "Keep track of the task info." 43 | (setq sacha/planner-current-task (planner-current-task-info))) 44 | 45 | (defun sacha/planner-what-am-i-supposed-to-be-doing (&optional prefix) 46 | "Make it easy to keep track of what I'm supposed to be working on. 47 | If PREFIX is non-nil, jump to the current task, else display it 48 | in a message. If called from the plan page, jump back to whatever 49 | I was looking at." 50 | (interactive "P") 51 | (if planner-timeclock-current-task 52 | (if (string= (planner-task-page sacha/planner-current-task) 53 | (planner-page-name)) 54 | (jump-to-register sacha/window-register) 55 | (if (null prefix) 56 | (message "%s" planner-timeclock-current-task) 57 | (frame-configuration-to-register sacha/window-register) 58 | (planner-find-file (planner-task-page sacha/planner-current-task)) 59 | (planner-find-task sacha/planner-current-task))) 60 | (if prefix 61 | (planner-goto-today) 62 | (message "No current task. HEY!")))) 63 | 64 | (global-set-key (kbd " ") 'sacha/planner-what-am-i-supposed-to-be-doing) 65 | (defadvice planner-create-task-from-buffer (before cwebber activate) 66 | "Change the priority if specified. 67 | You can set the priority of a task during creation by starting the 68 | task description with #A, #B, or #C. This changes the default task 69 | status." 70 | (when (string-match "^#\\([ABC]\\)[ \t]" title) 71 | (setq planner-default-task-priority (match-string 1 title)) 72 | (setq title (substring title (match-end 0))))) 73 | -------------------------------------------------------------------------------- /modes/racket-mode.el: -------------------------------------------------------------------------------- 1 | (require 'racket-mode) 2 | (require 'racket-xp) 3 | 4 | ;;; wtf why isn't it working 5 | ;; (add-hook ’racket-mode-hook ’racket-xp-mode) 6 | 7 | (put 'let-on 'racket-indent-function 1) 8 | -------------------------------------------------------------------------------- /modes/rainbow-delimiters.el: -------------------------------------------------------------------------------- 1 | (require 'rainbow-delimiters) 2 | 3 | (add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode) 4 | (add-hook 'hy-mode-hook 'rainbow-delimiters-mode) 5 | (add-hook 'inferior-lisp-mode-hook 'rainbow-delimiters-mode) 6 | (add-hook 'scheme-mode-hook 'rainbow-delimiters-mode) 7 | (add-hook 'lisp-mode-hook 'rainbow-delimiters-mode) 8 | (add-hook 'racket-mode-hook 'rainbow-delimiters-mode) 9 | 10 | (setq rainbow-delimiters-max-face-count 11) 11 | -------------------------------------------------------------------------------- /modes/rainbow-identifiers.el: -------------------------------------------------------------------------------- 1 | (require 'rainbow-identifiers) 2 | 3 | (add-hook 'emacs-lisp-mode-hook 'rainbow-identifiers-mode) 4 | (add-hook 'hy-mode-hook 'rainbow-identifiers-mode) 5 | (add-hook 'inferior-lisp-mode-hook 'rainbow-identifiers-mode) 6 | (add-hook 'scheme-mode-hook 'rainbow-identifiers-mode) 7 | (add-hook 'lisp-mode-hook 'rainbow-identifiers-mode) 8 | (add-hook 'racket-mode-hook 'rainbow-identifiers-mode) 9 | -------------------------------------------------------------------------------- /modes/remember.el: -------------------------------------------------------------------------------- 1 | ;;; ------ 2 | ;;; Remember! 3 | ;;; ------ 4 | (require 'remember) 5 | (require 'planner) 6 | 7 | (require 'remember-planner) 8 | (setq remember-handler-functions '(remember-planner-append)) 9 | (setq remember-annotation-functions planner-annotation-functions) 10 | ; (load "~/elisp/remember/remember-planner.el") 11 | (autoload 'remember "remember" nil t) 12 | (autoload 'remember-region "remember" nil t) 13 | (autoload 'remember-to-planner "remember" nil t) 14 | ;; (global-set-key (kbd " ") 'remember) 15 | ;; (global-set-key (kbd " r") 'remember-region) 16 | ;; (global-set-key (kbd " p") 'remember-to-planner) 17 | 18 | ;;; (From Sacha) 19 | ;; (global-set-key (kbd " ") 'sacha/planner-what-am-i-supposed-to-be-doing) 20 | ;; (global-set-key (kbd " p SPC") 'planner-goto-today) 21 | ;; (global-set-key (kbd " P SPC") 'planner-goto) 22 | ;(global-set-key (kbd " r SPC") 'remember) 23 | ;(global-set-key (kbd " R SPC") 'remember-region) 24 | ;; (global-set-key (kbd " t SPC") 'planner-create-task-from-buffer) 25 | ;; (global-set-key (kbd " T SPC") 'planner-create-task) 26 | 27 | (defadvice planner-create-task-from-buffer (before cwebber activate) 28 | "Change the priority if specified. 29 | You can set the priority of a task during creation by starting the 30 | task description with #A, #B, or #C. This changes the default task 31 | status." 32 | (when (string-match "^#\\([ABC]\\)[ \t]" title) 33 | (setq planner-default-task-priority (match-string 1 title)) 34 | (setq title (substring title (match-end 0))))) 35 | -------------------------------------------------------------------------------- /modes/rhtml.el: -------------------------------------------------------------------------------- 1 | ;;; rhtml-mode 2 | (add-to-list 'load-path "~/elisp/rhtml") 3 | (require 'rhtml-mode) 4 | (add-hook 'rhtml-mode-hook 5 | (lambda () (rinari-launch))) 6 | -------------------------------------------------------------------------------- /modes/ri.el: -------------------------------------------------------------------------------- 1 | (load-file "/home/cwebber/elisp/ri-emacs/ri-ruby.el") 2 | (setq ri-ruby-script "/home/cwebber/elisp/ri-emacs/ri-emacs.rb") -------------------------------------------------------------------------------- /modes/scheme.el: -------------------------------------------------------------------------------- 1 | ;; Indentation stuff 2 | 3 | (put 'signal-let* 'scheme-indent-function 1) 4 | (put 'signal-let 'scheme-indent-function 1) 5 | (put 'let/cc 'scheme-indent-function 1) 6 | (put 'extend-methods 'scheme-indent-function 1) 7 | (put 'let-on 'scheme-indent-function 1) 8 | 9 | ;;; ============= 10 | ;;; From Mark Weaver. See this thread on guix-devel: 11 | ;;; http://lists.gnu.org/archive/html/guix-devel/2016-05/msg00603.html 12 | 13 | ;; Slightly modified scheme-indent-function (starting from the one in 14 | ;; Emacs 24.2) that properly indents s-exprs starting with a keyword 15 | ;; like this: 16 | ;; 17 | ;; (#:foo 1 18 | ;; #:bar 2) 19 | ;; 20 | ;; instead of like this: 21 | ;; 22 | ;; (#:foo 1 23 | ;; #:bar 2) 24 | ;; 25 | ;; NOTE: These modifications are probably a bit hacky, as I was too 26 | ;; lazy to fully understand the lisp indent code, and am not very 27 | ;; familiar with elisp. 28 | 29 | (defun scheme-indent-function (indent-point state) 30 | "Scheme mode function for the value of the variable `lisp-indent-function'. 31 | This behaves like the function `lisp-indent-function', except that: 32 | 33 | i) it checks for a non-nil value of the property `scheme-indent-function' 34 | \(or the deprecated `scheme-indent-hook'), rather than `lisp-indent-function'. 35 | 36 | ii) if that property specifies a function, it is called with three 37 | arguments (not two), the third argument being the default (i.e., current) 38 | indentation." 39 | (let ((normal-indent (current-column))) 40 | (goto-char (1+ (elt state 1))) 41 | (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t) 42 | (if (and (elt state 2) 43 | (not (looking-at "\\sw\\|\\s_"))) 44 | ;; car of form doesn't seem to be a symbol 45 | (progn 46 | (if (not (> (save-excursion (forward-line 1) (point)) 47 | calculate-lisp-indent-last-sexp)) 48 | (progn (goto-char calculate-lisp-indent-last-sexp) 49 | (beginning-of-line) 50 | (parse-partial-sexp (point) 51 | calculate-lisp-indent-last-sexp 0 t))) 52 | ;; Indent under the list or under the first sexp on the same 53 | ;; line as calculate-lisp-indent-last-sexp. Note that first 54 | ;; thing on that line has to be complete sexp since we are 55 | ;; inside the innermost containing sexp. 56 | (backward-prefix-chars) 57 | (current-column)) 58 | (let ((function (buffer-substring (point) 59 | (progn (forward-sexp 1) (point)))) 60 | method) 61 | (setq method (or (get (intern-soft function) 'scheme-indent-function) 62 | (get (intern-soft function) 'scheme-indent-hook))) 63 | (cond ((or (eq method 'defun) 64 | (and (null method) 65 | (> (length function) 3) 66 | (string-match "\\`def" function))) 67 | (lisp-indent-defform state indent-point)) 68 | ;; This next cond clause is the only change -mhw 69 | ((and (null method) 70 | (> (length function) 1) 71 | ; The '#' in '#:' seems to get lost, not sure why 72 | (string-match "\\`:" function)) 73 | (let ((lisp-body-indent 1)) 74 | (lisp-indent-defform state indent-point))) 75 | ((integerp method) 76 | (lisp-indent-specform method state 77 | indent-point normal-indent)) 78 | (method 79 | (funcall method state indent-point normal-indent))))))) 80 | 81 | ;;; ============= 82 | 83 | ;;; More robust keyword highlighting 84 | 85 | ;; (setq scheme-font-lock-keywords 86 | ;; (list 87 | ;; ;; 88 | ;; ;; Declarations. Hannes Haug says 89 | ;; ;; this works for SOS, STklos, SCOOPS, Meroon and Tiny CLOS. 90 | ;; (list (concat "(\\(define\\(" 91 | ;; ;; Function names. 92 | ;; "\\(\\|-public\\|-method\\|-generic\\(-procedure\\)?\\)\\|" 93 | ;; ;; Macro names, as variable names. A bit dubious, this. 94 | ;; "\\(-syntax\\|-macro\\)\\|" 95 | ;; ;; Class names. 96 | ;; "-class" 97 | ;; ;; Guile modules. 98 | ;; "\\|-module" 99 | ;; "\\)\\*?\\)\\>" 100 | ;; ;; Any whitespace and declared object. 101 | ;; ;; The "(*" is for curried definitions, e.g., 102 | ;; ;; (define ((sum a) b) (+ a b)) 103 | ;; "[ \t]*(*" 104 | ;; "\\(\\sw+\\)?") 105 | ;; '(1 font-lock-keyword-face) 106 | ;; '(6 (cond ((match-beginning 3) font-lock-function-name-face) 107 | ;; ((match-beginning 5) font-lock-variable-name-face) 108 | ;; (t font-lock-type-face)) 109 | ;; nil t)) 110 | ;; )) 111 | 112 | 113 | ;;; This is for 8sync! 114 | 115 | (put 'mbody-receive 'scheme-indent-function 2) 116 | 117 | ;;; Hacking on a particular project? Hm hm! 118 | (defvar guile-projects 119 | '((goblins "~/devel/guile-goblins") 120 | (syrup "~/devel/syrup/impls/guile") 121 | (spritely.institute-site "~/devel/spritely.institute-site") 122 | ;; (guile "~/devel/guile") 123 | )) 124 | 125 | (require 'cl-lib) 126 | 127 | (defun guile-projectify (project-name) 128 | (interactive (list (completing-read "Project: " 129 | (mapcar 130 | (lambda (x) (symbol-name (car x))) 131 | guile-projects)))) 132 | (let ((project-dir (cadr (assoc (intern project-name) 133 | guile-projects)))) 134 | (cond 135 | ((not project-dir) 136 | (message "No such project...?")) 137 | (t 138 | (make-local-variable 'geiser-guile-load-path) 139 | (cl-pushnew project-dir geiser-guile-load-path 140 | :test 'string-equal))))) 141 | 142 | 143 | ;; Some propagators stuff 144 | (put 'p:when 'scheme-indent-function 1) 145 | (put 'e:when 'scheme-indent-function 1) 146 | (put 'p:unless 'scheme-indent-function 1) 147 | (put 'e:unless 'scheme-indent-function 1) 148 | (put 'with-vat 'scheme-indent-function 1) 149 | -------------------------------------------------------------------------------- /modes/shell.el: -------------------------------------------------------------------------------- 1 | ; Replaced pager-set-to-nothing with ~/.emacs_bash 2 | -------------------------------------------------------------------------------- /modes/skribe-mode.el: -------------------------------------------------------------------------------- 1 | (load-file "~/.guix-profile/share/emacs/site-lisp/skribe.el") 2 | 3 | -------------------------------------------------------------------------------- /modes/slime.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; Slime mode 3 | ;; --------- 4 | 5 | ;; (setq inferior-lisp-program "/usr/bin/sbcl") 6 | ;; (add-to-list 'load-path "/usr/share/emacs23/site-lisp/slime/") 7 | ;; (add-to-list 'load-path "/usr/share/common-lisp/source/slime/") 8 | ;; (setq slime-backend "/usr/share/common-lisp/source/slime/swank-loader.lisp") 9 | (require 'slime) 10 | (slime-setup '(slime-repl)) 11 | -------------------------------------------------------------------------------- /modes/smartparens.el: -------------------------------------------------------------------------------- 1 | (require 'smartparens) 2 | (require 'smartparens-config) 3 | 4 | ; Use default keygindings 5 | (sp-use-smartparens-bindings) 6 | 7 | ;; Less nasty face for pair-overlay 8 | 9 | (set-face-attribute 'sp-pair-overlay-face nil :background "#443152") 10 | ;;; snow edition 11 | ;; (set-face-attribute 'sp-pair-overlay-face nil :background "old lace") 12 | 13 | ;;; Lots borrwowed from https://github.com/Fuco1/smartparens/wiki/Example-configuration 14 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 15 | 16 | ;;;;;;;;;;;;;;;;;; 17 | ;; pair management 18 | 19 | (sp-local-pair 'minibuffer-inactive-mode "'" nil :actions nil) 20 | 21 | ;;; html-mode 22 | (sp-with-modes '(html-mode sgml-mode) 23 | (sp-local-pair "<" ">")) 24 | 25 | ;;; lisp modes 26 | (sp-with-modes sp--lisp-modes 27 | (sp-local-pair "(" nil :bind "C-(")) 28 | 29 | (add-hook 'emacs-lisp-mode-hook 'smartparens-mode) 30 | (add-hook 'hy-mode-hook 'smartparens-mode) 31 | (add-hook 'inferior-lisp-mode-hook 'smartparens-mode) 32 | (add-hook 'scheme-mode-hook 'smartparens-mode) 33 | (add-hook 'lisp-mode-hook 'smartparens-mode) 34 | (add-hook 'racket-mode-hook 'smartparens-mode) 35 | 36 | ;; Of course I want (|)() when at |(), damnit 37 | (setq sp-autoinsert-if-followed-by-same 0) 38 | -------------------------------------------------------------------------------- /modes/smex.el: -------------------------------------------------------------------------------- 1 | ;; Smex is like, ido for M-x, man.... 2 | 3 | (require 'smex) 4 | 5 | (global-set-key (kbd "M-x") 'smex) 6 | 7 | 8 | -------------------------------------------------------------------------------- /modes/spaceline.el: -------------------------------------------------------------------------------- 1 | (require 'spaceline-config) 2 | (spaceline-toggle-buffer-encoding-off) 3 | (spaceline-spacemacs-theme) 4 | 5 | (spaceline-compile 6 | '(((persp-name 7 | workspace-number 8 | window-number) 9 | :fallback evil-state 10 | :face highlight-face 11 | :priority 100) 12 | (anzu :priority 95) 13 | auto-compile 14 | ((buffer-modified buffer-id remote-host) 15 | :priority 98) 16 | (major-mode :priority 79) 17 | (process :when active) 18 | ((flycheck-error flycheck-warning flycheck-info) 19 | :when active 20 | :priority 89) 21 | (minor-modes :when active 22 | :priority 9) 23 | ;; (mu4e-alert-segment :when active) 24 | (erc-track :when active) 25 | (version-control :when active 26 | :priority 78) 27 | (org-pomodoro :when active) 28 | (org-clock :when active) 29 | nyan-cat) 30 | '(which-function 31 | (python-pyvenv :fallback python-pyenv) 32 | (purpose :priority 94) 33 | (battery :when active) 34 | (selection-info :priority 95) 35 | input-method 36 | ((; buffer-encoding-abbrev 37 | point-position 38 | line-column) 39 | :separator " | " 40 | :priority 96) 41 | (global :when active) 42 | (buffer-position :priority 99) 43 | (hud :priority 99))) 44 | -------------------------------------------------------------------------------- /modes/switch-window.el: -------------------------------------------------------------------------------- 1 | (global-set-key (kbd "C-x o") 'other-window) 2 | (global-set-key (kbd "C-x O") 'switch-window) 3 | 4 | -------------------------------------------------------------------------------- /modes/tramp.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; Tramp 3 | ;; --------- 4 | (require 'tramp) 5 | (setq tramp-default-method "ssh") 6 | (add-to-list 'tramp-default-method-alist '("localhost" "" "sudo")) 7 | (setq tramp-backup-directory-alist backup-directory-alist) 8 | (add-to-list 'tramp-default-proxies-alist 9 | '(nil "\\`root\\'" "/ssh:%h:")) 10 | 11 | ;; Make sure we work on remote guixsd machines :) 12 | ;; probably only helps if you start on a guixsd machine..! 13 | (setq tramp-remote-path 14 | (append tramp-remote-path 15 | '(tramp-own-remote-path 16 | "/run/current-system/profile/bin" "/run/current-system/profile/sbin" 17 | "~/.guix-profile/bin" "~/.guix-profile/sbin"))) 18 | -------------------------------------------------------------------------------- /modes/uniquify.el: -------------------------------------------------------------------------------- 1 | ;; Use Uniquify to keep buffer names unique and meaninful 2 | ;; (thanks emacswiki!) 3 | 4 | (require 'uniquify) 5 | (setq uniquify-buffer-name-style 'reverse) 6 | (setq uniquify-separator "/") 7 | (setq uniquify-after-kill-buffer-p t) ; rename after killing uniquified 8 | (setq uniquify-ignore-buffers-re "^\\*") ; don't muck with special buffers 9 | -------------------------------------------------------------------------------- /modes/vala.el: -------------------------------------------------------------------------------- 1 | ; Remove tab nastiness 2 | 3 | (defun vala-remove-tab-nastiness () 4 | (setq indent-tabs-mode nil)) 5 | 6 | (add-hook 'vala-mode-hook 'vala-remove-tab-nastiness) 7 | -------------------------------------------------------------------------------- /modes/vertico.el: -------------------------------------------------------------------------------- 1 | (require 'vertico) 2 | (vertico-mode) 3 | -------------------------------------------------------------------------------- /modes/visual-regexp.el: -------------------------------------------------------------------------------- 1 | (require 'visual-regexp) 2 | (define-key global-map (kbd "C-c r R") 'vr/replace) 3 | (define-key global-map (kbd "C-c r q") 'vr/query-replace) 4 | -------------------------------------------------------------------------------- /modes/w3m.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; emacs-w3m 3 | ;; --------- 4 | 5 | (setq load-path (add-to-list 'load-path "~/elisp/emacs-w3m/")) 6 | (require 'w3m) 7 | (setq w3m-use-cookies t) 8 | 9 | (defun cwebber/w3m-save-link () 10 | "Copy the link at point to the kill ring." 11 | (interactive) 12 | (let ((link (w3m-anchor))) 13 | (if link 14 | (kill-new link) 15 | (message "Point is not on a link.")))) 16 | 17 | (global-set-key (kbd "C-c k") 'cwebber/w3m-save-link) 18 | -------------------------------------------------------------------------------- /modes/weather.el: -------------------------------------------------------------------------------- 1 | (load-file "~/elisp/google-weather-el/google-weather.el") 2 | (load-file "~/elisp/google-weather-el/org-google-weather.el") 3 | (require 'google-weather) 4 | (require 'org-google-weather) 5 | -------------------------------------------------------------------------------- /modes/web-mode.el: -------------------------------------------------------------------------------- 1 | (require 'web-mode) 2 | (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)) 3 | (add-to-list 'auto-mode-alist '("\\.php?\\'" . web-mode)) 4 | 5 | (setq web-mode-engines-alist 6 | '(("django" . "\\.html\\'"))) 7 | 8 | (defun cwebber-web-mode-customizations () 9 | "Hooks for Web mode." 10 | (setq web-mode-markup-indent-offset 2)) 11 | 12 | (add-hook 'web-mode-hook 'cwebber-web-mode-customizations) 13 | 14 | ;; ;; More tango-y colors 15 | ;; (set-face-attribute 'web-mode-html-tag-face nil 16 | ;; :foreground (naquadah-get-colors 'sky-blue-1)) 17 | ;; (set-face-attribute 'web-mode-html-tag-bracket-face nil 18 | ;; :foreground (naquadah-get-colors 'aluminium-4)) 19 | -------------------------------------------------------------------------------- /modes/wisp-mode.el: -------------------------------------------------------------------------------- 1 | (require 'wisp-mode) 2 | (require 'scheme) 3 | (add-hook 'lisp-mode-hook 'rainbow-identifiers-mode) 4 | (add-hook 'scheme-mode-hook 'rainbow-identifiers-mode) 5 | 6 | (defun cwebber/wisp2lisp () 7 | (interactive) 8 | (let ((current-line (line-number-at-pos))) 9 | (save-excursion 10 | (set-buffer (get-buffer-create "*wisp2lisp*")) 11 | (erase-buffer) 12 | (scheme-mode)) 13 | (call-process "wisp2lisp" nil "*wisp2lisp*" nil (buffer-file-name)) 14 | (when (called-interactively-p) 15 | (switch-to-buffer-other-window "*wisp2lisp*") 16 | (beginning-of-buffer) 17 | (forward-line (- current-line 1))))) 18 | 19 | (define-key wisp-mode-map (kbd "C-c C-w") 'cwebber/wisp2lisp) 20 | 21 | (defun cwebber/wisp2lisp-eval-buffer () 22 | (interactive) 23 | (cwebber/wisp2lisp) 24 | (save-excursion 25 | (set-buffer "*wisp2lisp*") 26 | (geiser-eval-buffer))) 27 | 28 | (define-key wisp-mode-map (kbd "C-c C-b") 'cwebber/wisp2lisp-eval-buffer) 29 | 30 | (defun cwebber/wisp2lisp-switch-to-geiser (arg) 31 | (interactive "P") 32 | (cwebber/wisp2lisp) 33 | (let ((cur-buf (current-buffer))) 34 | (set-buffer "*wisp2lisp*") 35 | (geiser-mode-switch-to-repl arg) 36 | (set-buffer cur-buf))) 37 | 38 | (define-key wisp-mode-map (kbd "C-c C-z") 'cwebber/wisp2lisp-switch-to-geiser) 39 | 40 | 41 | -------------------------------------------------------------------------------- /modes/wordcount.el: -------------------------------------------------------------------------------- 1 | ;; --------- 2 | ;; Word count 3 | ;; --------- 4 | 5 | (load "~/elisp/word-counter.el") 6 | (require 'word-counter) 7 | (global-set-key (kbd "C-c w") 'word-count) 8 | -------------------------------------------------------------------------------- /modes/yasnippet.el: -------------------------------------------------------------------------------- 1 | (require 'yasnippet) 2 | 3 | (setq yas-snippet-dirs 4 | '("~/.config/emacs/yas-snippets" ;; personal snippets 5 | "~/elisp/yasnippet-snippets/" ; third party snippets 6 | "~/devel/guix/etc/snippets")) 7 | 8 | ;; Also putting hippie-expand here. Maybe should be its own file.. 9 | (define-key global-map "\M-/" 'hippie-expand) 10 | 11 | (setq hippie-expand-try-functions-list 12 | (cons 'yas/hippie-try-expand hippie-expand-try-functions-list)) 13 | 14 | ; Fix orgmode issue with yas 15 | ;; (add-hook 'org-mode-hook 16 | ;; (lambda () 17 | ;; (org-set-local 'yas/trigger-key [tab]) 18 | ;; (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand))) 19 | 20 | 21 | ; change dropdown behavior 22 | ;(require 'dropdown-list) 23 | (setq yas/prompt-functions '(yas/dropdown-prompt yas/completing-prompt yas/no-prompt)) 24 | 25 | (yas-global-mode 1) 26 | 27 | -------------------------------------------------------------------------------- /yas-snippets/beancount-mode/tr.yasnippet: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: transaction 3 | # key: tr 4 | # expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)) 5 | # -- 6 | ${1:YYYY-MM-DD} ${2:!} "${3:Payee}" "${4:Description}" 7 | ${5:$$(yas-choose-value (sort (beancount-collect beancount-account-regexp 0) #'string<))} ${6:0.00} ${7:USD} 8 | ${8:$$(yas-choose-value (sort (beancount-collect beancount-account-regexp 0) #'string<))} -------------------------------------------------------------------------------- /yas-snippets/ledger-mode/a:b:c.yasnippet: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: a:b:c 3 | # -- 4 | assets:bank:checking -------------------------------------------------------------------------------- /yas-snippets/org-mode/FUD: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: FUD 3 | # -- 4 | `(progn 5 | (save-excursion 6 | (org-insert-todo-subheading nil) 7 | (insert "Functionality") 8 | (org-insert-todo-heading nil) 9 | (insert "Unit tests") 10 | (org-insert-todo-heading nil) 11 | (insert "Documentation")))` -------------------------------------------------------------------------------- /yas-snippets/org-mode/notes: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: Notes Block (for org-reveal) 3 | # -- 4 | #+BEGIN_NOTES 5 | $0 6 | #+END_NOTES 7 | -------------------------------------------------------------------------------- /yas-snippets/org-mode/quote: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: Quote Block 3 | # -- 4 | #+BEGIN_QUOTE 5 | $0 6 | #+END_QUOTE 7 | -------------------------------------------------------------------------------- /yas-snippets/python-mode/cc-cc0: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: Creative Commons CC0 header 3 | # -- 4 | # ${1:program name - description} 5 | # 6 | # Written in `(format-time-string "%Y")` by Christopher Allan Webber, Creative Commons 7 | # 8 | # To the extent possible under law, the author(s) have dedicated all 9 | # copyright and related and neighboring rights to this software to the 10 | # public domain worldwide. This software is distributed without any 11 | # warranty. 12 | # 13 | # You should have received a copy of the CC0 Public Domain Dedication along 14 | # with this software. If not, see 15 | # . 16 | -------------------------------------------------------------------------------- /yas-snippets/python-mode/class.yasnippet: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # name: class 3 | # contributor: Orestis Markou 4 | # contributor: Nishio Hirokazu 5 | # contributor: Yasser González Fernández 6 | # contributor: Christopher Webber (maybe I should contribute back! :O 7 | # -- 8 | class ${1:ClassName}(${2:object}): 9 | """$3 10 | """ 11 | 12 | def __init__(self, $4): 13 | """$5 14 | ${4:$ 15 | (let* ((indent 16 | (concat "\n" (make-string (current-column) 32))) 17 | (args 18 | (mapconcat 19 | '(lambda (x) 20 | (if (not (string= (nth 0 x) "")) 21 | (concat "- " (nth 0 x) 22 | ":"))) 23 | (mapcar 24 | '(lambda (x) 25 | (mapcar 26 | (lambda (x) 27 | (replace-regexp-in-string "[[:blank:]]*$" "" 28 | (replace-regexp-in-string "^[[:blank:]]*" "" x))) x)) 29 | (mapcar '(lambda (x) (split-string x "=")) 30 | (split-string text ","))) 31 | indent))) 32 | (if (string= args "") 33 | (make-string 3 34) 34 | (mapconcat 35 | 'identity 36 | (list "" "Keyword arguments:" args (make-string 3 34)) 37 | indent))) 38 | } 39 | ${4:$ 40 | (mapconcat 41 | '(lambda (x) 42 | (if (not (string= (nth 0 x) "")) 43 | (concat "self." (nth 0 x) " = " (nth 0 x)))) 44 | (mapcar 45 | '(lambda (x) 46 | (mapcar 47 | '(lambda (x) 48 | (replace-regexp-in-string "[[:blank:]]*$" "" 49 | (replace-regexp-in-string "^[[:blank:]]*" "" x))) 50 | x)) 51 | (mapcar '(lambda (x) (split-string x "=")) 52 | (split-string text ","))) 53 | (concat "\n" (make-string (current-column) 32))) 54 | } 55 | $0 56 | -------------------------------------------------------------------------------- /yas-snippets/python-mode/def.yasnippet: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # name: def 3 | # contributor: Orestis Markou 4 | # contributor: Yasser González Fernández 5 | # -- 6 | def ${1:name}($2): 7 | """ 8 | $3 9 | ${2:$ 10 | (let* 11 | ((indent 12 | (concat "\n" (make-string (current-column) 32))) 13 | (args 14 | (mapconcat 15 | '(lambda (x) 16 | (if (not (or (string= (nth 0 x) ""))) 17 | (concat "- " (nth 0 x) 18 | ": "))) 19 | (mapcar 20 | '(lambda (x) 21 | (mapcar 22 | '(lambda (x) 23 | (replace-regexp-in-string "[[:blank:]]*$" "" 24 | (replace-regexp-in-string "^[[:blank:]]*" "" x))) 25 | x)) 26 | (mapcar '(lambda (x) (split-string x "=")) 27 | (let ((funcargs (split-string text ","))) 28 | (if (string= (car funcargs) "self") 29 | (cdr funcargs) 30 | funcargs)))) 31 | indent))) 32 | (if (string= args "") 33 | (make-string 3 34) 34 | (mapconcat 35 | 'identity 36 | (list "Keyword arguments:" args (make-string 3 34)) 37 | indent))) 38 | } 39 | $0 40 | -------------------------------------------------------------------------------- /yas-snippets/scheme-mode/record: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: define-record-type 3 | # key: record 4 | # contributor: Christine Lemmer-Webber 5 | # -- 6 | (define-record-type <$1> 7 | (make-$1 $2) 8 | $1? 9 | ${2:$(mapconcat (lambda (x) (format "(%s %s-%s)" x (yas-field-value 1) x)) 10 | (split-string yas-text) "\n ")}) 11 | --------------------------------------------------------------------------------