Mercurial > emacs
comparison lisp/ediff-init.el @ 14582:c768f6d7daaa
*** empty log message ***
author | Michael Kifer <kifer@cs.stonybrook.edu> |
---|---|
date | Fri, 16 Feb 1996 06:36:35 +0000 |
parents | 3c38a5112cb6 |
children | 43a3308fcf61 |
comparison
equal
deleted
inserted
replaced
14581:4951b11970a1 | 14582:c768f6d7daaa |
---|---|
31 (defsubst ediff-device-type () | 31 (defsubst ediff-device-type () |
32 (if ediff-emacs-p | 32 (if ediff-emacs-p |
33 window-system | 33 window-system |
34 (device-type (selected-device)))) | 34 (device-type (selected-device)))) |
35 ;; in XEmacs: device-type is tty on tty and stream in batch. | 35 ;; in XEmacs: device-type is tty on tty and stream in batch. |
36 (defsubst ediff-window-display-p () | 36 (defun ediff-window-display-p () |
37 (and (ediff-device-type) (not (memq (ediff-device-type) '(tty stream))))) | 37 (and (ediff-device-type) (not (memq (ediff-device-type) '(tty pc stream))))) |
38 | |
39 ;; test if supports faces | |
40 ;; ediff-force-faces is for those devices that support faces, but we don't know | |
41 ;; this yet | |
42 (defun ediff-has-face-support-p () | |
43 (cond ((ediff-window-display-p)) | |
44 (ediff-force-faces) | |
45 (ediff-emacs-p (memq (ediff-device-type) '(pc))) | |
46 (ediff-xemacs-p (memq (ediff-device-type) '(tty pc))))) | |
47 | |
38 | 48 |
39 ;;; Macros | 49 ;;; Macros |
40 (defmacro ediff-odd-p (arg) | 50 (defmacro ediff-odd-p (arg) |
41 (` (eq (logand (, arg) 1) 1))) | 51 (` (eq (logand (, arg) 1) 1))) |
42 | 52 |
144 (progn | 154 (progn |
145 (set-buffer (, buffer)) | 155 (set-buffer (, buffer)) |
146 (,@ forms)) | 156 (,@ forms)) |
147 (set-buffer StartBuffer)) | 157 (set-buffer StartBuffer)) |
148 (or (eq this-command 'ediff-quit) | 158 (or (eq this-command 'ediff-quit) |
149 (error | 159 (error ediff-KILLED-VITAL-BUFFER)) |
150 "You've killed an essential Ediff buffer---Please quit Ediff")) | |
151 )))) | 160 )))) |
152 | 161 |
153 | 162 |
154 (defsubst ediff-multiframe-setup-p () | 163 (defsubst ediff-multiframe-setup-p () |
155 (and (ediff-window-display-p) ediff-multiframe)) | 164 (and (ediff-window-display-p) ediff-multiframe)) |
224 (defsubst ediff-dir1-metajob (&optional metajob) | 233 (defsubst ediff-dir1-metajob (&optional metajob) |
225 (or (ediff-revision-metajob metajob) | 234 (or (ediff-revision-metajob metajob) |
226 ;; add more here | 235 ;; add more here |
227 )) | 236 )) |
228 (defsubst ediff-collect-diffs-metajob (&optional metajob) | 237 (defsubst ediff-collect-diffs-metajob (&optional metajob) |
229 (or (ediff-revision-metajob metajob) | 238 (memq (or metajob ediff-metajob-name) |
230 (memq ediff-metajob-name | 239 '(ediff-directories |
231 '(ediff-directories | 240 ediff-directory-revisions |
232 ;; add more here | 241 ediff-merge-directories |
233 ediff-directory-revisions)))) | 242 ediff-merge-directories-with-ancestor |
243 ediff-merge-directory-revisions | |
244 ediff-merge-directory-revisions-with-ancestor | |
245 ;; add more here | |
246 ))) | |
247 | |
234 (defsubst ediff-metajob3 (&optional metajob) | 248 (defsubst ediff-metajob3 (&optional metajob) |
235 (memq (or metajob ediff-metajob-name) | 249 (memq (or metajob ediff-metajob-name) |
236 '(ediff-merge-directories-with-ancestor | 250 '(ediff-merge-directories-with-ancestor |
237 ediff-merge-filegroups-with-ancestor | 251 ediff-merge-filegroups-with-ancestor |
238 ediff-directories3 | 252 ediff-directories3 |
333 j -jump to diff | @ -auto-refinement | * -refine current region | 347 j -jump to diff | @ -auto-refinement | * -refine current region |
334 gx -goto X's point| | ! -update diff regions | 348 gx -goto X's point| | ! -update diff regions |
335 C-l -recenter | ## -ignore whitespace | | 349 C-l -recenter | ## -ignore whitespace | |
336 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X | 350 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X |
337 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output | 351 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output |
338 | m -wide display | ~ -swap buffers | 352 ~ -swap variants | m -wide display | |
339 " | 353 " |
340 "Help message usually used for 2-way comparison. | 354 "Help message usually used for 2-way comparison. |
341 Normally, not a user option. See `ediff-help-message' for details.") | 355 Normally, not a user option. See `ediff-help-message' for details.") |
342 | 356 |
343 (defconst ediff-long-help-message-narrow2 | 357 (defconst ediff-long-help-message-narrow2 |
347 j -jump to diff | @ -auto-refinement | * -refine current region | 361 j -jump to diff | @ -auto-refinement | * -refine current region |
348 gx -goto X's point| % -narrow/widen buffs | ! -update diff regions | 362 gx -goto X's point| % -narrow/widen buffs | ! -update diff regions |
349 C-l -recenter | ## -ignore whitespace | | 363 C-l -recenter | ## -ignore whitespace | |
350 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X | 364 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X |
351 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output | 365 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output |
352 | m -wide display | ~ -swap buffers | 366 ~ -swap variants | m -wide display | |
353 " | 367 " |
354 "Help message when comparing windows or regions line-by-line. | 368 "Help message when comparing windows or regions line-by-line. |
355 Normally, not a user option. See `ediff-help-message' for details.") | 369 Normally, not a user option. See `ediff-help-message' for details.") |
356 | 370 |
357 (defconst ediff-long-help-message-word-mode | 371 (defconst ediff-long-help-message-word-mode |
361 j -jump to diff | | | 375 j -jump to diff | | |
362 gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs | 376 gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs |
363 C-l -recenter | | | 377 C-l -recenter | | |
364 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X | 378 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X |
365 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output | 379 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output |
366 | m -wide display | ~ -swap buffers | 380 ~ -swap variants | m -wide display | |
367 " | 381 " |
368 "Help message when comparing windows or regions word-by-word. | 382 "Help message when comparing windows or regions word-by-word. |
369 Normally, not a user option. See `ediff-help-message' for details.") | 383 Normally, not a user option. See `ediff-help-message' for details.") |
370 | 384 |
371 (defconst ediff-long-help-message-merge | 385 (defconst ediff-long-help-message-merge |
375 j -jump to diff | @ -auto-refinement | * -refine current region | 389 j -jump to diff | @ -auto-refinement | * -refine current region |
376 gx -goto X's point| ## -ignore whitespace | ! -update diff regions | 390 gx -goto X's point| ## -ignore whitespace | ! -update diff regions |
377 C-l -recenter | #f/#h -focus/hide regions | + -combine diff regions | 391 C-l -recenter | #f/#h -focus/hide regions | + -combine diff regions |
378 v/V -scroll up/dn | X -read-only in buf X | wx -save buf X | 392 v/V -scroll up/dn | X -read-only in buf X | wx -save buf X |
379 </> -scroll lt/rt | m -wide display | wd -save diff output | 393 </> -scroll lt/rt | m -wide display | wd -save diff output |
380 / -ancestor buff | s -shrink window C | ~ -swap buffers | 394 ~ -swap variants | s -shrink window C | / -show ancestor buff |
381 | $ -show clashes only | & -merge w/new default | 395 | $ -show clashes only | & -merge w/new default |
382 " | 396 " |
383 "Help message during merging. | 397 "Help message during merging. |
384 Normally, not a user option. See `ediff-help-message' for details.") | 398 Normally, not a user option. See `ediff-help-message' for details.") |
385 | 399 |
400 produce the brief help message. This function must return a string.") | 414 produce the brief help message. This function must return a string.") |
401 (ediff-defvar-local ediff-long-help-message-function nil | 415 (ediff-defvar-local ediff-long-help-message-function nil |
402 "The long help message that the user can customize. | 416 "The long help message that the user can customize. |
403 See `ediff-brief-help-message-function' for more.") | 417 See `ediff-brief-help-message-function' for more.") |
404 | 418 |
405 (defvar ediff-prefer-long-help-message nil | 419 (defvar ediff-use-long-help-message nil |
406 "*If t, Ediff starts with a long help message. Short help msg otherwise.") | 420 "*If t, Ediff displays a long help message. Short help message otherwise.") |
407 | 421 |
408 ;; The actual help message. | 422 ;; The actual help message. |
409 (ediff-defvar-local ediff-help-message "" | 423 (ediff-defvar-local ediff-help-message "" |
410 "The actual help message. | 424 "The actual help message. |
411 Normally, the user shouldn't touch this. However, if you want Ediff to | 425 Normally, the user shouldn't touch this. However, if you want Ediff to |
412 start up with different help messages for different jobs, you can change | 426 start up with different help messages for different jobs, you can change |
413 the value of this variable and the variables `ediff-help-message-*' in | 427 the value of this variable and the variables `ediff-help-message-*' in |
414 `ediff-startup-hook'.") | 428 `ediff-startup-hook'.") |
429 | |
430 ;; Error messages | |
431 (defconst ediff-KILLED-VITAL-BUFFER | |
432 "You have killed a vital Ediff buffer---you must leave Ediff now!") | |
433 (defconst ediff-NO-DIFFERENCES | |
434 "Sorry, it is not my job to munch identical variants...") | |
415 | 435 |
416 ;; Selective browsing | 436 ;; Selective browsing |
417 | 437 |
418 (ediff-defvar-local ediff-skip-diff-region-function 'ediff-show-all-diffs | 438 (ediff-defvar-local ediff-skip-diff-region-function 'ediff-show-all-diffs |
419 "Function that determines the next/previous diff region to show. | 439 "Function that determines the next/previous diff region to show. |
482 (defvar ediff-after-flag-mol (if ediff-xemacs-p (make-glyph "<<-") "<<-") | 502 (defvar ediff-after-flag-mol (if ediff-xemacs-p (make-glyph "<<-") "<<-") |
483 "*Like ediff-after-flag, used when a difference starts in mid-line.") | 503 "*Like ediff-after-flag, used when a difference starts in mid-line.") |
484 | 504 |
485 | 505 |
486 (ediff-defvar-local ediff-use-faces t | 506 (ediff-defvar-local ediff-use-faces t |
487 "If t, differences are highlighted using faces on a window system. | 507 "If t, differences are highlighted using faces, if device supports faces. |
488 If nil, they are highlighted using ASCII flags, ediff-before-flag | 508 If nil, differences are highlighted using ASCII flags, ediff-before-flag |
489 and ediff-after-flag. On a non-window system, differences are always | 509 and ediff-after-flag. On a non-window system, differences are always |
490 highlighted using ASCII flags. | 510 highlighted using ASCII flags. |
491 This variable can be set either in .emacs or toggled interactively. | 511 This variable can be set either in .emacs or toggled interactively. |
492 Use `setq-default' if setting it in .emacs") | 512 Use `setq-default' if setting it in .emacs") |
513 | |
514 (defvar ediff-force-faces nil | |
515 "If t, Ediff will think that it is running on a display that supports faces. | |
516 This is provided as a temporary relief for users of face-capable displays | |
517 that Ediff doesn't know about.") | |
493 | 518 |
494 | 519 |
495 ;; this indicates that diff regions are word-size, so fine diffs are | 520 ;; this indicates that diff regions are word-size, so fine diffs are |
496 ;; permanently nixed; used in ediff-windows-wordwise and ediff-regions-wordwise | 521 ;; permanently nixed; used in ediff-windows-wordwise and ediff-regions-wordwise |
497 (ediff-defvar-local ediff-word-mode nil "") | 522 (ediff-defvar-local ediff-word-mode nil "") |
568 ;; The original values of ediff-protected-variables for buffer Ancestor | 593 ;; The original values of ediff-protected-variables for buffer Ancestor |
569 (ediff-defvar-local ediff-buffer-values-orig-Ancestor nil "") | 594 (ediff-defvar-local ediff-buffer-values-orig-Ancestor nil "") |
570 ;; Buffer-local variables to be saved then restored during Ediff sessions | 595 ;; Buffer-local variables to be saved then restored during Ediff sessions |
571 ;; Buffer-local variables to be saved then restored during Ediff sessions | 596 ;; Buffer-local variables to be saved then restored during Ediff sessions |
572 (defconst ediff-protected-variables '(buffer-read-only | 597 (defconst ediff-protected-variables '(buffer-read-only |
573 synchronize-minibuffers | 598 ;;; synchronize-minibuffers |
574 mode-line-format)) | 599 mode-line-format)) |
575 | 600 |
576 ;; Vector of differences between the variants. Each difference is | 601 ;; Vector of differences between the variants. Each difference is |
577 ;; represented by a vector of two overlays plus a vector of fine diffs, | 602 ;; represented by a vector of two overlays plus a vector of fine diffs, |
578 ;; plus a no-fine-diffs flag. The first overlay spans the | 603 ;; plus a no-fine-diffs flag. The first overlay spans the |
634 ;; Priority of non-selected overlays. | 659 ;; Priority of non-selected overlays. |
635 (defvar ediff-shadow-overlay-priority 100 "") | 660 (defvar ediff-shadow-overlay-priority 100 "") |
636 | 661 |
637 (defvar ediff-version-control-package 'vc | 662 (defvar ediff-version-control-package 'vc |
638 "Version control package used. | 663 "Version control package used. |
639 Currently, Ediff supports vc.el, rcs.el, and generic-sc.el. The standard Emacs | 664 Currently, Ediff supports vc.el, rcs.el, pcl-cvs.el, and generic-sc.el. The |
640 interface to RCS, CVS, SCCS, etc., is vc.el. However, some people find the | 665 standard Emacs interface to RCS, CVS, SCCS, etc., is vc.el. However, some |
641 other two packages more convenient. Set this variable `rcs' or `generic-sc' if | 666 people find the other two packages more convenient. Set this variable to the |
642 you are such a person.") | 667 appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire.") |
643 | 668 |
644 | 669 |
645 (if ediff-xemacs-p | 670 (if ediff-xemacs-p |
646 (progn | 671 (progn |
647 (fset 'ediff-read-event (symbol-function 'next-command-event)) | 672 (fset 'ediff-read-event (symbol-function 'next-command-event)) |
648 (fset 'ediff-overlayp (symbol-function 'extentp)) | 673 (fset 'ediff-overlayp (symbol-function 'extentp)) |
649 (fset 'ediff-make-overlay (symbol-function 'make-extent)) | 674 (fset 'ediff-make-overlay (symbol-function 'make-extent)) |
650 (fset 'ediff-delete-overlay (symbol-function 'delete-extent)) | 675 (fset 'ediff-delete-overlay (symbol-function 'delete-extent))) |
651 (fset 'ediff-overlay-buffer (symbol-function 'extent-buffer)) | |
652 (fset 'ediff-overlay-get (symbol-function 'extent-property))) | |
653 (fset 'ediff-read-event (symbol-function 'read-event)) | 676 (fset 'ediff-read-event (symbol-function 'read-event)) |
654 (fset 'ediff-overlayp (symbol-function 'overlayp)) | 677 (fset 'ediff-overlayp (symbol-function 'overlayp)) |
655 (fset 'ediff-overlayp (symbol-function 'overlayp)) | 678 (fset 'ediff-overlayp (symbol-function 'overlayp)) |
656 (fset 'ediff-make-overlay (symbol-function 'make-overlay)) | 679 (fset 'ediff-make-overlay (symbol-function 'make-overlay)) |
657 (fset 'ediff-delete-overlay (symbol-function 'delete-overlay)) | 680 (fset 'ediff-delete-overlay (symbol-function 'delete-overlay))) |
658 (fset 'ediff-overlay-buffer (symbol-function 'overlay-buffer)) | |
659 (fset 'ediff-overlay-get (symbol-function 'overlay-get))) | |
660 | 681 |
661 ;; Check the current version against the major and minor version numbers | 682 ;; Check the current version against the major and minor version numbers |
662 ;; using op: cur-vers op major.minor If emacs-major-version or | 683 ;; using op: cur-vers op major.minor If emacs-major-version or |
663 ;; emacs-minor-version are not defined, we assume that the current version | 684 ;; emacs-minor-version are not defined, we assume that the current version |
664 ;; is hopelessly outdated. We assume that emacs-major-version and | 685 ;; is hopelessly outdated. We assume that emacs-major-version and |
726 (if ediff-emacs-p | 747 (if ediff-emacs-p |
727 (x-display-color-p) | 748 (x-display-color-p) |
728 (eq (device-class (selected-device)) 'color))) | 749 (eq (device-class (selected-device)) 'color))) |
729 | 750 |
730 | 751 |
752 (if (ediff-has-face-support-p) | |
753 (if ediff-xemacs-p | |
754 (progn | |
755 (fset 'ediff-valid-color-p (symbol-function 'valid-color-name-p)) | |
756 (fset 'ediff-get-face (symbol-function 'get-face))) | |
757 ;; Temporary fix for OS/2 port of Emacs | |
758 ;; pm-win.el in PM-Emacs should be fixed. | |
759 (if (eq (ediff-device-type) 'pm) | |
760 (fset 'ediff-valid-color-p | |
761 (function (lambda (color) (assoc color pm-color-alist)))) | |
762 (fset 'ediff-valid-color-p (symbol-function 'x-color-defined-p))) | |
763 (fset 'ediff-get-face (symbol-function 'internal-get-face)))) | |
764 | |
731 (if (ediff-window-display-p) | 765 (if (ediff-window-display-p) |
732 (if ediff-xemacs-p | 766 (if ediff-xemacs-p |
733 (progn | 767 (progn |
734 (fset 'ediff-display-pixel-width | 768 (fset 'ediff-display-pixel-width |
735 (symbol-function 'device-pixel-width)) | 769 (symbol-function 'device-pixel-width)) |
736 (fset 'ediff-display-pixel-height | 770 (fset 'ediff-display-pixel-height |
737 (symbol-function 'device-pixel-height)) | 771 (symbol-function 'device-pixel-height))) |
738 (fset 'ediff-valid-color-p (symbol-function 'valid-color-name-p)) | |
739 (fset 'ediff-get-face (symbol-function 'get-face))) | |
740 ;; Temporary fix for OS/2 port of Emacs | |
741 ;; pm-win.el in PM-Emacs should be fixed. | |
742 (fset 'ediff-display-pixel-width | 772 (fset 'ediff-display-pixel-width |
743 (symbol-function 'x-display-pixel-width)) | 773 (symbol-function 'x-display-pixel-width)) |
744 (fset 'ediff-display-pixel-height | 774 (fset 'ediff-display-pixel-height |
745 (symbol-function 'x-display-pixel-height)) | 775 (symbol-function 'x-display-pixel-height)))) |
746 (if (eq (ediff-device-type) 'pm) | |
747 (fset 'ediff-valid-color-p | |
748 (function (lambda (color) (assoc color pm-color-alist)))) | |
749 (fset 'ediff-valid-color-p (symbol-function 'x-color-defined-p))) | |
750 (fset 'ediff-get-face (symbol-function 'internal-get-face)))) | |
751 | 776 |
752 | 777 |
753 (defun ediff-make-current-diff-overlay (type) | 778 (defun ediff-make-current-diff-overlay (type) |
754 (if (ediff-window-display-p) | 779 (if (ediff-has-face-support-p) |
755 (let ((overlay (intern (format "ediff-current-diff-overlay-%S" type))) | 780 (let ((overlay (intern (format "ediff-current-diff-overlay-%S" type))) |
756 (buffer (ediff-get-buffer type)) | 781 (buffer (ediff-get-buffer type)) |
757 (face (face-name | 782 (face (face-name |
758 (symbol-value | 783 (symbol-value |
759 (intern (format "ediff-current-diff-face-%S" type)))))) | 784 (intern (format "ediff-current-diff-face-%S" type)))))) |
785 (format "Difference region %S -- non-current" (1+ diff-num))) | 810 (format "Difference region %S -- non-current" (1+ diff-num))) |
786 (t ""))))) ; none | 811 (t ""))))) ; none |
787 | 812 |
788 (defun ediff-set-face (ground face color) | 813 (defun ediff-set-face (ground face color) |
789 "Set face foreground/background." | 814 "Set face foreground/background." |
790 (if (ediff-window-display-p) | 815 (if (ediff-has-face-support-p) |
791 (if (ediff-valid-color-p color) | 816 (if (ediff-valid-color-p color) |
792 (if (eq ground 'foreground) | 817 (if (eq ground 'foreground) |
793 (set-face-foreground face color) | 818 (set-face-foreground face color) |
794 (set-face-background face color)) | 819 (set-face-background face color)) |
795 (cond ((memq face | 820 (cond ((memq face |
813 ediff-even-diff-face-Ancestor | 838 ediff-even-diff-face-Ancestor |
814 ediff-odd-diff-face-Ancestor)) | 839 ediff-odd-diff-face-Ancestor)) |
815 (copy-face 'secondary-selection face)))) | 840 (copy-face 'secondary-selection face)))) |
816 )) | 841 )) |
817 | 842 |
818 (or (boundp 'facemenu-unlisted-faces) | 843 (defun ediff-hide-face (face) |
819 (setq facemenu-unlisted-faces nil)) | 844 (if (and (ediff-has-face-support-p) ediff-emacs-p) |
820 | 845 (add-to-list 'facemenu-unlisted-faces face))) |
821 (add-to-list 'facemenu-unlisted-faces 'ediff-current-diff-face-A) | 846 |
822 (defvar ediff-current-diff-face-A | 847 (defvar ediff-current-diff-face-A |
823 (if (ediff-window-display-p) | 848 (if (ediff-has-face-support-p) |
824 (progn | 849 (progn |
825 (make-face 'ediff-current-diff-face-A) | 850 (make-face 'ediff-current-diff-face-A) |
851 (ediff-hide-face 'ediff-current-diff-face-A) | |
826 (or (face-differs-from-default-p 'ediff-current-diff-face-A) | 852 (or (face-differs-from-default-p 'ediff-current-diff-face-A) |
827 (cond ((ediff-color-display-p) | 853 (cond ((ediff-color-display-p) |
828 (ediff-set-face | 854 (ediff-set-face |
829 'foreground 'ediff-current-diff-face-A "firebrick") | 855 'foreground 'ediff-current-diff-face-A "firebrick") |
830 (ediff-set-face | 856 (ediff-set-face |
835 (copy-face 'highlight 'ediff-current-diff-face-A)) | 861 (copy-face 'highlight 'ediff-current-diff-face-A)) |
836 ))) | 862 ))) |
837 'ediff-current-diff-face-A)) | 863 'ediff-current-diff-face-A)) |
838 "Face for highlighting the selected difference in buffer A.") | 864 "Face for highlighting the selected difference in buffer A.") |
839 | 865 |
840 (add-to-list 'facemenu-unlisted-faces 'ediff-current-diff-face-B) | |
841 (defvar ediff-current-diff-face-B | 866 (defvar ediff-current-diff-face-B |
842 (if (ediff-window-display-p) | 867 (if (ediff-has-face-support-p) |
843 (progn | 868 (progn |
844 (make-face 'ediff-current-diff-face-B) | 869 (make-face 'ediff-current-diff-face-B) |
870 (ediff-hide-face 'ediff-current-diff-face-B) | |
845 (or (face-differs-from-default-p 'ediff-current-diff-face-B) | 871 (or (face-differs-from-default-p 'ediff-current-diff-face-B) |
846 (cond ((ediff-color-display-p) | 872 (cond ((ediff-color-display-p) |
847 (ediff-set-face | 873 (ediff-set-face |
848 'foreground 'ediff-current-diff-face-B "DarkOrchid") | 874 'foreground 'ediff-current-diff-face-B "DarkOrchid") |
849 (ediff-set-face | 875 (ediff-set-face |
855 ))) | 881 ))) |
856 'ediff-current-diff-face-B)) | 882 'ediff-current-diff-face-B)) |
857 "Face for highlighting the selected difference in buffer B.") | 883 "Face for highlighting the selected difference in buffer B.") |
858 | 884 |
859 | 885 |
860 (add-to-list 'facemenu-unlisted-faces 'ediff-current-diff-face-C) | |
861 (defvar ediff-current-diff-face-C | 886 (defvar ediff-current-diff-face-C |
862 (if (ediff-window-display-p) | 887 (if (ediff-has-face-support-p) |
863 (progn | 888 (progn |
864 (make-face 'ediff-current-diff-face-C) | 889 (make-face 'ediff-current-diff-face-C) |
890 (ediff-hide-face 'ediff-current-diff-face-C) | |
865 (or (face-differs-from-default-p 'ediff-current-diff-face-C) | 891 (or (face-differs-from-default-p 'ediff-current-diff-face-C) |
866 (cond ((ediff-color-display-p) | 892 (cond ((ediff-color-display-p) |
867 (ediff-set-face | 893 (ediff-set-face |
868 'foreground 'ediff-current-diff-face-C "Navy") | 894 'foreground 'ediff-current-diff-face-C "Navy") |
869 (ediff-set-face | 895 (ediff-set-face |
874 (copy-face 'highlight 'ediff-current-diff-face-C)) | 900 (copy-face 'highlight 'ediff-current-diff-face-C)) |
875 ))) | 901 ))) |
876 'ediff-current-diff-face-C)) | 902 'ediff-current-diff-face-C)) |
877 "Face for highlighting the selected difference in buffer C.") | 903 "Face for highlighting the selected difference in buffer C.") |
878 | 904 |
879 (add-to-list 'facemenu-unlisted-faces 'ediff-current-diff-face-Ancestor) | |
880 (defvar ediff-current-diff-face-Ancestor | 905 (defvar ediff-current-diff-face-Ancestor |
881 (if (ediff-window-display-p) | 906 (if (ediff-has-face-support-p) |
882 (progn | 907 (progn |
883 (make-face 'ediff-current-diff-face-Ancestor) | 908 (make-face 'ediff-current-diff-face-Ancestor) |
909 (ediff-hide-face 'ediff-current-diff-face-Ancestor) | |
884 (or (face-differs-from-default-p 'ediff-current-diff-face-Ancestor) | 910 (or (face-differs-from-default-p 'ediff-current-diff-face-Ancestor) |
885 (copy-face | 911 (copy-face |
886 'ediff-current-diff-face-C 'ediff-current-diff-face-Ancestor)))) | 912 'ediff-current-diff-face-C 'ediff-current-diff-face-Ancestor)))) |
887 "Face for highlighting the selected difference in the ancestor buffer.") | 913 "Face for highlighting the selected difference in the ancestor buffer.") |
888 | 914 |
889 (add-to-list 'facemenu-unlisted-faces 'ediff-fine-diff-face-A) | |
890 (defvar ediff-fine-diff-face-A | 915 (defvar ediff-fine-diff-face-A |
891 (if (ediff-window-display-p) | 916 (if (ediff-has-face-support-p) |
892 (progn | 917 (progn |
893 (make-face 'ediff-fine-diff-face-A) | 918 (make-face 'ediff-fine-diff-face-A) |
919 (ediff-hide-face 'ediff-fine-diff-face-A) | |
894 (or (face-differs-from-default-p 'ediff-fine-diff-face-A) | 920 (or (face-differs-from-default-p 'ediff-fine-diff-face-A) |
895 (cond ((ediff-color-display-p) | 921 (cond ((ediff-color-display-p) |
896 (ediff-set-face 'foreground 'ediff-fine-diff-face-A | 922 (ediff-set-face 'foreground 'ediff-fine-diff-face-A |
897 "Navy") | 923 "Navy") |
898 (ediff-set-face 'background 'ediff-fine-diff-face-A | 924 (ediff-set-face 'background 'ediff-fine-diff-face-A |
899 "sky blue")) | 925 "sky blue")) |
900 (t (set-face-underline-p 'ediff-fine-diff-face-A t)))) | 926 (t (set-face-underline-p 'ediff-fine-diff-face-A t)))) |
901 'ediff-fine-diff-face-A)) | 927 'ediff-fine-diff-face-A)) |
902 "Face for highlighting the refinement of the selected diff in buffer A.") | 928 "Face for highlighting the refinement of the selected diff in buffer A.") |
903 | 929 |
904 (add-to-list 'facemenu-unlisted-faces 'ediff-fine-diff-face-B) | |
905 (defvar ediff-fine-diff-face-B | 930 (defvar ediff-fine-diff-face-B |
906 (if (ediff-window-display-p) | 931 (if (ediff-has-face-support-p) |
907 (progn | 932 (progn |
908 (make-face 'ediff-fine-diff-face-B) | 933 (make-face 'ediff-fine-diff-face-B) |
934 (ediff-hide-face 'ediff-fine-diff-face-B) | |
909 (or (face-differs-from-default-p 'ediff-fine-diff-face-B) | 935 (or (face-differs-from-default-p 'ediff-fine-diff-face-B) |
910 (cond ((ediff-color-display-p) | 936 (cond ((ediff-color-display-p) |
911 (ediff-set-face 'foreground 'ediff-fine-diff-face-B "Black") | 937 (ediff-set-face 'foreground 'ediff-fine-diff-face-B "Black") |
912 (ediff-set-face 'background 'ediff-fine-diff-face-B "cyan")) | 938 (ediff-set-face 'background 'ediff-fine-diff-face-B "cyan")) |
913 (t (set-face-underline-p 'ediff-fine-diff-face-B t)))) | 939 (t (set-face-underline-p 'ediff-fine-diff-face-B t)))) |
914 'ediff-fine-diff-face-B)) | 940 'ediff-fine-diff-face-B)) |
915 "Face for highlighting the refinement of the selected diff in buffer B.") | 941 "Face for highlighting the refinement of the selected diff in buffer B.") |
916 | 942 |
917 (add-to-list 'facemenu-unlisted-faces 'ediff-fine-diff-face-C) | |
918 (defvar ediff-fine-diff-face-C | 943 (defvar ediff-fine-diff-face-C |
919 (if (ediff-window-display-p) | 944 (if (ediff-has-face-support-p) |
920 (progn | 945 (progn |
921 (make-face 'ediff-fine-diff-face-C) | 946 (make-face 'ediff-fine-diff-face-C) |
947 (ediff-hide-face 'ediff-fine-diff-face-C) | |
922 (or (face-differs-from-default-p 'ediff-fine-diff-face-C) | 948 (or (face-differs-from-default-p 'ediff-fine-diff-face-C) |
923 (cond ((ediff-color-display-p) | 949 (cond ((ediff-color-display-p) |
924 (ediff-set-face 'foreground 'ediff-fine-diff-face-C "black") | 950 (ediff-set-face 'foreground 'ediff-fine-diff-face-C "black") |
925 (ediff-set-face | 951 (ediff-set-face |
926 'background 'ediff-fine-diff-face-C "Turquoise")) | 952 'background 'ediff-fine-diff-face-C "Turquoise")) |
927 (t (set-face-underline-p 'ediff-fine-diff-face-C t)))) | 953 (t (set-face-underline-p 'ediff-fine-diff-face-C t)))) |
928 'ediff-fine-diff-face-C)) | 954 'ediff-fine-diff-face-C)) |
929 "Face for highlighting the refinement of the selected diff in buffer C.") | 955 "Face for highlighting the refinement of the selected diff in buffer C.") |
930 | 956 |
931 (add-to-list 'facemenu-unlisted-faces 'ediff-fine-diff-face-Ancestor) | |
932 (defvar ediff-fine-diff-face-Ancestor | 957 (defvar ediff-fine-diff-face-Ancestor |
933 (if (ediff-window-display-p) | 958 (if (ediff-has-face-support-p) |
934 (progn | 959 (progn |
935 (make-face 'ediff-fine-diff-face-Ancestor) | 960 (make-face 'ediff-fine-diff-face-Ancestor) |
961 (ediff-hide-face 'ediff-fine-diff-face-Ancestor) | |
936 (or (face-differs-from-default-p 'ediff-fine-diff-face-Ancestor) | 962 (or (face-differs-from-default-p 'ediff-fine-diff-face-Ancestor) |
937 (copy-face | 963 (copy-face |
938 'ediff-fine-diff-face-C 'ediff-fine-diff-face-Ancestor)))) | 964 'ediff-fine-diff-face-C 'ediff-fine-diff-face-Ancestor)))) |
939 "Face highlighting refinements of the selected diff in ancestor buffer. | 965 "Face highlighting refinements of the selected diff in ancestor buffer. |
940 Presently, this is not used, as difference regions are not refined in the | 966 Presently, this is not used, as difference regions are not refined in the |
941 ancestor buffer.") | 967 ancestor buffer.") |
942 | 968 |
943 (add-to-list 'facemenu-unlisted-faces 'ediff-even-diff-face-A) | |
944 (defvar ediff-even-diff-face-A | 969 (defvar ediff-even-diff-face-A |
945 (if (ediff-window-display-p) | 970 (if (ediff-has-face-support-p) |
946 (progn | 971 (progn |
947 (make-face 'ediff-even-diff-face-A) | 972 (make-face 'ediff-even-diff-face-A) |
973 (ediff-hide-face 'ediff-even-diff-face-A) | |
948 (or (face-differs-from-default-p 'ediff-even-diff-face-A) | 974 (or (face-differs-from-default-p 'ediff-even-diff-face-A) |
949 (cond ((ediff-color-display-p) | 975 (cond ((ediff-color-display-p) |
950 (ediff-set-face | 976 (ediff-set-face |
951 'foreground 'ediff-even-diff-face-A "black") | 977 'foreground 'ediff-even-diff-face-A "black") |
952 (ediff-set-face | 978 (ediff-set-face |
954 (t | 980 (t |
955 (copy-face 'italic 'ediff-even-diff-face-A)))) | 981 (copy-face 'italic 'ediff-even-diff-face-A)))) |
956 'ediff-even-diff-face-A)) | 982 'ediff-even-diff-face-A)) |
957 "Face used to highlight even-numbered differences in buffer A.") | 983 "Face used to highlight even-numbered differences in buffer A.") |
958 | 984 |
959 (add-to-list 'facemenu-unlisted-faces 'ediff-even-diff-face-B) | |
960 (defvar ediff-even-diff-face-B | 985 (defvar ediff-even-diff-face-B |
961 (if (ediff-window-display-p) | 986 (if (ediff-has-face-support-p) |
962 (progn | 987 (progn |
963 (make-face 'ediff-even-diff-face-B) | 988 (make-face 'ediff-even-diff-face-B) |
989 (ediff-hide-face 'ediff-even-diff-face-B) | |
964 (or (face-differs-from-default-p 'ediff-even-diff-face-B) | 990 (or (face-differs-from-default-p 'ediff-even-diff-face-B) |
965 (cond ((ediff-color-display-p) | 991 (cond ((ediff-color-display-p) |
966 (ediff-set-face | 992 (ediff-set-face |
967 'foreground 'ediff-even-diff-face-B "White") | 993 'foreground 'ediff-even-diff-face-B "White") |
968 (ediff-set-face | 994 (ediff-set-face |
970 (t | 996 (t |
971 (copy-face 'italic 'ediff-even-diff-face-B)))) | 997 (copy-face 'italic 'ediff-even-diff-face-B)))) |
972 'ediff-even-diff-face-B)) | 998 'ediff-even-diff-face-B)) |
973 "Face used to highlight even-numbered differences in buffer B.") | 999 "Face used to highlight even-numbered differences in buffer B.") |
974 | 1000 |
975 (add-to-list 'facemenu-unlisted-faces 'ediff-even-diff-face-C) | |
976 (defvar ediff-even-diff-face-C | 1001 (defvar ediff-even-diff-face-C |
977 (if (ediff-window-display-p) | 1002 (if (ediff-has-face-support-p) |
978 (progn | 1003 (progn |
979 (make-face 'ediff-even-diff-face-C) | 1004 (make-face 'ediff-even-diff-face-C) |
1005 (ediff-hide-face 'ediff-even-diff-face-C) | |
980 (or (face-differs-from-default-p 'ediff-even-diff-face-C) | 1006 (or (face-differs-from-default-p 'ediff-even-diff-face-C) |
981 (copy-face 'ediff-even-diff-face-A 'ediff-even-diff-face-C)) | 1007 (copy-face 'ediff-even-diff-face-A 'ediff-even-diff-face-C)) |
982 'ediff-even-diff-face-C)) | 1008 'ediff-even-diff-face-C)) |
983 "Face used to highlight even-numbered differences in buffer C.") | 1009 "Face used to highlight even-numbered differences in buffer C.") |
984 | 1010 |
985 (add-to-list 'facemenu-unlisted-faces 'ediff-even-diff-face-Ancestor) | |
986 (defvar ediff-even-diff-face-Ancestor | 1011 (defvar ediff-even-diff-face-Ancestor |
987 (if (ediff-window-display-p) | 1012 (if (ediff-has-face-support-p) |
988 (progn | 1013 (progn |
989 (make-face 'ediff-even-diff-face-Ancestor) | 1014 (make-face 'ediff-even-diff-face-Ancestor) |
1015 (ediff-hide-face 'ediff-even-diff-face-Ancestor) | |
990 (or (face-differs-from-default-p 'ediff-even-diff-face-Ancestor) | 1016 (or (face-differs-from-default-p 'ediff-even-diff-face-Ancestor) |
991 (copy-face 'ediff-even-diff-face-C 'ediff-even-diff-face-Ancestor)) | 1017 (copy-face 'ediff-even-diff-face-C 'ediff-even-diff-face-Ancestor)) |
992 'ediff-even-diff-face-Ancestor)) | 1018 'ediff-even-diff-face-Ancestor)) |
993 "Face highlighting even-numbered differences in the ancestor buffer.") | 1019 "Face highlighting even-numbered differences in the ancestor buffer.") |
994 | 1020 |
995 (add-to-list 'facemenu-unlisted-faces 'ediff-odd-diff-face-A) | |
996 (defvar ediff-odd-diff-face-A | 1021 (defvar ediff-odd-diff-face-A |
997 (if (ediff-window-display-p) | 1022 (if (ediff-has-face-support-p) |
998 (progn | 1023 (progn |
999 (make-face 'ediff-odd-diff-face-A) | 1024 (make-face 'ediff-odd-diff-face-A) |
1025 (ediff-hide-face 'ediff-odd-diff-face-A) | |
1000 (or (face-differs-from-default-p 'ediff-odd-diff-face-A) | 1026 (or (face-differs-from-default-p 'ediff-odd-diff-face-A) |
1001 (cond ((ediff-color-display-p) | 1027 (cond ((ediff-color-display-p) |
1002 (ediff-set-face | 1028 (ediff-set-face |
1003 'foreground 'ediff-odd-diff-face-A "White") | 1029 'foreground 'ediff-odd-diff-face-A "White") |
1004 (ediff-set-face | 1030 (ediff-set-face |
1006 (t | 1032 (t |
1007 (copy-face 'italic 'ediff-odd-diff-face-A)))) | 1033 (copy-face 'italic 'ediff-odd-diff-face-A)))) |
1008 'ediff-odd-diff-face-A)) | 1034 'ediff-odd-diff-face-A)) |
1009 "Face used to highlight odd-numbered differences in buffer A.") | 1035 "Face used to highlight odd-numbered differences in buffer A.") |
1010 | 1036 |
1011 (add-to-list 'facemenu-unlisted-faces 'ediff-odd-diff-face-B) | |
1012 (defvar ediff-odd-diff-face-B | 1037 (defvar ediff-odd-diff-face-B |
1013 (if (ediff-window-display-p) | 1038 (if (ediff-has-face-support-p) |
1014 (progn | 1039 (progn |
1015 (make-face 'ediff-odd-diff-face-B) | 1040 (make-face 'ediff-odd-diff-face-B) |
1041 (ediff-hide-face 'ediff-odd-diff-face-B) | |
1016 (or (face-differs-from-default-p 'ediff-odd-diff-face-B) | 1042 (or (face-differs-from-default-p 'ediff-odd-diff-face-B) |
1017 (cond ((ediff-color-display-p) | 1043 (cond ((ediff-color-display-p) |
1018 (ediff-set-face | 1044 (ediff-set-face |
1019 'foreground 'ediff-odd-diff-face-B "Black") | 1045 'foreground 'ediff-odd-diff-face-B "Black") |
1020 (ediff-set-face | 1046 (ediff-set-face |
1022 (t | 1048 (t |
1023 (copy-face 'italic 'ediff-odd-diff-face-B)))) | 1049 (copy-face 'italic 'ediff-odd-diff-face-B)))) |
1024 'ediff-odd-diff-face-B)) | 1050 'ediff-odd-diff-face-B)) |
1025 "Face used to highlight odd-numbered differences in buffer B.") | 1051 "Face used to highlight odd-numbered differences in buffer B.") |
1026 | 1052 |
1027 (add-to-list 'facemenu-unlisted-faces 'ediff-odd-diff-face-C) | |
1028 (defvar ediff-odd-diff-face-C | 1053 (defvar ediff-odd-diff-face-C |
1029 (if (ediff-window-display-p) | 1054 (if (ediff-has-face-support-p) |
1030 (progn | 1055 (progn |
1031 (make-face 'ediff-odd-diff-face-C) | 1056 (make-face 'ediff-odd-diff-face-C) |
1057 (ediff-hide-face 'ediff-odd-diff-face-C) | |
1032 (or (face-differs-from-default-p 'ediff-odd-diff-face-C) | 1058 (or (face-differs-from-default-p 'ediff-odd-diff-face-C) |
1033 (copy-face 'ediff-odd-diff-face-A 'ediff-odd-diff-face-C)) | 1059 (copy-face 'ediff-odd-diff-face-A 'ediff-odd-diff-face-C)) |
1034 'ediff-odd-diff-face-C)) | 1060 'ediff-odd-diff-face-C)) |
1035 "Face used to highlight odd-numbered differences in buffer C.") | 1061 "Face used to highlight odd-numbered differences in buffer C.") |
1036 | 1062 |
1037 (add-to-list 'facemenu-unlisted-faces 'ediff-odd-diff-face-Ancestor ) | |
1038 (defvar ediff-odd-diff-face-Ancestor | 1063 (defvar ediff-odd-diff-face-Ancestor |
1039 (if (ediff-window-display-p) | 1064 (if (ediff-has-face-support-p) |
1040 (progn | 1065 (progn |
1041 (make-face 'ediff-odd-diff-face-Ancestor) | 1066 (make-face 'ediff-odd-diff-face-Ancestor) |
1067 (ediff-hide-face 'ediff-odd-diff-face-Ancestor) | |
1042 (or (face-differs-from-default-p 'ediff-odd-diff-face-Ancestor) | 1068 (or (face-differs-from-default-p 'ediff-odd-diff-face-Ancestor) |
1043 (copy-face 'ediff-odd-diff-face-C 'ediff-odd-diff-face-Ancestor)) | 1069 (copy-face 'ediff-odd-diff-face-C 'ediff-odd-diff-face-Ancestor)) |
1044 'ediff-odd-diff-face-Ancestor)) | 1070 'ediff-odd-diff-face-Ancestor)) |
1045 "Face used to highlight even-numbered differences in the ancestor buffer.") | 1071 "Face used to highlight even-numbered differences in the ancestor buffer.") |
1046 | 1072 |
1108 (getenv "TMP") | 1134 (getenv "TMP") |
1109 (getenv "TEMP"))) | 1135 (getenv "TEMP"))) |
1110 d) | 1136 d) |
1111 (setq d (if (and env (> (length env) 0)) | 1137 (setq d (if (and env (> (length env) 0)) |
1112 env | 1138 env |
1113 (if (memq system-type '(vax-vms axp-vms)) | 1139 (cond ((memq system-type '(vax-vms axp-vms)) "SYS$SCRATCH:") |
1114 "SYS$SCRATCH:" | 1140 ((eq system-type 'ms-dos) "c:/") |
1115 "/tmp"))) | 1141 (t "/tmp")))) |
1116 ;; The following is to make sure we get something to which we can | 1142 ;; The following is to make sure we get something to which we can |
1117 ;; add directory levels on VMS. | 1143 ;; add directory levels on VMS. |
1118 (setq d (file-name-as-directory (directory-file-name d))) | 1144 (setq d (file-name-as-directory (directory-file-name d))) |
1119 ) | 1145 ) |
1120 "*Prefix to put on Ediff temporary file names. | 1146 "*Prefix to put on Ediff temporary file names. |
1127 ;; a diff/diff3 command. | 1153 ;; a diff/diff3 command. |
1128 (defvar ediff-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]" | 1154 (defvar ediff-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]" |
1129 "Characters that must be quoted with \\ when used in a shell command line. | 1155 "Characters that must be quoted with \\ when used in a shell command line. |
1130 More precisely, a regexp to match any one such character.") | 1156 More precisely, a regexp to match any one such character.") |
1131 | 1157 |
1158 ;; needed to simulate frame-char-width in XEmacs. | |
1159 (defvar ediff-H-glyph (if ediff-xemacs-p (make-glyph "H"))) | |
1160 | |
1132 | 1161 |
1133 (ediff-defvar-local ediff-temp-file-A nil | 1162 (ediff-defvar-local ediff-temp-file-A nil |
1134 "Temporary file used for refining difference regions in buffer A.") | 1163 "Temporary file used for refining difference regions in buffer A.") |
1135 (ediff-defvar-local ediff-temp-file-B nil | 1164 (ediff-defvar-local ediff-temp-file-B nil |
1136 "Temporary file used for refining difference regions in buffer B.") | 1165 "Temporary file used for refining difference regions in buffer B.") |
1141 | 1170 |
1142 (defsubst ediff-file-remote-p (file-name) | 1171 (defsubst ediff-file-remote-p (file-name) |
1143 (if (fboundp ediff-ange-ftp-ftp-name) | 1172 (if (fboundp ediff-ange-ftp-ftp-name) |
1144 (funcall ediff-ange-ftp-ftp-name file-name))) | 1173 (funcall ediff-ange-ftp-ftp-name file-name))) |
1145 | 1174 |
1146 ;;(defun ediff-frame-has-menubar () | |
1147 ;; (and (ediff-window-display-p) | |
1148 ;; (if ediff-xemacs-p | |
1149 ;; current-menubar | |
1150 ;; (let ((lines (cdr (assq 'menu-bar-lines | |
1151 ;; (frame-parameters (selected-frame)))))) | |
1152 ;; (or (eq lines t) (and (numberp lines) (< 0 lines)))) | |
1153 ;; ))) | |
1154 | 1175 |
1155 (defsubst ediff-frame-unsplittable-p (frame) | 1176 (defsubst ediff-frame-unsplittable-p (frame) |
1156 (cdr (assq 'unsplittable (frame-parameters frame)))) | 1177 (cdr (assq 'unsplittable (frame-parameters frame)))) |
1157 | 1178 |
1158 (defsubst ediff-get-next-window (wind prev-wind) | 1179 (defsubst ediff-get-next-window (wind prev-wind) |
1244 (if ediff-xemacs-p | 1265 (if ediff-xemacs-p |
1245 (event-point event) | 1266 (event-point event) |
1246 (posn-point (event-start event)))) | 1267 (posn-point (event-start event)))) |
1247 ((ediff-key-press-event-p event) | 1268 ((ediff-key-press-event-p event) |
1248 (point)) | 1269 (point)) |
1249 (t (error "")))) | 1270 (t (error)))) |
1250 | 1271 |
1251 (defun ediff-event-buffer (event) | 1272 (defun ediff-event-buffer (event) |
1252 (cond ((ediff-mouse-event-p event) | 1273 (cond ((ediff-mouse-event-p event) |
1253 (if ediff-xemacs-p | 1274 (if ediff-xemacs-p |
1254 (event-buffer event) | 1275 (event-buffer event) |
1255 (window-buffer (posn-window (event-start event))))) | 1276 (window-buffer (posn-window (event-start event))))) |
1256 ((ediff-key-press-event-p event) | 1277 ((ediff-key-press-event-p event) |
1257 (current-buffer)) | 1278 (current-buffer)) |
1258 (t (error "")))) | 1279 (t (error)))) |
1259 | 1280 |
1260 | 1281 |
1261 (defsubst ediff-frame-iconified-p (frame) | 1282 (defsubst ediff-frame-iconified-p (frame) |
1262 (if (and (ediff-window-display-p) (frame-live-p frame)) | 1283 (if (and (ediff-window-display-p) (frame-live-p frame)) |
1263 (if ediff-xemacs-p | 1284 (if ediff-xemacs-p |
1297 ))) | 1318 ))) |
1298 | 1319 |
1299 (defsubst ediff-spy-after-mouse () | 1320 (defsubst ediff-spy-after-mouse () |
1300 (setq ediff-mouse-pixel-position (mouse-pixel-position))) | 1321 (setq ediff-mouse-pixel-position (mouse-pixel-position))) |
1301 | 1322 |
1302 ;; This is actually not easy to find out since emacs and xemacs behave | 1323 ;; It is not easy to find out when the user grabs the mouse, since emacs and |
1303 ;; differently when mouse is not in any frame. Also, this is sensitive to | 1324 ;; xemacs behave differently when mouse is not in any frame. Also, this is |
1304 ;; when the user grabbed mouse. | 1325 ;; sensitive to when the user grabbed mouse. Not used for now. |
1305 ;; Not used for now. | |
1306 (defun ediff-user-grabbed-mouse () | 1326 (defun ediff-user-grabbed-mouse () |
1307 (if ediff-mouse-pixel-position | 1327 (if ediff-mouse-pixel-position |
1308 (cond ((not (eq (car ediff-mouse-pixel-position) | 1328 (cond ((not (eq (car ediff-mouse-pixel-position) |
1309 (car (mouse-pixel-position))))) | 1329 (car (mouse-pixel-position))))) |
1310 ((and (car (cdr ediff-mouse-pixel-position)) | 1330 ((and (car (cdr ediff-mouse-pixel-position)) |
1319 ediff-mouse-pixel-threshold)))) | 1339 ediff-mouse-pixel-threshold)))) |
1320 (t nil)))) | 1340 (t nil)))) |
1321 | 1341 |
1322 (defsubst ediff-frame-char-height (frame) | 1342 (defsubst ediff-frame-char-height (frame) |
1323 (if ediff-xemacs-p | 1343 (if ediff-xemacs-p |
1324 (/ (frame-pixel-height frame) (frame-height frame)) | 1344 (glyph-height ediff-H-glyph (selected-window frame)) |
1325 (frame-char-height frame))) | 1345 (frame-char-height frame))) |
1326 | 1346 |
1327 | 1347 |
1328 (defsubst ediff-empty-overlay-p (overl) | 1348 (defsubst ediff-empty-overlay-p (overl) |
1329 (= (ediff-overlay-start overl) (ediff-overlay-end overl))) | 1349 (= (ediff-overlay-start overl) (ediff-overlay-end overl))) |
1350 | |
1351 ;; like overlay-buffer in Emacs. In XEmacs, returns nil if the extent is | |
1352 ;; dead. Otherwise, works like extent-buffer | |
1353 (defun ediff-overlay-buffer (overl) | |
1354 (if ediff-emacs-p | |
1355 (overlay-buffer overl) | |
1356 (and (extent-live-p overl) (extent-buffer overl)))) | |
1357 | |
1358 ;; like overlay-get in Emacs. In XEmacs, returns nil if the extent is | |
1359 ;; dead. Otherwise, like extent-property | |
1360 (defun ediff-overlay-get (overl property) | |
1361 (if ediff-emacs-p | |
1362 (overlay-get overl property) | |
1363 (and (extent-live-p overl) (extent-property overl property)))) | |
1330 | 1364 |
1331 ;; t if diff region is empty. | 1365 ;; t if diff region is empty. |
1332 ;; In case of buffer C, t also if it is not a 3way | 1366 ;; In case of buffer C, t also if it is not a 3way |
1333 ;; comparison job (merging jobs return t as well). | 1367 ;; comparison job (merging jobs return t as well). |
1334 (defun ediff-empty-diff-region-p (n buf-type) | 1368 (defun ediff-empty-diff-region-p (n buf-type) |
1352 (skip-chars-forward ediff-whitespace) | 1386 (skip-chars-forward ediff-whitespace) |
1353 (>= (point) end)))))) | 1387 (>= (point) end)))))) |
1354 | 1388 |
1355 ;; temporarily uses DIR to abbreviate file name | 1389 ;; temporarily uses DIR to abbreviate file name |
1356 ;; if DIR is nil, use default-directory | 1390 ;; if DIR is nil, use default-directory |
1357 (defsubst ediff-abbreviate-file-name (file &optional dir) | 1391 (defun ediff-abbreviate-file-name (file &optional dir) |
1358 (cond ((stringp dir) | 1392 (cond ((stringp dir) |
1359 (let ((directory-abbrev-alist (list (cons dir "")))) | 1393 (let ((directory-abbrev-alist (list (cons dir "")))) |
1360 (abbreviate-file-name file))) | 1394 (abbreviate-file-name file))) |
1361 (ediff-emacs-p (abbreviate-file-name file)) | 1395 (ediff-emacs-p (abbreviate-file-name file)) |
1362 (t ; XEmacs requires addl argument | 1396 (t ; XEmacs requires addl argument |
1445 (or (and a (not b)) (and (not a) b))) | 1479 (or (and a (not b)) (and (not a) b))) |
1446 | 1480 |
1447 (defsubst ediff-message-if-verbose (string &rest args) | 1481 (defsubst ediff-message-if-verbose (string &rest args) |
1448 (if ediff-verbose-p | 1482 (if ediff-verbose-p |
1449 (apply 'message string args))) | 1483 (apply 'message string args))) |
1484 | |
1450 | 1485 |
1451 (provide 'ediff-init) | 1486 (provide 'ediff-init) |
1452 | 1487 |
1453 | 1488 |
1454 ;;; ediff-init.el ends here | 1489 ;;; ediff-init.el ends here |