From 1892efc93a3ba9b4381f24adf9ae994949e3250b Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Wed, 1 May 2019 01:31:21 +0200 Subject: [PATCH] Made menu command robust to empty selection. --- elpher.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/elpher.el b/elpher.el index 53905ba..12ef1c8 100644 --- a/elpher.el +++ b/elpher.el @@ -679,11 +679,12 @@ The result is stored as a string in the variable ‘elpher-selector-string’." (interactive) (let* ((link-map (elpher-build-link-map))) (if link-map - (let* ((key (let ((completion-ignore-case t)) - (completing-read "Menu item: " link-map nil t))) - (b (cdr (assoc key link-map)))) - (goto-char (button-start b)) - (button-activate b))))) + (let ((key (let ((completion-ignore-case t)) + (completing-read "Menu item: " link-map nil t)))) + (if (and key (> (length key) 0)) + (let ((b (cdr (assoc key link-map)))) + (goto-char (button-start b)) + (button-activate b))))))) ;;; Mode and keymap ;; -- 2.20.1