From 6980a4fa450260b97830de52a69b039d9d020ff2 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 5 Dec 2021 21:20:03 +0100 Subject: [PATCH] Fix regression introduced by previous context-menu-map change * lisp/mouse.el (context-menu-map): Make the context mode work with flyspell again (bug#52237). --- lisp/mouse.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/mouse.el b/lisp/mouse.el index b5ca80a446e..af1eca12f45 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -330,7 +330,8 @@ the function `context-menu-filter-function'." ;; Remove duplicate separators as well as ones at the beginning or ;; end of the menu. (let ((l menu) saw-first-item) - (while (consp (cdr l)) + (while (and (consp l) + (consp (cdr l))) ;; If the next item is a separator, remove it if 1) we haven't ;; seen any other items yet, or 2) it's followed by either ;; another separator or the end of the list. -- 2.39.2