]> code.delx.au - gnu-emacs/blobdiff - lisp/tree-widget.el
Don’t create unnecessary marker in ‘delete-trailing-whitespace’
[gnu-emacs] / lisp / tree-widget.el
index 77159573c9d1ae7c52970e09fb8d7b1d8a5e30ee..0ffb8dc96dc1d97dbf3282830bb4655c09ffbbe4 100644 (file)
@@ -1,6 +1,6 @@
 ;;; tree-widget.el --- Tree widget
 
-;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2016 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 ;; Maintainer: David Ponce <david@dponce.com>
 ;;
 
 ;;; Code:
-(eval-when-compile (require 'cl))
 (require 'wid-edit)
 \f
 ;;; Customization
@@ -209,9 +208,11 @@ icon widgets used to draw the tree.  By default these images are used:
 
 (defcustom tree-widget-space-width 0.5
   "Amount of space between an icon image and a node widget.
-Must be a valid space :width display property."
+Must be a valid space :width display property.
+See Info node `(elisp)Specified Space'."
   :group 'tree-widget
-  :type 'sexp)
+  :type '(choice (number :tag "Multiple of normal character width")
+                 sexp))
 \f
 ;;; Image support
 ;;
@@ -295,9 +296,9 @@ Typically it should contain something like this:
 
   (tree-widget-set-parent-theme \"my-parent-theme\")
   (tree-widget-set-image-properties
-   (if (featurep 'xemacs)
-       '(:ascent center)
-     '(:ascent center :mask (heuristic t))
+   (if (featurep \\='xemacs)
+       \\='(:ascent center)
+     \\='(:ascent center :mask (heuristic t))
      ))"
   (or name (setq name (or tree-widget-theme "default")))
   (unless (string-equal name (tree-widget-theme-name))
@@ -657,13 +658,15 @@ This hook should be local in the buffer setup to display widgets.")
                                    (widget-get tree :dynargs)))
     tree))
 
+(defvar widget-glyph-enable) ; XEmacs
+
 (defun tree-widget-value-create (tree)
   "Create the TREE tree-widget."
   (let* ((node   (tree-widget-node tree))
          (flags  (widget-get tree :tree-widget--guide-flags))
          (indent (widget-get tree :indent))
          ;; Setup widget's image support.  Looking up for images, and
-         ;; setting widgets' :tag-glyph is done here, to allow to
+         ;; setting widgets' :tag-glyph is done here, to allow us to
          ;; dynamically change the image theme.
          (widget-image-enable (tree-widget-use-image-p))     ; Emacs
          (widget-glyph-enable widget-image-enable)           ; XEmacs
@@ -792,7 +795,7 @@ Each function is passed a tree-widget.  If the value of the :open
 property is non-nil the tree has been expanded, else collapsed.
 This hook should be local in the buffer setup to display widgets.")
 
-(defun tree-widget-action (tree &optional event)
+(defun tree-widget-action (tree &optional _event)
   "Handle the :action of the TREE tree-widget.
 That is, toggle expansion of the TREE tree-widget.
 Ignore the EVENT argument."