unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to bind (shift Fx) for emacs in putty?
@ 2005-12-24 16:30 c.c
  2005-12-25 11:49 ` Peter Dyballa
       [not found] ` <mailman.20392.1135512536.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 16+ messages in thread
From: c.c @ 2005-12-24 16:30 UTC (permalink / raw)


Hi,

I am in a putty terminal, I can bind the fx to some function for emacs,
such as (global-set-key [f1] "hello world!"), but if I bind the (shift
Fx) like this (global-set-key [(shift f1)] "hello world!"), I will be
failed! And the "C-h k" can get correct key description for the (shift
f1).

Any suggestion?

Thanks.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
  2005-12-24 16:30 How to bind (shift Fx) for emacs in putty? c.c
@ 2005-12-25 11:49 ` Peter Dyballa
       [not found] ` <mailman.20392.1135512536.20277.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 16+ messages in thread
From: Peter Dyballa @ 2005-12-25 11:49 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 24.12.2005 um 17:30 schrieb c.c:

> (global-set-key [(shift f1)] "hello world!"), I will be failed! And 
> the "C-h k" can get correct key description for the (shift f1).
>

Then try first to bind the key interactively and then invoke 
repeat-complex-command (C-x Esc Esc). You will see in minibuffer what 
you did. Going to the beginning of the line (C-a) you can kill it 
(C-k), send a C-g to the recursive edit, and can yank (C-y) the killed 
line into .emacs. The line is valid ELisp.

--
Greetings

   Pete

Genius may have its limitations, but stupidity is not thus handicapped.
		-- Elbert Hubbard

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
       [not found] ` <mailman.20392.1135512536.20277.help-gnu-emacs@gnu.org>
@ 2005-12-25 12:58   ` c.c
  2005-12-25 13:32     ` Peter Dyballa
       [not found]     ` <mailman.20395.1135517652.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 16+ messages in thread
From: c.c @ 2005-12-25 12:58 UTC (permalink / raw)


Hi Pete,

Thanks for your help.

I think the (global-set-key [(shift f1)] "hello world!") is doing some
work, but not all right. because I can get the description when I
invoke (C-h k) by <S-f1>.

"
<S-f1> runs the command "Hello world"
   which is a keyboard macro.
Keyboard macro.
"

but when I press the keys <S-f1>, there is no response.

Something is wrong?

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
  2005-12-25 12:58   ` c.c
@ 2005-12-25 13:32     ` Peter Dyballa
       [not found]     ` <mailman.20395.1135517652.20277.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 16+ messages in thread
From: Peter Dyballa @ 2005-12-25 13:32 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 25.12.2005 um 13:58 schrieb c.c:

> "
> <S-f1> runs the command "Hello world"
>    which is a keyboard macro.
> Keyboard macro.
> "
>
> but when I press the keys <S-f1>, there is no response.
>

I assumed you were using pseudo code in your description! If you use it 
like this, it won't work. You need to define a function that does 
(message "Hello! World?") or such, and bind this function to the key.

--
Mit friedvollen Grüßen

   Pete

Banken sprengen heißt Sonne rein lassen.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
       [not found]     ` <mailman.20395.1135517652.20277.help-gnu-emacs@gnu.org>
@ 2005-12-25 14:04       ` c.c
  2005-12-25 14:51         ` Peter Dyballa
       [not found]         ` <mailman.20398.1135522358.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 16+ messages in thread
From: c.c @ 2005-12-25 14:04 UTC (permalink / raw)


Hm, this is not a pseudo code. If I replace [(shift f1)] with [f1], the
key f1 will print the "Hello world" in the buff.

So it's really very strange.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
  2005-12-25 14:04       ` c.c
@ 2005-12-25 14:51         ` Peter Dyballa
       [not found]         ` <mailman.20398.1135522358.20277.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 16+ messages in thread
From: Peter Dyballa @ 2005-12-25 14:51 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 25.12.2005 um 15:04 schrieb c.c:

> Hm, this is not a pseudo code. If I replace [(shift f1)] with [f1], the
> key f1 will print the "Hello world" in the buff.
>

Indeed! Settings like

	(global-set-key [f6]		"Nix!")
	(global-set-key [s-f6]		"Auch nix!")

work for me (the version of Emacs I used does not allow to distinguish 
f6 from S-f6 (shift f6) so I used the super modifier)! Although it's 
really not the proper way to do it.


Again, I would bind the keys by hand first and retrieve afterwards with 
repeat-complex-command their bindings and see if they really are 
different. Stefan Monnier gave in a simliar situation this hint:

	Try M-: (read-event) RET and then hit your ò key.  It'll return the 
code
	Elisp receives in response to this key (e.g. 2290).  You can then bind 
it
	with (local-set-key [2290] "{").


