From ca4a16962ff30dc0a6c670fc64837d7d3d4d1945 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Tue, 12 Nov 2013 20:10:53 +0000 Subject: [PATCH] [PATCH v4 1/7] emacs: help: check for nil key binding --- ac/d83f110d2152e2f3b35db15ab14e3392146f2e | 89 +++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 ac/d83f110d2152e2f3b35db15ab14e3392146f2e diff --git a/ac/d83f110d2152e2f3b35db15ab14e3392146f2e b/ac/d83f110d2152e2f3b35db15ab14e3392146f2e new file mode 100644 index 000000000..9490160e1 --- /dev/null +++ b/ac/d83f110d2152e2f3b35db15ab14e3392146f2e @@ -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 84747431FDD + for ; Tue, 12 Nov 2013 12:18:39 -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 ZNRluIwa++h3 for ; + Tue, 12 Nov 2013 12:18:33 -0800 (PST) +Received: from mail-we0-f178.google.com (mail-we0-f178.google.com + [74.125.82.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 76225431FD7 + for ; Tue, 12 Nov 2013 12:18:27 -0800 (PST) +Received: by mail-we0-f178.google.com with SMTP id q59so6441249wes.23 + for ; Tue, 12 Nov 2013 12:18:26 -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=EEaRINw2MVLK36utIg3+Ia+wlP+1H7ZftlNwpDE6GiI=; + b=x90D4ctHQDf+6ukXsxGtI8EMo9s2Lg2po2zBbjF8IxNdA4DiAmTKFiG3siF8woIWvs + WeS/h4Xz8zqbdo/hz7e7ZyMCHdnIULTyrHTnmdpzpCCh9R+f9UTBC5iA1AUWnkLysiwk + WKaP2NIexn2+5OTwTUqNpH2ifoxZMkWbIyE0C3c3I6fC7Oh7/1C/AF/GCHbeOodjde8O + VmddwV3PFXCsbkApYdMbPkfDBury/4+cHpeqtmfw6waMG7dtcFnRafBtrxFTA5VyEDst + lz6k2LCnAmw050Y7Ro4PMu3rCczkFI/9K4nK55yuReCMdWPX0eGoMIK+vsOZ96RuK8b7 + IzgQ== +X-Received: by 10.180.221.38 with SMTP id qb6mr17564225wic.8.1384287066631; + Tue, 12 Nov 2013 12:11:06 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id + qc10sm48003147wic.9.2013.11.12.12.11.05 for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Tue, 12 Nov 2013 12:11:06 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v4 1/7] emacs: help: check for nil key binding +Date: Tue, 12 Nov 2013 20:10:53 +0000 +Message-Id: <1384287059-3525-2-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1384287059-3525-1-git-send-email-markwalters1009@gmail.com> +References: <1384287059-3525-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: Tue, 12 Nov 2013 20:18:39 -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 08a86fd..5e734b3 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