diff options
| -rw-r--r-- | lisp/ediff-init.el | 293 |
1 files changed, 123 insertions, 170 deletions
diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el index 2bf50f629c7..3339f9fd837 100644 --- a/lisp/ediff-init.el +++ b/lisp/ediff-init.el | |||
| @@ -39,15 +39,6 @@ | |||
| 39 | (defvar mswindowsx-bitmap-file-path) | 39 | (defvar mswindowsx-bitmap-file-path) |
| 40 | ;; end pacifier | 40 | ;; end pacifier |
| 41 | 41 | ||
| 42 | ;; This is used to avoid compilation warnings. When emacs/xemacs forms can | ||
| 43 | ;; generate compile time warnings, we use this macro. | ||
| 44 | ;; In this case, the macro will expand into the form that is appropriate to the | ||
| 45 | ;; compiler at hand. | ||
| 46 | ;; Suggested by rms. | ||
| 47 | (defmacro ediff-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form) | ||
| 48 | (if (featurep 'xemacs) | ||
| 49 | xemacs-form emacs-form)) | ||
| 50 | |||
| 51 | (defvar ediff-force-faces nil | 42 | (defvar ediff-force-faces nil |
| 52 | "If t, Ediff will think that it is running on a display that supports faces. | 43 | "If t, Ediff will think that it is running on a display that supports faces. |
| 53 | This is provided as a temporary relief for users of face-capable displays | 44 | This is provided as a temporary relief for users of face-capable displays |
| @@ -55,10 +46,9 @@ that Ediff doesn't know about.") | |||
| 55 | 46 | ||
| 56 | ;; Are we running as a window application or on a TTY? | 47 | ;; Are we running as a window application or on a TTY? |
| 57 | (defsubst ediff-device-type () | 48 | (defsubst ediff-device-type () |
| 58 | (ediff-cond-compile-for-xemacs-or-emacs | 49 | (if (featurep 'xemacs) |
| 59 | (device-type (selected-device)) ; xemacs form | 50 | (device-type (selected-device)) |
| 60 | window-system ; emacs form | 51 | window-system)) |
| 61 | )) | ||
| 62 | 52 | ||
| 63 | ;; in XEmacs: device-type is tty on tty and stream in batch. | 53 | ;; in XEmacs: device-type is tty on tty and stream in batch. |
| 64 | (defun ediff-window-display-p () | 54 | (defun ediff-window-display-p () |
| @@ -75,18 +65,13 @@ that Ediff doesn't know about.") | |||
| 75 | 65 | ||
| 76 | ;; toolbar support for emacs hasn't been implemented in ediff | 66 | ;; toolbar support for emacs hasn't been implemented in ediff |
| 77 | (defun ediff-has-toolbar-support-p () | 67 | (defun ediff-has-toolbar-support-p () |
| 78 | (ediff-cond-compile-for-xemacs-or-emacs | 68 | (if (featurep 'xemacs) |
| 79 | (and (featurep 'toolbar) (console-on-window-system-p)) ; xemacs form | 69 | (if (featurep 'toolbar) (console-on-window-system-p)))) |
| 80 | nil ; emacs form | ||
| 81 | )) | ||
| 82 | 70 | ||
| 83 | 71 | ||
| 84 | (defun ediff-has-gutter-support-p () | 72 | (defun ediff-has-gutter-support-p () |
| 85 | (ediff-cond-compile-for-xemacs-or-emacs | 73 | (if (featurep 'xemacs) |
| 86 | (and (featurep 'gutter) (console-on-window-system-p)) ; xemacs form | 74 | (if (featurep 'gutter) (console-on-window-system-p)))) |
| 87 | nil ; emacs form | ||
| 88 | )) | ||
| 89 | |||
| 90 | 75 | ||
| 91 | (defun ediff-use-toolbar-p () | 76 | (defun ediff-use-toolbar-p () |
| 92 | (and (ediff-has-toolbar-support-p) ;Can it do it ? | 77 | (and (ediff-has-toolbar-support-p) ;Can it do it ? |
| @@ -752,18 +737,17 @@ to temp files when Ediff needs to find fine differences." | |||
| 752 | :group 'ediff) | 737 | :group 'ediff) |
| 753 | 738 | ||
| 754 | 739 | ||
| 755 | (ediff-cond-compile-for-xemacs-or-emacs | 740 | (defalias 'ediff-read-event |
| 756 | (progn ; xemacs | 741 | (if (featurep 'xemacs) 'next-command-event 'read-event)) |
| 757 | (defalias 'ediff-read-event 'next-command-event) | 742 | |
| 758 | (defalias 'ediff-overlayp 'extentp) | 743 | (defalias 'ediff-overlayp |
| 759 | (defalias 'ediff-make-overlay 'make-extent) | 744 | (if (featurep 'xemacs) 'extentp 'overlayp)) |
| 760 | (defalias 'ediff-delete-overlay 'delete-extent)) | 745 | |
| 761 | (progn ; emacs | 746 | (defalias 'ediff-make-overlay |
| 762 | (defalias 'ediff-read-event 'read-event) | 747 | (if (featurep 'xemacs) 'make-extent 'make-overlay)) |
| 763 | (defalias 'ediff-overlayp 'overlayp) | 748 | |
| 764 | (defalias 'ediff-make-overlay 'make-overlay) | 749 | (defalias 'ediff-delete-overlay |
| 765 | (defalias 'ediff-delete-overlay 'delete-overlay)) | 750 | (if (featurep 'xemacs) 'delete-extent 'delete-overlay)) |
| 766 | ) | ||
| 767 | 751 | ||
| 768 | ;; Check the current version against the major and minor version numbers | 752 | ;; Check the current version against the major and minor version numbers |
| 769 | ;; using op: cur-vers op major.minor If emacs-major-version or | 753 | ;; using op: cur-vers op major.minor If emacs-major-version or |
| @@ -810,32 +794,28 @@ to temp files when Ediff needs to find fine differences." | |||
| 810 | 794 | ||
| 811 | 795 | ||
| 812 | (if (ediff-has-face-support-p) | 796 | (if (ediff-has-face-support-p) |
| 813 | (ediff-cond-compile-for-xemacs-or-emacs | 797 | (if (featurep 'xemacs) |
| 814 | (progn ; xemacs | 798 | (progn ; xemacs |
| 815 | (defalias 'ediff-valid-color-p 'valid-color-name-p) | 799 | (defalias 'ediff-valid-color-p 'valid-color-name-p) |
| 816 | (defalias 'ediff-get-face 'get-face)) | 800 | (defalias 'ediff-get-face 'get-face)) |
| 817 | (progn ; emacs | 801 | (defalias 'ediff-valid-color-p (if (fboundp 'color-defined-p) |
| 818 | (defalias 'ediff-valid-color-p (if (fboundp 'color-defined-p) | 802 | 'color-defined-p |
| 819 | 'color-defined-p | 803 | 'x-color-defined-p)) |
| 820 | 'x-color-defined-p)) | 804 | (defalias 'ediff-get-face 'internal-get-face))) |
| 821 | (defalias 'ediff-get-face 'internal-get-face)) | ||
| 822 | )) | ||
| 823 | 805 | ||
| 824 | (if (ediff-window-display-p) | 806 | (if (ediff-window-display-p) |
| 825 | (ediff-cond-compile-for-xemacs-or-emacs | 807 | (if (featurep 'xemacs) |
| 826 | (progn ; xemacs | 808 | (progn ; xemacs |
| 827 | (defalias 'ediff-display-pixel-width 'device-pixel-width) | 809 | (defalias 'ediff-display-pixel-width 'device-pixel-width) |
| 828 | (defalias 'ediff-display-pixel-height 'device-pixel-height)) | 810 | (defalias 'ediff-display-pixel-height 'device-pixel-height)) |
| 829 | (progn ; emacs | 811 | (defalias 'ediff-display-pixel-width |
| 830 | (defalias 'ediff-display-pixel-width | 812 | (if (fboundp 'display-pixel-width) |
| 831 | (if (fboundp 'display-pixel-width) | 813 | 'display-pixel-width |
| 832 | 'display-pixel-width | 814 | 'x-display-pixel-width)) |
| 833 | 'x-display-pixel-width)) | 815 | (defalias 'ediff-display-pixel-height |
| 834 | (defalias 'ediff-display-pixel-height | 816 | (if (fboundp 'display-pixel-height) |
| 835 | (if (fboundp 'display-pixel-height) | 817 | 'display-pixel-height |
| 836 | 'display-pixel-height | 818 | 'x-display-pixel-height)))) |
| 837 | 'x-display-pixel-height))) | ||
| 838 | )) | ||
| 839 | 819 | ||
| 840 | ;; A-list of current-diff-overlay symbols associated with buf types | 820 | ;; A-list of current-diff-overlay symbols associated with buf types |
| 841 | (defconst ediff-current-diff-overlay-alist | 821 | (defconst ediff-current-diff-overlay-alist |
| @@ -917,10 +897,10 @@ this variable represents.") | |||
| 917 | (ediff-hide-face ediff-current-diff-face-A) | 897 | (ediff-hide-face ediff-current-diff-face-A) |
| 918 | ;; Until custom.el for XEmacs starts supporting :inverse-video we do this. | 898 | ;; Until custom.el for XEmacs starts supporting :inverse-video we do this. |
| 919 | ;; This means that some user customization may be trashed. | 899 | ;; This means that some user customization may be trashed. |
| 920 | (if (and (featurep 'xemacs) | 900 | (and (featurep 'xemacs) |
| 921 | (ediff-has-face-support-p) | 901 | (ediff-has-face-support-p) |
| 922 | (not (ediff-color-display-p))) | 902 | (not (ediff-color-display-p)) |
| 923 | (copy-face 'modeline ediff-current-diff-face-A)) | 903 | (copy-face 'modeline ediff-current-diff-face-A)) |
| 924 | 904 | ||
| 925 | 905 | ||
| 926 | 906 | ||
| @@ -948,10 +928,10 @@ this variable represents.") | |||
| 948 | (ediff-hide-face ediff-current-diff-face-B) | 928 | (ediff-hide-face ediff-current-diff-face-B) |
| 949 | ;; Until custom.el for XEmacs starts supporting :inverse-video we do this. | 929 | ;; Until custom.el for XEmacs starts supporting :inverse-video we do this. |
| 950 | ;; This means that some user customization may be trashed. | 930 | ;; This means that some user customization may be trashed. |
| 951 | (if (and (featurep 'xemacs) | 931 | (and (featurep 'xemacs) |
| 952 | (ediff-has-face-support-p) | 932 | (ediff-has-face-support-p) |
| 953 | (not (ediff-color-display-p))) | 933 | (not (ediff-color-display-p)) |
| 954 | (copy-face 'modeline ediff-current-diff-face-B)) | 934 | (copy-face 'modeline ediff-current-diff-face-B)) |
| 955 | 935 | ||
| 956 | 936 | ||
| 957 | (defface ediff-current-diff-C | 937 | (defface ediff-current-diff-C |
| @@ -976,10 +956,10 @@ this variable represents.") | |||
| 976 | (ediff-hide-face ediff-current-diff-face-C) | 956 | (ediff-hide-face ediff-current-diff-face-C) |
| 977 | ;; Until custom.el for XEmacs starts supporting :inverse-video we do this. | 957 | ;; Until custom.el for XEmacs starts supporting :inverse-video we do this. |
| 978 | ;; This means that some user customization may be trashed. | 958 | ;; This means that some user customization may be trashed. |
| 979 | (if (and (featurep 'xemacs) | 959 | (and (featurep 'xemacs) |
| 980 | (ediff-has-face-support-p) | 960 | (ediff-has-face-support-p) |
| 981 | (not (ediff-color-display-p))) | 961 | (not (ediff-color-display-p)) |
| 982 | (copy-face 'modeline ediff-current-diff-face-C)) | 962 | (copy-face 'modeline ediff-current-diff-face-C)) |
| 983 | 963 | ||
| 984 | 964 | ||
| 985 | (defface ediff-current-diff-Ancestor | 965 | (defface ediff-current-diff-Ancestor |
| @@ -1004,10 +984,10 @@ this variable represents.") | |||
| 1004 | (ediff-hide-face ediff-current-diff-face-Ancestor) | 984 | (ediff-hide-face ediff-current-diff-face-Ancestor) |
| 1005 | ;; Until custom.el for XEmacs starts supporting :inverse-video we do this. | 985 | ;; Until custom.el for XEmacs starts supporting :inverse-video we do this. |
| 1006 | ;; This means that some user customization may be trashed. | 986 | ;; This means that some user customization may be trashed. |
| 1007 | (if (and (featurep 'xemacs) | 987 | (and (featurep 'xemacs) |
| 1008 | (ediff-has-face-support-p) | 988 | (ediff-has-face-support-p) |
| 1009 | (not (ediff-color-display-p))) | 989 | (not (ediff-color-display-p)) |
| 1010 | (copy-face 'modeline ediff-current-diff-face-Ancestor)) | 990 | (copy-face 'modeline ediff-current-diff-face-Ancestor)) |
| 1011 | 991 | ||
| 1012 | 992 | ||
| 1013 | (defface ediff-fine-diff-A | 993 | (defface ediff-fine-diff-A |
| @@ -1353,33 +1333,28 @@ this variable represents.") | |||
| 1353 | (defun ediff-highest-priority (start end buffer) | 1333 | (defun ediff-highest-priority (start end buffer) |
| 1354 | (let ((pos (max 1 (1- start))) | 1334 | (let ((pos (max 1 (1- start))) |
| 1355 | ovr-list) | 1335 | ovr-list) |
| 1356 | (ediff-cond-compile-for-xemacs-or-emacs | 1336 | (if (featurep 'xemacs) |
| 1357 | (1+ ediff-shadow-overlay-priority) ; xemacs form | 1337 | (1+ ediff-shadow-overlay-priority) |
| 1358 | ;; emacs form | 1338 | (ediff-with-current-buffer buffer |
| 1359 | (ediff-with-current-buffer buffer | 1339 | (while (< pos (min (point-max) (1+ end))) |
| 1360 | (while (< pos (min (point-max) (1+ end))) | 1340 | (setq ovr-list (append (overlays-at pos) ovr-list)) |
| 1361 | (setq ovr-list (append (overlays-at pos) ovr-list)) | 1341 | (setq pos (next-overlay-change pos))) |
| 1362 | (setq pos (next-overlay-change pos))) | 1342 | (+ 1 ediff-shadow-overlay-priority |
| 1363 | (+ 1 ediff-shadow-overlay-priority | 1343 | (apply 'max |
| 1364 | (apply 'max | 1344 | (cons |
| 1365 | (cons | 1345 | 1 |
| 1366 | 1 | 1346 | (mapcar |
| 1367 | (mapcar | 1347 | (lambda (ovr) |
| 1368 | (lambda (ovr) | 1348 | (if (and ovr |
| 1369 | (if (and ovr | 1349 | ;; exclude ediff overlays from priority |
| 1370 | ;; exclude ediff overlays from priority | 1350 | ;; calculation, or else priority will keep |
| 1371 | ;; calculation, or else priority will keep | 1351 | ;; increasing |
| 1372 | ;; increasing | 1352 | (null (ediff-overlay-get ovr 'ediff)) |
| 1373 | (null (ediff-overlay-get ovr 'ediff)) | 1353 | (null (ediff-overlay-get ovr 'ediff-diff-num))) |
| 1374 | (null (ediff-overlay-get ovr 'ediff-diff-num))) | 1354 | ;; use the overlay priority or 0 |
| 1375 | ;; use the overlay priority or 0 | 1355 | (or (ediff-overlay-get ovr 'priority) 0) |
| 1376 | (or (ediff-overlay-get ovr 'priority) 0) | 1356 | 0)) |
| 1377 | 0)) | 1357 | ovr-list)))))))) |
| 1378 | ovr-list) | ||
| 1379 | ) | ||
| 1380 | ))) | ||
| 1381 | ) ; ediff-cond-compile-for-xemacs-or-emacs | ||
| 1382 | )) | ||
| 1383 | 1358 | ||
| 1384 | 1359 | ||
| 1385 | (defvar ediff-toggle-read-only-function nil | 1360 | (defvar ediff-toggle-read-only-function nil |
| @@ -1552,54 +1527,45 @@ This default should work without changes." | |||
| 1552 | 1527 | ||
| 1553 | 1528 | ||
| 1554 | (defsubst ediff-mouse-event-p (event) | 1529 | (defsubst ediff-mouse-event-p (event) |
| 1555 | (ediff-cond-compile-for-xemacs-or-emacs | 1530 | (if (featurep 'xemacs) |
| 1556 | (button-event-p event) ; xemacs form | 1531 | (button-event-p event) |
| 1557 | (string-match "mouse" (format "%S" (event-basic-type event))) ; emacs form | 1532 | (string-match "mouse" (format "%S" (event-basic-type event))))) |
| 1558 | )) | ||
| 1559 | 1533 | ||
| 1560 | 1534 | ||
| 1561 | (defsubst ediff-key-press-event-p (event) | 1535 | (defsubst ediff-key-press-event-p (event) |
| 1562 | (ediff-cond-compile-for-xemacs-or-emacs | 1536 | (if (featurep 'xemacs) |
| 1563 | (key-press-event-p event) ; xemacs form | 1537 | (key-press-event-p event) |
| 1564 | (or (char-or-string-p event) (symbolp event)) ; emacs form | 1538 | (or (char-or-string-p event) (symbolp event)))) |
| 1565 | )) | ||
| 1566 | 1539 | ||
| 1567 | (defun ediff-event-point (event) | 1540 | (defun ediff-event-point (event) |
| 1568 | (cond ((ediff-mouse-event-p event) | 1541 | (cond ((ediff-mouse-event-p event) |
| 1569 | (ediff-cond-compile-for-xemacs-or-emacs | 1542 | (if (featurep 'xemacs) |
| 1570 | (event-point event) ; xemacs form | 1543 | (event-point event) |
| 1571 | (posn-point (event-start event)) ; emacs form | 1544 | (posn-point (event-start event)))) |
| 1572 | ) | ||
| 1573 | ) | ||
| 1574 | ((ediff-key-press-event-p event) | 1545 | ((ediff-key-press-event-p event) |
| 1575 | (point)) | 1546 | (point)) |
| 1576 | (t (error "Error")))) | 1547 | (t (error "Error")))) |
| 1577 | 1548 | ||
| 1578 | (defun ediff-event-buffer (event) | 1549 | (defun ediff-event-buffer (event) |
| 1579 | (cond ((ediff-mouse-event-p event) | 1550 | (cond ((ediff-mouse-event-p event) |
| 1580 | (ediff-cond-compile-for-xemacs-or-emacs | 1551 | (if (featurep 'xemacs) |
| 1581 | (event-buffer event) ; xemacs form | 1552 | (event-buffer event) |
| 1582 | (window-buffer (posn-window (event-start event))) ; emacs form | 1553 | (window-buffer (posn-window (event-start event))))) |
| 1583 | ) | ||
| 1584 | ) | ||
| 1585 | ((ediff-key-press-event-p event) | 1554 | ((ediff-key-press-event-p event) |
| 1586 | (current-buffer)) | 1555 | (current-buffer)) |
| 1587 | (t (error "Error")))) | 1556 | (t (error "Error")))) |
| 1588 | 1557 | ||
| 1589 | (defun ediff-event-key (event-or-key) | 1558 | (defun ediff-event-key (event-or-key) |
| 1590 | (ediff-cond-compile-for-xemacs-or-emacs | 1559 | (if (featurep 'xemacs) |
| 1591 | (if (eventp event-or-key) (event-key event-or-key) event-or-key) ; xemacs | 1560 | (if (eventp event-or-key) (event-key event-or-key) event-or-key) |
| 1592 | event-or-key ; emacs form | 1561 | event-or-key)) |
| 1593 | )) | ||
| 1594 | 1562 | ||
| 1595 | 1563 | ||
| 1596 | (defsubst ediff-frame-iconified-p (frame) | 1564 | (defsubst ediff-frame-iconified-p (frame) |
| 1597 | (if (and (ediff-window-display-p) (frame-live-p frame)) | 1565 | (and (ediff-window-display-p) (frame-live-p frame) |
| 1598 | (ediff-cond-compile-for-xemacs-or-emacs | 1566 | (if (featurep 'xemacs) |
| 1599 | (frame-iconified-p frame) ; xemacs form | 1567 | (frame-iconified-p frame) |
| 1600 | (eq (frame-visible-p frame) 'icon) ; emacs form | 1568 | (eq (frame-visible-p frame) 'icon)))) |
| 1601 | ) | ||
| 1602 | )) | ||
| 1603 | 1569 | ||
| 1604 | (defsubst ediff-window-visible-p (wind) | 1570 | (defsubst ediff-window-visible-p (wind) |
| 1605 | ;; under TTY, window-live-p also means window is visible | 1571 | ;; under TTY, window-live-p also means window is visible |
| @@ -1609,10 +1575,9 @@ This default should work without changes." | |||
| 1609 | 1575 | ||
| 1610 | 1576 | ||
| 1611 | (defsubst ediff-frame-char-width (frame) | 1577 | (defsubst ediff-frame-char-width (frame) |
| 1612 | (ediff-cond-compile-for-xemacs-or-emacs | 1578 | (if (featurep 'xemacs) |
| 1613 | (/ (frame-pixel-width frame) (frame-width frame)) ; xemacs | 1579 | (/ (frame-pixel-width frame) (frame-width frame)) |
| 1614 | (frame-char-width frame) ; emacs | 1580 | (frame-char-width frame))) |
| 1615 | )) | ||
| 1616 | 1581 | ||
| 1617 | (defun ediff-reset-mouse (&optional frame do-not-grab-mouse) | 1582 | (defun ediff-reset-mouse (&optional frame do-not-grab-mouse) |
| 1618 | (or frame (setq frame (selected-frame))) | 1583 | (or frame (setq frame (selected-frame))) |
| @@ -1657,29 +1622,23 @@ This default should work without changes." | |||
| 1657 | (t nil)))) | 1622 | (t nil)))) |
| 1658 | 1623 | ||
| 1659 | (defsubst ediff-frame-char-height (frame) | 1624 | (defsubst ediff-frame-char-height (frame) |
| 1660 | (ediff-cond-compile-for-xemacs-or-emacs | 1625 | (if (featurep 'xemacs) |
| 1661 | (glyph-height ediff-H-glyph (frame-selected-window frame)) ; xemacs case | 1626 | (glyph-height ediff-H-glyph (frame-selected-window frame)) |
| 1662 | (frame-char-height frame) ; emacs case | 1627 | (frame-char-height frame))) |
| 1663 | ) | ||
| 1664 | ) | ||
| 1665 | 1628 | ||
| 1666 | ;; Some overlay functions | 1629 | ;; Some overlay functions |
| 1667 | 1630 | ||
| 1668 | (defsubst ediff-overlay-start (overl) | 1631 | (defsubst ediff-overlay-start (overl) |
| 1669 | (if (ediff-overlayp overl) | 1632 | (if (ediff-overlayp overl) |
| 1670 | (ediff-cond-compile-for-xemacs-or-emacs | 1633 | (if (featurep 'xemacs) |
| 1671 | (extent-start-position overl) ; xemacs form | 1634 | (extent-start-position overl) |
| 1672 | (overlay-start overl) ; emacs form | 1635 | (overlay-start overl)))) |
| 1673 | ) | ||
| 1674 | )) | ||
| 1675 | 1636 | ||
| 1676 | (defsubst ediff-overlay-end (overl) | 1637 | (defsubst ediff-overlay-end (overl) |
| 1677 | (if (ediff-overlayp overl) | 1638 | (if (ediff-overlayp overl) |
| 1678 | (ediff-cond-compile-for-xemacs-or-emacs | 1639 | (if (featurep 'xemacs) |
| 1679 | (extent-end-position overl) ; xemacs form | 1640 | (extent-end-position overl) |
| 1680 | (overlay-end overl) ; emacs form | 1641 | (overlay-end overl)))) |
| 1681 | ) | ||
| 1682 | )) | ||
| 1683 | 1642 | ||
| 1684 | (defsubst ediff-empty-overlay-p (overl) | 1643 | (defsubst ediff-empty-overlay-p (overl) |
| 1685 | (= (ediff-overlay-start overl) (ediff-overlay-end overl))) | 1644 | (= (ediff-overlay-start overl) (ediff-overlay-end overl))) |
| @@ -1687,18 +1646,16 @@ This default should work without changes." | |||
| 1687 | ;; like overlay-buffer in Emacs. In XEmacs, returns nil if the extent is | 1646 | ;; like overlay-buffer in Emacs. In XEmacs, returns nil if the extent is |
| 1688 | ;; dead. Otherwise, works like extent-buffer | 1647 | ;; dead. Otherwise, works like extent-buffer |
| 1689 | (defun ediff-overlay-buffer (overl) | 1648 | (defun ediff-overlay-buffer (overl) |
| 1690 | (ediff-cond-compile-for-xemacs-or-emacs | 1649 | (if (featurep 'xemacs) |
| 1691 | (and (extent-live-p overl) (extent-object overl)) ; xemacs form | 1650 | (and (extent-live-p overl) (extent-object overl)) |
| 1692 | (overlay-buffer overl) ; emacs form | 1651 | (overlay-buffer overl))) |
| 1693 | )) | ||
| 1694 | 1652 | ||
| 1695 | ;; like overlay-get in Emacs. In XEmacs, returns nil if the extent is | 1653 | ;; like overlay-get in Emacs. In XEmacs, returns nil if the extent is |
| 1696 | ;; dead. Otherwise, like extent-property | 1654 | ;; dead. Otherwise, like extent-property |
| 1697 | (defun ediff-overlay-get (overl property) | 1655 | (defun ediff-overlay-get (overl property) |
| 1698 | (ediff-cond-compile-for-xemacs-or-emacs | 1656 | (if (featurep 'xemacs) |
| 1699 | (and (extent-live-p overl) (extent-property overl property)) ; xemacs form | 1657 | (and (extent-live-p overl) (extent-property overl property)) |
| 1700 | (overlay-get overl property) ; emacs form | 1658 | (overlay-get overl property))) |
| 1701 | )) | ||
| 1702 | 1659 | ||
| 1703 | 1660 | ||
| 1704 | ;; These two functions are here because XEmacs refuses to | 1661 | ;; These two functions are here because XEmacs refuses to |
| @@ -1708,10 +1665,9 @@ This default should work without changes." | |||
| 1708 | Checks if overlay's buffer exists before actually doing the move." | 1665 | Checks if overlay's buffer exists before actually doing the move." |
| 1709 | (let ((buf (and overlay (ediff-overlay-buffer overlay)))) | 1666 | (let ((buf (and overlay (ediff-overlay-buffer overlay)))) |
| 1710 | (if (ediff-buffer-live-p buf) | 1667 | (if (ediff-buffer-live-p buf) |
| 1711 | (ediff-cond-compile-for-xemacs-or-emacs | 1668 | (if (featurep 'xemacs) |
| 1712 | (set-extent-endpoints overlay beg end) ; xemacs form | 1669 | (set-extent-endpoints overlay beg end) |
| 1713 | (move-overlay overlay beg end buffer) ; emacs form | 1670 | (move-overlay overlay beg end buffer)) |
| 1714 | ) | ||
| 1715 | ;; buffer's dead | 1671 | ;; buffer's dead |
| 1716 | (if overlay | 1672 | (if overlay |
| 1717 | (ediff-delete-overlay overlay))))) | 1673 | (ediff-delete-overlay overlay))))) |
| @@ -1720,10 +1676,9 @@ Checks if overlay's buffer exists before actually doing the move." | |||
| 1720 | "Calls `overlay-put' or `set-extent-property' depending on Emacs version. | 1676 | "Calls `overlay-put' or `set-extent-property' depending on Emacs version. |
| 1721 | Checks if overlay's buffer exists." | 1677 | Checks if overlay's buffer exists." |
| 1722 | (if (ediff-buffer-live-p (ediff-overlay-buffer overlay)) | 1678 | (if (ediff-buffer-live-p (ediff-overlay-buffer overlay)) |
| 1723 | (ediff-cond-compile-for-xemacs-or-emacs | 1679 | (if (featurep 'xemacs) |
| 1724 | (set-extent-property overlay prop value) ; xemacs form | 1680 | (set-extent-property overlay prop value) |
| 1725 | (overlay-put overlay prop value) ; emacs form | 1681 | (overlay-put overlay prop value)) |
| 1726 | ) | ||
| 1727 | (ediff-delete-overlay overlay))) | 1682 | (ediff-delete-overlay overlay))) |
| 1728 | 1683 | ||
| 1729 | ;; temporarily uses DIR to abbreviate file name | 1684 | ;; temporarily uses DIR to abbreviate file name |
| @@ -1733,12 +1688,10 @@ Checks if overlay's buffer exists." | |||
| 1733 | (let ((directory-abbrev-alist (list (cons dir "")))) | 1688 | (let ((directory-abbrev-alist (list (cons dir "")))) |
| 1734 | (abbreviate-file-name file))) | 1689 | (abbreviate-file-name file))) |
| 1735 | (t | 1690 | (t |
| 1736 | (ediff-cond-compile-for-xemacs-or-emacs | 1691 | (if (featurep 'xemacs) |
| 1737 | ;; XEmacs requires addl argument | 1692 | ;; XEmacs requires addl argument |
| 1738 | (abbreviate-file-name file t) ; xemacs form | 1693 | (abbreviate-file-name file t) |
| 1739 | (abbreviate-file-name file)) ; emacs form | 1694 | (abbreviate-file-name file))))) |
| 1740 | ) | ||
| 1741 | )) | ||
| 1742 | 1695 | ||
| 1743 | ;; Takes a directory and returns the parent directory. | 1696 | ;; Takes a directory and returns the parent directory. |
| 1744 | ;; does nothing to `/'. If the ARG is a regular file, | 1697 | ;; does nothing to `/'. If the ARG is a regular file, |