This is Google's cache of http://lukeshu.ath.cx/1/wordpress/2011/08/fixing-wrong-type-argument-characterp-return-in-emacs/. It is a snapshot of the page as it appeared on Dec 16, 2011 06:35:41 GMT. The current page could have changed in the meantime. Learn more

Text-only version
 
Fixing “Wrong type argument: characterp, return” in !Emacs | ltsBlog

ltsBlog

Fixing “Wrong type argument: characterp, return” in !Emacs

A few months ago, I ran into an issue with Emacs that I just found the solution to. In Emacs term-mode (or ansi-term, or multi-term), hitting Enter doesn’t work, and the mini-buffer displays Wrong type argument: characterp, return, and the term doesn’t see the keystroke.

I dented about it on identi.ca, and no one was able to help me. This turned out to be a mistake, because I kept seeing the dent as I Googled/DuckDuckGo’ed for a solution.

Anyway, I finally found the solution on the Korean blog Seorenn SIGSEGV.

The problem is basically that autopair had remapped the return key to an autopair function, which didn’t jive with term-mode. At least, that’s what Seorenn said.

If it were that simple, I would have noticed it when I installed autopair. Only in some environments does the problem manifest. For example, on Ubuntu, where I started using autopair, the problem never appears. When I switched to Fedora (and later Parabola), I figured it was some issue with the X server, because it worked fine when running in a terminal.

Now knowing that the problem was related to autopair, I can’t figure out how it ever worked.

Anyway, the fix is to add the following to your .emacs:

(add-hook 'term-mode-hook
  #'(lambda () (setq autopair-dont-activate t)))

(Code segment from emacs-fu, via Seorenn SIGSEGV.)

This entry was posted in Computers. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>