all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* S-up and emacs -nw?
@ 2002-10-13 20:39 Joe Casadonte
  2002-10-13 21:09 ` Stefan Monnier <foo@acm.com>
  0 siblings, 1 reply; 23+ messages in thread
From: Joe Casadonte @ 2002-10-13 20:39 UTC (permalink / raw)



How do I get emacs -nw to recognize a Shift up?  I realize this is
probably more of a termcap question than an emacs one, but I can
barely spell termcap.....

Thanks!

--
Regards,

joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------

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

* Re: S-up and emacs -nw?
  2002-10-13 20:39 S-up and emacs -nw? Joe Casadonte
@ 2002-10-13 21:09 ` Stefan Monnier <foo@acm.com>
  2002-10-14  2:18   ` Joe Casadonte
  0 siblings, 1 reply; 23+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-10-13 21:09 UTC (permalink / raw)


>>>>> "Joe" == Joe Casadonte <jcasadonte@northbound-train.com> writes:
> How do I get emacs -nw to recognize a Shift up?  I realize this is
> probably more of a termcap question than an emacs one, but I can
> barely spell termcap.....

Hit `up' and `S-up' and then `C-h l' which will show you the raw
event sequence that Emacs has seen recently.  If the events sent
for `up' and `S-up' are the same, then Emacs can't help you and
you'll first have to teach your terminal to send different sequences
for those two different cases.
If the sequences are different, then you'll want to add something like

  (define-key function-key-map [?\e ?O ?2 ?A] 'S-up)

which translates `ESC O 2 A' into `S-up'.


        Stefan

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

* Re: S-up and emacs -nw?
  2002-10-13 21:09 ` Stefan Monnier <foo@acm.com>
@ 2002-10-14  2:18   ` Joe Casadonte
  2002-10-14  4:09     ` Stefan Monnier <foo@acm.com>
  2002-10-14 18:47     ` Alex Schroeder
  0 siblings, 2 replies; 23+ messages in thread
From: Joe Casadonte @ 2002-10-14  2:18 UTC (permalink / raw)


On 13 Oct 2002, Stefan Monnier wrote:

>>> "Joe" == Joe Casadonte <jcasadonte@northbound-train.com> writes:
>> How do I get emacs -nw to recognize a Shift up?  I realize this is
>> probably more of a termcap question than an emacs one, but I can
>> barely spell termcap.....
>
> Hit `up' and `S-up' and then `C-h l' which will show you the raw
> event sequence that Emacs has seen recently.  If the events sent for
> `up' and `S-up' are the same, then Emacs can't help you and you'll
> first have to teach your terminal to send different sequences for
> those two different cases.

As I suspected, they are indeed the same.  Can anyone point me in the
direction of some info that will show me how to do this?  Thanks!

--
Regards,

joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------

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

* Re: S-up and emacs -nw?
  2002-10-14  2:18   ` Joe Casadonte
@ 2002-10-14  4:09     ` Stefan Monnier <foo@acm.com>
  2002-10-14  5:49       ` Fredrik Staxeng
  2002-10-14 13:45       ` Joe Casadonte
  2002-10-14 18:47     ` Alex Schroeder
  1 sibling, 2 replies; 23+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-10-14  4:09 UTC (permalink / raw)


>>>>> "Joe" == Joe Casadonte <jcasadonte@northbound-train.com> writes:
> As I suspected, they are indeed the same.  Can anyone point me in the
> direction of some info that will show me how to do this?  Thanks!

It would help if you were a bit more forthcoming with hard-data.
I don't even know what terminal you're using.


        Stefan

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

* Re: S-up and emacs -nw?
  2002-10-14  4:09     ` Stefan Monnier <foo@acm.com>
@ 2002-10-14  5:49       ` Fredrik Staxeng
  2002-10-14 13:45       ` Joe Casadonte
  1 sibling, 0 replies; 23+ messages in thread
From: Fredrik Staxeng @ 2002-10-14  5:49 UTC (permalink / raw)


"Stefan Monnier <foo@acm.com>" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:

>>>>>> "Joe" == Joe Casadonte <jcasadonte@northbound-train.com> writes:
>> As I suspected, they are indeed the same.  Can anyone point me in the
>> direction of some info that will show me how to do this?  Thanks!
>
>It would help if you were a bit more forthcoming with hard-data.
>I don't even know what terminal you're using.
>
>
>        Stefan

If it happens to be xterm, out things like this in .Xdefaults, or wherever
your particular setup keeps X resources:

XTerm*vt100.translations: #override <Key>BackSpace: string(0x7f) \n\
	Shift<Key>Tab: string(0x1b) string([Z) \n\
	<Key>Prior: string(0x1b) string([5~) \n\
	<Key>Next: string(0x1b) string([6~) \n\
	<Key>Home: string(0x1b) string(<) \n\
	<Key>End: string(0x1b) string(>) \n\
	<Key>Delete: string(0x1b) string([3~)

No space after the last backslash, no newline/backslash on the last line,
and no error messages if you spell anything wrong.

-- 
Fredrik Stax\"ang | rot13: sfgk@hcqngr.hh.fr

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

* Re: S-up and emacs -nw?
  2002-10-14  4:09     ` Stefan Monnier <foo@acm.com>
  2002-10-14  5:49       ` Fredrik Staxeng
@ 2002-10-14 13:45       ` Joe Casadonte
  2002-10-14 15:08         ` Ehud Karni
                           ` (4 more replies)
  1 sibling, 5 replies; 23+ messages in thread
From: Joe Casadonte @ 2002-10-14 13:45 UTC (permalink / raw)


On 14 Oct 2002, Stefan Monnier wrote:

> It would help if you were a bit more forthcoming with hard-data.
> I don't even know what terminal you're using.

My apologies.  I'm not at the box, but I tried this with the Debian
console (not sure the default terminal type) and with a cygwin
terminal window.  X is not an option for me; console only.

My cygwin termcap entry reads:

cygwin:\
	:xn@:op=\E[39;49m:Km=\E[M:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:tc=linux:

Which unfortunately means next to nothing to me.  Thanks!

--
Regards,

joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------

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

* Re: S-up and emacs -nw?
  2002-10-14 13:45       ` Joe Casadonte
@ 2002-10-14 15:08         ` Ehud Karni
  2002-10-14 15:34         ` Stefan Monnier <foo@acm.com>
                           ` (3 subsequent siblings)
  4 siblings, 0 replies; 23+ messages in thread
From: Ehud Karni @ 2002-10-14 15:08 UTC (permalink / raw)
  Cc: help-gnu-emacs

On 14 Oct 2002 09:45:19 -0400, Joe Casadonte <jcasadonte@northbound-train.com> wrote:
> 
> My apologies.  I'm not at the box, but I tried this with the Debian
> console (not sure the default terminal type) and with a cygwin
> terminal window.  X is not an option for me; console only.
> 
> My cygwin termcap entry reads:
> 
> cygwin:\
> 	:xn@:op=\E[39;49m:Km=\E[M:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:tc=linux:
> 
> Which unfortunately means next to nothing to me.  Thanks!

Bellow is a fuller cygwin termcap entry. You can also use rxvt (which
is an xterm emulation), it is included with the Cygwin net installer.

I think that the terminal type for the Debian console is `linux' (it
is for the RedHat distribution).  

Of these 3 terminal only `rxvt' generate different keys for the shifted
key (up is \e[A and S-up is \e[a). The termcap entry has the definition
of the up key only. The emacs distributed xterm.el has only the `up' 
key definition but you can define the shifted up like this:
    (define-key function-key-map "\e[a" [S-up])

Ehud.


Ernie Boyd (old, but working) cygwin termcap entry:

# Use this for cygwin (tested with version 1.1.0).
# I've combined pcansi and linux.  Some values of course were different and
# I've indicated which of these were and which I used.
# Cheers, earnie_boyd@yahoo.com
# several changes based on running with tack and comparing with older entry -TD
# (untranslatable capabilities removed to fit entry within 1023 bytes)
# (sgr removed to fit entry within 1023 bytes)
# (acsc removed to fit entry within 1023 bytes)
cygwin|ansi emulation for Cygwin:\
	:am:eo:in:ms:xo:\
	:Co#8:NC#3:co#80:it#8:li#25:pa#64:\
	:&7=^Z:@7=\E[4~:AB=\E[4%dm:AF=\E[3%dm:AL=\E[%dL:DC=\E[%dP:\
	:DL=\E[%dM:F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:\
	:F5=\E[28~:F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:\
	:FA=\E[34~:IC=\E[%d@:S2=\E[11m:S3=\E[10m:al=\E[L:bl=^G:\
	:cb=\E[1K:cd=\E[J:ce=\E[K:ch=\E[%i%dG:cl=\E[H\E[J:\
	:cm=\E[%i%d;%dH:cr=^M:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=\E[B:\
	:ei=\E[4l:ho=\E[H:ic=\E[@:im=\E[4h:k1=\E[[A:k2=\E[[B:\
	:k3=\E[[C:k4=\E[[D:k5=\E[[E:k6=\E[17~:k7=\E[18~:k8=\E[19~:\
	:k9=\E[20~:k;=\E[21~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:\
	:kb=^H:kd=\E[B:kh=\E[1~:kl=\E[D:kr=\E[C:ku=\E[A:le=^H:\
	:md=\E[1m:me=\E[0;10m:mk=\E[8m:mr=\E[7m:nd=\E[C:nw=^M^J:\
	:op=\E[39;49m:r1=\Ec\E]R:rc=\E8:sc=\E7:se=\E[27m:sf=^J:\
	:so=\E[7m:sr=\EM:st=\EH:ta=^I:u6=\E[%i%d;%dR:u7=\E[6n:\
	:u9=\E[c:ue=\E[24m:up=\E[A:us=\E[4m:



-- 
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 mailto:ehud@unix.mvs.co.il                  Better  Safe  Than  Sorry

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

* Re: S-up and emacs -nw?
  2002-10-14 13:45       ` Joe Casadonte
  2002-10-14 15:08         ` Ehud Karni
@ 2002-10-14 15:34         ` Stefan Monnier <foo@acm.com>
  2002-10-14 18:56         ` Fredrik Staxeng
                           ` (2 subsequent siblings)
  4 siblings, 0 replies; 23+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-10-14 15:34 UTC (permalink / raw)


>> It would help if you were a bit more forthcoming with hard-data.
>> I don't even know what terminal you're using.
> My apologies.  I'm not at the box, but I tried this with the Debian
> console (not sure the default terminal type) and with a cygwin
> terminal window.  X is not an option for me; console only.
> My cygwin termcap entry reads:
> cygwin:\
> 	:xn@:op=\E[39;49m:Km=\E[M:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:tc=linux:
> Which unfortunately means next to nothing to me.  Thanks!

Termcap/terminfo is used to describe to Emacs (and other applications) how
the terminal behaves.  In your case, you don't want to describe its behavior
but you want to change it instead.  How to do this changes from one terminal
to the next.  I know how to do it with xterm.

I think `loadkeys' is on the right track as far as the GNU/Linux
console goes.  As for cygwin's terminal, I have no idea.


        Stefan

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

* Re: S-up and emacs -nw?
  2002-10-14  2:18   ` Joe Casadonte
  2002-10-14  4:09     ` Stefan Monnier <foo@acm.com>
@ 2002-10-14 18:47     ` Alex Schroeder
  1 sibling, 0 replies; 23+ messages in thread
From: Alex Schroeder @ 2002-10-14 18:47 UTC (permalink / raw)


"Joe Casadonte" <jcasadonte@northbound-train.com> writes:

> As I suspected, they are indeed the same.  Can anyone point me in the
> direction of some info that will show me how to do this?  Thanks!

http://www.emacswiki.org/cgi-bin/wiki.pl?MissingKeys

Alex.

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

* Re: S-up and emacs -nw?
  2002-10-14 13:45       ` Joe Casadonte
  2002-10-14 15:08         ` Ehud Karni
  2002-10-14 15:34         ` Stefan Monnier <foo@acm.com>
@ 2002-10-14 18:56         ` Fredrik Staxeng
  2002-10-14 20:00         ` Alan Mackenzie
       [not found]         ` <mailman.1034608215.19174.help-gnu-emacs@gnu.org>
  4 siblings, 0 replies; 23+ messages in thread
From: Fredrik Staxeng @ 2002-10-14 18:56 UTC (permalink / raw)


"Joe Casadonte" <jcasadonte@northbound-train.com> writes:

>My cygwin termcap entry reads:
>
>cygwin:\
>	:xn@:op=\E[39;49m:Km=\E[M:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:tc=linux:

The ti/te in that entry makes less, emacs and other termcap using programs
switch buffers, and restore the screen on exit. If that bothers you, 
remove them, so that the termcap entry reads 

cygwin:\
	:xn@:op=\E[39;49m:Km=\E[M:te=:ti=:tc=linux:

But for the shift up question, I don't understand why you would want to
use Emacs under in the cygwin window. There is an NT port of Emacs which 
gives you full access to the keyboard, including all modifier combinations.

If you want to log in to another host, an X server for NT also gives you
full access to the keyboard. Yes, you said you didn't want X, but you
do, really :-)

Terminal emulators are just that, they inherit the limitations of the
keyboard handling of the old terminals they emulate. Some probably
have fully programmable keyboard handling, and could be made to do what 
you want. 

-- 
Fredrik Stax\"ang | rot13: sfgk@hcqngr.hh.fr

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

* Re: S-up and emacs -nw?
  2002-10-14 13:45       ` Joe Casadonte
                           ` (2 preceding siblings ...)
  2002-10-14 18:56         ` Fredrik Staxeng
@ 2002-10-14 20:00         ` Alan Mackenzie
       [not found]         ` <mailman.1034608215.19174.help-gnu-emacs@gnu.org>
  4 siblings, 0 replies; 23+ messages in thread
From: Alan Mackenzie @ 2002-10-14 20:00 UTC (permalink / raw)


Joe Casadonte <jcasadonte@northbound-train.com> wrote on 14 Oct 2002
09:45:19 -0400:
> On 14 Oct 2002, Stefan Monnier wrote:

>> It would help if you were a bit more forthcoming with hard-data.
>> I don't even know what terminal you're using.

> My apologies.  I'm not at the box, but I tried this with the Debian
> console (not sure the default terminal type) and with a cygwin
> terminal window.  X is not an option for me; console only.

Not sure this is entirely right, but try
<http://stekt.oulu.fi/~tosi/kbd>, Kalle Niemitalo's complete solution for
mapping Ctrl/Alt/Shift-<not-alphanumeric> keys on the Linux console.  It
works for me!

> Joe Casadonte

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

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

* Re: S-up and emacs -nw?
       [not found]         ` <mailman.1034608215.19174.help-gnu-emacs@gnu.org>
@ 2002-10-19 13:05           ` Joe Casadonte
  2002-10-19 16:44             ` Fredrik Staxeng
  2002-10-21 13:22             ` Stefan Monnier <foo@acm.com>
  0 siblings, 2 replies; 23+ messages in thread
From: Joe Casadonte @ 2002-10-19 13:05 UTC (permalink / raw)


On 14 Oct 2002, Stefan Monnier wrote:

> Termcap/terminfo is used to describe to Emacs (and other
> applications) how the terminal behaves.  In your case, you don't
> want to describe its behavior but you want to change it instead.
> How to do this changes from one terminal to the next.  I know how to
> do it with xterm.
>
> I think `loadkeys' is on the right track as far as the GNU/Linux
> console goes.  As for cygwin's terminal, I have no idea.

I think I need more help than I'll find in an Emacs group for this
one, but I honestly don't know where to look for the answers.  I'm
gonna ask some dumb questions instead; pointers as to where to look
are appreciated.

1) I ultimately want to run this on a laptop running Debian, with no X
   support (I only have 24 meg of memory and 100 meg of hard drive
   space left).  Is there a better terminal type than 'linux' to use?
   Can I just arbitrarily reset the terminal type?

2) What's the relationship between terminal type, loadkey/keymap,
   and termcap/terminfo?  Does changing the terminal type change the
   underlying keymap, or just how the keymap is interpreted?  Can I
   change the keymap and expect whatever program is running to
   suddenly be able to generate those sequences?  I would think not,
   since I can't seem to figure out how to generate C-f11 for example.

3) Emacs under Debian uses terminfo -- can I make it use termcap
   instead?  Do I want to?  Termcap seems to have more terminal types
   defined, at least on my system.

4) I'm used to using NTEmacs, and my keybindings are very influenced
   by the fact that S-f4 produces S-f4 and not f16, and C-f9 produces
   C-f9 and not nothing.  Do I have a reasonable chance in hell of
   getting the linux console to generate the same keystrokes?  I have
   a LOT of functions bound to the combinations of C- M- and S- with
   the function keys 1-12 (i.e. standard PC keyboard).  It would
   really suck to lose all of that.

I guess I've got to start looking into ways to get Win95 back on the
laptop.  Oh my, I can't believe I just typed that.....

--
Regards,

joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------

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

* Re: S-up and emacs -nw?
  2002-10-19 13:05           ` Joe Casadonte
@ 2002-10-19 16:44             ` Fredrik Staxeng
  2002-10-19 21:03               ` Joe Casadonte
  2002-10-21 13:22             ` Stefan Monnier <foo@acm.com>
  1 sibling, 1 reply; 23+ messages in thread
From: Fredrik Staxeng @ 2002-10-19 16:44 UTC (permalink / raw)


"Joe Casadonte" <jcasadonte@northbound-train.com> writes:

>1) I ultimately want to run this on a laptop running Debian, with no X
>   support (I only have 24 meg of memory and 100 meg of hard drive
>   space left).  Is there a better terminal type than 'linux' to use?
>   Can I just arbitrarily reset the terminal type?

24 megs used to be plenty for X + twm + xterm + Emacs, but perhaps not 
anymore. But anyway, just resetting the terminal type will not do any 
good.

>2) What's the relationship between terminal type, loadkey/keymap,
>   and termcap/terminfo?  Does changing the terminal type change the
>   underlying keymap, or just how the keymap is interpreted?  Can I
>   change the keymap and expect whatever program is running to
>   suddenly be able to generate those sequences?  I would think not,
>   since I can't seem to figure out how to generate C-f11 for example.

The terminal type says which termcap/terminfo entry to use. The terminfo
entry describes what the terminal does. What you want to do is to extend
what the terminal does, and loadkeys might be able to do what you want.
You need to assign distinct sequences to all combinations that you
want to be distinct. E.g. Shift-Up needs to be distinct from
Up. 

Then you need to tell Emacs how to interpret your new sequences.

>
>3) Emacs under Debian uses terminfo -- can I make it use termcap
>   instead?  Do I want to?  Termcap seems to have more terminal types
>   defined, at least on my system.

This is of no use since the best entry for you to use is still linux.

>4) I'm used to using NTEmacs, and my keybindings are very influenced
>   by the fact that S-f4 produces S-f4 and not f16, and C-f9 produces
>   C-f9 and not nothing.  Do I have a reasonable chance in hell of
>   getting the linux console to generate the same keystrokes?  I have
>   a LOT of functions bound to the combinations of C- M- and S- with
>   the function keys 1-12 (i.e. standard PC keyboard).  It would
>   really suck to lose all of that.

I don't think it's that hard. From looking at the defkeymap.gz somewhere
under /usr/share/keymaps, it seems that loadkeys should be able to
do what you want. There is a layer of indirection, so you need to
define a string, say

string CF11 = "\033[21;1~"
                       
and then refer to it in the map part

control keycode  87 = CF11 

>I guess I've got to start looking into ways to get Win95 back on the
>laptop.  Oh my, I can't believe I just typed that.....

If you just want to run Emacs, I think that Debian is the easiest way to
go. But don't waste time on cygwin then.


-- 
Fredrik Stax\"ang | rot13: sfgk@hcqngr.hh.fr

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

* Re: S-up and emacs -nw?
  2002-10-19 16:44             ` Fredrik Staxeng
@ 2002-10-19 21:03               ` Joe Casadonte
  2002-10-20 12:33                 ` Fredrik Staxeng
  0 siblings, 1 reply; 23+ messages in thread
From: Joe Casadonte @ 2002-10-19 21:03 UTC (permalink / raw)


Fredrik,

On 19 Oct 2002, Fredrik Staxeng wrote:

> "Joe Casadonte" <jcasadonte@northbound-train.com> writes:
>
>>1) I ultimately want to run this on a laptop running Debian, with no
>>   X support (I only have 24 meg of memory and 100 meg of hard drive
>>   space left).  Is there a better terminal type than 'linux' to
>>   use?  Can I just arbitrarily reset the terminal type?
>
> 24 megs used to be plenty for X + twm + xterm + Emacs, but perhaps
> not anymore. But anyway, just resetting the terminal type will not
> do any good.

I saw somewhere, and I can't find it now, that console was OK with 12
or 16 Meg of RAM, and X wanted 128!  I can't find that at the moment.
Maybe that is the best thing to do -- I'll have to find some more disk
space, though.

> The terminal type says which termcap/terminfo entry to use. The
> terminfo entry describes what the terminal does. What you want to do
> is to extend what the terminal does, and loadkeys might be able to
> do what you want.

This is what's confusing to me.  I thought loadkeys would change
things at the kernel level, to then be interpreted at the terminfo
level?  Something like:

1. Keyboard (raw keycode/scancode type stuff)
2. Kernel (loadkeys can affect this)
3. Terminfo/ncurses
4. Emacs (linking in via ncurses)

If that's the correct hierarchy, I'm not sure what the relationship is
between 2 & 3.  Does terminfo interpret <ESC>[A as UP, or does the
kernel do that and just pass UP to terminfo?  Or is terminfo more used
for things like how to clear the screen and such?

Assuming there's some kind of shared relationship between the kernel
and terminfo, do I need to change both layers?  Change the kernel via
loadkeys and then adapt my own terminal type?

> You need to assign distinct sequences to all combinations that you
> want to be distinct. E.g. Shift-Up needs to be distinct from Up.
>
> Then you need to tell Emacs how to interpret your new sequences.

OK, I start up emacs and type a shift F4.  It tells me that <f14> is
undefined.  I do a C-h l (view-lossage) and I see:

C-h k ESC [ 2 6 ~ C-h l

So who interpreted <ESC>[26~ as <f14>?  Emacs??

>>3) Emacs under Debian uses terminfo -- can I make it use termcap
>>   instead?  Do I want to?  Termcap seems to have more terminal
>>   types defined, at least on my system.
>
> This is of no use since the best entry for you to use is still
> linux.

Yeah, after reading some more, I pretty much came to this conclusion.

>>4) I'm used to using NTEmacs, and my keybindings are very influenced
>>   by the fact that S-f4 produces S-f4 and not f16, and C-f9
>>   produces C-f9 and not nothing.  Do I have a reasonable chance in
>>   hell of getting the linux console to generate the same
>>   keystrokes?  I have a LOT of functions bound to the combinations
>>   of C- M- and S- with the function keys 1-12 (i.e. standard PC
>>   keyboard).  It would really suck to lose all of that.
>
> I don't think it's that hard. From looking at the defkeymap.gz
> somewhere under /usr/share/keymaps, it seems that loadkeys should be
> able to do what you want. There is a layer of indirection, so you
> need to define a string, say
>
> string CF11 = "\033[21;1~"
>
> and then refer to it in the map part
>
> control keycode  87 = CF11

I pretty much did that and it didn't work.  It didn't like CF11 (I
used SF4, but you get what I'm saying) no matter where I defined it
(i.e. before or after it's referenced, after being how the default
stuff was done).  So I used something like F104, and it still did not
affect anything.  That's when I started wondering if I need to change
both the kernel layer and the terminfo layer.

>>I guess I've got to start looking into ways to get Win95 back on the
>>laptop.  Oh my, I can't believe I just typed that.....
>
> If you just want to run Emacs, I think that Debian is the easiest
> way to go. But don't waste time on cygwin then.

Cygwin's just a red herring in all of this.  I just find it easier to
type at my PC than on my laptop, and since I have a choice at the
moment, it's what I was doing.  Nothing's been effective, either via
cygwin or on the console itself.

So, though my end objective is to use this for emacs, I am straying
way, way off-topic.  Is there a better forum that I should be posting
to?  Thanks very much to everyone so far for all of their help.  I'm
certainly learning more about this than I had wanted to.....

--
Regards,

joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------

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

* Re: S-up and emacs -nw?
  2002-10-19 21:03               ` Joe Casadonte
@ 2002-10-20 12:33                 ` Fredrik Staxeng
  2002-10-20 15:08                   ` ken
  2002-10-20 16:01                   ` Joe Casadonte
  0 siblings, 2 replies; 23+ messages in thread
From: Fredrik Staxeng @ 2002-10-20 12:33 UTC (permalink / raw)


"Joe Casadonte" <jcasadonte@northbound-train.com> writes:

>Fredrik,
>
>On 19 Oct 2002, Fredrik Staxeng wrote:
>
>> "Joe Casadonte" <jcasadonte@northbound-train.com> writes:
>>
>>>1) I ultimately want to run this on a laptop running Debian, with no
>>>   X support (I only have 24 meg of memory and 100 meg of hard drive
>>>   space left).  Is there a better terminal type than 'linux' to
>>>   use?  Can I just arbitrarily reset the terminal type?
>>
>> 24 megs used to be plenty for X + twm + xterm + Emacs, but perhaps
>> not anymore. But anyway, just resetting the terminal type will not
>> do any good.
>
>I saw somewhere, and I can't find it now, that console was OK with 12
>or 16 Meg of RAM, and X wanted 128!  I can't find that at the moment.
>Maybe that is the best thing to do -- I'll have to find some more disk
>space, though.

Software automagically expands, so it might be hard to fit the above into 
24 MByte today. I have 24 MByte laptop sitting on my shelf that I used
to run RedHat on. Version 4.2 I believe. Don't enven try with Gnome/KDE.

>> The terminal type says which termcap/terminfo entry to use. The
>> terminfo entry describes what the terminal does. What you want to do
>> is to extend what the terminal does, and loadkeys might be able to
>> do what you want.
>
>This is what's confusing to me.  I thought loadkeys would change
>things at the kernel level, to then be interpreted at the terminfo
>level?  Something like:
>
>1. Keyboard (raw keycode/scancode type stuff)

Hardware. Ban't be changed without soldering.

>2. Kernel (loadkeys can affect this)

Correct.

>3. Terminfo/ncurses

Terminfo is the database of terminal descriptions. ncurses is a library
that many programs, but not Emacs, use for terminal handling.

>4. Emacs (linking in via ncurses)

Emacs only uses ncurses to read the terminfo entry. The ncurses 
programming model does not allow for the Emacs user interface,
and besides, Emacs does those things better than ncurses do.

>If that's the correct hierarchy, I'm not sure what the relationship is
>between 2 & 3.  Does terminfo interpret <ESC>[A as UP, or does the
>kernel do that and just pass UP to terminfo?  Or is terminfo more used
>for things like how to clear the screen and such?

ncurses or Emacs interprets the key sequences.

>Assuming there's some kind of shared relationship between the kernel
>and terminfo, do I need to change both layers?  Change the kernel via
>loadkeys and then adapt my own terminal type?

You just need to do loadkeys, and then tell Emacs about it.

>> You need to assign distinct sequences to all combinations that you
>> want to be distinct. E.g. Shift-Up needs to be distinct from Up.
>>
>> Then you need to tell Emacs how to interpret your new sequences.
>
>OK, I start up emacs and type a shift F4.  It tells me that <f14> is
>undefined.  I do a C-h l (view-lossage) and I see:

Then your are halfway there. Now you just need to assign a function
to f14. Use define-key or global-set-key as appropriate. They
keys that Emacs does not see at all, or see as another key, need
to be changed using loadkeys.

>C-h k ESC [ 2 6 ~ C-h l
>
>So who interpreted <ESC>[26~ as <f14>?  Emacs??

Yes.


-- 
Fredrik Stax\"ang | rot13: sfgk@hcqngr.hh.fr

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

* Re: S-up and emacs -nw?
  2002-10-20 12:33                 ` Fredrik Staxeng
@ 2002-10-20 15:08                   ` ken
  2002-10-20 16:01                   ` Joe Casadonte
  1 sibling, 0 replies; 23+ messages in thread
From: ken @ 2002-10-20 15:08 UTC (permalink / raw)
  Cc: help-gnu-emacs


Spake Fredrik Staxeng at 14:33 (UTC+0200) on 20 Oct 2002:

= "Joe Casadonte" <jcasadonte@northbound-train.com> writes:
= 
= >Fredrik,
= >
= >On 19 Oct 2002, Fredrik Staxeng wrote:
= >
= >> "Joe Casadonte" <jcasadonte@northbound-train.com> writes:
= >>
= >>>1) I ultimately want to run this on a laptop running Debian, with no
= >>>   X support (I only have 24 meg of memory and 100 meg of hard drive
= >>>   space left).  Is there a better terminal type than 'linux' to
= >>>   use?  Can I just arbitrarily reset the terminal type?
= >>
= >> 24 megs used to be plenty for X + twm + xterm + Emacs, but perhaps
= >> not anymore. But anyway, just resetting the terminal type will not
= >> do any good.
= >
= >I saw somewhere, and I can't find it now, that console was OK with 12
= >or 16 Meg of RAM, and X wanted 128!  I can't find that at the moment.
= >Maybe that is the best thing to do -- I'll have to find some more disk
= >space, though.

Many years ago I ran Slackware on a 486 with 16M of RAM, including X and
fvwm.  Just recently I set up a RH7.2 box running X, fvwm2, apache,
Twiki, and other, more standard services with just 64M of RAM.


= ...


-- 
AMD crashes?  See http://cleveland.lug.net/~ken/amd-problem/.

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

* Re: S-up and emacs -nw?
  2002-10-20 12:33                 ` Fredrik Staxeng
  2002-10-20 15:08                   ` ken
@ 2002-10-20 16:01                   ` Joe Casadonte
  2002-10-20 17:10                     ` Fredrik Staxeng
  1 sibling, 1 reply; 23+ messages in thread
From: Joe Casadonte @ 2002-10-20 16:01 UTC (permalink / raw)


Fredrik,

On 20 Oct 2002, Fredrik Staxeng wrote:

> Then your are halfway there. Now you just need to assign a function
> to f14. Use define-key or global-set-key as appropriate. They
> keys that Emacs does not see at all, or see as another key, need
> to be changed using loadkeys.

I'm almost there.  If:

1) the kernel knows that UP is "<ESC>[A"
2) I teach the kernel (via loadkeys) that Shift-Up is "<ESC>[a"
3) Emacs knows that <up> is bound to `previous-line-nomark' and
   <S-up> is bound to `previous-line-mark'

How do I get Emacs to recognize "<ESC>[a" as <S-up>, so that I don't
have to do some crazy conditional keybindings?  Should I use
`keyboard-translate' for that?  If so, how would I represent "<ESC>[a"
as a character?

Thanks again for taking the time to answer my questions!

--
Regards,

joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------

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

* Re: S-up and emacs -nw?
  2002-10-20 16:01                   ` Joe Casadonte
@ 2002-10-20 17:10                     ` Fredrik Staxeng
  2002-10-21  0:24                       ` Joe Casadonte
  2002-10-21 22:01                       ` Alan Mackenzie
  0 siblings, 2 replies; 23+ messages in thread
From: Fredrik Staxeng @ 2002-10-20 17:10 UTC (permalink / raw)


"Joe Casadonte" <jcasadonte@northbound-train.com> writes:

>Fredrik,
>
>On 20 Oct 2002, Fredrik Staxeng wrote:
>
>> Then your are halfway there. Now you just need to assign a function
>> to f14. Use define-key or global-set-key as appropriate. They
>> keys that Emacs does not see at all, or see as another key, need
>> to be changed using loadkeys.
>
>I'm almost there.  If:
>
>1) the kernel knows that UP is "<ESC>[A"
>2) I teach the kernel (via loadkeys) that Shift-Up is "<ESC>[a"
>3) Emacs knows that <up> is bound to `previous-line-nomark' and
>   <S-up> is bound to `previous-line-mark'
>
>How do I get Emacs to recognize "<ESC>[a" as <S-up>, so that I don't
>have to do some crazy conditional keybindings?  Should I use
>`keyboard-translate' for that?  If so, how would I represent "<ESC>[a"
>as a character?

Crazy conditional keybindings is probably an equivalent amount of work,
unless you need to do mode-specific bindings. But the see the files
in the subdirectory term of your lisp directory. It seems
that you can do things like 

(define-key function-key-map "\e[161q" [S-up])

If you run debian, you need to install the emacs21-el package to get 
the lisp source files.

There seems to be a sizeable number of people still running in tty 
mode. I guess about 1% of those run on actual terminals, the rest
are runnning various terminal emulators. 

-- 
Fredrik Stax\"ang | rot13: sfgk@hcqngr.hh.fr

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

* Re: S-up and emacs -nw?
  2002-10-20 17:10                     ` Fredrik Staxeng
@ 2002-10-21  0:24                       ` Joe Casadonte
  2002-10-21 22:01                       ` Alan Mackenzie
  1 sibling, 0 replies; 23+ messages in thread
From: Joe Casadonte @ 2002-10-21  0:24 UTC (permalink / raw)


On 20 Oct 2002, Fredrik Staxeng wrote:

> Crazy conditional keybindings is probably an equivalent amount of
> work, unless you need to do mode-specific bindings.

I do, and if I add a 3rd terminal type, things might get even more
complex.  If I do it this way, it's all localized....

> But the see the files in the subdirectory term of your lisp
> directory. It seems that you can do things like
>
> (define-key function-key-map "\e[161q" [S-up])

Wow, I obviously didn't know you could bind to another key.  This
conversation would have been much shorter had I known that :)

> There seems to be a sizeable number of people still running in tty
> mode. I guess about 1% of those run on actual terminals, the rest
> are runnning various terminal emulators.

Once I get a decent pair of keymaps done (kernel and emacs), I'll post
them (to g.e.sources?).  Maybe my pain can help someone else.

Thanks to everyone who helped me out, and Fredrik most of all!

--
Regards,

joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------

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

* Re: S-up and emacs -nw?
  2002-10-19 13:05           ` Joe Casadonte
  2002-10-19 16:44             ` Fredrik Staxeng
@ 2002-10-21 13:22             ` Stefan Monnier <foo@acm.com>
  1 sibling, 0 replies; 23+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-10-21 13:22 UTC (permalink / raw)


>>>>> "Joe" == Joe Casadonte <jcasadonte@northbound-train.com> writes:
> 2) What's the relationship between terminal type, loadkey/keymap,
>    and termcap/terminfo?

The terminfo data tells the application what code to send to display
what it wants (i.e. how to clear the screen, how to advance by one char,
...) as well as what the terminal sends for some special keys.
This second part only covers a few "standard" keys but not all.
So the terminal might be able to generate some key-codes which the
application will not understand (at least not by looking at terminfo).
In the case of Emacs, you can tell it what those codes mean via
function-key-map which is initialized based on the terminfo database.

>    change the keymap and expect whatever program is running to
>    suddenly be able to generate those sequences?

The program does not generate those sequences, it only receives them
and has to interpret them.  You hit a key -> the terminal
emulator (in your case it's mostly all in the Linux kernel) notices it
-> looks up the keymap you've defined via loadkeys to know which
byte-sequence to use for it -> and sends to the application the
corresponding byte-sequence.

I.e. you need to invent unused byte-sequences for each new key you want to
handle, and then tell loadkeys how to map the key to the byte-sequence and
tell Emacs's function-key-map how to map the byte-sequence back to the key.


        Stefan

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

* Re: S-up and emacs -nw?
  2002-10-20 17:10                     ` Fredrik Staxeng
  2002-10-21  0:24                       ` Joe Casadonte
@ 2002-10-21 22:01                       ` Alan Mackenzie
  2002-10-22  7:12                         ` Fredrik Staxeng
  1 sibling, 1 reply; 23+ messages in thread
From: Alan Mackenzie @ 2002-10-21 22:01 UTC (permalink / raw)


Fredrik Staxeng <fstx+u@update.uu.se> wrote on 20 Oct 2002 19:10:10 +0200:

> There seems to be a sizeable number of people still running in tty
> mode. I guess about 1% of those run on actual terminals, the rest are
> runnning various terminal emulators. 

I'm one of these people who use an actual terminal (a Linux tty), and I
do so by choice.  Long may that choice continue!  X (even under
ratpoison) has too many garish distractions for my tastes.  I saw a
survey somewhere (it was referred to from somewhere in
<http://www.heisse.de/> that of free software developers, 8% use a text
console (as opposed to a GUI).

> -- 
> Fredrik Stax\"ang | rot13: sfgk@hcqngr.hh.fr

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

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

* Re: S-up and emacs -nw?
  2002-10-21 22:01                       ` Alan Mackenzie
@ 2002-10-22  7:12                         ` Fredrik Staxeng
  2002-10-22 18:58                           ` Alan Mackenzie
  0 siblings, 1 reply; 23+ messages in thread
From: Fredrik Staxeng @ 2002-10-22  7:12 UTC (permalink / raw)


Alan Mackenzie<none@example.invalid> writes:

>Fredrik Staxeng <fstx+u@update.uu.se> wrote on 20 Oct 2002 19:10:10 +0200:
>
>> There seems to be a sizeable number of people still running in tty
>> mode. I guess about 1% of those run on actual terminals, the rest are
>> runnning various terminal emulators. 
>
>I'm one of these people who use an actual terminal (a Linux tty), and I
                                    ^^^^^^^^^^^^^^^  ^^^^^^^^^^^

I assume you mean that you run on the Linux console. That is not what I
mean with an actual terminal, rather it is an example of a terminal
emulator.

The relevant difference for the topic of this thread is that emulators
can be enhanced to send bucky bits for functions keys. Given that
some people still run in tty mode, perhaps it would be I good idea
to implement this so that it works by default.

I have used actual terminals for several years, and as soon as had the
opportunity I switched to X. That was on a 20MHz 386 with 4MBytes of
memory with an unaccelerated VGA card in 640x480. I am definitely the
wrong person to try to convince about the virtues of text mode.

-- 
Fredrik Stax\"ang | rot13: sfgk@hcqngr.hh.fr

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

* Re: S-up and emacs -nw?
  2002-10-22  7:12                         ` Fredrik Staxeng
@ 2002-10-22 18:58                           ` Alan Mackenzie
  0 siblings, 0 replies; 23+ messages in thread
From: Alan Mackenzie @ 2002-10-22 18:58 UTC (permalink / raw)


Fredrik Staxeng <fstx+u@update.uu.se> wrote on 22 Oct 2002 09:12:10 +0200:
> Alan Mackenzie<none@example.invalid> writes:

>>Fredrik Staxeng <fstx+u@update.uu.se> wrote on 20 Oct 2002 19:10:10 +0200:

>>> There seems to be a sizeable number of people still running in tty
>>> mode. I guess about 1% of those run on actual terminals, the rest are
>>> runnning various terminal emulators. 

>>I'm one of these people who use an actual terminal (a Linux tty), and I
>                                    ^^^^^^^^^^^^^^^  ^^^^^^^^^^^

> I assume you mean that you run on the Linux console. That is not what I
> mean with an actual terminal, rather it is an example of a terminal
> emulator.

OK.  Thanks for the elucidation.  I thought you meant an xterm under X.

> The relevant difference for the topic of this thread is that emulators
> can be enhanced to send bucky bits for function keys. Given that some
> people still run in tty mode, perhaps it would be a good idea to
> implement this so that it works by default.

Indeed so.

> I have used actual terminals for several years, and as soon as had the
> opportunity I switched to X. That was on a 20MHz 386 with 4MBytes of
> memory with an unaccelerated VGA card in 640x480. I am definitely the
> wrong person to try to convince about the virtues of text mode.

Wouldn't dream of it!  I'm kind of more trying to persuade developers
whose attitude is "now we've 'upgraded' to X (or Windows NT or whatever)
we can forget about this silly console support, because nobody'll want it
anyway.".  Thankfully, that attitude is absent amongst the GNU Emacs
developers.  :-)

> -- 
> Fredrik Stax\"ang | rot13: sfgk@hcqngr.hh.fr

Who'd've thought Sweeden and France were so closely related?  :-)

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

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

end of thread, other threads:[~2002-10-22 18:58 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-13 20:39 S-up and emacs -nw? Joe Casadonte
2002-10-13 21:09 ` Stefan Monnier <foo@acm.com>
2002-10-14  2:18   ` Joe Casadonte
2002-10-14  4:09     ` Stefan Monnier <foo@acm.com>
2002-10-14  5:49       ` Fredrik Staxeng
2002-10-14 13:45       ` Joe Casadonte
2002-10-14 15:08         ` Ehud Karni
2002-10-14 15:34         ` Stefan Monnier <foo@acm.com>
2002-10-14 18:56         ` Fredrik Staxeng
2002-10-14 20:00         ` Alan Mackenzie
     [not found]         ` <mailman.1034608215.19174.help-gnu-emacs@gnu.org>
2002-10-19 13:05           ` Joe Casadonte
2002-10-19 16:44             ` Fredrik Staxeng
2002-10-19 21:03               ` Joe Casadonte
2002-10-20 12:33                 ` Fredrik Staxeng
2002-10-20 15:08                   ` ken
2002-10-20 16:01                   ` Joe Casadonte
2002-10-20 17:10                     ` Fredrik Staxeng
2002-10-21  0:24                       ` Joe Casadonte
2002-10-21 22:01                       ` Alan Mackenzie
2002-10-22  7:12                         ` Fredrik Staxeng
2002-10-22 18:58                           ` Alan Mackenzie
2002-10-21 13:22             ` Stefan Monnier <foo@acm.com>
2002-10-14 18:47     ` Alex Schroeder

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.