From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Narendra Joshi Newsgroups: gmane.emacs.help Subject: Re: trouble overwriting C-r in a shell (term-mode) Date: Thu, 28 May 2020 22:35:09 +0200 Message-ID: <87imgflrwi.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="61092"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Christian Seberino Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 28 22:35:37 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jePFY-000FhJ-W9 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 28 May 2020 22:35:36 +0200 Original-Received: from localhost ([::1]:55792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jePFY-0004xA-2V for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 28 May 2020 16:35:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jePFF-0004ww-0a for help-gnu-emacs@gnu.org; Thu, 28 May 2020 16:35:17 -0400 Original-Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:43997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jePFD-0005eb-DT for help-gnu-emacs@gnu.org; Thu, 28 May 2020 16:35:16 -0400 Original-Received: by mail-ej1-x632.google.com with SMTP id a2so1356081ejb.10 for ; Thu, 28 May 2020 13:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=T8N2Uu34QL0XWYDNGOMkxQosYFgqkAgFJXnwXYz8XZc=; b=N9MY3Vh9dCKjQPmXTn4erFTu7gOt0OkUQnAotUZF3+wCaR1W3C81JcJN9l7vnxguEY 0hHFTr6YQsi70abf5l+00awO2fWIi73XStIDbYLKkg57OTugdJQswf2j7Nghcx/2rfKI iDk3gxPPxop4EK2+3j+mWPKYq1DCTqgAcItri1kHTPIsRfJhU0G9Yfkp5pjVh88XBSJl RFDr7Pgv908m4uLrx6zCPHM2zw6j6FItwhfXOnTZNiaHT0P5b7MmQ18C7SUIgPkiTq1O D61unBj6jZugpfJEqDLfe5ditAKDcOk6Tfddvns3Ml5NllYrVDo0GJ2UnE/VfNBF3eyH bzhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=T8N2Uu34QL0XWYDNGOMkxQosYFgqkAgFJXnwXYz8XZc=; b=ftN5G7V9/uvOUFSzItH5AQS0cCWJaZhl3kqode9pMCKdYx4N2QlA2rCmA+hEZgoZ5a 4j3W0+Vg6erP+eSgQ3/AH0YS40dYZ3K5VvreeANSSHSlKxoIcQOzouHY1CPokv3o3DDe tx+SlgpDthwtnRF4yGWu0+CV9cp8J/faSaJO6NTTwDaFBbsS/SCilFkNUkR4BDnKoKbO lMAznFCoflSRrBu+I8FZEpbtgeRha1eWracqvlBAHOqVWh6bAb9guka97LlFsDfwOPiN JAAcIlbsl5XWKbRI1spJ6U5ZN9MQLz7J1QLm3YYt8XUO7hVNqH16aFZWR01jGhvvES4W 1WEQ== X-Gm-Message-State: AOAM530baT3985shG/zsvI7q13hcIIuCp9ftG/rWwqyQOMSDO4SMgycS WJrXT1btPNoAi+MExlD+/NlXpfhjZg== X-Google-Smtp-Source: ABdhPJwErw+YTMD1aPWO/DZ/uhzmfdhnXh0YhYWnAp1ZtL7259C4cPdkeSmPqCtPtSCO7eAFuKE7YQ== X-Received: by 2002:a17:906:a387:: with SMTP id k7mr5049941ejz.408.1590698112542; Thu, 28 May 2020 13:35:12 -0700 (PDT) Original-Received: from vicarie ([2a02:8109:b640:2344::eae9]) by smtp.gmail.com with ESMTPSA id cy14sm2032216edb.27.2020.05.28.13.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 13:35:11 -0700 (PDT) In-Reply-To: (Christian Seberino's message of "Thu, 28 May 2020 11:30:41 -0500") Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=narendraj9@gmail.com; helo=mail-ej1-x632.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:123153 Archived-At: Christian Seberino writes: > I'm trying to overwrite C-r in a shell and it isn't working. > Any help greatly appreciated. I tried adding a term-mode hook as > follows.... > > (add-hook 'term-mode-hook > '(lambda () (interactive) > (global-set-key (kbd "C-r") > (lambda () (interactive) > (if (get-buffer "*Open > Recent*") > (kill-buffer "*Open > Recent*")) > (recentf-open-files))))) You can bind "C-r" in the keymap `term-raw-map' to the function: --8<---------------cut here---------------start------------->8--- (define-key term-raw-map (kbd "C-r") (lambda () (interactive) (if (get-buffer "*Open Recent*") (kill-buffer "*Open Recent*")) (recentf-open-files))) --8<---------------cut here---------------end--------------->8--- When `term-char-mode' is on, `term-raw-map' is activated as the local map of the term buffer. > Thanks! > > Chris Best, -- Narendra Joshi