unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: How to find commands run by menu?
Date: Wed, 09 Dec 2009 17:06:04 +0100	[thread overview]
Message-ID: <4B1FCAEC.4090307@easy-emacs.de> (raw)
In-Reply-To: <hfmdmq$1pj$1@reader1.panix.com>

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/





  parent reply	other threads:[~2009-12-09 16:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-08 20:42 How to find commands run by menu? kj
2009-12-08 21:19 ` Pascal J. Bourguignon
2009-12-08 22:13   ` kj
2009-12-08 23:29     ` Pascal J. Bourguignon
2009-12-09  9:22 ` Peter Dyballa
     [not found] ` <mailman.12591.1260350574.2239.help-gnu-emacs@gnu.org>
2009-12-09 15:57   ` kj
2009-12-09 16:06 ` Andreas Röhler [this message]
     [not found] ` <mailman.12600.1260374782.2239.help-gnu-emacs@gnu.org>
2009-12-09 16:35   ` harven
2009-12-09 18:44 ` J. David Boyd
2009-12-10 13:30 ` Jason Rumney
2009-12-11 15:44   ` kj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B1FCAEC.4090307@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).