From 500abc4dc3792d9f5e1bfdbb5e493c8a59889097 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 29 May 2023 20:34:53 +0300 Subject: [PATCH] * lisp/tmm.el (tmm-completion-delete-prompt): Add more checks (bug#63754). In case when 'completions-header-format' is nil, the first 'mouse-face' property is at the beginning of the buffer. So first use 'get-text-property' at point-min. --- lisp/tmm.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/tmm.el b/lisp/tmm.el index 88254f0d1b8..a4058594622 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -329,7 +329,8 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'." (with-current-buffer standard-output (goto-char (point-min)) (let* (;; First candidate: first string with mouse-face - (menu-start-1 (next-single-char-property-change (point) 'mouse-face)) + (menu-start-1 (or (and (get-text-property (point) 'mouse-face) (point)) + (next-single-char-property-change (point) 'mouse-face))) ;; Second candidate: an inactive menu item with tmm-inactive face (tps-result (save-excursion (text-property-search-forward 'face 'tmm-inactive t))) -- 2.39.2