File: slime-motd.el

package info (click to toggle)
slime 1:20080223.dfsg-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,600 kB
  • ctags: 3,345
  • sloc: lisp: 30,707; sh: 163; makefile: 119; awk: 10
file content (30 lines) | stat: -rw-r--r-- 800 bytes parent folder | download
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
;;; slime-motd.el --- Message Of The Day in a slime repl
;;
;; Authors: Marco Baringer <mb@bese.it>
;;
;; License: GNU GPL (same license as Emacs)
;;
;;; Installation
;;
;; Add slime-motd to your slime-setup call.

(require 'slime-banner)

(defcustom slime-motd-pathname nil
  "The local pathnamethe motd is read from."
  :group 'slime-mode
  :type '(file :must-match t))

(defun slime-insert-motd ()
  (slime-eval-async `(cl:progn
                      (swank:swank-require :swank-motd)
                      (swank::read-motd ,slime-motd-pathname))
                    (lambda (motd)
                      (when motd
                        (slime-repl-insert-result (list :values motd))))))

(defun slime-motd-init ()
  (add-hook 'slime-connected-hook 'slime-insert-motd))

(provide 'slime-motd)