From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QLCRCsgVpmG1mQAAgWs5BA (envelope-from ) for ; Tue, 30 Nov 2021 13:15:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id wJASBsgVpmEkRQAA1q6Kng (envelope-from ) for ; Tue, 30 Nov 2021 12:15:04 +0000 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 C28524EB8 for ; Tue, 30 Nov 2021 13:15:03 +0100 (CET) Received: from localhost ([::1]:45470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ms22H-0006tI-P9 for larch@yhetil.org; Tue, 30 Nov 2021 07:15:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms21G-0006t7-7e for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 07:13:58 -0500 Received: from [2607:f8b0:4864:20::92a] (port=35778 helo=mail-ua1-x92a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ms21E-0005Z6-PP for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 07:13:57 -0500 Received: by mail-ua1-x92a.google.com with SMTP id l24so40950027uak.2 for ; Tue, 30 Nov 2021 04:13:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UhVOSW3EXBPDqKARNUaAN7i4bmMgw2T3SmpYwfEhqTE=; b=J593UqXJzYBhoHjt5w30H+MibZfxGotcWU5HNBtIpRFlTisxxIfOHDqTNOpNbouBNd tlblXFo8Edc0FWOJO2J6nQtqi0Fr8mbEGuMJvGn8NSCNikZIYzyHRoL0wZ02gy3K8wg4 P8/glfuqVTgmSFauPwSR2rRmTQQKN/ZJh9hfYSDvGl8dSHGLcnyFVVxpIK5MWktlya05 3Z/8KJkYhFnV6VnC/PW2lAsnguZmGrtEEAI09fcKU5cFVuoZutkvrzLE8jycEdZHdxaU mZ646SfkcgLSj4KQ4WnhcaVVN42FYIkscYkzaFFF0W7zxB8j6pkq194UWVRxX8ha+3M6 qvZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UhVOSW3EXBPDqKARNUaAN7i4bmMgw2T3SmpYwfEhqTE=; b=PsipSGSAUAPrBzIghtG8mesuEaNSLtGiZz0Qqpycp60BygWngVUEa3CQuom4f8Kzh5 WCMlz4E7AE+mP/JMGGk1pZQY17+YgnBlo/vKDBsysDii+ma65cDgewCASIftBT+GllAb 5mK+B2CZ8652usLQY9h7mAI0/oRTCnPHjikvyAfzccShraQicjvdGL7lnXaDlFmSr9Me wpnNmSXzdldbsVONBY+sUlDA6TbMazkR4hDrOLEzYORBKVJj6nPApzXwExm1ocQQXYKK fKMl2q0Q3p3N8Ji60ymuQdDYkMeb5UbluO2DbTV5XA4iZv8Y9+POL1RF2P2DQ+srIVVN 2lfg== X-Gm-Message-State: AOAM530m/BO6IUpR1XDaqfs//1xXFk0pjx6RxdHKi5GYdQ41AW0YbN1E a3E7VvJZDjQdYl4VsbP7L2uVgKrwVJZHSYx+8ZCGZOjmuSc= X-Google-Smtp-Source: ABdhPJyTKmaQQ2mBEVShx5WOisyEC8oO6VnU88jFvwYLGmLgwJdiTXwJgoOxFrqgRi67g7Y587/GgybBadqJJntjd/w= X-Received: by 2002:ab0:2a11:: with SMTP id o17mr56131996uar.141.1638274435160; Tue, 30 Nov 2021 04:13:55 -0800 (PST) MIME-Version: 1.0 References: <87zgpolbnd.fsf@onenetbeyond.org> In-Reply-To: <87zgpolbnd.fsf@onenetbeyond.org> From: Shankar Rao Date: Tue, 30 Nov 2021 13:13:43 +0100 Message-ID: Subject: Re: Unintended consequences of removing org-speed-commands-user To: dal-blazej@onenetbeyond.org Content-Type: text/plain; charset="UTF-8" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::92a (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::92a; envelope-from=shankar.rao@gmail.com; helo=mail-ua1-x92a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638274503; 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=UhVOSW3EXBPDqKARNUaAN7i4bmMgw2T3SmpYwfEhqTE=; b=a+m2DMOyqAmai822f0MFZDuWw4sTbrLM+i+UvI1mur+Bz6TYKUyGIFvz5yuy0/MO8zqYfJ +bwrQoaarUOlGlmPrW2S+biYleb58yNARICwvktfZlw1aqvPilir0UCyUBJl8u6QQfBs1c HucoP3ZqUddUKbLF5o+YjO220ck7PVpJvBPaGJXM2/9S8/FylITSdlw8JzOPq4wiIWBbws 6om9YrBQvKvANLA64iQcb7gQNA2pACezgftp4ZfWsxDPmTzYEn9aORpH3hSK1JsFc6BbtW SS9Cd37Sexaj1BtWmpeJPHkMkRLIwSQH4lJ53xgh6sqYqm40xjeGPnTAAk/wqg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638274503; a=rsa-sha256; cv=none; b=musmQhyhGinK4XY8VCai5dxqP7GyIkP9meaxZDNxAJind8AfebBP4PC/vbXANZEeBvXu7G 7WKZK95fXnuln7nkF4EtgRQf1cBH70fF06XZTxU7IvBCkNznE+uviP8qQdVbog1v2KXRpo AJqIDyUYNmluYhFEj3Q77fa5jQO1RmF1+3qila0ekwqeUUoz5stkuBFu9oZBu0ZBa3IlrZ TirU/kP+Ds6Nqi+DuJIR7nIkcfxTlUJRpVR11t1n5WaDw2UMBQqnweI5TdeGkMYbtTfp/x 02uD8CEoVxlU6XZ5fITqis1f9prbKQmMXQTTTU3MHW3Hms2LBDpgkUY3mJOLYg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=J593UqXJ; 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: -4.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=J593UqXJ; 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: C28524EB8 X-Spam-Score: -4.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: /aeMNXjNbjgb Thank you for the tip. I didn't realize that `member' could be used in this way to insert an element at a particular point in a list. But this doesn't address the main issue in my post, that the user has two different approaches for adding commands to `org-speed-commands' depending on whether it is a brand new command or overwriting an old one. After thinking about it over the weekend, I believe I've come up with a simple solution that will achieve easy addition to/ modification of `org-speed-commands' without bringing reverting back to `org-speed-commands-user'. I'll submit a patch for this soon Shankar On Sun, Nov 28, 2021 at 1:15 PM wrote: > > > Hi, > > If you want to insert a new element in the list after a particular > element, you could do : > > #+begin_src emacs-lisp > (let ((bk (cdr (member '("Agenda Views etc") org-speed-commands)))) > (setf (cdr (member '("Agenda Views etc") org-speed-commands)) > (cons '("@" . my-foobarized-speed-command) bk))) > #+end_src > > Use append to insert a list of new elements instead of one. > > Also simply add a new list at the end, use append : > > #+begin_src emacs-lisp :results code > (setq org-speed-commands > (append org-speed-commands '(("my foo commands!") > ("@" . my-foobarized-speed-command) > ("&" . my-barfooized-speed-command)))) > #+end_src > > However if you define many new commands, simply redefining the whole > list is simpler ;)