From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 WJfvL/ACcWIDdwEAbAwnHQ (envelope-from ) for ; Tue, 03 May 2022 12:24:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SO7aL/ACcWLyOAAAauVa8A (envelope-from ) for ; Tue, 03 May 2022 12:24:48 +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 6FDBC1BCA9 for ; Tue, 3 May 2022 12:24:48 +0200 (CEST) Received: from localhost ([::1]:53254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlpi3-0008Ck-Ce for larch@yhetil.org; Tue, 03 May 2022 06:24:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlpgf-0008CJ-Eq for emacs-orgmode@gnu.org; Tue, 03 May 2022 06:23:21 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:36667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlpgd-0001nG-Uf for emacs-orgmode@gnu.org; Tue, 03 May 2022 06:23:21 -0400 Received: by mail-pj1-x1029.google.com with SMTP id gj17-20020a17090b109100b001d8b390f77bso1824729pjb.1 for ; Tue, 03 May 2022 03:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=XswQh26IQ0Fg5bM4hxgqUurCfeoj7+zq9Qlddk0aeYc=; b=mQoFRt/2k5RqvgEfJi7W270S+DNji+FAahMBixEmfG0+y2epB4dTMxYrnvCJB6Gno2 gI4AHgcwgC9s4lAt5hCfcNXAIPBmzOUaSXcRrh6YCryNbdiuMrfAxsFkLwK+oME7a3g/ wy0yAlOXvvAi2UItUrQXYI823f9uNM04+bOr4kZTFjxL6I7jNrtKiRKOo6W7tOUpJg12 D6gtU9UrWVZT20F5yzLmM8/G3NT7DSHBnD/asIxODmNsCP3ZCAxAtjELHzDpPdQL2nws GflPTyCEj6XPiKPNyjzDFCU556nQbd0X7f5W9NkJd2narPcI09Nqa4D//QDKm7WXr47n wqeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=XswQh26IQ0Fg5bM4hxgqUurCfeoj7+zq9Qlddk0aeYc=; b=kZzH4QdViTfqjaD+hgo6z8/CK98PzlzZQf9nH/XYwikIaq18/cXL0iSmjO2elNr6vV CCjqEBIutE5vD/1llB0FuGL5pn1aKOPvjaAy2iCbw+OpnSPcsGsfd5beLnj8SscWhAnY HNnoE0s/Msr5DJyBbCmKyNvsPruQcI4vFI2002cRxuRRCDI0GEwshY2S0sH9MJWokomY 5gC4/H0MnBXqm+qtFEVen5uVs0Zek16pA8II3rcReDoGembu8jyzlVMMuneHR+cBUNU5 eoUETv/RfiY14TujuVAR+0Bjhh2KKkknaspG5kCEmASgwnnDp493L7xq4E4EAI31IG8b gb+A== X-Gm-Message-State: AOAM53239lf/Lc4jhNpY3u3Ar5AQ+GssFKAshcXd8ZQRyS6+rrwaW4K7 G37p9Ir1o12INtV2hLgybKE= X-Google-Smtp-Source: ABdhPJxPsldi3yqfXeqE/e/XPswMnvUmaghumgcbvJMm/WP8nwP3Qp+56A8hgIoNRcrDwUymn/Q/vA== X-Received: by 2002:a17:90b:4f8d:b0:1dc:6cca:1d96 with SMTP id qe13-20020a17090b4f8d00b001dc6cca1d96mr3937996pjb.135.1651573398576; Tue, 03 May 2022 03:23:18 -0700 (PDT) Received: from localhost ([134.73.240.160]) by smtp.gmail.com with ESMTPSA id x22-20020a170902821600b0015e8d4eb24csm5943106pln.150.2022.05.03.03.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 May 2022 03:23:17 -0700 (PDT) From: Ihor Radchenko To: Shankar Rao Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] New function org-speed-command-add for adding/modifying speed commands In-Reply-To: References: X-Woof-Patch: confirmed Date: Tue, 03 May 2022 18:24:04 +0800 Message-ID: <87bkwe52yj.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651573488; 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=XswQh26IQ0Fg5bM4hxgqUurCfeoj7+zq9Qlddk0aeYc=; b=NRUCCZ1TU/M7mKcCbGFwupIHFvvFZV0CeyRlDEnqOecLw8YQpQGmLKbBxyZfsczBjZfW8y b8CXY8PfujV+jH1e1qzXUK0KAEIpw+IlgOTSilp/yH6L93IcupS4NH5WBMEyQI8oxwQdKw WzNtE72xVVXLfnAwdRzqCjBnQpAoTCrFnvpHxPat7uWuD3jB0fPV4n/Ta6VSinGL1We95p 31tAsy1pSItvOhTbZKEUIDlr0oOkMr6O7fvjoTeqaBGSVKvccxxunfPyhgPQm1KpvFltg5 aIXIX7Ab3NIUCUJKq4md7bhUZZuFZcQxtrDE0AESzFC2oEvzr0lAUtZH16Decw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651573488; a=rsa-sha256; cv=none; b=Vcgj1S2Fjbxaoio58yP7P3Ib940ii9QKREH/FbphMN2yA8PY8hsVJCDwV48SUBWmXXLDVu +BmVb3vNNeUUt8xRrhFstEMhpez6wDejc/aF+K3fPHCdazgRkyhPUcPh/PmW3NHg260meO OA+d7Us90K7ve0G2Pt/7KGYcOfTCd17m1d9K0ru0hGvcy4/P38x/S4q7QLieFn+jucmBpC GlYDFXdVGp3H4DLpchDlU/H7+F7utJPDxPyffWF322fTm3qDhblRbdEK7kTvbTtPV6tWbR yjXOGW0P7Cg+bMU2wP39xXRZgshNxUEQnPm7iE9B1R5HMXhKKvwK59OYZ/nmEA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="mQoFRt/2"; dmarc=pass (policy=none) header.from=gmail.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: -8.48 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="mQoFRt/2"; dmarc=pass (policy=none) header.from=gmail.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: 6FDBC1BCA9 X-Spam-Score: -8.48 X-Migadu-Scanner: scn0.migadu.com X-TUID: i19Rf9sanXEI Shankar Rao writes: > Over the weekend I thought about this issue of configuring > `org-speed-commands' more easily, and I believe I have come up with a > simpler solution that I have provided in the attached patch. > > This patch creates a new function `org-speed-command-add' that can be > used to add new speed command shortcuts to `org-speed-commands', as > well as modify existing shortcuts. This function takes as argument an > alist in the same format as `org-speed-commands'. For each command for > which the shortcut key is already present in `org-speed-commands', the > old command is replaced with the new command at the same position. > Commands with brand new shortcut keys are added to the user section of > `org-speed-commands'. > > I believe this patch strikes a balance between power users, who can > still directly customize `org-speed-commands', and non-experts, who > may want to add/modify some speed commands without having to > understand the structure and organization of `org-speed-commands'. I am not sure about usefulness of the proposed command. For non-power users, we have cusomize interface. It should work just fine without a need to introduce another function. Also, org-speed-command-add may behave strangely if the argument contains descriptive headline like ("My command group title") as its first element. Best, Ihor