From c15e56ebb4a7c770685836bd73b9bae306017ae0 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Fri, 8 Nov 2013 17:40:13 +0000 Subject: [PATCH] [PATCH v3 1/7] emacs: help: check for nil key binding --- 70/e5eaf778c4ed984ae440a2375b5d2375f0bb8e | 89 +++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 70/e5eaf778c4ed984ae440a2375b5d2375f0bb8e diff --git a/70/e5eaf778c4ed984ae440a2375b5d2375f0bb8e b/70/e5eaf778c4ed984ae440a2375b5d2375f0bb8e new file mode 100644 index 000000000..fa9ec3033 --- /dev/null +++ b/70/e5eaf778c4ed984ae440a2375b5d2375f0bb8e @@ -0,0 +1,89 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 08470429E34 + for ; Fri, 8 Nov 2013 09:40:34 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id laTlFS4PFNjX for ; + Fri, 8 Nov 2013 09:40:26 -0800 (PST) +Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com + [74.125.82.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 5F3F8431FC9 for ; Fri, 8 Nov 2013 09:40:26 -0800 + (PST) +Received: by mail-wg0-f43.google.com with SMTP id b13so2281417wgh.22 + for ; Fri, 08 Nov 2013 09:40:25 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=xDDQSNwLsLqTF5/Zqcw1bxW3Ho9rooKvpKamKJLI6xc=; + b=cybXtYBOuFoE7gjH0KX9G+mXi9IM9u3duVkL/DDOjGMIixsv3RNPXSXYD24d94J7zp + oJmniuIw3v86P6WLf8cxDn0fEP0UAiRKddudQ23yd8F/BwKTZImuszDwKn8COyNhkFhu + xk1k5BrUpVpbAGzf9UIAUINYXk8LmeHD14Y/jhx2FNttlMgEZbkUfV+b7D72yZdWGH53 + 6qYlZosvEkV1SdBHO3L4WEy/+XpMSuk4/uVmYHJPR5bsn0dNxiYPr2yC41h45d00DcV+ + PE+7NMfl6m2D82/A2lBn93u0EFgqWbmyaJiMJqCx2L0U+FgPoBCoYQtp+e6oqMJvPCMm + KaRQ== +X-Received: by 10.194.109.167 with SMTP id ht7mr8768631wjb.5.1383932424932; + Fri, 08 Nov 2013 09:40:24 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id c10sm7507475wie.11.2013.11.08.09.40.24 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Fri, 08 Nov 2013 09:40:24 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v3 1/7] emacs: help: check for nil key binding +Date: Fri, 8 Nov 2013 17:40:13 +0000 +Message-Id: <1383932419-12533-2-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1383932419-12533-1-git-send-email-markwalters1009@gmail.com> +References: <1383932419-12533-1-git-send-email-markwalters1009@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 08 Nov 2013 17:40:34 -0000 + +A standard way to unset a key binding is local-unset-key which is equivalent to + (define-key (current-local-map) key nil) + +Currently notmuch-help gives an error and fails if a user has done this. + +To fix this we only add a help line if the binding is non-nil. +--- + emacs/notmuch-lib.el | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el +index 921ed20..ec5a2cb 100644 +--- a/emacs/notmuch-lib.el ++++ b/emacs/notmuch-lib.el +@@ -254,7 +254,7 @@ prefix argument. PREFIX and TAIL are used internally." + (setq tail + (notmuch-describe-keymap + binding ua-keys (notmuch-prefix-key-description key) tail))) +- (t ++ (binding + (when (and ua-keys (symbolp binding) + (get binding 'notmuch-prefix-doc)) + ;; Documentation for prefixed command +-- +1.7.9.1 + -- 2.26.2