unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Switch Meta and Alt modifiers
       [not found] <vafzo3na09i.fsf@INBOX.auto.emacs.devel.tok.lucy.cs.uni-dortmund.de>
@ 2002-02-14 10:09 ` Kai Großjohann
  2002-02-14 12:30   ` Andreas Schwab
  2002-02-15  9:38 ` Kai Großjohann
  1 sibling, 1 reply; 20+ messages in thread
From: Kai Großjohann @ 2002-02-14 10:09 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

Here is a new version, incorporating a suggestion from Stefan
Monnier.  I have made an entry in etc/NEWS.

Should I use "unsigned int" or "EMACS_UINT"?

Opinions?

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: core --]
[-- Type: text/x-patch, Size: 7729 bytes --]

Index: etc/NEWS
===================================================================
RCS file: /cvsroot/emacs/emacs/etc/NEWS,v
retrieving revision 1.597
diff -u -r1.597 NEWS
--- etc/NEWS	12 Feb 2002 18:58:21 -0000	1.597
+++ etc/NEWS	14 Feb 2002 10:07:23 -0000
@@ -240,9 +240,12 @@
 example, if you set `jit-lock-defer-time' to 0.25, fontification will
 only happen after 0.25s of idle time.
 
-** If you hit M-C-SPC (mark-sexp) repeatedly, the marked region
-will now be extended each time, so you can mark the next two sexps with
-M-C-SPC M-C-SPC, for example.
+** Marking commands extend the region when invoked multiple times.  If
+you hit M-C-SPC (mark-sexp), M-@ (mark-word), M-h (mark-paragraph), or
+C-M-h (mark-defun) repeatedly, the marked region will now be extended
+each time, so you can mark the next two sexps with M-C-SPC M-C-SPC,
+for example.  This feature also works for mark-end-of-sentence, if you
+bind that to a key.
 
 ** In the *Occur* buffer, `o' switches to it in another window, and
 C-o displays the current line's occurrence in another window without
@@ -386,6 +389,14 @@
 The new variable `w32-pass-extra-mouse-buttons-to-system' controls
 whether Emacs should handle the extra buttons itself (the default), or
 pass them to Windows to be handled with system-wide functions.
+
+** Under X11, it is possible to swap Alt and Meta (and Super and Hyper).
+The new variables `x-alt-keysym', `x-hyper-keysym', `x-meta-keysym',
+and `x-super-keysym' can be used to choose which keysyms Emacs should
+use for the modifiers.  For example, the following two lines swap
+Meta and Alt:
+    (setq x-alt-keysym 'meta)
+    (setq x-meta-keysym 'alt)
 
 ---
 ** A French translation of the `Emacs Survival Guide' is available.
Index: src/xterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xterm.c,v
retrieving revision 1.703
diff -u -r1.703 xterm.c
--- src/xterm.c	27 Jan 2002 16:43:36 -0000	1.703
+++ src/xterm.c	14 Feb 2002 10:07:24 -0000
@@ -381,6 +381,14 @@
 
 extern int extra_keyboard_modifiers;
 
+/* The keysyms to use for the various modifiers.  */
+
+unsigned int Vx_alt_keysym;
+unsigned int Vx_hyper_keysym;
+unsigned int Vx_meta_keysym;
+unsigned int Vx_super_keysym;
+static Lisp_Object Qalt, Qhyper, Qmeta, Qsuper, Qmodifier_value;
+
 static Lisp_Object Qvendor_specific_keysyms;
 
 extern XrmDatabase x_load_resources P_ ((Display *, char *, char *, char *));
