From: Nick Roberts Date: Mon, 20 Feb 2006 00:01:10 +0000 (+0000) Subject: (speedbar-make-button): Keep text properties X-Git-Tag: emacs-pretest-22.0.90~4017 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=37eadbacb41608a0ce13653f378b52ee5e8fb9d2;p=emacs.git (speedbar-make-button): Keep text properties of string arguments if desired. --- diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 4e639c586f2..4f0e2edf7cb 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -1708,9 +1708,13 @@ Separators are not active, have no labels, depth, or actions." (defun speedbar-make-button (start end face mouse function &optional token) "Create a button from START to END, with FACE as the display face. MOUSE is the mouse face. When this button is clicked on FUNCTION -will be run with the TOKEN parameter (any Lisp object)" +will be run with the TOKEN parameter (any Lisp object). If FACE +is t use the text properties of the string that is passed as an +argument." + (unless (eq face t) + (put-text-property start end 'face face)) (add-text-properties - start end `(face ,face mouse-face ,mouse invisible nil + start end `(mouse-face ,mouse invisible nil speedbar-text ,(buffer-substring-no-properties start end))) (if speedbar-use-tool-tips-flag (put-text-property start end 'help-echo #'dframe-help-echo))