[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/lmc 5a8a6a3 06/14: * lmc.el (lmc-turbo): New option.
From: |
Stefan Monnier |
Subject: |
[elpa] externals/lmc 5a8a6a3 06/14: * lmc.el (lmc-turbo): New option. |
Date: |
Sat, 28 Nov 2020 23:22:15 -0500 (EST) |
branch: externals/lmc
commit 5a8a6a3878115f11ed8b3287105656ace81083b9
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* lmc.el (lmc-turbo): New option.
(lmc--sit-for): New function. Use it instead of sit-for.
(lmc-run): Don't stop upon user input if lmc-turbo is enabled.
---
lmc.el | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/lmc.el b/lmc.el
index 656539d..01365b4 100644
--- a/lmc.el
+++ b/lmc.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2011, 2013 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
-;; Version: 1.1
+;; Version: 1.2
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -76,6 +76,12 @@
(defvar lmc-acc 0 "Accumulator for LMC.")
(make-variable-buffer-local 'lmc--acc)
+(defvar lmc-turbo nil
+ "When non-nil, evaluate the code without extra delays.
+When nil, evaluation flashes the cursor at to help you see what's going on,
+which slows it down significantly.
+Also, when nil, evaluation is interrupted when the user hits a key.")
+
;; Emacs-22 backward compatibility.
(defmacro lmc--with-silent-modifications (&rest body)
(declare (debug t) (indent 0))
@@ -535,6 +541,9 @@
"If non-nil, memory words blink when modified."
:type 'boolean)
+(defun lmc--sit-for (secs)
+ (unless lmc-turbo (sit-for sec)))
+
(defun lmc-store-word (addr word)
(save-excursion
(lmc-addr->point addr)
@@ -544,17 +553,17 @@
(when lmc-store-flash
(lmc--with-silent-modifications
(put-text-property mb1 (point) 'face 'region))
- (sit-for 0.2))
+ (lmc--sit-for 0.2))
(let ((me1 (point)))
(insert (format " %03d" word)) (delete-region mb1 me1))
(when lmc-store-flash
- (sit-for 0.1)
+ (lmc--sit-for 0.1)
(lmc--with-silent-modifications
(put-text-property mb1 (point) 'face 'region))
- (sit-for 0.1)
+ (lmc--sit-for 0.1)
(lmc--with-silent-modifications
(put-text-property mb1 (point) 'face nil))
- (sit-for 0.1))))))
+ (lmc--sit-for 0.1))))))
(defun lmc-step ()
"Execute one LMC instruction."
@@ -597,9 +606,9 @@
"Run the code until hitting a HLT.
The machine will also stop if the user presses a key."
(interactive)
- (while (not (or (input-pending-p) (lmc-stopped-p)))
+ (while (not (or (unless lmc-turbo (input-pending-p)) (lmc-stopped-p)))
(lmc-step)
- (sit-for 0.05)))
+ (lmc--sit-for 0.05)))
;;; The LMC assembly language editor.
- [elpa] externals/lmc d248525 01/14: New package lmc., (continued)
- [elpa] externals/lmc d248525 01/14: New package lmc., Stefan Monnier, 2020/11/28
- [elpa] externals/lmc a5fe8d2 04/14: * lmc.el: Make it work on Emacs-22., Stefan Monnier, 2020/11/28
- [elpa] externals/lmc b7cbf14 07/14: * lmc.el (lmc--sit-for): Fix last change., Stefan Monnier, 2020/11/28
- [elpa] externals/lmc 3b26656 08/14: * lmc.el (lmc-asm-indentation): Indent to tab-width by default., Stefan Monnier, 2020/11/28
- [elpa] externals/lmc 6cd76ac 05/14: * packages/lmc/lmc.el (lmc-store-word): match-data can change in sit-for., Stefan Monnier, 2020/11/28
- [elpa] externals/lmc 0604c74 09/14: Add "rudel" to the list of externals., Stefan Monnier, 2020/11/28
- [elpa] externals/lmc cb110db 14/14: * .gitignore: New file, Stefan Monnier, 2020/11/28
- [elpa] externals/lmc 4e16a02 10/14: * packages/lmc/lmc.el (lmc--load-word): Remove unused vars., Stefan Monnier, 2020/11/28
- [elpa] externals/lmc 47cc7a9 11/14: * lmc.el: Use cl-lib, Stefan Monnier, 2020/11/28
- [elpa] externals/lmc d0ca555 03/14: 2011-09-29 Stefan Monnier <address@hidden>, Stefan Monnier, 2020/11/28
- [elpa] externals/lmc 5a8a6a3 06/14: * lmc.el (lmc-turbo): New option.,
Stefan Monnier <=
- [elpa] externals/lmc b65ac80 12/14: * lmc.el: Mention dependencies & bumpp version, Stefan Monnier, 2020/11/28
- [elpa] externals/lmc 5913867 13/14: * lmc.el: Fix `Package-Requires` line, Stefan Monnier, 2020/11/28