unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how to set button action
@ 2016-10-16  2:36 Stefan Huchler
  2016-10-16 13:43 ` Alex Kost
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Huchler @ 2016-10-16  2:36 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I am trying to get buttons working in a tabulated-list mode but when I
press enter on that link it does not execute the print.

also tried it without lambda and the funcions name. Is there a trick I
am missing?


(define-derived-mode test-foo-mode tabulated-list-mode "test-foo"
  (setq tabulated-list-format [("Series" 10 t)])
  (setq tabulated-list-entries '((nil [("test" . ('action (lambda (btn)
    (print "action"))))])))
  (tabulated-list-init-header)
  (tabulated-list-print)
  )

(defun test-foo ()
  (interactive)
  (let* ((name "*test-foo*")
	 (buffer (or (get-buffer name)
		     (generate-new-buffer name))))
    (unless (eq buffer (current-buffer))
      (with-current-buffer buffer
	(unless (eq major-mode 'test-foo-mode)
	  (condition-case e
	      (progn
		(test-foo-mode)
		)
	    (error
	     (kill-buffer buffer)
	     (signal (car e) (cdr e))))))
      (switch-to-buffer-other-window buffer))))






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

end of thread, other threads:[~2016-10-20  2:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-10-20  2:57       ` Stefan Huchler

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).