clojure-emacs / clojure-mode

Emacs support for the Clojure(Script) programming language
914 stars 246 forks source link

Wrong type argument: `number-or-marker-p` on `native-comp` branch #587

Open ribelo opened 3 years ago

ribelo commented 3 years ago

Expected behavior

Proper code indentation

Actual behavior

Message/error Wrong type argument: number-or-marker-p

Steps to reproduce the problem

Install the emacs from the native-comp branch, commit 64425ee0d and try to indent any clojure code

Environment & Version information

distro  Arch Linux Linux 5.11.6-1-ck-skylake x86_64
emacs  28.0.50 pgtk-nativecomp 64425ee0d ~/.emacs.d/
doom  2.0.9 grafted, HEAD -> develop, origin/develop, origin/HEAD 46dedb3 2021-03-13 16:35:21 -0500 ~/.doom.d/ -> ~/.doom.d/

clojure-mode version

5.13.0

Emacs version

emacs 28.0.50 pgtk-nativecomp 64425ee0d

Operating system

Arch Linux

I'm far from an elisp hacker and I have no idea if the problem is on the clojure-mode side or somewhere else, but after remove (,mothod) fromt this line everything works. With this, method "resets" and becomes nil. I have no idea and I don't understand why.

hindol commented 3 years ago

I am facing the exact same issue. I tried M-x toggle-debug-on-error and got this,

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  #f(compiled-function (indent-point last-sexp containing-form-column method) #<bytecode -0x558e0fe260f46bc>)(82 67 2 nil)
  clojure-indent-function(82 (2 62 67 nil nil nil 1 nil nil (35 62) nil))
  calculate-lisp-indent((2 62 67 nil nil nil 1 nil nil (35 62) nil))
  lisp-indent-line()
  clojure-indent-line()
  indent-according-to-mode()
  #f(compiled-function (&optional arg) "Insert a newline, then indent according to major mode.\nIndentation is done using the value of `indent-line-function'.\nIn programming language modes, this is the same as TAB.\nIn some text modes, where TAB inserts a tab, this command indents to the\ncolumn specified by the function `current-left-margin'.\n\nWith ARG, perform this action that many times." (interactive "*p") #<bytecode 0x167a886a28ec364c>)()
  apply(#f(compiled-function (&optional arg) "Insert a newline, then indent according to major mode.\nIndentation is done using the value of `indent-line-function'.\nIn programming language modes, this is the same as TAB.\nIn some text modes, where TAB inserts a tab, this command indents to the\ncolumn specified by the function `current-left-margin'.\n\nWith ARG, perform this action that many times." (interactive "*p") #<bytecode 0x167a886a28ec364c>) nil)
  newline-and-indent()
  lispy-newline-and-indent-plain()
  funcall-interactively(lispy-newline-and-indent-plain)
  call-interactively(lispy-newline-and-indent-plain nil nil)
  command-execute(lispy-newline-and-indent-plain)

Note: I am also on the pgtk-nativecomp branch of Emacs. Not sure if this issue is restricted to this Emacs branch or not.

EDIT: Possible duplicate of #584?