From: Mark Walters Date: Fri, 8 Nov 2013 00:21:32 +0000 (+0000) Subject: [PATCH v2 1/5] emacs: help: check for nil key binding X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8b4eadc256460edd1b4d54aa875031b1b08323e9;p=notmuch-archives.git [PATCH v2 1/5] emacs: help: check for nil key binding --- diff --git a/96/b33209c7e5effbb225bab882a912eb21fde2b6 b/96/b33209c7e5effbb225bab882a912eb21fde2b6 new file mode 100644 index 000000000..40d4919e0 --- /dev/null +++ b/96/b33209c7e5effbb225bab882a912eb21fde2b6 @@ -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 9739F429E2E + for ; Thu, 7 Nov 2013 16:21:52 -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 i2dHXoa92Ckt for ; + Thu, 7 Nov 2013 16:21:45 -0800 (PST) +Received: from mail-we0-f179.google.com (mail-we0-f179.google.com + [74.125.82.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id D0566431FD5 + for ; Thu, 7 Nov 2013 16:21:44 -0800 (PST) +Received: by mail-we0-f179.google.com with SMTP id w61so1269858wes.38 + for ; Thu, 07 Nov 2013 16:21:43 -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=bVSisxvll0gSILUy5QBxgI/GCqQBBRxvDq//cCWb1gWZou4YcqpNGaqcQZw+B202kW + JhJjyouB+WcqWUjibZqLh+hENa1u75JdyfM3MeD0RFY1sLTua7oSoz0VCgSexid8FFEQ + Bgi79wbnUCXsfXoJsNuHvm2YKoytl5Kv+OC838h7PP5UO6PoZeCQAGMPBuk6mDIcv5Pe + ZL+avtT2exv03MIseSFOCik9fUs7H7SSYsRrc3qZOClMVndvip2ZnVdMZD6sNv7xfW+x + sIfaJJ+YzxnmoRSy+7Hx13XD+p5nkPGmj269anuu5VswHF8RC+sqfxt9y6/O3aIJY4I3 + 0XlA== +X-Received: by 10.180.160.240 with SMTP id xn16mr108303wib.62.1383870103409; + Thu, 07 Nov 2013 16:21:43 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id ey4sm365102wic.11.2013.11.07.16.21.42 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Thu, 07 Nov 2013 16:21:43 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v2 1/5] emacs: help: check for nil key binding +Date: Fri, 8 Nov 2013 00:21:32 +0000 +Message-Id: <1383870096-14627-2-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1383870096-14627-1-git-send-email-markwalters1009@gmail.com> +References: <1383870096-14627-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 00:21:52 -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 +