I think it was due to org-mode, which has its share of bugs and glitches. Either way Emacs refused to evaluate a function because I had a commented out line with a closing parentheses in it, and would only accept it after I deleted that line.
If you can reproduce it it would be worth submitting a bug report. Comments like:
(defun foo ()
;; old code)
new code)
Should just get discarded when parsing/running the lisp code. There was a lot of code like that in my old .emacs file back when I was learning how I wanted it to behave but didn't want to delete old configurations (before I got into the git everything habit, especially).
I just checked, it doesn't happen in an actual elisp buffer, but every time in a standard .org file. It'll always throw a 'Lisp error: (scan-error "Unbalanced parentheses")'.
You might rightly say that evaluating lisp code directly in an org-mode code block might not be the best idea, I just don't expect it to mostly work but mess up the syntax depending on comments.
Interesting. I frequently write Common Lisp code in org blocks and execute from there, but not Emacs Lisp. And I don't have emacs on my phone so I can't test it. Can you copy a sample org file here?
Not sure where this is coming from. Elisp doesn't error on anything in comments.