(riece-user-button-set-operators): Use riece-scan-property-region.
(riece-user-button-set-speakers): Ditto.
(riece-button-add-identity-button): Ditto.
* riece-keyword.el: Require 'riece-message.
(riece-keyword-map-region): Abolish.
(riece-keyword-scan-region): Use riece-scan-property-region.
* riece-misc.el (riece-scan-property-region): New function.
2003-10-13 Daiki Ueno <ueno@unixuser.org>
+ * riece-button.el (riece-button-map-identity-region): Abolish.
+ (riece-user-button-set-operators): Use riece-scan-property-region.
+ (riece-user-button-set-speakers): Ditto.
+ (riece-button-add-identity-button): Ditto.
+
+ * riece-keyword.el: Require 'riece-message.
+ (riece-keyword-map-region): Abolish.
+ (riece-keyword-scan-region): Use riece-scan-property-region.
+
+ * riece-misc.el (riece-scan-property-region): New function.
+
+2003-10-13 Daiki Ueno <ueno@unixuser.org>
+
* riece-xemacs.el (riece-make-overlay): New alias.
(riece-overlay-put): New alias.
(riece-overlay-start): New alias.
(let (group)
(if (riece-region-active-p)
(save-excursion
- (riece-button-map-identity-region
+ (riece-scan-property-region
+ 'riece-identity
(region-beginning) (region-end)
(lambda (start end)
(setq group (cons (get-text-property start 'riece-identity)
(let (group)
(if (riece-region-active-p)
(save-excursion
- (riece-button-map-identity-region
+ (riece-scan-property-region
+ 'riece-identity
(region-beginning) (region-end)
(lambda (start end)
(setq group (cons (get-text-property start 'riece-identity)
(define-key map [down-mouse-3] 'riece-identity-button-popup-menu)
map))
-(defun riece-button-map-identity-region (start end function)
- (catch 'done
- (while t
- ;; Search for the beginning of the button region.
- (unless (get-text-property start 'riece-identity)
- (setq start (next-single-property-change start 'riece-identity
- nil end)))
- (if (= start end)
- (throw 'done nil))
- ;; Search for the end of the button region.
- (let ((button-end (next-single-property-change start 'riece-identity
- nil end)))
- (if (= button-end end)
- (throw 'done nil))
- (funcall function start button-end)
- (setq start button-end)))))
-
(defvar riece-identity-button-map)
(defun riece-button-add-identity-button (start end)
- (riece-button-map-identity-region
+ (riece-scan-property-region
+ 'riece-identity
start end
(lambda (start end)
(let ((inhibit-read-only t)
(erase-buffer)
(while channels
(if (car channels)
- (let ((point (point)))
- (insert (riece-format-channel-list-line
- index (car channels)))))
+ (insert (riece-format-channel-list-line
+ index (car channels))))
(setq index (1+ index)
channels (cdr channels))))))
;;; Code:
+(require 'riece-message)
+
(defgroup riece-keyword nil
"Highlight keyword in IRC buffer."
:group 'riece-vars)
(setq index (match-end 0)))))
message)
-(defun riece-keyword-map-region (start end function)
- (catch 'done
- (while t
- ;; Search for the beginning of the button region.
- (unless (get-text-property start 'riece-keyword)
- (setq start (next-single-property-change start 'riece-keyword
- nil end)))
- (if (= start end)
- (throw 'done nil))
- ;; Search for the end of the button region.
- (let ((button-end (next-single-property-change start 'riece-keyword
- nil end)))
- (if (= button-end end)
- (throw 'done nil))
- (funcall function start button-end)
- (setq start button-end)))))
-
(defun riece-keyword-scan-region (start end)
- (riece-keyword-map-region
+ (riece-scan-property-region
+ 'riece-keyword
start end
(lambda (start end)
(riece-overlay-put (riece-make-overlay start end)
(setq riece-buffer-list (cons buffer riece-buffer-list)))
buffer))
+(defun riece-scan-property-region (property start end function)
+ (catch 'done
+ (while t
+ ;; Search for the beginning of the property region.
+ (unless (get-text-property start property)
+ (setq start (next-single-property-change start property nil end)))
+ (if (= start end)
+ (throw 'done nil))
+ ;; Search for the end of the property region.
+ (let ((region-end (next-single-property-change start property nil end)))
+ (if (= region-end end)
+ (throw 'done nil))
+ (funcall function start region-end)
+ (setq start region-end)))))
+
(defun riece-insert (buffers string)
(unless (listp buffers)
(setq buffers (list buffers)))