From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.devel Subject: Re: Emacs Lisp's future Date: Tue, 30 Sep 2014 21:18:47 +0200 Message-ID: <87wq8kgbmw.fsf@gmail.com> References: <87wq97i78i.fsf@earlgrey.lan> <87sijqxzr2.fsf@newcastle.ac.uk> <877g11c8wh.fsf@gmx.us> <87wq91uhe8.fsf@newcastle.ac.uk> <87k3508oie.fsf@gmx.us> <87mw9mqqb2.fsf@bernoul.li> <874mvufdes.fsf@earlgrey.lan> <87mw9iu8p8.fsf@newcastle.ac.uk> <87vbo55ykd.fsf@gmail.com> <871tqtozj9.fsf@ferrier.me.uk> <877g0lgeab.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1412104764 7599 80.91.229.3 (30 Sep 2014 19:19:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Sep 2014 19:19:24 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 30 21:19:16 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XZ2xA-00072X-5Z for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2014 21:19:16 +0200 Original-Received: from localhost ([::1]:45254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ2x9-0005tx-O5 for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2014 15:19:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ2x1-0005oJ-1A for emacs-devel@gnu.org; Tue, 30 Sep 2014 15:19:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZ2wv-0005yN-MK for emacs-devel@gnu.org; Tue, 30 Sep 2014 15:19:06 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:48741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ2wv-0005yF-GN for emacs-devel@gnu.org; Tue, 30 Sep 2014 15:19:01 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XZ2wt-0006vh-Lr for emacs-devel@gnu.org; Tue, 30 Sep 2014 21:18:59 +0200 Original-Received: from g231235229.adsl.alicedsl.de ([92.231.235.229]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Sep 2014 21:18:59 +0200 Original-Received: from tjolitz by g231235229.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Sep 2014 21:18:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 98 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231235229.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:x2alR/QLFKH2xoz2a3J0jxliI6I= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:174885 Archived-At: Thorsten Jolitz writes: > Nic Ferrier writes: > >> Thorsten Jolitz writes: >> >>> phillip.lord@newcastle.ac.uk (Phillip Lord) writes: >>> May be an Org table would be a good input format: >>> >>> #+BEGIN_ORG >>> | (key . fun) | | | >>> |-------------+-------------+-------------| >>> | | | | >>> | (key . fun) | (key . fun) | (key . fun) | >>> | (key . fun) | (key . fun) | | >>> | | | | >>> | (key . fun) | (key . fun) | | >>> |-------------+-------------+-------------| >>> | | (key . fun) | | >>> #+END_ORG >> >> >> You should totally do this. I'd love to play with it. > > 'discover-context-menus' look like this: > > #+BEGIN_SRC emacs-lisp > (dired > (description "DIRectory EDitor") > (actions > ("Navigation" > ("DEL" "unmark backward" dired-unmark-backward) > ("RET" "find file" dired-find-file) > ("SPC" "next line" dired-next-line) > ("<" "prev dirline" dired-prev-dirline) > (">" "next dirline" dired-next-dirline) > ("^" "up directory" dired-up-directory) > ("j" "goto file" dired-goto-file) > ("i" "maybe insert subdir" dired-maybe-insert-subdir) > ("n" "next line" dired-next-line) > ("p" "previous line" dired-previous-line) > ("v" "view file" dired-view-file) > ("w" "copy filename as kill" dired-copy-filename-as-kill)) ...)) > #+END_SRC > > and it could easily be derived form an org table: > > > | Navigation | | > | (DEL . dired-find-file) | (RET . dired-find-file)| [Ups, sorry ... did C-c C-c in the table, but wasn't in Org-mode but in message-mode, so sent the message accidentally] Calling 'org-table-to-lisp on this table | Navigation | | | DEL dired-find-file | RET dired-find-file | yields: (("Navigation" "") ("DEL dired-find-file" "RET dired-find-file")) Using that as arg for this (imperfect) mapping function #+BEGIN_SRC emacs-lisp (defun tj/org-tbl-to-context-menu (org-tbl-as-lisp) (mapcar (lambda (--row) (mapcar (lambda (--cell) (let ((cell-split (split-string --cell " " t))) (if (eq (length cell-split) 2) (list (car cell-split) (mapconcat 'identity (split-string (cadr cell-split) "\\(?:dired\\)?-" t) " ") (intern (cadr cell-split))) cell-split))) --row)) org-tbl-as-lisp)) #+END_SRC yields something (at least somehow) similar to 'discover-context-menus': #+BEGIN_SRC emacs-lisp ((("Navigation") nil) (("DEL" "find file" dired-find-file) ("RET" "find file" dired-find-file))) #+END_SRC but to make it useful, makey.el would need to consider empty tbl-cells as well as empty tbl-rows as well as hlines when drawing the UI grid. -- cheers, Thorsten