From c701ef68035b227bdd9eb4cbdcf1ca7ae67b1cdd Mon Sep 17 00:00:00 2001 From: Alexander Adolf Date: Thu, 24 Nov 2022 22:23:22 +0100 Subject: [PATCH] Weird Minibuffer Display When Candidate Search Text Has Properties When the candidate symbol or text to search for is copied from the current buffer to the command line in the minibuffer, text properties are copied, too. When the text has a big font size, is bold, etc. this can affect the minibuffer display in aesthetically unpleasant ways. This commit removes any text properties from the candidate symbol, so that the command line in the minibuffer retains a uniform appearance. * ack.el (ack-yank-symbol-at-point): remove text properties from candidate symbol --- ack.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ack.el b/ack.el index 8df6507..ec8bfcb 100644 --- a/ack.el +++ b/ack.el @@ -378,10 +378,10 @@ This function is a suitable addition to (defun ack-yank-symbol-at-point () "Yank the symbol from the window before entering the minibuffer." (interactive) - (let ((symbol (and (minibuffer-selected-window) + (let ((symbol (substring-no-properties (and (minibuffer-selected-window) (with-current-buffer (window-buffer (minibuffer-selected-window)) - (thing-at-point 'symbol))))) + (thing-at-point 'symbol)))))) (cond (symbol (insert symbol) (set (make-local-variable 'ack--yanked-symbol) symbol)) (t (minibuffer-message "No symbol found")))))