@@ -6422,12 +6430,28 @@
      struct x_display_info *dpyinfo;
      unsigned int state;
 {
+  unsigned int mod_meta = meta_modifier;
+  unsigned int mod_alt  = alt_modifier;
+  unsigned int mod_hyper = hyper_modifier;
+  unsigned int mod_super = super_modifier;
+  EMACS_UINT tem;
+  
+  tem = Fget (Vx_alt_keysym, Qmodifier_value);
+  if (! EQ (tem, Qnil)) mod_alt = XUINT (tem);
+  tem = Fget (Vx_meta_keysym, Qmodifier_value);
+  if (! EQ (tem, Qnil)) mod_meta = XUINT (tem);
+  tem = Fget (Vx_hyper_keysym, Qmodifier_value);
+  if (! EQ (tem, Qnil)) mod_hyper = XUINT (tem);
+  tem = Fget (Vx_super_keysym, Qmodifier_value);
+  if (! EQ (tem, Qnil)) mod_super = XUINT (tem);
+  
+
   return (  ((state & (ShiftMask | dpyinfo->shift_lock_mask)) ? shift_modifier : 0)
-	  | ((state & ControlMask)	       ? ctrl_modifier  : 0)
-	  | ((state & dpyinfo->meta_mod_mask)  ? meta_modifier  : 0)
-	  | ((state & dpyinfo->alt_mod_mask)   ? alt_modifier  : 0)
-	  | ((state & dpyinfo->super_mod_mask) ? super_modifier  : 0)
-	  | ((state & dpyinfo->hyper_mod_mask) ? hyper_modifier  : 0));
+            | ((state & ControlMask)			? ctrl_modifier	: 0)
+            | ((state & dpyinfo->meta_mod_mask)		? mod_meta	: 0)
+            | ((state & dpyinfo->alt_mod_mask)		? mod_alt	: 0)
+            | ((state & dpyinfo->super_mod_mask)	? mod_super	: 0)
+            | ((state & dpyinfo->hyper_mod_mask)	? mod_hyper	: 0));
 }
 
 static unsigned int
@@ -6435,12 +6459,29 @@
      struct x_display_info *dpyinfo;
      unsigned int state;
 {
-  return (  ((state & alt_modifier)	? dpyinfo->alt_mod_mask   : 0)
-	  | ((state & super_modifier)	? dpyinfo->super_mod_mask : 0)
-	  | ((state & hyper_modifier)	? dpyinfo->hyper_mod_mask : 0)
-	  | ((state & shift_modifier)	? ShiftMask        : 0)
-	  | ((state & ctrl_modifier)	? ControlMask      : 0)
-	  | ((state & meta_modifier)	? dpyinfo->meta_mod_mask  : 0));
+  unsigned int mod_meta = meta_modifier;
+  unsigned int mod_alt  = alt_modifier;
+  unsigned int mod_hyper = hyper_modifier;
+  unsigned int mod_super = super_modifier;
+  
+  EMACS_UINT tem;
+  
+  tem = Fget (Vx_alt_keysym, Qmodifier_value);
+  if (! EQ (tem, Qnil)) mod_alt = XUINT (tem);
+  tem = Fget (Vx_meta_keysym, Qmodifier_value);
+  if (! EQ (tem, Qnil)) mod_meta = XUINT (tem);
+  tem = Fget (Vx_hyper_keysym, Qmodifier_value);
+  if (! EQ (tem, Qnil)) mod_hyper = XUINT (tem);
+  tem = Fget (Vx_super_keysym, Qmodifier_value);
+  if (! EQ (tem, Qnil)) mod_super = XUINT (tem);
+  
+  
+  return (  ((state & mod_alt)		? dpyinfo->alt_mod_mask   : 0)
+            | ((state & mod_super)	? dpyinfo->super_mod_mask : 0)
+            | ((state & mod_hyper)	? dpyinfo->hyper_mod_mask : 0)
+            | ((state & shift_modifier)	? ShiftMask        : 0)
+            | ((state & ctrl_modifier)	? ControlMask      : 0)
+            | ((state & mod_meta)	? dpyinfo->meta_mod_mask  : 0));
 }
 
 /* Convert a keysym to its name.  */
@@ -15035,6 +15076,45 @@
 
   staticpro (&last_mouse_motion_frame);
   last_mouse_motion_frame = Qnil;
