~ubuntu-branches/ubuntu/hardy/vm/hardy

« back to all changes in this revision

Viewing changes to vm-version.el

  • Committer: Bazaar Package Importer
  • Author(s): Manoj Srivastava
  • Date: 2002-03-06 00:46:29 UTC
  • Revision ID: james.westby@ubuntu.com-20020306004629-lnksqjffsnoc4tog
Tags: upstream-7.03
ImportĀ upstreamĀ versionĀ 7.03

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(provide 'vm)
 
2
 
 
3
(provide 'vm-version)
 
4
 
 
5
(defconst vm-version "7.03"
 
6
  "Version number of VM.")
 
7
 
 
8
(defun vm-version ()
 
9
  "Returns the value of the variable vm-version."
 
10
  vm-version)
 
11
 
 
12
(defconst vm-xemacs-p nil)
 
13
(defconst vm-xemacs-mule-p nil)
 
14
(defconst vm-xemacs-file-coding-p nil)
 
15
(defconst vm-fsfemacs-p nil)
 
16
(defconst vm-fsfemacs-mule-p nil)
 
17
(defun vm-xemacs-p () vm-xemacs-p)
 
18
(defun vm-xemacs-mule-p () vm-xemacs-mule-p)
 
19
(defun vm-xemacs-file-coding-p () vm-xemacs-file-coding-p)
 
20
(defun vm-fsfemacs-p () vm-fsfemacs-p)
 
21
(defun vm-fsfemacs-mule-p () vm-fsfemacs-mule-p)
 
22
(defun vm-note-emacs-version ()
 
23
  (setq vm-xemacs-p (string-match "XEmacs" emacs-version)
 
24
        vm-xemacs-mule-p (and vm-xemacs-p (featurep 'mule)
 
25
                              ;; paranoia
 
26
                              (fboundp 'set-buffer-file-coding-system))
 
27
        vm-xemacs-file-coding-p (and vm-xemacs-p (featurep 'file-coding)
 
28
                                     ;; paranoia
 
29
                                     (fboundp 'set-buffer-file-coding-system))
 
30
        vm-fsfemacs-p (not vm-xemacs-p)
 
31
        vm-fsfemacs-mule-p (and (not vm-xemacs-mule-p) (featurep 'mule)
 
32
                                (fboundp 'set-buffer-file-coding-system))))
 
33
(vm-note-emacs-version)
 
34
 
 
35
(defun vm-mouse-fsfemacs-mouse-p ()
 
36
  (and vm-fsfemacs-p
 
37
       (fboundp 'set-mouse-position)))
 
38
 
 
39
(defun vm-mouse-xemacs-mouse-p ()
 
40
  (and vm-xemacs-p
 
41
       (fboundp 'set-mouse-position)))
 
42
 
 
43
(defun vm-menu-fsfemacs-menus-p ()
 
44
  (and vm-fsfemacs-p
 
45
       (fboundp 'menu-bar-mode)))
 
46
 
 
47
(defun vm-menu-fsfemacs19-menus-p ()
 
48
  (and vm-fsfemacs-p
 
49
       (fboundp 'menu-bar-mode)
 
50
       (= emacs-major-version 19)))
 
51
 
 
52
(defun vm-menu-xemacs-menus-p ()
 
53
  (and vm-xemacs-p
 
54
       (fboundp 'set-buffer-menubar)))
 
55
 
 
56
(defun vm-menu-can-eval-item-name ()
 
57
  (and vm-xemacs-p
 
58
       (fboundp 'check-menu-syntax)
 
59
       (condition-case nil
 
60
           (check-menu-syntax '("bar" ((identity "foo") 'ding t)))
 
61
         (error nil))))
 
62
 
 
63
(defun vm-multiple-frames-possible-p () 
 
64
  (cond (vm-xemacs-p 
 
65
         (or (memq 'win (device-matching-specifier-tag-list))
 
66
             (featurep 'tty-frames)))
 
67
        (vm-fsfemacs-p 
 
68
         (fboundp 'make-frame))))
 
69
 
 
70
(defun vm-mouse-support-possible-p () 
 
71
  (cond (vm-xemacs-p 
 
72
         (featurep 'window-system)) 
 
73
        (vm-fsfemacs-p 
 
74
         (fboundp 'track-mouse))))
 
75
 
 
76
(defun vm-mouse-support-possible-here-p ()
 
77
  (cond (vm-xemacs-p
 
78
         (memq 'win (device-matching-specifier-tag-list)))
 
79
        (vm-fsfemacs-p
 
80
         (memq window-system '(x w32 win32)))))
 
81
 
 
82
(defun vm-menu-support-possible-p ()
 
83
  (cond (vm-xemacs-p
 
84
         (featurep 'menubar))
 
85
        (vm-fsfemacs-p
 
86
         (fboundp 'menu-bar-mode))))
 
87
 
 
88
(defun vm-toolbar-support-possible-p ()
 
89
  (or (and vm-xemacs-p (featurep 'toolbar))
 
90
      (and vm-fsfemacs-p (fboundp 'tool-bar-mode) (boundp 'tool-bar-map))))
 
91
 
 
92
(defun vm-multiple-fonts-possible-p ()
 
93
  (cond (vm-xemacs-p
 
94
         (memq (device-type) '(x mswindows)))
 
95
        (vm-fsfemacs-p
 
96
         (memq window-system '(x w32 win32)))))
 
97
 
 
98
(defun vm-images-possible-here-p ()
 
99
  (or (and vm-xemacs-p (memq (device-type) '(x mswindows)))
 
100
      (and vm-fsfemacs-p window-system
 
101
           (or (fboundp 'image-type-available-p)
 
102
               (and (stringp vm-imagemagick-convert-program)
 
103
                    (stringp vm-imagemagick-identify-program))))))
 
104
 
 
105
(defun vm-image-type-available-p (type)
 
106
  (if (fboundp 'image-type-available-p)
 
107
      (image-type-available-p type)
 
108
    (or (featurep type) (eq type 'xbm))))