From: shuhei Date: Wed, 22 Dec 1999 21:54:13 +0000 (+0000) Subject: (emacs-major-version, emacs-minor-version): Moved from poe.el to product.el. X-Git-Tag: apel-10_0~7 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=3abec9e84ddd8702fa3587bdf7e90363086e4baf;p=elisp%2Fapel.git (emacs-major-version, emacs-minor-version): Moved from poe.el to product.el. --- diff --git a/ChangeLog b/ChangeLog index b0b8e7a..65c3f02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +1999-12-22 Shuhei KOBAYASHI + + * APEL-ELS, EMU-ELS: product.el, apel-ver.el, time-stamp.el, + and timezone.el are version-dependent. + + * product.el (emacs-major-version, emacs-minor-version): Moved + from poe.el. + + * poe.el (emacs-major-version, emacs-minor-version): Removed. + + * pym.el: Add product information. + 1999-12-22 Yuuichi Teranishi * poe.el (string-to-int): Commented out an alias for diff --git a/apel-ver.el b/apel-ver.el index 86e7862..7a23938 100644 --- a/apel-ver.el +++ b/apel-ver.el @@ -51,6 +51,7 @@ (message "%s" product-info) product-info))) + ;;; @ End. ;;; diff --git a/poe.el b/poe.el index d45005e..b577da1 100644 --- a/poe.el +++ b/poe.el @@ -32,29 +32,13 @@ (require 'pym) + ;;; @ Version information. ;;; -;; v18 does not have many features we expect, -;; notably `eval-when-compile' and `eval-and-compile'. -(static-when (string= (substring emacs-version 0 2) "18") +(static-when (= emacs-major-version 18) (require 'poe-18)) -;; Now we can use them! -(eval-and-compile - ;; We must define these two constants at compile-time as well as - ;; load-time since they are used for compile-time version checking. - (defconst-maybe emacs-major-version - (progn (string-match "^[0-9]+" emacs-version) - (string-to-int (substring emacs-version - (match-beginning 0)(match-end 0)))) - "Major version number of this version of Emacs.") - (defconst-maybe emacs-minor-version - (progn (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version) - (string-to-int (substring emacs-version - (match-beginning 1)(match-end 1)))) - "Minor version number of this version of Emacs.")) - ;; Some ancient version of XEmacs did not provide 'xemacs. (static-when (string-match "XEmacs" emacs-version) (provide 'xemacs)) @@ -85,7 +69,7 @@ (progn (require 'nofeature "nofile" 'noerror) (if (get 'require 'defun-maybe) - (error ""))) ; already redefined. + (error "`require' is already redefined"))) (error ;; load-time check. (or (fboundp 'si:require) @@ -204,8 +188,8 @@ See `read-from-minibuffer' for details of HISTORY argument." ;; compile-time check. (if (= (string-to-number "1e1" 16) 481) (if (get 'string-to-number 'defun-maybe) - (error "")) ; already redefined. - (error "")) ; Emacs 20.3 and ealier. + (error "`string-to-number' is already redefined")) + (error "`string-to-number' is broken")) (error ;; load-time check. (or (fboundp 'si:string-to-number) @@ -286,7 +270,7 @@ If the base used is not 10, floating point is not recognized." (progn (char-before) (if (get 'char-before 'defun-maybe) - (error ""))) ; already defined. + (error "`char-before' is already defined"))) (wrong-number-of-arguments ; Mule. ;; load-time check. (or (fboundp 'si:char-before) @@ -351,7 +335,7 @@ If POS is out of range, the value is nil." (progn (char-after) (if (get 'char-after 'defun-maybe) - (error ""))) ; already defined. + (error "`char-after' is already redefined"))) (wrong-number-of-arguments ; v18, v19 ;; load-time check. (or (fboundp 'si:char-after) diff --git a/product.el b/product.el index d420efd..d3ea017 100644 --- a/product.el +++ b/product.el @@ -209,21 +209,21 @@ all checkers." (product-version (product-version product)) (product-code-name (product-code-name product)) (product-version-string (product-version-string product))) - (` (progn - (, product-def) - (put (, feature) 'product - (let ((product (product-find-by-name (, product-name)))) - (product-run-checkers product '(, product-version)) - (and (, product-family) - (product-add-to-family (, product-family) - (, product-name))) - (product-add-feature product (, feature)) - (if (equal '(, product-version) (product-version product)) - product - (vector (, product-name) (, product-family) - '(, product-version) (, product-code-name) - nil nil nil (, product-version-string))))) - (, feature-def))))) + (` (progn + (, product-def) + (put (, feature) 'product + (let ((product (product-find-by-name (, product-name)))) + (product-run-checkers product '(, product-version)) + (and (, product-family) + (product-add-to-family (, product-family) + (, product-name))) + (product-add-feature product (, feature)) + (if (equal '(, product-version) (product-version product)) + product + (vector (, product-name) (, product-family) + '(, product-version) (, product-code-name) + nil nil nil (, product-version-string))))) + (, feature-def))))) (defun product-string-1 (product &optional verbose) "Return information of PRODUCT as a string of \"NAME/VERSION\". @@ -327,14 +327,30 @@ Return list of version, code-name, and version-string." temp (substring temp (match-end 0)))))) (list (nreverse version) code-name version-string))) + ;;; @ End. ;;; (provide 'product) ; beware of circular dependency. (require 'apel-ver) ; these two files depend on each other. (product-provide 'product 'apel-ver) + ;;; @ Define emacs versions. +;;; + +(require 'pym) + +(defconst-maybe emacs-major-version + (progn (string-match "^[0-9]+" emacs-version) + (string-to-int (substring emacs-version + (match-beginning 0)(match-end 0)))) + "Major version number of this version of Emacs.") +(defconst-maybe emacs-minor-version + (progn (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version) + (string-to-int (substring emacs-version + (match-beginning 1)(match-end 1)))) + "Minor version number of this version of Emacs.") ;;(or (product-find "emacs") ;; (progn