comparison lisp/speedbar.el @ 69021:4d9d30d2a347

(speedbar-make-button): Keep text properties of string arguments if desired.
author Nick Roberts <nickrob@snap.net.nz>
date Mon, 20 Feb 2006 00:01:10 +0000
parents cb07d3843e81
children 9f9cc4dd5f76 d1c5430c5bff
comparison
equal deleted inserted replaced
69020:e4e1c1572306 69021:4d9d30d2a347
1706 nil nil nil))) 1706 nil nil nil)))
1707 1707
1708 (defun speedbar-make-button (start end face mouse function &optional token) 1708 (defun speedbar-make-button (start end face mouse function &optional token)
1709 "Create a button from START to END, with FACE as the display face. 1709 "Create a button from START to END, with FACE as the display face.
1710 MOUSE is the mouse face. When this button is clicked on FUNCTION 1710 MOUSE is the mouse face. When this button is clicked on FUNCTION
1711 will be run with the TOKEN parameter (any Lisp object)" 1711 will be run with the TOKEN parameter (any Lisp object). If FACE
1712 is t use the text properties of the string that is passed as an
1713 argument."
1714 (unless (eq face t)
1715 (put-text-property start end 'face face))
1712 (add-text-properties 1716 (add-text-properties
1713 start end `(face ,face mouse-face ,mouse invisible nil 1717 start end `(mouse-face ,mouse invisible nil
1714 speedbar-text ,(buffer-substring-no-properties start end))) 1718 speedbar-text ,(buffer-substring-no-properties start end)))
1715 (if speedbar-use-tool-tips-flag 1719 (if speedbar-use-tool-tips-flag
1716 (put-text-property start end 'help-echo #'dframe-help-echo)) 1720 (put-text-property start end 'help-echo #'dframe-help-echo))
1717 (if function (put-text-property start end 'speedbar-function function)) 1721 (if function (put-text-property start end 'speedbar-function function))
1718 (if token (put-text-property start end 'speedbar-token token)) 1722 (if token (put-text-property start end 'speedbar-token token))