all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Stefan Huchler <stefan.huchler@mail.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: how to set button action
Date: Wed, 19 Oct 2016 12:03:03 +0200	[thread overview]
Message-ID: <877f94d5bc.fsf@web.de> (raw)
In-Reply-To: <87shrucir6.fsf@jupiter.lan> (Stefan Huchler's message of "Tue, 18 Oct 2016 07:45:49 +0200")

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.



  reply	other threads:[~2016-10-19 10:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-16  2:36 how to set button action Stefan Huchler
2016-10-16 13:43 ` Alex Kost
2016-10-18  5:45   ` Stefan Huchler
2016-10-19 10:03     ` Michael Heerdegen [this message]
2016-10-20  2:57       ` Stefan Huchler

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

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

  git send-email \
    --in-reply-to=877f94d5bc.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=stefan.huchler@mail.de \
    /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 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.