+  
+  Qmodifier_value = intern ("modifier-value");
+  Qalt = intern ("alt");
+  Fput (Qalt, Qmodifier_value, make_number (alt_modifier));
+  Qhyper = intern ("hyper");
+  Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier));
+  Qmeta = intern ("meta");
+  Fput (Qmeta, Qmodifier_value, make_number (meta_modifier));
+  Qsuper = intern ("super");
+  Fput (Qsuper, Qmodifier_value, make_number (super_modifier));
+  
+  DEFVAR_LISP ("x-alt-keysym", &Vx_alt_keysym,
+    doc: /* Which keys Emacs uses for the alt modifier.
+This should be one of the symbols `alt', `hyper', `meta', `super'.
+For example, `alt' means use the Alt_L and Alt_R keysyms.  The default
+is nil, which is the same as `alt'.  */);
+  Vx_alt_keysym = Qnil;
+  
+  DEFVAR_LISP ("x-hyper-keysym", &Vx_hyper_keysym,
+    doc: /* Which keys Emacs uses for the hyper modifier.
+This should be one of the symbols `alt', `hyper', `meta', `super'.
+For example, `hyper' means use the Hyper_L and Hyper_R keysyms.  The
+default is nil, which is the same as `hyper'.  */);
+  Vx_hyper_keysym = Qnil;
+  
+  DEFVAR_LISP ("x-meta-keysym", &Vx_meta_keysym,
+    doc: /* Which keys Emacs uses for the meta modifier.
+This should be one of the symbols `alt', `hyper', `meta', `super'.
+For example, `meta' means use the Meta_L and Meta_R keysyms.  The
+default is nil, which is the same as `meta'.  */);
+  Vx_meta_keysym = Qnil;
+  
+  DEFVAR_LISP ("x-super-keysym", &Vx_super_keysym,
+    doc: /* Which keys Emacs uses for the super modifier.
+This should be one of the symbols `alt', `hyper', `meta', `super'.
+For example, `super' means use the Super_L and Super_R keysyms.  The
+default is nil, which is the same as `super'.  */);
+  Vx_super_keysym = Qnil;
+
 }
 
 #endif /* HAVE_X_WINDOWS */
Index: src/alloc.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/alloc.c,v
retrieving revision 1.263
diff -u -r1.263 alloc.c
--- src/alloc.c	8 Feb 2002 21:23:53 -0000	1.263
+++ src/alloc.c	14 Feb 2002 10:07:24 -0000
@@ -396,7 +396,7 @@
 
 /* Addresses of staticpro'd variables.  */
 
-#define NSTATICS 1024
+#define NSTATICS 1026
 Lisp_Object *staticvec[NSTATICS] = {0};
 
 /* Index of next unused slot in staticvec.  */

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

* Re: Switch Meta and Alt modifiers
  2002-02-14 10:09 ` Switch Meta and Alt modifiers Kai Großjohann
@ 2002-02-14 12:30   ` Andreas Schwab
  0 siblings, 0 replies; 20+ messages in thread
From: Andreas Schwab @ 2002-02-14 12:30 UTC (permalink / raw)
  Cc: emacs-devel

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

|> Index: src/xterm.c
|> ===================================================================
|> RCS file: /cvsroot/emacs/emacs/src/xterm.c,v
|> retrieving revision 1.703
|> diff -u -r1.703 xterm.c
|> --- src/xterm.c	27 Jan 2002 16:43:36 -0000	1.703
|> +++ src/xterm.c	14 Feb 2002 10:07:24 -0000
|> @@ -381,6 +381,14 @@
|>  
|>  extern int extra_keyboard_modifiers;
|>  
|> +/* The keysyms to use for the various modifiers.  */
|> +
|> +unsigned int Vx_alt_keysym;
|> +unsigned int Vx_hyper_keysym;
|> +unsigned int Vx_meta_keysym;
|> +unsigned int Vx_super_keysym;

These must be Lisp_Objects, since you use them as such.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
       [not found] <vafzo3na09i.fsf@INBOX.auto.emacs.devel.tok.lucy.cs.uni-dortmund.de>
  2002-02-14 10:09 ` Switch Meta and Alt modifiers Kai Großjohann
@ 2002-02-15  9:38 ` Kai Großjohann
  2002-02-17  5:48   ` Eli Zaretskii
  1 sibling, 1 reply; 20+ messages in thread
From: Kai Großjohann @ 2002-02-15  9:38 UTC (permalink / raw)


Kai.Grossjohann@cs.uni-dortmund.de (Kai Großjohann) writes:

> WIBNI the user could tell Emacs to swap the meanings of the Alt and
> Meta modifier?  Or to tell Emacs that mod1 is Meta, even if
> x_find_modifier_meanings finds Alt_L and Alt_R there?

I have now committed something which does this.  There are new
variables x-{alt,hyper,meta,super}-keysym.  Allowed values are the
symbols alt, hyper, meta, and super.  So to switch the alt and meta
keys, one can do:

(setq x-alt-keysym 'meta)
(setq x-meta-keysym 'alt)

There might be unexpected side effects with the "use alt as meta if
there is no meta key" mechanism that's already in Emacs: If you (setq
x-alt-keysym 'meta) but the kbd doesn't have a meta key, then Emacs
will use the alt keys for the alt keysym.

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-15  9:38 ` Kai Großjohann
@ 2002-02-17  5:48   ` Eli Zaretskii
  2002-02-17  9:58     ` Kai Großjohann
  0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2002-02-17  5:48 UTC (permalink / raw)
  Cc: emacs-devel


