X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/37d2ef66f705b72f9937740a6455c57e99cfce05..7c2fb837ec2f0e0a509f22ccc35f9b43476a6119:/lisp/tree-widget.el diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el index 5fcb2dc8bf..3879b3c266 100644 --- a/lisp/tree-widget.el +++ b/lisp/tree-widget.el @@ -1,6 +1,6 @@ ;;; tree-widget.el --- Tree widget -;; Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;; Author: David Ponce ;; Maintainer: David Ponce @@ -9,20 +9,18 @@ ;; This file is part of GNU Emacs -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2, or (at -;; your option) any later version. +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: ;; @@ -127,9 +125,9 @@ :version "22.1" :group 'widgets) -(defcustom tree-widget-image-enable - (not (or (featurep 'xemacs) (< emacs-major-version 21))) - "*Non-nil means that tree-widget will try to use images." +(defcustom tree-widget-image-enable (if (fboundp 'display-images-p) + (display-images-p)) + "Non-nil means that tree-widget will try to use images." :type 'boolean :group 'tree-widget) @@ -403,19 +401,20 @@ Search first in current theme, then in parent themes (see also the function `tree-widget-set-parent-theme'). Return the first image found having a supported format, or nil if not found." - (catch 'found - (dolist (default-directory (tree-widget-themes-path)) - (dolist (dir (aref tree-widget--theme 0)) - (dolist (fmt (tree-widget-image-formats)) - (dolist (ext (cdr fmt)) - (setq file (expand-file-name (concat name ext) dir)) - (and (file-readable-p file) - (file-regular-p file) - (throw 'found - (tree-widget-create-image - (car fmt) file - (tree-widget-image-properties name)))))))) - nil)) + (let (file) + (catch 'found + (dolist (default-directory (tree-widget-themes-path)) + (dolist (dir (aref tree-widget--theme 0)) + (dolist (fmt (tree-widget-image-formats)) + (dolist (ext (cdr fmt)) + (setq file (expand-file-name (concat name ext) dir)) + (and (file-readable-p file) + (file-regular-p file) + (throw 'found + (tree-widget-create-image + (car fmt) file + (tree-widget-image-properties name)))))))) + nil))) (defun tree-widget-find-image (name) "Find the image with NAME in current theme.