ltsBlog

[Emacs] autopair problems when using term-mode

I found this awesome blog post on the Korean blog Seorenn SIGSEGV.

Using Google translate, I was able to extract the information I needed. However, Google translate quite botched it, as did Yahoo and Bing translate. I’ve used a combination of these three tools, and my understanding of Emacs, to put together a more reasonable translation.

I’m posting the full English text of it here because this is a problem I’ve had, and would like to help others find the solution. I don’t mean to rip off the original author, his blog seems quite good, worth reading, if you don’t mind poor translations (or, can read Korean).

The original post can be found here here.

In Emacs term-mode (M-x term) and multi-term-mode pressing the Enter key causes an error to appear in the mini-buffer, and the keystroke appears to have been eaten.

This problem only occurs when using autopair. are thought to In addition to or RET (Enter) as a separate feature for all modes of binding may also occur. if autopair the last of the solution are presented.

See below sum up shoveling machine.

Issue

During term-mode RET does not work. The mini-buffer shows the error message Wrong type argument: characterp, return. RET has been bound to something here, or maybe you saw the state I had a feeling heard nil.

Alternative

Fortunately, I was able to replace the RET key with C-j. This is used as a temporary measure to work with.

Cause Analysis

In term-mode use C-h k to find the function that RET is bound to. autopair that certain functions were bound.

As a result, be sure that autopair is the culprit.

Attempted Solution

In term-mode C-h k with C-j to determine the function bound to: term-send-raw.

In conclusion, I believe you will solve the problem in the RET key bindings by using define-key to bind the key to term-send-raw in term-mode-map.

But the code encounters an error. Is not allowed to do something it felt like.

Solution

The code below. Not two lines were able to solve it.

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

Source of the above code: http://emacs-fu.blogspot.com/2010/06/console-apps-in-emacs-with-multi-term.html

This entry was posted in Computers. Bookmark the permalink.

One Response to [Emacs] autopair problems when using term-mode

  1. Pingback: Fixing “Wrong type argument: characterp, return” in !Emacs | ltsBlog

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>