unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 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

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