Emacs -nw problems with cscope and terminals

A few issues with emacs in terms of windows. Any help is appreciated.

a. I am running emacs over ssh with emacs -nw with cscope enabled. After searching for a character or definition in the cscope buffer, when I press 'enter', emacs says, "The buffer is read-only." While the same functionality in emacs with xwindows (gtk or something else) leads me to the file and line in the edit buffer. How can I use the same functions with 'emacs -nw'.

b. Also the arrow in the edit / source buffer, when I make the following link for the character from the cscope buffer, remains in the edit buffer. How can i do this?

from. My keys map to cscope functions, as in xcscope.el. All control keys expect Ctrl-F3 and Ctrl-F4. How can I turn this on too.

Thanks a lot,

0
source share
2 answers

a. Add the following to the .emacs file:

(define-key global-map (kbd "\r") [return]) 

I got a response from http://weenix.cs.brown.edu/mediawiki/index.php/Cscope

b. If you press the spacebar in the cscope buffer, you will get an arrow. It is just a display; the file has not changed. If you want to get rid of it, add the following to your .emacs file:

 (setq cscope-allow-arrow-overlays nil) 
+1
source
Terminal

sends different key sequences than pending emacs. you need to provide translations for the terminal type for emacs to work correctly. for example, I have this configuration for setting up the terminal I (weird char is a literal "escape" char, which you can enter using "Cq <esc>" :

 (let ((map (if (boundp 'input-decode-map) input-decode-map function-key-map))) (define-key map (kbd "RET") [return]) (define-key map "[OA" (kbd "<C-up>")) (define-key map "[OB" (kbd "<C-down>")) (define-key map "[OC" (kbd "<C-right>")) (define-key map "[OD" (kbd "<C-left>")) (define-key map "[A" (kbd "<C-up>")) (define-key map "[B" (kbd "<C-down>")) (define-key map "[C" (kbd "<C-right>")) (define-key map "[D" (kbd "<C-left>")) (define-key map "OA" (kbd "<M-up>")) (define-key map "OB" (kbd "<M-down>")) (define-key map "OC" (kbd "<M-right>")) (define-key map "OD" (kbd "<M-left>")) (define-key map "[OA" (kbd "<MC-up>")) (define-key map "[OB" (kbd "<MC-down>")) (define-key map "[OC" (kbd "<MC-right>")) (define-key map "[OD" (kbd "<MC-left>")) (define-key map "[[17~" (kbd "<C-f6>")) (define-key map "[[18~" (kbd "<C-f7>")) (define-key map "[[19~" (kbd "<C-f8>")) (define-key map "[[20~" (kbd "<C-f9>")) (define-key map "[[21~" (kbd "<C-f10>")) (define-key map "[[23~" (kbd "<C-f11>")) (define-key map "[[24~" (kbd "<C-f12>")) (define-key map "\e[1~" [home]) (define-key map "\e[4~" [end]) (define-key map "\e\e[1~" [M-home]) (define-key map "\e\e[4~" [M-end]) ) 

in some terminals, you can get the key code by typing "Cv" and then the desired keys. this should output the actual key codes that the terminal sends for the keys that you pressed after "Cv".

0
source

Source: https://habr.com/ru/post/1403281/


All Articles