Emacs python mode question

J

jblazi

If I should like to go to line 345: how can I do that? Typing M-x
goto-line and then 345 is a bit cumbersome.
I defines the key Alt-g to be goto-line, but it does not work.

TIA,
jb
 
S

Skip Montanaro

jb> If I should like to go to line 345: how can I do that? Typing M-x
jb> goto-line and then 345 is a bit cumbersome. I defines the key Alt-g
jb> to be goto-line, but it does not work.

Is M-g not bound to goto-line? You can check for keybindings by typing "C-h
w" then entering the name of a command.

Skip
 
J

jblazi

jb> If I should like to go to line 345: how can I do that? Typing M-x
jb> goto-line and then 345 is a bit cumbersome. I defines the key
Alt-g jb> to be goto-line, but it does not work.

Is M-g not bound to goto-line? You can check for keybindings by typing
"C-h w" then entering the name of a command.

Thx.
gogo-line is on the menu but is not bound to a key. How can I bind it?
 
S

Skip Montanaro

jb> gogo-line is on the menu but is not bound to a key. How can I bind
jb> it?

M-x global-set-key RET

should do the job interactively. In your ~/.emacs file use something like:

(define-key esc-map [g] 'goto-line)

YMMV. I don't use GNU Emacs anymore. Keybindings is one area in which
Emacs and XEmacs have diverged. Try C-h f define-key RET.

Skip
 
S

Sean Richards

jblazi said:
gogo-line is on the menu but is not bound to a key. How can I bind it?

Put (global-set-key (kbd "M-g") 'goto-line) in your ~/.emacs

Sean
 
D

David M. Cook

If I should like to go to line 345: how can I do that? Typing M-x
goto-line and then 345 is a bit cumbersome.
I defines the key Alt-g to be goto-line, but it does not work.

In XEmacs, you can just highlight the error line and middle-click. I don't
know whether this feature is missing in Gnu Emacs or just turned off.

Dave Cook
 
J

jblazi

(define-key esc-map [g] 'goto-line)

For one reason or the other, this does not work. (I tried several such
options before posting.)
When I do this (and save .emacs and restart Emacs of course) I get the
message

Set face default (M-g d) ...

in the command line buffer.

jb
 
A

Alexander Schmolck

jblazi said:
(define-key esc-map [g] 'goto-line)

For one reason or the other, this does not work.

It doesn't work because the above will specifically set ESC-g to goto-line,
which isn't what you want, I guess. Try either of the following:

(global-set-key [(meta g)] 'goto-line)
(global-set-key "\eg" 'goto-line)

Before you save your .emacs you can verify that the command works by pressing
C-xC-e right after the closing ')' and then M-g.

'as
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top