On Fri, 15 Feb 2002, Kai =?iso-8859-1?q?Gro=DFjohann?= wrote:

> I have now committed something which does this.  There are new
> variables x-{alt,hyper,meta,super}-keysym.  Allowed values are the
> symbols alt, hyper, meta, and super.  So to switch the alt and meta
> keys, one can do:
> 
> (setq x-alt-keysym 'meta)
> (setq x-meta-keysym 'alt)

Isn't there a way to accomplish the same on a system-independent level, 
so that this would be automatically supported on all platforms, not just 
on X?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-17  5:48   ` Eli Zaretskii
@ 2002-02-17  9:58     ` Kai Großjohann
  2002-02-17 10:10       ` Eli Zaretskii
  2002-02-17 11:53       ` Jason Rumney
  0 siblings, 2 replies; 20+ messages in thread
From: Kai Großjohann @ 2002-02-17  9:58 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii <eliz@is.elta.co.il> writes:

> Isn't there a way to accomplish the same on a system-independent
> level, so that this would be automatically supported on all
> platforms, not just on X?

Hm.  w32fns.c has some variables to accomplish similar things.

Alas, I know nothing about non-X platforms.  Can anyone help?

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-17  9:58     ` Kai Großjohann
@ 2002-02-17 10:10       ` Eli Zaretskii
  2002-02-17 15:23         ` Kai Großjohann
  2002-02-17 17:00         ` Eli Zaretskii
  2002-02-17 11:53       ` Jason Rumney
  1 sibling, 2 replies; 20+ messages in thread
From: Eli Zaretskii @ 2002-02-17 10:10 UTC (permalink / raw)
  Cc: emacs-devel


On Sun, 17 Feb 2002, Kai =?iso-8859-1?q?Gro=DFjohann?= wrote:

> Eli Zaretskii <eliz@is.elta.co.il> writes:
> 
> > Isn't there a way to accomplish the same on a system-independent
> > level, so that this would be automatically supported on all
> > platforms, not just on X?
> 
> Hm.  w32fns.c has some variables to accomplish similar things.
> 
> Alas, I know nothing about non-X platforms.  Can anyone help?

It strikes me that you could do the remapping in the code that handles 
the event queue.  In the queue, the platform-specific keysyms are already 
translated into system-independent event types and modifiers.  (At leat 
that's my recollection; I might be missing something.)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-17  9:58     ` Kai Großjohann
  2002-02-17 10:10       ` Eli Zaretskii
@ 2002-02-17 11:53       ` Jason Rumney
  1 sibling, 0 replies; 20+ messages in thread
From: Jason Rumney @ 2002-02-17 11:53 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> Eli Zaretskii <eliz@is.elta.co.il> writes:
> 
> > Isn't there a way to accomplish the same on a system-independent
> > level, so that this would be automatically supported on all
> > platforms, not just on X?
> 
> Hm.  w32fns.c has some variables to accomplish similar things.

Yes, it would be better (from a documentation point of view) to have
the same variables on all platforms.  The existing w32 variables could
then be made aliases for backward compatibility.


-- 
Jason Rumney


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-17 10:10       ` Eli Zaretskii
@ 2002-02-17 15:23         ` Kai Großjohann
  2002-02-17 17:00         ` Eli Zaretskii
  1 sibling, 0 replies; 20+ messages in thread
From: Kai Großjohann @ 2002-02-17 15:23 UTC (permalink / raw)


Eli Zaretskii <eliz@is.elta.co.il> writes:

> It strikes me that you could do the remapping in the code that handles 
> the event queue.  In the queue, the platform-specific keysyms are already 
> translated into system-independent event types and modifiers.  (At leat 
> that's my recollection; I might be missing something.)

Ah, I found the event queue in src/keyboard.c.  Very interesting code.
Alas, I don't quite grok that code yet.  It seems that either
make_lispy_event or modify_event_symbol would be the spot to do that,
right?

Does anyone out there want to do this?

If no, I'll try to get around to doing it, but it might be a while.

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-17 10:10       ` Eli Zaretskii
  2002-02-17 15:23         ` Kai Großjohann
@ 2002-02-17 17:00         ` Eli Zaretskii
  2002-02-19  6:36           ` Richard Stallman
  1 sibling, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2002-02-17 17:00 UTC (permalink / raw)
  Cc: emacs-devel@gnu.org

> From: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai =?iso-8859-1?q?Gro=DFjohann?=)
> Date: Sun, 17 Feb 2002 16:23:15 +0100
> 
> Eli Zaretskii <eliz@is.elta.co.il> writes:
> 
> > It strikes me that you could do the remapping in the code that handles 
> > the event queue.  In the queue, the platform-specific keysyms are already 
> > translated into system-independent event types and modifiers.  (At leat 
> > that's my recollection; I might be missing something.)
> 
> Ah, I found the event queue in src/keyboard.c.  Very interesting code.
> Alas, I don't quite grok that code yet.  It seems that either
> make_lispy_event or modify_event_symbol would be the spot to do that,
> right?

Yes, I think so.  Or maybe even in kbd_buffer_get_event, which
dequeues events and calls make_lispy_event.  But please wait for
Richard to confirm, I still don't feel myself at home in that maze
full of misty passages called keyboard.c ;-)

What are your difficulties in understanding that code as far as
modifiers are concerned?  Perhaps if you ask specific questions, they
can be answered one by one.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-17 17:00         ` Eli Zaretskii
@ 2002-02-19  6:36           ` Richard Stallman
  2002-02-19  9:31             ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Richard Stallman @ 2002-02-19  6:36 UTC (permalink / raw)
  Cc: Kai.Grossjohann, emacs-devel

If this code already works, I don't see a reason to rewrite it.
The code Kai wrote is clean enough.  I think it would be much
more useful to spend the time implementing some other feature
on the TODO list, or fixing a bug.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-19  6:36           ` Richard Stallman
@ 2002-02-19  9:31             ` Eli Zaretskii
  2002-02-20 22:12               ` Richard Stallman
  0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2002-02-19  9:31 UTC (permalink / raw)
  Cc: Kai.Grossjohann, emacs-devel

> Date: Mon, 18 Feb 2002 23:36:54 -0700 (MST)
> From: Richard Stallman <rms@gnu.org>
> 
> If this code already works, I don't see a reason to rewrite it.

The reason is that it's specific to X.  IMHO, platform-specific
features should be avoided, as they make documentation less clear, and
harm people who work on several platforms.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-19  9:31             ` Eli Zaretskii
@ 2002-02-20 22:12               ` Richard Stallman
  2002-02-21  6:44                 ` Eli Zaretskii
  2002-02-21 18:59                 ` Jason Rumney
  0 siblings, 2 replies; 20+ messages in thread
From: Richard Stallman @ 2002-02-20 22:12 UTC (permalink / raw)
  Cc: Kai.Grossjohann, emacs-devel

    The reason is that it's specific to X.

Is it needed, other than with X?  As far as I know, only X
has so many modifier keys, and only with X is there any need to modify
what maps to what.


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-20 22:12               ` Richard Stallman
@ 2002-02-21  6:44                 ` Eli Zaretskii
  2002-02-22  4:32                   ` Richard Stallman
  2002-02-21 18:59                 ` Jason Rumney
  1 sibling, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2002-02-21  6:44 UTC (permalink / raw)
  Cc: Kai.Grossjohann, emacs-devel


On Wed, 20 Feb 2002, Richard Stallman wrote:

>     The reason is that it's specific to X.
> 
> Is it needed, other than with X?  As far as I know, only X
> has so many modifier keys, and only with X is there any need to modify
> what maps to what.

AFAIK, all the supported versions, with the exception of the Unix tty, 
support those modifiers.  As Jason pointed out, a similar facility 
already exists in the Windows port (and another one is in the DOS port).  
I think it would be nice to have a single facility that is platform 
independent.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-20 22:12               ` Richard Stallman
  2002-02-21  6:44                 ` Eli Zaretskii
@ 2002-02-21 18:59                 ` Jason Rumney
  1 sibling, 0 replies; 20+ messages in thread
From: Jason Rumney @ 2002-02-21 18:59 UTC (permalink / raw)
  Cc: eliz, Kai.Grossjohann, emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     The reason is that it's specific to X.
> 
> Is it needed, other than with X?  As far as I know, only X
> has so many modifier keys, and only with X is there any need to modify
> what maps to what.

On the contrary.  The reason why there is already code in the Windows
port for the same purpose is that we don't have xmodmap to modify
what maps to what externally to Emacs.


-- 
Jason Rumney


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-21  6:44                 ` Eli Zaretskii
@ 2002-02-22  4:32                   ` Richard Stallman
  2002-02-24 17:41                     ` Kai Großjohann
  0 siblings, 1 reply; 20+ messages in thread
From: Richard Stallman @ 2002-02-22  4:32 UTC (permalink / raw)
  Cc: Kai.Grossjohann, emacs-devel

      As Jason pointed out, a similar facility 
    already exists in the Windows port (and another one is in the DOS port).  
    I think it would be nice to have a single facility that is platform 
    independent.

I agree that would be an improvement.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-22  4:32                   ` Richard Stallman
@ 2002-02-24 17:41                     ` Kai Großjohann
  2002-02-24 18:49                       ` Jason Rumney
  2002-02-25  0:09                       ` Richard Stallman
  0 siblings, 2 replies; 20+ messages in thread
From: Kai Großjohann @ 2002-02-24 17:41 UTC (permalink / raw)
  Cc: eliz, emacs-devel

Richard Stallman <rms@gnu.org> writes:

>       As Jason pointed out, a similar facility 
>     already exists in the Windows port (and another one is in the DOS port).  
>     I think it would be nice to have a single facility that is platform 
>     independent.
>
> I agree that would be an improvement.

I'm not sure but I think that this does not encompass all of the
Windows functionality.  [time passes]  Ah, for example there is the
variable w32-lwindow-modifier.  If this is nil, the key is not a
modifier but seen by Emacs as <lwindow>.  Else, the key can be seen
by Emacs as any of alt, hyper, meta, super, control, shift.

But the platform-independent mechanism (at least the one I'm thinking
of) would only transform A-x (for some modifier A and some other key
x) into H-x (for some other modifier H and the same key x).

So the closest we could get with the platform-independent mechanism
is to choose some modifier for the <lwindow> key and to have a
boolean variable which chooses whether <lwindow> is seen as that
modifier or as a normal key.

But this looses functionality.

Thoughts?

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-24 17:41                     ` Kai Großjohann
@ 2002-02-24 18:49                       ` Jason Rumney
  2002-02-24 19:10                         ` Kai Großjohann
  2002-02-25  0:09                       ` Richard Stallman
  1 sibling, 1 reply; 20+ messages in thread
From: Jason Rumney @ 2002-02-24 18:49 UTC (permalink / raw)
  Cc: rms, eliz, emacs-devel

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> I'm not sure but I think that this does not encompass all of the
> Windows functionality.

Probably not, but it would be nice if the functionality that it does
encompass could be the same.

> So the closest we could get with the platform-independent mechanism
> is to choose some modifier for the <lwindow> key and to have a
> boolean variable which chooses whether <lwindow> is seen as that
> modifier or as a normal key.
> 
> But this looses functionality.

I don't see which functionality has been lost. The only difference
seems to be that we would have two variables to control it instead of
one variable with an overloaded meaning.

-- 
Jason Rumney


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-24 18:49                       ` Jason Rumney
@ 2002-02-24 19:10                         ` Kai Großjohann
  0 siblings, 0 replies; 20+ messages in thread
From: Kai Großjohann @ 2002-02-24 19:10 UTC (permalink / raw)
  Cc: rms, eliz, emacs-devel

Jason Rumney <jasonr@gnu.org> writes:

> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
>
>> I'm not sure but I think that this does not encompass all of the
>> Windows functionality.
>
> Probably not, but it would be nice if the functionality that it does
> encompass could be the same.

I agree on that.

>> So the closest we could get with the platform-independent mechanism
>> is to choose some modifier for the <lwindow> key and to have a
>> boolean variable which chooses whether <lwindow> is seen as that
>> modifier or as a normal key.
>> 
>> But this looses functionality.
>
> I don't see which functionality has been lost. The only difference
> seems to be that we would have two variables to control it instead of
> one variable with an overloaded meaning.

For any key foo with a variable w32-foo-modifier, the modifier that
is used for that key can be freely chosen via that variable,
independent of any other key.

But if we choose the same modifier for the key foo1 as well as the
key foo2, then the new mechanism can't assign them different
`modifier meanings'.  For example, suppose we decide that lwindow and
rwindow should both map to hyper.  Then no amount of remapping of H-x
(for any x) events could distinguish between lwindow and rwindow in
the platform-independent code.  But the current code has no problem
with assigning lwindow and rwindow different `modifier meanings'.

So, we have modifiers hyper and super which aren't already taken, but
we have three keys lwindow, rwindow and menu (sp?).  So two of these
need to share the same modifier.

The above assumes that some functionality should be removed from the
w32 code.  The point is, of course, moot if the current functionality
should stay as is.  (Then, people could say that lwindow should be a
hyper key, and then they could remap H-x events into A-x events using
the platform independent code.  And then they could get confused :-)

But maybe my view of what can be done in the platform independent code
is too narrow?  My idea is that the user (conceptually) specifies a
table which says, for example: whenever Emacs sees a H-<something>
event, it should be rewritten into an A-<something> event.  An
optional extension would be that the user can specify combinations of
modifiers, so that, for instance, all C-H-<something> events are
rewritten into M-s-<something> events.

But please bear in mind that I don't use Windows, and I haven't spent
much time reading the w32 code in Emacs.  So my idea of what the
current code might be doing may be way off.  Thus, if any of the
above sounds strange to you, please don't hesitate to tell me to go
back to RTFM or UTSL.  (But please include a pointer so I know where
to start.)

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-24 17:41                     ` Kai Großjohann
  2002-02-24 18:49                       ` Jason Rumney
@ 2002-02-25  0:09                       ` Richard Stallman
  2002-02-25  6:03                         ` Eli Zaretskii
  1 sibling, 1 reply; 20+ messages in thread
From: Richard Stallman @ 2002-02-25  0:09 UTC (permalink / raw)
  Cc: eliz, emacs-devel

I'd rather not spend time worrying about how to do better Windows
support.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Switch Meta and Alt modifiers
  2002-02-25  0:09                       ` Richard Stallman
@ 2002-02-25  6:03                         ` Eli Zaretskii
  0 siblings, 0 replies; 20+ messages in thread
From: Eli Zaretskii @ 2002-02-25  6:03 UTC (permalink / raw)
  Cc: Kai.Grossjohann, emacs-devel


On Sun, 24 Feb 2002, Richard Stallman wrote:

> I'd rather not spend time worrying about how to do better Windows
> support.

I don't think this is about doing Windows support better (in this 
specific area, it is already better, btw).  This is about introducing 
X-specific solutions to problems that are not specific to X.  I think we 
should avoid that as much as possible.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

end of thread, other threads:[~2002-02-25  6:03 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <vafzo3na09i.fsf@INBOX.auto.emacs.devel.tok.lucy.cs.uni-dortmund.de>
2002-02-14 10:09 ` Switch Meta and Alt modifiers Kai Großjohann
2002-02-14 12:30   ` Andreas Schwab
2002-02-15  9:38 ` Kai Großjohann
2002-02-17  5:48   ` Eli Zaretskii
2002-02-17  9:58     ` Kai Großjohann
2002-02-17 10:10       ` Eli Zaretskii
2002-02-17 15:23         ` Kai Großjohann
2002-02-17 17:00         ` Eli Zaretskii
2002-02-19  6:36           ` Richard Stallman
2002-02-19  9:31             ` Eli Zaretskii
2002-02-20 22:12               ` Richard Stallman
2002-02-21  6:44                 ` Eli Zaretskii
2002-02-22  4:32                   ` Richard Stallman
2002-02-24 17:41                     ` Kai Großjohann
2002-02-24 18:49                       ` Jason Rumney
2002-02-24 19:10                         ` Kai Großjohann
2002-02-25  0:09                       ` Richard Stallman
2002-02-25  6:03                         ` Eli Zaretskii
2002-02-21 18:59                 ` Jason Rumney
2002-02-17 11:53       ` Jason Rumney

Code repositories for project(s) associated with this public inbox

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

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