Re: Meta key for 'emacs -nw'

2016-02-07 Thread James Cloos
> "BB" == Bob Bernstein  writes:

BB> ... if I launch 'emacs -nw' to avoid running in X that understanding
BB> (Meta == Alt) evaporates.

That is an issue with your terminal emulator.

What do you see if you, in an emacs -nw session, press: C-q M-x

Xterm's default settings can be a problem for M- keystrokes.

Some other terminals may also have issues.

Also, do M- keys work correctly at the bash prompt?  (Or whichever shell
you use)

A quick test shows that my urxvt translates M-x into C-[ x (aka ESC x),
which allows emacs to handle it.

-JimC
-- 
James Cloos  OpenPGP: 0x997A9F17ED7DAEA6



Re: Meta key for 'emacs -nw'

2016-02-02 Thread Nate Bargmann
* On 2016 01 Feb 21:30 -0600, Nate Bargmann wrote:

> What I've not sat down and figured out is how to use Ctl-Left/Right to
> navigate word left/right but use Alt-B/F instead.  Even Bash will allow
> the Ctl variants.

I think I resolved my Ctrl-arrow keys following this page:

http://www.emacswiki.org/emacs/CuaModeTerminalProblems

Unless one is using an actual Linux VC the keymap information can be
ignored.  I added the stanza at the bottom of that page to my
~/.emacs-mail which is loaded only when calling Emacs from Mutt.  I also
added the TERM type of "screen-256color" to the list of "linux" and
"xterm" so the Ctrl-arrow work through TMUX in Emacs.

While that page is linked from the CUA page:

http://www.emacswiki.org/emacs/CuaMode

it seems independent.  That said, I did enable CUA mode so I get the
familiar cut, copy, paste, undo keys.  However, it appears that Xfce
Terminal (others?) traps the Shift-arrow keys so as to enable
line-by-line scrolling as with the default keymap of the Linux console.

I should have done this long ago.  :-D

- Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://www.n0nb.us



Re: Meta key for 'emacs -nw'

2016-02-02 Thread David Wright
On Tue 02 Feb 2016 at 13:38:26 (-0600), Nate Bargmann wrote:
> * On 2016 01 Feb 21:30 -0600, Nate Bargmann wrote:
> 
> > What I've not sat down and figured out is how to use Ctl-Left/Right to
> > navigate word left/right but use Alt-B/F instead.  Even Bash will allow
> > the Ctl variants.
> 
> I think I resolved my Ctrl-arrow keys following this page:
> 
> http://www.emacswiki.org/emacs/CuaModeTerminalProblems
> 
> Unless one is using an actual Linux VC the keymap information can be
> ignored.

Fair enough. I just want my VC to behave as much like X as I can
manage, and I prefer to configure it system-wide and in the Debian way.

I didn't like the footnote on that page: "I am using the complete
version without problems outside X. But I couldn’t make it work on
xterm with ‘emacs -nw’. But (again), if you are using X, why use
‘-nw’? :)" Waiting for a remote system's window to map is a pain.

> I added the stanza at the bottom of that page to my
> ~/.emacs-mail which is loaded only when calling Emacs from Mutt.  I also
> added the TERM type of "screen-256color" to the list of "linux" and
> "xterm" so the Ctrl-arrow work through TMUX in Emacs.
> 
> While that page is linked from the CUA page:
> 
> http://www.emacswiki.org/emacs/CuaMode
> 
> it seems independent.  That said, I did enable CUA mode so I get the
> familiar cut, copy, paste, undo keys.

I tend to stick with the native behaviour as much as possible;
fewer surprises when you use a different or unconfigured system.

> However, it appears that Xfce
> Terminal (others?) traps the Shift-arrow keys so as to enable
> line-by-line scrolling as with the default keymap of the Linux console.

That's odd. In an xterm, Shift-arrows seem to make/modify the
selection as one might expect.

Cheers,
David.



Re: Meta key for 'emacs -nw'

2016-02-02 Thread Nate Bargmann
* On 2016 02 Feb 18:52 -0600, David Wright wrote:

