C-x is notation for "control-x", which stands for hitting
the x key at the same time as holding down the Control
key. Similarly, M-h stands for "meta-h", which means
doing the same but with the meta key. On PC keyboards, the ALT key
often stands in for a meta key. If this doesn't work, you can get a
meta effect by first hitting ESC and then the next key (h in this
case). If you can get the proper, modifier-key meta working, it's
definitely worthwhile, as having to hit ESC all the time is tedious in
the extreme.
(autoload 'hol98 "<holdir>/tools/hol-mode" "Runs a HOL98 session in a comint window. With a numeric prefix argument, runs it niced to that level or at level 10 with a bare prefix. " t)into your
.emacs file, where <holdir>
is where you installed HOL. This approach has the disadvantage
that you have to start HOL using M-x hol98; you can't
use the key sequence M-h h. If you want that, you can use
(load "<holdir>/tools/hol-mode")in the
.emacs file.Alternatively, if you just want to try it once, type
M-x load-fileand type
<holdir>/tools/hol-mode.el in response
to the prompt.
C-x C-f fooScript.sml (* find my file *) M-h h (* start my hol; it takes over the window *) C-x b fooScript.sml (* go back to my script file *) C-x 5 b *HOL* (* go to the HOL buffer in a separate window *)I also recommend that you enable
transient-mark-mode.
This makes it more obvious what you have selected. You can enable
this for all sessions by putting (transient-mark-mode 1)
in your .emacs file, or as a once-off, by typing
M-x transient-mark-mode (and typing the same again will
turn it back off).
To select text, move the cursor in your source buffer to one end or
other of the text to be sent and hit C-SPC. This
starts text selection. Then move the cursor to the other end of the
text to be sent. With transient-mark-mode on, you should
see the text highlight. This is useful visual feedback that what
you're doing makes sense. Of course, you don't need to just move one
character at a time to select text; use the up and down cursor keys to
select lines at a time, C-a and C-e to
move to the starts and ends of lines, and M-b and
M-f to move backwards and forwards over words.
Once you're happy that you've highlighted the right bit of text, hit
M-h M-r
M-h e
e(...).
load instructions to the interpreter.)
Aside: Two more things about text selection in emacs. You
can flip your cursor to be at the other end of the selected region by
hitting C-x C-x. The end of the text where you were then
becomes the anchor point for further selection. Further, if you find
yourself highlighting something and don't want to be in
"highlight-mode", hit C-g. This stops highlighting.
Finally, if you find you don't like the text-highlighting that you get
with transient-mark-mode on, you can do all of the above
without it, but you don't get the highlighting and you need to be
aware that the region between the cursor and where you last hit
C-SPC is always available to be sent. (With
transient-mark-mode on, but nothing highlighted, an
attempt to do M-h M-r will just make Emacs beep and say
"The mark is not active now".) I find the absence of high-lighting
off-putting myself, but this is the way Emacs used to be and I guess
some people may still like it.
M-h
g, and the text between the backquotes will be sent to be set
up as a goal in the goalstack package.These are the basic commands. See the section below for even more, and learn how to control the HOL session entirely from your original text buffer.
M-h followed by the
given key-combination, or type M-x followed by the long
name of the command, given between quotes (``...'').
h ``hol98''
C-a ``hol-toggle-show-assums''
show_assums variable, affecting
whether or not assumptions are printed as dots or full terms.
C-c ``hol-interrupt''
C-f ``hol-toggle-goalstack-fvs''
C-l ``hol-recentre''
C-v ``hol-scroll-up''
C-t ``hol-toggle-show-types''
show_types variable, affecting how terms are printed.
M-b ``backward-hol-tactic''
M-f ``forward-hol-tactic''
M-r ``send-region''
M-s ``hol-subgoal-tactic''
STRIP_ASSUME'd
onto the assumption list of the old goal. (Loads the Q module if not
already loaded.)
M-v ``hol-scroll-down''
b ``hol-backup''
d ``hol-drop-goal''
D ``hol-drop-all-goals''
e ``expand-hol-tactic''
g ``hol-goal''
l ``hol-load-file''
m ``hol-db-match''
DB.match []. Very useful for
finding pertinent theorems.
n ``hol-name-top-theorem''
o ``hol-open-string''
p ``hol-print''
r ``hol-rotate''
R ``hol-restart''
s ``send-string-to-hol''
``M-r''.
t ``mark-hol-tactic''
``expand-hol-tactic''.
u ``hol-use-file''