Skip to content

Commit

Permalink
My snippet for making Emacs Demonstrations
Browse files Browse the repository at this point in the history
  • Loading branch information
howardabrams committed Nov 14, 2015
1 parent d5b3867 commit c257ae1
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ results
elisp/in-progress
snippets/message-mode/*
server/old
/snippets/clojure-mode
51 changes: 51 additions & 0 deletions snippets/emacs-lisp-mode/demoit
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# -*- mode: snippet; require-final-newline: nil -*-
# key: Sample Functions for demo-it
# name: demoit
# contributor: Howard Abrams <howardabrams@gmail.com>
# --
;;; ${1:`(file-name-sans-extension (file-name-base (buffer-file-name)))`} --- ${2:Simple Summary}

;;; Commentary:

;; $0

;;; Code:

(load-library "demo-it")

;; ----------------------------------------------------------------------
;; Create each function that represents a "presentation frame"

(defun ${3:my-demo}-load-presentation ()
"Display $1.org (an 'org-mode' file) as a presentation."
(demo-it-frame-fullscreen)
(delete-other-windows)
(demo-it-presentation "$1.org"))

(defun $3-load-source-code ()
"Load some source code in a side window."
(demo-it-load-file "some-source.py"))

(defun $3-run-code ()
"Execute our source code in an Eshell buffer."
(demo-it-run-in-eshell "~/Work" "python some-source.py"))

;; ----------------------------------------------------------------------
;; Demonstration and/or Presentation Order

(defun $3-start-presentation ()
"$2."
(interactive)
(demo-it-keybindings)
(demo-it-start (list
'$3-load-presentation ;; Frame 1
'$3-load-source-code ;; Frame 2
'$3-run-code ;; Frame 3
'demo-it-end
)))

;; ----------------------------------------------------------------------
;; Start the presentation whenever this script is evaluated. Good idea?
($3-start-presentation)

;;; $1.el ends here

0 comments on commit c257ae1

Please sign in to comment.