* trouble overwriting C-r in a shell (term-mode)
@ 2020-05-28 16:30 Christian Seberino
2020-05-28 20:35 ` Narendra Joshi
0 siblings, 1 reply; 5+ messages in thread
From: Christian Seberino @ 2020-05-28 16:30 UTC (permalink / raw)
To: help-gnu-emacs
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)))))
Thanks!
Chris
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: trouble overwriting C-r in a shell (term-mode)
2020-05-28 16:30 trouble overwriting C-r in a shell (term-mode) Christian Seberino
@ 2020-05-28 20:35 ` Narendra Joshi
2020-05-28 21:31 ` Christian Seberino
2020-05-28 22:42 ` Emanuel Berg via Users list for the GNU Emacs text editor
0 siblings, 2 replies; 5+ messages in thread
From: Narendra Joshi @ 2020-05-28 20:35 UTC (permalink / raw)
To: Christian Seberino; +Cc: help-gnu-emacs
Christian Seberino <cseberino@gmail.com> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-05-29 9:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-28 16:30 trouble overwriting C-r in a shell (term-mode) Christian Seberino
2020-05-28 20:35 ` Narendra Joshi
2020-05-28 21:31 ` Christian Seberino
2020-05-28 22:42 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-05-29 9:09 ` Jamie Beardslee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).