From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +I+XJq6QbWKw4wAAbAwnHQ (envelope-from ) for ; Sat, 30 Apr 2022 21:40:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id iO+YJq6QbWI9JQEAauVa8A (envelope-from ) for ; Sat, 30 Apr 2022 21:40:30 +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 A81AC3DE00 for ; Sat, 30 Apr 2022 21:40:29 +0200 (CEST) Received: from localhost ([::1]:34508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nksxA-0006SA-NF for larch@yhetil.org; Sat, 30 Apr 2022 15:40:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkswd-0006S0-3C for emacs-orgmode@gnu.org; Sat, 30 Apr 2022 15:39:55 -0400 Received: from mout02.posteo.de ([185.67.36.66]:43771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkswa-0004hQ-VF for emacs-orgmode@gnu.org; Sat, 30 Apr 2022 15:39:54 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id C6767240107 for ; Sat, 30 Apr 2022 21:39:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1651347586; bh=zdEOt+SYuxnuimmJ8aflNTH6bVYWXrI/58eytQwgj2Q=; h=From:To:Cc:Subject:Date:From; b=fY+rT3Jjt5DVdWLVMRuIU95JVV/1+ckFFU1WeR0ahGeRBv4emjPiyCgXtznQpA3P+ yyZjrdVR6xL6BiJMk7ANNzq47nac6PZaFrCkJ7DCL4T2ZjJa+fV9e1rhmcGV8t+rkv yMCSdwP4Jc+4TSLBr2LakHz1z77zjG0Nj4Kgy/SmZeKIgG+EU3p2z8cYztqbza2TER Edar5KVw0xVITt0QmQI6WnnjXGhiVkZvfU1amt0+sa2PXqTRSMwVf1PcEKvjw+bb6d CAGecuRgNkC9JIM3qnYw4R4zAEcuTnltcyIdIl2PjdEfMMu2RRWa4cMIT7PHogBUtY ypmG62qGWwxGw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KrKSL12GTz9rxP; Sat, 30 Apr 2022 21:39:45 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Ihor Radchenko 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> Date: Sat, 30 Apr 2022 19:39:59 +0000 In-Reply-To: <87k0b6vdkx.fsf@posteo.net> ("Juan Manuel =?utf-8?Q?Mac=C3=AD?= =?utf-8?Q?as=22's?= message of "Sat, 30 Apr 2022 14:41:02 +0000") Message-ID: <87v8uqmkc0.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: , Cc: orgmode 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=1651347630; 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=5VE8hWbevmKj0sfvrEMzIQWhrivx3hO9ZHnd6LFR/vY=; b=mTFkwskwwY8t8GF5lVyENPHeKK+xYe5ReS07/j7C5RJzV6rILSaN2oUjxyFtNwD1ISJfoP XoUx/UDhr53QASVW51E4Mzxj7kWMXHu4UNVeaPcSV1rwGBB1QMqoHokWvwlc/L+o0FY/hr pNnIo931mQxcuHsT5UhK5UPtIrEJjr1KUl9h9zL/J5enMJME7/aDnA0hx7xuKmmwKHaYfN vrwAtliUd+pMeD6j+bWTlAt3V2IZKlLW4c0fr7N8Ma/As0STHBC8/Tz/csYkq1WPMyM5Wo aeoHtqHNopOh+jx2C2hTdqsOLrEwanhMu03ihmDr26AMNvnMnJQidAm6sjBy8A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651347630; a=rsa-sha256; cv=none; b=cH7iUvnMJ3Djf7MS0S0ediDmzet8AXaOZ6wdbEY2dn7rYdrkKQsRqVhCvjBg4V+w/4QKSr wA0bp1FKOrumIhdkhhswlsuPXW+OXPKg/DLRFfAHTTjQxladwEMoKl/d9UVAyJVXY6AHZb V0v5y9Jel8Z3HRRztBVDXqRy2yw8lvz290/2zozf9Bp0wTsoEHFm9am46iKpxOLR5pt5mK XzMMCpHy002Su3qCnz9bQmnPnNCrg9cW7L6JJMRkWMHVc6V7GhP9ggmZotJEosyAs/ilHT +oMXVD12Wt8A+Z1DW7GgeVFKFfLSZ74J+tKIPuh8+7xi1AAl4vnLXdnfvxiVUQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=fY+rT3Jj; 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: -2.70 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=fY+rT3Jj; 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: A81AC3DE00 X-Spam-Score: -2.70 X-Migadu-Scanner: scn1.migadu.com X-TUID: Rd0wScSIzgvu > Ihor Radchenko writes: > >> Note that speed commands are not only decided by >> org-speed-command-activate. Any function in org-speed-command-hook can >> trigger speed command. Throwing an error in org-speed-command-activate >> can potentially shadow other functions in the hook. This other, more general solution has also occurred to me, although I don't know if it's too tricky :-). The idea is to define an org-speed-command-strict-hook. Something like this (I haven't tested it much), and probably have its drawbacks: #+begin_src emacs-lisp (defcustom org-speed-command-strict-hook nil "TODO" :group 'org-structure :version "24.1" :type 'hook) (defun org-speed-command-strict-function (_) (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 _)))) ;; no strict speed commands (default values): ;; org-speed-command-strict-hook: nil ;; org-speed-command-hook: (org-speed-command-activate org-babel-speed-command-activate) ;; when strict speed commands: (setq org-speed-command-strict-hook '(org-speed-command-activate org-babel-speed-command-activate)) (setq org-speed-command-hook '(org-speed-command-strict-function)) (defun my-org-toggle-speed-commands () (interactive) (if org-use-speed-commands (progn (setq org-use-speed-commands-on org-use-speed-commands) (setq org-use-speed-commands nil) (message "speed commands off")) (setq org-use-speed-commands org-use-speed-commands-on) (message "speed commands on"))) #+end_src Best regards, Juan Manuel