(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))
(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)
;; 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)
(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)
(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)
(throw 'found (car list))))
(setq list (cdr list)))))
+;;; Define `functionp' here because "localhook" uses it.
+
+;; Emacs 20.1/XEmacs 20.3 (but first appeared in Epoch?): (functionp OBJECT)
+(defun-maybe functionp (object)
+ "Non-nil if OBJECT is a type of object that can be called as a function."
+ (or (subrp object) (byte-code-function-p object)
+ (eq (car-safe object) 'lambda)
+ (and (symbolp object) (fboundp object))))
+
;;; @@ Hook manipulation functions.
;; "localhook" package is written for Emacs 19.28 and earlier.
(setq parts (cons (substring string start (match-beginning 0)) parts)
start (match-end 0)))
(nreverse (cons (substring string start) parts))))
-
-;; Emacs 20.1/XEmacs 20.3 (but first appeared in Epoch?): (functionp OBJECT)
-(defun-maybe functionp (object)
- "Non-nil if OBJECT is a type of object that can be called as a function."
- (or (subrp object) (byte-code-function-p object)
- (eq (car-safe object) 'lambda)
- (and (symbolp object) (fboundp object))))
\f
;;; @ Window commands emulation. (lisp/window.el)