[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to find commands run by menu?
From: |
Andreas Röhler |
Subject: |
Re: How to find commands run by menu? |
Date: |
Wed, 09 Dec 2009 17:06:04 +0100 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20081227) |
kj wrote:
> Is there any way to determine the exact command that gets run when
> one invokes a particular menu item?
>
> TIA!
>
> kynnjo
>
> P.S. Here's why I want this. It's a bit convoluted. For mysterious
> reasons, the latest version of Emacs on my system does not offer
> any "print region" commands when run in X11 mode (these commands
> do show in the File menu, but are permanently disabled, irrespective
> of whether a region is defined or not).
>
> I determined that if instead I run Emacs in text mode, now the
> menus do offer the "print region" commands.
>
> But I don't want to run Emacs in text mode. Therefore, I want to
> be able to execute *while on X11 mode* the same commands that get
> triggered when I choose (in text mode) one of the "print region"
> commands from the File menu. Make sense?
>
> I thought that the desired commands would be ones like ps-print-region,
> but the ones I've guessed produce different-looking printed results
> from those obtained by using the menus under text mode, and I prefer
> the latter by far. Therefore, I have to conclude that using the
> menus does something more than just calling, say, ps-print-region.
>
Hi,
seems no easy way to solve your question. Which is an
inconvenience AFAIS. For the moment here a possible
proceeding relying at the tooltip shown:
>From to the source-code directory,
with M-x grep-find and the command
find . -type f -name "*.el" -print0 | xargs -0 -e grep -nH -e "Print region
between mark"
it displays
./lisp/menu-bar.el:125: :help ,(purecopy "Print region between mark and
current position")))
with RET at the link the source is shown:
(define-key menu-bar-file-menu [print-region]
`(menu-item ,(purecopy "Print Region") print-region
:enable mark-active
:help ,(purecopy "Print region between mark and current
position")))
>From there I guess "print-region" is the command looked for...
HTH
Andreas
--
https://code.launchpad.net/s-x-emacs-werkstatt/
http://bazaar.launchpad.net/~a-roehler/python-mode/python-mode.el/