CestDiego / nand2tetris.el

Major Mode for HDL files in nand2tetris.
42 stars 11 forks source link

Wrong format for entry in auto-mode-alist #14

Open circius opened 5 years ago

circius commented 5 years ago

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))
circius commented 5 years ago

In case someone comes across this in the future, this pull request includes a fix for this issue.