all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* prefix arg when mouse clicking on header
@ 2008-12-14 23:42 Roland Winkler
  2008-12-15  0:01 ` Drew Adams
  2008-12-15  4:03 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Roland Winkler @ 2008-12-14 23:42 UTC (permalink / raw)
  To: emacs-devel

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?

Thanks!

Roland




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-12-15 20:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-14 23:42 prefix arg when mouse clicking on header Roland Winkler
2008-12-15  0:01 ` Drew Adams
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.