[Top][All Lists]

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

Re: hook for C-Mouse-3?

From: Oleksandr Gavenko
Subject: Re: hook for C-Mouse-3?
Date: Mon, 26 Jul 2010 01:08:38 +0300
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20091204 Thunderbird/3.0

On 2010-07-26 0:42, Oleksandr Gavenko wrote:
On 2010-07-26 0:35, Oleksandr Gavenko wrote:
I discover 'imenu' useful with (imenu-add-menubar-index).

But also I like save visible display area by:

(menu-bar-mode -1) ; This switch IMPORTANT for this mail.
(tool-bar-mode -1)

As menu hidden to access menu items I use

Under 'imenu.el' you can find such code:

(defun imenu-add-to-menubar (name)
(add-hook 'menu-bar-update-hook 'imenu-update-menubar)
... )

so imenu items in menu updated by 'menu-bar-update-hook'
which seems not invoked in menu-bar disabled.

Is there any hook when opened context menu?

I found solution by force invoking 'menu-bar-update-hook':

(when window-system
(mapc (lambda (hook)
(add-hook hook
(lambda ()
(run-hooks 'menu-bar-update-hook)
) ))


(defvar my-devel-mode-hook-list
sh-mode-hook script-mode-hook
c-mode-hook c++-mode-hook java-mode-hook
makefile-mode-hook makefile-gmake-mode-hook
lisp-mode-hook emacs-lisp-mode-hook)
"List of development mode hooks.")

Also use mouse to see imenu terrible.
After some reading doc and mouse.el I found the way
invoke menu by keyboard:

(when window-system
  (defun my-popup-menu ()
     (mouse-menu-bar-map) ;; (mouse-menu-major-mode-map)
(list (list (/ (display-pixel-width) 2) 10) (get-buffer-window (buffer-name)))))
  (global-set-key [f10] 'my-popup-menu)

It easy move by arrows up/down by list and
open/close sublist by right/left arrows!

Best regards!

reply via email to

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