comparison lisp/hm--html-menus/adapt.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 6a22abad6937
children 0d2f883870bc
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
1 ;;; $Id: adapt.el,v 1.3 1997/03/26 22:42:37 steve Exp $ 1 ;;; $Id: adapt.el,v 1.1.1.1 1996/12/18 22:43:20 steve Exp $
2 ;;; 2 ;;;
3 ;;; Copyright (C) 1993 - 1997 Heiko Muenkel 3 ;;; Copyright (C) 1993, 1994, 1995 Heiko Muenkel
4 ;;; email: muenkel@tnt.uni-hannover.de 4 ;;; email: muenkel@tnt.uni-hannover.de
5 ;;; 5 ;;;
6 ;;; This program is free software; you can redistribute it and/or modify 6 ;;; This program is free software; you can redistribute it and/or modify
7 ;;; it under the terms of the GNU General Public License as published by 7 ;;; it under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 2, or (at your option) 8 ;;; the Free Software Foundation; either version 2, or (at your option)
18 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 ;;; 19 ;;;
20 ;;; 20 ;;;
21 ;;; Description: 21 ;;; Description:
22 ;;; 22 ;;;
23 ;;; General functions to port XEmacs functions to GNU Emacs 19. 23 ;;; General functions to port Lucid Emacs to GNU Emacs 19.
24 ;;; 24 ;;;
25 ;;; Installation: 25 ;;; Installation:
26 ;;; 26 ;;;
27 ;;; Put this file in one of your lisp load directories. 27 ;;; Put this file in one of your lisp load directories.
28 ;;; 28 ;;;
45 "Returns non nil if the editor is the GNU Emacs 19." 45 "Returns non nil if the editor is the GNU Emacs 19."
46 (and 46 (and
47 (not (adapt-xemacsp)) 47 (not (adapt-xemacsp))
48 (string= (substring emacs-version 0 2) "19"))) 48 (string= (substring emacs-version 0 2) "19")))
49 49
50 ;;; Functions, which don't exist in both emacs versions 50 ;;; Functions, which doesn't exist in both emacses
51 51
52 (defun adapt-region-active-p () 52 (defun adapt-region-active-p ()
53 "Returns t, if a region is active." 53 "Returns t, if a region is active."
54 (if (adapt-xemacsp) 54 (if (adapt-xemacsp)
55 (mark) 55 (mark)
56 mark-active)) 56 mark-active))
57 57
58 (if (not (fboundp 'file-remote-p)) 58
59 (defun file-remote-p (file)
60 "Test wether file resides on the local system.
61 The special value 'unknown is returned if no remote file acess package
62 has been loaded."
63 (if (not (featurep 'ange-ftp))
64 (require 'ange-ftp))
65 (if (not (fboundp 'ange-ftp-ftp-p))
66 nil ; better than nothing, if no ange-ftp-ftp-p exists
67 (ange-ftp-ftp-path file))))
68
69
70 ;;; Functions, which don't exist in the Emacs 19
71 (if (adapt-emacs19p) 59 (if (adapt-emacs19p)
72 (progn 60 (progn
73 (load-library "lucid") 61 (load-library "lucid")
74 62
75 (load-library "lmenu") 63 (load-library "lmenu")
248 (defun button-release-event-p (obj) 236 (defun button-release-event-p (obj)
249 "True if OBJ is a mouse-button-release event object." 237 "True if OBJ is a mouse-button-release event object."
250 (and (button-event-p obj) 238 (and (button-event-p obj)
251 (not (button-press-event-p obj))))) 239 (not (button-press-event-p obj)))))
252 240
253 (if (not (fboundp 'button-click-event-p))
254 (defun button-click-event-p (obj)
255 "True if OBJ is a click event obkect."
256 ;; only for the Emacs 19
257 ;; doesn't exist and can't (?) exist in the XEmacs
258 (and (button-event-p obj)
259 (member 'click (event-modifiers obj)))))
260
261 (if (not (fboundp 'mouse-event-p))
262 (defun mouse-event-p (obj)
263 "True if OBJ is a button-press, button-release, or mouse-motion event object."
264 (or (button-event-p obj)
265 (member 'drag (event-modifiers obj)))))
266
267 (if (not (fboundp 'event-window)) 241 (if (not (fboundp 'event-window))
268 (defun event-window (event) 242 (defun event-window (event)
269 "Return the window of the given mouse event. 243 "Return the window of the given mouse event.
270 This may be nil if the event occurred in the border or over a toolbar. 244 This may be nil if the event occurred in the border or over a toolbar.
271 The modeline is considered to be in the window it represents." 245 The modeline is considered to be in the window it represents."
336 (setq minor-mode-map-alist 310 (setq minor-mode-map-alist
337 (cons (cons toggle keymap) 311 (cons (cons toggle keymap)
338 minor-mode-map-alist)))) 312 minor-mode-map-alist))))
339 )) 313 ))
340 ) 314 )
341
342 (if (not (fboundp 'redraw-modeline))
343 (defalias 'redraw-modeline 'force-mode-line-update))
344
345 (if (not (fboundp 'mouse-track))
346 (defalias 'mouse-track 'mouse-drag-region))
347
348 )) 315 ))
349 316
350 317
351 (provide 'adapt) 318 (provide 'adapt)