From: Tim Vaughan Date: Tue, 30 Apr 2019 23:31:21 +0000 (+0200) Subject: Made menu command robust to empty selection. X-Git-Tag: v1.0.0~10 X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=commitdiff_plain;h=1892efc93a3ba9b4381f24adf9ae994949e3250b Made menu command robust to empty selection. --- 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 ;;