diff options
| author | Richard M. Stallman | 1994-07-26 20:16:05 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-07-26 20:16:05 +0000 |
| commit | f9ae53246cc48ccd0872fe860b6b6fe819026d85 (patch) | |
| tree | 7d056a5a11bbf4a25bc7a54421c1d60a18fc2887 | |
| parent | 4d587a6ce1f09acda481b9a0983c0460faa05f48 (diff) | |
| download | emacs-f9ae53246cc48ccd0872fe860b6b6fe819026d85.tar.gz emacs-f9ae53246cc48ccd0872fe860b6b6fe819026d85.zip | |
Made menu bar's autoloaded stuff conditional on
purify-flag, to avoid error message when loading ediff in a frame
that has no menu bar.
(ediff-setup): Improved mode-line-buffer-identification.
Now accommodates buffer identifications generated by
mode-line.el and uniquify.el.
(ediff-current-diff-face-A/B,
ediff-fine-diff-face-A/B,ediff-odd/even-diff-face-A/B):
Variables changed to contain face names
instead of face internal representation.
| -rw-r--r-- | lisp/ediff.el | 186 |
1 files changed, 111 insertions, 75 deletions
diff --git a/lisp/ediff.el b/lisp/ediff.el index fdd86056b0e..a10c11f61de 100644 --- a/lisp/ediff.el +++ b/lisp/ediff.el | |||
| @@ -3,16 +3,11 @@ | |||
| 3 | 3 | ||
| 4 | ;; Author: Michael Kifer <kifer@cs.sunysb.edu> | 4 | ;; Author: Michael Kifer <kifer@cs.sunysb.edu> |
| 5 | ;; Created: February 2, 1994 | 5 | ;; Created: February 2, 1994 |
| 6 | ;; Version: 1.64 | 6 | ;; Version: 1.64.2 |
| 7 | ;; Keywords: comparing, merging, patching, version control. | 7 | ;; Keywords: comparing, merging, patching, version control. |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | 10 | ||
| 11 | ;; LCD Archive Entry: | ||
| 12 | ;; ediff|Michael Kifer|kifer@cs.sunysb.edu| | ||
| 13 | ;; Visual interface to diff and patch.| | ||
| 14 | ;; 28-June-94|1.64|~/packages/ediff.el.Z| | ||
| 15 | |||
| 16 | ;; GNU Emacs is free software; you can redistribute it and/or modify | 11 | ;; GNU Emacs is free software; you can redistribute it and/or modify |
| 17 | ;; it under the terms of the GNU General Public License as published by | 12 | ;; it under the terms of the GNU General Public License as published by |
| 18 | ;; the Free Software Foundation; either version 2, or (at your option) | 13 | ;; the Free Software Foundation; either version 2, or (at your option) |
| @@ -340,14 +335,17 @@ | |||
| 340 | ;; faces: ediff-even/odd-diff-face-A/B. The odd and the even | 335 | ;; faces: ediff-even/odd-diff-face-A/B. The odd and the even |
| 341 | ;; faces are actually identical on monochrome displays, because it is | 336 | ;; faces are actually identical on monochrome displays, because it is |
| 342 | ;; rather poor in what you can do on such a display. So, I chose to use | 337 | ;; rather poor in what you can do on such a display. So, I chose to use |
| 343 | ;; italics to highlight other differences. Any ideas would be welcome. (In | 338 | ;; italics to highlight other differences. Any ideas would be welcome. |
| 344 | ;; Lucid Emacs, the faces are different because it supports pixmaps.) | ||
| 345 | ;; There are two ways to change the default setting for highlighting faces: | 339 | ;; There are two ways to change the default setting for highlighting faces: |
| 346 | ;; either change the variables, as in | 340 | ;; either change the variables, as in |
| 347 | ;; | 341 | ;; |
| 348 | ;; (setq ediff-current-diff-face-A (internal-get-face 'bold-italic)) | 342 | ;; (setq ediff-current-diff-face-A 'bold-italic) |
| 343 | ;; | ||
| 344 | ;; or | ||
| 345 | ;; | ||
| 346 | ;; (setq ediff-current-diff-face-A | ||
| 347 | ;; (copy-face 'bold-italic 'ediff-current-diff-face-A)) | ||
| 349 | ;; | 348 | ;; |
| 350 | ;; (`internal-get-face' should be `get-face' if you are using Lucid Emacs) | ||
| 351 | ;; or by selectively modifying the defaults: | 349 | ;; or by selectively modifying the defaults: |
| 352 | ;; | 350 | ;; |
| 353 | ;; (add-hook 'ediff-load-hooks | 351 | ;; (add-hook 'ediff-load-hooks |
| @@ -359,6 +357,11 @@ | |||
| 359 | ;; You may also want to take a look at how the above faces are defined in | 357 | ;; You may also want to take a look at how the above faces are defined in |
| 360 | ;; Ediff. | 358 | ;; Ediff. |
| 361 | ;; | 359 | ;; |
| 360 | ;; Note: it is not recommended to use `internal-get-face' (or `get-face' in | ||
| 361 | ;; Lucid) when defining faces for Ediff, since this may cause | ||
| 362 | ;; problems when there are several frames with different font sizes. | ||
| 363 | ;; Instead, use copy-face or set/make-face-* as shown above. | ||
| 364 | ;; | ||
| 362 | ;; The last group of variables in this group, | 365 | ;; The last group of variables in this group, |
| 363 | ;; | 366 | ;; |
| 364 | ;; ediff-want-faces | 367 | ;; ediff-want-faces |
| @@ -392,8 +395,8 @@ | |||
| 392 | ;; | 395 | ;; |
| 393 | ;; Refining difference regions | 396 | ;; Refining difference regions |
| 394 | ;; --------------------------- | 397 | ;; --------------------------- |
| 395 | ;; There are also variables that control the way fine differences are | 398 | ;; Ediff has variables that control the way fine differences are |
| 396 | ;; highlighted. This feature lets the user highlight the exact words that | 399 | ;; highlighted. This feature lets the user highlight the exact words that |
| 397 | ;; make the difference regions in buffer A and B different. This process | 400 | ;; make the difference regions in buffer A and B different. This process |
| 398 | ;; ignores spaces, tabs, and newlines. | 401 | ;; ignores spaces, tabs, and newlines. |
| 399 | ;; | 402 | ;; |
| @@ -456,6 +459,21 @@ | |||
| 456 | ;; faster in yielding the output of diff (Ediff is a big gun, if used | 459 | ;; faster in yielding the output of diff (Ediff is a big gun, if used |
| 457 | ;; for this simple purpose). | 460 | ;; for this simple purpose). |
| 458 | ;; | 461 | ;; |
| 462 | ;; Mode line | ||
| 463 | ;; --------- | ||
| 464 | ;; | ||
| 465 | ;; When Ediff is running, the mode line of Ediff Control Panel buffer | ||
| 466 | ;; displays the current difference being displayed and the total number of | ||
| 467 | ;; difference regions in the two files. | ||
| 468 | ;; | ||
| 469 | ;; The mode line of the buffers being compared displays the type of the | ||
| 470 | ;; buffer (`A:' or `B:') and (usually) the file name. Ediff is trying to be | ||
| 471 | ;; intelligent in choosing mode line buffer identification. In particular, | ||
| 472 | ;; it works well with uniquify.el and mode-line.el packages (which improve | ||
| 473 | ;; on the default way in which Emacs displays buffer identification). | ||
| 474 | ;; If you don't like the way Ediff identifies its buffers, there is always | ||
| 475 | ;; ediff-prepare-buffer-hooks, which can be used to modify the mode line. | ||
| 476 | ;; | ||
| 459 | ;; Miscellaneous | 477 | ;; Miscellaneous |
| 460 | ;; ------------- | 478 | ;; ------------- |
| 461 | ;; The last set of variables that can be modified is | 479 | ;; The last set of variables that can be modified is |
| @@ -789,7 +807,7 @@ | |||
| 789 | 807 | ||
| 790 | ;; Sat April 16, 1994 | 808 | ;; Sat April 16, 1994 |
| 791 | 809 | ||
| 792 | ;; Added Ediff to the File menu on the menu bar (version). | 810 | ;; Added Ediff to the File menu on the menu bar (FSF's version). |
| 793 | 811 | ||
| 794 | ;; Mon April 18, 1994 | 812 | ;; Mon April 18, 1994 |
| 795 | 813 | ||
| @@ -867,6 +885,20 @@ | |||
| 867 | 885 | ||
| 868 | ;; Fixed ediff-patch-files to work with remote and compressed files. | 886 | ;; Fixed ediff-patch-files to work with remote and compressed files. |
| 869 | 887 | ||
| 888 | ;; Wed July 20, 1994 | ||
| 889 | |||
| 890 | ;; Changed menu bar items per RMS's suggestion. Changed odd/even faces | ||
| 891 | ;; in Lemacs to italic. Changed ediff-*-face-* variables so that they | ||
| 892 | ;; will contain names of faces instead of the face internal | ||
| 893 | ;; representation. (Copy-face works better with face names than with | ||
| 894 | ;; face internal representation. With face internal representation, if | ||
| 895 | ;; a face vector mentions a font explicitly, copy-face may attempt to | ||
| 896 | ;; copy this font, which would cause an error if the font has a wrong | ||
| 897 | ;; size for one of the existing frames.) Improved the way | ||
| 898 | ;; mode-line-buffer-identification is set in ediff-setup so that Ediff | ||
| 899 | ;; will accommodate the way buffers are identified in mode-line.el and | ||
| 900 | ;; uniquify.el. | ||
| 901 | |||
| 870 | 902 | ||
| 871 | ;;; Acknowledgements: | 903 | ;;; Acknowledgements: |
| 872 | 904 | ||
| @@ -884,8 +916,9 @@ | |||
| 884 | ;; <maechler@stat.math.ethz.ch>, Richard Mlynarik <mly@adoc.xerox.com>, | 916 | ;; <maechler@stat.math.ethz.ch>, Richard Mlynarik <mly@adoc.xerox.com>, |
| 885 | ;; Ray Nickson <nickson@cs.uq.oz.au>, Sandy Rutherford | 917 | ;; Ray Nickson <nickson@cs.uq.oz.au>, Sandy Rutherford |
| 886 | ;; <sandy@ibm550.sissa.it>, Andy Scott <ascott@pcocd2.intel.com>, | 918 | ;; <sandy@ibm550.sissa.it>, Andy Scott <ascott@pcocd2.intel.com>, |
| 887 | ;; Richard Stanton <stanton@haas.berkeley.edu>, Peter Stout | 919 | ;; Richard Stallman <rms@gnu.ai.mit.edu>, Richard Stanton |
| 888 | ;; <Peter_Stout@cs.cmu.edu> for contributing ideas, patches and bug reports. | 920 | ;; <stanton@haas.berkeley.edu>, Peter Stout <Peter_Stout@cs.cmu.edu> |
| 921 | ;; for contributing ideas, patches, and bug reports. | ||
| 889 | ;; | 922 | ;; |
| 890 | ;; Thanks also to many others who felt obliged to drop a thanks note. | 923 | ;; Thanks also to many others who felt obliged to drop a thanks note. |
| 891 | 924 | ||
| @@ -1291,12 +1324,7 @@ through files.") | |||
| 1291 | (defvar ediff-disturbed-overlays nil | 1324 | (defvar ediff-disturbed-overlays nil |
| 1292 | "List of difference overlays disturbed by working with the current diff.") | 1325 | "List of difference overlays disturbed by working with the current diff.") |
| 1293 | 1326 | ||
| 1294 | (defvar ediff-shaded-overlay-priority | 1327 | (defvar ediff-shaded-overlay-priority 100 |
| 1295 | (if (ediff-if-lucid) | ||
| 1296 | (1+ mouse-highlight-priority) | ||
| 1297 | 100) ;; 100 is a kludge. There is a bug in insert-in-front-hooks | ||
| 1298 | ;; in Emacs < 19.23. When this is fixed, I will get rid of | ||
| 1299 | ;; this kludge. | ||
| 1300 | "Priority of non-selected overlays.") | 1328 | "Priority of non-selected overlays.") |
| 1301 | 1329 | ||
| 1302 | 1330 | ||
| @@ -1350,7 +1378,7 @@ through files.") | |||
| 1350 | (if (not window-system) | 1378 | (if (not window-system) |
| 1351 | () | 1379 | () |
| 1352 | (defun ediff-set-face (ground face color) | 1380 | (defun ediff-set-face (ground face color) |
| 1353 | "Sets face foreground/background. If color unavailable, guides the user." | 1381 | "Sets face foreground/background." |
| 1354 | (if (ediff-valid-color-p color) | 1382 | (if (ediff-valid-color-p color) |
| 1355 | (if (eq ground 'foreground) | 1383 | (if (eq ground 'foreground) |
| 1356 | (set-face-foreground face color) | 1384 | (set-face-foreground face color) |
| @@ -1381,7 +1409,8 @@ through files.") | |||
| 1381 | (copy-face 'modeline 'ediff-current-diff-face-A) | 1409 | (copy-face 'modeline 'ediff-current-diff-face-A) |
| 1382 | (copy-face 'highlight 'ediff-current-diff-face-A)) | 1410 | (copy-face 'highlight 'ediff-current-diff-face-A)) |
| 1383 | ))) | 1411 | ))) |
| 1384 | (ediff-get-face 'ediff-current-diff-face-A)) | 1412 | 'ediff-current-diff-face-A) |
| 1413 | ;;(ediff-get-face 'ediff-current-diff-face-A)) | ||
| 1385 | "Face for highlighting the selected difference in buffer A.") | 1414 | "Face for highlighting the selected difference in buffer A.") |
| 1386 | 1415 | ||
| 1387 | (defvar ediff-current-diff-face-B | 1416 | (defvar ediff-current-diff-face-B |
| @@ -1398,7 +1427,8 @@ through files.") | |||
| 1398 | (copy-face 'modeline 'ediff-current-diff-face-B) | 1427 | (copy-face 'modeline 'ediff-current-diff-face-B) |
| 1399 | (copy-face 'highlight 'ediff-current-diff-face-B)) | 1428 | (copy-face 'highlight 'ediff-current-diff-face-B)) |
| 1400 | ))) | 1429 | ))) |
| 1401 | (ediff-get-face 'ediff-current-diff-face-B)) | 1430 | 'ediff-current-diff-face-B) |
| 1431 | ;;(ediff-get-face 'ediff-current-diff-face-B)) | ||
| 1402 | "Face for highlighting the selected difference in buffer B.") | 1432 | "Face for highlighting the selected difference in buffer B.") |
| 1403 | 1433 | ||
| 1404 | (defvar ediff-fine-diff-face-A | 1434 | (defvar ediff-fine-diff-face-A |
| @@ -1411,7 +1441,8 @@ through files.") | |||
| 1411 | (ediff-set-face 'background 'ediff-fine-diff-face-A | 1441 | (ediff-set-face 'background 'ediff-fine-diff-face-A |
| 1412 | "sky blue")) | 1442 | "sky blue")) |
| 1413 | (t (set-face-underline-p 'ediff-fine-diff-face-A t)))) | 1443 | (t (set-face-underline-p 'ediff-fine-diff-face-A t)))) |
| 1414 | (ediff-get-face 'ediff-fine-diff-face-A)) | 1444 | 'ediff-fine-diff-face-A) |
| 1445 | ;;(ediff-get-face 'ediff-fine-diff-face-A)) | ||
| 1415 | "Face for highlighting the refinement of the selected diff in buffer A.") | 1446 | "Face for highlighting the refinement of the selected diff in buffer A.") |
| 1416 | 1447 | ||
| 1417 | (defvar ediff-fine-diff-face-B | 1448 | (defvar ediff-fine-diff-face-B |
| @@ -1422,7 +1453,8 @@ through files.") | |||
| 1422 | (ediff-set-face 'foreground 'ediff-fine-diff-face-B "Black") | 1453 | (ediff-set-face 'foreground 'ediff-fine-diff-face-B "Black") |
| 1423 | (ediff-set-face 'background 'ediff-fine-diff-face-B "cyan")) | 1454 | (ediff-set-face 'background 'ediff-fine-diff-face-B "cyan")) |
| 1424 | (t (set-face-underline-p 'ediff-fine-diff-face-B t)))) | 1455 | (t (set-face-underline-p 'ediff-fine-diff-face-B t)))) |
| 1425 | (ediff-get-face 'ediff-fine-diff-face-B)) | 1456 | 'ediff-fine-diff-face-B) |
| 1457 | ;;(ediff-get-face 'ediff-fine-diff-face-B)) | ||
| 1426 | "Face for highlighting the refinement of the selected diff in buffer B.") | 1458 | "Face for highlighting the refinement of the selected diff in buffer B.") |
| 1427 | 1459 | ||
| 1428 | 1460 | ||
| @@ -1436,12 +1468,9 @@ through files.") | |||
| 1436 | (ediff-set-face | 1468 | (ediff-set-face |
| 1437 | 'background 'ediff-even-diff-face-A "light grey")) | 1469 | 'background 'ediff-even-diff-face-A "light grey")) |
| 1438 | (t | 1470 | (t |
| 1439 | (if (ediff-if-lucid) | 1471 | (copy-face 'italic 'ediff-even-diff-face-A)))) |
| 1440 | (progn | 1472 | 'ediff-even-diff-face-A) |
| 1441 | (copy-face 'highlight 'ediff-even-diff-face-A) | 1473 | ;;(ediff-get-face 'ediff-even-diff-face-A)) |
| 1442 | (invert-face 'ediff-even-diff-face-A)) | ||
| 1443 | (copy-face 'italic 'ediff-even-diff-face-A))))) | ||
| 1444 | (ediff-get-face 'ediff-even-diff-face-A)) | ||
| 1445 | "Face used to highlight even-numbered differences in buffer A.") | 1474 | "Face used to highlight even-numbered differences in buffer A.") |
| 1446 | 1475 | ||
| 1447 | (defvar ediff-even-diff-face-B | 1476 | (defvar ediff-even-diff-face-B |
| @@ -1454,10 +1483,9 @@ through files.") | |||
| 1454 | (ediff-set-face | 1483 | (ediff-set-face |
| 1455 | 'background 'ediff-even-diff-face-B "Gray")) | 1484 | 'background 'ediff-even-diff-face-B "Gray")) |
| 1456 | (t | 1485 | (t |
| 1457 | (if (ediff-if-lucid) | 1486 | (copy-face 'italic 'ediff-even-diff-face-B)))) |
| 1458 | (copy-face 'highlight 'ediff-even-diff-face-B) | 1487 | 'ediff-even-diff-face-B) |
| 1459 | (copy-face 'italic 'ediff-even-diff-face-B))))) | 1488 | ;;(ediff-get-face 'ediff-even-diff-face-B)) |
| 1460 | (ediff-get-face 'ediff-even-diff-face-B)) | ||
| 1461 | "Face used to highlight even-numbered differences in buffer B.") | 1489 | "Face used to highlight even-numbered differences in buffer B.") |
| 1462 | 1490 | ||
| 1463 | (defvar ediff-odd-diff-face-A | 1491 | (defvar ediff-odd-diff-face-A |
| @@ -1470,10 +1498,9 @@ through files.") | |||
| 1470 | (ediff-set-face | 1498 | (ediff-set-face |
| 1471 | 'background 'ediff-odd-diff-face-A "Gray")) | 1499 | 'background 'ediff-odd-diff-face-A "Gray")) |
| 1472 | (t | 1500 | (t |
| 1473 | (if (ediff-if-lucid) | 1501 | (copy-face 'italic 'ediff-odd-diff-face-A)))) |
| 1474 | (copy-face 'highlight 'ediff-odd-diff-face-A) | 1502 | 'ediff-odd-diff-face-A) |
| 1475 | (copy-face 'italic 'ediff-odd-diff-face-A))))) | 1503 | ;;(ediff-get-face 'ediff-odd-diff-face-A)) |
| 1476 | (ediff-get-face 'ediff-odd-diff-face-A)) | ||
| 1477 | "Face used to highlight odd-numbered differences in buffer A.") | 1504 | "Face used to highlight odd-numbered differences in buffer A.") |
| 1478 | 1505 | ||
| 1479 | (defvar ediff-odd-diff-face-B | 1506 | (defvar ediff-odd-diff-face-B |
| @@ -1486,12 +1513,9 @@ through files.") | |||
| 1486 | (ediff-set-face | 1513 | (ediff-set-face |
| 1487 | 'background 'ediff-odd-diff-face-B "light grey")) | 1514 | 'background 'ediff-odd-diff-face-B "light grey")) |
| 1488 | (t | 1515 | (t |
| 1489 | (if (ediff-if-lucid) | 1516 | (copy-face 'italic 'ediff-odd-diff-face-B)))) |
| 1490 | (progn | 1517 | 'ediff-odd-diff-face-B) |
| 1491 | (copy-face 'highlight 'ediff-odd-diff-face-B) | 1518 | ;;(ediff-get-face 'ediff-odd-diff-face-B)) |
| 1492 | (invert-face 'ediff-odd-diff-face-B)) | ||
| 1493 | (copy-face 'italic 'ediff-odd-diff-face-B))))) | ||
| 1494 | (ediff-get-face 'ediff-odd-diff-face-B)) | ||
| 1495 | "Face used to highlight odd-numbered differences in buffer B.") | 1519 | "Face used to highlight odd-numbered differences in buffer B.") |
| 1496 | 1520 | ||
| 1497 | ;; Create *-var faces. These are the actual faces used to highlight | 1521 | ;; Create *-var faces. These are the actual faces used to highlight |
| @@ -1543,12 +1567,12 @@ through files.") | |||
| 1543 | (ediff-overlay-put (eval overlay) 'ediff ediff-control-buffer) | 1567 | (ediff-overlay-put (eval overlay) 'ediff ediff-control-buffer) |
| 1544 | )) | 1568 | )) |
| 1545 | 1569 | ||
| 1546 | ;; Computes priority of ediff overlay. | 1570 | ;; Compute priority of ediff overlay. |
| 1547 | (defun ediff-highest-priority (start end buffer) | 1571 | (defun ediff-highest-priority (start end buffer) |
| 1548 | (let ((pos (max 1 (1- start))) | 1572 | (let ((pos (max 1 (1- start))) |
| 1549 | ovr-list) | 1573 | ovr-list) |
| 1550 | (if (ediff-if-lucid) | 1574 | (if (ediff-if-lucid) |
| 1551 | (+ 2 mouse-highlight-priority) | 1575 | (1+ ediff-shaded-overlay-priority) |
| 1552 | (ediff-eval-in-buffer | 1576 | (ediff-eval-in-buffer |
| 1553 | buffer | 1577 | buffer |
| 1554 | (while (< pos (min (point-max) (1+ end))) | 1578 | (while (< pos (min (point-max) (1+ end))) |
| @@ -1644,30 +1668,32 @@ Do not start with `~/' or `~user-name/'.") | |||
| 1644 | ;;; They only do something in loaddefs.el. | 1668 | ;;; They only do something in loaddefs.el. |
| 1645 | ;;;###autoload | 1669 | ;;;###autoload |
| 1646 | (if purify-flag | 1670 | (if purify-flag |
| 1647 | (defvar menu-bar-epatch-menu | 1671 | (progn |
| 1648 | (make-sparse-keymap "Epatch")) | 1672 | (defvar menu-bar-epatch-menu (make-sparse-keymap "Epatch")) |
| 1649 | (fset 'menu-bar-epatch-menu (symbol-value 'menu-bar-epatch-menu)) | 1673 | (fset 'menu-bar-epatch-menu (symbol-value 'menu-bar-epatch-menu)) |
| 1650 | (defvar menu-bar-ediff-menu (make-sparse-keymap "Ediff")) | 1674 | (defvar menu-bar-ediff-menu (make-sparse-keymap "Ediff")) |
| 1651 | (fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu))) | 1675 | (fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu)))) |
| 1652 | 1676 | ||
| 1653 | 1677 | ||
| 1654 | ;;;###autoload | 1678 | ;;;###autoload |
| 1655 | (if purify-flag | 1679 | (if purify-flag |
| 1656 | (define-key menu-bar-ediff-menu [rcs-ediff] | 1680 | (progn |
| 1657 | '("Compare with a version via RCS ..." . rcs-ediff)) | 1681 | (define-key menu-bar-ediff-menu [rcs-ediff] |
| 1658 | (define-key menu-bar-ediff-menu [vc-ediff] | 1682 | '("Compare with a version via RCS ..." . rcs-ediff)) |
| 1659 | '("Compare with a version via VC ..." . vc-ediff)) | 1683 | (define-key menu-bar-ediff-menu [vc-ediff] |
| 1660 | (define-key menu-bar-ediff-menu [ediff-buffers] | 1684 | '("Compare with a version via VC ..." . vc-ediff)) |
| 1661 | '("Compare buffers ..." . ediff-buffers)) | 1685 | (define-key menu-bar-ediff-menu [ediff-buffers] |
| 1662 | (define-key menu-bar-ediff-menu [ediff-files] | 1686 | '("Compare buffers ..." . ediff-buffers)) |
| 1663 | '("Compare files ..." . ediff-files))) | 1687 | (define-key menu-bar-ediff-menu [ediff-files] |
| 1688 | '("Compare files ..." . ediff-files)))) | ||
| 1664 | 1689 | ||
| 1665 | ;;;###autoload | 1690 | ;;;###autoload |
| 1666 | (if purify-flag | 1691 | (if purify-flag |
| 1667 | (define-key menu-bar-epatch-menu [ediff-patch-buffer] | 1692 | (progn |
| 1668 | '("To a Buffer ..." . ediff-patch-buffer)) | 1693 | (define-key menu-bar-epatch-menu [ediff-patch-buffer] |
| 1669 | (define-key menu-bar-epatch-menu [ediff-patch-file] | 1694 | '("To a Buffer ..." . ediff-patch-buffer)) |
| 1670 | '("To a File ..." . ediff-patch-file))) | 1695 | (define-key menu-bar-epatch-menu [ediff-patch-file] |
| 1696 | '("To a File ..." . ediff-patch-file)))) | ||
| 1671 | 1697 | ||
| 1672 | (if (and window-system ediff-want-default-menus (ediff-frame-has-menubar) | 1698 | (if (and window-system ediff-want-default-menus (ediff-frame-has-menubar) |
| 1673 | (ediff-if-lucid)) | 1699 | (ediff-if-lucid)) |
| @@ -1692,6 +1718,7 @@ Do not start with `~/' or `~user-name/'.") | |||
| 1692 | (add-menu-item '("File") "---" nil nil "New Screen"))) | 1718 | (add-menu-item '("File") "---" nil nil "New Screen"))) |
| 1693 | 1719 | ||
| 1694 | 1720 | ||
| 1721 | |||
| 1695 | (defun ediff-setup-keymap () | 1722 | (defun ediff-setup-keymap () |
| 1696 | "Set up the keymap used in the control buffer of Ediff." | 1723 | "Set up the keymap used in the control buffer of Ediff." |
| 1697 | (setq ediff-mode-map (make-sparse-keymap)) | 1724 | (setq ediff-mode-map (make-sparse-keymap)) |
| @@ -1855,24 +1882,38 @@ Else, read patch file into a new buffer." | |||
| 1855 | ;; These won't run if there are errors in diff | 1882 | ;; These won't run if there are errors in diff |
| 1856 | (ediff-eval-in-buffer | 1883 | (ediff-eval-in-buffer |
| 1857 | ediff-A-buffer | 1884 | ediff-A-buffer |
| 1858 | (run-hooks 'ediff-prepare-buffer-hooks) | ||
| 1859 | (add-hook 'local-write-file-hooks 'ediff-block-write-file) | 1885 | (add-hook 'local-write-file-hooks 'ediff-block-write-file) |
| 1860 | (setq before-change-function 'ediff-before-change-guard) | 1886 | (setq before-change-function 'ediff-before-change-guard) |
| 1861 | ;; add control-buffer to the list of sessions | 1887 | ;; add control-buffer to the list of sessions |
| 1862 | (or (memq control-buffer ediff-this-buffer-control-sessions) | 1888 | (or (memq control-buffer ediff-this-buffer-control-sessions) |
| 1863 | (setq ediff-this-buffer-control-sessions | 1889 | (setq ediff-this-buffer-control-sessions |
| 1864 | (cons control-buffer ediff-this-buffer-control-sessions))) | 1890 | (cons control-buffer ediff-this-buffer-control-sessions))) |
| 1865 | (setq mode-line-buffer-identification '("A: %b"))) | 1891 | (setq mode-line-buffer-identification |
| 1892 | (cons "A: " | ||
| 1893 | (if (string-match "\\(^ \\|^[^ \t]*: \\)" | ||
| 1894 | (car mode-line-buffer-identification)) | ||
| 1895 | (cons (substring (car mode-line-buffer-identification) | ||
| 1896 | (match-end 0)) | ||
| 1897 | (cdr mode-line-buffer-identification)) | ||
| 1898 | mode-line-buffer-identification))) | ||
| 1899 | (run-hooks 'ediff-prepare-buffer-hooks)) | ||
| 1866 | (ediff-eval-in-buffer | 1900 | (ediff-eval-in-buffer |
| 1867 | ediff-B-buffer | 1901 | ediff-B-buffer |
| 1868 | (run-hooks 'ediff-prepare-buffer-hooks) | ||
| 1869 | (add-hook 'local-write-file-hooks 'ediff-block-write-file) | 1902 | (add-hook 'local-write-file-hooks 'ediff-block-write-file) |
| 1870 | (setq before-change-function 'ediff-before-change-guard) | 1903 | (setq before-change-function 'ediff-before-change-guard) |
| 1871 | ;; add control-buffer to the list of sessions | 1904 | ;; add control-buffer to the list of sessions |
| 1872 | (or (memq control-buffer ediff-this-buffer-control-sessions) | 1905 | (or (memq control-buffer ediff-this-buffer-control-sessions) |
| 1873 | (setq ediff-this-buffer-control-sessions | 1906 | (setq ediff-this-buffer-control-sessions |
| 1874 | (cons control-buffer ediff-this-buffer-control-sessions))) | 1907 | (cons control-buffer ediff-this-buffer-control-sessions))) |
| 1875 | (setq mode-line-buffer-identification '("B: %b"))) | 1908 | (setq mode-line-buffer-identification |
| 1909 | (cons "B: " | ||
| 1910 | (if (string-match "\\(^ \\|^[^ \t]*: \\)" | ||
| 1911 | (car mode-line-buffer-identification)) | ||
| 1912 | (cons (substring (car mode-line-buffer-identification) | ||
| 1913 | (match-end 0)) | ||
| 1914 | (cdr mode-line-buffer-identification)) | ||
| 1915 | mode-line-buffer-identification))) | ||
| 1916 | (run-hooks 'ediff-prepare-buffer-hooks)) | ||
| 1876 | 1917 | ||
| 1877 | (ediff-eval-in-buffer control-buffer | 1918 | (ediff-eval-in-buffer control-buffer |
| 1878 | (run-hooks 'startup-hooks 'ediff-startup-hooks) | 1919 | (run-hooks 'startup-hooks 'ediff-startup-hooks) |
| @@ -3573,7 +3614,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." | |||
| 3573 | (1+ ediff-current-difference) | 3614 | (1+ ediff-current-difference) |
| 3574 | ediff-number-of-differences))))) | 3615 | ediff-number-of-differences))))) |
| 3575 | ;; Force mode-line redisplay | 3616 | ;; Force mode-line redisplay |
| 3576 | (set-buffer-modified-p (buffer-modified-p))) | 3617 | (force-mode-line-update)) |
| 3577 | 3618 | ||
| 3578 | 3619 | ||
| 3579 | 3620 | ||
| @@ -4292,8 +4333,3 @@ avoid loading cl-*." | |||
| 4292 | (provide 'ediff) | 4333 | (provide 'ediff) |
| 4293 | 4334 | ||
| 4294 | ;;; ediff.el ends here | 4335 | ;;; ediff.el ends here |
| 4295 | |||
| 4296 | |||
| 4297 | |||
| 4298 | |||
| 4299 | |||