[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/button.el,v
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/button.el,v |
Date: |
Tue, 10 Jun 2008 14:17:33 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Stefan Monnier <monnier> 08/06/10 14:17:33
Index: button.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/button.el,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- button.el 6 May 2008 07:57:27 -0000 1.35
+++ button.el 10 Jun 2008 14:17:32 -0000 1.36
@@ -293,10 +293,15 @@
large numbers of buttons can also be somewhat faster using
`make-text-button'.
+BEG can also be a string, in which case it is made into a button.
+
Also see `insert-text-button'."
- (let ((type-entry
+ (let ((object nil)
+ (type-entry
(or (plist-member properties 'type)
(plist-member properties :type))))
+ (when (stringp beg)
+ (setq object beg beg 0 end (length object)))
;; Disallow setting the `category' property directly.
(when (plist-get properties 'category)
(error "Button `category' property may not be set directly"))
@@ -308,15 +313,16 @@
;; text-properties for inheritance.
(setcar type-entry 'category)
(setcar (cdr type-entry)
- (button-category-symbol (car (cdr type-entry))))))
+ (button-category-symbol (car (cdr type-entry)))))
;; Now add all the text properties at once
(add-text-properties beg end
;; Each button should have a non-eq `button'
;; property so that next-single-property-change can
;; detect boundaries reliably.
- (cons 'button (cons (list t) properties)))
+ (cons 'button (cons (list t) properties))
+ object)
;; Return something that can be used to get at the button.
- beg)
+ beg))
(defun insert-text-button (label &rest properties)
"Insert a button with the label LABEL.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/button.el,v,
Stefan Monnier <=