* Can't figure out how to create a tabulated-list-mode with visible content
@ 2016-10-08 2:11 Stefan Huchler
2016-10-09 10:01 ` Thien-Thi Nguyen
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Huchler @ 2016-10-08 2:11 UTC (permalink / raw)
To: emacs-devel
Hi,
I tried to upgrade my few kodi-remote functions to a basic major
mode. Primary to control kodi like you would do with a usb-keyboard but
over network within emacs.
So the basic stuff works so far, you can navigate start/pause/stop
delete a selected file and some stuff like that, with the standart
keyboard configuration.
I did not include it in melpa so far, but its in my github:
https://github.com/spiderbit/kodi-remote.el
the problem is, in this form it only creates a empty special buffer,
which has setup the right keybindings and sends them to the kodi
instance but doesnt show anything.
I am not shure how you can print something into that read-only buffer, I
then thought next logical step besides a remote-keyboard would be to
list movies and series and stuff like that, and tabulated-list-mode
would make probably sense for that.
I looked into the codes of other list modes like transmission or proced,
but they are pretty complex.
So I looked up the official documentation and tried to make a minimal
implementation that dispals anything.
But I could not display it anything, here my attempt:
(define-derived-mode kodi-remote-mode tabulated-list-mode "kodi-remote"
"Major mode for remote controlling kodi instance
Key bindings:
\\{kodi-remote-mode-map}"
;; :group '
;; (setq-local line-move-visual nil)
(setq tabulated-list-format [("choice" nil t)])
(setq tabulated-list-entries (nil ["Series"]))
(tabulated-list-init-header)
(tabulated-list-print)
)
;;;###autoload
(defun kodi-remote ()
"Open a `kodi-remote-mode' buffer."
(interactive)
(let* ((name "*kodi-remote*")
(buffer (or (get-buffer name)
(generate-new-buffer name))))
(unless (eq buffer (current-buffer))
(with-current-buffer buffer
(unless (eq major-mode 'kodi-remote-mode)
(condition-case e
(progn
(kodi-remote-mode)
)
(error
(kill-buffer buffer)
(signal (car e) (cdr e))))))
(switch-to-buffer-other-window buffer))))
what did I miss?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Can't figure out how to create a tabulated-list-mode with visible content
2016-10-08 2:11 Can't figure out how to create a tabulated-list-mode with visible content Stefan Huchler
@ 2016-10-09 10:01 ` Thien-Thi Nguyen
2016-10-09 15:49 ` Stefan Huchler
0 siblings, 1 reply; 3+ messages in thread
From: Thien-Thi Nguyen @ 2016-10-09 10:01 UTC (permalink / raw)
To: Stefan Huchler; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 521 bytes --]
() Stefan Huchler <stefan.huchler@mail.de>
() Sat, 08 Oct 2016 04:11:29 +0200
what did I miss?
This is an interesting question. Please repost to help-gnu-emacs
(emacs-devel is for the development of Emacs, proper).
--
Thien-Thi Nguyen -----------------------------------------------
(defun responsep (type via)
(case type
(technical (eq 'mailing-list via))
...)) 748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Can't figure out how to create a tabulated-list-mode with visible content
2016-10-09 10:01 ` Thien-Thi Nguyen
@ 2016-10-09 15:49 ` Stefan Huchler
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Huchler @ 2016-10-09 15:49 UTC (permalink / raw)
To: emacs-devel
Thien-Thi Nguyen <ttn@gnu.org> writes:
> () Stefan Huchler <stefan.huchler@mail.de>
> () Sat, 08 Oct 2016 04:11:29 +0200
>
> what did I miss?
>
> This is an interesting question. Please repost to help-gnu-emacs
> (emacs-devel is for the development of Emacs, proper).
Thx Thien-Thi, sorry for using the wrong list a bit confusing, I thought
help-gnu-emacs is for help in using emacs not code/develop for it :)
I first searched for elisp groups but there are no officials only from
some 3rd party websites.
Well now I know it, so thx again!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-09 15:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-08 2:11 Can't figure out how to create a tabulated-list-mode with visible content Stefan Huchler
2016-10-09 10:01 ` Thien-Thi Nguyen
2016-10-09 15:49 ` Stefan Huchler
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).