From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.help Subject: Re: macro only for shell-mode Date: Sun, 05 Oct 2008 11:33:00 +0200 Organization: FH-Trier Message-ID: <1223199493.378516@arno.fh-trier.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1223199703 31131 80.91.229.12 (5 Oct 2008 09:41:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Oct 2008 09:41:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 05 11:42:39 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KmQ8C-00065U-9M for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Oct 2008 11:42:28 +0200 Original-Received: from localhost ([127.0.0.1]:35912 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KmQ78-0007Y6-LW for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Oct 2008 05:41:22 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-kl.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: 143-93-54-11.arno.fh-trier.de Original-X-Trace: news.uni-kl.de 1223199509 4437 143.93.54.11 (5 Oct 2008 09:38:29 GMT) Original-X-Complaints-To: usenet@news.uni-kl.de Original-NNTP-Posting-Date: Sun, 5 Oct 2008 09:38:29 +0000 (UTC) User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) In-Reply-To: Cache-Post-Path: arno.fh-trier.de!unknown@dslb-088-068-220-052.pools.arcor-ip.net X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) Original-Xref: news.stanford.edu gnu.emacs.help:163032 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58371 Archived-At: Stefan Thomas wrote: > Dear all, > sorry for bothering You again, but I didn't succed with all my trials until > now. But I think what I want is very simple: > I want, if I press the key "4" in shell-mode, > the curser moves first one space to the left, then prints "4" and then goes > to the end of the line. > In other words: > I want to substitue "4" with: > C-b 4 C-e > I have defined a macro ("viertel") wich does C-b 4 C-e, but I'm not able to > associate this macro to the key 4. > It would be great if I could get an advice how this can be done! > Thanks for Your support, > Stefan > (defun viertel () (interactive) (backward-char) (insert "4") (end-of-line)) (defun my-shell-mode-hook () (local-set-key [?4] 'viertel) ;;... ) (add-hook 'shell-mode-hook 'my-shell-mode-hook) -ap