Commit ba7fbe92 authored by Karl Heuer's avatar Karl Heuer
Browse files

(widget-plist-member): Move from here to src/fns.c;

translated into C for efficiency.
(widget-put, widget-get, widget-apply): Likewise.
parent 1a269256
......@@ -59,11 +59,6 @@
'next-event
'read-event))
;; The following should go away when bundled with Emacs.
(condition-case ()
(require 'custom)
(error nil))
(unless (and (featurep 'custom) (fboundp 'custom-declare-variable))
;; We have the old custom-library, hack around it!
(defmacro defgroup (&rest args) nil)
......@@ -189,17 +184,6 @@ This exists as a variable so it can be set locally in certain buffers.")
;;
;; These are not really widget specific.
(defsubst widget-plist-member (plist prop)
;; Return non-nil if PLIST has the property PROP.
;; PLIST is a property list, which is a list of the form
;; (PROP1 VALUE1 PROP2 VALUE2 ...). PROP is a symbol.
;; Unlike `plist-get', this allows you to distinguish between a missing
;; property and a property with the value nil.
;; The value is actually the tail of PLIST whose car is PROP.
(while (and plist (not (eq (car plist) prop)))
(setq plist (cdr (cdr plist))))
plist)
(defun widget-princ-to-string (object)
;; Return string representation of OBJECT, any Lisp object.
;; No quoting characters are used; no delimiters are printed around
......@@ -487,27 +471,6 @@ new value."
"Return the type of WIDGET, a symbol."
(car widget))
(defun widget-put (widget property value)
"In WIDGET set PROPERTY to VALUE.
The value can later be retrived with `widget-get'."
(setcdr widget (plist-put (cdr widget) property value)))
(defun widget-get (widget property)
"In WIDGET, get the value of PROPERTY.
The value could either be specified when the widget was created, or
later with `widget-put'."
(let ((missing t)
value tmp)
(while missing
(cond ((setq tmp (widget-plist-member (cdr widget) property))
(setq value (car (cdr tmp))
missing nil))
((setq tmp (car widget))
(setq widget (get tmp 'widget-type)))
(t
(setq missing nil))))
value))
(defun widget-get-indirect (widget property)
"In WIDGET, get the value of PROPERTY.
If the value is a symbol, return its binding.
......@@ -525,12 +488,6 @@ Otherwise, just return the value."
(widget-member (get (car widget) 'widget-type) property))
(t nil)))
;;;###autoload
(defun widget-apply (widget property &rest args)
"Apply the value of WIDGET's PROPERTY to the widget itself.
ARGS are passed as extra arguments to the function."
(apply (widget-get widget property) widget args))
(defun widget-value (widget)
"Extract the current value of WIDGET."
(widget-apply widget
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment