# HG changeset patch # User Nick Roberts # Date 1140393670 0 # Node ID 4d9d30d2a34775ebe163e395a02b43efe7581462 # Parent e4e1c1572306e3b495eb834f8a1f0254ec931e0e (speedbar-make-button): Keep text properties of string arguments if desired. diff -r e4e1c1572306 -r 4d9d30d2a347 lisp/speedbar.el --- a/lisp/speedbar.el Mon Feb 20 00:00:31 2006 +0000 +++ b/lisp/speedbar.el Mon Feb 20 00:01:10 2006 +0000 @@ -1708,9 +1708,13 @@ (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))