From: tomo Date: Tue, 14 May 2002 12:06:24 +0000 (+0000) Subject: Sync with apel-10_3-1. X-Git-Tag: Emacs-21_1-LEMI-1_14-0~7 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a741e2ae80f4caf7e114aa8b8e4723d62fffb335;p=elisp%2Flemi.git Sync with apel-10_3-1. --- diff --git a/poe/product.el b/poe/product.el index c9aeaab..4b2bfa8 100644 --- a/poe/product.el +++ b/poe/product.el @@ -1,6 +1,6 @@ ;;; product.el --- Functions for product version information. -;; Copyright (C) 1999 Free Software Foundation, Inc. +;; Copyright (C) 1999,2000 Free Software Foundation, Inc. ;; Author: Shuhei KOBAYASHI ;; Keiichi Suzuki @@ -96,7 +96,7 @@ numbers. Optional 4th argument CODE-NAME is a string." "Set code-name of PRODUCT to CODE-NAME." (aset product 3 code-name)) (defun product-set-checkers (product checkers) - "Set ckecker functions of PRODUCT to CHECKERS." + "Set checker functions of PRODUCT to CHECKERS." (aset product 4 checkers)) (defun product-set-family-products (product products) "Set family products of PRODUCT to PRODUCTS." @@ -135,7 +135,7 @@ PRODUCT-NAME is a string of the product's name." "Add checker function(s) to a product. PRODUCT is a product structure which returned by `product-define'. The rest arguments CHECKERS should be functions. These functions -are regist to the product's checkers list, and will be called by +are registered to the product's checkers list, and will be called by `product-run-checkers'. If a checker is `ignore' will be ignored all checkers after this." (setq product (product-find product)) @@ -205,7 +205,7 @@ FEATURE is a symbol of the feature." (defun product-find (product) "Find product information. -If PROCUCT is a product structure, then return PRODUCT itself. +If PRODUCT is a product structure, then return PRODUCT itself. If PRODUCT is a string, then find product by name and return a product structure. If PRODUCT is symbol of feature, then return the feature's product." @@ -248,6 +248,19 @@ PRODUCT-DEF is a definition of the product." nil nil nil (, product-version-string))))) (, feature-def))))) +(defun product-version-as-string (product) + "Return version number of product as a string. +PRODUCT is a product structure which returned by `product-define'. +If optional argument UPDATE is non-nil, then regenerate +`produce-version-string' from `product-version'." + (setq product (product-find product)) + (or (product-version-string product) + (and (product-version product) + (product-set-version-string product + (mapconcat (function int-to-string) + (product-version product) + "."))))) + (defun product-string-1 (product &optional verbose) "Return information of product as a string of \"NAME/VERSION\". PRODUCT is a product structure which returned by `product-define'. @@ -255,20 +268,11 @@ If optional argument VERBOSE is non-nil, then return string of \"NAME/VERSION (CODE-NAME)\"." (setq product (product-find product)) (concat (product-name product) - (cond - ((product-version-string product) - (concat "/" (product-version-string product))) - ((product-version product) - (concat "/" - (product-set-version-string - product - (mapconcat (function int-to-string) - (product-version product) - ".")))) - ("")) - (if (and verbose (product-code-name product)) - (concat " (" (product-code-name product) ")") - ""))) + (let ((version-string (product-version-as-string product))) + (and version-string + (concat "/" version-string))) + (and verbose (product-code-name product) + (concat " (" (product-code-name product) ")")))) (defun product-for-each (product all function &rest args) "Apply a function to a product and the product's family with args.