help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: S-up and emacs -nw?


From: Fredrik Staxeng
Subject: Re: S-up and emacs -nw?
Date: 20 Oct 2002 14:33:58 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2

"Joe Casadonte" <address@hidden> writes:

>Fredrik,
>
>On 19 Oct 2002, Fredrik Staxeng wrote:
>
>> "Joe Casadonte" <address@hidden> 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: address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]