--
Greetings

   Pete

Without vi there is only GNU Emacs

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
       [not found]         ` <mailman.20398.1135522358.20277.help-gnu-emacs@gnu.org>
@ 2005-12-25 15:33           ` c.c
  2005-12-25 17:53             ` Peter Dyballa
                               ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: c.c @ 2005-12-25 15:33 UTC (permalink / raw)


So I say the (global-set-key [(shift f1)] "hello world!") is working a
little, but not all. Because the emacs can recognize it, so it can
describe key like this,
"
<S-f1> runs the command "Hello world"
   which is a keyboard macro.
Keyboard macro.
"
but why it can't response when I hit the keys in buff? It's puzzling
me.

I tried to bind the key by hand. the same result.

And I am using Putty to connect the debian box. Are there some special
things I need to notice about that?

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
  2005-12-25 15:33           ` c.c
@ 2005-12-25 17:53             ` Peter Dyballa
       [not found]             ` <mailman.20408.1135533298.20277.help-gnu-emacs@gnu.org>
  2005-12-26 12:32             ` Slawomir Nowaczyk
  2 siblings, 0 replies; 16+ messages in thread
From: Peter Dyballa @ 2005-12-25 17:53 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 25.12.2005 um 16:33 schrieb c.c:

> And I am using Putty to connect the debian box. Are there some special
> things I need to notice about that?
>

Oh, that can be! All your local keyboard activity is stolen by putty 
and transferred to the remote debian system. What (remote, debian?) 
Emacs receives is filtered by the shell and its TERM setting (as with 
my Emacs on Mac OS X which cannot distinguish between fn and S-Fn).

I think you either need to find a terminal emulation on the debian 
system that knows to make a difference between Fn and Shift-Fn, and/or 
you need to teach putty to send too the 'modified' keyboard event. This 
can be a second cause. I think starting with DEC vt320 or using xterm 
you might become a happy human ... But: I just tried an Emacs in an 
xterm. It receives two different key events, what you can prove in 
*scratch* buffer by typing C-q and then pressing the F or Shift-F key. 
You might see two different ANSI strings starting with Esc (or '^[') 
each, as I do, but my Emacs, running without windows in xterm, does not 
look up two different key bindings. So it's Emacs itself that needs to 
be set up better, I mean, by loading TERM specific Elisp files?

Do you see in your remote Emacs two different events? I presume before 
you tested in Losedows ...

--
Greetings

   Pete

If you're not confused, you're not paying attention

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
       [not found]             ` <mailman.20408.1135533298.20277.help-gnu-emacs@gnu.org>
@ 2005-12-26 12:24               ` c.c
  2005-12-26 13:45                 ` Peter Dyballa
  2005-12-26 16:51                 ` Stefan Monnier
  0 siblings, 2 replies; 16+ messages in thread
From: c.c @ 2005-12-26 12:24 UTC (permalink / raw)


The TERM setting is xterm-256color, I has added the lines

(define-key function-key-map "\e[11~" [f1])
(define-key function-key-map "\e[23~" [(shift f1)])

to the Emacs's term/xterm-256color.el file , so the Emcas can recognize
these keys, and can describe these keys correctly by "describe-key".
And when I type "C-q f1" and "C-q (S-f1)", I can see in the buff what I
am setting in the file term/xterm-256color.el. it seems everything is
OK, but I just can't get the response when I type <S-f1> in a buff. I
will give up it.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
  2005-12-25 15:33           ` c.c
  2005-12-25 17:53             ` Peter Dyballa
       [not found]             ` <mailman.20408.1135533298.20277.help-gnu-emacs@gnu.org>
@ 2005-12-26 12:32             ` Slawomir Nowaczyk
  2005-12-26 18:49               ` Eli Zaretskii
  2 siblings, 1 reply; 16+ messages in thread
From: Slawomir Nowaczyk @ 2005-12-26 12:32 UTC (permalink / raw)


On Sun, 25 Dec 2005 07:33:31 -0800
"c.c" <i.c.code@gmail.com> wrote:

#> And I am using Putty to connect the debian box. Are there some special
#> things I need to notice about that?

