From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Huchler Newsgroups: gmane.emacs.help Subject: Can't figure out how to create a tabulated-list-mode with visible Date: Sun, 09 Oct 2016 18:08:48 +0200 Message-ID: <87lgxxfqsv.fsf@jupiter.lan> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1476034201 28092 195.159.176.226 (9 Oct 2016 17:30:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Oct 2016 17:30:01 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 09 19:29:57 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btHv4-0005tj-E6 for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Oct 2016 19:29:50 +0200 Original-Received: from localhost ([::1]:45042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btHv2-0001xQ-Tj for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Oct 2016 13:29:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btGgA-00007R-RO for help-gnu-emacs@gnu.org; Sun, 09 Oct 2016 12:10:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btGg7-0001u1-Fu for help-gnu-emacs@gnu.org; Sun, 09 Oct 2016 12:10:22 -0400 Original-Received: from [195.159.176.226] (port=34255 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btGg7-0001rf-8h for help-gnu-emacs@gnu.org; Sun, 09 Oct 2016 12:10:19 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1btGft-0007xA-3V for help-gnu-emacs@gnu.org; Sun, 09 Oct 2016 18:10:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 68 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:rnmBjNHcUwtt79omCmvpRU6nmYU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-Mailman-Approved-At: Sun, 09 Oct 2016 13:29:17 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111486 Archived-At: 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 standard keyboard configuration. https://github.com/spiderbit/kodi-remote.el (its also in melpa) the problem is, that in this form it only creates a empty special buffer, which provides the right keybindings and forwards 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 code of other tabulated 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 displays anything, but I did not succeed the buffer stays empty, 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?