> I didn't like the footnote on that page: "I am using the complete
> version without problems outside X. But I couldn’t make it work on
> xterm with ‘emacs -nw’. But (again), if you are using X, why use
> ‘-nw’? :)" Waiting for a remote system's window to map is a pain.

I use -nw when called from Mutt in tmux.  Typically that combination is
run in an Xfce Terminal instance.

> That's odd. In an xterm, Shift-arrows seem to make/modify the
> selection as one might expect.

We found that Xfce Terminal also consumes Ctl-PageUp/Down and F11.  I'm
sure they could be disabled but it seems that doing so isn't as simple
as in Gnome Terminal where a single checkbox disabled all short cuts
except Alt-Space which Xfce still consumed.

I may just have to give Xterm a try for this combination and see how I
like it.

- Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://www.n0nb.us



Re: Meta key for 'emacs -nw'

2016-02-02 Thread Stefan Monnier
>> :-)  "There are no dumb questions.  Only dumb answers."
> Okay. Here's one -- I was going to post it in gnu.emacs.help, but you
> changed my mind! Emacs running in X honors Alt as its Meta key. But if
> I launch 'emacs -nw' to avoid running in X that understanding (Meta == Alt)
> evaporates. Perhaps I need to set something specific in my .emacs for
> the minibuffer?

Not really.  Text terminals (e.g. xterm, rxvt, linux console, ...) get
to see your actual key events and transform them into a sequence
of bytes.  The programs that run inside (e.g. bash, Emacs, ...) only get
to see that byte sequence.

That sequence of bytes is not really well defined, for
historical reasons.  So for things like "press the letter t", the
situation is pretty clear, but for "press M-t" it's much less so, not to
mention "press M-C-é" or "move mouse from X,Y to Z,W".

Most like you'll want to tell your text terminal to change the Alt
modifier so that it sends an ESC character (i.e. so Alt-t gets turned
into the sequence of bytes corresponding to the ASCII chars ESC and t).
That's probably the most standard way to deal with this
particular aspect.

For xterm, you set this config the way Don Armstrong showed:

   XTerm*metaSendsEscape: true

in your ~/.Xdefaults or ~/.Xresources.


Stefan



Re: Meta key for 'emacs -nw'

2016-02-02 Thread Bob Bernstein

On Tue, 2 Feb 2016, Stefan Monnier wrote:


For xterm, you set this config the way Don Armstrong showed:

  XTerm*metaSendsEscape: true

in your ~/.Xdefaults or ~/.Xresources.


Bingo. That did it. I could not for money or love recall either 
of those two filenames you so graciously cited. Thanks everyone 
who chimed in, and a tip 'o the hat to Don!


--
Bob Bernstein



Meta key for 'emacs -nw'

2016-02-01 Thread Bob Bernstein

On Tue, 2 Feb 2016, Lisi Reisz wrote:


:-)  "There are no dumb questions.  Only dumb answers."


Okay. Here's one -- I was going to post it in gnu.emacs.help, 
but you changed my mind! Emacs running in X honors Alt as its 
Meta key. But if I launch 'emacs -nw' to avoid running in X that 
understanding (Meta == Alt) evaporates. Perhaps I need to set 
something specific in my .emacs for the minibuffer?


I've got amd64 Jessie running without systemd and icewm for X.

--
Bob Bernstein



Re: Meta key for 'emacs -nw'

2016-02-01 Thread Doug

  
  


On 02/01/2016 09:06 PM, Bob Bernstein
  wrote:

On Tue, 2 Feb 2016, Lisi Reisz wrote:
  
  
  :-)  "There are no dumb questions.  Only
dumb answers."

  
  
  Okay. Here's one -- I was going to post it
in gnu.emacs.help, but you changed my mind! Emacs running in X
honors Alt as its Meta key. But if I launch 'emacs -nw' to avoid
running in X that understanding (Meta == Alt) evaporates.
Perhaps I need to set something specific in my .emacs for the
minibuffer?

  
  I've got amd64 Jessie running without systemd and icewm for X.
  
  

