- (memq 'drag (event-modifiers event))))))
-
- (unless (fboundp 'functionp)
- ;; Missing from Emacs 19.34 and earlier.
- (defun functionp (object)
- "Non-nil of OBJECT is a type of object that can be called as a function."
- (or (subrp object) (byte-code-function-p object)
- (eq (car-safe object) 'lambda)
- (and (symbolp object) (fboundp object)))))
-
- (unless (fboundp 'error-message-string)
- ;; Emacs function missing in XEmacs.
- (defun error-message-string (obj)
- "Convert an error value to an error message."
- (let ((buf (get-buffer-create " *error-message*")))
- (erase-buffer buf)
- (display-error obj buf)
- (buffer-string buf)))))
-
-(when (let ((a "foo"))
- (put-text-property 1 2 'foo 1 a)
- (put-text-property 1 2 'bar 2 a)
- (set-text-properties 1 2 nil a)
- (text-properties-at 1 a))
- ;; XEmacs 20.2 and earlier had a buggy set-text-properties.
- (defun set-text-properties (start end props &optional buffer-or-string)
- "Completely replace properties of text from START to END.
-The third argument PROPS is the new property list.
-The optional fourth argument, BUFFER-OR-STRING,
-is the string or buffer containing the text."
- (map-extents #'(lambda (extent ignored)
- (remove-text-properties
- start end
- (list (extent-property extent 'text-prop)
- nil)
- buffer-or-string)
- nil)
- buffer-or-string start end nil nil 'text-prop)
- (add-text-properties start end props buffer-or-string)))