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 gL9vHjO9cWIjGgEAbAwnHQ (envelope-from ) for ; Wed, 04 May 2022 01:39:31 +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 uNiMHjO9cWJMLwAA9RJhRA (envelope-from ) for ; Wed, 04 May 2022 01:39:31 +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 A2CF53D943 for ; Wed, 4 May 2022 01:39:30 +0200 (CEST) Received: from localhost ([::1]:51728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nm277-0005uz-HA for larch@yhetil.org; Tue, 03 May 2022 19:39:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nm1di-0000uY-4v for emacs-orgmode@gnu.org; Tue, 03 May 2022 19:09:06 -0400 Received: from mout02.posteo.de ([185.67.36.66]:47137) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nm1dg-0000E7-7e for emacs-orgmode@gnu.org; Tue, 03 May 2022 19:09:05 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id BD138240108 for ; Wed, 4 May 2022 01:09:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1651619340; bh=BhtrAXhhkriuROy/3di0W2tkOfQJAt6892d/hPS49Rc=; h=From:To:Cc:Subject:Date:From; b=Z7jP+bCWeLMgHgTpORgqN9yXnJNsOxhmo+ZW3pC+AwSF3JfaLmYqQJccxMPSnKM89 amelhUbdmTqO3gNjV75VmWggJ99hoAR4vjtU+NA+3FzZ11ZvgZCVO1P8cl62OXZbhz bdwJD+aMEdHPLC8pNCg9W0f4f1X/8nCCBVFdaNjbAAnOIr0qsitl6rxNQDOc6WZVId 3R4TDpkb+6Vm2Zwd5f9KjmGlmZL2+M4Xoo19D5ID07LDYhtgCw7r6Q56TUlHIIa6Ps cCqApJgRpTF6oS7ObZ2WeyqcXzWlJMIht5tfy+etrdALFLlLwnn2LUs9YvDBFCI3dL BMFnu4/oW2HUA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KtFyM5rPNz9rxL; Wed, 4 May 2022 01:08:59 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Ihor Radchenko Cc: orgmode Subject: Re: [PATCH] speed commands: error message when a key is not associated with a command References: <87pmkyvmmk.fsf@posteo.net> <87y1zm7ma5.fsf@localhost> <87k0b6vdkx.fsf@posteo.net> <877d757vg3.fsf@localhost> <87ilqp8qml.fsf@posteo.net> <87czgwvce1.fsf@localhost> Date: Tue, 03 May 2022 23:08:58 +0000 In-Reply-To: <87czgwvce1.fsf@localhost> (Ihor Radchenko's message of "Mon, 02 May 2022 11:31:18 +0800") Message-ID: <871qxai585.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=maciaschain@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, 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=1651621171; 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=ZT6ZI2ZCE8IXJVCu4r5HKddKPXXCCwJojE+rzixFp3c=; b=IFLNfQMv5drWy6eLK0TM4tFpbB2VxDJ+WKZ1gyh0OhKRF9LeQu81XF8qz893u4prRuDlWO Uv2gJJ+0Xknst4ZJ31UYMLqYB6Bn66f49vRHAzbF3IDl57xGnAVxjzwkdhOrjMkdPMfxYa qzTLxftbNXpNoRdWs9Xc9oEhzoVH/dUStU7TqTESToJDj/GkCXMKlcNB5NaUktyg3NYH6k Gu6OnOMymbqiCTqlvxgVGHnXcamMKnxxYFvHEe//IMcMQsV3SRurNnOQmPZghPA1w3jZM9 LpVaelNqOU8WZlZoD9kpvqmCXMNzfD3RTfbRQiWy6B1qFxegw/wcjd2TgRG39Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651621171; a=rsa-sha256; cv=none; b=DBifgxLiPWDiZ9j9rIhE6dS6GKDP0rHi97H+H80ZJvT0T8GeD5U0A5J9EKMG9zaW+kppr6 0vQJdjy9qT0OR7bcxuwwYeVVUdHWa7EOXnJLBTXTW80wj/1hWYw0zX2dPQx1UL7lx+hq4e ShCZK3lO6fDLvc6fQTmCcJBarVc6JAZL361JGa39q/tffV5hIttYJtVwz8Pgcb9Fo86+g/ BZ0HujjtoR/tcqjNs+1l2Cp3jWMSrTXpqWuhxWIMMHxg/cnBury4BifwCF5PESaTPylP2o YlEDC/+HDr9gZvvOK6bqY0223o6IPUwy/y2/yp6BpSeMXbyX5EAzeMhsqr8RxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Z7jP+bCW; dmarc=pass (policy=none) header.from=posteo.net; 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.48 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Z7jP+bCW; dmarc=pass (policy=none) header.from=posteo.net; 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: A2CF53D943 X-Spam-Score: -5.48 X-Migadu-Scanner: scn0.migadu.com X-TUID: WJDVJrE6lQjF Ihor Radchenko writes: > It is more complex and I do not see a clear benefit of introducing a > whole new hook. It would only be useful for people who define a large > number of extra speed command handlers. Yes, I agree. Also I'm afraid that this idea of mine added a drawback as a bonus track: it would be necessary to modify all the functions that activate the speed commands because, otherwise, it would return an error anywhere outside the activation contexts. Precisely because of this: (pcase (run-hook-with-args-until-success 'org-speed-command-strict-hook _) ('nil (error "Command not defined: \"?\" for help")) (symbol (run-hook-with-args-until-success 'org-speed-command-strict-hook _))) And I suppose that the functions should consist of a conditional of the type: "if the context is given -> activate the speed commands, otherwise -> self-insert-command". Or something like that. Too hacky. On the other hand, I now seriously doubt whether a patch would be worth it, even if a defcustom was added. I think you're also right about what you said at the beginning: considering how speed commands are designed, it's hard to implement a clean, general solution. I think I'm going to leave this patch in the fridge for now, though I also encourage other potential users of speed commands to join the discussion. (Perhaps, instead of a patch, some tips could be added to the manual (or to any other relevant site) so that users who want to extend this functionality apply this type of hacks, as I have done in my particular case...). Best regards, Juan Manuel