emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/keyboard.c


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/keyboard.c
Date: Sat, 19 Mar 2005 11:36:02 -0500

Index: emacs/src/keyboard.c
diff -c emacs/src/keyboard.c:1.815 emacs/src/keyboard.c:1.816
*** emacs/src/keyboard.c:1.815  Wed Mar 16 21:39:49 2005
--- emacs/src/keyboard.c        Sat Mar 19 16:36:01 2005
***************
*** 11427,11436 ****
  
    initial_define_lispy_key (Vspecial_event_map, "delete-frame",
                            "handle-delete-frame");
    initial_define_lispy_key (Vspecial_event_map, "iconify-frame",
!                           "ignore-event");
    initial_define_lispy_key (Vspecial_event_map, "make-frame-visible",
!                           "ignore-event");
    /* Handling it at such a low-level causes read_key_sequence to get
     * confused because it doesn't realize that the current_buffer was
     * changed by read_char.
--- 11427,11455 ----
  
    initial_define_lispy_key (Vspecial_event_map, "delete-frame",
                            "handle-delete-frame");
+   /* Here we used to use `ignore-event' which would simple set prefix-arg to
+      current-prefix-arg, as is done in `handle-switch-frame'.
+      But `handle-switch-frame is not run from the special-map.
+      Commands from that map are run in a special way that automatically
+      preserves the prefix-arg.  Restoring the prefix arg here is not just
+      redundant but harmful:
+      - C-u C-x v =
+      - current-prefix-arg is set to non-nil, prefix-arg is set to nil.
+      - after the first prompt, the exit-minibuffer-hook is run which may
+        iconify a frame and thus push a `iconify-frame' event.
+      - after running exit-minibuffer-hook, current-prefix-arg is
+        restored to the non-nil value it had before the prompt.
+      - we enter the second prompt.
+        current-prefix-arg is non-nil, prefix-arg is nil.
+      - before running the first real event, we run the special iconify-frame
+        event, but we pass the `special' arg to execute-command so
+        current-prefix-arg and prefix-arg are left untouched.
+      - here we foolishly copy the non-nil current-prefix-arg to prefix-arg.
+      - the next key event will have a spuriously non-nil current-prefix-arg.  
*/
    initial_define_lispy_key (Vspecial_event_map, "iconify-frame",
!                           "ignore");
    initial_define_lispy_key (Vspecial_event_map, "make-frame-visible",
!                           "ignore");
    /* Handling it at such a low-level causes read_key_sequence to get
     * confused because it doesn't realize that the current_buffer was
     * changed by read_char.




reply via email to

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