Seeing is believing emacs minor mode
Seeing Is Believing is a ruby gem to evaluate Ruby code, recording the results of each line. This minor mode provides an easy way to run it from emacs on the current region or entire buffer.
Download the package and add it to your load path.
Once that's set up, you can run
Alternatively, if you use spacemacs, add
seeing-is-believing to your
dotspacemacs-additional-packages variable in your
.spacemacs file and reload your config.
Using the package
Enable the mode by typing
M-x seeing-is-believing or by adding
something similar to the following to your emacs init file:
(require 'seeing-is-believing) (add-hook 'ruby-mode-hook 'seeing-is-believing)
When the mode is active you can run seeing is believing by typing
C-c ? s. If you prefer the
style of explicitly specifying where you want to see the output type
C-c ? x. You can clear out the output from seeing is believing by
C-c ? c.
You can change the keybinding shortcuts from the default of
C-c ? by
M-x set-variable <return> seeing-is-believing-prefix <return>).
You can also customize or set variables that affect how
seeing-is-believing-executablecan be set to the name of the program file for the executable (default "seeing_is_believing")
seeing-is-believing-max-lengthcan be set to an integer that limits the length of lines produced, source plus comments (default 1000).
seeing-is-believing-max-resultscan be set to an integer that limits the number of results produced, when
seeing-is-believingshows multiple results per comment (default 10),
seeing-is-believing-timeoutcan be set to a decimal number for the number of seconds
seeing-is-believingruns before it times out or to 0 for no timeout (default 0), and
seeing-is-believing-alignmentcan be set to one of
'lineto change the way
seeing-is-believingaligns its comments, on a chunk-by-chunk basis, across the whole file, or on a line-by-line basis, effectively no alignment (default
Either use the customize interface to set these, or set them in your
(setq seeing-is-believing-max-length 150 seeing-is-believing-max-results 10 seeing-is-believing-timeout 10.5 seeing-is-believing-alignment 'file)
Copyright 2015 John Cinnamond
This mode is distributed under the same licence as GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.