;;; wid-edit.el --- Functions for creating and using widgets.
;;
-;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
;;
;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org>
(defun widget-specify-active (widget)
"Make WIDGET active for user modifications."
- (let ((inactive (widget-get widget :inactive)))
+ (let ((inactive (widget-get widget :inactive))
+ (from (widget-get widget :from))
+ (to (widget-get widget :to)))
(when (and inactive (not (extent-detached-p inactive)))
;; Reactivate the buttons and fields covered by the extent.
(map-extents 'widget-activation-widget-mapper
- inactive nil nil :activate nil 'button-or-field)
+ nil from to :activate nil 'button-or-field)
;; Reactivate the glyphs.
(map-extents 'widget-activation-glyph-mapper
- inactive nil nil :activate nil 'end-glyph)
+ nil from to :activate nil 'end-glyph)
(delete-extent inactive)
(widget-put widget :inactive nil))))
value)))
(defun widget-member (widget property)
- "Non-nil iff there is a definition in WIDGET for PROPERTY."
+ "Return t if there is a definition in WIDGET for PROPERTY."
(cond ((widget-plist-member (cdr widget) property)
t)
((car widget)
;; In WIDGET, match the start of VALS.
(cond ((widget-get widget :inline)
(widget-apply widget :match-inline vals))
- ((and vals
+ ((and (listp vals)
(widget-apply widget :match (car vals)))
(cons (list (car vals)) (cdr vals)))
(t nil)))
(t
(when (and (null arg)
(= last-non-space (point)))
- (forward-char -1))
+ (backward-char 1))
(transpose-chars arg)))))
(defcustom widget-complete-field (lookup-key global-map "\M-\t")
(defun widget-url-link-action (widget &optional event)
"Open the url specified by WIDGET."
- (if (boundp 'browse-url-browser-function)
- (funcall browse-url-browser-function (widget-value widget))
+ (if (fboundp 'browse-url)
+ (browse-url (widget-value widget))
(error "Cannot follow URLs in this XEmacs")))
;;; The `function-link' Widget.
found))
(defun widget-checklist-match-up (args vals)
- ;; Rerturn the first type from ARGS that matches VALS.
+ ;; Return the first type from ARGS that matches VALS.
(let (current found)
(while (and args (null found))
(setq current (car args)
result))
(defun widget-checklist-validate (widget)
- ;; Ticked chilren must be valid.
+ ;; Ticked children must be valid.
(let ((children (widget-get widget :children))
child button found)
(while (and children (not found))