Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: Ansi-term not tab-completing

Tags:

I have recently installed a few packages so that I can program iOS apps from emacs, but I am having some trouble. One of the packages (I'm pretty sure it's autocomplete) is preventing tab-completion from working in ansi-term. Any time I try to tab-complete, I get the error "Wrong type argument: characterp, tab".

Here is my .emacs file:

; Add packages (add-to-list 'load-path "~/.emacs.d/elpa") (add-to-list 'load-path "~/.emacs.d/packages")  (require 'package)  ; Package sources (add-to-list 'package-archives      '("marmalade" .       "http://marmalade-repo.org/packages/")) (add-to-list 'package-archives     '("melpa" .             "http://melpa.milkbox.net/packages/") t)  (package-initialize)  ; Check packages were loaded (require 'linum-relative) (require 'git-gutter-fringe) (require 'yasnippet) (require 'auto-complete-config)  ; Enable packages (elscreen-start)  ; Config ; Color scheme (load-file "~/.emacs.d/themes/color-theme-wombat.el")  ; Enable snippets (yas-global-mode 1)  ; Copy/paste with the system clipboard (setq x-select-enable-clipboard t)  ; Enable relative line numbers (global-linum-mode t)  ; Enable git gutter (global-git-gutter-mode t) (setq git-gutter-fr:side 'left-fringe)  ; Darker git gutter colors (set-face-foreground 'git-gutter-fr:modified "#ccaa8f") (set-face-foreground 'git-gutter-fr:added    "#333366") (set-face-foreground 'git-gutter-fr:deleted  "#e5786d")  ; C-x -> arrow changes windows (global-set-key (kbd "C-x <up>") 'windmove-up) (global-set-key (kbd "C-x <down>") 'windmove-down) (global-set-key (kbd "C-x <right>") 'windmove-right) (global-set-key (kbd "C-x <left>") 'windmove-left)  ; Hide everything that isn't text (tool-bar-mode -1) (scroll-bar-mode -1) (menu-bar-mode -1)  ; Move backups (setq backup-directory-alist   `((".*" . ,"~/.emacsbackups"))) (setq auto-save-file-name-transforms   `((".*" ,"~/.emacstemps" t))) (setq backup-by-copying t)  ; Autocomplete settings ;when to use autocomplete (note yasnippits) (setq-default ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers)) (global-auto-complete-mode t) (add-to-list 'ac-modes 'objc-mode) ; For iOS dev 
like image 500
user1539179 Avatar asked Aug 16 '13 16:08

user1539179


1 Answers

Alright, I fixed it. The problem was with yasnippets, but the suggestion on the link didn't work. For some reason setting yas-minor-mode to -1 didn't work. What I had to do was set yas-dont-activate to something.

Suggested fix that did NOT work for me:

(add-hook 'term-mode-hook (lambda()                 (yas-minor-mode -1))) 

What DID work for me:

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

I'm running emacs 23.4.1

like image 84
user1539179 Avatar answered Oct 02 '22 21:10

user1539179