Skip to content

gracjan/gifcast.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create screencasts of Emacs from coded scenarios

Create screencasts of Emacs sessions from coded scenarios. Write scenario in Emacs Lisp.

Example

This animation:

Was generated by this code:

(require 'gifcast)

(gifcast-animation
 hello-world
 (set-frame-size (window-frame (get-buffer-window)) 40 10)
 (progn
   (when (get-buffer "file.txt")
     (kill-buffer "file.txt"))
   (switch-to-buffer (get-buffer-create "file.txt"))
   (delete-other-windows)

   (insert (concat
            "The greeting is:\n"
            "\n"
            "    Hello ")))
 (gifcast-capture)
 (gifcast-keys "W")
 (gifcast-capture)
 (gifcast-keys "o")
 (gifcast-capture)
 (gifcast-keys "r")
 (gifcast-capture)
 (gifcast-keys "l")
 (gifcast-capture)
 (gifcast-keys "d")
 (gifcast-capture)
 (gifcast-keys "!")
 (gifcast-capture)
 (gifcast-generate "hello-world.gif")

 (kill-buffer "file.txt")
 nil)

by running:

$EMACS -q -L . -l example.el -f gifcast-generate-batch-and-exit

Documentation

  • gifcast-animation name body

    A macro to declare animation named NAME. BODY is a list of form. Note that although body looks like a function definition in reality each of the top level forms will be executed asynchronously from a timer. This is done so that Emacs can react to user input and redraw the screen. Only top level forms are executed separately.

  • gifcast-animation-0

    Delare animation as disabled so that neither gifcast-generate-batch nor gifcast-generate-batch-and-exit executes it.

  • gifcast-keys

    Add keys to processing queue to simulate user input events. For example (gifcast-keys "Abc") simulates a user entering A then b then c. (gifcast-keys (kbd "RET") simulates a RET.

  • gifcast-capture

    Capture current Emacs window as next animation frame. Optional parameter DURATION says how much time should this frame last in milisecons, defaults to 100ms.

  • gifcast-generate

    Generate final animated GIF and save it to the path given as parameter.

  • gifcast-generate-batch

    Function to be called from command line to generate a set of animations. Usage:

    $EMACS -q -L . -l example.el -f gifcast-generate-batch
    

    Use full for debugging purposes because Emacs stays open after animations have run. For fully automated animation generation use gifcast-generate-batch-and-exit.

  • gifcast-generate-batch-and-exit

    Function to be called from command line to generate a set of animations. Usage:

    $EMACS -q -L . -l example.el -f gifcast-generate-batch-and-exit
    

Requirements

  • Mac OS X
  • Emacs that runs in GUI mode under Mac OS X (Aquamacs, Emacs)
  • /usr/sbin/screencapture -- comes with Mac OS X
  • convert from ImageMagic or GraphicsMagick

Contributing

I love receiving issue reports and pull requests! Use Github for that, official place to coordinate development is:

https://github.com/gracjan/gifcast.el

Have fun, Gracjan

About

Emacs screshot animations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published