Mercurial > emacs
comparison lisp/ediff-init.el @ 94275:5503e811e130
(ediff-check-version): Drop support for very old Emacs versions. Add
doc-string. Mark as obsolete.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Wed, 23 Apr 2008 02:57:36 +0000 |
parents | 6523ed37006c |
children | 41446eab1f5c |
comparison
equal
deleted
inserted
replaced
94274:b9513e9a71ae | 94275:5503e811e130 |
---|---|
747 (if (featurep 'xemacs) 'make-extent 'make-overlay)) | 747 (if (featurep 'xemacs) 'make-extent 'make-overlay)) |
748 | 748 |
749 (defalias 'ediff-delete-overlay | 749 (defalias 'ediff-delete-overlay |
750 (if (featurep 'xemacs) 'delete-extent 'delete-overlay)) | 750 (if (featurep 'xemacs) 'delete-extent 'delete-overlay)) |
751 | 751 |
752 ;; Check the current version against the major and minor version numbers | 752 ;; Assumes that emacs-major-version and emacs-minor-version are defined. |
753 ;; using op: cur-vers op major.minor If emacs-major-version or | |
754 ;; emacs-minor-version are not defined, we assume that the current version | |
755 ;; is hopelessly outdated. We assume that emacs-major-version and | |
756 ;; emacs-minor-version are defined. Otherwise, for Emacs/XEmacs 19, if the | |
757 ;; current minor version is < 10 (xemacs) or < 23 (emacs) the return value | |
758 ;; will be nil (when op is =, >, or >=) and t (when op is <, <=), which may be | |
759 ;; incorrect. However, this gives correct result in our cases, since we are | |
760 ;; testing for sufficiently high Emacs versions. | |
761 (defun ediff-check-version (op major minor &optional type-of-emacs) | 753 (defun ediff-check-version (op major minor &optional type-of-emacs) |
762 (if (and (boundp 'emacs-major-version) (boundp 'emacs-minor-version)) | 754 "Check the current version against MAJOR and MINOR version numbers. |
763 (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs)) | 755 The comparison uses operator OP, which may be any of: =, >, >=, <, <=. |
764 ((eq type-of-emacs 'emacs) (featurep 'emacs)) | 756 TYPE-OF-EMACS is either 'xemacs or 'emacs." |
765 (t t)) | 757 (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs)) |
766 (cond ((eq op '=) (and (= emacs-minor-version minor) | 758 ((eq type-of-emacs 'emacs) (featurep 'emacs)) |
767 (= emacs-major-version major))) | 759 (t)) |
768 ((memq op '(> >= < <=)) | 760 (cond ((eq op '=) (and (= emacs-minor-version minor) |
769 (and (or (funcall op emacs-major-version major) | 761 (= emacs-major-version major))) |
770 (= emacs-major-version major)) | 762 ((memq op '(> >= < <=)) |
771 (if (= emacs-major-version major) | 763 (and (or (funcall op emacs-major-version major) |
772 (funcall op emacs-minor-version minor) | 764 (= emacs-major-version major)) |
773 t))) | 765 (if (= emacs-major-version major) |
774 (t | 766 (funcall op emacs-minor-version minor) |
775 (error "%S: Invalid op in ediff-check-version" op)))) | 767 t))) |
776 (cond ((memq op '(= > >=)) nil) | 768 (t |
777 ((memq op '(< <=)) t)))) | 769 (error "%S: Invalid op in ediff-check-version" op))))) |
778 | 770 |
771 ;; ediff-check-version seems to be totally unused anyway. | |
772 (make-obsolete 'ediff-check-version 'version< "23.1") | |
779 | 773 |
780 (defun ediff-color-display-p () | 774 (defun ediff-color-display-p () |
781 (condition-case nil | 775 (condition-case nil |
782 (if (featurep 'xemacs) | 776 (if (featurep 'xemacs) |
783 (eq (device-class (selected-device)) 'color) ; xemacs form | 777 (eq (device-class (selected-device)) 'color) ; xemacs form |