From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.help Subject: Re: Possible to bind C-o to some function in an ansi-term? (Add something to term-mode-hook?) Date: Tue, 11 Aug 2015 02:37:56 +0100 Message-ID: <87a8tyfvuz.fsf@robertthorpeconsulting.com> References: <87h9o9b5j9.fsf@nl106-137-147.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1439257105 21006 80.91.229.3 (11 Aug 2015 01:38:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Aug 2015 01:38:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 11 03:38:13 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZOyW5-0006GS-7e for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Aug 2015 03:38:13 +0200 Original-Received: from localhost ([::1]:60741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOyW4-0006Iy-JP for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Aug 2015 21:38:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOyVu-0006Im-DU for help-gnu-emacs@gnu.org; Mon, 10 Aug 2015 21:38:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZOyVr-0006HO-1T for help-gnu-emacs@gnu.org; Mon, 10 Aug 2015 21:38:02 -0400 Original-Received: from outbound-smtp05.blacknight.com ([81.17.249.38]:59585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOyVq-0006Gy-Ra for help-gnu-emacs@gnu.org; Mon, 10 Aug 2015 21:37:58 -0400 Original-Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp05.blacknight.com (Postfix) with ESMTPS id C6D1098F11 for ; Tue, 11 Aug 2015 01:37:57 +0000 (UTC) Original-Received: (qmail 28768 invoked from network); 11 Aug 2015 01:37:57 -0000 Original-Received: from unknown (HELO RTLaptop) (rt@robertthorpeconsulting.com@[109.76.93.78]) by 81.17.254.9 with ESMTPSA (DHE-RSA-AES128-SHA encrypted, authenticated); 11 Aug 2015 01:37:57 -0000 In-Reply-To: <87h9o9b5j9.fsf@nl106-137-147.student.uu.se> (message from Emanuel Berg on Sun, 09 Aug 2015 03:43:22 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 81.17.249.38 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106446 Archived-At: Emanuel Berg writes: > Dan Espen writes: > >> I think the OP may need to do the binding in >> term-mode-hook. But I confess, I don't really >> understand term.el and I haven't tried. It has >> a term-mode-map and some other maps that just >> confuse me. > > OK - well, it doesn't work just setting the > term-mode-map, probably because the shell intercepts > the keystrokes and this is the whole idea with the > mode. Perhaps the OP can use 'M-x shell RET' where > keys are setup like everwhere else? As far as I know, and that's not very far.... Term-mode and ansi-term are now very similar. They both have two modes "character" and "line". "Line" is like *shell*, each line is sent at once to the shell. "Character" is like a terminal, each character is sent. The only difference between ansi-term and term-mode is the escape character (C-c for term-mode and both C-c and C-x for ansi-term). So, you can over-ride keybindings quite easily using term-mode-map in line mode but not in character mode. In character mode term-raw-map is used. That looks like something you wouldn't want to tinker with. BR, Robert Thorpe