* hook for C-Mouse-3?
@ 2010-07-25 21:35 Oleksandr Gavenko
2010-07-25 21:42 ` Oleksandr Gavenko
0 siblings, 1 reply; 4+ messages in thread
From: Oleksandr Gavenko @ 2010-07-25 21:35 UTC (permalink / raw)
To: help-gnu-emacs
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
C-Mouse-3.
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?
--
Best regards!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: hook for C-Mouse-3?
2010-07-25 21:35 hook for C-Mouse-3? Oleksandr Gavenko
@ 2010-07-25 21:42 ` Oleksandr Gavenko
2010-07-25 22:08 ` Oleksandr Gavenko
0 siblings, 1 reply; 4+ messages in thread
From: Oleksandr Gavenko @ 2010-07-25 21:42 UTC (permalink / raw)
To: help-gnu-emacs
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
> C-Mouse-3.
>
> 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 ()
(imenu-add-menubar-index)
(run-hooks 'menu-bar-update-hook)
) ))
my-devel-mode-hook-list)
)
where
(defvar my-devel-mode-hook-list
'(
outline-mode-hook
sh-mode-hook script-mode-hook
c-mode-hook c++-mode-hook java-mode-hook
python-mode-hook
makefile-mode-hook makefile-gmake-mode-hook
lisp-mode-hook emacs-lisp-mode-hook)
"List of development mode hooks.")
--
Best regards!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: hook for C-Mouse-3?
2010-07-25 21:42 ` Oleksandr Gavenko
@ 2010-07-25 22:08 ` Oleksandr Gavenko
0 siblings, 0 replies; 4+ messages in thread
From: Oleksandr Gavenko @ 2010-07-25 22:08 UTC (permalink / raw)
To: help-gnu-emacs
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
>> C-Mouse-3.
>>
>> 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 ()
> (imenu-add-menubar-index)
> (run-hooks 'menu-bar-update-hook)
> ) ))
> my-devel-mode-hook-list)
> )
>
> where
>
> (defvar my-devel-mode-hook-list
> '(
> outline-mode-hook
> sh-mode-hook script-mode-hook
> c-mode-hook c++-mode-hook java-mode-hook
> python-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 ()
(interactive)
(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!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: hook for C-Mouse-3?
[not found] <mailman.0.1280093729.10103.help-gnu-emacs@gnu.org>
@ 2010-07-26 7:39 ` Stefan Kamphausen
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Kamphausen @ 2010-07-26 7:39 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
Oleksandr Gavenko <gavenkoa@gmail.com> writes:
> 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.
do you know active-menu[1]? I haven't worked on this for ages and don't
really use it anymore myself. But the last time I did, it worked quite
well. It allows you to hide the menubar and only have it appear when
the mouse comes close to where it would be usually.
I know this doesn't really answer your original question but maybe it
provides a different approach?
Kind regards,
Stefan
Footnotes:
[1] http://www.emacswiki.org/emacs/ActiveMenu
http://www.skamphausen.de/cgi-bin/ska/active-menu.el
--
a blessed +42 regexp of confusion (weapon in hand)
You hit. The format string crumbles and turns to dust.
user=> (clojure-buch (Locale/GERMANY))
#<URL http://www.clojure-buch.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-07-26 7:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-25 21:35 hook for C-Mouse-3? Oleksandr Gavenko
2010-07-25 21:42 ` Oleksandr Gavenko
2010-07-25 22:08 ` Oleksandr Gavenko
[not found] <mailman.0.1280093729.10103.help-gnu-emacs@gnu.org>
2010-07-26 7:39 ` Stefan Kamphausen
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).