summary refs log tree commit diff stats
path: root/lisp/+chicken.el
blob: 15713f8ca199df1772cb9b63b50793a2267c7b4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;;; +chicken.el --- Chicken Scheme additions -*- lexical-binding: t; -*-

;;; Commentary:

;;; Code:

;; Reload [[https://wiki.call-cc.org/eggref/5/awful][awful]] with a keybinding

(defun +chicken-awful-reload ()
  "Reload awful by visiting /reload."
  (interactive)
  (save-buffer)
  (condition-case e
      (url-retrieve-synchronously "http://localhost:8080/reload")
    (file-error (progn
                  (message "Couldn't ping awful's server.  Starting...")
                  (start-process "awful" (generate-new-buffer "*awful*")
                                 "awful" "--development-mode" (buffer-file-name))))
    (t (message "Some awful error occurred!"))))

(defun +chicken-indentation-insinuate ()
  "Insinuate indentation from
https://wiki.call-cc.org/emacs#tweaking-stock-scheme-mode-indentation."
  (defun scheme-module-indent (state indent-point normal-indent) 0)
  (put 'module 'scheme-indent-function 'scheme-module-indent)
  (put 'and-let* 'scheme-indent-function 1)
  (put 'parameterize 'scheme-indent-function 1)
  (put 'handle-exceptions 'scheme-indent-function 1)
  (put 'when 'scheme-indent-function 1)
  (put 'unless 'scheme-indent-function 1)
  (put 'match 'scheme-indent-function 1))

(provide '+chicken)
;;; +chicken.el ends here