You may try typing "C-h k S-F1" and checking what emacs *thinks* you
are typing and what is bound there. If emacs is receiving the correct
key, neither putty nor debian should matter (I may be wrong, of
course, since I personally don't use either).

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( slawomir.nowaczyk.847@student.lu.se )

Have no fear of perfection - you'll never reach it  (S. Dali)

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
  2005-12-26 12:24               ` c.c
@ 2005-12-26 13:45                 ` Peter Dyballa
  2005-12-26 16:51                 ` Stefan Monnier
  1 sibling, 0 replies; 16+ messages in thread
From: Peter Dyballa @ 2005-12-26 13:45 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 26.12.2005 um 13:24 schrieb c.c:

> it seems everything is OK, but I just can't get the response when I 
> type <S-f1> in a buff. I will give up it.
>

Before you do so: what about other modifiers? Control, Meta, Alt, 
Hyper, super ...

--
Greetings

   Pete       (:
         _    / __    -    -
       _/ \__/_/        -     -
      (´`)      (´`)   -    -
       `´        `´

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
  2005-12-26 12:24               ` c.c
  2005-12-26 13:45                 ` Peter Dyballa
@ 2005-12-26 16:51                 ` Stefan Monnier
  2005-12-27 11:40                   ` liaoweijie
  2005-12-27 11:51                   ` c.c
  1 sibling, 2 replies; 16+ messages in thread
From: Stefan Monnier @ 2005-12-26 16:51 UTC (permalink / raw)


> (define-key function-key-map "\e[23~" [(shift f1)])

This is wrong.  It should be

  (define-key function-key-map "\e[23~" [S-f1])

The compatibility code that turns XEmacs-style [(shift f1)] into [S-f1] is
only applied to the second argument of define-key, not the third.


        Stefan

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
  2005-12-26 12:32             ` Slawomir Nowaczyk
@ 2005-12-26 18:49               ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2005-12-26 18:49 UTC (permalink / raw)


> Date: Mon, 26 Dec 2005 13:32:48 +0100
> From: Slawomir Nowaczyk <slawomir.nowaczyk.847@student.lu.se>
> 
> On Sun, 25 Dec 2005 07:33:31 -0800
> "c.c" <i.c.code@gmail.com> wrote:
> 
> #> And I am using Putty to connect the debian box. Are there some special
> #> things I need to notice about that?
> 
> You may try typing "C-h k S-F1" and checking what emacs *thinks* you
> are typing and what is bound there.

I think PuTTY by default maps S-F1 to F11.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
  2005-12-26 16:51                 ` Stefan Monnier
@ 2005-12-27 11:40                   ` liaoweijie
  2005-12-29  3:57                     ` Stefan Monnier
  2005-12-27 11:51                   ` c.c
  1 sibling, 1 reply; 16+ messages in thread
From: liaoweijie @ 2005-12-27 11:40 UTC (permalink / raw)


Thank you very much.

It's working now. It's wondful!

But I don't know if my define-key sentence is wrong, why the "C-h k"
can give the right description.

Thanks again.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
  2005-12-26 16:51                 ` Stefan Monnier
  2005-12-27 11:40                   ` liaoweijie
@ 2005-12-27 11:51                   ` c.c
  1 sibling, 0 replies; 16+ messages in thread
From: c.c @ 2005-12-27 11:51 UTC (permalink / raw)


Thank you very much.

It's working now. It's wondful!

But I don't know if my define-key sentence is wrong, why the "C-h k"
can give correct  key description for (shift f1).

Thanks again.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to bind (shift Fx) for emacs in putty?
  2005-12-27 11:40                   ` liaoweijie
@ 2005-12-29  3:57                     ` Stefan Monnier
  0 siblings, 0 replies; 16+ messages in thread
From: Stefan Monnier @ 2005-12-29  3:57 UTC (permalink / raw)


> But I don't know if my define-key sentence is wrong, why the "C-h k"
> can give the right description.

Probably some unexpected interaction between various functions.
It should display an error message instead, but it doesn't check for errors.


        Stefan

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2005-12-29  3:57 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-24 16:30 How to bind (shift Fx) for emacs in putty? c.c
2005-12-25 11:49 ` Peter Dyballa
     [not found] ` <mailman.20392.1135512536.20277.help-gnu-emacs@gnu.org>
2005-12-25 12:58   ` c.c
2005-12-25 13:32     ` Peter Dyballa
     [not found]     ` <mailman.20395.1135517652.20277.help-gnu-emacs@gnu.org>
2005-12-25 14:04       ` c.c
2005-12-25 14:51         ` Peter Dyballa
     [not found]         ` <mailman.20398.1135522358.20277.help-gnu-emacs@gnu.org>
2005-12-25 15:33           ` c.c
2005-12-25 17:53             ` Peter Dyballa
     [not found]             ` <mailman.20408.1135533298.20277.help-gnu-emacs@gnu.org>
2005-12-26 12:24               ` c.c
2005-12-26 13:45                 ` Peter Dyballa
2005-12-26 16:51                 ` Stefan Monnier
2005-12-27 11:40                   ` liaoweijie
2005-12-29  3:57                     ` Stefan Monnier
2005-12-27 11:51                   ` c.c
2005-12-26 12:32             ` Slawomir Nowaczyk
2005-12-26 18:49               ` Eli Zaretskii

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).