sulami/literate-calc-mode.el

Fix for #15 broke variable names that contain identifiers

charignon opened this issue · 2 comments

fb39084 introduced a fix for #15 but seems to have broken the package by being too restrictive in what variable name we can use.

Example test that fails (after the fix but worked before) to show the issue:

;; FAIL (seems to be because of year in the name)
(ert-deftest literate-calc-mode-test/overlapping-names-2-test ()
  (with-temp-buffer
    (literate-calc-mode)
    (insert "yearlyfoo = 25\nbar=yearlyfoo * 2")
    (literate-calc-insert-results)
    (should (equal "yearlyfoo = 25 => yearlyfoo: 25\nbar=yearlyfoo * 2 => bar: 50"
                   (buffer-string)))))

This prevent using any identifier (like year) as part of variable names, which is a problem that I have encountered frequently trying to use literate-calc-mode, so I reverted my local version to before the fix for #15.

sulami commented

I've put up a branch (fix-36) with what I believe fixes this, but I'm happy to get some feedback on that before merging it.

Yep your fix looks like it would work, thanks!