From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CAPYNVjht2IGdgEAbAwnHQ (envelope-from ) for ; Sun, 26 Jun 2022 06:32:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id UGLbNVjht2LNAAEA9RJhRA (envelope-from ) for ; Sun, 26 Jun 2022 06:32:24 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E08BA9C19 for ; Sun, 26 Jun 2022 06:32:23 +0200 (CEST) Received: from localhost ([::1]:60544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5Jwb-0001cM-SN for larch@yhetil.org; Sun, 26 Jun 2022 00:32:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5Jut-0001af-H5 for emacs-orgmode@gnu.org; Sun, 26 Jun 2022 00:30:37 -0400 Received: from mail-vi1eur04olkn0827.outbound.protection.outlook.com ([2a01:111:f400:fe0e::827]:62881 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5Jup-0002F0-MA for emacs-orgmode@gnu.org; Sun, 26 Jun 2022 00:30:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JEDX7KFLmmLwn6QfAPnWnYY6GfIDmoTWagfOKDoXvm9DYeJo7Zc0SKBxe8ycaQbTozbGV3h9SyBizp5geDPzAyKXQzooB0OVA3HOxHoI5VpQt3uKUnmlkMoywHqSZ6p11Q38FyATbr+rSak1ec/NLLrUapHGLANJCqS3UblIE2vK1ozIglGXfRomQxldRqV2JoCFb3kwjo42qHDZAlkkP9S7D5P9gRFyPGuvpAmEKxti5I8uyS75NoMGzbhGHdiMbNf9H7Rw+wcjIVPpKqk4UE0Ru3sw16uZA0gTRqoSsBw63gkm0VrE9mh7qRmkPkxL6YvbPnZ0uOoXluEE5c+7sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LvRGZaashLdiejWx7EEI0SRkRFEQjSRO6L0xl70p8ss=; b=ItWEHfSDLCSh+3ZFYXf/oaEyVt+bje4Cy0BEix4rRuNG1G7zuQpszLy4ebLf4MSzHVqPTXJ8wRYRaUSZtoc9Xh2/H1f1nQwAft+w8aIDKmtJdnUCAYvy/0/7rm1V9Cg4EAGudIOTG1pyK5vqZfv2hPzlg14+cMnLHShotb8Y6JDXbkSd/i08Sme0Hc2Hm7ksAkpUfXgLQ47nqzB2xIiIfe/qNyKWMZ5chTu2JTdUc6hXAep2EtOElRPTmk6sLi/jEVlzQFINuRUuLGu0QfQQIbIkpQ1/Z0R/fI4djqwe9vjIaKYNG/h3soYZWaUMVNV8puIlRk8W/2M3KIHR0zbIiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LvRGZaashLdiejWx7EEI0SRkRFEQjSRO6L0xl70p8ss=; b=e93U4MAnjtcLoxazaZc0xJRKfXJsQgqyuAdrcvnDTg0AK1cNtfrPeFwJ2ulQ6OknAmDL7XJUvSXfo/RmAqQNTQ0DW1IaVHjFp0+0qGj5PWSqIL9iPeHj+FqDx2VfYMXNcl23BNPYB9JpgriwZGDlDABjMRoaLCAYyQYtJ9/zxVGBUP1lJikI2ITfo4sXSUseH511GD6GpUfk4kz6iO6ypURH9t//FD3thaB4BAseQ6j8vFUStQoIXSQjqzgbd2U3iou49j3vwvGybfOhyjfOllAsPcSVUYLW5kpfXIuRubE4A24DyIfUALk9b6rYp45VsYJajgCSFywqWMpI383e0w== Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by DBBPR09MB3079.eurprd09.prod.outlook.com (2603:10a6:10:f6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.15; Sun, 26 Jun 2022 04:25:26 +0000 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::1995:84ad:afa1:1f39]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::1995:84ad:afa1:1f39%7]) with mapi id 15.20.5373.018; Sun, 26 Jun 2022 04:25:26 +0000 From: Arthur Miller To: Ihor Radchenko Cc: Max Nikulin , emacs-orgmode@gnu.org Subject: Re: Proposal: 'executable' org-capture-templaes References: <87fskrobiw.fsf@localhost> <87a6ay1enh.fsf@localhost> <87edzvdb44.fsf@localhost> <878rpu5qf4.fsf@localhost> <87zgi7357y.fsf@localhost> <875ykuslpx.fsf@localhost> <87h749urjv.fsf@localhost> Date: Sun, 26 Jun 2022 06:25:23 +0200 In-Reply-To: <87h749urjv.fsf@localhost> (Ihor Radchenko's message of "Sat, 25 Jun 2022 15:32:20 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt) Content-Type: text/plain X-TMN: [3fBMD4/YMklgSpcKsCcGXLSvCN1EcwHt] X-ClientProxiedBy: GV3P280CA0079.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:a::22) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <82sfnsqcek.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7b29115-5fa1-4bc6-0223-08da572be493 X-MS-TrafficTypeDiagnostic: DBBPR09MB3079:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d0yUhscQgBjGIEfajqzV69aq+ocz8hwjdhsAUoY34GIH2RHeNx0o06163Bh5akYRiedSJbpaTmi+ivY5eGiNcluMBoaWw3+J7FH/pssEMs+gIBuTJH3TGjYDUSiPHn2nRCrQ2ApgGKihwi8oDjSeKr79CS8F/hRW/BEInYH35MaobFbW59sMHo371OpNmEOnELa2jwev70LT8fY8a/a5f8SObrEpsd60X5xiovCIxTDx7BxqdtII15vxR8NzXceVqedBdTV5ZjtulVyfcxbNr4vKK64TC/0JY/Wy9RHK2I9DRRs9oxrMBbH2XnAbtO1WEe20O5xZ2I5PunfhSjVSQxRSdqkxL3PRyOCWfBXGVPtSTIFRA9lmVDMYuYVPfDqNckixqil8t7f3VVB+yt0g7Uu4Cz7rUZB9luUkWWW7OFjQlmOiKdbOFVmk8bj2sKh7SjkOIw8YYipa37WOjlDteoRlkjzApUmEy+vmyLPQX/YKKWiGwZcs78Nbd3v4r+0LPa9uM13dJZh/EZUXsbT3FFveZJr7Q+t2rky397/CHq8pX3XLOK20V4/m20If1+pGMAJxoRLdjbEoBgF1egV88yRRs+SZdKABZqdRZdKt6YPlmJUiQTEBK5HStNab2kJM X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?MpalVPY4SLLoQY1es8+Lik4J1+wfSdaRRf+GFG+8isp+rrWoieoqB2UiVY0i?= =?us-ascii?Q?TGwd4gC+umzktbK+65mcBJ10iNhzO8Lj0wVg6WBaccmTDcuC0v7vkji6j8YF?= =?us-ascii?Q?xRRTUBesBnUIwH3pP2LFJMXMQmaY3lKRS/5derLeHmU2/O05KsY4mwq9j6lI?= =?us-ascii?Q?UoCz5uU6fBQ7CW02cav+wC/cLNdLs6+OEXmIr4B1x1RjFGwTRP2ds/Y7DsJd?= =?us-ascii?Q?NOTnTkC3JcPki62l37OtbMxgBRbI7xOYEOu2LsU8zsekOXj6MihWXcEXz3BV?= =?us-ascii?Q?uAXPSSSje+TeJ8gBnceUHbjL1bNmk+t5smAGsGDjRUFl86k0csA6u9cfVcJm?= =?us-ascii?Q?IOiutC7ugGVkEuDbs+ttbXjrgtf4U1VWx3c9AKlyhb2GFXeUWf/mFGZ+zegz?= =?us-ascii?Q?PEe2NgOKq9q5pySgIdNeFTQrl9NAGPgbTwdXI3NSnSv4y6Q2ODd5ixksM09q?= =?us-ascii?Q?5dUXd4O7RxNgcQJ67jyDAVqmF0QFdSaNFFmlfX6iczYuowDIMEN24Fa7FFm+?= =?us-ascii?Q?28Mp13EsQsSTwVqq+urIgCpplwXWZF4bIhTaZ2ZElumCGTe29WdBJc1ZS5MR?= =?us-ascii?Q?oHfLag/XA+VvnGneVa7PIdwxeGoLWHp4aORyDSIfSvRUtCxTRieNP/uo48vx?= =?us-ascii?Q?/BRnSAGamIBuejbW5Uwq7RsEFRBLJNGhxt8YfHA01dLAp++/KXe6gomykRGy?= =?us-ascii?Q?0Zuk+k9BgQ8HXrNcdZWAEchOBDsiWHYc/6xbrPEgGeqFrBhMGT11UAkPaaqT?= =?us-ascii?Q?OrIffdjp5T2B+Ja6C8ref6ug3tlkf1NHinJI4l0LJralm8gUvqQtymKupgLx?= =?us-ascii?Q?ixjri/zGPQoB8e52mPTTYSSKtkdrzJ602FJYs1yjBtePDTKioTADQncPy7Wa?= =?us-ascii?Q?DgtOOo4z2s3VppN4gHY/IDez6kiluCBD13os0wIaF9ndiHn9ICK8KQS93w9G?= =?us-ascii?Q?2UlNbTcihF0Cw5Lr9im6foZm5RtHLCD/zsJYoorcCSWRy74S7+EBdItuTE/m?= =?us-ascii?Q?kK5CKzq2rx+hOFgvFZDexi3oBoGO0x4jtYm9qS3HBvnu2U8X+ucPGc945pC7?= =?us-ascii?Q?t96Sg2vclVSxi9xPQC4j5ZaCwZv6LSgABxq7ulPAVV/nRDGQONvD22B5REPm?= =?us-ascii?Q?O7XZ8cTC2Ed8CzUVdvD2+83HccxGfnrUuOaRope9WjtOTRkpUD4SIGy9ZB3r?= =?us-ascii?Q?pEm95cb6J2q5kukQgByeQjU9OQ97eswNbFzeJPrYyj/r/ju+DD7/toMRaJEc?= =?us-ascii?Q?aTtng268is5aBZE1NBjK2PpMPYHgGmxxboWNEpXrzA=3D=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: b7b29115-5fa1-4bc6-0223-08da572be493 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2022 04:25:26.0446 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR09MB3079 Received-SPF: pass client-ip=2a01:111:f400:fe0e::827; envelope-from=arthur.miller@live.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1656217944; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=LvRGZaashLdiejWx7EEI0SRkRFEQjSRO6L0xl70p8ss=; b=aI2AREJFRGJgC04XXfmjVAzYHA0Z1AiNTt5o7fBb6VeV3BUGnch8HRkHHTpDLXqvrdO2ws ME0qfArPb+VbSYrbxBujYMMe/MaUv0Hm5PhUbgqiLpRjofNB3yIMiXIuwzS94RtBLKGQ+k wdm2BORL1lXIN5Qz2VR3Ca994mKB/7WwarHWOURx3FE7t5B/tEJelVyz6NPrSwOY4ggFoS b29DgaT6nkaheUdhktuGRhXp1T1lOx8X9DeH/poCd0Ao4iF/BV631AN7/f7voEiqTGAzCS yRXXUixvf4GCb5DXnTVJXXjkc2I8wDCkc0x4g9DvSetvRlm5T+lN7bwJGunnlg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1656217944; a=rsa-sha256; cv=pass; b=UqmWVHmhQQaaC3nzCQ2gqDCE/QHcOJLJR4aLxn6d6+5K4sC7FlQwi/tdxllBK+rYd5W78a A4bVkQs0FqNKqsvwjCd1yWN6l70B32bEGBawgSKK6yIIztfoS49b134qEAnv6CmvA+U0UI WCq/AcA8Q5sqTmEZbe82ZlX4APGSL6DehZyiwML/PBjt4BMOwZYpnzI8u0aRoe5UYlGqwQ /5pNDnjsm+Z/KlsNoKZTylCML7T1l7OZjHAjCiXxuexIQFumAChr/rpTboKmLSys7Nn54+ DGYw/oDMaxtyNUeVwjmjA1Uj9G2UX3Mx9xWG1jlFXKO1IEDZx2SwAOpGR1ORfA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=live.com header.s=selector1 header.b=e93U4MAn; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=live.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.26 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=live.com header.s=selector1 header.b=e93U4MAn; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=live.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: E08BA9C19 X-Spam-Score: -5.26 X-Migadu-Scanner: scn0.migadu.com X-TUID: 1v0VMOslV8X4 Ihor Radchenko writes: > Arthur Miller writes: > >> I have reworked a bit org-capture, but I haven't yet worked on org-agenda >> restrictions and other details. > > I do not think that you need to prioritize re-creating > org-capture/org-agenda/etc The main point is making sure that org-select > provides the required functionality. That is just my way to test if it provides features needed, and how they would reflect on real use-case such as org-capture and org-agenda. It is just for demo purpose so to say. > I'd prefer to first finalize the API and get a cleaner code of > org-select itself. Yes, that is my goal too. I just thought it was illustrative in context of those two. >> (define-minor-mode org-select-mode "" >> :interactive nil :global nil) > > Why don't you just make it a major mode derived from special-mode? It > will make more sense considering that you are setting special-mode, > keymap, etc. I don't remember any more :). The first version I made was derived from special mode, but than I switched to minor mode. I don't remember why atm, to be honset, but I don't think there is anything prohibitive to derive it from special mode either. >> (defun osl--prop (property list) >> "Return value of PROPERTY from irregular plist LIST." >> (cadr (member property list))) > > FYI, there is plist-get Yes I know, I have been using it. However this one is a bit different. plist-get works on regular lists, this one works on irregular. This one just match key-value in any list, or to be correct, it matches key and return next element as the value. I should have documented, but I meant to document them later on, this is just for my testing and demoing. >> (defun osl--init () >> (buffer-local-value 'osl--init (current-buffer))) > > This is no different than just saying osl--init. > >> (defun org-select-abort () >> (interactive) >> (org-select-quit "Aborted")) > > Please make sure that all the functions and variables have docstrings. > This is not just a boring convention, it really helps when you come back > to the code in future and when other people are reading your code. Yepp. As said, this was just while I am testing and demoing. Since I tend to change lots in the code, I am finding myself constantly typing and erasing stuff, but I guess I should have been more clear when sending in code to others. I also forgott to make patch and sent in everything, wasn't really meaning :): >> (defun osl--longest-line () >> "Return the length of the longest line in current buffer." >> (let ((n 1) (L 0) (e 0) (E (point-max)) l) >> (while (< e E) >> (setq e (line-end-position n) >> l (- e (line-beginning-position n)) >> n (1+ n)) >> (if (> l L) (setq L l))) >> L)) > > Please do not use single-char variable names for non-trivial variables. > It is always better to provide self-explanatory names. It is not a > programming context. We are targeting better readability, not fast > typing. Ah, that one is special :). e = end, l = line length L = longest length. I espect myself to rework that one, but yes normally I use self-docummented code. Sure np, I'll try to not send in short-named ones. >> (dolist (menu menus) >> (cond ((symbolp menu) (setq menu (eval menu))) >> ((symbolp (car menu)) (setq menu (eval (car menu))))) >> (let ((handler (osl--prop :org-select-handler menu))) >> (when handler >> (setq menu (delete :org-select-handler (delete handler menu)))) > > Destructive modifications of arguments is a bad idea. I expect future > bugs in such code. Please avoid this approach. Ok. I can rework it by copying the list, but I am not sure if it adds much of the value since the original one is not used after this point. But if it is believed to lead to bugs, I can of course change it, its not a problem. >> ;; we send in the entire menu so we can return next piece in chain, >> ;; but *the* entry we work with is just the very first one (car menu) >> (defun osl--do-entry (menu handler) >> "Display a single entry in the buffer." > > AFAIU, the comment on top belongs to the docstring. At least the part > talking about the return value. If the function is expected to return > something, it should be documented. Otherwise, I expect bugs in future. Ok. >> (defun org-select-run (entry &optional _org-select-buffer) >> "Try to execute form found in ENTRY if any leave ORG-SELECT-BUFFER live. >> >> This handler provides an easy way to use the framework for the simple >> use-cases for multiple choices. It relies on the user to press built-in choice >> `q' or `C-g' to exit the menu." > > Please, do not use key bindings verbatim in docstring. Prefer commands. > Docstrings do have special format for auto-detecting command bindings. > See D.6 Tips for Documentation Strings section of Elisp manual. Allright, I didn't know about key bindings format in docs. I'll check on it, thanks. >> ;; given a list of menus, display one menu at a time >> (dolist (menu menus) >> (cond ((symbolp menu) (setq menu (eval menu))) >> ((symbolp (car menu)) (setq menu (eval (car menu))))) > > Please avoid eval when possible. It can behave not nicely in > lexical/dynamic scope. > >> Each menu can be followed by some properties in form of a keu-value >> pair. The > ^key >> entire menu or entry does not need to be a regular plist. Following keys are >> recognized: >> >> :org-select-pin Pin this menu in org-select buffer. If group nodes are used, >> when this option is `t', keep this menu visible even when >> descending into a submenu. ;; FIXME Not implemented yet. >> :org-select-handler Use this function to handle this particular menu or >> entry. When none is specified, org-select uses >> `org-select-run-once' to hande the menu. Entry handler >> takes precedence over menu handler. > > This is confusing. What do you mean by "does not need to be a regular > plist"? What do you mean by "menu can be followed"? Do you imply that > MENUS may not be a list of MENU lists, but can also contain :key value > pairs? Yepp. That is also the reason for osl--prop above, and why am I using "destructive approach" when I remove the handler from the list before rendering it. Consider simple case of (key label form) that can be executed directly as in tests at the end. I can than add a key-value pair like, and get the value with osl--prop. Otherwise (key label form) would need an extra keyword or some other mean: (key label :form form)? > In general, I'd prefer format similar to > https://github.com/progfolio/doct/ > or at least similar to org-capture-templates > The global ARGS in org-select could be defined using cl-defun style. See > 2.1 Argument Lists section of CL manual. Ok. I am not familiar with doct, but I did try to keep it similar to org-capture-templates. Or at least it must start with key and label: (key label ... ) rest after label is user data. This entry will be passed back to user callback if user specify a callback. The special case is a simplistic case where client code does not have any data but will just like to have a lisp form executed when user chooses a key. That one is (key label form). I think that will be the most often use-case. That would provide for really simple way to create menus, so I would like to make the most often use-case the most simple to use too. In more general case, as in org-capture for example, I exect client code to pass in a handler and parse its user data itself. If I relate to Max last mail about C structs and void* to user data, that is pretty much that void* user gets. Org-capture define its own "template language", some other project could define their own, etc. The only thing this library cares about is the first two elements so it can draw stuff in buffer and create mode-map to execute commands. Thank you for the input and sorry for sending in the entire program instead of just patch, I tottally forgot it and remembered first long after I sent the mail. I'll definitely think about all the issues you bring up, and hear from me when I have reworked it a bit more. best regards /a