Emacs-D-Mode-Maintainers / Emacs-D-Mode

An Emacs mode for D code.
GNU General Public License v3.0
84 stars 22 forks source link

wrong-type-argument error when triggering electric mode #98

Closed benjones closed 3 years ago

benjones commented 4 years ago

Using emacs version 27.1 on macos, typing any character that triggers electric mode (semicolon after statement, parentheses when defining a function), I get the following error + stack trace (captured using debug-on-error):

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  looking-at(nil)
  c-semi-pp-to-literal(17)
  c-in-literal(nil)
  c-electric-semi&comma(nil)
  funcall-interactively(c-electric-semi&comma nil)
  call-interactively(c-electric-semi&comma nil nil)
  command-execute(c-electric-semi&comma)

I'm using the latest release installed from melpa.

Let me know what other info I can/should provide. I think this is the only part of my .emacs with d-mode stuff in it which doesn't seem related to the issue:

(add-hook 'd-mode-hook 'dfmt-setup-keys)
(add-hook 'd-mode-hook
                  (lambda ()
                        (setq c-basic-offset 4)
                        (setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60
                                                                        64 68 72 76 80 84 88 92 96 100 104 108 112
                                                                        116 120))
                        (setq indent-tabs-mode nil)
                        (setq tab-width 4)
                        (c-set-offset 'substatement-open 0)
                        (c-set-offset 'case-label 4)
                        )
                  )
CyberShadow commented 4 years ago

There's no d-mode code in that stack trace. It's possible this is a cc-mode regression.

In any case, does this happen with the next branch? https://github.com/CyberShadow/Emacs-D-Mode/tree/next

benjones commented 4 years ago

I noticed that too, so I tried to see if similar issues came up editing in c++ mode and it didn't seem to.

Your new branch seems to work fine.

CyberShadow commented 3 years ago

I am assuming this is no longer an issue now that the next branch has been merged.