Commit 14ab3a40 authored by Karoly Lorentey's avatar Karoly Lorentey
Browse files

Fix F10 behaviour. (Reported by Bernard Adrian.)

* src/xmenu.c (Fx_menu_bar_open) [USE_X_TOOLKIT, USE_GTK]: 
  Rename from Fmenu_bar_open.
  (syms_of_xmenu): Update defsubr.

* lisp/menu-bar.el (menu-bar-open): New function.
  Bind it to f10.

* lisp/term/x-win.el: Don't bind f10.

* lisp/tmm.el: Remove autoload binding for f10.

* lisp/ldefs-boot.el: Regenerate.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-577
parent e6aee454
This diff is collapsed.
......@@ -1768,6 +1768,22 @@ See `menu-bar-mode' for more information."
(menu-bar-mode (if (> (frame-parameter nil 'menu-bar-lines) 0) 0 1))
(menu-bar-mode arg)))
(defun menu-bar-open (&optional frame)
"Start key navigation of the menu bar in FRAME.
This function decides which method to use to access the menu
depending on FRAME's terminal device. On X displays, it calls
`x-menu-bar-open'; otherwise it calls `tmm-menubar'.
If FRAME is nil or not given, use the selected frame."
(interactive)
(if (eq window-system 'x)
(x-menu-bar-open frame)
(with-selected-frame (or frame (selected-frame))
(tmm-menubar))))
(global-set-key [f10] 'menu-bar-open)
(provide 'menu-bar)
;;; arch-tag: 6e6a3c22-4ec4-4d3d-8190-583f8ef94ced
......
......@@ -2533,9 +2533,5 @@ order until succeed.")
(add-hook 'after-make-frame-functions 'x-dnd-init-frame)
(global-set-key [drag-n-drop] 'x-dnd-handle-drag-n-drop-event)
;; Let F10 do menu bar navigation.
(and (fboundp 'menu-bar-open)
(global-set-key [f10] 'menu-bar-open))
;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78
;;; x-win.el ends here
......@@ -47,7 +47,6 @@
(defvar tmm-table-undef)
;;;###autoload (define-key global-map "\M-`" 'tmm-menubar)
;;;###autoload (define-key global-map [f10] 'tmm-menubar)
;;;###autoload (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
;;;###autoload
......
......@@ -1970,7 +1970,7 @@ xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group)
return w;
}
/* Callback called when keyboard traversal (started by menu-bar-open) ends.
/* Callback called when keyboard traversal (started by x-menu-bar-open) ends.
WMENU is the menu for which traversal has been done. DATA points to the
frame for WMENU. We must release grabs, some bad interaction between GTK
and Emacs makes the menus keep the grabs. */
......
......@@ -1310,7 +1310,7 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers)
}
}
DEFUN ("menu-bar-open", Fmenu_bar_open, Smenu_bar_open, 0, 1, "i",
DEFUN ("x-menu-bar-open", Fx_menu_bar_open, Sx_menu_bar_open, 0, 1, "i",
doc: /* Start key navigation of the menu bar in FRAME.
This initially opens the first menu bar item and you can then navigate with the
arrow keys, select a menu entry with the return key or cancel with the
......@@ -1389,7 +1389,7 @@ If FRAME is nil or not given, use the selected frame. */)
#ifdef USE_GTK
DEFUN ("menu-bar-open", Fmenu_bar_open, Smenu_bar_open, 0, 1, "i",
DEFUN ("x-menu-bar-open", Fx_menu_bar_open, Sx_menu_bar_open, 0, 1, "i",
doc: /* Start key navigation of the menu bar in FRAME.
This initially opens the first menu bar item and you can then navigate with the
arrow keys, select a menu entry with the return key or cancel with the
......@@ -3816,9 +3816,10 @@ The enable predicate for a menu command should check this variable. */);
defsubr (&Sx_popup_menu);
#if defined (USE_GTK) || defined (USE_X_TOOLKIT)
defsubr (&Smenu_bar_open);
Fdefalias (intern ("accelerate-menu"), intern (Smenu_bar_open.symbol_name),
Qnil);
defsubr (&Sx_menu_bar_open);
Fdefalias (intern ("accelerate-menu"),
intern (Sx_menu_bar_open.symbol_name),
Qnil);
#endif
#ifdef HAVE_MENUS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment