product-set-version-string

Keiichi Suzuki keiichi @ nanap.org
2000年 10月 10日 (火) 17:02:11 JST


>>>>> apel-ja の No. 00421
>>>>> Message-Id: <yp18zrxqjj2.wl @ snake.se.uec.ac.jp> で、
>>>>> "高橋" == TAKAHASHI Kaoru <kaoru @ se.uec.ac.jp>さま曰く...

高橋> product-string-1() のこの部分だけを切り出した関数を用意すると、
高橋> ありがちな version-string を設定するときに便利だと思うのですが、
高橋> いかがでしょう。

-------------- next part --------------
Index: product.el
===================================================================
RCS file: /cvs/root/apel/product.el,v
retrieving revision 1.6
diff -c -r1.6 product.el
*** product.el	1999/12/23 03:57:20	1.6
--- product.el	2000/10/10 08:01:24
***************
*** 248,253 ****
--- 248,266 ----
  			  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,274 ****
  \"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) ")")
! 	    "")))
  
  (defun product-for-each (product all function &rest args)
    "Apply a function to a product and the product's family with args.
--- 268,278 ----
  \"NAME/VERSION (CODE-NAME)\"."
    (setq product (product-find product))
    (concat (product-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.
-------------- next part --------------

などというものでよろしければ commit しておきますが、いかがでしょ
うか?

-- 
鈴木圭一 / keiichi @ nanap.org
PGP finger print (DH/DSS)
0B32 B37E 6DE9 3BC1 68A4  4089 7AAF 2B03 ECBD 614B




More information about the APEL-ja mailing list