From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 yDRoOwkdbWL4VwEAbAwnHQ (envelope-from ) for ; Sat, 30 Apr 2022 13:27:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id +NCmOgkdbWIucAAAG6o9tA (envelope-from ) for ; Sat, 30 Apr 2022 13:27:05 +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 974042A038 for ; Sat, 30 Apr 2022 13:27:05 +0200 (CEST) Received: from localhost ([::1]:56880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nklFg-0008RZ-Dw for larch@yhetil.org; Sat, 30 Apr 2022 07:27:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nklEB-0008RR-TV for emacs-orgmode@gnu.org; Sat, 30 Apr 2022 07:25:31 -0400 Received: from mout02.posteo.de ([185.67.36.66]:58261) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nklE9-0003Nm-VJ for emacs-orgmode@gnu.org; Sat, 30 Apr 2022 07:25:31 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CDC38240107 for ; Sat, 30 Apr 2022 13:25:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1651317927; bh=ifetXKJFeL+vXXQ11VTEbxDqokZhnWEjotbujpBJIkM=; h=From:To:Subject:Date:From; b=RDx7opttNCv93VkBJyknBONf2Uk9yTCBwEMsGilmaYRMZqKCLyrr65YAiqsTzI/Vp 9c+o1zB/zbQpWKPe/RjZBIWoil45N2QuFlt6TpApW9o8XQQbubpkHQA6j1qeJtXO6l RYSsmzPPqdS7ucW2CHcpt8CCJVZuxDUaghNrAbPE1+iT/KyW/6uk8lGhnduTvL+roN Rfx5wfaYEuVONHLcLhP+H5xgMmVDqYzmdI2pt0wdoTQhVjn7GCxslet4oNz978gJAg ApootYbkgSd6FuICWyAFGwyk4mSagNoWm9vUb5y8ci93yPo09JYi2os6TVOaGLa92u wqnWGKfDspzYg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Kr6Tz1Cfjz9rxH for ; Sat, 30 Apr 2022 13:25:26 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: orgmode Subject: [PATCH] speed commands: error message when a key is not associated with a command Date: Sat, 30 Apr 2022 11:25:39 +0000 Message-ID: <87pmkyvmmk.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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=1651318025; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=VOZtbpFEYuvRdagn6OcMahiKcUx0jvBHxDIeI+07R6o=; b=Ty6zCJcYftjHVrXyHZCGpgP9LvNCR6pIsyUGcDY9F7eYPhusif9VRaryiWyReCTZWcCy0n HwHuhPLIuhUIqeU1GJTrpBrY83WarU+xJB+X6C8/BLNbWaxKOmcWmLdUteMdyDYr482ffV Xu1oeqOsKIFpW3MMC41vGlLGx08I5rNnpSj+Iqxv0tqPieYI/imzCr3Iy9EMPEH1WuSZj2 b2aR7FWDpGCIMqiC4ns1dB2/YI+8Cede8j1CU3yQjy4MluuMel9JO3R0x6tdDBJMVsW66k 5hkcCn5eZD1V7+1nMtHdQuOHbIxin0zyfcCWf2IIN07+57URf/1b6808/Lf49g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651318025; a=rsa-sha256; cv=none; b=UsOKpMRlusa8bu6crZPGSbHiOigbh7VpPjM+9wI10Fg85RQvm4lFtEMVF8DIN/khGzNnTl VMBnA0mgRUL0hyHebd9zb9AudQPWxcaYWaLm3W8QiZFK5mX+//4/G3FYpUTvFj2jlWf3lx u8DQ43cm8Mw72jSCJEsPkDp6Ev7yAxpCCPaqr89w6rmuk005PKuWDmgVS5+LmVygg+14Dp FkNuEAvvulMms4M5YGXChsAjutcjgSmNpdtmpLDq6OJ6fc/PpSOmV+POa7YGWumcQVv3vE lNrCNqVvp9N7i7pDqhNKUprZtjDtW32UcrE2e8j3fj7gXztmTdCsAXUuuqDEvw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=RDx7optt; 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.60 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=RDx7optt; 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: 974042A038 X-Spam-Score: -2.60 X-Migadu-Scanner: scn1.migadu.com X-TUID: dbffYTK0xRyB --=-=-= Content-Type: text/plain Hi, If we have speed commands activated and we type (by mistake) a character not associated with a command, the letter is printed at point. I think a more appropriate behavior would be: - key associated with a command: the command is activated - key not associated with a command: an error message is displayed. Attached a patch with that modification. Best regards, Juan Manuel --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-org-keys.el-error-message-when-speed-command-is.patch >From fd380f41420aef9bc91baede9d4cd2cb7eadee0a Mon Sep 17 00:00:00 2001 From: Juan Manuel Macias Date: Sat, 30 Apr 2022 13:00:02 +0200 Subject: [PATCH] lisp/org-keys.el: error message when speed command is not defined * (org-speed-command-activate): If a letter is not associated with a command, an error message is displayed instead of typing the letter. --- lisp/org-keys.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/org-keys.el b/lisp/org-keys.el index 782ffa871..a850abb4f 100644 --- a/lisp/org-keys.el +++ b/lisp/org-keys.el @@ -835,12 +835,14 @@ See `org-speed-commands' for configuring them." (when (or (and (bolp) (looking-at org-outline-regexp)) (and (functionp org-use-speed-commands) (funcall org-use-speed-commands))) - (cdr (assoc keys - ;; FIXME: don't check `org-speed-commands-user' past 9.6 - (if (boundp 'org-speed-commands-user) - (append org-speed-commands - org-speed-commands-user) - org-speed-commands))))) + (let ((defined (cdr (assoc keys + ;; FIXME: don't check `org-speed-commands-user' past 9.6 + (if (boundp 'org-speed-commands-user) + (append org-speed-commands + org-speed-commands-user) + org-speed-commands))))) + (if defined defined + (error "Speed command not defined: \"h\" for help"))))) ;;; Babel speed keys -- 2.36.0 --=-=-=--