[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to set button action
From: |
Michael Heerdegen |
Subject: |
Re: how to set button action |
Date: |
Wed, 19 Oct 2016 12:03:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Stefan Huchler <stefan.huchler@mail.de> writes:
> yes that helped me, a small followup question, if I dont use lamba and
> instead a function, can I define a parameter to that function?
You mean a named function (a lambda is a function). Yes, you can do
that. I suggest to have a look how some Emacs package do that,
e.g. package.el (look at `package-menu--print-info-simple' and the
action function `package-menu-describe-package'. Seems the action
function should accept a button as argument.
> It uses a marker object anyway, or can I access the id inside that
> function? I have a list and need to know which element got selected.
Seems you can either put a property on the button and refer to the
property value in the action function via `button-get', or just use
`tabulated-list-get-id' to get the ID.
HTH,
Michael.