This sounds something like the fellow who told his doctor, "It hurts
when I do this." And the doctor replied, "So don't do that!" 

(sorry) --doug
-- 
Anyone who goes to a psychiatrist ought to have his head examined! --Samuel Goldwyn

  




Re: Meta key for 'emacs -nw'

2016-02-01 Thread Joe Pfeiffer
Bob Bernstein  writes:

> On Tue, 2 Feb 2016, Lisi Reisz wrote:
>
>> :-)  "There are no dumb questions.  Only dumb answers."
>
> Okay. Here's one -- I was going to post it in gnu.emacs.help, but you
> changed my mind! Emacs running in X honors Alt as its Meta key. But if
> I launch 'emacs -nw' to avoid running in X that understanding (Meta ==
> Alt) evaporates. Perhaps I need to set something specific in my .emacs
> for the minibuffer?
>
> I've got amd64 Jessie running without systemd and icewm for X.

I've always used  for  -- you have to press-and-release, not
hold like for  and , but it works for me in a window, with
-nw, and in console mode.  I'd actually been using it for a couple of
decades before I learned about  for , and have never made the
switch.



Re: Meta key for 'emacs -nw'

2016-02-01 Thread Jude DaShiell
That, or use the escape key and it may be possible to restore that key 
binding for when emacs -nw is run so hitting alt works again.


On Mon, 1 Feb 2016, Nate Bargmann wrote:


Date: Mon, 1 Feb 2016 22:28:50
From: Nate Bargmann <n...@n0nb.us>
To: debian-user@lists.debian.org
Subject: Re: Meta key for 'emacs -nw'
Resent-Date: Tue,  2 Feb 2016 03:29:08 + (UTC)
Resent-From: debian-user@lists.debian.org

* On 2016 01 Feb 20:07 -0600, Bob Bernstein wrote:

On Tue, 2 Feb 2016, Lisi Reisz wrote:


:-)  "There are no dumb questions.  Only dumb answers."


Okay. Here's one -- I was going to post it in gnu.emacs.help, but you
changed my mind! Emacs running in X honors Alt as its Meta key. But if I
launch 'emacs -nw' to avoid running in X that understanding (Meta == Alt)
evaporates. Perhaps I need to set something specific in my .emacs for the
minibuffer?

I've got amd64 Jessie running without systemd and icewm for X.


I don't have an answer, however, I am using Emacs -nw to type this
message calling it from Mutt and running in Xfce Terminal and
Alt-X. etc, works just fine.

What I've not sat down and figured out is how to use Ctl-Left/Right to
navigate word left/right but use Alt-B/F instead.  Even Bash will allow
the Ctl variants.

- Nate




--



Re: Meta key for 'emacs -nw'

2016-02-01 Thread Don Armstrong
On Mon, 01 Feb 2016, Bob Bernstein wrote:

> On Tue, 2 Feb 2016, Lisi Reisz wrote:
> 
> >:-)  "There are no dumb questions.  Only dumb answers."
> 
> Okay. Here's one -- I was going to post it in gnu.emacs.help, but you
> changed my mind! Emacs running in X honors Alt as its Meta key. But if I
> launch 'emacs -nw' to avoid running in X that understanding (Meta == Alt)
> evaporates. Perhaps I need to set something specific in my .emacs for the
> minibuffer?

You probably want:

XTerm*metaSendsEscape: true 

or the equivalent in your shell.

-- 
Don Armstrong  http://www.donarmstrong.com




Re: Meta key for 'emacs -nw'

2016-02-01 Thread Nate Bargmann
* On 2016 01 Feb 21:37 -0600, Bob Bernstein wrote:
> On Mon, 1 Feb 2016, Nate Bargmann wrote:
> 
> >...I am using Emacs -nw to type this message calling it from Mutt and
> >running in Xfce Terminal and Alt-X. etc, works just fine.
> 
> Interesting. Hrrrmmm...so perhaps I can set up Alt as Meta in the
> configuration of the terminal I use in X?

