cestdiego / nand2tetris.el Goto Github PK
View Code? Open in Web Editor NEWMajor Mode for HDL files in nand2tetris.
Major Mode for HDL files in nand2tetris.
It would be nice if the mode would automatically indent multi-line function arguments to the appropriate parenthesis. For example, when I tab-indent the second line in this example I currently get this:
Mux16(a=XWithY, b=InvertedXWithY, sel=no,
out[0..7]=OutLow, out[8..15]=OutHigh, out[15]=ng, out=out);
But I expected to get this:
Mux16(a=XWithY, b=InvertedXWithY, sel=no,
out[0..7]=OutLow, out[8..15]=OutHigh, out[15]=ng, out=out);
I've done a little bit of this in the past, and I might be able to put some time into this at some point. But I at least wanted to get this onto the issue tracker.
Hi,
after intalling this quite interesting package via package-manager, Emacs starts with the following error:
Debugger entered--Lisp error: (void-variable nand2tetris-core-base-dir)
(expand-file-name nand2tetris-core-base-dir)
(concat (expand-file-name nand2tetris-core-base-dir) ".\.hdl")
(cons (concat (expand-file-name nand2tetris-core-base-dir) ".\.hdl") (quote (quote nand2tetris-mode)))
(add-to-list (quote auto-mode-alist) (cons (concat (expand-file-name nand2tetris-core-base-dir) ".*\.hdl") (quote (quote nand2tetris-mode))))
eval-buffer(#<buffer load-175805> nil "/home/MyName/.emacs.d/elpa/nand2tetris-20170306.1827/nand2tetris-autoloads.el" nil t) ; Reading at buffer position 957
load-with-code-conversion("/home/MyName/.emacs.d/elpa/nand2tetris-20170306.1827/nand2tetris-autoloads.el" "/home/MyName/.emacs.d/elpa/nand2tetris-20170306.1827/nand2tetris-autoloads.el" nil t)
load("/home/MyName/.emacs.d/elpa/nand2tetris-20170306.1827/nand2tetris-autoloads" nil t)
package--activate-autoloads-and-load-path([cl-struct-package-desc nand2tetris (20170306 1827) "Major mode for HDL files in the nand2tetris course" ((emacs (24))) nil nil "/home/MyName/.emacs.d/elpa/nand2tetris-20170306.1827" ((:keywords "nand2tetris" "hdl") (:url . "http://www.github.com/CestDiego/nand2tetris.el/")) nil])
package--load-files-for-activation([cl-struct-package-desc nand2tetris (20170306 1827) "Major mode for HDL files in the nand2tetris course" ((emacs (24))) nil nil "/home/MyName/.emacs.d/elpa/nand2tetris-20170306.1827" ((:keywords "nand2tetris" "hdl") (:url . "http://www.github.com/CestDiego/nand2tetris.el/")) nil] nil)
package-activate-1([cl-struct-package-desc nand2tetris (20170306 1827) "Major mode for HDL files in the nand2tetris course" ((emacs (24))) nil nil "/home/MyName/.emacs.d/elpa/nand2tetris-20170306.1827" ((:keywords "nand2tetris" "hdl") (:url . "http://www.github.com/CestDiego/nand2tetris.el/")) nil] nil deps)
package-activate(nand2tetris)
package-initialize()
eval-buffer(#<buffer load-39633> nil "/home/MyName/.gnu-emacs25" nil t) ; Reading at buffer position 723
load-with-code-conversion("/home/MyName/.gnu-emacs25" "/home/MyName/.gnu-emacs25" nil nil)
load("/home/MyName/.gnu-emacs25")
(cond ((string-match "^23" emacs-version) (load (expand-file-name "/.gnu-emacs23-all-cvs")) (setq custom-file (expand-file-name "/.gnu-emacs23-cvs-custom"))) ((string-match "^24" emacs-version) (load (expand-file-name "/.gnu-emacs24")) (setq custom-file (expand-file-name "/.gnu-emacs24-custom"))) ((string-match "^25" emacs-version) (load (expand-file-name "/.gnu-emacs25")) (setq custom-file (expand-file-name "/.gnu-emacs25-custom"))))
eval-buffer(#<buffer load> nil "/home/MyName/.emacs" nil t) ; Reading at buffer position 866
load-with-code-conversion("/home/MyName/.emacs" "/home/MyName/.emacs" t t)
load("~/.emacs" t t)
#[0 "๏ฟฝ\205\266
Every time this function runs it copies the target files to /tmp
and runs the hardware simulator there. But this means that any files that were previously copied there are still hanging around for future test runs. So the hardware simulator tries to use them instead of the builtin chips.
A simple fix would be to generate a new temp directory each time with (make-temp-file "nand2tetris" t)
. As a side benefit this would also be more portable: /tmp
isn't always the correct temp directory.
It's not really bothering me (I think I'll use tests-current-hdl
anyway from now on so that I can see the outputs), but I thought you would like to know.
Thanks for the nice package ๐.
The autoload cookies used in the source files do not seem to be the default ;;;###autoload
, but :autoload
instead.
This seems like a legacy of the names
package that should be removed.
First, thanks for creating this package--it makes working with the Nand2Tetris course much easier!
I would suggest, however, that namespace libraries like names
be avoided. While they may seem convenient, there are some annoying quirks. For example, if I eval-defun
on a variable like -assembler
, I am actually putting a new value into -assembler
, not nand2tetris-assembler
.
Also, using customizable variables for directories means that changing the base directory nand2tetris-core-base-dir
does not propagate the change to all relevant values and functions. There's really no need for these variables; the script functions should just use nand2tetris-core-base-dir
directly.
Hello. Thanks for this useful software.
I wasn't able to get it running automatically when I opened project-files. I was getting a "File mode specification error". It worked fine when enabled automatically.
I think this was due to a faulty entry in auto-mode-alist. The relevant code can be found at the end of nand2tetris.el:
(add-to-list 'auto-mode-alist
`(,(concat (expand-file-name nand2tetris-core-base-dir) "\.*\\.hdl")
. 'nand2tetris-mode))
This was resulting in an entry to auto-mode-alist which was dissimilar to the other entries; deleting the quote before the mode in the above expression produced a properly-formatted entry in auto-mode-alist and resolved the problem for me. The revised code is below:
(add-to-list 'auto-mode-alist
`(,(concat (expand-file-name nand2tetris-core-base-dir) "\.*\\.hdl")
. nand2tetris-mode))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.