emacs-compat / compat

COMPATibility Library for Emacs Lisp
https://elpa.gnu.org/packages/compat.html
GNU General Public License v3.0
69 stars 12 forks source link

semicolon shadows ending parenthesis #9

Closed erusyd closed 1 year ago

erusyd commented 1 year ago

In compat-tests.el, line 254: (should-equal (key-parse "C-;") [?\C-;])

minad commented 1 year ago

Not an issue, test suite is green

doolio commented 1 year ago

Not an issue

Are you sure? It seems to prevent straight from building the package. I get the following error.

Building no-littering... Building no-littering → Building compat... autoload-generate-file-autoloads: ../../../../../../../.emacs.d/straight/build/compat/compat-tests.el:0:0: error: scan-error: (Unbalanced parentheses 9333 92132)

Edit: Looking more closely, it seems the opening parenthesis in line 254 is closed by the closing parenthesis in line 328 but that should close the parenthesis in line 239.

minad commented 1 year ago

I see. This means there is a bug in the autoload generator. Furthermore the problem is that straight ignores .elpaignore. Note that compat-tests.el is NOT part of the package. While it compiles cleanly, it may not.

We should probably escape the semicolon somehow. Is the issue fixed if you write ?\C-\; instead? If this doesn't work we just write the numeric code.

Furthermore compat-tests.el could be moved to a test directory. Then straight would not compile it, right? Otoh compiling it may also be beneficial to uncover issues like this one.

doolio commented 1 year ago

Firstly, thank you for the quick response.

Is the issue fixed if you write ?\C-\; instead?

Yes, this fixes the issue.

Furthermore compat-tests.el could be moved to a test directory. Then straight would not compile it, right?

Perhaps, but I'm not sure. If it matters it did not compile the compat-macs.el file but it did for all the other .el files.

minad commented 1 year ago

compat-macs.el is intentionally not compiled. This file is only needed at compile time.

doolio commented 1 year ago

Ah ok.