When using ansi-term on Emacs a get the following error whenever I press enter in char-mode
:
wrong type argument: characterp, return
I used toggle-debug-on-error
and get the following:
Debugger entered--Lisp error: (wrong-type-argument characterp return)
string(return)
term-send-raw()
call-interactively(term-send-raw)
(let ((cua-delete-selection (not autopair-autowrap)) (blink-matching-paren (not autopair-action))) (call-interactively beyond-autopair))
(let* ((autopair-emulation-alist nil) (beyond-cua (let ((cua--keymap-alist nil)) (autopair-original-binding fallback-keys))) (beyond-autopair (autopair-original-binding fallback-keys))) (if autopair-autowrap (progn (setq autopair-wrap-action (autopair-calculate-wrap-action)))) (setq this-autopair-command this-command) (setq this-original-command beyond-cua) (if (and (featurep (quote paredit)) (symbolp beyond-cua) (string-match "paredit" (symbol-name beyond-cua))) (progn (setq autopair-action nil))) (let ((cua-delete-selection (not autopair-autowrap)) (blink-matching-paren (not autopair-action))) (call-interactively beyond-autopair)))
autopair-fallback("
")
(let ((pair (autopair-find-pair (char-before)))) (if (and pair (eq (char-syntax pair) 41) (eq (char-after) pair)) (progn (setq autopair-action (list (quote newline) pair (point))))) (autopair-fallback (kbd "RET")))
autopair-newline()
call-interactively(autopair-newline nil nil)
command-execute(autopair-newline)
And after that the Enter key starts to work normally, but I do have to go through the toggle-debug-on-error
every time I open Emacs.
I looked around but didn't find anything that could help me on that.
In my .emacs
I've got the following reference to ansi-term
:
(defvar my-term-shell "/bin/zsh")
(defadvice ansi-term (before force-bash)
(interactive (list my-term-shell)))
(ad-activate 'ansi-term)
(defun my-term-use-utf8 ()
(set-buffer-process-coding-system 'utf-8-unix 'utf-8-unix))
(add-hook 'term-exec-hook 'my-term-use-utf8)
autopair
andcua-mode
. Have you tried disabling them. They (or your configuration of them) might be the cause of your problem.