From: "Drew Adams" <drew.adams@oracle.com>
To: "'Roland Winkler'" <Roland.Winkler@physik.uni-erlangen.de>,
<emacs-devel@gnu.org>
Subject: RE: prefix arg when mouse clicking on header
Date: Sun, 14 Dec 2008 16:01:22 -0800 [thread overview]
Message-ID: <000001c95e48$446696c0$0200a8c0@us.oracle.com> (raw)
In-Reply-To: <18757.39394.481444.293571@tfkp04.physik.uni-erlangen.de>
> I have some difficulties with the command proced-sort-header in
> proced.el. This command is called when the mouse is on the header
> line. The first arg of this command is the mouse event. I'd like to
> give the command an optional prefix arg. But somehow it seems to me
> that clicking on the header line is different from clicking
> elsewhere. What is the proper way to access the prefix arg when
> clicking on the header line?
>
> I used to have (interactive "e\nP"), but that ignores the prefix arg.
>
> Instead of "P", I really would like to have something like
>
> (interactive (list last-input-event (or current-prefix-arg 'no-arg)))
>
> (The 'no-arg is similar to 'toggle in define-derived-mode.)
> But again, this ignores the prefix arg. By trial an error I have
> found that
>
> (interactive (list last-input-event (or last-prefix-arg 'no-arg)))
>
> seems to work. But is this the right thing? Why last-prefix-arg
> instead of current-prefix-arg? Certainly, this is consistent with
> the code letter P being ignored by interactive.
>
> Also I was wondering what is the proper replacement for the code
> letter e used by interactive when the list is constructed by hand.
> last-input-event is used in commands like Buffer-menu-sort-by-column.
> Is last-input-event always equivalent to the code letter e?
> If yes, that could go into the elisp manual. If not, what would be
> the proper replacement?
(interactive "e\nP") works for me.
For example, try the version of `mouse-yank-secondary' in `mouse+.el', with
`second-sel.el' also loaded. If `mouse-yank-secondary' is bound to, say,
`M-mouse-2', then `C-u 3 M-mouse-2' yanks the 3rd most recent secondary
selection.
The code for that, as an example, is here:
http://www.emacswiki.org/emacs/mouse%2b.el ; mouse+.el
http://www.emacswiki.org/emacs/second-sel.el
next prev parent reply other threads:[~2008-12-15 0:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-14 23:42 prefix arg when mouse clicking on header Roland Winkler
2008-12-15 0:01 ` Drew Adams [this message]
2008-12-15 1:25 ` Roland Winkler
2008-12-15 1:33 ` Drew Adams
2008-12-15 4:03 ` Stefan Monnier
2008-12-15 18:33 ` Roland Winkler
2008-12-15 20:13 ` Stefan Monnier
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='000001c95e48$446696c0$0200a8c0@us.oracle.com' \
--to=drew.adams@oracle.com \
--cc=Roland.Winkler@physik.uni-erlangen.de \
--cc=emacs-devel@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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).