1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-04 11:40:22 +00:00

(tree-widget-super-format-handler)

(tree-widget-format-handler): Remove.
(tree-widget-value-create): Handle the :indent property.
This commit is contained in:
David Ponce 2005-06-15 08:19:19 +00:00
parent 763e7cf6dd
commit 3bcf793ca4

View File

@ -1,6 +1,6 @@
;;; tree-widget.el --- Tree widget
;; Copyright (C) 2004 Free Software Foundation, Inc.
;; Copyright (C) 2004, 2005 Free Software Foundation, Inc.
;; Author: David Ponce <david@dponce.com>
;; Maintainer: David Ponce <david@dponce.com>
@ -469,21 +469,6 @@ found."
'widget-type)
property))
(defsubst tree-widget-super-format-handler (widget escape)
"Call WIDGET's inherited format handler to process ESCAPE character."
(let ((handler (tree-widget-get-super widget :format-handler)))
(and handler (funcall handler widget escape))))
(defun tree-widget-format-handler (widget escape)
"For WIDGET, signal that the %p format template is obsolete.
Call WIDGET's inherited format handler to process other ESCAPE
characters."
(if (eq escape ?p)
(message "The %%p format template is obsolete and ignored")
(tree-widget-super-format-handler widget escape)))
(make-obsolete 'tree-widget-format-handler
'tree-widget-super-format-handler)
(defsubst tree-widget-node (widget)
"Return the tree WIDGET :node value.
If not found setup a default 'item' widget."
@ -630,26 +615,27 @@ IGNORE other arguments."
(let* ((widget-image-enable (tree-widget-use-image-p)) ; Emacs
(widget-glyph-enable widget-image-enable) ; XEmacs
(node (tree-widget-node tree))
(flags (widget-get tree :tree-widget--guide-flags))
(indent (and (bolp) (widget-get tree :indent)))
children buttons)
(and (null flags) indent (insert-char ?\ indent))
(if (widget-get tree :open)
;;;; Unfolded node.
(let* ((args (widget-get tree :args))
(dynargs (widget-get tree :dynargs))
(flags (widget-get tree :tree-widget--guide-flags))
(rflags (reverse flags))
(guide (tree-widget-guide tree))
(noguide (tree-widget-no-guide tree))
(endguide (tree-widget-end-guide tree))
(handle (tree-widget-handle tree))
(nohandle (tree-widget-no-handle tree))
;; Lookup for images and set widgets' tag-glyphs here,
;; to allow to dynamically change the image theme.
(guidi (tree-widget-find-image "guide"))
(noguidi (tree-widget-find-image "no-guide"))
(endguidi (tree-widget-find-image "end-guide"))
(handli (tree-widget-find-image "handle"))
(nohandli (tree-widget-find-image "no-handle"))
child)
(let ((args (widget-get tree :args))
(dynargs (widget-get tree :dynargs))
(guide (tree-widget-guide tree))
(noguide (tree-widget-no-guide tree))
(endguide (tree-widget-end-guide tree))
(handle (tree-widget-handle tree))
(nohandle (tree-widget-no-handle tree))
;; Lookup for images and set widgets' tag-glyphs here,
;; to allow to dynamically change the image theme.
(guidi (tree-widget-find-image "guide"))
(noguidi (tree-widget-find-image "no-guide"))
(endguidi (tree-widget-find-image "end-guide"))
(handli (tree-widget-find-image "handle"))
(nohandli (tree-widget-find-image "no-handle"))
child)
(when dynargs
;; Request the definition of dynamic children
(setq dynargs (funcall dynargs tree))
@ -671,8 +657,9 @@ IGNORE other arguments."
(while args
(setq child (car args)
args (cdr args))
(and indent (insert-char ?\ indent))
;; Insert guide lines elements
(dolist (f rflags)
(dolist (f (reverse flags))
(widget-create-child-and-convert
tree (if f guide noguide)
:tag-glyph (if f guidi noguidi))