Possibly.  In doing some Ncurses development recently I found a range of
keycodes being sent to an application by the various terminals.
Alt-keys seemed to be consistent amongst them except with Xterm.  I left
rxvt alone.  ;-)

As for defining the keys, I shied away once dealing with terminfo was
involved.  I think it would be easier to configure Emacs.  Wouldn't
~/.inputrc be the place to do that?  I haven't looked yet.

- Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://www.n0nb.us



Re: Meta key for 'emacs -nw'

2016-02-01 Thread Doug



On 02/01/2016 10:36 PM, Bob Bernstein wrote:

On Mon, 1 Feb 2016, Nate Bargmann wrote:


...I am using Emacs -nw to type this message calling it from Mutt and running 
in Xfce Terminal and Alt-X. etc, works just fine.


Interesting. Hrrrmmm...so perhaps I can set up Alt as Meta in the configuration 
of the terminal I use in X?


There should be a keyboard setup arrangement somewhere on your system--there is 
in at least some other distros. Then you pick

a key that you want to use as a Compose key, which I _believe_ is the same 
thing as a meta key.  (I don't have Windows keys on my

old IBM keyboards, so I always choose right-alt. If I had Windows keys, I would 
choose right-Win.)

--doug

--
Anyone who goes to a psychiatrist ought to have his head examined! --Samuel 
Goldwyn



Re: Meta key for 'emacs -nw'

2016-02-01 Thread David Wright
On Mon 01 Feb 2016 at 21:28:50 (-0600), Nate Bargmann wrote:
> * On 2016 01 Feb 20:07 -0600, Bob Bernstein wrote:
> > [...] Emacs running in X honors Alt as its Meta key. But if I
> > launch 'emacs -nw' to avoid running in X that understanding (Meta == Alt)
> > evaporates. Perhaps I need to set something specific in my .emacs for the
> > minibuffer?
> > 
> > I've got amd64 Jessie running without systemd and icewm for X.
> 
> I don't have an answer, however, I am using Emacs -nw to type this
> message calling it from Mutt and running in Xfce Terminal and
> Alt-X. etc, works just fine.

I too use emacs -nw from mutt (because mutt is running remotely),
but in xterm, and typing Alt-X gives me the character useful for
typing Tromsø. Not that I'm bothered; I use Esc-X instead.
The Alt- characters (like ñ÷åòôùõéïð) would be more useful if the keys
were appropriately engraved.

> What I've not sat down and figured out is how to use Ctl-Left/Right to
> navigate word left/right but use Alt-B/F instead.  Even Bash will allow
> the Ctl variants.

Let's see...I have the following in /etc/console-setup/remap.inc

# Ctrl-arrow keys need to send the same codes as in X/xterm.
Control keycode 105 = F51
string F51 = "\033[1;5D"
Control keycode 106 = F52
string F52 = "\033[1;5C"
Control keycode 108 = F53
string F53 = "\033[1;5B"
Control keycode 103 = F54
string F54 = "\033[1;5A"

and ~/.inputrc has

set input-meta on
set output-meta on
set convert-meta off
# Ctrl-Right arrow
"\e[1;5C": forward-word
# Ctrl-Left arrow
"\e[1;5D": backward-word

and my emacs startup contains

(global-set-key [?\e left] 'backward-word)
(global-set-key [?\e right] 'forward-word)

That's enough to make Ctrl-Left/Right move by word on the commandline
and in emacs with the exception of emacs -nw in a VC (where it types
5C for example).

If you're tempted to follow suit, note that configuring the keyboard
with /etc/console-setup/remap.inc is a bit fraught. You must run
# dpkg-reconfigure console-setup
# dpkg-reconfigure keyboard-configuration
in a genuine VC without X running at all (getting to a VC from X with
Ctrl-Alt-Fn is not good enough) and /etc/console-setup/remap.inc
must be perfectly formed or strange things may get defined.

Cheers,
David.



Re: Meta key for 'emacs -nw'

2016-02-01 Thread Nate Bargmann
* On 2016 01 Feb 20:07 -0600, Bob Bernstein wrote:
> On Tue, 2 Feb 2016, Lisi Reisz wrote:
> 
> >:-)  "There are no dumb questions.  Only dumb answers."
> 
> Okay. Here's one -- I was going to post it in gnu.emacs.help, but you
> changed my mind! Emacs running in X honors Alt as its Meta key. But if I
> launch 'emacs -nw' to avoid running in X that understanding (Meta == Alt)
> evaporates. Perhaps I need to set something specific in my .emacs for the
> minibuffer?
> 
> I've got amd64 Jessie running without systemd and icewm for X.

I don't have an answer, however, I am using Emacs -nw to type this
message calling it from Mutt and running in Xfce Terminal and
Alt-X. etc, works just fine.

What I've not sat down and figured out is how to use Ctl-Left/Right to
navigate word left/right but use Alt-B/F instead.  Even Bash will allow
the Ctl variants.

- Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://www.n0nb.us



Re: Meta key for 'emacs -nw'

2016-02-01 Thread Bob Bernstein

On Mon, 1 Feb 2016, Nate Bargmann wrote:

...I am using Emacs -nw to type this message calling it from 
Mutt and running in Xfce Terminal and Alt-X. etc, works just 
fine.


Interesting. Hrrrmmm...so perhaps I can set up Alt as Meta in 
the configuration of the terminal I use in X?


--
Bob Bernstein



Alt vs Meta key in Emacs

2002-11-25 Thread Joe Riel
I use a pc104 keyboard, the bottom row looks like the following:

ctrl-L window-L alt-L space alt-R window-R menu-R ctrl-R

Using xmodmap I swapped the ctrl-L key with the caps lock.
In emacs (under X), 
  window-L acts like a meta key, 
  window-R doesn't do anything (using xev it shows up as multi-key)
  alt-L and alt-R do nothing (they act as alt modifier keys, but
that
  does nothing in emacs).
  menu-R behaves as meta-X.

How do I change these keys?  I tried using keysym in xmodmap,
but my first attempt did not work with emacs.  A search of the
emacs info pages, web, and Debian HOWTOs wasn't a lot of help.

I currently would like to have the alt-L and alt-R keys 
act as meta keys in emacs (in the long run it might be better
to have the window keys become meta keys and the alt keys
be a new modifier, however, I'm switching from NTEmacs where
alt is meta and that's what my fingers want to type.)

Thanks for any pointers,

Joe Riel


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




RE: Alt vs Meta key in Emacs

2002-11-25 Thread Charlie Reiman

 -Original Message-
 From: Joe Riel [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 25, 2002 9:28 AM
 To: debian
 Subject: Alt vs Meta key in Emacs


 I use a pc104 keyboard, the bottom row looks like the following:

 ctrl-L window-L alt-L space alt-R window-R menu-R ctrl-R

 Using xmodmap I swapped the ctrl-L key with the caps lock.
 In emacs (under X),
   window-L acts like a meta key,
   window-R doesn't do anything (using xev it shows up as multi-key)
   alt-L and alt-R do nothing (they act as alt modifier keys, but
 that
   does nothing in emacs).
   menu-R behaves as meta-X.

 How do I change these keys?  I tried using keysym in xmodmap,
 but my first attempt did not work with emacs.  A search of the
 emacs info pages, web, and Debian HOWTOs wasn't a lot of help.

 I currently would like to have the alt-L and alt-R keys
 act as meta keys in emacs (in the long run it might be better
 to have the window keys become meta keys and the alt keys
 be a new modifier, however, I'm switching from NTEmacs where
 alt is meta and that's what my fingers want to type.)

 Thanks for any pointers,

 Joe Riel


I got ya covered. Here's my fixkeys script. It lives as a startup script in
.kde/Autostart for me. I agreed that xmodmap leaves a lot to be desired.
Even though I wrote the script below, I'm not entirely sure how it works.

Good luck.

Charlie.

#!/bin/sh
xmodmap - EOF
!
! Maps capslock to control
!
remove Lock = Caps_Lock
keysym Caps_Lock = Control_L
add Control = Control_L
!
! Swap alts with meta
!
remove Mod1 = Alt_L
remove Mod1 = Alt_R
remove Mod4 = Meta_L
keysym Meta_L = Alt_L
keysym Alt_L = Meta_L
keysym Alt_R = Meta_R
add mod1 = Meta_L Meta_R
add mod4 = Alt_L
EOF


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Alt vs Meta key in Emacs

2002-11-25 Thread Vincent Lefevre
On Mon, Nov 25, 2002 at 09:28:25 -0800, Joe Riel wrote:
 I currently would like to have the alt-L and alt-R keys 
 act as meta keys in emacs

These keys should be the mod1 modifiers. The modifiers are given by
xmodmap -pme. You can set them with:

keycode xxx = Alt_L
keycode yyy = Alt_R
clear mod1
add mod1 = Alt_L Alt_R

where xxx and yyy are the keycodes of the keys (given by xev).

Note that with some configuration of xterm, you must have Meta_L
instead of Alt_L.

-- 
Vincent Lefèvre [EMAIL PROTECTED] - Web: http://www.vinc17.org/ - 100%
validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International
des Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




How do I get Meta key for emacs?

1999-09-05 Thread Brian E. Lavender
I am using emacs and I am trying to get the Meta key from Xwindows and the 
terminal. I know
I can issue the command

$ xmodmap -e keysym Alt_L = Meta_L Alt_L

and that will give me the meta key in Xwindows, but not outsite Xwindows. I 
seem to once
running across another way to remap the keyboard.

brian
-- 
Brian Lavender
http://www.brie.com/brian/


meta key in emacs

1998-08-20 Thread Michael Symalla
Dear Debian users,

can anyone help me to let my Alt-key be the metakey in emacs? Now I am
using the ESC key, which works fine but is not as comfortable as the ALT
key.

Thanks a lot.
-- 
Bye
  Mitch


Re: meta key in emacs

1998-08-20 Thread Richard L. Alhama
On Thu, 20 Aug 1998, Michael Symalla wrote:

 Dear Debian users,
 
 can anyone help me to let my Alt-key be the metakey in emacs? Now I am
 using the ESC key, which works fine but is not as comfortable as the ALT
 key.

Install xkeycaps and edit the keyboard layout to your liking.  If you have
an M$ Natural keyboard or similar you can bind the winkey to Meta if you
wish, like me, that's what I did.

Admiral Charah
Tech Support, Cyberspace Laoag, ISP


Re: meta key in emacs

1998-08-20 Thread Jens B. Jorgensen
This problem has come up so many times since hamm started getting used that it 
almost
merits its own HOWTO. What's happened is that you've upgraded X and now you are 
using
the XKEYBOARD extension. As you've noticed, the ALT key now does ALT and the 
windows
key is now the META key. I've argued several times that this is a bug since it 
changes
behavior. Alas no one listens to this raving madman. Where's whatcha do (as 
root):

sed -e 's/Alt_L/Foo_L/' -e 's/Alt_R/Foo_R/'  /usr/lib/X11/xkb/symbols/us |\
sed -e 's/Meta_L/Alt_L/' -e 's/Meta_R/Alt_R/' |\
sed -e 's/Foo_L/Meta_L/' -e 's/Foo_R/Meta_R/'  /usr/lib/X11/xkb/symbols/us.new
mv /usr/lib/X11/xkb/symbols/us /usr/lib/X11/xkb/symbols/us.old
mv /usr/lib/X11/xkb/symbols/us.new /usr/lib/X11/xkb/symbols/us

Now restart X and Things should work normally.

Michael Symalla wrote:

 Dear Debian users,

 can anyone help me to let my Alt-key be the metakey in emacs? Now I am
 using the ESC key, which works fine but is not as comfortable as the ALT
 key.

 Thanks a lot.
 --
 Bye
   Mitch

 --
 Unsubscribe?  mail -s unsubscribe [EMAIL PROTECTED]  /dev/null



--
Jens B. Jorgensen
[EMAIL PROTECTED]