aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/abbrev.el2
-rw-r--r--lisp/allout.el38
-rw-r--r--lisp/ansi-color.el4
-rw-r--r--lisp/apropos.el14
-rw-r--r--lisp/arc-mode.el2
-rw-r--r--lisp/array.el4
-rw-r--r--lisp/autoinsert.el4
-rw-r--r--lisp/byte-run.el10
-rw-r--r--lisp/cmuscheme.el8
-rw-r--r--lisp/completion.el206
-rw-r--r--lisp/composite.el4
-rw-r--r--lisp/cus-dep.el16
-rw-r--r--lisp/cus-face.el22
-rw-r--r--lisp/cus-start.el18
-rw-r--r--lisp/cus-theme.el2
-rw-r--r--lisp/custom.el22
-rw-r--r--lisp/cvs-status.el10
-rw-r--r--lisp/dabbrev.el4
-rw-r--r--lisp/descr-text.el12
-rw-r--r--lisp/diff-mode.el14
-rw-r--r--lisp/dired-x.el4
-rw-r--r--lisp/disp-table.el2
-rw-r--r--lisp/dos-fns.el2
-rw-r--r--lisp/double.el8
-rw-r--r--lisp/ebuff-menu.el4
-rw-r--r--lisp/echistory.el2
-rw-r--r--lisp/ediff-diff.el126
-rw-r--r--lisp/ediff-help.el92
-rw-r--r--lisp/ediff-hook.el30
-rw-r--r--lisp/ediff-init.el6
-rw-r--r--lisp/ediff-merg.el46
-rw-r--r--lisp/ediff-ptch.el72
-rw-r--r--lisp/ediff-util.el536
-rw-r--r--lisp/ediff-vers.el28
-rw-r--r--lisp/ediff-wind.el186
-rw-r--r--lisp/ediff.el206
-rw-r--r--lisp/edmacro.el4
-rw-r--r--lisp/ehelp.el12
-rw-r--r--lisp/electric.el6
-rw-r--r--lisp/emerge.el34
-rw-r--r--lisp/env.el10
-rw-r--r--lisp/facemenu.el58
-rw-r--r--lisp/ffap.el2
-rw-r--r--lisp/find-dired.el6
-rw-r--r--lisp/find-file.el24
-rw-r--r--lisp/flow-ctrl.el10
-rw-r--r--lisp/foldout.el2
-rw-r--r--lisp/font-core.el2
-rw-r--r--lisp/format.el6
-rw-r--r--lisp/forms-d2.el2
-rw-r--r--lisp/forms.el156
-rw-r--r--lisp/gdb-ui.el40
-rw-r--r--lisp/gud.el14
-rw-r--r--lisp/help-fns.el2
-rw-r--r--lisp/help.el2
-rw-r--r--lisp/hexl.el6
-rw-r--r--lisp/hi-lock.el6
-rw-r--r--lisp/hilit-chg.el84
-rw-r--r--lisp/ibuf-ext.el10
-rw-r--r--lisp/ibuf-macs.el8
-rw-r--r--lisp/ibuffer.el32
-rw-r--r--lisp/icomplete.el2
-rw-r--r--lisp/ido.el208
-rw-r--r--lisp/ielm.el4
-rw-r--r--lisp/image.el2
65 files changed, 1260 insertions, 1260 deletions
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 8d9b7625128..929724dd995 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -229,7 +229,7 @@ Don't use this function in a Lisp program; use `define-abbrev' instead."
229 (interactive "p") 229 (interactive "p")
230 (add-abbrev 230 (add-abbrev
231 (if only-global-abbrevs 231 (if only-global-abbrevs
232 global-abbrev-table 232 global-abbrev-table
233 (or local-abbrev-table 233 (or local-abbrev-table
234 (error "No per-mode abbrev table"))) 234 (error "No per-mode abbrev table")))
235 "Mode" arg)) 235 "Mode" arg))
diff --git a/lisp/allout.el b/lisp/allout.el
index 3fc20d95208..b083153d1fa 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -5,7 +5,7 @@
5;; Author: Ken Manheimer <klm@python.org> 5;; Author: Ken Manheimer <klm@python.org>
6;; Maintainer: Ken Manheimer <klm@python.org> 6;; Maintainer: Ken Manheimer <klm@python.org>
7;; Created: Dec 1991 - first release to usenet 7;; Created: Dec 1991 - first release to usenet
8;; Version: $Id: allout.el,v 1.37 2002/12/16 00:42:23 rost Exp $|| 8;; Version: $Id: allout.el,v 1.38 2002/12/16 01:00:51 rost Exp $||
9;; Keywords: outlines mode wp languages 9;; Keywords: outlines mode wp languages
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
@@ -33,23 +33,23 @@
33;; exposure. It also provides for syntax-sensitive text like 33;; exposure. It also provides for syntax-sensitive text like
34;; programming languages. (For an example, see the allout code 34;; programming languages. (For an example, see the allout code
35;; itself, which is organized in ;; an outline framework.) 35;; itself, which is organized in ;; an outline framework.)
36;; 36;;
37;; In addition to outline navigation and exposure, allout includes: 37;; In addition to outline navigation and exposure, allout includes:
38;; 38;;
39;; - topic-oriented repositioning, cut, and paste 39;; - topic-oriented repositioning, cut, and paste
40;; - integral outline exposure-layout 40;; - integral outline exposure-layout
41;; - incremental search with dynamic exposure and reconcealment of hidden text 41;; - incremental search with dynamic exposure and reconcealment of hidden text
42;; - automatic topic-number maintenance 42;; - automatic topic-number maintenance
43;; - "Hot-spot" operation, for single-keystroke maneuvering and 43;; - "Hot-spot" operation, for single-keystroke maneuvering and
44;; exposure control. (See the `allout-mode' docstring.) 44;; exposure control. (See the `allout-mode' docstring.)
45;; 45;;
46;; and many other features. 46;; and many other features.
47;; 47;;
48;; The outline menubar additions provide quick reference to many of 48;; The outline menubar additions provide quick reference to many of
49;; the features, and see the docstring of the function `allout-init' 49;; the features, and see the docstring of the function `allout-init'
50;; for instructions on priming your emacs session for automatic 50;; for instructions on priming your emacs session for automatic
51;; activation of `allout-mode'. 51;; activation of `allout-mode'.
52;; 52;;
53;; See the docstring of the variables `allout-layout' and 53;; See the docstring of the variables `allout-layout' and
54;; `allout-auto-activation' for details on automatic activation of 54;; `allout-auto-activation' for details on automatic activation of
55;; allout `allout-mode' as a minor mode. (It has changed since allout 55;; allout `allout-mode' as a minor mode. (It has changed since allout
@@ -89,7 +89,7 @@ With value `t', auto-mode-activation and auto-layout are enabled.
89With value `ask', auto-mode-activation is enabled, and endorsement for 89With value `ask', auto-mode-activation is enabled, and endorsement for
90performing auto-layout is asked of the user each time. 90performing auto-layout is asked of the user each time.
91 91
92With value `activate', only auto-mode-activation is enabled, 92With value `activate', only auto-mode-activation is enabled,
93auto-layout is not. 93auto-layout is not.
94 94
95With value `nil', neither auto-mode-activation nor auto-layout are 95With value `nil', neither auto-mode-activation nor auto-layout are
@@ -189,7 +189,7 @@ of this var to take effect."
189 189
190These bullets are used to distinguish topics from the run-of-the-mill 190These bullets are used to distinguish topics from the run-of-the-mill
191ones. They are not used in the standard topic headers created by 191ones. They are not used in the standard topic headers created by
192the topic-opening, shifting, and rebulleting \(eg, on topic shift, 192the topic-opening, shifting, and rebulleting \(eg, on topic shift,
193topic paste, blanket rebulleting) routines, but are offered among the 193topic paste, blanket rebulleting) routines, but are offered among the
194choices for rebulleting. They are not altered by the above automatic 194choices for rebulleting. They are not altered by the above automatic
195rebulleting, so they can be used to characterize topics, eg: 195rebulleting, so they can be used to characterize topics, eg:
@@ -242,7 +242,7 @@ tripled, but an underscore is substituted for the space. [This
242presumes that the space is for appearance, not comment syntax. You 242presumes that the space is for appearance, not comment syntax. You
243can use `allout-mode-leaders' to override this behavior, when 243can use `allout-mode-leaders' to override this behavior, when
244incorrect.]" 244incorrect.]"
245 :type '(choice (const t) (const nil) string 245 :type '(choice (const t) (const nil) string
246 (const allout-mode-leaders) 246 (const allout-mode-leaders)
247 (const comment-start)) 247 (const comment-start))
248 :group 'allout) 248 :group 'allout)
@@ -508,7 +508,7 @@ behavior."
508;;;_ : Version 508;;;_ : Version
509;;;_ = allout-version 509;;;_ = allout-version
510(defvar allout-version 510(defvar allout-version
511 (let ((rcs-rev "$Revision: 1.37 $")) 511 (let ((rcs-rev "$Revision: 1.38 $"))
512 (condition-case err 512 (condition-case err
513 (save-match-data 513 (save-match-data
514 (string-match "Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev) 514 (string-match "Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev)
@@ -789,9 +789,9 @@ activation. Being deprecated.")
789 "----" 789 "----"
790 ["Duplicate Exposed" allout-copy-exposed-to-buffer t] 790 ["Duplicate Exposed" allout-copy-exposed-to-buffer t]
791 ["Duplicate Exposed, numbered" 791 ["Duplicate Exposed, numbered"
792 allout-flatten-exposed-to-buffer t] 792 allout-flatten-exposed-to-buffer t]
793 ["Duplicate Exposed, indented" 793 ["Duplicate Exposed, indented"
794 allout-indented-exposed-to-buffer t] 794 allout-indented-exposed-to-buffer t]
795 "----" 795 "----"
796 ["Set Header Lead" allout-reset-header-lead t] 796 ["Set Header Lead" allout-reset-header-lead t]
797 ["Set New Exposure" allout-expose-topic t]))) 797 ["Set New Exposure" allout-expose-topic t])))
@@ -1006,7 +1006,7 @@ the following two lines in your emacs init file:
1006 ((message 1006 ((message
1007 "Outline mode auto-activation and -layout enabled.") 1007 "Outline mode auto-activation and -layout enabled.")
1008 'full))))))) 1008 'full)))))))
1009 1009
1010;;;_ > allout-setup-menubar () 1010;;;_ > allout-setup-menubar ()
1011(defun allout-setup-menubar () 1011(defun allout-setup-menubar ()
1012 "Populate the current buffer's menubar with `allout-mode' stuff." 1012 "Populate the current buffer's menubar with `allout-mode' stuff."
@@ -2459,12 +2459,12 @@ The function checks to ensure that the rebinding is done only once."
2459 2459
2460 (add-hook 'isearch-mode-end-hook 'allout-isearch-rectification) 2460 (add-hook 'isearch-mode-end-hook 'allout-isearch-rectification)
2461 (if (fboundp 'allout-real-isearch-abort) 2461 (if (fboundp 'allout-real-isearch-abort)
2462 ;; 2462 ;;
2463 nil 2463 nil
2464 ; Ensure load of isearch-mode: 2464 ; Ensure load of isearch-mode:
2465 (if (or (and (fboundp 'isearch-mode) 2465 (if (or (and (fboundp 'isearch-mode)
2466 (fboundp 'isearch-abort)) 2466 (fboundp 'isearch-abort))
2467 (condition-case error 2467 (condition-case error
2468 (load-library "isearch-mode") 2468 (load-library "isearch-mode")
2469 ('file-error (message 2469 ('file-error (message
2470 "Skipping isearch-mode provisions - %s '%s'" 2470 "Skipping isearch-mode provisions - %s '%s'"
@@ -2475,7 +2475,7 @@ The function checks to ensure that the rebinding is done only once."
2475 (setq allout-isearch-dynamic-expose nil)))) 2475 (setq allout-isearch-dynamic-expose nil))))
2476 ;; Isearch-mode loaded, encapsulate specific entry points for 2476 ;; Isearch-mode loaded, encapsulate specific entry points for
2477 ;; outline dynamic-exposure business: 2477 ;; outline dynamic-exposure business:
2478 (progn 2478 (progn
2479 ;; stash crucial isearch-mode funcs under known, private 2479 ;; stash crucial isearch-mode funcs under known, private
2480 ;; names, then register wrapper functions under the old 2480 ;; names, then register wrapper functions under the old
2481 ;; names, in their stead: 2481 ;; names, in their stead:
@@ -4053,7 +4053,7 @@ and retains start position."
4053 4053
4054Optional arg CONTEXT indicates interior levels to include." 4054Optional arg CONTEXT indicates interior levels to include."
4055 (let ((delim ".") 4055 (let ((delim ".")
4056 result 4056 result
4057 numstr 4057 numstr
4058 (context-depth (or (and context 2) 1))) 4058 (context-depth (or (and context 2) 1)))
4059 ;; Take care of the explicit context: 4059 ;; Take care of the explicit context:
@@ -4096,7 +4096,7 @@ Optional arg CONTEXT indicates interior levels to include."
4096(defun allout-stringify-flat-index-indented (flat-index) 4096(defun allout-stringify-flat-index-indented (flat-index)
4097 "Convert list representing section/subsection/... to document string." 4097 "Convert list representing section/subsection/... to document string."
4098 (let ((delim ".") 4098 (let ((delim ".")
4099 result 4099 result
4100 numstr) 4100 numstr)
4101 ;; Take care of the explicit context: 4101 ;; Take care of the explicit context:
4102 (setq numstr (int-to-string (car flat-index)) 4102 (setq numstr (int-to-string (car flat-index))
@@ -4534,7 +4534,7 @@ BULLET string, and a list of TEXT strings for the body."
4534 (curr-line) 4534 (curr-line)
4535 body-content bop) 4535 body-content bop)
4536 ; Do the head line: 4536 ; Do the head line:
4537 (insert (concat "\\OneHeadLine{\\verb\1 " 4537 (insert (concat "\\OneHeadLine{\\verb\1 "
4538 (allout-latex-verb-quote bullet) 4538 (allout-latex-verb-quote bullet)
4539 "\1}{" 4539 "\1}{"
4540 depth 4540 depth
diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el
index 3c15528d092..45c0bfb6674 100644
--- a/lisp/ansi-color.el
+++ b/lisp/ansi-color.el
@@ -415,7 +415,7 @@ information will be used for the next call to
415start of the region and set the face with which to start. Set 415start of the region and set the face with which to start. Set
416`ansi-color-context-region' to nil if you don't want this." 416`ansi-color-context-region' to nil if you don't want this."
417 (let ((face (car ansi-color-context-region)) 417 (let ((face (car ansi-color-context-region))
418 (start-marker (or (cadr ansi-color-context-region) 418 (start-marker (or (cadr ansi-color-context-region)
419 (copy-marker begin))) 419 (copy-marker begin)))
420 (end-marker (copy-marker end)) 420 (end-marker (copy-marker end))
421 escape-sequence) 421 escape-sequence)
@@ -481,7 +481,7 @@ start of the region and set the face with which to start. Set
481 481
482(defun ansi-color-make-face (property color) 482(defun ansi-color-make-face (property color)
483 "Return a face with PROPERTY set to COLOR. 483 "Return a face with PROPERTY set to COLOR.
484PROPERTY can be either symbol `foreground' or symbol `background'. 484PROPERTY can be either symbol `foreground' or symbol `background'.
485 485
486For Emacs, we just return the cons cell \(PROPERTY . COLOR). 486For Emacs, we just return the cons cell \(PROPERTY . COLOR).
487For XEmacs, we create a temporary face and return it." 487For XEmacs, we create a temporary face and return it."
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 63450adbc62..f5305f3b290 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -247,7 +247,7 @@ before finding a label."
247 (concat "\\(" 247 (concat "\\("
248 (mapconcat 'identity words "\\|") 248 (mapconcat 'identity words "\\|")
249 "\\)" wild 249 "\\)" wild
250 (if (cdr words) 250 (if (cdr words)
251 (concat "\\(" 251 (concat "\\("
252 (mapconcat 'identity words "\\|") 252 (mapconcat 'identity words "\\|")
253 "\\)") 253 "\\)")
@@ -314,7 +314,7 @@ Value is a list of offsets of the words into the string."
314 (dolist (s (apropos-calc-scores doc apropos-all-words) score) 314 (dolist (s (apropos-calc-scores doc apropos-all-words) score)
315 (setq score (+ score 50 (/ (* (- l s) 50) l))))) 315 (setq score (+ score 50 (/ (* (- l s) 50) l)))))
316 0)) 316 0))
317 317
318(defun apropos-score-symbol (symbol &optional weight) 318(defun apropos-score-symbol (symbol &optional weight)
319 "Return apropos score for SYMBOL." 319 "Return apropos score for SYMBOL."
320 (setq symbol (symbol-name symbol)) 320 (setq symbol (symbol-name symbol))
@@ -413,7 +413,7 @@ satisfy the predicate VAR-PREDICATE."
413 (if (functionp symbol) 413 (if (functionp symbol)
414 (if (setq doc (documentation symbol t)) 414 (if (setq doc (documentation symbol t))
415 (progn 415 (progn
416 (setq score (+ score (apropos-score-doc doc))) 416 (setq score (+ score (apropos-score-doc doc)))
417 (substring doc 0 (string-match "\n" doc))) 417 (substring doc 0 (string-match "\n" doc)))
418 "(not documented)"))) 418 "(not documented)")))
419 (and var-predicate 419 (and var-predicate
@@ -531,7 +531,7 @@ Returns list of symbols and values found."
531 (if (apropos-false-hit-str p) 531 (if (apropos-false-hit-str p)
532 (setq p nil)) 532 (setq p nil))
533 (if (or f v p) 533 (if (or f v p)
534 (setq apropos-accumulator (cons (list symbol 534 (setq apropos-accumulator (cons (list symbol
535 (+ (apropos-score-str f) 535 (+ (apropos-score-str f)
536 (apropos-score-str v) 536 (apropos-score-str v)
537 (apropos-score-str p)) 537 (apropos-score-str p))
@@ -580,7 +580,7 @@ Returns list of symbols and documentation found."
580 (setcar (nthcdr 2 apropos-item) v) 580 (setcar (nthcdr 2 apropos-item) v)
581 (setcar apropos-item (+ (car apropos-item) sv))))) 581 (setcar apropos-item (+ (car apropos-item) sv)))))
582 (setq apropos-accumulator 582 (setq apropos-accumulator
583 (cons (list symbol 583 (cons (list symbol
584 (+ (apropos-score-symbol symbol 2) sf sv) 584 (+ (apropos-score-symbol symbol 2) sf sv)
585 f v) 585 f v)
586 apropos-accumulator))))))) 586 apropos-accumulator)))))))
@@ -665,7 +665,7 @@ Returns list of symbols and documentation found."
665 (or (and (setq apropos-item (assq symbol apropos-accumulator)) 665 (or (and (setq apropos-item (assq symbol apropos-accumulator))
666 (setcar (cdr apropos-item) 666 (setcar (cdr apropos-item)
667 (+ (cadr apropos-item) (apropos-score-doc doc)))) 667 (+ (cadr apropos-item) (apropos-score-doc doc))))
668 (setq apropos-item (list symbol 668 (setq apropos-item (list symbol
669 (+ (apropos-score-symbol symbol 2) 669 (+ (apropos-score-symbol symbol 2)
670 (apropos-score-doc doc)) 670 (apropos-score-doc doc))
671 nil nil) 671 nil nil)
@@ -755,7 +755,7 @@ Will return nil instead."
755(defun apropos-print (do-keys spacing) 755(defun apropos-print (do-keys spacing)
756 "Output result of apropos searching into buffer `*Apropos*'. 756 "Output result of apropos searching into buffer `*Apropos*'.
757The value of `apropos-accumulator' is the list of items to output. 757The value of `apropos-accumulator' is the list of items to output.
758Each element should have the format 758Each element should have the format
759 (SYMBOL SCORE FN-DOC VAR-DOC [PLIST-DOC WIDGET-DOC FACE-DOC GROUP-DOC]). 759 (SYMBOL SCORE FN-DOC VAR-DOC [PLIST-DOC WIDGET-DOC FACE-DOC GROUP-DOC]).
760The return value is the list that was in `apropos-accumulator', sorted 760The return value is the list that was in `apropos-accumulator', sorted
761alphabetically by symbol name; but this function also sets 761alphabetically by symbol name; but this function also sets
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index cc1462c22f3..76eaef21c56 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -757,7 +757,7 @@ when parsing the archive."
757 (apply 757 (apply
758 (function concat) 758 (function concat)
759 (mapcar 759 (mapcar
760 (function 760 (function
761 (lambda (fil) 761 (lambda (fil)
762 ;; Using `concat' here copies the text also, so we can add 762 ;; Using `concat' here copies the text also, so we can add
763 ;; properties without problems. 763 ;; properties without problems.
diff --git a/lisp/array.el b/lisp/array.el
index 597f4ecf2ce..40462968951 100644
--- a/lisp/array.el
+++ b/lisp/array.el
@@ -58,7 +58,7 @@
58 (defvar array-respect-tabs)) 58 (defvar array-respect-tabs))
59 59
60;;; Internal information functions. 60;;; Internal information functions.
61 61
62(defun array-cursor-in-array-range () 62(defun array-cursor-in-array-range ()
63 "Return t if the cursor is in a valid array cell. 63 "Return t if the cursor is in a valid array cell.
64Its ok to be on a row number line." 64Its ok to be on a row number line."
@@ -385,7 +385,7 @@ Leave point at the beginning of the field."
385 (insert array-copy-string)) 385 (insert array-copy-string))
386 (move-to-column array-buffer-column) 386 (move-to-column array-buffer-column)
387 (setq count (1- count))))) 387 (setq count (1- count)))))
388 388
389(defun array-copy-to-column (a-column) 389(defun array-copy-to-column (a-column)
390 "Copy current field horizontally into every cell up to and including A-COLUMN. 390 "Copy current field horizontally into every cell up to and including A-COLUMN.
391Leave point at the beginning of the field." 391Leave point at the beginning of the field."
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index 4b0cd71306e..b13fe3ce503 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -113,7 +113,7 @@ If this contains a %s, that will be replaced by the matching rule."
113 (("[Mm]akefile\\'" . "Makefile") . "makefile.inc") 113 (("[Mm]akefile\\'" . "Makefile") . "makefile.inc")
114 114
115 (html-mode . (lambda () (sgml-tag "html"))) 115 (html-mode . (lambda () (sgml-tag "html")))
116 116
117 (plain-tex-mode . "tex-insert.tex") 117 (plain-tex-mode . "tex-insert.tex")
118 (bibtex-mode . "tex-insert.tex") 118 (bibtex-mode . "tex-insert.tex")
119 (latex-mode 119 (latex-mode
@@ -130,7 +130,7 @@ If this contains a %s, that will be replaced by the matching rule."
130 lambda () 130 lambda ()
131 (if (eq major-mode default-major-mode) 131 (if (eq major-mode default-major-mode)
132 (sh-mode))) 132 (sh-mode)))
133 133
134 (ada-mode . ada-header) 134 (ada-mode . ada-header)
135 135
136 (("\\.[1-9]\\'" . "Man page skeleton") 136 (("\\.[1-9]\\'" . "Man page skeleton")
diff --git a/lisp/byte-run.el b/lisp/byte-run.el
index 09c59818b22..538214b7093 100644
--- a/lisp/byte-run.el
+++ b/lisp/byte-run.el
@@ -144,19 +144,19 @@ The result of the body appears to the compiler as a quoted constant."
144;; "Set some compilation-parameters for this file. This will affect only the 144;; "Set some compilation-parameters for this file. This will affect only the
145;; file in which it appears; this does nothing when evaluated, and when loaded 145;; file in which it appears; this does nothing when evaluated, and when loaded
146;; from a .el file. 146;; from a .el file.
147;; 147;;
148;; Each argument to this macro must be a list of a key and a value. 148;; Each argument to this macro must be a list of a key and a value.
149;; 149;;
150;; Keys: Values: Corresponding variable: 150;; Keys: Values: Corresponding variable:
151;; 151;;
152;; verbose t, nil byte-compile-verbose 152;; verbose t, nil byte-compile-verbose
153;; optimize t, nil, source, byte byte-compile-optimize 153;; optimize t, nil, source, byte byte-compile-optimize
154;; warnings list of warnings byte-compile-warnings 154;; warnings list of warnings byte-compile-warnings
155;; Legal elements: (callargs redefine free-vars unresolved) 155;; Legal elements: (callargs redefine free-vars unresolved)
156;; file-format emacs18, emacs19 byte-compile-compatibility 156;; file-format emacs18, emacs19 byte-compile-compatibility
157;; 157;;
158;; For example, this might appear at the top of a source file: 158;; For example, this might appear at the top of a source file:
159;; 159;;
160;; (byte-compiler-options 160;; (byte-compiler-options
161;; (optimize t) 161;; (optimize t)
162;; (warnings (- free-vars)) ; Don't warn about free variables 162;; (warnings (- free-vars)) ; Don't warn about free variables
diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el
index 770d5c90c2f..2e95658004f 100644
--- a/lisp/cmuscheme.el
+++ b/lisp/cmuscheme.el
@@ -47,19 +47,19 @@
47;; character to the scheme process. Cmuscheme mode does *not* provide this 47;; character to the scheme process. Cmuscheme mode does *not* provide this
48;; functionality. If you are a cscheme user, you may prefer to use the 48;; functionality. If you are a cscheme user, you may prefer to use the
49;; xscheme.el/cscheme -emacs interaction. 49;; xscheme.el/cscheme -emacs interaction.
50;; 50;;
51;; Here's a summary of the pros and cons, as I see them. 51;; Here's a summary of the pros and cons, as I see them.
52;; xscheme: Tightly integrated with inferior cscheme process! A few commands 52;; xscheme: Tightly integrated with inferior cscheme process! A few commands
53;; not in cmuscheme. But. Integration is a bit of a hack. Input 53;; not in cmuscheme. But. Integration is a bit of a hack. Input
54;; history only keeps the immediately prior input. Bizarre 54;; history only keeps the immediately prior input. Bizarre
55;; keybindings. 55;; keybindings.
56;; 56;;
57;; cmuscheme: Not tightly integrated with inferior cscheme process. But. 57;; cmuscheme: Not tightly integrated with inferior cscheme process. But.
58;; Carefully integrated functionality with the entire suite of 58;; Carefully integrated functionality with the entire suite of
59;; comint-derived CMU process modes. Keybindings reminiscent of 59;; comint-derived CMU process modes. Keybindings reminiscent of
60;; Zwei and Hemlock. Good input history. A few commands not in 60;; Zwei and Hemlock. Good input history. A few commands not in
61;; xscheme. 61;; xscheme.
62;; 62;;
63;; It's a tradeoff. Pay your money; take your choice. If you use a Scheme 63;; It's a tradeoff. Pay your money; take your choice. If you use a Scheme
64;; that isn't Cscheme, of course, there isn't a choice. Xscheme.el is *very* 64;; that isn't Cscheme, of course, there isn't a choice. Xscheme.el is *very*
65;; Cscheme-specific; you must use cmuscheme.el. Interested parties are 65;; Cscheme-specific; you must use cmuscheme.el. Interested parties are
@@ -432,7 +432,7 @@ for a minimal, simple implementation. Feel free to extend it.")
432This is a good place to put keybindings." 432This is a good place to put keybindings."
433 :type 'hook 433 :type 'hook
434 :group 'cmuscheme) 434 :group 'cmuscheme)
435 435
436(run-hooks 'cmuscheme-load-hook) 436(run-hooks 'cmuscheme-load-hook)
437 437
438(provide 'cmuscheme) 438(provide 'cmuscheme)
diff --git a/lisp/completion.el b/lisp/completion.el
index 4bc34cc4ba2..2f89a68147d 100644
--- a/lisp/completion.el
+++ b/lisp/completion.el
@@ -37,36 +37,36 @@
37;; 37;;
38;; Introduction 38;; Introduction
39;;--------------- 39;;---------------
40;; 40;;
41;; After you type a few characters, pressing the "complete" key inserts 41;; After you type a few characters, pressing the "complete" key inserts
42;; the rest of the word you are likely to type. 42;; the rest of the word you are likely to type.
43;; 43;;
44;; This watches all the words that you type and remembers them. When 44;; This watches all the words that you type and remembers them. When
45;; typing a new word, pressing "complete" (meta-return) "completes" the 45;; typing a new word, pressing "complete" (meta-return) "completes" the
46;; word by inserting the most recently used word that begins with the 46;; word by inserting the most recently used word that begins with the
47;; same characters. If you press meta-return repeatedly, it cycles 47;; same characters. If you press meta-return repeatedly, it cycles
48;; through all the words it knows about. 48;; through all the words it knows about.
49;; 49;;
50;; If you like the completion then just continue typing, it is as if you 50;; If you like the completion then just continue typing, it is as if you
51;; entered the text by hand. If you want the inserted extra characters 51;; entered the text by hand. If you want the inserted extra characters
52;; to go away, type control-w or delete. More options are described below. 52;; to go away, type control-w or delete. More options are described below.
53;; 53;;
54;; The guesses are made in the order of the most recently "used". Typing 54;; The guesses are made in the order of the most recently "used". Typing
55;; in a word and then typing a separator character (such as a space) "uses" 55;; in a word and then typing a separator character (such as a space) "uses"
56;; the word. So does moving a cursor over the word. If no words are found, 56;; the word. So does moving a cursor over the word. If no words are found,
57;; it uses an extended version of the dabbrev style completion. 57;; it uses an extended version of the dabbrev style completion.
58;; 58;;
59;; You automatically save the completions you use to a file between 59;; You automatically save the completions you use to a file between
60;; sessions. 60;; sessions.
61;; 61;;
62;; Completion enables programmers to enter longer, more descriptive 62;; Completion enables programmers to enter longer, more descriptive
63;; variable names while typing fewer keystrokes than they normally would. 63;; variable names while typing fewer keystrokes than they normally would.
64;; 64;;
65;; 65;;
66;; Full documentation 66;; Full documentation
67;;--------------------- 67;;---------------------
68;; 68;;
69;; A "word" is any string containing characters with either word or symbol 69;; A "word" is any string containing characters with either word or symbol
70;; syntax. [E.G. Any alphanumeric string with hyphens, underscores, etc.] 70;; syntax. [E.G. Any alphanumeric string with hyphens, underscores, etc.]
71;; Unless you change the constants, you must type at least three characters 71;; Unless you change the constants, you must type at least three characters
72;; for the word to be recognized. Only words longer than 6 characters are 72;; for the word to be recognized. Only words longer than 6 characters are
@@ -82,27 +82,27 @@
82;; Completions are automatically saved from one session to another 82;; Completions are automatically saved from one session to another
83;; (unless save-completions-flag or enable-completion is nil). 83;; (unless save-completions-flag or enable-completion is nil).
84;; Loading this file (or calling initialize-completions) causes EMACS 84;; Loading this file (or calling initialize-completions) causes EMACS
85;; to load a completions database for a saved completions file 85;; to load a completions database for a saved completions file
86;; (default: ~/.completions). When you exit, EMACS saves a copy of the 86;; (default: ~/.completions). When you exit, EMACS saves a copy of the
87;; completions that you 87;; completions that you
88;; often use. When you next start, EMACS loads in the saved completion file. 88;; often use. When you next start, EMACS loads in the saved completion file.
89;; 89;;
90;; The number of completions saved depends loosely on 90;; The number of completions saved depends loosely on
91;; *saved-completions-decay-factor*. Completions that have never been 91;; *saved-completions-decay-factor*. Completions that have never been
92;; inserted via "complete" are not saved. You are encouraged to experiment 92;; inserted via "complete" are not saved. You are encouraged to experiment
93;; with different functions (see compute-completion-min-num-uses). 93;; with different functions (see compute-completion-min-num-uses).
94;; 94;;
95;; Some completions are permanent and are always saved out. These 95;; Some completions are permanent and are always saved out. These
96;; completions have their num-uses slot set to T. Use 96;; completions have their num-uses slot set to T. Use
97;; add-permanent-completion to do this 97;; add-permanent-completion to do this
98;; 98;;
99;; Completions are saved only if enable-completion is T. The number of old 99;; Completions are saved only if enable-completion is T. The number of old
100;; versions kept of the saved completions file is controlled by 100;; versions kept of the saved completions file is controlled by
101;; completions-file-versions-kept. 101;; completions-file-versions-kept.
102;; 102;;
103;; COMPLETE KEY OPTIONS 103;; COMPLETE KEY OPTIONS
104;; The complete function takes a numeric arguments. 104;; The complete function takes a numeric arguments.
105;; control-u :: leave the point at the beginning of the completion rather 105;; control-u :: leave the point at the beginning of the completion rather
106;; than the middle. 106;; than the middle.
107;; a number :: rotate through the possible completions by that amount 107;; a number :: rotate through the possible completions by that amount
108;; `-' :: same as -1 (insert previous completion) 108;; `-' :: same as -1 (insert previous completion)
@@ -111,17 +111,17 @@
111;; <write> 111;; <write>
112;; 112;;
113;; UPDATING THE DATABASE MANUALLY 113;; UPDATING THE DATABASE MANUALLY
114;; m-x kill-completion 114;; m-x kill-completion
115;; kills the completion at point. 115;; kills the completion at point.
116;; m-x add-completion 116;; m-x add-completion
117;; m-x add-permanent-completion 117;; m-x add-permanent-completion
118;; 118;;
119;; UPDATING THE DATABASE FROM A SOURCE CODE FILE 119;; UPDATING THE DATABASE FROM A SOURCE CODE FILE
120;; m-x add-completions-from-buffer 120;; m-x add-completions-from-buffer
121;; Parses all the definition names from a C or LISP mode buffer and 121;; Parses all the definition names from a C or LISP mode buffer and
122;; adds them to the completion database. 122;; adds them to the completion database.
123;; 123;;
124;; m-x add-completions-from-lisp-file 124;; m-x add-completions-from-lisp-file
125;; Parses all the definition names from a C or Lisp mode file and 125;; Parses all the definition names from a C or Lisp mode file and
126;; adds them to the completion database. 126;; adds them to the completion database.
127;; 127;;
@@ -133,16 +133,16 @@
133;; <write> 133;; <write>
134;; 134;;
135;; STRING CASING 135;; STRING CASING
136;; Completion is string case independent if case-fold-search has its 136;; Completion is string case independent if case-fold-search has its
137;; normal default of T. Also when the completion is inserted the case of the 137;; normal default of T. Also when the completion is inserted the case of the
138;; entry is coerced appropriately. 138;; entry is coerced appropriately.
139;; [E.G. APP --> APPROPRIATELY app --> appropriately 139;; [E.G. APP --> APPROPRIATELY app --> appropriately
140;; App --> Appropriately] 140;; App --> Appropriately]
141;; 141;;
142;; INITIALIZATION 142;; INITIALIZATION
143;; The form `(initialize-completions)' initializes the completion system by 143;; The form `(initialize-completions)' initializes the completion system by
144;; trying to load in the user's completions. After the first cal, further 144;; trying to load in the user's completions. After the first cal, further
145;; calls have no effect so one should be careful not to put the form in a 145;; calls have no effect so one should be careful not to put the form in a
146;; site's standard site-init file. 146;; site's standard site-init file.
147;; 147;;
148;;--------------------------------------------------------------------------- 148;;---------------------------------------------------------------------------
@@ -180,10 +180,10 @@
180;; Inserts a completion at point 180;; Inserts a completion at point
181;; 181;;
182;; initialize-completions 182;; initialize-completions
183;; Loads the completions file and sets up so that exiting emacs will 183;; Loads the completions file and sets up so that exiting emacs will
184;; save them. 184;; save them.
185;; 185;;
186;; save-completions-to-file &optional filename 186;; save-completions-to-file &optional filename
187;; load-completions-from-file &optional filename 187;; load-completions-from-file &optional filename
188;; 188;;
189;;----------------------------------------------- 189;;-----------------------------------------------
@@ -194,11 +194,11 @@
194;; 194;;
195;; These things are for manipulating the structure 195;; These things are for manipulating the structure
196;; make-completion string num-uses 196;; make-completion string num-uses
197;; completion-num-uses completion 197;; completion-num-uses completion
198;; completion-string completion 198;; completion-string completion
199;; set-completion-num-uses completion num-uses 199;; set-completion-num-uses completion num-uses
200;; set-completion-string completion string 200;; set-completion-string completion string
201;; 201;;
202;; 202;;
203 203
204;;----------------------------------------------- 204;;-----------------------------------------------
@@ -215,16 +215,16 @@
215;;----------------------------------------------- 215;;-----------------------------------------------
216;;; Change Log: 216;;; Change Log:
217;;----------------------------------------------- 217;;-----------------------------------------------
218;; Sometime in '84 Brewster implemented a somewhat buggy version for 218;; Sometime in '84 Brewster implemented a somewhat buggy version for
219;; Symbolics LISPMs. 219;; Symbolics LISPMs.
220;; Jan. '85 Jim became enamored of the idea and implemented a faster, 220;; Jan. '85 Jim became enamored of the idea and implemented a faster,
221;; more robust version. 221;; more robust version.
222;; With input from many users at TMC, (rose, craig, and gls come to mind), 222;; With input from many users at TMC, (rose, craig, and gls come to mind),
223;; the current style of interface was developed. 223;; the current style of interface was developed.
224;; 9/87, Jim and Brewster took terminals home. Yuck. After 224;; 9/87, Jim and Brewster took terminals home. Yuck. After
225;; complaining for a while Brewster implemented a subset of the current 225;; complaining for a while Brewster implemented a subset of the current
226;; LISPM version for GNU Emacs. 226;; LISPM version for GNU Emacs.
227;; 8/88 After complaining for a while (and with sufficient 227;; 8/88 After complaining for a while (and with sufficient
228;; promised rewards), Jim reimplemented a version of GNU completion 228;; promised rewards), Jim reimplemented a version of GNU completion
229;; superior to that of the LISPM version. 229;; superior to that of the LISPM version.
230;; 230;;
@@ -269,7 +269,7 @@
269;; - minor fix to capitalization code 269;; - minor fix to capitalization code
270;; - added *completion-auto-save-period* to variables recorded. 270;; - added *completion-auto-save-period* to variables recorded.
271;; - added reenter protection to cmpl-record-statistics-filter 271;; - added reenter protection to cmpl-record-statistics-filter
272;; - added backup protection to save-completions-to-file (prevents 272;; - added backup protection to save-completions-to-file (prevents
273;; problems with disk full errors) 273;; problems with disk full errors)
274 274
275;;; Code: 275;;; Code:
@@ -375,7 +375,7 @@ DON'T CHANGE WITHOUT RECOMPILING ! This is used by macros.")
375 (setq completion-prefix-min-length 3))) 375 (setq completion-prefix-min-length 3)))
376 376
377(completion-eval-when) 377(completion-eval-when)
378 378
379;;--------------------------------------------------------------------------- 379;;---------------------------------------------------------------------------
380;; Internal Variables 380;; Internal Variables
381;;--------------------------------------------------------------------------- 381;;---------------------------------------------------------------------------
@@ -476,17 +476,17 @@ Used to decide whether to save completions.")
476;; of syntax in these "symbol" syntax tables :: 476;; of syntax in these "symbol" syntax tables ::
477;; 477;;
478;; syntax (?_) - "symbol" chars (e.g. alphanumerics) 478;; syntax (?_) - "symbol" chars (e.g. alphanumerics)
479;; syntax (?w) - symbol chars to ignore at end of words (e.g. period). 479;; syntax (?w) - symbol chars to ignore at end of words (e.g. period).
480;; syntax (? ) - everything else 480;; syntax (? ) - everything else
481;; 481;;
482;; Thus by judicious use of scan-sexps and forward-word, we can get 482;; Thus by judicious use of scan-sexps and forward-word, we can get
483;; the word we want relatively fast and without consing. 483;; the word we want relatively fast and without consing.
484;; 484;;
485;; Why do we need a separate category for "symbol chars to ignore at ends" ? 485;; Why do we need a separate category for "symbol chars to ignore at ends" ?
486;; For example, in LISP we want starting :'s trimmed 486;; For example, in LISP we want starting :'s trimmed
487;; so keyword argument specifiers also define the keyword completion. And, 487;; so keyword argument specifiers also define the keyword completion. And,
488;; for example, in C we want `.' appearing in a structure ref. to 488;; for example, in C we want `.' appearing in a structure ref. to
489;; be kept intact in order to store the whole structure ref.; however, if 489;; be kept intact in order to store the whole structure ref.; however, if
490;; it appears at the end of a symbol it should be discarded because it is 490;; it appears at the end of a symbol it should be discarded because it is
491;; probably used as a period. 491;; probably used as a period.
492 492
@@ -503,7 +503,7 @@ Used to decide whether to save completions.")
503;; C diffs -> 503;; C diffs ->
504;; Separator chars :: + * / : % 504;; Separator chars :: + * / : %
505;; A note on the hyphen (`-'). Perhaps the hyphen should also be a separator 505;; A note on the hyphen (`-'). Perhaps the hyphen should also be a separator
506;; char., however, we wanted to have completion symbols include pointer 506;; char., however, we wanted to have completion symbols include pointer
507;; references. For example, "foo->bar" is a symbol as far as completion is 507;; references. For example, "foo->bar" is a symbol as far as completion is
508;; concerned. 508;; concerned.
509;; 509;;
@@ -556,7 +556,7 @@ Used to decide whether to save completions.")
556 (dolist (char symbol-chars) 556 (dolist (char symbol-chars)
557 (modify-syntax-entry char "_" table)) 557 (modify-syntax-entry char "_" table))
558 table)) 558 table))
559 559
560(defun cmpl-make-c-completion-syntax-table () 560(defun cmpl-make-c-completion-syntax-table ()
561 (let ((table (copy-syntax-table cmpl-standard-syntax-table)) 561 (let ((table (copy-syntax-table cmpl-standard-syntax-table))
562 (separator-chars '(?+ ?* ?/ ?: ?%))) 562 (separator-chars '(?+ ?* ?/ ?: ?%)))
@@ -598,9 +598,9 @@ But only if it is longer than `completion-min-length'."
598 (unwind-protect 598 (unwind-protect
599 (progn 599 (progn
600 (set-syntax-table cmpl-syntax-table) 600 (set-syntax-table cmpl-syntax-table)
601 (cond 601 (cond
602 ;; Cursor is on following-char and after preceding-char 602 ;; Cursor is on following-char and after preceding-char
603 ((memq (char-syntax (following-char)) '(?w ?_)) 603 ((memq (char-syntax (following-char)) '(?w ?_))
604 (setq cmpl-saved-point (point) 604 (setq cmpl-saved-point (point)
605 cmpl-symbol-start (scan-sexps (1+ cmpl-saved-point) -1) 605 cmpl-symbol-start (scan-sexps (1+ cmpl-saved-point) -1)
606 cmpl-symbol-end (scan-sexps cmpl-saved-point 1)) 606 cmpl-symbol-end (scan-sexps cmpl-saved-point 1))
@@ -638,7 +638,7 @@ But only if it is longer than `completion-min-length'."
638 638
639(defun symbol-before-point () 639(defun symbol-before-point ()
640 "Returns a string of the symbol immediately before point. 640 "Returns a string of the symbol immediately before point.
641Returns nil if there isn't one longer than `completion-min-length'." 641Returns nil if there isn't one longer than `completion-min-length'."
642 ;; This is called when a word separator is typed so it must be FAST ! 642 ;; This is called when a word separator is typed so it must be FAST !
643 (setq cmpl-saved-syntax (syntax-table)) 643 (setq cmpl-saved-syntax (syntax-table))
644 (unwind-protect 644 (unwind-protect
@@ -774,7 +774,7 @@ Returns nil if there isn't one longer than `completion-min-length'."
774;; "Only executes body if we are recording statistics." 774;; "Only executes body if we are recording statistics."
775;; (list 'cond 775;; (list 'cond
776;; (list* '*record-cmpl-statistics-p* body) 776;; (list* '*record-cmpl-statistics-p* body)
777;; )) 777;; ))
778 778
779;;----------------------------------------------- 779;;-----------------------------------------------
780;; Completion Sources 780;; Completion Sources
@@ -797,7 +797,7 @@ Returns nil if there isn't one longer than `completion-min-length'."
797;; Completion Method #2: dabbrev-expand style 797;; Completion Method #2: dabbrev-expand style
798;;--------------------------------------------------------------------------- 798;;---------------------------------------------------------------------------
799;; 799;;
800;; This method is used if there are no useful stored completions. It is 800;; This method is used if there are no useful stored completions. It is
801;; based on dabbrev-expand with these differences : 801;; based on dabbrev-expand with these differences :
802;; 1) Faster (we don't use regexps) 802;; 1) Faster (we don't use regexps)
803;; 2) case coercion handled correctly 803;; 2) case coercion handled correctly
@@ -880,7 +880,7 @@ This is sensitive to `case-fold-search'."
880 ;; note that case-fold-search affects the behavior of this function 880 ;; note that case-fold-search affects the behavior of this function
881 ;; Bug: won't pick up an expansion that starts at the top of buffer 881 ;; Bug: won't pick up an expansion that starts at the top of buffer
882 (if cdabbrev-current-window 882 (if cdabbrev-current-window
883 (let (saved-point 883 (let (saved-point
884 saved-syntax 884 saved-syntax
885 (expansion nil) 885 (expansion nil)
886 downcase-expansion tried-list syntax saved-point-2) 886 downcase-expansion tried-list syntax saved-point-2)
@@ -1004,7 +1004,7 @@ Each symbol is bound to a single completion entry.")
1004;; last-use-time is t if the string should be kept permanently 1004;; last-use-time is t if the string should be kept permanently
1005;; num-uses is incremented every time the completion is used. 1005;; num-uses is incremented every time the completion is used.
1006 1006
1007;; We chose lists because (car foo) is faster than (aref foo 0) and the 1007;; We chose lists because (car foo) is faster than (aref foo 0) and the
1008;; creation time is about the same. 1008;; creation time is about the same.
1009 1009
1010;; READER MACROS 1010;; READER MACROS
@@ -1013,7 +1013,7 @@ Each symbol is bound to a single completion entry.")
1013 (list 'car completion-entry)) 1013 (list 'car completion-entry))
1014 1014
1015(defmacro completion-num-uses (completion-entry) 1015(defmacro completion-num-uses (completion-entry)
1016 ;; "The number of times it has used. Used to decide whether to save 1016 ;; "The number of times it has used. Used to decide whether to save
1017 ;; it." 1017 ;; it."
1018 (list 'car (list 'cdr completion-entry))) 1018 (list 'car (list 'cdr completion-entry)))
1019 1019
@@ -1291,7 +1291,7 @@ Returns the completion entry."
1291 (note-added-completion)) 1291 (note-added-completion))
1292 ;; Add it to the symbol 1292 ;; Add it to the symbol
1293 (set cmpl-db-symbol (car entry))))) 1293 (set cmpl-db-symbol (car entry)))))
1294 1294
1295(defun delete-completion (completion-string) 1295(defun delete-completion (completion-string)
1296 "Delete the completion from the database. 1296 "Delete the completion from the database.
1297String must be longer than `completion-prefix-min-length'." 1297String must be longer than `completion-prefix-min-length'."
@@ -1299,7 +1299,7 @@ String must be longer than `completion-prefix-min-length'."
1299 (if completion-to-accept (accept-completion)) 1299 (if completion-to-accept (accept-completion))
1300 (if (setq cmpl-db-entry (find-exact-completion completion-string)) 1300 (if (setq cmpl-db-entry (find-exact-completion completion-string))
1301 ;; found 1301 ;; found
1302 (let* ((prefix-entry (find-cmpl-prefix-entry 1302 (let* ((prefix-entry (find-cmpl-prefix-entry
1303 (substring cmpl-db-downcase-string 0 1303 (substring cmpl-db-downcase-string 0
1304 (cmpl-read-time-eval 1304 (cmpl-read-time-eval
1305 completion-prefix-min-length)))) 1305 completion-prefix-min-length))))
@@ -1339,16 +1339,16 @@ String must be longer than `completion-prefix-min-length'."
1339;; 1339;;
1340;; - Deleting - 1340;; - Deleting -
1341;; (add-completion-to-head "banner") --> ("banner" 0 nil 0) 1341;; (add-completion-to-head "banner") --> ("banner" 0 nil 0)
1342;; (delete-completion "banner") 1342;; (delete-completion "banner")
1343;; (find-exact-completion "banner") --> nil 1343;; (find-exact-completion "banner") --> nil
1344;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...)) 1344;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...))
1345;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...)) 1345;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...))
1346;; (add-completion-to-head "banner") --> ("banner" 0 nil 0) 1346;; (add-completion-to-head "banner") --> ("banner" 0 nil 0)
1347;; (delete-completion "banana") 1347;; (delete-completion "banana")
1348;; (car (find-cmpl-prefix-entry "ban")) --> (("banner" ...) ("banish" ...)) 1348;; (car (find-cmpl-prefix-entry "ban")) --> (("banner" ...) ("banish" ...))
1349;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...)) 1349;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...))
1350;; (delete-completion "banner") 1350;; (delete-completion "banner")
1351;; (delete-completion "banish") 1351;; (delete-completion "banish")
1352;; (find-cmpl-prefix-entry "ban") --> nil 1352;; (find-cmpl-prefix-entry "ban") --> nil
1353;; (delete-completion "banner") --> error 1353;; (delete-completion "banner") --> error
1354;; 1354;;
@@ -1365,7 +1365,7 @@ String must be longer than `completion-prefix-min-length'."
1365;;--------------------------------------------------------------------------- 1365;;---------------------------------------------------------------------------
1366;; Database Update :: Interface level routines 1366;; Database Update :: Interface level routines
1367;;--------------------------------------------------------------------------- 1367;;---------------------------------------------------------------------------
1368;; 1368;;
1369;; These lie on top of the database ref. functions but below the standard 1369;; These lie on top of the database ref. functions but below the standard
1370;; user interface level 1370;; user interface level
1371 1371
@@ -1388,7 +1388,7 @@ String must be longer than `completion-prefix-min-length'."
1388 1388
1389(defun add-completion (string &optional num-uses last-use-time) 1389(defun add-completion (string &optional num-uses last-use-time)
1390 "Add STRING to completion list, or move it to head of list. 1390 "Add STRING to completion list, or move it to head of list.
1391The completion is altered appropriately if num-uses and/or last-use-time is 1391The completion is altered appropriately if num-uses and/or last-use-time is
1392specified." 1392specified."
1393 (interactive (interactive-completion-string-reader "Completion to add")) 1393 (interactive (interactive-completion-string-reader "Completion to add"))
1394 (check-completion-length string) 1394 (check-completion-length string)
@@ -1396,7 +1396,7 @@ specified."
1396 cmpl-source-interactive 1396 cmpl-source-interactive
1397 current-completion-source)) 1397 current-completion-source))
1398 (entry (add-completion-to-head string))) 1398 (entry (add-completion-to-head string)))
1399 1399
1400 (if num-uses (set-completion-num-uses entry num-uses)) 1400 (if num-uses (set-completion-num-uses entry num-uses))
1401 (if last-use-time 1401 (if last-use-time
1402 (set-completion-last-use-time entry last-use-time)))) 1402 (set-completion-last-use-time entry last-use-time))))
@@ -1417,7 +1417,7 @@ specified."
1417 1417
1418(defun accept-completion () 1418(defun accept-completion ()
1419 "Accepts the pending completion in `completion-to-accept'. 1419 "Accepts the pending completion in `completion-to-accept'.
1420This bumps num-uses. Called by `add-completion-to-head' and 1420This bumps num-uses. Called by `add-completion-to-head' and
1421`completion-search-reset'." 1421`completion-search-reset'."
1422 (let ((string completion-to-accept) 1422 (let ((string completion-to-accept)
1423 ;; if this is added afresh here, then it must be a cdabbrev 1423 ;; if this is added afresh here, then it must be a cdabbrev
@@ -1433,7 +1433,7 @@ This bumps num-uses. Called by `add-completion-to-head' and
1433 (let ((string (and enable-completion (symbol-under-point))) 1433 (let ((string (and enable-completion (symbol-under-point)))
1434 (current-completion-source cmpl-source-cursor-moves)) 1434 (current-completion-source cmpl-source-cursor-moves))
1435 (if string (add-completion-to-head string)))) 1435 (if string (add-completion-to-head string))))
1436 1436
1437(defun use-completion-before-point () 1437(defun use-completion-before-point ()
1438 "Add the completion symbol before point into the completion buffer." 1438 "Add the completion symbol before point into the completion buffer."
1439 (let ((string (and enable-completion (symbol-before-point))) 1439 (let ((string (and enable-completion (symbol-before-point)))
@@ -1465,25 +1465,25 @@ Completions added this way will automatically be saved if
1465 1465
1466;; Tests -- 1466;; Tests --
1467;; - Add and Find - 1467;; - Add and Find -
1468;; (add-completion "banana" 5 10) 1468;; (add-completion "banana" 5 10)
1469;; (find-exact-completion "banana") --> ("banana" 5 10 0) 1469;; (find-exact-completion "banana") --> ("banana" 5 10 0)
1470;; (add-completion "banana" 6) 1470;; (add-completion "banana" 6)
1471;; (find-exact-completion "banana") --> ("banana" 6 10 0) 1471;; (find-exact-completion "banana") --> ("banana" 6 10 0)
1472;; (add-completion "banish") 1472;; (add-completion "banish")
1473;; (car (find-cmpl-prefix-entry "ban")) --> (("banish" ...) ("banana" ...)) 1473;; (car (find-cmpl-prefix-entry "ban")) --> (("banish" ...) ("banana" ...))
1474;; 1474;;
1475;; - Accepting - 1475;; - Accepting -
1476;; (setq completion-to-accept "banana") 1476;; (setq completion-to-accept "banana")
1477;; (accept-completion) 1477;; (accept-completion)
1478;; (find-exact-completion "banana") --> ("banana" 7 10) 1478;; (find-exact-completion "banana") --> ("banana" 7 10)
1479;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...)) 1479;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...))
1480;; (setq completion-to-accept "banish") 1480;; (setq completion-to-accept "banish")
1481;; (add-completion "banner") 1481;; (add-completion "banner")
1482;; (car (find-cmpl-prefix-entry "ban")) 1482;; (car (find-cmpl-prefix-entry "ban"))
1483;; --> (("banner" ...) ("banish" 1 ...) ("banana" 7 ...)) 1483;; --> (("banner" ...) ("banish" 1 ...) ("banana" 7 ...))
1484;; 1484;;
1485;; - Deleting - 1485;; - Deleting -
1486;; (kill-completion "banish") 1486;; (kill-completion "banish")
1487;; (car (find-cmpl-prefix-entry "ban")) --> (("banner" ...) ("banana" ...)) 1487;; (car (find-cmpl-prefix-entry "ban")) --> (("banner" ...) ("banana" ...))
1488 1488
1489 1489
@@ -1499,7 +1499,7 @@ Completions added this way will automatically be saved if
1499(defvar cmpl-test-string "") 1499(defvar cmpl-test-string "")
1500;; "The current string used by completion-search-next." 1500;; "The current string used by completion-search-next."
1501(defvar cmpl-test-regexp "") 1501(defvar cmpl-test-regexp "")
1502;; "The current regexp used by completion-search-next. 1502;; "The current regexp used by completion-search-next.
1503;; (derived from cmpl-test-string)" 1503;; (derived from cmpl-test-string)"
1504(defvar cmpl-last-index 0) 1504(defvar cmpl-last-index 0)
1505;; "The last index that completion-search-next was called with." 1505;; "The last index that completion-search-next was called with."
@@ -1554,7 +1554,7 @@ If there are no more entries, try cdabbrev and returns only a string."
1554 (cond ((not cmpl-next-possibilities)) 1554 (cond ((not cmpl-next-possibilities))
1555 ;; If no more possibilities, leave it that way 1555 ;; If no more possibilities, leave it that way
1556 ((= -1 cmpl-last-index) 1556 ((= -1 cmpl-last-index)
1557 ;; next completion is at index 0. reset next-possibility list 1557 ;; next completion is at index 0. reset next-possibility list
1558 ;; to start at beginning 1558 ;; to start at beginning
1559 (setq cmpl-next-possibilities cmpl-starting-possibilities)) 1559 (setq cmpl-next-possibilities cmpl-starting-possibilities))
1560 (t 1560 (t
@@ -1574,11 +1574,11 @@ If there are no more entries, try cdabbrev and returns only a string."
1574 (prog1 1574 (prog1
1575 cmpl-next-possibility 1575 cmpl-next-possibility
1576 (setq cmpl-next-possibility nil))) 1576 (setq cmpl-next-possibility nil)))
1577 1577
1578 1578
1579(defun completion-search-peek (use-cdabbrev) 1579(defun completion-search-peek (use-cdabbrev)
1580 "Returns the next completion entry without actually moving the pointers. 1580 "Returns the next completion entry without actually moving the pointers.
1581Calling this again or calling `completion-search-next' results in the same 1581Calling this again or calling `completion-search-next' results in the same
1582string being returned. Depends on `case-fold-search'. 1582string being returned. Depends on `case-fold-search'.
1583If there are no more entries, try cdabbrev and then return only a string." 1583If there are no more entries, try cdabbrev and then return only a string."
1584 (cond 1584 (cond
@@ -1609,14 +1609,14 @@ If there are no more entries, try cdabbrev and then return only a string."
1609 1609
1610;; Tests -- 1610;; Tests --
1611;; - Add and Find - 1611;; - Add and Find -
1612;; (add-completion "banana") 1612;; (add-completion "banana")
1613;; (completion-search-reset "ban") 1613;; (completion-search-reset "ban")
1614;; (completion-search-next 0) --> "banana" 1614;; (completion-search-next 0) --> "banana"
1615;; 1615;;
1616;; - Discrimination - 1616;; - Discrimination -
1617;; (add-completion "cumberland") 1617;; (add-completion "cumberland")
1618;; (add-completion "cumberbund") 1618;; (add-completion "cumberbund")
1619;; cumbering 1619;; cumbering
1620;; (completion-search-reset "cumb") 1620;; (completion-search-reset "cumb")
1621;; (completion-search-peek t) --> "cumberbund" 1621;; (completion-search-peek t) --> "cumberbund"
1622;; (completion-search-next 0) --> "cumberbund" 1622;; (completion-search-next 0) --> "cumberbund"
@@ -1637,7 +1637,7 @@ If there are no more entries, try cdabbrev and then return only a string."
1637;; 1637;;
1638;; - Deleting - 1638;; - Deleting -
1639;; (kill-completion "cumberland") 1639;; (kill-completion "cumberland")
1640;; cummings 1640;; cummings
1641;; (completion-search-reset "cum") 1641;; (completion-search-reset "cum")
1642;; (completion-search-next 0) --> "cumberbund" 1642;; (completion-search-next 0) --> "cumberbund"
1643;; (completion-search-next 1) --> "cummings" 1643;; (completion-search-next 1) --> "cummings"
@@ -1657,17 +1657,17 @@ If there are no more entries, try cdabbrev and then return only a string."
1657 (interactive) 1657 (interactive)
1658 (setq enable-completion (not enable-completion)) 1658 (setq enable-completion (not enable-completion))
1659 (message "Completion mode is now %s." (if enable-completion "ON" "OFF"))) 1659 (message "Completion mode is now %s." (if enable-completion "ON" "OFF")))
1660 1660
1661(defvar cmpl-current-index 0) 1661(defvar cmpl-current-index 0)
1662(defvar cmpl-original-string nil) 1662(defvar cmpl-original-string nil)
1663(defvar cmpl-last-insert-location -1) 1663(defvar cmpl-last-insert-location -1)
1664(defvar cmpl-leave-point-at-start nil) 1664(defvar cmpl-leave-point-at-start nil)
1665 1665
1666(defun complete (&optional arg) 1666(defun complete (&optional arg)
1667 "Fill out a completion of the word before point. 1667 "Fill out a completion of the word before point.
1668Point is left at end. Consecutive calls rotate through all possibilities. 1668Point is left at end. Consecutive calls rotate through all possibilities.
1669Prefix args :: 1669Prefix args ::
1670 control-u :: leave the point at the beginning of the completion rather 1670 control-u :: leave the point at the beginning of the completion rather
1671 than at the end. 1671 than at the end.
1672 a number :: rotate through the possible completions by that amount 1672 a number :: rotate through the possible completions by that amount
1673 `-' :: same as -1 (insert previous completion) 1673 `-' :: same as -1 (insert previous completion)
@@ -1693,7 +1693,7 @@ Prefix args ::
1693 (setq this-command 'failed-complete) 1693 (setq this-command 'failed-complete)
1694 (error "To complete, point must be after a symbol at least %d character long" 1694 (error "To complete, point must be after a symbol at least %d character long"
1695 completion-prefix-min-length))) 1695 completion-prefix-min-length)))
1696 ;; get index 1696 ;; get index
1697 (setq cmpl-current-index (if current-prefix-arg arg 0)) 1697 (setq cmpl-current-index (if current-prefix-arg arg 0))
1698 ;; statistics 1698 ;; statistics
1699 (cmpl-statistics-block 1699 (cmpl-statistics-block
@@ -1748,7 +1748,7 @@ Prefix args ::
1748 (setq string (cmpl-merge-string-cases 1748 (setq string (cmpl-merge-string-cases
1749 string cmpl-original-string)) 1749 string cmpl-original-string))
1750 (message "Next completion: %s" string)))) 1750 (message "Next completion: %s" string))))
1751 (t;; none found, insert old 1751 (t;; none found, insert old
1752 (insert cmpl-original-string) 1752 (insert cmpl-original-string)
1753 ;; Don't accept completions 1753 ;; Don't accept completions
1754 (setq completion-to-accept nil) 1754 (setq completion-to-accept nil)
@@ -1862,7 +1862,7 @@ Prefix args ::
1862;; (and (string-match *lisp-def-regexp* "\n(def-bar foo")(match-end 0)) -> 10 1862;; (and (string-match *lisp-def-regexp* "\n(def-bar foo")(match-end 0)) -> 10
1863;; (and (string-match *lisp-def-regexp* "\n(defun (foo") (match-end 0)) -> 9 1863;; (and (string-match *lisp-def-regexp* "\n(defun (foo") (match-end 0)) -> 9
1864 1864
1865;; Parses all the definition names from a Lisp mode buffer and adds them to 1865;; Parses all the definition names from a Lisp mode buffer and adds them to
1866;; the completion database. 1866;; the completion database.
1867(defun add-completions-from-lisp-buffer () 1867(defun add-completions-from-lisp-buffer ()
1868 ;;; Benchmarks 1868 ;;; Benchmarks
@@ -1955,7 +1955,7 @@ Prefix args ::
1955;; (test-c-def-regexp *c-cont-regexp* "oo {trout =1} my_carp;") -> 14 1955;; (test-c-def-regexp *c-cont-regexp* "oo {trout =1} my_carp;") -> 14
1956;; (test-c-def-regexp *c-cont-regexp* "truct_p complex foon") -> nil 1956;; (test-c-def-regexp *c-cont-regexp* "truct_p complex foon") -> nil
1957 1957
1958;; Parses all the definition names from a C mode buffer and adds them to the 1958;; Parses all the definition names from a C mode buffer and adds them to the
1959;; completion database. 1959;; completion database.
1960(defun add-completions-from-c-buffer () 1960(defun add-completions-from-c-buffer ()
1961 ;; Benchmark -- 1961 ;; Benchmark --
@@ -2089,7 +2089,7 @@ If file name is not specified, use `save-completions-file-name'."
2089 (total-perm 0) 2089 (total-perm 0)
2090 (total-saved 0) 2090 (total-saved 0)
2091 (backup-filename (completion-backup-filename filename))) 2091 (backup-filename (completion-backup-filename filename)))
2092 2092
2093 (save-excursion 2093 (save-excursion
2094 (get-buffer-create " *completion-save-buffer*") 2094 (get-buffer-create " *completion-save-buffer*")
2095 (set-buffer " *completion-save-buffer*") 2095 (set-buffer " *completion-save-buffer*")
@@ -2130,7 +2130,7 @@ If file name is not specified, use `save-completions-file-name'."
2130 (setq total-saved (1+ total-saved)) 2130 (setq total-saved (1+ total-saved))
2131 (insert (prin1-to-string (cons (completion-string completion) 2131 (insert (prin1-to-string (cons (completion-string completion)
2132 last-use-time)) "\n")))) 2132 last-use-time)) "\n"))))
2133 2133
2134 ;; write the buffer 2134 ;; write the buffer
2135 (condition-case e 2135 (condition-case e
2136 (let ((file-exists-p (file-exists-p filename))) 2136 (let ((file-exists-p (file-exists-p filename)))
@@ -2139,7 +2139,7 @@ If file name is not specified, use `save-completions-file-name'."
2139 ;; If file exists . . . 2139 ;; If file exists . . .
2140 ;; Save a backup(so GNU doesn't screw us when we're out of disk) 2140 ;; Save a backup(so GNU doesn't screw us when we're out of disk)
2141 ;; (GNU leaves a 0 length file if it gets a disk full error!) 2141 ;; (GNU leaves a 0 length file if it gets a disk full error!)
2142 2142
2143 ;; If backup doesn't exit, Rename current to backup 2143 ;; If backup doesn't exit, Rename current to backup
2144 ;; {If backup exists the primary file is probably messed up} 2144 ;; {If backup exists the primary file is probably messed up}
2145 (or (file-exists-p backup-filename) 2145 (or (file-exists-p backup-filename)
@@ -2189,7 +2189,7 @@ If file is not specified, then use `save-completions-file-name'."
2189 ;; prepare the buffer to be modified 2189 ;; prepare the buffer to be modified
2190 (clear-visited-file-modtime) 2190 (clear-visited-file-modtime)
2191 (erase-buffer) 2191 (erase-buffer)
2192 2192
2193 (let ((insert-okay-p nil) 2193 (let ((insert-okay-p nil)
2194 (buffer (current-buffer)) 2194 (buffer (current-buffer))
2195 (current-time (cmpl-hours-since-origin)) 2195 (current-time (cmpl-hours-since-origin))
@@ -2205,10 +2205,10 @@ If file is not specified, then use `save-completions-file-name'."
2205 (progn (insert-file-contents filename t) 2205 (progn (insert-file-contents filename t)
2206 (setq insert-okay-p t)) 2206 (setq insert-okay-p t))
2207 2207
2208 (file-error 2208 (file-error
2209 (message "File error trying to load completion file %s." 2209 (message "File error trying to load completion file %s."
2210 filename))) 2210 filename)))
2211 ;; parse it 2211 ;; parse it
2212 (if insert-okay-p 2212 (if insert-okay-p
2213 (progn 2213 (progn
2214 (goto-char (point-min)) 2214 (goto-char (point-min))
@@ -2234,7 +2234,7 @@ If file is not specified, then use `save-completions-file-name'."
2234 (completion-last-use-time 2234 (completion-last-use-time
2235 (setq cmpl-entry 2235 (setq cmpl-entry
2236 (add-completion-to-tail-if-new string)))) 2236 (add-completion-to-tail-if-new string))))
2237 (if (or (eq last-use-time t) 2237 (if (or (eq last-use-time t)
2238 (and (> last-use-time 1000);;backcompatibility 2238 (and (> last-use-time 1000);;backcompatibility
2239 (not (eq cmpl-last-use-time t)) 2239 (not (eq cmpl-last-use-time t))
2240 (or (not cmpl-last-use-time) 2240 (or (not cmpl-last-use-time)
@@ -2290,7 +2290,7 @@ If the previous command was also a kill command,
2290the text killed this time appends to the text killed last time 2290the text killed this time appends to the text killed last time
2291to make one entry in the kill ring. 2291to make one entry in the kill ring.
2292Patched to remove the most recent completion." 2292Patched to remove the most recent completion."
2293 (interactive "r") 2293 (interactive "r")
2294 (cond ((eq last-command 'complete) 2294 (cond ((eq last-command 'complete)
2295 (delete-region (point) cmpl-last-insert-location) 2295 (delete-region (point) cmpl-last-insert-location)
2296 (insert cmpl-original-string) 2296 (insert cmpl-original-string)
@@ -2311,7 +2311,7 @@ Patched to remove the most recent completion."
2311;; All common separators (eg. space "(" ")" """) characters go through a 2311;; All common separators (eg. space "(" ")" """) characters go through a
2312;; function to add new words to the list of words to complete from: 2312;; function to add new words to the list of words to complete from:
2313;; COMPLETION-SEPARATOR-SELF-INSERT-COMMAND (arg). 2313;; COMPLETION-SEPARATOR-SELF-INSERT-COMMAND (arg).
2314;; If the character before this was an alpha-numeric then this adds the 2314;; If the character before this was an alpha-numeric then this adds the
2315;; symbol before point to the completion list (using ADD-COMPLETION). 2315;; symbol before point to the completion list (using ADD-COMPLETION).
2316 2316
2317(defun completion-separator-self-insert-command (arg) 2317(defun completion-separator-self-insert-command (arg)
@@ -2330,7 +2330,7 @@ Patched to remove the most recent completion."
2330;; Wrapping Macro 2330;; Wrapping Macro
2331;;----------------------------------------------- 2331;;-----------------------------------------------
2332 2332
2333;; Note that because of the way byte compiling works, none of 2333;; Note that because of the way byte compiling works, none of
2334;; the functions defined with this macro get byte compiled. 2334;; the functions defined with this macro get byte compiled.
2335 2335
2336(defmacro def-completion-wrapper (function-name type &optional new-name) 2336(defmacro def-completion-wrapper (function-name type &optional new-name)
@@ -2397,7 +2397,7 @@ TYPE is the type of the wrapper to be added. Can be :before or :under."
2397 (define-key fortran-mode-map "/" 'completion-separator-self-insert-command)) 2397 (define-key fortran-mode-map "/" 'completion-separator-self-insert-command))
2398 2398
2399;;; Enable completion mode. 2399;;; Enable completion mode.
2400 2400
2401;;;###autoload 2401;;;###autoload
2402(defun dynamic-completion-mode () 2402(defun dynamic-completion-mode ()
2403 "Enable dynamic word-completion." 2403 "Enable dynamic word-completion."
@@ -2522,8 +2522,8 @@ TYPE is the type of the wrapper to be added. Can be :before or :under."
2522 2522
2523 ;; Tests -- 2523 ;; Tests --
2524 ;; foobarbiz 2524 ;; foobarbiz
2525 ;; foobar 2525 ;; foobar
2526 ;; fooquux 2526 ;; fooquux
2527 ;; fooper 2527 ;; fooper
2528 2528
2529 (cmpl-statistics-block 2529 (cmpl-statistics-block
diff --git a/lisp/composite.el b/lisp/composite.el
index 49fe76de5ed..1f279cd6a17 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -95,7 +95,7 @@ follows (the point `*' corresponds to both reference points):
95 (or (integerp nref) 95 (or (integerp nref)
96 (setq nref (cdr (assq nref reference-point-alist)))) 96 (setq nref (cdr (assq nref reference-point-alist))))
97 (or (and (>= gref 0) (< gref 12) (>= nref 0) (< nref 12)) 97 (or (and (>= gref 0) (< gref 12) (>= nref 0) (< nref 12))
98 (error "Invalid composition rule: %S" rule)) 98 (error "Invalid composition rule: %S" rule))
99 (+ (* gref 12) nref)))) 99 (+ (* gref 12) nref))))
100 100
101;; Decode encoded composition rule RULE-CODE. The value is a cons of 101;; Decode encoded composition rule RULE-CODE. The value is a cons of
@@ -331,7 +331,7 @@ This function is the default value of `compose-chars-after-function'."
331 (when tail 331 (when tail
332 (save-match-data 332 (save-match-data
333 (save-excursion 333 (save-excursion
334 (while (and tail (not func)) 334 (while (and tail (not func))
335 (setq pattern (car (car tail)) 335 (setq pattern (car (car tail))
336 func (cdr (car tail))) 336 func (cdr (car tail)))
337 (goto-char pos) 337 (goto-char pos)
diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el
index 5a472ebcf96..e448f279917 100644
--- a/lisp/cus-dep.el
+++ b/lisp/cus-dep.el
@@ -92,7 +92,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
92 (when members 92 (when members
93 ;; So x and no-x builds won't differ. 93 ;; So x and no-x builds won't differ.
94 (setq members 94 (setq members
95 (sort (copy-sequence members) 95 (sort (copy-sequence members)
96 (lambda (x y) (string< (car x) (car y))))) 96 (lambda (x y) (string< (car x) (car y)))))
97 (while members 97 (while members
98 (setq item (car (car members)) 98 (setq item (car (car members))
@@ -102,7 +102,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
102 (member where found)) 102 (member where found))
103 (if found 103 (if found
104 (insert " ") 104 (insert " ")
105 (insert "(put '" (symbol-name symbol) 105 (insert "(put '" (symbol-name symbol)
106 " 'custom-loads '(")) 106 " 'custom-loads '("))
107 (prin1 where (current-buffer)) 107 (prin1 where (current-buffer))
108 (push where found))) 108 (push where found)))
@@ -110,7 +110,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
110 (insert "))\n")))))) 110 (insert "))\n"))))))
111 (insert "\ 111 (insert "\
112;;; These are for handling :version. We need to have a minimum of 112;;; These are for handling :version. We need to have a minimum of
113;;; information so `customize-changed-options' could do its job. 113;;; information so `customize-changed-options' could do its job.
114 114
115;;; For groups we set `custom-version', `group-documentation' and 115;;; For groups we set `custom-version', `group-documentation' and
116;;; `custom-tag' (which are shown in the customize buffer), so we 116;;; `custom-tag' (which are shown in the customize buffer), so we
@@ -136,7 +136,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
136 (mapatoms (lambda (symbol) 136 (mapatoms (lambda (symbol)
137 (let ((version (get symbol 'custom-version)) 137 (let ((version (get symbol 'custom-version))
138 where) 138 where)
139 (when version 139 (when version
140 (setq where (get symbol 'custom-where)) 140 (setq where (get symbol 'custom-where))
141 (when where 141 (when where
142 (if (or (custom-variable-p symbol) 142 (if (or (custom-variable-p symbol)
@@ -144,13 +144,13 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
144 ;; This means it's a variable or a face. 144 ;; This means it's a variable or a face.
145 (progn 145 (progn
146 (if (assoc version version-alist) 146 (if (assoc version version-alist)
147 (unless 147 (unless
148 (member where 148 (member where
149 (cdr (assoc version version-alist))) 149 (cdr (assoc version version-alist)))
150 (push where (cdr (assoc version version-alist)))) 150 (push where (cdr (assoc version version-alist))))
151 (push (cons version (list where)) version-alist))) 151 (push (cons version (list where)) version-alist)))
152 ;; This is a group 152 ;; This is a group
153 (insert "(custom-put-if-not '" (symbol-name symbol) 153 (insert "(custom-put-if-not '" (symbol-name symbol)
154 " 'custom-version ") 154 " 'custom-version ")
155 (prin1 version (current-buffer)) 155 (prin1 version (current-buffer))
156 (insert ")\n") 156 (insert ")\n")
@@ -169,7 +169,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
169 (if version-alist "'" "")) 169 (if version-alist "'" ""))
170 (prin1 version-alist (current-buffer)) 170 (prin1 version-alist (current-buffer))
171 (insert "\n \"For internal use by custom.\")\n")) 171 (insert "\n \"For internal use by custom.\")\n"))
172 172
173 (insert "\ 173 (insert "\
174 174
175\(provide '" (file-name-sans-extension 175\(provide '" (file-name-sans-extension
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index 4b33f1e4f04..f1744cc9e65 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -86,7 +86,7 @@
86 (const :tag "ultracondensed" ultra-condensed) 86 (const :tag "ultracondensed" ultra-condensed)
87 (const :tag "ultraexpanded" ultra-expanded) 87 (const :tag "ultraexpanded" ultra-expanded)
88 (const :tag "wide" extra-expanded))) 88 (const :tag "wide" extra-expanded)))
89 89
90 (:height 90 (:height
91 (choice :tag "Height" 91 (choice :tag "Height"
92 :help-echo "Face's font height." 92 :help-echo "Face's font height."
@@ -113,7 +113,7 @@
113 (const :tag "semilight" semi-light) 113 (const :tag "semilight" semi-light)
114 (const :tag "ultralight" ultra-light) 114 (const :tag "ultralight" ultra-light)
115 (const :tag "ultrabold" ultra-bold))) 115 (const :tag "ultrabold" ultra-bold)))
116 116
117 (:slant 117 (:slant
118 (choice :tag "Slant" 118 (choice :tag "Slant"
119 :help-echo "Font slant." 119 :help-echo "Font slant."
@@ -121,28 +121,28 @@
121 (const :tag "italic" italic) 121 (const :tag "italic" italic)
122 (const :tag "oblique" oblique) 122 (const :tag "oblique" oblique)
123 (const :tag "normal" normal))) 123 (const :tag "normal" normal)))
124 124
125 (:underline 125 (:underline
126 (choice :tag "Underline" 126 (choice :tag "Underline"
127 :help-echo "Control text underlining." 127 :help-echo "Control text underlining."
128 (const :tag "Off" nil) 128 (const :tag "Off" nil)
129 (const :tag "On" t) 129 (const :tag "On" t)
130 (color :tag "Colored"))) 130 (color :tag "Colored")))
131 131
132 (:overline 132 (:overline
133 (choice :tag "Overline" 133 (choice :tag "Overline"
134 :help-echo "Control text overlining." 134 :help-echo "Control text overlining."
135 (const :tag "Off" nil) 135 (const :tag "Off" nil)
136 (const :tag "On" t) 136 (const :tag "On" t)
137 (color :tag "Colored"))) 137 (color :tag "Colored")))
138 138
139 (:strike-through 139 (:strike-through
140 (choice :tag "Strike-through" 140 (choice :tag "Strike-through"
141 :help-echo "Control text strike-through." 141 :help-echo "Control text strike-through."
142 (const :tag "Off" nil) 142 (const :tag "Off" nil)
143 (const :tag "On" t) 143 (const :tag "On" t)
144 (color :tag "Colored"))) 144 (color :tag "Colored")))
145 145
146 (:box 146 (:box
147 ;; Fixme: this can probably be done better. 147 ;; Fixme: this can probably be done better.
148 (choice :tag "Box around text" 148 (choice :tag "Box around text"
@@ -190,21 +190,21 @@
190 (nconc (and lwidth `(:line-width ,lwidth)) 190 (nconc (and lwidth `(:line-width ,lwidth))
191 (and color `(:color ,color)) 191 (and color `(:color ,color))
192 (and style `(:style ,style))))))))) 192 (and style `(:style ,style)))))))))
193 193
194 (:inverse-video 194 (:inverse-video
195 (choice :tag "Inverse-video" 195 (choice :tag "Inverse-video"
196 :help-echo "Control whether text should be in inverse-video." 196 :help-echo "Control whether text should be in inverse-video."
197 (const :tag "Off" nil) 197 (const :tag "Off" nil)
198 (const :tag "On" t))) 198 (const :tag "On" t)))
199 199
200 (:foreground 200 (:foreground
201 (color :tag "Foreground" 201 (color :tag "Foreground"
202 :help-echo "Set foreground color.")) 202 :help-echo "Set foreground color."))
203 203
204 (:background 204 (:background
205 (color :tag "Background" 205 (color :tag "Background"
206 :help-echo "Set background color.")) 206 :help-echo "Set background color."))
207 207
208 (:stipple 208 (:stipple
209 (choice :tag "Stipple" 209 (choice :tag "Stipple"
210 :help-echo "Background bit-mask" 210 :help-echo "Background bit-mask"
@@ -230,7 +230,7 @@
230 (if (and (consp cus-value) (null (cdr cus-value))) 230 (if (and (consp cus-value) (null (cdr cus-value)))
231 (car cus-value) 231 (car cus-value)
232 cus-value)))) 232 cus-value))))
233 233
234 "Alist of face attributes. 234 "Alist of face attributes.
235 235
236The elements are of the form (KEY TYPE PRE-FILTER POST-FILTER), 236The elements are of the form (KEY TYPE PRE-FILTER POST-FILTER),
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index c09662ff60b..9ece1e8d2f0 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -34,7 +34,7 @@
34 34
35;;; Code: 35;;; Code:
36 36
37(let ((all '(;; abbrev.c 37(let ((all '(;; abbrev.c
38 (abbrev-all-caps abbrev-mode boolean) 38 (abbrev-all-caps abbrev-mode boolean)
39 (pre-abbrev-expand-hook abbrev-mode hook) 39 (pre-abbrev-expand-hook abbrev-mode hook)
40 ;; alloc.c 40 ;; alloc.c
@@ -88,7 +88,7 @@
88 (function :value ignore)))) 88 (function :value ignore))))
89 (selection-coding-system mule coding-system) 89 (selection-coding-system mule coding-system)
90 ;; dired.c 90 ;; dired.c
91 (completion-ignored-extensions dired 91 (completion-ignored-extensions dired
92 (repeat (string :format "%v"))) 92 (repeat (string :format "%v")))
93 ;; dispnew.c 93 ;; dispnew.c
94 (baud-rate display integer) 94 (baud-rate display integer)
@@ -106,7 +106,7 @@
106 :value (nil) 106 :value (nil)
107 (symbol :format "%v")) 107 (symbol :format "%v"))
108 (const :tag "always" t))) 108 (const :tag "always" t)))
109 (debug-on-error debug 109 (debug-on-error debug
110 (choice (const :tag "off") 110 (choice (const :tag "off")
111 (repeat :menu-tag "When" 111 (repeat :menu-tag "When"
112 :value (nil) 112 :value (nil)
@@ -155,7 +155,7 @@
155;; version-specific directories when you upgrade. We need 155;; version-specific directories when you upgrade. We need
156;; customization of the front of the list, maintaining the standard 156;; customization of the front of the list, maintaining the standard
157;; value intact at the back. 157;; value intact at the back.
158;;; (load-path environment 158;;; (load-path environment
159;;; (repeat (choice :tag "[Current dir?]" 159;;; (repeat (choice :tag "[Current dir?]"
160;;; :format "%[Current dir?%] %v" 160;;; :format "%[Current dir?%] %v"
161;;; (const :tag " current dir" nil) 161;;; (const :tag " current dir" nil)
@@ -205,8 +205,8 @@
205 (display-buffer-function windows (choice (const nil) function)) 205 (display-buffer-function windows (choice (const nil) function))
206 (pop-up-frames frames boolean) 206 (pop-up-frames frames boolean)
207 (pop-up-frame-function frames function) 207 (pop-up-frame-function frames function)
208 (special-display-buffer-names 208 (special-display-buffer-names
209 frames 209 frames
210 (repeat (choice :tag "Buffer" 210 (repeat (choice :tag "Buffer"
211 :value "" 211 :value ""
212 (string :format "%v") 212 (string :format "%v")
@@ -219,7 +219,7 @@
219 (symbol :tag "Parameter") 219 (symbol :tag "Parameter")
220 (sexp :tag "Value"))))))) 220 (sexp :tag "Value")))))))
221 (special-display-regexps 221 (special-display-regexps
222 frames 222 frames
223 (repeat (choice :tag "Buffer" 223 (repeat (choice :tag "Buffer"
224 :value "" 224 :value ""
225 (regexp :format "%v") 225 (regexp :format "%v")
@@ -283,7 +283,7 @@
283 (numberp sexp)) 283 (numberp sexp))
284 sexp 284 sexp
285 (list 'quote sexp))))) 285 (list 'quote sexp)))))
286 (while all 286 (while all
287 (setq this (car all) 287 (setq this (car all)
288 all (cdr all) 288 all (cdr all)
289 symbol (nth 0 this) 289 symbol (nth 0 this)
@@ -307,7 +307,7 @@
307 (message "Note, built-in variable `%S' not bound" symbol)) 307 (message "Note, built-in variable `%S' not bound" symbol))
308 ;; Save the standard value, unless we already did. 308 ;; Save the standard value, unless we already did.
309 (or (get symbol 'standard-value) 309 (or (get symbol 'standard-value)
310 (put symbol 'standard-value 310 (put symbol 'standard-value
311 (list (funcall quoter (default-value symbol))))) 311 (list (funcall quoter (default-value symbol)))))
312 ;; If this is NOT while dumping Emacs, 312 ;; If this is NOT while dumping Emacs,
313 ;; set up the rest of the customization info. 313 ;; set up the rest of the customization info.
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index 6faa1a199c2..32364763dfb 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -53,7 +53,7 @@ This will help you share your customizations with other people.\n\n")
53 user-login-name)) 53 user-login-name))
54 (widget-insert "\n\nDocumentation:\n") 54 (widget-insert "\n\nDocumentation:\n")
55 (setq custom-theme-description 55 (setq custom-theme-description
56 (widget-create 'text 56 (widget-create 'text
57 :value (format-time-string "Created %Y-%m-%d."))) 57 :value (format-time-string "Created %Y-%m-%d.")))
58 (widget-insert "\nVariables:\n\n") 58 (widget-insert "\nVariables:\n\n")
59 (setq custom-theme-variables 59 (setq custom-theme-variables
diff --git a/lisp/custom.el b/lisp/custom.el
index b3458bfce41..8ed78fd649d 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -191,27 +191,27 @@ The following keywords are meaningful:
191 Include an external link after the documentation string for this 191 Include an external link after the documentation string for this
192 item. This is a sentence containing an active field which 192 item. This is a sentence containing an active field which
193 references some other documentation. 193 references some other documentation.
194 194
195 There are three alternatives you can use for LINK-DATA: 195 There are three alternatives you can use for LINK-DATA:
196 196
197 (custom-manual INFO-NODE) 197 (custom-manual INFO-NODE)
198 Link to an Info node; INFO-NODE is a string which specifies 198 Link to an Info node; INFO-NODE is a string which specifies
199 the node name, as in \"(emacs)Top\". The link appears as 199 the node name, as in \"(emacs)Top\". The link appears as
200 `[manual]' in the customization buffer. 200 `[manual]' in the customization buffer.
201 201
202 (info-link INFO-NODE) 202 (info-link INFO-NODE)
203 Like `custom-manual' except that the link appears in the 203 Like `custom-manual' except that the link appears in the
204 customization buffer with the Info node name. 204 customization buffer with the Info node name.
205 205
206 (url-link URL) 206 (url-link URL)
207 Link to a web page; URL is a string which specifies the URL. 207 Link to a web page; URL is a string which specifies the URL.
208 The link appears in the customization buffer as URL. 208 The link appears in the customization buffer as URL.
209 209
210 You can specify the text to use in the customization buffer by 210 You can specify the text to use in the customization buffer by
211 adding `:tag NAME' after the first element of the LINK-DATA; for 211 adding `:tag NAME' after the first element of the LINK-DATA; for
212 example, (info-link :tag \"foo\" \"(emacs)Top\") makes a link to the 212 example, (info-link :tag \"foo\" \"(emacs)Top\") makes a link to the
213 Emacs manual which appears in the buffer as `foo'. 213 Emacs manual which appears in the buffer as `foo'.
214 214
215 An item can have more than one external link; however, most items 215 An item can have more than one external link; however, most items
216 have none at all. 216 have none at all.
217:initialize 217:initialize
@@ -772,7 +772,7 @@ in SYMBOL's list property `theme-value' \(using `custom-push-theme')."
772 ((default-boundp symbol) 772 ((default-boundp symbol)
773 ;; Something already set this, overwrite it. 773 ;; Something already set this, overwrite it.
774 (funcall set symbol (eval value)))) 774 (funcall set symbol (eval value))))
775 (error 775 (error
776 (message "Error setting %s: %s" symbol data))) 776 (message "Error setting %s: %s" symbol data)))
777 (setq args (cdr args)) 777 (setq args (cdr args))
778 (and (or now (default-boundp symbol)) 778 (and (or now (default-boundp symbol))
@@ -815,7 +815,7 @@ this sets the local binding in that buffer instead."
815(defun customize-mark-to-save (symbol) 815(defun customize-mark-to-save (symbol)
816 "Mark SYMBOL for later saving. 816 "Mark SYMBOL for later saving.
817 817
818If the default value of SYMBOL is different from the standard value, 818If the default value of SYMBOL is different from the standard value,
819set the `saved-value' property to a list whose car evaluates to the 819set the `saved-value' property to a list whose car evaluates to the
820default value. Otherwise, set it to nil. 820default value. Otherwise, set it to nil.
821 821
@@ -844,9 +844,9 @@ Return non-nil iff the `saved-value' property actually changed."
844(defun customize-mark-as-set (symbol) 844(defun customize-mark-as-set (symbol)
845 "Mark current value of SYMBOL as being set from customize. 845 "Mark current value of SYMBOL as being set from customize.
846 846
847If the default value of SYMBOL is different from the saved value if any, 847If the default value of SYMBOL is different from the saved value if any,
848or else if it is different from the standard value, set the 848or else if it is different from the standard value, set the
849`customized-value' property to a list whose car evaluates to the 849`customized-value' property to a list whose car evaluates to the
850default value. Otherwise, set it to nil. 850default value. Otherwise, set it to nil.
851 851
852Return non-nil iff the `customized-value' property actually changed." 852Return non-nil iff the `customized-value' property actually changed."
@@ -856,7 +856,7 @@ Return non-nil iff the `customized-value' property actually changed."
856 (old (or (get symbol 'saved-value) (get symbol 'standard-value)))) 856 (old (or (get symbol 'saved-value) (get symbol 'standard-value))))
857 ;; Mark default value as set iff different from old value. 857 ;; Mark default value as set iff different from old value.
858 (if (or (null old) 858 (if (or (null old)
859 (not (equal value (condition-case nil 859 (not (equal value (condition-case nil
860 (eval (car old)) 860 (eval (car old))
861 (error nil))))) 861 (error nil)))))
862 (put symbol 'customized-value (list (custom-quote value))) 862 (put symbol 'customized-value (list (custom-quote value)))
diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el
index 27cd78e1daf..27c5c20649a 100644
--- a/lisp/cvs-status.el
+++ b/lisp/cvs-status.el
@@ -86,7 +86,7 @@
86 (1 font-lock-function-name-face))))) 86 (1 font-lock-function-name-face)))))
87(defconst cvs-status-font-lock-defaults 87(defconst cvs-status-font-lock-defaults
88 '(cvs-status-font-lock-keywords t nil nil nil (font-lock-multiline . t))) 88 '(cvs-status-font-lock-keywords t nil nil nil (font-lock-multiline . t)))
89 89
90 90
91(put 'cvs-status-mode 'mode-class 'special) 91(put 'cvs-status-mode 'mode-class 'special)
92;;;###autoload 92;;;###autoload
@@ -218,7 +218,7 @@ or a string (in which case it should simply return its argument).
218A tag cannot be a CONS. The return value can also be a list of strings, 218A tag cannot be a CONS. The return value can also be a list of strings,
219if several nodes where merged into one. 219if several nodes where merged into one.
220The tree will be printed no closer than column COLUMN." 220The tree will be printed no closer than column COLUMN."
221 221
222 (let* ((eol (save-excursion (end-of-line) (current-column))) 222 (let* ((eol (save-excursion (end-of-line) (current-column)))
223 (column (max (+ eol 2) column))) 223 (column (max (+ eol 2) column)))
224 (if (null tags) column 224 (if (null tags) column
@@ -487,9 +487,9 @@ Optional prefix ARG chooses between two representations."
487 (setq pe eq))) 487 (setq pe eq)))
488 (nreverse nas)))) 488 (nreverse nas))))
489 489
490;;;; 490;;;;
491;;;; Merged trees from different files 491;;;; Merged trees from different files
492;;;; 492;;;;
493 493
494(defun cvs-tree-fuzzy-merge-1 (trees tree prev) 494(defun cvs-tree-fuzzy-merge-1 (trees tree prev)
495 ) 495 )
@@ -509,7 +509,7 @@ Optional prefix ARG chooses between two representations."
509 (erase-buffer) 509 (erase-buffer)
510 (let ((cvs-tag-print-rev nil)) 510 (let ((cvs-tag-print-rev nil))
511 (cvs-tree-print tree 'cvs-tag->string 3))))) 511 (cvs-tree-print tree 'cvs-tag->string 3)))))
512 512
513 513
514(provide 'cvs-status) 514(provide 'cvs-status)
515 515
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index fd8b596d530..b31760ff654 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -751,7 +751,7 @@ DIRECTION = 0 means try both backward and forward.
751IGNORE-CASE non-nil means ignore case when searching. 751IGNORE-CASE non-nil means ignore case when searching.
752This sets `dabbrev--last-direction' to 1 or -1 according 752This sets `dabbrev--last-direction' to 1 or -1 according
753to the direction in which the occurrence was actually found. 753to the direction in which the occurrence was actually found.
754It sets `dabbrev--last-expansion-location' to the location 754It sets `dabbrev--last-expansion-location' to the location
755of the start of the occurrence." 755of the start of the occurrence."
756 (save-excursion 756 (save-excursion
757 ;; If we were scanning something other than the current buffer, 757 ;; If we were scanning something other than the current buffer,
@@ -921,7 +921,7 @@ to record whether we upcased the expansion, downcased it, or did neither."
921 ;; record if we upcased or downcased the first word, 921 ;; record if we upcased or downcased the first word,
922 ;; in order to do likewise for subsequent words. 922 ;; in order to do likewise for subsequent words.
923 (and record-case-pattern 923 (and record-case-pattern
924 (setq dabbrev--last-case-pattern 924 (setq dabbrev--last-case-pattern
925 (and use-case-replace 925 (and use-case-replace
926 (cond ((equal abbrev (upcase abbrev)) 'upcase) 926 (cond ((equal abbrev (upcase abbrev)) 'upcase)
927 ((equal abbrev (downcase abbrev)) 'downcase))))) 927 ((equal abbrev (downcase abbrev)) 'downcase)))))
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index b0e091a89dd..810c781e8c3 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -35,12 +35,12 @@
35 (delete-window) 35 (delete-window)
36 (bury-buffer))) 36 (bury-buffer)))
37 37
38(defvar describe-text-mode-map 38(defvar describe-text-mode-map
39 (let ((map (make-sparse-keymap))) 39 (let ((map (make-sparse-keymap)))
40 (set-keymap-parent map widget-keymap) 40 (set-keymap-parent map widget-keymap)
41 map) 41 map)
42 "Keymap for `describe-text-mode'.") 42 "Keymap for `describe-text-mode'.")
43 43
44(defcustom describe-text-mode-hook nil 44(defcustom describe-text-mode-hook nil
45 "List of hook functions ran by `describe-text-mode'." 45 "List of hook functions ran by `describe-text-mode'."
46 :type 'hook 46 :type 'hook
@@ -67,7 +67,7 @@ if that value is non-nil."
67 (widget-create 'link 67 (widget-create 'link
68 :notify `(lambda (&rest ignore) 68 :notify `(lambda (&rest ignore)
69 (widget-browse ',widget)) 69 (widget-browse ',widget))
70 (format "%S" (if (symbolp widget) 70 (format "%S" (if (symbolp widget)
71 widget 71 widget
72 (car widget)))) 72 (car widget))))
73 (widget-insert " ") 73 (widget-insert " ")
@@ -197,7 +197,7 @@ otherwise."
197 ;; Buttons 197 ;; Buttons
198 (when (and button (not (widgetp wid-button))) 198 (when (and button (not (widgetp wid-button)))
199 (newline) 199 (newline)
200 (widget-insert "Here is a " (format "%S" button-type) 200 (widget-insert "Here is a " (format "%S" button-type)
201 " button labeled `" button-label "'.\n\n")) 201 " button labeled `" button-label "'.\n\n"))
202 ;; Overlays 202 ;; Overlays
203 (when overlays 203 (when overlays
@@ -207,7 +207,7 @@ otherwise."
207 (widget-insert "There are " (format "%d" (length overlays)) 207 (widget-insert "There are " (format "%d" (length overlays))
208 " overlays here:\n")) 208 " overlays here:\n"))
209 (dolist (overlay overlays) 209 (dolist (overlay overlays)
210 (widget-insert " From " (format "%d" (overlay-start overlay)) 210 (widget-insert " From " (format "%d" (overlay-start overlay))
211 " to " (format "%d" (overlay-end overlay)) "\n") 211 " to " (format "%d" (overlay-end overlay)) "\n")
212 (describe-property-list (overlay-properties overlay))) 212 (describe-property-list (overlay-properties overlay)))
213 (widget-insert "\n")) 213 (widget-insert "\n"))
@@ -336,7 +336,7 @@ as well as widgets, buttons, overlays, and text properties."
336 (t (concat (substring composed 0 (- pos (car composition))) 336 (t (concat (substring composed 0 (- pos (car composition)))
337 "' and `" 337 "' and `"
338 (substring composed (- (1+ pos) (car composition)))))) 338 (substring composed (- (1+ pos) (car composition))))))
339 339
340 "' to form `" composed "'") 340 "' to form `" composed "'")
341 (if (nth 3 composition) 341 (if (nth 3 composition)
342 (insert ".\n") 342 (insert ".\n")
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 7899da63eed..30b9467c727 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -417,7 +417,7 @@ If the prefix ARG is given, restrict the view to the current file instead."
417 (number-to-string newstart2) ",1 @@\n") 417 (number-to-string newstart2) ",1 @@\n")
418 ;; Fix the original hunk-header. 418 ;; Fix the original hunk-header.
419 (diff-fixup-modifs start pos)))) 419 (diff-fixup-modifs start pos))))
420 420
421 421
422;;;; 422;;;;
423;;;; jump to other buffers 423;;;; jump to other buffers
@@ -519,9 +519,9 @@ Non-nil OLD means that we want the old file."
519 (ediff-patch-file nil (current-buffer)) 519 (ediff-patch-file nil (current-buffer))
520 (wrong-number-of-arguments (ediff-patch-file)))) 520 (wrong-number-of-arguments (ediff-patch-file))))
521 521
522;;;; 522;;;;
523;;;; Conversion functions 523;;;; Conversion functions
524;;;; 524;;;;
525 525
526;;(defvar diff-inhibit-after-change nil 526;;(defvar diff-inhibit-after-change nil
527;; "Non-nil means inhibit `diff-mode's after-change functions.") 527;; "Non-nil means inhibit `diff-mode's after-change functions.")
@@ -791,9 +791,9 @@ else cover the whole bufer."
791 (unless (string= new old) (replace-match new t t nil 2)))))) 791 (unless (string= new old) (replace-match new t t nil 2))))))
792 (setq space 0 plus 0 minus 0 bang 0))))))) 792 (setq space 0 plus 0 minus 0 bang 0)))))))
793 793
794;;;; 794;;;;
795;;;; Hooks 795;;;; Hooks
796;;;; 796;;;;
797 797
798(defun diff-write-contents-hooks () 798(defun diff-write-contents-hooks ()
799 "Fixup hunk headers if necessary." 799 "Fixup hunk headers if necessary."
@@ -847,9 +847,9 @@ See `after-change-functions' for the meaning of BEG, END and LEN."
847 (diff-fixup-modifs (point) (cdr diff-unhandled-changes))))) 847 (diff-fixup-modifs (point) (cdr diff-unhandled-changes)))))
848 (setq diff-unhandled-changes nil))) 848 (setq diff-unhandled-changes nil)))
849 849
850;;;; 850;;;;
851;;;; The main function 851;;;; The main function
852;;;; 852;;;;
853 853
854;;;###autoload 854;;;###autoload
855(define-derived-mode diff-mode fundamental-mode "Diff" 855(define-derived-mode diff-mode fundamental-mode "Diff"
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 0cc9c43b2fe..ddd0a289eeb 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -33,9 +33,9 @@
33;; been removed or renamed in order to work properly with dired of GNU 33;; been removed or renamed in order to work properly with dired of GNU
34;; Emacs. All suggestions or comments are most welcomed. 34;; Emacs. All suggestions or comments are most welcomed.
35 35
36;; 36;;
37;; Please, PLEASE, *PLEASE* see the info pages. 37;; Please, PLEASE, *PLEASE* see the info pages.
38;; 38;;
39 39
40;; BUGS: Type M-x dired-x-submit-report and a report will be generated. 40;; BUGS: Type M-x dired-x-submit-report and a report will be generated.
41 41
diff --git a/lisp/disp-table.el b/lisp/disp-table.el
index 6a8fe08ca20..174b5d27211 100644
--- a/lisp/disp-table.el
+++ b/lisp/disp-table.el
@@ -159,7 +159,7 @@ X frame."
159(defun standard-display-underline (c uc) 159(defun standard-display-underline (c uc)
160 "Display character C as character UC plus underlining." 160 "Display character C as character UC plus underlining."
161 (aset standard-display-table c 161 (aset standard-display-table c
162 (vector 162 (vector
163 (if window-system 163 (if window-system
164 (logior uc (lsh (face-id 'underline) 19)) 164 (logior uc (lsh (face-id 'underline) 19))
165 (create-glyph (concat "\e[4m" (char-to-string uc) "\e[m")))))) 165 (create-glyph (concat "\e[4m" (char-to-string uc) "\e[m"))))))
diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el
index 1a979a80d73..ba2aff981e7 100644
--- a/lisp/dos-fns.el
+++ b/lisp/dos-fns.el
@@ -42,7 +42,7 @@ with a definition that really does change some file names."
42 (let ((flen (length filename))) 42 (let ((flen (length filename)))
43 ;; If FILENAME has a trailing slash, remove it and recurse. 43 ;; If FILENAME has a trailing slash, remove it and recurse.
44 (if (memq (aref filename (1- flen)) '(?/ ?\\)) 44 (if (memq (aref filename (1- flen)) '(?/ ?\\))
45 (concat (convert-standard-filename 45 (concat (convert-standard-filename
46 (substring filename 0 (1- flen))) 46 (substring filename 0 (1- flen)))
47 "/") 47 "/")
48 (let* (;; ange-ftp gets in the way for names like "/foo:bar". 48 (let* (;; ange-ftp gets in the way for names like "/foo:bar".
diff --git a/lisp/double.el b/lisp/double.el
index ed427d056b1..b658f007923 100644
--- a/lisp/double.el
+++ b/lisp/double.el
@@ -26,7 +26,7 @@
26 26
27;; This mode is intended for use with languages that adds a small 27;; This mode is intended for use with languages that adds a small
28;; number of extra letters not available on the keyboard. 28;; number of extra letters not available on the keyboard.
29;; 29;;
30;; Examples includes Scandinavian and German with an US keyboard. 30;; Examples includes Scandinavian and German with an US keyboard.
31;; 31;;
32;; The idea is that certain keys are overloaded. When you press it 32;; The idea is that certain keys are overloaded. When you press it
@@ -34,7 +34,7 @@
34;; string will be replaced by another. This can be used for mapping 34;; string will be replaced by another. This can be used for mapping
35;; keys on a US keyboard to generate characters according to the local 35;; keys on a US keyboard to generate characters according to the local
36;; keyboard convention when pressed once, and according to US keyboard 36;; keyboard convention when pressed once, and according to US keyboard
37;; convention when pressed twice. 37;; convention when pressed twice.
38;; 38;;
39;; To use this mode, you must define the variable `double-map' and 39;; To use this mode, you must define the variable `double-map' and
40;; then enable double mode with `M-x double-mode'. Read the 40;; then enable double mode with `M-x double-mode'. Read the
@@ -99,7 +99,7 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
99(or (boundp 'isearch-mode-map) 99(or (boundp 'isearch-mode-map)
100 (load-library "isearch")) 100 (load-library "isearch"))
101 101
102(define-key isearch-mode-map [ignore] 102(define-key isearch-mode-map [ignore]
103 (function (lambda () (interactive) (isearch-update)))) 103 (function (lambda () (interactive) (isearch-update))))
104 104
105(defun double-translate-key (prompt) 105(defun double-translate-key (prompt)
@@ -117,7 +117,7 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
117 (let ((new (double-read-event prompt)) 117 (let ((new (double-read-event prompt))
118 (entry (assoc double-last-event double-map))) 118 (entry (assoc double-last-event double-map)))
119 (if (eq new double-last-event) 119 (if (eq new double-last-event)
120 (progn 120 (progn
121 (setq unread-command-events 121 (setq unread-command-events
122 (append (make-list (1- (length (nth 1 entry))) 122 (append (make-list (1- (length (nth 1 entry)))
123 127) 123 127)
diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el
index 3d2f87b04b0..d87a2124546 100644
--- a/lisp/ebuff-menu.el
+++ b/lisp/ebuff-menu.el
@@ -54,7 +54,7 @@ much like those of buffer-menu-mode.
54 54
55Calls value of `electric-buffer-menu-mode-hook' on entry if non-nil. 55Calls value of `electric-buffer-menu-mode-hook' on entry if non-nil.
56 56
57\\{electric-buffer-menu-mode-map}" 57\\{electric-buffer-menu-mode-map}"
58 (interactive "P") 58 (interactive "P")
59 (let (select buffer) 59 (let (select buffer)
60 (save-window-excursion 60 (save-window-excursion
@@ -209,7 +209,7 @@ electric-buffer-menu-mode-hook if it is non-nil."
209 (define-key map [escape escape escape] 'Electric-buffer-menu-quit) 209 (define-key map [escape escape escape] 'Electric-buffer-menu-quit)
210 (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select) 210 (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select)
211 (setq electric-buffer-menu-mode-map map))) 211 (setq electric-buffer-menu-mode-map map)))
212 212
213(defun Electric-buffer-menu-exit () 213(defun Electric-buffer-menu-exit ()
214 (interactive) 214 (interactive)
215 (setq unread-command-events (listify-key-sequence (this-command-keys))) 215 (setq unread-command-events (listify-key-sequence (this-command-keys)))
diff --git a/lisp/echistory.el b/lisp/echistory.el
index 221d9176f51..dd6b4298727 100644
--- a/lisp/echistory.el
+++ b/lisp/echistory.el
@@ -72,7 +72,7 @@ With prefix arg NOCONFIRM, execute current line as-is without editing."
72 (define-key electric-history-map "\e<" 'beginning-of-buffer) 72 (define-key electric-history-map "\e<" 'beginning-of-buffer)
73 (define-key electric-history-map "\n" 'next-line) 73 (define-key electric-history-map "\n" 'next-line)
74 (define-key electric-history-map "\r" 'next-line) 74 (define-key electric-history-map "\r" 'next-line)
75 (define-key electric-history-map "\177" 'previous-line) 75 (define-key electric-history-map "\177" 'previous-line)
76 (define-key electric-history-map "\C-n" 'next-line) 76 (define-key electric-history-map "\C-n" 'next-line)
77 (define-key electric-history-map "\C-p" 'previous-line) 77 (define-key electric-history-map "\C-p" 'previous-line)
78 (define-key electric-history-map "\ev" 'scroll-down) 78 (define-key electric-history-map "\ev" 'scroll-down)
diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el
index 37ac8c0e13d..99b9a23f7c0 100644
--- a/lisp/ediff-diff.el
+++ b/lisp/ediff-diff.el
@@ -126,7 +126,7 @@ are `-I REGEXP', to ignore changes whose lines match the REGEXP."
126 :group 'ediff-diff) 126 :group 'ediff-diff)
127 127
128(defcustom ediff-diff-options "" 128(defcustom ediff-diff-options ""
129 "*Options to pass to `ediff-diff-program'. 129 "*Options to pass to `ediff-diff-program'.
130If Unix diff is used as `ediff-diff-program', then the most useful options are 130If Unix diff is used as `ediff-diff-program', then the most useful options are
131`-w', to ignore space, and `-i', to ignore case of letters. 131`-w', to ignore space, and `-i', to ignore case of letters.
132At present, the option `-c' is not allowed." 132At present, the option `-c' is not allowed."
@@ -164,7 +164,7 @@ Lines that do not match are assumed to be error messages."
164;; the status can be =diff(A), =diff(B), or =diff(A+B) 164;; the status can be =diff(A), =diff(B), or =diff(A+B)
165(ediff-defvar-local ediff-diff-status "" "") 165(ediff-defvar-local ediff-diff-status "" "")
166 166
167 167
168;;; Fine differences 168;;; Fine differences
169 169
170(ediff-defvar-local ediff-auto-refine (if (ediff-has-face-support-p) 'on 'nix) 170(ediff-defvar-local ediff-auto-refine (if (ediff-has-face-support-p) 'on 'nix)
@@ -182,7 +182,7 @@ Use `setq-default' if setting it in .emacs")
182 182
183(ediff-defvar-local ediff-auto-refine-limit 1400 183(ediff-defvar-local ediff-auto-refine-limit 1400
184 "*Auto-refine only the regions of this size \(in bytes\) or less.") 184 "*Auto-refine only the regions of this size \(in bytes\) or less.")
185 185
186;;; General 186;;; General
187 187
188(defvar ediff-diff-ok-lines-regexp 188(defvar ediff-diff-ok-lines-regexp
@@ -215,7 +215,7 @@ The function should take three mandatory arguments, file-A, file-B, and
215file-C. It may ignore file C for diff2 jobs. It should also take 215file-C. It may ignore file C for diff2 jobs. It should also take
216one optional arguments, diff-number to refine.") 216one optional arguments, diff-number to refine.")
217 217
218 218
219;;; Functions 219;;; Functions
220 220
221;; Generate the difference vector and overlays for the two files 221;; Generate the difference vector and overlays for the two files
@@ -228,7 +228,7 @@ one optional arguments, diff-number to refine.")
228 ;; looking either for '-c' or a 'c' in a set of clustered non-long options 228 ;; looking either for '-c' or a 'c' in a set of clustered non-long options
229 (if (string-match "^-c\\| -c\\|-[^- ]+c" ediff-diff-options) 229 (if (string-match "^-c\\| -c\\|-[^- ]+c" ediff-diff-options)
230 (error "Option `-c' is not allowed in `ediff-diff-options'")) 230 (error "Option `-c' is not allowed in `ediff-diff-options'"))
231 231
232 ;; create, if it doesn't exist 232 ;; create, if it doesn't exist
233 (or (ediff-buffer-live-p ediff-diff-buffer) 233 (or (ediff-buffer-live-p ediff-diff-buffer)
234 (setq ediff-diff-buffer 234 (setq ediff-diff-buffer
@@ -268,9 +268,9 @@ one optional arguments, diff-number to refine.")
268 (message "") 268 (message "")
269 (ediff-with-current-buffer diff-buffer 269 (ediff-with-current-buffer diff-buffer
270 (buffer-size)))))) 270 (buffer-size))))))
271
272 271
273 272
273
274;; If file-A/B/C is nil, do 2-way comparison with the non-nil buffers 274;; If file-A/B/C is nil, do 2-way comparison with the non-nil buffers
275;; This function works for diff3 and diff2 jobs 275;; This function works for diff3 and diff2 jobs
276(defun ediff-setup-fine-diff-regions (file-A file-B file-C reg-num) 276(defun ediff-setup-fine-diff-regions (file-A file-B file-C reg-num)
@@ -278,7 +278,7 @@ one optional arguments, diff-number to refine.")
278 (setq ediff-fine-diff-buffer 278 (setq ediff-fine-diff-buffer
279 (get-buffer-create 279 (get-buffer-create
280 (ediff-unique-buffer-name "*ediff-fine-diff" "*")))) 280 (ediff-unique-buffer-name "*ediff-fine-diff" "*"))))
281 281
282 (let (diff3-job diff-program diff-options ok-regexp diff-list) 282 (let (diff3-job diff-program diff-options ok-regexp diff-list)
283 (setq diff3-job ediff-3way-job 283 (setq diff3-job ediff-3way-job
284 diff-program (if diff3-job ediff-diff3-program ediff-diff-program) 284 diff-program (if diff3-job ediff-diff3-program ediff-diff-program)
@@ -286,7 +286,7 @@ one optional arguments, diff-number to refine.")
286 ok-regexp (if diff3-job 286 ok-regexp (if diff3-job
287 ediff-diff3-ok-lines-regexp 287 ediff-diff3-ok-lines-regexp
288 ediff-diff-ok-lines-regexp)) 288 ediff-diff-ok-lines-regexp))
289 289
290 (ediff-message-if-verbose "Refining difference region %d ..." (1+ reg-num)) 290 (ediff-message-if-verbose "Refining difference region %d ..." (1+ reg-num))
291 (ediff-exec-process diff-program ediff-fine-diff-buffer 'synchronize 291 (ediff-exec-process diff-program ediff-fine-diff-buffer 'synchronize
292 diff-options 292 diff-options
@@ -298,12 +298,12 @@ one optional arguments, diff-number to refine.")
298 (if diff3-job 298 (if diff3-job
299 (if file-C file-C file-B)) 299 (if file-C file-C file-B))
300 ) ; exec process 300 ) ; exec process
301 301
302 (ediff-prepare-error-list ok-regexp ediff-fine-diff-buffer) 302 (ediff-prepare-error-list ok-regexp ediff-fine-diff-buffer)
303 (ediff-message-if-verbose 303 (ediff-message-if-verbose
304 "") 304 "")
305 ;; "Refining difference region %d ... done" (1+ reg-num)) 305 ;; "Refining difference region %d ... done" (1+ reg-num))
306 306
307 (setq diff-list 307 (setq diff-list
308 (if diff3-job 308 (if diff3-job
309 (ediff-extract-diffs3 309 (ediff-extract-diffs3
@@ -327,11 +327,11 @@ one optional arguments, diff-number to refine.")
327 (aset elt 5 nil)) 327 (aset elt 5 nil))
328 (cdr diff-list))) 328 (cdr diff-list)))
329 )) 329 ))
330 330
331 (ediff-convert-fine-diffs-to-overlays diff-list reg-num) 331 (ediff-convert-fine-diffs-to-overlays diff-list reg-num)
332 )) 332 ))
333 333
334 334
335(defun ediff-prepare-error-list (ok-regexp diff-buff) 335(defun ediff-prepare-error-list (ok-regexp diff-buff)
336 (or (ediff-buffer-live-p ediff-error-buffer) 336 (or (ediff-buffer-live-p ediff-error-buffer)
337 (setq ediff-error-buffer 337 (setq ediff-error-buffer
@@ -368,7 +368,7 @@ one optional arguments, diff-number to refine.")
368 (c-prev 1) 368 (c-prev 1)
369 diff-list shift-A shift-B 369 diff-list shift-A shift-B
370 ) 370 )
371 371
372 ;; diff list contains word numbers, unless changed later 372 ;; diff list contains word numbers, unless changed later
373 (setq diff-list (cons (if word-mode 'words 'points) 373 (setq diff-list (cons (if word-mode 'words 'points)
374 diff-list)) 374 diff-list))
@@ -380,7 +380,7 @@ one optional arguments, diff-number to refine.")
380 shift-B 380 shift-B
381 (ediff-overlay-start 381 (ediff-overlay-start
382 (ediff-get-value-according-to-buffer-type 'B bounds)))) 382 (ediff-get-value-according-to-buffer-type 'B bounds))))
383 383
384 ;; reset point in buffers A/B/C 384 ;; reset point in buffers A/B/C
385 (ediff-with-current-buffer A-buffer 385 (ediff-with-current-buffer A-buffer
386 (goto-char (if shift-A shift-A (point-min)))) 386 (goto-char (if shift-A shift-A (point-min))))
@@ -389,7 +389,7 @@ one optional arguments, diff-number to refine.")
389 (if (ediff-buffer-live-p C-buffer) 389 (if (ediff-buffer-live-p C-buffer)
390 (ediff-with-current-buffer C-buffer 390 (ediff-with-current-buffer C-buffer
391 (goto-char (point-min)))) 391 (goto-char (point-min))))
392 392
393 (ediff-with-current-buffer diff-buffer 393 (ediff-with-current-buffer diff-buffer
394 (goto-char (point-min)) 394 (goto-char (point-min))
395 (while (re-search-forward ediff-match-diff-line nil t) 395 (while (re-search-forward ediff-match-diff-line nil t)
@@ -423,13 +423,13 @@ one optional arguments, diff-number to refine.")
423 ;; (string-equal diff-type "c") 423 ;; (string-equal diff-type "c")
424 (setq a-end (1+ a-end) 424 (setq a-end (1+ a-end)
425 b-end (1+ b-end)))) 425 b-end (1+ b-end))))
426 426
427 (if (eq ediff-default-variant 'default-B) 427 (if (eq ediff-default-variant 'default-B)
428 (setq c-begin b-begin 428 (setq c-begin b-begin
429 c-end b-end) 429 c-end b-end)
430 (setq c-begin a-begin 430 (setq c-begin a-begin
431 c-end a-end)) 431 c-end a-end))
432 432
433 ;; compute main diff vector 433 ;; compute main diff vector
434 (if word-mode 434 (if word-mode
435 ;; make diff-list contain word numbers 435 ;; make diff-list contain word numbers
@@ -500,11 +500,11 @@ one optional arguments, diff-number to refine.")
500 nil ; dummy state of ancestor 500 nil ; dummy state of ancestor
501 ))) 501 )))
502 ))) 502 )))
503 503
504 ))) ; end ediff-with-current-buffer 504 ))) ; end ediff-with-current-buffer
505 diff-list 505 diff-list
506 )) 506 ))
507 507
508 508
509(defun ediff-convert-diffs-to-overlays (diff-list) 509(defun ediff-convert-diffs-to-overlays (diff-list)
510 (ediff-set-diff-overlays-in-one-buffer 'A diff-list) 510 (ediff-set-diff-overlays-in-one-buffer 'A diff-list)
@@ -530,7 +530,7 @@ one optional arguments, diff-number to refine.")
530 ))) 530 )))
531 (message "Processing difference regions ... done")) 531 (message "Processing difference regions ... done"))
532 532
533 533
534(defun ediff-set-diff-overlays-in-one-buffer (buf-type diff-list) 534(defun ediff-set-diff-overlays-in-one-buffer (buf-type diff-list)
535 (let* ((current-diff -1) 535 (let* ((current-diff -1)
536 (buff (ediff-get-buffer buf-type)) 536 (buff (ediff-get-buffer buf-type))
@@ -548,10 +548,10 @@ one optional arguments, diff-number to refine.")
548 548
549 (setq diff-list (cdr diff-list)) ; discard diff list type 549 (setq diff-list (cdr diff-list)) ; discard diff list type
550 (setq total-diffs (length diff-list)) 550 (setq total-diffs (length diff-list))
551 551
552 ;; shift, if necessary 552 ;; shift, if necessary
553 (ediff-with-current-buffer buff (setq pt-saved shift)) 553 (ediff-with-current-buffer buff (setq pt-saved shift))
554 554
555 (while diff-list 555 (while diff-list
556 (setq current-diff (1+ current-diff) 556 (setq current-diff (1+ current-diff)
557 list-element (car diff-list) 557 list-element (car diff-list)
@@ -565,7 +565,7 @@ one optional arguments, diff-number to refine.")
565 (t 7))) ; Ancestor 565 (t 7))) ; Ancestor
566 state-of-diff (aref list-element 8) 566 state-of-diff (aref list-element 8)
567 ) 567 )
568 568
569 (cond ((and (not (eq buf-type state-of-diff)) 569 (cond ((and (not (eq buf-type state-of-diff))
570 (not (eq buf-type 'Ancestor)) 570 (not (eq buf-type 'Ancestor))
571 (memq state-of-diff '(A B C))) 571 (memq state-of-diff '(A B C)))
@@ -574,7 +574,7 @@ one optional arguments, diff-number to refine.")
574 (setq state-of-diff (format "=diff(%S)" state-of-diff)) 574 (setq state-of-diff (format "=diff(%S)" state-of-diff))
575 ) 575 )
576 (t (setq state-of-diff nil))) 576 (t (setq state-of-diff nil)))
577 577
578 ;; Put overlays at appropriate places in buffer 578 ;; Put overlays at appropriate places in buffer
579 ;; convert word numbers to points, if necessary 579 ;; convert word numbers to points, if necessary
580 (if (eq diff-list-type 'words) 580 (if (eq diff-list-type 'words)
@@ -586,7 +586,7 @@ one optional arguments, diff-number to refine.")
586 (if (> begin end) (setq begin end)) 586 (if (> begin end) (setq begin end))
587 (setq pt-saved (ediff-with-current-buffer buff (point))))) 587 (setq pt-saved (ediff-with-current-buffer buff (point)))))
588 (setq overlay (ediff-make-bullet-proof-overlay begin end buff)) 588 (setq overlay (ediff-make-bullet-proof-overlay begin end buff))
589 589
590 (ediff-overlay-put overlay 'priority ediff-shadow-overlay-priority) 590 (ediff-overlay-put overlay 'priority ediff-shadow-overlay-priority)
591 (ediff-overlay-put overlay 'ediff-diff-num current-diff) 591 (ediff-overlay-put overlay 'ediff-diff-num current-diff)
592 (if (and (ediff-has-face-support-p) 592 (if (and (ediff-has-face-support-p)
@@ -609,7 +609,7 @@ one optional arguments, diff-number to refine.")
609 diff-list 609 diff-list
610 (cdr diff-list)) 610 (cdr diff-list))
611 ) ; while 611 ) ; while
612 612
613 (set (ediff-get-symbol-from-alist buf-type ediff-difference-vector-alist) 613 (set (ediff-get-symbol-from-alist buf-type ediff-difference-vector-alist)
614 (vconcat diff-overlay-list)) 614 (vconcat diff-overlay-list))
615 )) 615 ))
@@ -620,14 +620,14 @@ one optional arguments, diff-number to refine.")
620;; if `flag' is 'skip then don't compute fine diffs for this region. 620;; if `flag' is 'skip then don't compute fine diffs for this region.
621(defun ediff-make-fine-diffs (&optional n flag) 621(defun ediff-make-fine-diffs (&optional n flag)
622 (or n (setq n ediff-current-difference)) 622 (or n (setq n ediff-current-difference))
623 623
624 (if (< ediff-number-of-differences 1) 624 (if (< ediff-number-of-differences 1)
625 (error ediff-NO-DIFFERENCES)) 625 (error ediff-NO-DIFFERENCES))
626 626
627 (if ediff-word-mode 627 (if ediff-word-mode
628 (setq flag 'skip 628 (setq flag 'skip
629 ediff-auto-refine 'nix)) 629 ediff-auto-refine 'nix))
630 630
631 (or (< n 0) 631 (or (< n 0)
632 (>= n ediff-number-of-differences) 632 (>= n ediff-number-of-differences)
633 ;; n is within the range 633 ;; n is within the range
@@ -642,7 +642,7 @@ one optional arguments, diff-number to refine.")
642 (whitespace-B (ediff-whitespace-diff-region-p n 'B)) 642 (whitespace-B (ediff-whitespace-diff-region-p n 'B))
643 (whitespace-C (ediff-whitespace-diff-region-p n 'C)) 643 (whitespace-C (ediff-whitespace-diff-region-p n 'C))
644 cumulative-fine-diff-length) 644 cumulative-fine-diff-length)
645 645
646 (cond ;; If one of the regions is empty (or 2 in 3way comparison) 646 (cond ;; If one of the regions is empty (or 2 in 3way comparison)
647 ;; then don't refine. 647 ;; then don't refine.
648 ;; If the region happens to be entirely whitespace or empty then 648 ;; If the region happens to be entirely whitespace or empty then
@@ -706,7 +706,7 @@ one optional arguments, diff-number to refine.")
706 ediff-control-buffer) 706 ediff-control-buffer)
707 (setq file-A 707 (setq file-A
708 (ediff-make-temp-file tmp-buffer "fineDiffA" file-A)) 708 (ediff-make-temp-file tmp-buffer "fineDiffA" file-A))
709 709
710 (ediff-wordify 710 (ediff-wordify
711 (ediff-get-diff-posn 'B 'beg n) 711 (ediff-get-diff-posn 'B 'beg n)
712 (ediff-get-diff-posn 'B 'end n) 712 (ediff-get-diff-posn 'B 'end n)
@@ -715,7 +715,7 @@ one optional arguments, diff-number to refine.")
715 ediff-control-buffer) 715 ediff-control-buffer)
716 (setq file-B 716 (setq file-B
717 (ediff-make-temp-file tmp-buffer "fineDiffB" file-B)) 717 (ediff-make-temp-file tmp-buffer "fineDiffB" file-B))
718 718
719 (if ediff-3way-job 719 (if ediff-3way-job
720 (progn 720 (progn
721 (ediff-wordify 721 (ediff-wordify
@@ -727,12 +727,12 @@ one optional arguments, diff-number to refine.")
727 (setq file-C 727 (setq file-C
728 (ediff-make-temp-file 728 (ediff-make-temp-file
729 tmp-buffer "fineDiffC" file-C)))) 729 tmp-buffer "fineDiffC" file-C))))
730 730
731 ;; save temp file names. 731 ;; save temp file names.
732 (setq ediff-temp-file-A file-A 732 (setq ediff-temp-file-A file-A
733 ediff-temp-file-B file-B 733 ediff-temp-file-B file-B
734 ediff-temp-file-C file-C) 734 ediff-temp-file-C file-C)
735 735
736 ;; set the new vector of fine diffs, if none exists 736 ;; set the new vector of fine diffs, if none exists
737 (cond ((and ediff-3way-job whitespace-A) 737 (cond ((and ediff-3way-job whitespace-A)
738 (ediff-setup-fine-diff-regions nil file-B file-C n)) 738 (ediff-setup-fine-diff-regions nil file-B file-C n))
@@ -745,7 +745,7 @@ one optional arguments, diff-number to refine.")
745 (ediff-setup-fine-diff-regions file-A file-B nil n)) 745 (ediff-setup-fine-diff-regions file-A file-B nil n))
746 (t 746 (t
747 (ediff-setup-fine-diff-regions file-A file-B file-C n))) 747 (ediff-setup-fine-diff-regions file-A file-B file-C n)))
748 748
749 (setq cumulative-fine-diff-length 749 (setq cumulative-fine-diff-length
750 (+ (length (ediff-get-fine-diff-vector n 'A)) 750 (+ (length (ediff-get-fine-diff-vector n 'A))
751 (length (ediff-get-fine-diff-vector n 'B)) 751 (length (ediff-get-fine-diff-vector n 'B))
@@ -753,7 +753,7 @@ one optional arguments, diff-number to refine.")
753 (if (and file-C (not ediff-merge-job)) 753 (if (and file-C (not ediff-merge-job))
754 (length (ediff-get-fine-diff-vector n 'C)) 754 (length (ediff-get-fine-diff-vector n 'C))
755 0))) 755 0)))
756 756
757 (cond ((or 757 (cond ((or
758 ;; all regions are white space 758 ;; all regions are white space
759 (and whitespace-A whitespace-B whitespace-C) 759 (and whitespace-A whitespace-B whitespace-C)
@@ -781,7 +781,7 @@ one optional arguments, diff-number to refine.")
781 ) ; end cond 781 ) ; end cond
782 (ediff-set-fine-diff-properties n) 782 (ediff-set-fine-diff-properties n)
783 ))) 783 )))
784 784
785;; Interface to ediff-make-fine-diffs. Checks for auto-refine limit, etc. 785;; Interface to ediff-make-fine-diffs. Checks for auto-refine limit, etc.
786(defun ediff-install-fine-diff-if-necessary (n) 786(defun ediff-install-fine-diff-if-necessary (n)
787 (cond ((and (eq ediff-auto-refine 'on) 787 (cond ((and (eq ediff-auto-refine 'on)
@@ -797,12 +797,12 @@ one optional arguments, diff-number to refine.")
797 (ediff-get-diff-posn 'B 'beg n)))) 797 (ediff-get-diff-posn 'B 'beg n))))
798 (ediff-make-fine-diffs n 'noforce) 798 (ediff-make-fine-diffs n 'noforce)
799 (ediff-make-fine-diffs n 'skip))) 799 (ediff-make-fine-diffs n 'skip)))
800 800
801 ;; highlight iff fine diffs already exist 801 ;; highlight iff fine diffs already exist
802 ((eq ediff-auto-refine 'off) 802 ((eq ediff-auto-refine 'off)
803 (ediff-make-fine-diffs n 'skip)))) 803 (ediff-make-fine-diffs n 'skip))))
804 804
805 805
806;; if fine diff vector is not set for diff N, then do nothing 806;; if fine diff vector is not set for diff N, then do nothing
807(defun ediff-set-fine-diff-properties (n &optional default) 807(defun ediff-set-fine-diff-properties (n &optional default)
808 (or (not (ediff-has-face-support-p)) 808 (or (not (ediff-has-face-support-p))
@@ -814,7 +814,7 @@ one optional arguments, diff-number to refine.")
814 (ediff-set-fine-diff-properties-in-one-buffer 'B n default) 814 (ediff-set-fine-diff-properties-in-one-buffer 'B n default)
815 (if ediff-3way-job 815 (if ediff-3way-job
816 (ediff-set-fine-diff-properties-in-one-buffer 'C n default))))) 816 (ediff-set-fine-diff-properties-in-one-buffer 'C n default)))))
817 817
818(defun ediff-set-fine-diff-properties-in-one-buffer (buf-type 818(defun ediff-set-fine-diff-properties-in-one-buffer (buf-type
819 n &optional default) 819 n &optional default)
820 (let ((fine-diff-vector (ediff-get-fine-diff-vector n buf-type)) 820 (let ((fine-diff-vector (ediff-get-fine-diff-vector n buf-type))
@@ -836,7 +836,7 @@ one optional arguments, diff-number to refine.")
836 (ediff-set-overlay-face overl face) 836 (ediff-set-overlay-face overl face)
837 (ediff-overlay-put overl 'priority priority)) 837 (ediff-overlay-put overl 'priority priority))
838 fine-diff-vector))) 838 fine-diff-vector)))
839 839
840;; Set overlays over the regions that denote delimiters 840;; Set overlays over the regions that denote delimiters
841(defun ediff-set-fine-overlays-for-combined-merge (diff-list reg-num) 841(defun ediff-set-fine-overlays-for-combined-merge (diff-list reg-num)
842 (let (overlay overlay-list) 842 (let (overlay overlay-list)
@@ -856,8 +856,8 @@ delimiter regions"))
856 (ediff-set-fine-diff-vector 856 (ediff-set-fine-diff-vector
857 reg-num 'C (apply 'vector overlay-list)) 857 reg-num 'C (apply 'vector overlay-list))
858 )) 858 ))
859 859
860 860
861;; Convert diff list to overlays for a given DIFF-REGION 861;; Convert diff list to overlays for a given DIFF-REGION
862;; in buffer of type BUF-TYPE 862;; in buffer of type BUF-TYPE
863(defun ediff-set-fine-overlays-in-one-buffer (buf-type diff-list region-num) 863(defun ediff-set-fine-overlays-in-one-buffer (buf-type diff-list region-num)
@@ -871,7 +871,7 @@ delimiter regions"))
871 (ediff-clear-fine-differences-in-one-buffer region-num buf-type) 871 (ediff-clear-fine-differences-in-one-buffer region-num buf-type)
872 (setq diff-list (cdr diff-list)) ; discard list type (words or points) 872 (setq diff-list (cdr diff-list)) ; discard list type (words or points)
873 (ediff-with-current-buffer buff (goto-char reg-start)) 873 (ediff-with-current-buffer buff (goto-char reg-start))
874 874
875 ;; if it is a combined merge then set overlays in buff C specially 875 ;; if it is a combined merge then set overlays in buff C specially
876 (if (and ediff-merge-job (eq buf-type 'C) 876 (if (and ediff-merge-job (eq buf-type 'C)
877 (setq combined-merge-diff-list 877 (setq combined-merge-diff-list
@@ -897,7 +897,7 @@ delimiter regions"))
897 (setq overlay (ediff-make-bullet-proof-overlay begin end buff)) 897 (setq overlay (ediff-make-bullet-proof-overlay begin end buff))
898 ;; record all overlays for this difference region 898 ;; record all overlays for this difference region
899 (setq diff-overlay-list (nconc diff-overlay-list (list overlay)))) 899 (setq diff-overlay-list (nconc diff-overlay-list (list overlay))))
900 900
901 (setq diff-list (cdr diff-list)) 901 (setq diff-list (cdr diff-list))
902 ) ; while 902 ) ; while
903 ;; convert the list of difference information into a vector 903 ;; convert the list of difference information into a vector
@@ -964,7 +964,7 @@ delimiter regions"))
964 (anc-prev 1) 964 (anc-prev 1)
965 diff-list shift-A shift-B shift-C 965 diff-list shift-A shift-B shift-C
966 ) 966 )
967 967
968 ;; diff list contains word numbers or points, depending on word-mode 968 ;; diff list contains word numbers or points, depending on word-mode
969 (setq diff-list (cons (if word-mode 'words 'points) 969 (setq diff-list (cons (if word-mode 'words 'points)
970 diff-list)) 970 diff-list))
@@ -979,7 +979,7 @@ delimiter regions"))
979 (if three-way-comp 979 (if three-way-comp
980 (ediff-overlay-start 980 (ediff-overlay-start
981 (ediff-get-value-according-to-buffer-type 'C bounds))))) 981 (ediff-get-value-according-to-buffer-type 'C bounds)))))
982 982
983 ;; reset point in buffers A, B, C 983 ;; reset point in buffers A, B, C
984 (ediff-with-current-buffer A-buffer 984 (ediff-with-current-buffer A-buffer
985 (goto-char (if shift-A shift-A (point-min)))) 985 (goto-char (if shift-A shift-A (point-min))))
@@ -991,7 +991,7 @@ delimiter regions"))
991 (if (ediff-buffer-live-p anc-buffer) 991 (if (ediff-buffer-live-p anc-buffer)
992 (ediff-with-current-buffer anc-buffer 992 (ediff-with-current-buffer anc-buffer
993 (goto-char (point-min)))) 993 (goto-char (point-min))))
994 994
995 (ediff-with-current-buffer diff-buffer 995 (ediff-with-current-buffer diff-buffer
996 (goto-char (point-min)) 996 (goto-char (point-min))
997 (while (re-search-forward ediff-match-diff3-line nil t) 997 (while (re-search-forward ediff-match-diff3-line nil t)
@@ -1023,7 +1023,7 @@ delimiter regions"))
1023 b-begin-pt b-end-pt 1023 b-begin-pt b-end-pt
1024 c-begin-pt c-end-pt 1024 c-begin-pt c-end-pt
1025 anc-begin-pt anc-end-pt) 1025 anc-begin-pt anc-end-pt)
1026 1026
1027 (setq state-of-ancestor 1027 (setq state-of-ancestor
1028 (= c-or-anc-begin c-or-anc-end)) 1028 (= c-or-anc-begin c-or-anc-end))
1029 1029
@@ -1036,7 +1036,7 @@ delimiter regions"))
1036 (t 1036 (t
1037 (setq c-begin a-begin 1037 (setq c-begin a-begin
1038 c-end a-end))) 1038 c-end a-end)))
1039 1039
1040 ;; compute main diff vector 1040 ;; compute main diff vector
1041 (if word-mode 1041 (if word-mode
1042 ;; make diff-list contain word numbers 1042 ;; make diff-list contain word numbers
@@ -1105,11 +1105,11 @@ delimiter regions"))
1105 ))) 1105 )))
1106 ))) 1106 )))
1107 )) 1107 ))
1108 1108
1109 ))) ; end ediff-with-current-buffer 1109 ))) ; end ediff-with-current-buffer
1110 diff-list 1110 diff-list
1111 )) 1111 ))
1112 1112
1113;; Generate the difference vector and overlays for three files 1113;; Generate the difference vector and overlays for three files
1114;; File-C is either the third file to compare (in case of 3-way comparison) 1114;; File-C is either the third file to compare (in case of 3-way comparison)
1115;; or it is the ancestor file. 1115;; or it is the ancestor file.
@@ -1117,11 +1117,11 @@ delimiter regions"))
1117 (or (ediff-buffer-live-p ediff-diff-buffer) 1117 (or (ediff-buffer-live-p ediff-diff-buffer)
1118 (setq ediff-diff-buffer 1118 (setq ediff-diff-buffer
1119 (get-buffer-create (ediff-unique-buffer-name "*ediff-diff" "*")))) 1119 (get-buffer-create (ediff-unique-buffer-name "*ediff-diff" "*"))))
1120 1120
1121 (message "Computing differences ...") 1121 (message "Computing differences ...")
1122 (ediff-exec-process ediff-diff3-program ediff-diff-buffer 'synchronize 1122 (ediff-exec-process ediff-diff3-program ediff-diff-buffer 'synchronize
1123 ediff-diff3-options file-A file-B file-C) 1123 ediff-diff3-options file-A file-B file-C)
1124 1124
1125 (ediff-prepare-error-list ediff-diff3-ok-lines-regexp ediff-diff-buffer) 1125 (ediff-prepare-error-list ediff-diff3-ok-lines-regexp ediff-diff-buffer)
1126 ;;(message "Computing differences ... done") 1126 ;;(message "Computing differences ... done")
1127 (ediff-convert-diffs-to-overlays 1127 (ediff-convert-diffs-to-overlays
@@ -1129,7 +1129,7 @@ delimiter regions"))
1129 ediff-diff-buffer 1129 ediff-diff-buffer
1130 ediff-word-mode ediff-3way-comparison-job ediff-narrow-bounds) 1130 ediff-word-mode ediff-3way-comparison-job ediff-narrow-bounds)
1131 )) 1131 ))
1132 1132
1133 1133
1134;; Execute PROGRAM asynchronously, unless OS/2, Windows-*, or DOS, or unless 1134;; Execute PROGRAM asynchronously, unless OS/2, Windows-*, or DOS, or unless
1135;; SYNCH is non-nil. BUFFER must be a buffer object, and must be alive. The 1135;; SYNCH is non-nil. BUFFER must be a buffer object, and must be alive. The
@@ -1176,7 +1176,7 @@ delimiter regions"))
1176 (set-process-filter proc 'ediff-process-filter) 1176 (set-process-filter proc 'ediff-process-filter)
1177 ))) 1177 )))
1178 (store-match-data data)))) 1178 (store-match-data data))))
1179 1179
1180;; This is shell-command-filter from simple.el in Emacs. 1180;; This is shell-command-filter from simple.el in Emacs.
1181;; Copied here because XEmacs doesn't have it. 1181;; Copied here because XEmacs doesn't have it.
1182(defun ediff-process-filter (proc string) 1182(defun ediff-process-filter (proc string)
@@ -1200,7 +1200,7 @@ delimiter regions"))
1200 (if opoint 1200 (if opoint
1201 (goto-char opoint)) 1201 (goto-char opoint))
1202 (set-buffer obuf)))) 1202 (set-buffer obuf))))
1203 1203
1204;; like shell-command-sentinel but doesn't print an exit status message 1204;; like shell-command-sentinel but doesn't print an exit status message
1205;; we do this because diff always exits with status 1, if diffs are found 1205;; we do this because diff always exits with status 1, if diffs are found
1206;; so shell-command-sentinel displays a confusing message to the user 1206;; so shell-command-sentinel displays a confusing message to the user
@@ -1212,7 +1212,7 @@ delimiter regions"))
1212 (set-buffer (process-buffer process)) 1212 (set-buffer (process-buffer process))
1213 (setq mode-line-process nil)) 1213 (setq mode-line-process nil))
1214 (delete-process process)))) 1214 (delete-process process))))
1215 1215
1216 1216
1217;;; Word functions used to refine the current diff 1217;;; Word functions used to refine the current diff
1218 1218
@@ -1297,14 +1297,14 @@ arguments to `skip-chars-forward'."
1297 (goto-char (point-min)) 1297 (goto-char (point-min))
1298 (skip-chars-forward ediff-whitespace) 1298 (skip-chars-forward ediff-whitespace)
1299 (delete-region (point-min) (point)) 1299 (delete-region (point-min) (point))
1300 1300
1301 (while (not (eobp)) 1301 (while (not (eobp))
1302 (funcall forward-word-function) 1302 (funcall forward-word-function)
1303 (setq sv-point (point)) 1303 (setq sv-point (point))
1304 (skip-chars-forward ediff-whitespace) 1304 (skip-chars-forward ediff-whitespace)
1305 (delete-region sv-point (point)) 1305 (delete-region sv-point (point))
1306 (insert "\n"))))) 1306 (insert "\n")))))
1307 1307
1308;; copy string specified as BEG END from IN-BUF to OUT-BUF 1308;; copy string specified as BEG END from IN-BUF to OUT-BUF
1309(defun ediff-copy-to-buffer (beg end in-buffer out-buffer) 1309(defun ediff-copy-to-buffer (beg end in-buffer out-buffer)
1310 (with-current-buffer out-buffer 1310 (with-current-buffer out-buffer
diff --git a/lisp/ediff-help.el b/lisp/ediff-help.el
index 7d3234db280..640b9e5ec2e 100644
--- a/lisp/ediff-help.el
+++ b/lisp/ediff-help.el
@@ -24,7 +24,7 @@
24;;; Commentary: 24;;; Commentary:
25 25
26;;; Code: 26;;; Code:
27 27
28(provide 'ediff-help) 28(provide 'ediff-help)
29 29
30;; Compiler pacifier start 30;; Compiler pacifier start
@@ -47,9 +47,9 @@
47 "The head of the full help message.") 47 "The head of the full help message.")
48(defconst ediff-long-help-message-tail 48(defconst ediff-long-help-message-tail
49 "=====================|===========================|============================= 49 "=====================|===========================|=============================
50 R -show registry | = -compare regions | M -show session group 50 R -show registry | = -compare regions | M -show session group
51 D -diff output | E -browse Ediff manual| G -send bug report 51 D -diff output | E -browse Ediff manual| G -send bug report
52 i -status info | ? -help off | z/q -suspend/quit 52 i -status info | ? -help off | z/q -suspend/quit
53------------------------------------------------------------------------------- 53-------------------------------------------------------------------------------
54For help on a specific command: Click Button 2 over it; or 54For help on a specific command: Click Button 2 over it; or
55 Put the cursor over it and type RET." 55 Put the cursor over it and type RET."
@@ -59,69 +59,69 @@ For help on a specific command: Click Button 2 over it; or
59 " 59 "
60p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y 60p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y
61n,SPC -next diff | h -hilighting | rx -restore buf X's old diff 61n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
62 j -jump to diff | @ -auto-refinement | * -refine current region 62 j -jump to diff | @ -auto-refinement | * -refine current region
63 gx -goto X's point| | ! -update diff regions 63 gx -goto X's point| | ! -update diff regions
64 C-l -recenter | ## -ignore whitespace | 64 C-l -recenter | ## -ignore whitespace |
65 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X 65 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
66 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output 66 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output
67 ~ -rotate buffers| m -wide display | 67 ~ -rotate buffers| m -wide display |
68" 68"
69 "Help message usually used for 3-way comparison. 69 "Help message usually used for 3-way comparison.
70Normally, not a user option. See `ediff-help-message' for details.") 70Normally, not a user option. See `ediff-help-message' for details.")
71 71
72(defconst ediff-long-help-message-compare2 72(defconst ediff-long-help-message-compare2
73 " 73 "
74p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A 74p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A
75n,SPC -next diff | h -hilighting | rx -restore buf X's old diff 75n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
76 j -jump to diff | @ -auto-refinement | * -refine current region 76 j -jump to diff | @ -auto-refinement | * -refine current region
77 gx -goto X's point| | ! -update diff regions 77 gx -goto X's point| | ! -update diff regions
78 C-l -recenter | ## -ignore whitespace | 78 C-l -recenter | ## -ignore whitespace |
79 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X 79 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
80 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output 80 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output
81 ~ -swap variants | m -wide display | 81 ~ -swap variants | m -wide display |
82" 82"
83 "Help message usually used for 2-way comparison. 83 "Help message usually used for 2-way comparison.
84Normally, not a user option. See `ediff-help-message' for details.") 84Normally, not a user option. See `ediff-help-message' for details.")
85 85
86(defconst ediff-long-help-message-narrow2 86(defconst ediff-long-help-message-narrow2
87 " 87 "
88p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A 88p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A
89n,SPC -next diff | h -hilighting | rx -restore buf X's old diff 89n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
90 j -jump to diff | @ -auto-refinement | * -refine current region 90 j -jump to diff | @ -auto-refinement | * -refine current region
91 gx -goto X's point| % -narrow/widen buffs | ! -update diff regions 91 gx -goto X's point| % -narrow/widen buffs | ! -update diff regions
92 C-l -recenter | ## -ignore whitespace | 92 C-l -recenter | ## -ignore whitespace |
93 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X 93 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
94 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output 94 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output
95 ~ -swap variants | m -wide display | 95 ~ -swap variants | m -wide display |
96" 96"
97 "Help message when comparing windows or regions line-by-line. 97 "Help message when comparing windows or regions line-by-line.
98Normally, not a user option. See `ediff-help-message' for details.") 98Normally, not a user option. See `ediff-help-message' for details.")
99 99
100(defconst ediff-long-help-message-word-mode 100(defconst ediff-long-help-message-word-mode
101 " 101 "
102p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y 102p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y
103n,SPC -next diff | h -hilighting | rx -restore buf X's old diff 103n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
104 j -jump to diff | | 104 j -jump to diff | |
105 gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs 105 gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs
106 C-l -recenter | | 106 C-l -recenter | |
107 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X 107 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
108 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output 108 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output
109 ~ -swap variants | m -wide display | 109 ~ -swap variants | m -wide display |
110" 110"
111 "Help message when comparing windows or regions word-by-word. 111 "Help message when comparing windows or regions word-by-word.
112Normally, not a user option. See `ediff-help-message' for details.") 112Normally, not a user option. See `ediff-help-message' for details.")
113 113
114(defconst ediff-long-help-message-merge 114(defconst ediff-long-help-message-merge
115 " 115 "
116p,DEL -previous diff | | -vert/horiz split | x -copy buf X's region to C 116p,DEL -previous diff | | -vert/horiz split | x -copy buf X's region to C
117n,SPC -next diff | h -hilighting | r -restore buf C's old diff 117n,SPC -next diff | h -hilighting | r -restore buf C's old diff
118 j -jump to diff | @ -auto-refinement | * -refine current region 118 j -jump to diff | @ -auto-refinement | * -refine current region
119 gx -goto X's point| ## -ignore whitespace | ! -update diff regions 119 gx -goto X's point| ## -ignore whitespace | ! -update diff regions
120 C-l -recenter | #f/#h -focus/hide regions | + -combine diff regions 120 C-l -recenter | #f/#h -focus/hide regions | + -combine diff regions
121 v/V -scroll up/dn | X -read-only in buf X | wx -save buf X 121 v/V -scroll up/dn | X -read-only in buf X | wx -save buf X
122 </> -scroll lt/rt | m -wide display | wd -save diff output 122 </> -scroll lt/rt | m -wide display | wd -save diff output
123 ~ -swap variants | s -shrink window C | / -show ancestor buff 123 ~ -swap variants | s -shrink window C | / -show ancestor buff
124 | $$ -show clashes only | & -merge w/new default 124 | $$ -show clashes only | & -merge w/new default
125 | $* -skip changed regions | 125 | $* -skip changed regions |
126" 126"
127 "Help message for merge sessions. 127 "Help message for merge sessions.
@@ -130,14 +130,14 @@ Normally, not a user option. See `ediff-help-message' for details.")
130;; The actual long help message. 130;; The actual long help message.
131(ediff-defvar-local ediff-long-help-message "" 131(ediff-defvar-local ediff-long-help-message ""
132 "Normally, not a user option. See `ediff-help-message' for details.") 132 "Normally, not a user option. See `ediff-help-message' for details.")
133 133
134(defconst ediff-brief-message-string 134(defconst ediff-brief-message-string
135 " ? -quick help " 135 " ? -quick help "
136 "Contents of the brief help message.") 136 "Contents of the brief help message.")
137;; The actual brief help message 137;; The actual brief help message
138(ediff-defvar-local ediff-brief-help-message "" 138(ediff-defvar-local ediff-brief-help-message ""
139 "Normally, not a user option. See `ediff-help-message' for details.") 139 "Normally, not a user option. See `ediff-help-message' for details.")
140 140
141(ediff-defvar-local ediff-brief-help-message-function nil 141(ediff-defvar-local ediff-brief-help-message-function nil
142 "The brief help message that the user can customize. 142 "The brief help message that the user can customize.
143If the user sets this to a parameter-less function, Ediff will use it to 143If the user sets this to a parameter-less function, Ediff will use it to
@@ -157,7 +157,7 @@ See `ediff-brief-help-message-function' for more.")
157Normally, the user shouldn't touch this. However, if you want Ediff to 157Normally, the user shouldn't touch this. However, if you want Ediff to
158start up with different help messages for different jobs, you can change 158start up with different help messages for different jobs, you can change
159the value of this variable and the variables `ediff-help-message-*' in 159the value of this variable and the variables `ediff-help-message-*' in
160`ediff-startup-hook'.") 160`ediff-startup-hook'.")
161 161
162 162
163;; the keymap that defines clicks over the quick help regions 163;; the keymap that defines clicks over the quick help regions
@@ -199,12 +199,12 @@ the value of this variable and the variables `ediff-help-message-*' in
199 (overlay-get elt 'ediff-help-info)) 199 (overlay-get elt 'ediff-help-info))
200 (overlays-at pos)))) 200 (overlays-at pos))))
201 ) 201 )
202 202
203 (if (not (stringp cmd)) 203 (if (not (stringp cmd))
204 (error "Hmm... I don't see an Ediff command around here...")) 204 (error "Hmm... I don't see an Ediff command around here..."))
205 205
206 (ediff-documentation "Quick Help Commands") 206 (ediff-documentation "Quick Help Commands")
207 207
208 (let (case-fold-search) 208 (let (case-fold-search)
209 (cond ((string= cmd "?") (re-search-forward "^`\\?'")) 209 (cond ((string= cmd "?") (re-search-forward "^`\\?'"))
210 ((string= cmd "G") (re-search-forward "^`G'")) 210 ((string= cmd "G") (re-search-forward "^`G'"))
@@ -260,7 +260,7 @@ the value of this variable and the variables `ediff-help-message-*' in
260 (next-line 1)) 260 (next-line 1))
261 (end-of-line) 261 (end-of-line)
262 (current-column))) 262 (current-column)))
263 263
264 264
265(defun ediff-indent-help-message () 265(defun ediff-indent-help-message ()
266 (let* ((shift (/ (max 0 (- (window-width (selected-window)) 266 (let* ((shift (/ (max 0 (- (window-width (selected-window))
@@ -273,7 +273,7 @@ the value of this variable and the variables `ediff-help-message-*' in
273 (insert str) 273 (insert str)
274 (beginning-of-line) 274 (beginning-of-line)
275 (forward-line 1))))) 275 (forward-line 1)))))
276 276
277 277
278;; compose the help message as a string 278;; compose the help message as a string
279(defun ediff-set-help-message () 279(defun ediff-set-help-message ()
@@ -282,7 +282,7 @@ the value of this variable and the variables `ediff-help-message-*' in
282 (or (symbolp ediff-long-help-message-function) 282 (or (symbolp ediff-long-help-message-function)
283 (consp ediff-long-help-message-function))) 283 (consp ediff-long-help-message-function)))
284 (funcall ediff-long-help-message-function)) 284 (funcall ediff-long-help-message-function))
285 (ediff-word-mode 285 (ediff-word-mode
286 (concat ediff-long-help-message-head 286 (concat ediff-long-help-message-head
287 ediff-long-help-message-word-mode 287 ediff-long-help-message-word-mode
288 ediff-long-help-message-tail)) 288 ediff-long-help-message-tail))
@@ -290,7 +290,7 @@ the value of this variable and the variables `ediff-help-message-*' in
290 (concat ediff-long-help-message-head 290 (concat ediff-long-help-message-head
291 ediff-long-help-message-narrow2 291 ediff-long-help-message-narrow2
292 ediff-long-help-message-tail)) 292 ediff-long-help-message-tail))
293 (ediff-merge-job 293 (ediff-merge-job
294 (concat ediff-long-help-message-head 294 (concat ediff-long-help-message-head
295 ediff-long-help-message-merge 295 ediff-long-help-message-merge
296 ediff-long-help-message-tail)) 296 ediff-long-help-message-tail))
@@ -298,11 +298,11 @@ the value of this variable and the variables `ediff-help-message-*' in
298 (concat ediff-long-help-message-head 298 (concat ediff-long-help-message-head
299 ediff-long-help-message-compare3 299 ediff-long-help-message-compare3
300 ediff-long-help-message-tail)) 300 ediff-long-help-message-tail))
301 (t 301 (t
302 (concat ediff-long-help-message-head 302 (concat ediff-long-help-message-head
303 ediff-long-help-message-compare2 303 ediff-long-help-message-compare2
304 ediff-long-help-message-tail)))) 304 ediff-long-help-message-tail))))
305 (setq ediff-brief-help-message 305 (setq ediff-brief-help-message
306 (cond ((and ediff-brief-help-message-function 306 (cond ((and ediff-brief-help-message-function
307 (or (symbolp ediff-brief-help-message-function) 307 (or (symbolp ediff-brief-help-message-function)
308 (consp ediff-brief-help-message-function))) 308 (consp ediff-brief-help-message-function)))
diff --git a/lisp/ediff-hook.el b/lisp/ediff-hook.el
index f1be60e424b..e8cf252f99b 100644
--- a/lisp/ediff-hook.el
+++ b/lisp/ediff-hook.el
@@ -57,7 +57,7 @@
57(defmacro ediff-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form) 57(defmacro ediff-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form)
58 (if (string-match "XEmacs" emacs-version) 58 (if (string-match "XEmacs" emacs-version)
59 xemacs-form emacs-form)) 59 xemacs-form emacs-form))
60 60
61;; This autoload is useless in Emacs because ediff-hook.el is dumped with 61;; This autoload is useless in Emacs because ediff-hook.el is dumped with
62;; emacs, but it is needed in XEmacs 62;; emacs, but it is needed in XEmacs
63;;;###autoload 63;;;###autoload
@@ -147,12 +147,12 @@
147 :selected (if (featurep 'ediff-tbar) 147 :selected (if (featurep 'ediff-tbar)
148 (ediff-use-toolbar-p))] 148 (ediff-use-toolbar-p))]
149 )) 149 ))
150 150
151 ;; put these menus before Object-Oriented-Browser in Tools menu 151 ;; put these menus before Object-Oriented-Browser in Tools menu
152 (if (and (featurep 'menubar) (not (featurep 'infodock)) 152 (if (and (featurep 'menubar) (not (featurep 'infodock))
153 (not (featurep 'ediff-hook))) 153 (not (featurep 'ediff-hook)))
154 (ediff-xemacs-init-menus))) 154 (ediff-xemacs-init-menus)))
155 155
156 ;; Emacs--only if menu-bar is loaded 156 ;; Emacs--only if menu-bar is loaded
157 (if (featurep 'menu-bar) 157 (if (featurep 'menu-bar)
158 (progn 158 (progn
@@ -164,7 +164,7 @@
164 (defvar menu-bar-epatch-menu (make-sparse-keymap "Apply Patch")) 164 (defvar menu-bar-epatch-menu (make-sparse-keymap "Apply Patch"))
165 (fset 'menu-bar-epatch-menu (symbol-value 'menu-bar-epatch-menu)) 165 (fset 'menu-bar-epatch-menu (symbol-value 'menu-bar-epatch-menu))
166 (defvar menu-bar-ediff-merge-menu (make-sparse-keymap "Merge")) 166 (defvar menu-bar-ediff-merge-menu (make-sparse-keymap "Merge"))
167 (fset 'menu-bar-ediff-merge-menu 167 (fset 'menu-bar-ediff-merge-menu
168 (symbol-value 'menu-bar-ediff-merge-menu)) 168 (symbol-value 'menu-bar-ediff-merge-menu))
169 (defvar menu-bar-ediff-menu (make-sparse-keymap "Compare")) 169 (defvar menu-bar-ediff-menu (make-sparse-keymap "Compare"))
170 (fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu)) 170 (fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu))
@@ -222,7 +222,7 @@
222 . ediff-merge-directories-with-ancestor)) 222 . ediff-merge-directories-with-ancestor))
223 (define-key menu-bar-ediff-merge-menu [ediff-merge-directories] 223 (define-key menu-bar-ediff-merge-menu [ediff-merge-directories]
224 '("Directories..." . ediff-merge-directories)) 224 '("Directories..." . ediff-merge-directories))
225 (define-key 225 (define-key
226 menu-bar-ediff-merge-menu [separator-ediff-merge-dirs] '("--")) 226 menu-bar-ediff-merge-menu [separator-ediff-merge-dirs] '("--"))
227 (define-key 227 (define-key
228 menu-bar-ediff-merge-menu [ediff-merge-buffers-with-ancestor] 228 menu-bar-ediff-merge-menu [ediff-merge-buffers-with-ancestor]
@@ -251,7 +251,7 @@
251 (define-key menu-bar-ediff-misc-menu [ediff-doc] 251 (define-key menu-bar-ediff-misc-menu [ediff-doc]
252 '("Ediff Manual..." . ediff-documentation)) 252 '("Ediff Manual..." . ediff-documentation))
253 ) 253 )
254 254
255 ) ; emacs case 255 ) ; emacs case
256 ) ; ediff-cond-compile-for-xemacs-or-emacs 256 ) ; ediff-cond-compile-for-xemacs-or-emacs
257 257
@@ -273,13 +273,13 @@
273 (autoload 'ediff-revision "ediff" "Compare versions of a file" t) 273 (autoload 'ediff-revision "ediff" "Compare versions of a file" t)
274 274
275 ;; compare regions and windows 275 ;; compare regions and windows
276 (autoload 'ediff-windows-wordwise 276 (autoload 'ediff-windows-wordwise
277 "ediff" "Compare two windows word-by-word." t) 277 "ediff" "Compare two windows word-by-word." t)
278 (autoload 'ediff-regions-wordwise 278 (autoload 'ediff-regions-wordwise
279 "ediff" "Compare two regions word-by-word." t) 279 "ediff" "Compare two regions word-by-word." t)
280 (autoload 'ediff-windows-linewise 280 (autoload 'ediff-windows-linewise
281 "ediff" "Compare two windows line-by-line." t) 281 "ediff" "Compare two windows line-by-line." t)
282 (autoload 'ediff-regions-linewise 282 (autoload 'ediff-regions-linewise
283 "ediff" "Compare two regions line-by-line." t) 283 "ediff" "Compare two regions line-by-line." t)
284 284
285 ;; patch 285 ;; patch
@@ -308,9 +308,9 @@
308 (autoload 308 (autoload
309 'ediff-directories3 "ediff" "Compare files in three directories." t) 309 'ediff-directories3 "ediff" "Compare files in three directories." t)
310 310
311 (autoload 'edir-revisions 311 (autoload 'edir-revisions
312 "ediff" "Compare two versions of a file." t) 312 "ediff" "Compare two versions of a file." t)
313 (autoload 'ediff-directory-revisions 313 (autoload 'ediff-directory-revisions
314 "ediff" "Compare two versions of a file." t) 314 "ediff" "Compare two versions of a file." t)
315 315
316 ;; merge directories 316 ;; merge directories
@@ -326,9 +326,9 @@
326 "Merge files in two directories using files in a third dir as ancestors." 326 "Merge files in two directories using files in a third dir as ancestors."
327 t) 327 t)
328 328
329 (autoload 'edir-merge-revisions 329 (autoload 'edir-merge-revisions
330 "ediff" "Merge versions of files in a directory." t) 330 "ediff" "Merge versions of files in a directory." t)
331 (autoload 'ediff-merge-directory-revisions 331 (autoload 'ediff-merge-directory-revisions
332 "ediff" "Merge versions of files in a directory." t) 332 "ediff" "Merge versions of files in a directory." t)
333 (autoload 'ediff-merge-directory-revisions-with-ancestor 333 (autoload 'ediff-merge-directory-revisions-with-ancestor
334 "ediff" 334 "ediff"
@@ -364,7 +364,7 @@
364 "ediff-util" 364 "ediff-util"
365 "Toggle the use of Ediff toolbar." 365 "Toggle the use of Ediff toolbar."
366 t) 366 t)
367 367
368 ) ; if purify-flag 368 ) ; if purify-flag
369 369
370 370
diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el
index 58a37e2566d..0ce7e4323ec 100644
--- a/lisp/ediff-init.el
+++ b/lisp/ediff-init.el
@@ -740,7 +740,7 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
740 :group 'ediff) 740 :group 'ediff)
741 741
742(defcustom ediff-coding-system-for-read 'raw-text 742(defcustom ediff-coding-system-for-read 'raw-text
743 "*The coding system for read to use when running the diff program as a subprocess. 743 "*The coding system for read to use when running the diff program as a subprocess.
744In most cases, the default will do. However, under certain circumstances in 744In most cases, the default will do. However, under certain circumstances in
745Windows NT/98/95 you might need to use something like 'raw-text-dos here. 745Windows NT/98/95 you might need to use something like 'raw-text-dos here.
746So, if the output that your diff program sends to Emacs contains extra ^M's, 746So, if the output that your diff program sends to Emacs contains extra ^M's,
@@ -811,7 +811,7 @@ to temp files when Ediff needs to find fine differences."
811;; A var local to each control panel buffer. Indicates highlighting style 811;; A var local to each control panel buffer. Indicates highlighting style
812;; in effect for this buffer: `face', `ascii', 812;; in effect for this buffer: `face', `ascii',
813;; `off' -- turned off \(on a dumb terminal only\). 813;; `off' -- turned off \(on a dumb terminal only\).
814(ediff-defvar-local ediff-highlighting-style 814(ediff-defvar-local ediff-highlighting-style
815 (if (and (ediff-has-face-support-p) ediff-use-faces) 'face 'ascii) 815 (if (and (ediff-has-face-support-p) ediff-use-faces) 'face 'ascii)
816 "") 816 "")
817 817
@@ -1549,7 +1549,7 @@ This default should work without changes."
1549 (t nil)))) 1549 (t nil))))
1550 1550
1551(defsubst ediff-frame-char-height (frame) 1551(defsubst ediff-frame-char-height (frame)
1552 (ediff-cond-compile-for-xemacs-or-emacs 1552 (ediff-cond-compile-for-xemacs-or-emacs
1553 (glyph-height ediff-H-glyph (frame-selected-window frame)) ; xemacs case 1553 (glyph-height ediff-H-glyph (frame-selected-window frame)) ; xemacs case
1554 (frame-char-height frame) ; emacs case 1554 (frame-char-height frame) ; emacs case
1555 ) 1555 )
diff --git a/lisp/ediff-merg.el b/lisp/ediff-merg.el
index 8bb1aa0814f..e7f6de3e861 100644
--- a/lisp/ediff-merg.el
+++ b/lisp/ediff-merg.el
@@ -58,10 +58,10 @@ Valid values are the symbols `default-A', `default-B', and `combined'."
58 :type '(radio (const default-A) (const default-B) (const combined)) 58 :type '(radio (const default-A) (const default-B) (const combined))
59 :group 'ediff-merge) 59 :group 'ediff-merge)
60 60
61(defcustom ediff-combination-pattern 61(defcustom ediff-combination-pattern
62 '("<<<<<<< variant A" A ">>>>>>> variant B" B "####### Ancestor" Ancestor "======= end") 62 '("<<<<<<< variant A" A ">>>>>>> variant B" B "####### Ancestor" Ancestor "======= end")
63 "*Pattern to be used for combining difference regions in buffers A and B. 63 "*Pattern to be used for combining difference regions in buffers A and B.
64The value must be a list of the form 64The value must be a list of the form
65(STRING1 bufspec1 STRING2 bufspec2 STRING3 bufspec3 STRING4) 65(STRING1 bufspec1 STRING2 bufspec2 STRING3 bufspec3 STRING4)
66where bufspec is the symbol A, B, or Ancestor. For instance, if the value is 66where bufspec is the symbol A, B, or Ancestor. For instance, if the value is
67'(STRING1 A STRING2 Ancestor STRING3 B STRING4) then the 67'(STRING1 A STRING2 Ancestor STRING3 B STRING4) then the
@@ -93,7 +93,7 @@ skipped over. nil means show all regions."
93A region is considered to have been changed if it is different from the current 93A region is considered to have been changed if it is different from the current
94default (`default-A', `default-B', `combined') and it hasn't been marked as 94default (`default-A', `default-B', `combined') and it hasn't been marked as
95`prefer-A' or `prefer-B'. 95`prefer-A' or `prefer-B'.
96A region is considered to have been changed also when it is marked as 96A region is considered to have been changed also when it is marked as
97as `prefer-A', but is different from the corresponding difference region in 97as `prefer-A', but is different from the corresponding difference region in
98Buffer A or if it is marked as `prefer-B' and is different from the region in 98Buffer A or if it is marked as `prefer-B' and is different from the region in
99Buffer B." 99Buffer B."
@@ -111,7 +111,7 @@ Buffer B."
111;; If ediff-skip-changed-regions, check if the merge region differs from 111;; If ediff-skip-changed-regions, check if the merge region differs from
112;; the current default. If a region is different from the default, it means 112;; the current default. If a region is different from the default, it means
113;; that the user has made determination as to how to merge for this particular 113;; that the user has made determination as to how to merge for this particular
114;; region. 114;; region.
115(defsubst ediff-skip-merge-region-if-changed-from-default-p (n) 115(defsubst ediff-skip-merge-region-if-changed-from-default-p (n)
116 (and ediff-skip-merge-regions-that-differ-from-default 116 (and ediff-skip-merge-regions-that-differ-from-default
117 (ediff-merge-changed-from-default-p n 'prefers-too))) 117 (ediff-merge-changed-from-default-p n 'prefers-too)))
@@ -137,7 +137,7 @@ Buffer B."
137 (setq combo-region 137 (setq combo-region
138 (concat combo-region 138 (concat combo-region
139 region-delim "\n" 139 region-delim "\n"
140 (ediff-get-region-contents 140 (ediff-get-region-contents
141 n region-spec ediff-control-buffer))) 141 n region-spec ediff-control-buffer)))
142 (error "")) 142 (error ""))
143 (setq pattern-list (cdr (cdr pattern-list))) 143 (setq pattern-list (cdr (cdr pattern-list)))
@@ -161,7 +161,7 @@ Buffer B."
161 (while (< n ediff-number-of-differences) 161 (while (< n ediff-number-of-differences)
162 (ediff-set-state-of-diff-in-all-buffers n ctl-buf) 162 (ediff-set-state-of-diff-in-all-buffers n ctl-buf)
163 (setq n (1+ n))))) 163 (setq n (1+ n)))))
164 164
165(defun ediff-set-state-of-diff-in-all-buffers (n ctl-buf) 165(defun ediff-set-state-of-diff-in-all-buffers (n ctl-buf)
166 (let ((regA (ediff-get-region-contents n 'A ctl-buf)) 166 (let ((regA (ediff-get-region-contents n 'A ctl-buf))
167 (regB (ediff-get-region-contents n 'B ctl-buf)) 167 (regB (ediff-get-region-contents n 'B ctl-buf))
@@ -190,12 +190,12 @@ Buffer B."
190 (ediff-set-state-of-diff n 'B nil) 190 (ediff-set-state-of-diff n 'B nil)
191 (ediff-set-state-of-diff n 'C nil))) 191 (ediff-set-state-of-diff n 'C nil)))
192 )) 192 ))
193 193
194(defun ediff-set-merge-mode () 194(defun ediff-set-merge-mode ()
195 (normal-mode t) 195 (normal-mode t)
196 (remove-hook 'local-write-file-hooks 'ediff-set-merge-mode)) 196 (remove-hook 'local-write-file-hooks 'ediff-set-merge-mode))
197 197
198 198
199;; Go over all diffs starting with DIFF-NUM and copy regions into buffer C 199;; Go over all diffs starting with DIFF-NUM and copy regions into buffer C
200;; according to the state of the difference. 200;; according to the state of the difference.
201;; Since ediff-copy-diff refuses to copy identical diff regions, there is 201;; Since ediff-copy-diff refuses to copy identical diff regions, there is
@@ -217,7 +217,7 @@ Buffer B."
217 (if remerging "Re-merging" "Merging") 217 (if remerging "Re-merging" "Merging")
218 n 218 n
219 ediff-number-of-differences)) 219 ediff-number-of-differences))
220 220
221 (setq state-of-merge (ediff-get-state-of-merge n)) 221 (setq state-of-merge (ediff-get-state-of-merge n))
222 222
223 (if remerging 223 (if remerging
@@ -225,36 +225,36 @@ Buffer B."
225 ;; (reg-B (ediff-get-region-contents n 'B ediff-control-buffer)) 225 ;; (reg-B (ediff-get-region-contents n 'B ediff-control-buffer))
226 ;; (reg-C (ediff-get-region-contents n 'C ediff-control-buffer))) 226 ;; (reg-C (ediff-get-region-contents n 'C ediff-control-buffer)))
227 (let () 227 (let ()
228 228
229 ;; if region was edited since it was first set by default 229 ;; if region was edited since it was first set by default
230 (if (or (ediff-merge-changed-from-default-p n) 230 (if (or (ediff-merge-changed-from-default-p n)
231 ;; was preferred 231 ;; was preferred
232 (string-match "prefer" state-of-merge)) 232 (string-match "prefer" state-of-merge))
233 ;; then ignore 233 ;; then ignore
234 (setq do-not-copy t)) 234 (setq do-not-copy t))
235 235
236 ;; change state of merge for this diff, if necessary 236 ;; change state of merge for this diff, if necessary
237 (if (and (string-match "\\(default\\|combined\\)" state-of-merge) 237 (if (and (string-match "\\(default\\|combined\\)" state-of-merge)
238 (not do-not-copy)) 238 (not do-not-copy))
239 (ediff-set-state-of-merge 239 (ediff-set-state-of-merge
240 n (format "%S" ediff-default-variant))) 240 n (format "%S" ediff-default-variant)))
241 )) 241 ))
242 242
243 ;; state-of-merge may have changed via ediff-set-state-of-merge, so 243 ;; state-of-merge may have changed via ediff-set-state-of-merge, so
244 ;; check it once again 244 ;; check it once again
245 (setq state-of-merge (ediff-get-state-of-merge n)) 245 (setq state-of-merge (ediff-get-state-of-merge n))
246 246
247 (or do-not-copy 247 (or do-not-copy
248 (if (string= state-of-merge "combined") 248 (if (string= state-of-merge "combined")
249 ;; use n+1 because ediff-combine-diffs works via user numbering 249 ;; use n+1 because ediff-combine-diffs works via user numbering
250 ;; of diffs, which is 1+ to what ediff uses internally 250 ;; of diffs, which is 1+ to what ediff uses internally
251 (ediff-combine-diffs (1+ n) 'batch) 251 (ediff-combine-diffs (1+ n) 'batch)
252 (ediff-copy-diff 252 (ediff-copy-diff
253 n (if (string-match "-A" state-of-merge) 'A 'B) 'C 'batch))) 253 n (if (string-match "-A" state-of-merge) 'A 'B) 'C 'batch)))
254 (setq n (1+ n))) 254 (setq n (1+ n)))
255 (message "Merging buffers A & B into C ... Done") 255 (message "Merging buffers A & B into C ... Done")
256 )) 256 ))
257 257
258 258
259(defun ediff-re-merge () 259(defun ediff-re-merge ()
260 "Remerge unmodified diff regions using a new default. Start with the current region." 260 "Remerge unmodified diff regions using a new default. Start with the current region."
@@ -266,14 +266,14 @@ Buffer B."
266 default-variant-alist))) 266 default-variant-alist)))
267 (setq ediff-default-variant 267 (setq ediff-default-variant
268 (intern 268 (intern
269 (completing-read 269 (completing-read
270 (format "Current merge default is `%S'. New default: " 270 (format "Current merge default is `%S'. New default: "
271 ediff-default-variant) 271 ediff-default-variant)
272 actual-alist nil 'must-match))) 272 actual-alist nil 'must-match)))
273 (ediff-do-merge ediff-current-difference 'remerge) 273 (ediff-do-merge ediff-current-difference 'remerge)
274 (ediff-recenter) 274 (ediff-recenter)
275 )) 275 ))
276 276
277(defun ediff-shrink-window-C (arg) 277(defun ediff-shrink-window-C (arg)
278 "Shrink window C to just one line. 278 "Shrink window C to just one line.
279With a prefix argument, returns window C to its normal size. 279With a prefix argument, returns window C to its normal size.
@@ -307,16 +307,16 @@ Combining is done according to the specifications in variable
307`ediff-combination-pattern'." 307`ediff-combination-pattern'."
308 (interactive "P") 308 (interactive "P")
309 (setq n (if (numberp n) (1- n) ediff-current-difference)) 309 (setq n (if (numberp n) (1- n) ediff-current-difference))
310 310
311 (let (reg-combined) 311 (let (reg-combined)
312 ;;(setq regA (ediff-get-region-contents n 'A ediff-control-buffer) 312 ;;(setq regA (ediff-get-region-contents n 'A ediff-control-buffer)
313 ;; regB (ediff-get-region-contents n 'B ediff-control-buffer)) 313 ;; regB (ediff-get-region-contents n 'B ediff-control-buffer))
314 ;;(setq reg-combined (ediff-make-combined-diff regA regB)) 314 ;;(setq reg-combined (ediff-make-combined-diff regA regB))
315 (setq reg-combined (ediff-get-combined-region n)) 315 (setq reg-combined (ediff-get-combined-region n))
316 316
317 (ediff-copy-diff n nil 'C batch-invocation reg-combined)) 317 (ediff-copy-diff n nil 'C batch-invocation reg-combined))
318 (or batch-invocation (ediff-jump-to-difference (1+ n)))) 318 (or batch-invocation (ediff-jump-to-difference (1+ n))))
319 319
320 320
321;; Checks if the region in buff C looks like a combination of the regions 321;; Checks if the region in buff C looks like a combination of the regions
322;; in buffers A and B. Return a list (reg-a-beg reg-a-end reg-b-beg reg-b-end) 322;; in buffers A and B. Return a list (reg-a-beg reg-a-end reg-b-beg reg-b-end)
@@ -331,7 +331,7 @@ Combining is done according to the specifications in variable
331 (mrgreg-end (ediff-get-diff-posn 'C 'end region-num)) 331 (mrgreg-end (ediff-get-diff-posn 'C 'end region-num))
332 (pattern-list ediff-combination-pattern) 332 (pattern-list ediff-combination-pattern)
333 delim reg-beg reg-end delim-regs-list) 333 delim reg-beg reg-end delim-regs-list)
334 334
335 (if combined 335 (if combined
336 (ediff-with-current-buffer ediff-buffer-C 336 (ediff-with-current-buffer ediff-buffer-C
337 (while pattern-list 337 (while pattern-list
@@ -364,7 +364,7 @@ Combining is done according to the specifications in variable
364 (reg-C (ediff-get-region-contents diff-num 'C ediff-control-buffer))) 364 (reg-C (ediff-get-region-contents diff-num 'C ediff-control-buffer)))
365 365
366 (setq state-of-merge (ediff-get-state-of-merge diff-num)) 366 (setq state-of-merge (ediff-get-state-of-merge diff-num))
367 367
368 ;; if region was edited since it was first set by default 368 ;; if region was edited since it was first set by default
369 (or (and (string= state-of-merge "default-A") 369 (or (and (string= state-of-merge "default-A")
370 (not (string= reg-A reg-C))) 370 (not (string= reg-A reg-C)))
@@ -380,7 +380,7 @@ Combining is done according to the specifications in variable
380 (string= state-of-merge "prefer-B") 380 (string= state-of-merge "prefer-B")
381 (not (string= reg-B reg-C))) 381 (not (string= reg-B reg-C)))
382 ))) 382 )))
383 383
384 384
385;;; Local Variables: 385;;; Local Variables:
386;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) 386;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
diff --git a/lisp/ediff-ptch.el b/lisp/ediff-ptch.el
index 29174ff8e97..9590c9a181a 100644
--- a/lisp/ediff-ptch.el
+++ b/lisp/ediff-ptch.el
@@ -24,7 +24,7 @@
24;;; Commentary: 24;;; Commentary:
25 25
26;;; Code: 26;;; Code:
27 27
28(provide 'ediff-ptch) 28(provide 'ediff-ptch)
29 29
30(defgroup ediff-ptch nil 30(defgroup ediff-ptch nil
@@ -76,7 +76,7 @@ case the default value for this variable should be changed."
76(defconst ediff-default-backup-extension 76(defconst ediff-default-backup-extension
77 (if (memq system-type '(vax-vms axp-vms emx ms-dos)) 77 (if (memq system-type '(vax-vms axp-vms emx ms-dos))
78 "_orig" ".orig")) 78 "_orig" ".orig"))
79 79
80 80
81(defcustom ediff-backup-extension ediff-default-backup-extension 81(defcustom ediff-backup-extension ediff-default-backup-extension
82 "Backup extension used by the patch program. 82 "Backup extension used by the patch program.
@@ -94,7 +94,7 @@ See also `ediff-backup-specs'."
94 (t 'traditional)) 94 (t 'traditional))
95 (file-error nil))) 95 (file-error nil)))
96 96
97(defcustom ediff-backup-specs 97(defcustom ediff-backup-specs
98 (let ((type (ediff-test-patch-utility))) 98 (let ((type (ediff-test-patch-utility)))
99 (cond ((eq type 'gnu) 99 (cond ((eq type 'gnu)
100 ;; GNU `patch' v. >= 2.2 100 ;; GNU `patch' v. >= 2.2
@@ -184,10 +184,10 @@ program."
184 (setq count (1+ count))))) 184 (setq count (1+ count)))))
185 count))) 185 count)))
186 186
187;; Scan BUF (which is supposed to contain a patch) and make a list of the form 187;; Scan BUF (which is supposed to contain a patch) and make a list of the form
188;; ((nil nil filename-spec1 marker1 marker2) 188;; ((nil nil filename-spec1 marker1 marker2)
189;; (nil nil filename-spec2 marker1 marker2) ...) 189;; (nil nil filename-spec2 marker1 marker2) ...)
190;; where filename-spec[12] are files to which the `patch' program would 190;; where filename-spec[12] are files to which the `patch' program would
191;; have applied the patch. 191;; have applied the patch.
192;; nin, nil are placeholders. See ediff-make-new-meta-list-element in 192;; nin, nil are placeholders. See ediff-make-new-meta-list-element in
193;; ediff-meta.el for the explanations. 193;; ediff-meta.el for the explanations.
@@ -240,7 +240,7 @@ program."
240 (move-marker mark2 (match-beginning 0))) 240 (move-marker mark2 (match-beginning 0)))
241 241
242 (goto-char mark2-end) 242 (goto-char mark2-end)
243 243
244 (if filenames 244 (if filenames
245 (setq patch-map 245 (setq patch-map
246 (cons (ediff-make-new-meta-list-element 246 (cons (ediff-make-new-meta-list-element
@@ -274,7 +274,7 @@ program."
274 ;; directory part of filename 274 ;; directory part of filename
275 (file-name-as-directory filename) 275 (file-name-as-directory filename)
276 (file-name-directory filename))) 276 (file-name-directory filename)))
277 ;; Filename-spec is objA; at this point it is represented as 277 ;; Filename-spec is objA; at this point it is represented as
278 ;; (file1 . file2). We get it using ediff-get-session-objA 278 ;; (file1 . file2). We get it using ediff-get-session-objA
279 ;; directory part of the first file in the patch 279 ;; directory part of the first file in the patch
280 (base-dir1 (file-name-directory 280 (base-dir1 (file-name-directory
@@ -349,10 +349,10 @@ other files, enter /dev/null
349 (setcar (ediff-get-session-objA session-info) 349 (setcar (ediff-get-session-objA session-info)
350 (cons user-file user-file)))) 350 (cons user-file user-file))))
351 (setcar proposed-file-names 351 (setcar proposed-file-names
352 (expand-file-name 352 (expand-file-name
353 (concat actual-dir (car proposed-file-names)))) 353 (concat actual-dir (car proposed-file-names))))
354 (setcdr proposed-file-names 354 (setcdr proposed-file-names
355 (expand-file-name 355 (expand-file-name
356 (concat actual-dir (cdr proposed-file-names))))) 356 (concat actual-dir (cdr proposed-file-names)))))
357 )) 357 ))
358 ediff-patch-map) 358 ediff-patch-map)
@@ -418,7 +418,7 @@ are two possible targets for this patch. However, these files do not exist."
418 (let ((directory t) 418 (let ((directory t)
419 target) 419 target)
420 (while directory 420 (while directory
421 (setq target (read-file-name 421 (setq target (read-file-name
422 "Please enter a patch target: " 422 "Please enter a patch target: "
423 actual-dir actual-dir t)) 423 actual-dir actual-dir t))
424 (if (not (file-directory-p target)) 424 (if (not (file-directory-p target))
@@ -502,7 +502,7 @@ optional argument, then use it."
502 (if (y-or-n-p "Is the patch already in a buffer? ") 502 (if (y-or-n-p "Is the patch already in a buffer? ")
503 (ediff-prompt-for-patch-buffer) 503 (ediff-prompt-for-patch-buffer)
504 (ediff-prompt-for-patch-file))))) 504 (ediff-prompt-for-patch-file)))))
505 505
506 (ediff-with-current-buffer patch-buf 506 (ediff-with-current-buffer patch-buf
507 (goto-char (point-min)) 507 (goto-char (point-min))
508 (or (ediff-get-visible-buffer-window patch-buf) 508 (or (ediff-get-visible-buffer-window patch-buf)
@@ -529,7 +529,7 @@ optional argument, then use it."
529 "^/dev/null" 529 "^/dev/null"
530 ;; this is the file to patch 530 ;; this is the file to patch
531 (ediff-get-session-objA-name (car ediff-patch-map)))) 531 (ediff-get-session-objA-name (car ediff-patch-map))))
532 (> (length 532 (> (length
533 (ediff-get-session-objA-name (car ediff-patch-map))) 533 (ediff-get-session-objA-name (car ediff-patch-map)))
534 1)) 534 1))
535 (ediff-get-session-objA-name (car ediff-patch-map)) 535 (ediff-get-session-objA-name (car ediff-patch-map))
@@ -571,11 +571,11 @@ optional argument, then use it."
571 (set-visited-file-modtime) ; sync buffer and temp file 571 (set-visited-file-modtime) ; sync buffer and temp file
572 (setq default-directory default-dir) 572 (setq default-directory default-dir)
573 ) 573 )
574 574
575 ;; dispatch a patch function 575 ;; dispatch a patch function
576 (setq ctl-buf (ediff-dispatch-file-patching-job 576 (setq ctl-buf (ediff-dispatch-file-patching-job
577 patch-buf file-name startup-hooks)) 577 patch-buf file-name startup-hooks))
578 578
579 (ediff-with-current-buffer ctl-buf 579 (ediff-with-current-buffer ctl-buf
580 (delete-file (buffer-file-name ediff-buffer-A)) 580 (delete-file (buffer-file-name ediff-buffer-A))
581 (delete-file (buffer-file-name ediff-buffer-B)) 581 (delete-file (buffer-file-name ediff-buffer-B))
@@ -588,7 +588,7 @@ optional argument, then use it."
588 (setq buffer-auto-save-file-name nil) ; don't create auto-save file 588 (setq buffer-auto-save-file-name nil) ; don't create auto-save file
589 (if default-dir (setq default-directory default-dir)) 589 (if default-dir (setq default-directory default-dir))
590 (set-visited-file-name nil) 590 (set-visited-file-name nil)
591 (rename-buffer (ediff-unique-buffer-name 591 (rename-buffer (ediff-unique-buffer-name
592 (concat buf-to-patch-name "_patched") "")) 592 (concat buf-to-patch-name "_patched") ""))
593 (set-buffer-modified-p t))) 593 (set-buffer-modified-p t)))
594 )) 594 ))
@@ -607,7 +607,7 @@ optional argument, then use it."
607(defun ediff-patch-file-internal (patch-buf source-filename 607(defun ediff-patch-file-internal (patch-buf source-filename
608 &optional startup-hooks) 608 &optional startup-hooks)
609 (setq source-filename (expand-file-name source-filename)) 609 (setq source-filename (expand-file-name source-filename))
610 610
611 (let* ((shell-file-name ediff-shell) 611 (let* ((shell-file-name ediff-shell)
612 (patch-diagnostics (get-buffer-create "*ediff patch diagnostics*")) 612 (patch-diagnostics (get-buffer-create "*ediff patch diagnostics*"))
613 ;; ediff-find-file may use a temp file to do the patch 613 ;; ediff-find-file may use a temp file to do the patch
@@ -618,15 +618,15 @@ optional argument, then use it."
618 (target-filename source-filename) 618 (target-filename source-filename)
619 ;; this ensures that the patch process gets patch buffer in the 619 ;; this ensures that the patch process gets patch buffer in the
620 ;; encoding that Emacs thinks is right for that type of text 620 ;; encoding that Emacs thinks is right for that type of text
621 (coding-system-for-write 621 (coding-system-for-write
622 (if (boundp 'buffer-file-coding-system) buffer-file-coding-system)) 622 (if (boundp 'buffer-file-coding-system) buffer-file-coding-system))
623 target-buf buf-to-patch file-name-magic-p 623 target-buf buf-to-patch file-name-magic-p
624 patch-return-code ctl-buf backup-style aux-wind) 624 patch-return-code ctl-buf backup-style aux-wind)
625 625
626 (if (string-match "V" ediff-patch-options) 626 (if (string-match "V" ediff-patch-options)
627 (error 627 (error
628 "Ediff doesn't take the -V option in `ediff-patch-options'--sorry")) 628 "Ediff doesn't take the -V option in `ediff-patch-options'--sorry"))
629 629
630 ;; Make a temp file, if source-filename has a magic file handler (or if 630 ;; Make a temp file, if source-filename has a magic file handler (or if
631 ;; it is handled via auto-mode-alist and similar magic). 631 ;; it is handled via auto-mode-alist and similar magic).
632 ;; Check if there is a buffer visiting source-filename and if they are in 632 ;; Check if there is a buffer visiting source-filename and if they are in
@@ -640,8 +640,8 @@ optional argument, then use it."
640 ;; temporary file where we put the after-product of the file handler. 640 ;; temporary file where we put the after-product of the file handler.
641 (setq file-name-magic-p (not (equal (file-truename true-source-filename) 641 (setq file-name-magic-p (not (equal (file-truename true-source-filename)
642 (file-truename source-filename)))) 642 (file-truename source-filename))))
643 643
644 ;; Checkout orig file, if necessary, so that the patched file 644 ;; Checkout orig file, if necessary, so that the patched file
645 ;; could be checked back in. 645 ;; could be checked back in.
646 (ediff-maybe-checkout buf-to-patch) 646 (ediff-maybe-checkout buf-to-patch)
647 647
@@ -674,7 +674,7 @@ optional argument, then use it."
674 674
675 (switch-to-buffer patch-diagnostics) 675 (switch-to-buffer patch-diagnostics)
676 (sit-for 0) ; synchronize - let the user see diagnostics 676 (sit-for 0) ; synchronize - let the user see diagnostics
677 677
678 (or (and (ediff-patch-return-code-ok patch-return-code) 678 (or (and (ediff-patch-return-code-ok patch-return-code)
679 (file-exists-p 679 (file-exists-p
680 (concat true-source-filename ediff-backup-extension))) 680 (concat true-source-filename ediff-backup-extension)))
@@ -682,7 +682,7 @@ optional argument, then use it."
682 (with-output-to-temp-buffer ediff-msg-buffer 682 (with-output-to-temp-buffer ediff-msg-buffer
683 (ediff-with-current-buffer standard-output 683 (ediff-with-current-buffer standard-output
684 (fundamental-mode)) 684 (fundamental-mode))
685 (princ (format 685 (princ (format
686 "Patch program has failed due to a bad patch file, 686 "Patch program has failed due to a bad patch file,
687it couldn't apply all hunks, OR 687it couldn't apply all hunks, OR
688it couldn't create the backup for the file being patched. 688it couldn't create the backup for the file being patched.
@@ -695,7 +695,7 @@ The second problem might be due to an incompatibility among these settings:
695 ediff-backup-extension = %S ediff-backup-specs = %S 695 ediff-backup-extension = %S ediff-backup-specs = %S
696 696
697See Ediff on-line manual for more details on these variables. 697See Ediff on-line manual for more details on these variables.
698In particular, check the documentation for `ediff-backup-specs'. 698In particular, check the documentation for `ediff-backup-specs'.
699 699
700In any of the above cases, Ediff doesn't compare files automatically. 700In any of the above cases, Ediff doesn't compare files automatically.
701However, if the patch was applied partially and the backup file was created, 701However, if the patch was applied partially and the backup file was created,
@@ -713,7 +713,7 @@ you can still examine the changes via M-x ediff-files"
713 (goto-char (point-max)))) 713 (goto-char (point-max))))
714 (switch-to-buffer-other-window patch-diagnostics) 714 (switch-to-buffer-other-window patch-diagnostics)
715 (error "Patch appears to have failed"))) 715 (error "Patch appears to have failed")))
716 716
717 ;; If black magic is involved, apply patch to a temp copy of the 717 ;; If black magic is involved, apply patch to a temp copy of the
718 ;; file. Otherwise, apply patch to the orig copy. If patch is applied 718 ;; file. Otherwise, apply patch to the orig copy. If patch is applied
719 ;; to temp copy, we name the result old-name_patched for local files 719 ;; to temp copy, we name the result old-name_patched for local files
@@ -727,7 +727,7 @@ you can still examine the changes via M-x ediff-files"
727 (set-visited-file-name 727 (set-visited-file-name
728 (concat source-filename ediff-backup-extension)) 728 (concat source-filename ediff-backup-extension))
729 (set-buffer-modified-p nil)) 729 (set-buffer-modified-p nil))
730 730
731 ;; Black magic in effect. 731 ;; Black magic in effect.
732 ;; If orig file was remote, put the patched file in the temp directory. 732 ;; If orig file was remote, put the patched file in the temp directory.
733 ;; If orig file is local, put the patched file in the directory of 733 ;; If orig file is local, put the patched file in the directory of
@@ -738,20 +738,20 @@ you can still examine the changes via M-x ediff-files"
738 true-source-filename 738 true-source-filename
739 source-filename) 739 source-filename)
740 "_patched")) 740 "_patched"))
741 741
742 (rename-file true-source-filename target-filename t) 742 (rename-file true-source-filename target-filename t)
743 743
744 ;; arrange that the temp copy of orig will be deleted 744 ;; arrange that the temp copy of orig will be deleted
745 (rename-file (concat true-source-filename ediff-backup-extension) 745 (rename-file (concat true-source-filename ediff-backup-extension)
746 true-source-filename t)) 746 true-source-filename t))
747 747
748 ;; make orig buffer read-only 748 ;; make orig buffer read-only
749 (setq startup-hooks 749 (setq startup-hooks
750 (cons 'ediff-set-read-only-in-buf-A startup-hooks)) 750 (cons 'ediff-set-read-only-in-buf-A startup-hooks))
751 751
752 ;; set up a buf for the patched file 752 ;; set up a buf for the patched file
753 (setq target-buf (find-file-noselect target-filename)) 753 (setq target-buf (find-file-noselect target-filename))
754 754
755 (setq ctl-buf 755 (setq ctl-buf
756 (ediff-buffers-internal 756 (ediff-buffers-internal
757 buf-to-patch target-buf nil 757 buf-to-patch target-buf nil
@@ -759,7 +759,7 @@ you can still examine the changes via M-x ediff-files"
759 (ediff-with-current-buffer ctl-buf 759 (ediff-with-current-buffer ctl-buf
760 (setq ediff-patchbufer patch-buf 760 (setq ediff-patchbufer patch-buf
761 ediff-patch-diagnostics patch-diagnostics)) 761 ediff-patch-diagnostics patch-diagnostics))
762 762
763 (bury-buffer patch-diagnostics) 763 (bury-buffer patch-diagnostics)
764 (message "Type `P', if you need to see patch diagnostics") 764 (message "Type `P', if you need to see patch diagnostics")
765 ctl-buf)) 765 ctl-buf))
@@ -775,7 +775,7 @@ you can still examine the changes via M-x ediff-files"
775 'ediff-patch-file-form-meta 775 'ediff-patch-file-form-meta
776 ediff-meta-patchbufer patch-buf) ) 776 ediff-meta-patchbufer patch-buf) )
777 startup-hooks)) 777 startup-hooks))
778 (setq meta-buf (ediff-prepare-meta-buffer 778 (setq meta-buf (ediff-prepare-meta-buffer
779 'ediff-filegroup-action 779 'ediff-filegroup-action
780 (ediff-with-current-buffer patch-buf 780 (ediff-with-current-buffer patch-buf
781 (cons (ediff-make-new-meta-list-header 781 (cons (ediff-make-new-meta-list-header
@@ -793,8 +793,8 @@ you can still examine the changes via M-x ediff-files"
793 (ediff-show-meta-buffer meta-buf) 793 (ediff-show-meta-buffer meta-buf)
794 )) 794 ))
795 795
796 796
797 797
798 798
799;;; Local Variables: 799;;; Local Variables:
800;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) 800;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el
index 865f14a41c5..3dda354be15 100644
--- a/lisp/ediff-util.el
+++ b/lisp/ediff-util.el
@@ -24,7 +24,7 @@
24;;; Commentary: 24;;; Commentary:
25 25
26;;; Code: 26;;; Code:
27 27
28(provide 'ediff-util) 28(provide 'ediff-util)
29 29
30;; Compiler pacifier 30;; Compiler pacifier
@@ -118,7 +118,7 @@ Commands:
118 (setq mode-name "Ediff") 118 (setq mode-name "Ediff")
119 (run-hooks 'ediff-mode-hook)) 119 (run-hooks 'ediff-mode-hook))
120 120
121 121
122 122
123;;; Build keymaps 123;;; Build keymaps
124 124
@@ -133,19 +133,19 @@ to invocation.")
133 (if (null ediff-mode-map) 133 (if (null ediff-mode-map)
134 (ediff-setup-keymap)) 134 (ediff-setup-keymap))
135 (use-local-map ediff-mode-map)) 135 (use-local-map ediff-mode-map))
136 136
137;; Reload Ediff keymap. For debugging only. 137;; Reload Ediff keymap. For debugging only.
138(defun ediff-reload-keymap () 138(defun ediff-reload-keymap ()
139 (interactive) 139 (interactive)
140 (setq ediff-mode-map nil) 140 (setq ediff-mode-map nil)
141 (ediff-set-keys)) 141 (ediff-set-keys))
142 142
143 143
144(defun ediff-setup-keymap () 144(defun ediff-setup-keymap ()
145 "Set up the keymap used in the control buffer of Ediff." 145 "Set up the keymap used in the control buffer of Ediff."
146 (setq ediff-mode-map (make-sparse-keymap)) 146 (setq ediff-mode-map (make-sparse-keymap))
147 (suppress-keymap ediff-mode-map) 147 (suppress-keymap ediff-mode-map)
148 148
149 (define-key ediff-mode-map 149 (define-key ediff-mode-map
150 (if ediff-emacs-p [mouse-2] [button2]) 'ediff-help-for-quick-help) 150 (if ediff-emacs-p [mouse-2] [button2]) 'ediff-help-for-quick-help)
151 (define-key ediff-mode-map "\C-m" 'ediff-help-for-quick-help) 151 (define-key ediff-mode-map "\C-m" 'ediff-help-for-quick-help)
@@ -246,7 +246,7 @@ to invocation.")
246 )) 246 ))
247 247
248 (define-key ediff-mode-map "m" 'ediff-toggle-wide-display) 248 (define-key ediff-mode-map "m" 'ediff-toggle-wide-display)
249 249
250 ;; Allow ediff-mode-map to be referenced indirectly 250 ;; Allow ediff-mode-map to be referenced indirectly
251 (fset 'ediff-mode-map ediff-mode-map) 251 (fset 'ediff-mode-map ediff-mode-map)
252 (run-hooks 'ediff-keymap-setup-hook)) 252 (run-hooks 'ediff-keymap-setup-hook))
@@ -272,26 +272,26 @@ to invocation.")
272 (ediff-convert-standard-filename (expand-file-name file-C)))) 272 (ediff-convert-standard-filename (expand-file-name file-C))))
273 (if (stringp merge-buffer-file) 273 (if (stringp merge-buffer-file)
274 (progn 274 (progn
275 (setq merge-buffer-file 275 (setq merge-buffer-file
276 (ediff-convert-standard-filename 276 (ediff-convert-standard-filename
277 (expand-file-name merge-buffer-file))) 277 (expand-file-name merge-buffer-file)))
278 ;; check the directory exists 278 ;; check the directory exists
279 (or (file-exists-p (file-name-directory merge-buffer-file)) 279 (or (file-exists-p (file-name-directory merge-buffer-file))
280 (error "Directory %s given as place to save the merge doesn't exist" 280 (error "Directory %s given as place to save the merge doesn't exist"
281 (abbreviate-file-name 281 (abbreviate-file-name
282 (file-name-directory merge-buffer-file)))) 282 (file-name-directory merge-buffer-file))))
283 (if (and (file-exists-p merge-buffer-file) 283 (if (and (file-exists-p merge-buffer-file)
284 (file-directory-p merge-buffer-file)) 284 (file-directory-p merge-buffer-file))
285 (error "The merge buffer file %s must not be a directory" 285 (error "The merge buffer file %s must not be a directory"
286 (abbreviate-file-name merge-buffer-file))) 286 (abbreviate-file-name merge-buffer-file)))
287 )) 287 ))
288 (let* ((control-buffer-name 288 (let* ((control-buffer-name
289 (ediff-unique-buffer-name "*Ediff Control Panel" "*")) 289 (ediff-unique-buffer-name "*Ediff Control Panel" "*"))
290 (control-buffer (ediff-with-current-buffer buffer-A 290 (control-buffer (ediff-with-current-buffer buffer-A
291 (get-buffer-create control-buffer-name)))) 291 (get-buffer-create control-buffer-name))))
292 (ediff-with-current-buffer control-buffer 292 (ediff-with-current-buffer control-buffer
293 (ediff-mode) 293 (ediff-mode)
294 294
295 (make-local-variable 'ediff-use-long-help-message) 295 (make-local-variable 'ediff-use-long-help-message)
296 (make-local-variable 'ediff-prefer-iconified-control-frame) 296 (make-local-variable 'ediff-prefer-iconified-control-frame)
297 (make-local-variable 'ediff-split-window-function) 297 (make-local-variable 'ediff-split-window-function)
@@ -309,7 +309,7 @@ to invocation.")
309 (while setup-parameters 309 (while setup-parameters
310 (set (car (car setup-parameters)) (cdr (car setup-parameters))) 310 (set (car (car setup-parameters)) (cdr (car setup-parameters)))
311 (setq setup-parameters (cdr setup-parameters))) 311 (setq setup-parameters (cdr setup-parameters)))
312 312
313 ;; set variables classifying the current ediff job 313 ;; set variables classifying the current ediff job
314 ;; must come AFTER setup-parameters 314 ;; must come AFTER setup-parameters
315 (setq ediff-3way-comparison-job (ediff-3way-comparison-job) 315 (setq ediff-3way-comparison-job (ediff-3way-comparison-job)
@@ -334,7 +334,7 @@ to invocation.")
334 (if (ediff-window-display-p) 334 (if (ediff-window-display-p)
335 (add-hook 'pre-command-hook 'ediff-spy-after-mouse nil 'local)) 335 (add-hook 'pre-command-hook 'ediff-spy-after-mouse nil 'local))
336 (setq ediff-mouse-pixel-position (mouse-pixel-position)) 336 (setq ediff-mouse-pixel-position (mouse-pixel-position))
337 337
338 ;; adjust for merge jobs 338 ;; adjust for merge jobs
339 (if ediff-merge-job 339 (if ediff-merge-job
340 (let ((buf 340 (let ((buf
@@ -348,13 +348,13 @@ to invocation.")
348 (cond ((eq ediff-default-variant 'default-B) 348 (cond ((eq ediff-default-variant 'default-B)
349 buffer-B) 349 buffer-B)
350 (t buffer-A)))) 350 (t buffer-A))))
351 351
352 (setq ediff-split-window-function 352 (setq ediff-split-window-function
353 ediff-merge-split-window-function) 353 ediff-merge-split-window-function)
354 354
355 ;; remember the ancestor buffer, if any 355 ;; remember the ancestor buffer, if any
356 (setq ediff-ancestor-buffer buffer-C) 356 (setq ediff-ancestor-buffer buffer-C)
357 357
358 (setq buffer-C 358 (setq buffer-C
359 (get-buffer-create 359 (get-buffer-create
360 (ediff-unique-buffer-name "*ediff-merge" "*"))) 360 (ediff-unique-buffer-name "*ediff-merge" "*")))
@@ -365,14 +365,14 @@ to invocation.")
365 (widen) ; merge buffer is always widened 365 (widen) ; merge buffer is always widened
366 (add-hook 'local-write-file-hooks 'ediff-set-merge-mode nil t) 366 (add-hook 'local-write-file-hooks 'ediff-set-merge-mode nil t)
367 ))) 367 )))
368 (setq buffer-read-only nil 368 (setq buffer-read-only nil
369 ediff-buffer-A buffer-A 369 ediff-buffer-A buffer-A
370 ediff-buffer-B buffer-B 370 ediff-buffer-B buffer-B
371 ediff-buffer-C buffer-C 371 ediff-buffer-C buffer-C
372 ediff-control-buffer control-buffer) 372 ediff-control-buffer control-buffer)
373 373
374 (ediff-choose-syntax-table) 374 (ediff-choose-syntax-table)
375 375
376 (setq ediff-control-buffer-suffix 376 (setq ediff-control-buffer-suffix
377 (if (string-match "<[0-9]*>" control-buffer-name) 377 (if (string-match "<[0-9]*>" control-buffer-name)
378 (substring control-buffer-name 378 (substring control-buffer-name
@@ -388,10 +388,10 @@ to invocation.")
388 (or 388 (or
389 (string-match "[0-9]+" ediff-control-buffer-suffix) 389 (string-match "[0-9]+" ediff-control-buffer-suffix)
390 0)))))) 390 0))))))
391 391
392 (setq ediff-error-buffer 392 (setq ediff-error-buffer
393 (get-buffer-create (ediff-unique-buffer-name "*ediff-errors" "*"))) 393 (get-buffer-create (ediff-unique-buffer-name "*ediff-errors" "*")))
394 394
395 (ediff-with-current-buffer buffer-A (ediff-strip-mode-line-format)) 395 (ediff-with-current-buffer buffer-A (ediff-strip-mode-line-format))
396 (ediff-with-current-buffer buffer-B (ediff-strip-mode-line-format)) 396 (ediff-with-current-buffer buffer-B (ediff-strip-mode-line-format))
397 (if ediff-3way-job 397 (if ediff-3way-job
@@ -399,16 +399,16 @@ to invocation.")
399 (if (ediff-buffer-live-p ediff-ancestor-buffer) 399 (if (ediff-buffer-live-p ediff-ancestor-buffer)
400 (ediff-with-current-buffer ediff-ancestor-buffer 400 (ediff-with-current-buffer ediff-ancestor-buffer
401 (ediff-strip-mode-line-format))) 401 (ediff-strip-mode-line-format)))
402 402
403 (ediff-save-protected-variables) ; save variables to be restored on exit 403 (ediff-save-protected-variables) ; save variables to be restored on exit
404 404
405 ;; ediff-setup-diff-regions-function must be set after setup 405 ;; ediff-setup-diff-regions-function must be set after setup
406 ;; parameters are processed. 406 ;; parameters are processed.
407 (setq ediff-setup-diff-regions-function 407 (setq ediff-setup-diff-regions-function
408 (if ediff-diff3-job 408 (if ediff-diff3-job
409 'ediff-setup-diff-regions3 409 'ediff-setup-diff-regions3
410 'ediff-setup-diff-regions)) 410 'ediff-setup-diff-regions))
411 411
412 (setq ediff-wide-bounds 412 (setq ediff-wide-bounds
413 (list (ediff-make-bullet-proof-overlay 413 (list (ediff-make-bullet-proof-overlay
414 '(point-min) '(point-max) ediff-buffer-A) 414 '(point-min) '(point-max) ediff-buffer-A)
@@ -416,20 +416,20 @@ to invocation.")
416 '(point-min) '(point-max) ediff-buffer-B) 416 '(point-min) '(point-max) ediff-buffer-B)
417 (ediff-make-bullet-proof-overlay 417 (ediff-make-bullet-proof-overlay
418 '(point-min) '(point-max) ediff-buffer-C))) 418 '(point-min) '(point-max) ediff-buffer-C)))
419 419
420 ;; This has effect only on ediff-windows/regions 420 ;; This has effect only on ediff-windows/regions
421 ;; In all other cases, ediff-visible-region sets visibility bounds to 421 ;; In all other cases, ediff-visible-region sets visibility bounds to
422 ;; ediff-wide-bounds, and ediff-narrow-bounds are ignored. 422 ;; ediff-wide-bounds, and ediff-narrow-bounds are ignored.
423 (if ediff-start-narrowed 423 (if ediff-start-narrowed
424 (setq ediff-visible-bounds ediff-narrow-bounds) 424 (setq ediff-visible-bounds ediff-narrow-bounds)
425 (setq ediff-visible-bounds ediff-wide-bounds)) 425 (setq ediff-visible-bounds ediff-wide-bounds))
426 426
427 (ediff-set-keys) ; comes after parameter setup 427 (ediff-set-keys) ; comes after parameter setup
428 428
429 ;; set up ediff-narrow-bounds, if not set 429 ;; set up ediff-narrow-bounds, if not set
430 (or ediff-narrow-bounds 430 (or ediff-narrow-bounds
431 (setq ediff-narrow-bounds ediff-wide-bounds)) 431 (setq ediff-narrow-bounds ediff-wide-bounds))
432 432
433 ;; All these must be inside ediff-with-current-buffer control-buffer, 433 ;; All these must be inside ediff-with-current-buffer control-buffer,
434 ;; since these vars are local to control-buffer 434 ;; since these vars are local to control-buffer
435 ;; These won't run if there are errors in diff 435 ;; These won't run if there are errors in diff
@@ -472,7 +472,7 @@ to invocation.")
472 (or (memq control-buffer ediff-this-buffer-ediff-sessions) 472 (or (memq control-buffer ediff-this-buffer-ediff-sessions)
473 (setq ediff-this-buffer-ediff-sessions 473 (setq ediff-this-buffer-ediff-sessions
474 (cons control-buffer 474 (cons control-buffer
475 ediff-this-buffer-ediff-sessions))) 475 ediff-this-buffer-ediff-sessions)))
476 (if ediff-make-buffers-readonly-at-startup 476 (if ediff-make-buffers-readonly-at-startup
477 (setq buffer-read-only t) 477 (setq buffer-read-only t)
478 (setq buffer-read-only nil)) 478 (setq buffer-read-only nil))
@@ -488,22 +488,22 @@ to invocation.")
488 (cons control-buffer 488 (cons control-buffer
489 ediff-this-buffer-ediff-sessions))) 489 ediff-this-buffer-ediff-sessions)))
490 )) 490 ))
491 491
492 ;; the following must be after setting up ediff-narrow-bounds AND after 492 ;; the following must be after setting up ediff-narrow-bounds AND after
493 ;; nuking selective display 493 ;; nuking selective display
494 (funcall ediff-setup-diff-regions-function file-A file-B file-C) 494 (funcall ediff-setup-diff-regions-function file-A file-B file-C)
495 (setq ediff-number-of-differences (length ediff-difference-vector-A)) 495 (setq ediff-number-of-differences (length ediff-difference-vector-A))
496 (setq ediff-current-difference -1) 496 (setq ediff-current-difference -1)
497 497
498 (ediff-make-current-diff-overlay 'A) 498 (ediff-make-current-diff-overlay 'A)
499 (ediff-make-current-diff-overlay 'B) 499 (ediff-make-current-diff-overlay 'B)
500 (if ediff-3way-job 500 (if ediff-3way-job
501 (ediff-make-current-diff-overlay 'C)) 501 (ediff-make-current-diff-overlay 'C))
502 (if ediff-merge-with-ancestor-job 502 (if ediff-merge-with-ancestor-job
503 (ediff-make-current-diff-overlay 'Ancestor)) 503 (ediff-make-current-diff-overlay 'Ancestor))
504 504
505 (ediff-setup-windows buffer-A buffer-B buffer-C control-buffer) 505 (ediff-setup-windows buffer-A buffer-B buffer-C control-buffer)
506 506
507 (let ((shift-A (ediff-overlay-start 507 (let ((shift-A (ediff-overlay-start
508 (ediff-get-value-according-to-buffer-type 508 (ediff-get-value-according-to-buffer-type
509 'A ediff-narrow-bounds))) 509 'A ediff-narrow-bounds)))
@@ -526,10 +526,10 @@ to invocation.")
526 (select-window ediff-window-C) 526 (select-window ediff-window-C)
527 (goto-char shift-C))) 527 (goto-char shift-C)))
528 ) 528 )
529 529
530 (select-window ediff-control-window) 530 (select-window ediff-control-window)
531 (ediff-visible-region) 531 (ediff-visible-region)
532 532
533 (run-hooks 'startup-hooks) 533 (run-hooks 'startup-hooks)
534 (ediff-arrange-autosave-in-merge-jobs merge-buffer-file) 534 (ediff-arrange-autosave-in-merge-jobs merge-buffer-file)
535 535
@@ -544,10 +544,10 @@ to invocation.")
544 (run-hooks 'ediff-startup-hook) 544 (run-hooks 'ediff-startup-hook)
545 ) ; eval in control-buffer 545 ) ; eval in control-buffer
546 control-buffer)) 546 control-buffer))
547 547
548 548
549;; This function assumes that we are in the window where control buffer is 549;; This function assumes that we are in the window where control buffer is
550;; to reside. 550;; to reside.
551(defun ediff-setup-control-buffer (ctl-buf) 551(defun ediff-setup-control-buffer (ctl-buf)
552 "Set up window for control buffer." 552 "Set up window for control buffer."
553 (if (window-dedicated-p (selected-window)) 553 (if (window-dedicated-p (selected-window))
@@ -580,7 +580,7 @@ to invocation.")
580 (ediff-make-bottom-toolbar)) ; this checks if toolbar is requested 580 (ediff-make-bottom-toolbar)) ; this checks if toolbar is requested
581 (goto-char (point-min)) 581 (goto-char (point-min))
582 (skip-chars-forward ediff-whitespace))) 582 (skip-chars-forward ediff-whitespace)))
583 583
584;; This executes in control buffer and sets auto-save, visited file name, etc, 584;; This executes in control buffer and sets auto-save, visited file name, etc,
585;; in the merge buffer 585;; in the merge buffer
586(defun ediff-arrange-autosave-in-merge-jobs (merge-buffer-file) 586(defun ediff-arrange-autosave-in-merge-jobs (merge-buffer-file)
@@ -593,7 +593,7 @@ to invocation.")
593 (progn 593 (progn
594 ;; save before leaving ctl buffer 594 ;; save before leaving ctl buffer
595 (ediff-verify-file-merge-buffer ediff-merge-store-file) 595 (ediff-verify-file-merge-buffer ediff-merge-store-file)
596 (setq merge-buffer-file ediff-merge-store-file) 596 (setq merge-buffer-file ediff-merge-store-file)
597 (ediff-with-current-buffer ediff-buffer-C 597 (ediff-with-current-buffer ediff-buffer-C
598 (set-visited-file-name merge-buffer-file)))) 598 (set-visited-file-name merge-buffer-file))))
599 (ediff-with-current-buffer ediff-buffer-C 599 (ediff-with-current-buffer ediff-buffer-C
@@ -604,7 +604,7 @@ to invocation.")
604 604
605 605
606;;; Commands for working with Ediff 606;;; Commands for working with Ediff
607 607
608(defun ediff-update-diffs () 608(defun ediff-update-diffs ()
609 "Recompute difference regions in buffers A, B, and C. 609 "Recompute difference regions in buffers A, B, and C.
610Buffers are not synchronized with their respective files, so changes done 610Buffers are not synchronized with their respective files, so changes done
@@ -617,7 +617,7 @@ if necessary."
617 (y-or-n-p 617 (y-or-n-p
618 "Ancestor buffer will not be used. Recompute diffs anyway? "))) 618 "Ancestor buffer will not be used. Recompute diffs anyway? ")))
619 (error "Recomputation of differences canceled")) 619 (error "Recomputation of differences canceled"))
620 620
621 (let ((point-A (ediff-with-current-buffer ediff-buffer-A (point))) 621 (let ((point-A (ediff-with-current-buffer ediff-buffer-A (point)))
622 ;;(point-B (ediff-with-current-buffer ediff-buffer-B (point))) 622 ;;(point-B (ediff-with-current-buffer ediff-buffer-B (point)))
623 (tmp-buffer (get-buffer-create ediff-tmp-buffer)) 623 (tmp-buffer (get-buffer-create ediff-tmp-buffer))
@@ -643,14 +643,14 @@ if necessary."
643 (setq buf-C-file-name (file-name-nondirectory buf-C-file-name))) 643 (setq buf-C-file-name (file-name-nondirectory buf-C-file-name)))
644 644
645 (ediff-unselect-and-select-difference -1) 645 (ediff-unselect-and-select-difference -1)
646 646
647 (setq beg-A (ediff-overlay-start overl-A) 647 (setq beg-A (ediff-overlay-start overl-A)
648 beg-B (ediff-overlay-start overl-B) 648 beg-B (ediff-overlay-start overl-B)
649 beg-C (ediff-overlay-start overl-C) 649 beg-C (ediff-overlay-start overl-C)
650 end-A (ediff-overlay-end overl-A) 650 end-A (ediff-overlay-end overl-A)
651 end-B (ediff-overlay-end overl-B) 651 end-B (ediff-overlay-end overl-B)
652 end-C (ediff-overlay-end overl-C)) 652 end-C (ediff-overlay-end overl-C))
653 653
654 (if ediff-word-mode 654 (if ediff-word-mode
655 (progn 655 (progn
656 (ediff-wordify beg-A end-A ediff-buffer-A tmp-buffer) 656 (ediff-wordify beg-A end-A ediff-buffer-A tmp-buffer)
@@ -668,7 +668,7 @@ if necessary."
668 (if ediff-3way-job 668 (if ediff-3way-job
669 (setq file-C (ediff-make-temp-file ediff-buffer-C buf-C-file-name))) 669 (setq file-C (ediff-make-temp-file ediff-buffer-C buf-C-file-name)))
670 ) 670 )
671 671
672 (ediff-clear-diff-vector 'ediff-difference-vector-A 'fine-diffs-also) 672 (ediff-clear-diff-vector 'ediff-difference-vector-A 'fine-diffs-also)
673 (ediff-clear-diff-vector 'ediff-difference-vector-B 'fine-diffs-also) 673 (ediff-clear-diff-vector 'ediff-difference-vector-B 'fine-diffs-also)
674 (ediff-clear-diff-vector 'ediff-difference-vector-C 'fine-diffs-also) 674 (ediff-clear-diff-vector 'ediff-difference-vector-C 'fine-diffs-also)
@@ -681,7 +681,7 @@ if necessary."
681 ediff-state-of-merge nil) 681 ediff-state-of-merge nil)
682 682
683 (setq ediff-killed-diffs-alist nil) ; invalidate saved killed diff regions 683 (setq ediff-killed-diffs-alist nil) ; invalidate saved killed diff regions
684 684
685 ;; In case of merge job, fool it into thinking that it is just doing 685 ;; In case of merge job, fool it into thinking that it is just doing
686 ;; comparison 686 ;; comparison
687 (let ((ediff-setup-diff-regions-function ediff-setup-diff-regions-function) 687 (let ((ediff-setup-diff-regions-function ediff-setup-diff-regions-function)
@@ -696,20 +696,20 @@ if necessary."
696 ediff-merge-with-ancestor-job nil 696 ediff-merge-with-ancestor-job nil
697 ediff-job-name 'ediff-files3)) 697 ediff-job-name 'ediff-files3))
698 (funcall ediff-setup-diff-regions-function file-A file-B file-C)) 698 (funcall ediff-setup-diff-regions-function file-A file-B file-C))
699 699
700 (setq ediff-number-of-differences (length ediff-difference-vector-A)) 700 (setq ediff-number-of-differences (length ediff-difference-vector-A))
701 (delete-file file-A) 701 (delete-file file-A)
702 (delete-file file-B) 702 (delete-file file-B)
703 (if file-C 703 (if file-C
704 (delete-file file-C)) 704 (delete-file file-C))
705 705
706 (if ediff-3way-job 706 (if ediff-3way-job
707 (ediff-set-state-of-all-diffs-in-all-buffers ediff-control-buffer)) 707 (ediff-set-state-of-all-diffs-in-all-buffers ediff-control-buffer))
708 708
709 (ediff-jump-to-difference (ediff-diff-at-point 'A point-A)) 709 (ediff-jump-to-difference (ediff-diff-at-point 'A point-A))
710 (message "") 710 (message "")
711 )) 711 ))
712 712
713;; Not bound to any key---to dangerous. A user can do it if necessary. 713;; Not bound to any key---to dangerous. A user can do it if necessary.
714(defun ediff-revert-buffers-then-recompute-diffs (noconfirm) 714(defun ediff-revert-buffers-then-recompute-diffs (noconfirm)
715 "Revert buffers A, B and C. Then rerun Ediff on file A and file B." 715 "Revert buffers A, B and C. Then rerun Ediff on file A and file B."
@@ -746,7 +746,7 @@ if necessary."
746 (ediff-update-diffs)))) 746 (ediff-update-diffs))))
747 747
748 748
749;; optional NO-REHIGHLIGHT says to not rehighlight buffers 749;; optional NO-REHIGHLIGHT says to not rehighlight buffers
750(defun ediff-recenter (&optional no-rehighlight) 750(defun ediff-recenter (&optional no-rehighlight)
751 "Bring the highlighted region of all buffers being compared into view. 751 "Bring the highlighted region of all buffers being compared into view.
752Reestablish the default three-window display." 752Reestablish the default three-window display."
@@ -763,7 +763,7 @@ Reestablish the default three-window display."
763 (message ediff-KILLED-VITAL-BUFFER 763 (message ediff-KILLED-VITAL-BUFFER
764 (beep 1))) 764 (beep 1)))
765 )) 765 ))
766 766
767 ;; set visibility range appropriate to this invocation of Ediff. 767 ;; set visibility range appropriate to this invocation of Ediff.
768 (ediff-visible-region) 768 (ediff-visible-region)
769 ;; raise 769 ;; raise
@@ -797,7 +797,7 @@ Reestablish the default three-window display."
797 (not ediff-use-long-help-message) 797 (not ediff-use-long-help-message)
798 (not (ediff-frame-iconified-p ediff-control-frame))) 798 (not (ediff-frame-iconified-p ediff-control-frame)))
799 (raise-frame ediff-control-frame)) 799 (raise-frame ediff-control-frame))
800 800
801 ;; Redisplay whatever buffers are showing, if there is a selected difference 801 ;; Redisplay whatever buffers are showing, if there is a selected difference
802 (let ((control-frame ediff-control-frame) 802 (let ((control-frame ediff-control-frame)
803 (control-buf ediff-control-buffer)) 803 (control-buf ediff-control-buffer))
@@ -808,15 +808,15 @@ Reestablish the default three-window display."
808 (progn 808 (progn
809 (or no-rehighlight 809 (or no-rehighlight
810 (ediff-select-difference ediff-current-difference)) 810 (ediff-select-difference ediff-current-difference))
811 811
812 (ediff-recenter-one-window 'A) 812 (ediff-recenter-one-window 'A)
813 (ediff-recenter-one-window 'B) 813 (ediff-recenter-one-window 'B)
814 (if ediff-3way-job 814 (if ediff-3way-job
815 (ediff-recenter-one-window 'C)) 815 (ediff-recenter-one-window 'C))
816 816
817 (ediff-with-current-buffer control-buf 817 (ediff-with-current-buffer control-buf
818 (ediff-recenter-ancestor) ; check if ancestor is alive 818 (ediff-recenter-ancestor) ; check if ancestor is alive
819 819
820 (if (and (ediff-multiframe-setup-p) 820 (if (and (ediff-multiframe-setup-p)
821 (not ediff-use-long-help-message) 821 (not ediff-use-long-help-message)
822 (not (ediff-frame-iconified-p ediff-control-frame))) 822 (not (ediff-frame-iconified-p ediff-control-frame)))
@@ -829,7 +829,7 @@ Reestablish the default three-window display."
829 (ediff-restore-highlighting) 829 (ediff-restore-highlighting)
830 (ediff-with-current-buffer control-buf (ediff-refresh-mode-lines)) 830 (ediff-with-current-buffer control-buf (ediff-refresh-mode-lines))
831 )) 831 ))
832 832
833;; this function returns to the window it was called from 833;; this function returns to the window it was called from
834;; (which was the control window) 834;; (which was the control window)
835(defun ediff-recenter-one-window (buf-type) 835(defun ediff-recenter-one-window (buf-type)
@@ -837,7 +837,7 @@ Reestablish the default three-window display."
837 ;; context must be saved before switching to windows A/B/C 837 ;; context must be saved before switching to windows A/B/C
838 (let* ((ctl-wind (selected-window)) 838 (let* ((ctl-wind (selected-window))
839 (shift (ediff-overlay-start 839 (shift (ediff-overlay-start
840 (ediff-get-value-according-to-buffer-type 840 (ediff-get-value-according-to-buffer-type
841 buf-type ediff-narrow-bounds))) 841 buf-type ediff-narrow-bounds)))
842 (job-name ediff-job-name) 842 (job-name ediff-job-name)
843 (control-buf ediff-control-buffer) 843 (control-buf ediff-control-buffer)
@@ -845,7 +845,7 @@ Reestablish the default three-window display."
845 buf-type ediff-window-alist)) 845 buf-type ediff-window-alist))
846 (window (if (window-live-p (symbol-value window-name)) 846 (window (if (window-live-p (symbol-value window-name))
847 (symbol-value window-name)))) 847 (symbol-value window-name))))
848 848
849 (if (and window ediff-windows-job) 849 (if (and window ediff-windows-job)
850 (set-window-start window shift)) 850 (set-window-start window shift))
851 (if window 851 (if window
@@ -883,10 +883,10 @@ Reestablish the default three-window display."
883 (select-window ctl-wind) 883 (select-window ctl-wind)
884 ))) 884 )))
885 885
886 886
887;; This will have to be refined for 3way jobs 887;; This will have to be refined for 3way jobs
888(defun ediff-toggle-split () 888(defun ediff-toggle-split ()
889 "Toggle vertical/horizontal window split. 889 "Toggle vertical/horizontal window split.
890Does nothing if file-A and file-B are in different frames." 890Does nothing if file-A and file-B are in different frames."
891 (interactive) 891 (interactive)
892 (ediff-barf-if-not-control-buffer) 892 (ediff-barf-if-not-control-buffer)
@@ -908,10 +908,10 @@ Does nothing if file-A and file-B are in different frames."
908 'split-window-vertically)) 908 'split-window-vertically))
909 (message "Buffers being compared are in different frames")) 909 (message "Buffers being compared are in different frames"))
910 (ediff-recenter 'no-rehighlight))) 910 (ediff-recenter 'no-rehighlight)))
911 911
912(defun ediff-toggle-hilit () 912(defun ediff-toggle-hilit ()
913 "Switch between highlighting using ASCII flags and highlighting using faces. 913 "Switch between highlighting using ASCII flags and highlighting using faces.
914On a dumb terminal, switches between ASCII highlighting and no highlighting." 914On a dumb terminal, switches between ASCII highlighting and no highlighting."
915 (interactive) 915 (interactive)
916 (ediff-barf-if-not-control-buffer) 916 (ediff-barf-if-not-control-buffer)
917 917
@@ -941,15 +941,15 @@ On a dumb terminal, switches between ASCII highlighting and no highlighting."
941 (setq ediff-use-faces t 941 (setq ediff-use-faces t
942 ediff-highlighting-style 'face 942 ediff-highlighting-style 'face
943 ediff-highlight-all-diffs t))) 943 ediff-highlight-all-diffs t)))
944 944
945 (if (and ediff-use-faces ediff-highlight-all-diffs) 945 (if (and ediff-use-faces ediff-highlight-all-diffs)
946 (ediff-paint-background-regions) 946 (ediff-paint-background-regions)
947 (ediff-paint-background-regions 'unhighlight)) 947 (ediff-paint-background-regions 'unhighlight))
948 948
949 (ediff-unselect-and-select-difference 949 (ediff-unselect-and-select-difference
950 ediff-current-difference 'select-only)) 950 ediff-current-difference 'select-only))
951 951
952 952
953(defun ediff-toggle-autorefine () 953(defun ediff-toggle-autorefine ()
954 "Toggle auto-refine mode." 954 "Toggle auto-refine mode."
955 (interactive) 955 (interactive)
@@ -981,10 +981,10 @@ On a dumb terminal, switches between ASCII highlighting and no highlighting."
981 (cond ((setq wind (ediff-get-visible-buffer-window ediff-ancestor-buffer)) 981 (cond ((setq wind (ediff-get-visible-buffer-window ediff-ancestor-buffer))
982 (raise-frame (window-frame wind))) 982 (raise-frame (window-frame wind)))
983 (t (set-window-buffer ediff-window-C ediff-ancestor-buffer))))) 983 (t (set-window-buffer ediff-window-C ediff-ancestor-buffer)))))
984 984
985(defun ediff-make-or-kill-fine-diffs (arg) 985(defun ediff-make-or-kill-fine-diffs (arg)
986 "Compute fine diffs. With negative prefix arg, kill fine diffs. 986 "Compute fine diffs. With negative prefix arg, kill fine diffs.
987In both cases, operates on the current difference region." 987In both cases, operates on the current difference region."
988 (interactive "P") 988 (interactive "P")
989 (ediff-barf-if-not-control-buffer) 989 (ediff-barf-if-not-control-buffer)
990 (cond ((eq arg '-) 990 (cond ((eq arg '-)
@@ -992,8 +992,8 @@ In both cases, operates on the current difference region."
992 ((and (numberp arg) (< arg 0)) 992 ((and (numberp arg) (< arg 0))
993 (ediff-clear-fine-differences ediff-current-difference)) 993 (ediff-clear-fine-differences ediff-current-difference))
994 (t (ediff-make-fine-diffs)))) 994 (t (ediff-make-fine-diffs))))
995 995
996 996
997(defun ediff-toggle-help () 997(defun ediff-toggle-help ()
998 "Toggle short/long help message." 998 "Toggle short/long help message."
999 (interactive) 999 (interactive)
@@ -1007,11 +1007,11 @@ In both cases, operates on the current difference region."
1007 (if (and ediff-use-long-help-message (ediff-multiframe-setup-p)) 1007 (if (and ediff-use-long-help-message (ediff-multiframe-setup-p))
1008 (setq ediff-prefer-iconified-control-frame 1008 (setq ediff-prefer-iconified-control-frame
1009 (ediff-frame-iconified-p ediff-control-frame))) 1009 (ediff-frame-iconified-p ediff-control-frame)))
1010 1010
1011 (setq ediff-window-config-saved "") ; force redisplay 1011 (setq ediff-window-config-saved "") ; force redisplay
1012 (ediff-recenter 'no-rehighlight)) 1012 (ediff-recenter 'no-rehighlight))
1013 1013
1014 1014
1015;; If BUF, this is the buffer to toggle, not current buffer. 1015;; If BUF, this is the buffer to toggle, not current buffer.
1016(defun ediff-toggle-read-only (&optional buf) 1016(defun ediff-toggle-read-only (&optional buf)
1017 "Toggle read-only in current buffer. 1017 "Toggle read-only in current buffer.
@@ -1025,7 +1025,7 @@ of the current buffer."
1025 (or buf (ediff-recenter)) 1025 (or buf (ediff-recenter))
1026 (or buf 1026 (or buf
1027 (setq buf (ediff-get-buffer buf-type))) 1027 (setq buf (ediff-get-buffer buf-type)))
1028 1028
1029 (ediff-with-current-buffer buf ; eval in buf A/B/C 1029 (ediff-with-current-buffer buf ; eval in buf A/B/C
1030 (let* ((file (buffer-file-name buf)) 1030 (let* ((file (buffer-file-name buf))
1031 (file-writable (and file 1031 (file-writable (and file
@@ -1065,14 +1065,14 @@ of the current buffer."
1065 (message 1065 (message
1066 "Boy, this is risky! Don't modify this file...") 1066 "Boy, this is risky! Don't modify this file...")
1067 (sit-for 3)))) ; let the user see the warning 1067 (sit-for 3)))) ; let the user see the warning
1068 (if (and toggle-ro-cmd 1068 (if (and toggle-ro-cmd
1069 (string-match "toggle-read-only" (symbol-name toggle-ro-cmd))) 1069 (string-match "toggle-read-only" (symbol-name toggle-ro-cmd)))
1070 (save-excursion 1070 (save-excursion
1071 (save-window-excursion 1071 (save-window-excursion
1072 (select-window (ediff-get-visible-buffer-window buf)) 1072 (select-window (ediff-get-visible-buffer-window buf))
1073 (command-execute toggle-ro-cmd))) 1073 (command-execute toggle-ro-cmd)))
1074 (error "Don't know how to toggle read-only in buffer %S" buf)) 1074 (error "Don't know how to toggle read-only in buffer %S" buf))
1075 1075
1076 ;; Check if we made the current buffer updatable, but its file is RO. 1076 ;; Check if we made the current buffer updatable, but its file is RO.
1077 ;; Signal a warning in this case. 1077 ;; Signal a warning in this case.
1078 (if (and file (not buffer-read-only) 1078 (if (and file (not buffer-read-only)
@@ -1095,7 +1095,7 @@ of the current buffer."
1095 (ediff-abbreviate-file-name file)))) 1095 (ediff-abbreviate-file-name file))))
1096 (ediff-with-current-buffer buf 1096 (ediff-with-current-buffer buf
1097 (command-execute checkout-function))))) 1097 (command-execute checkout-function)))))
1098 1098
1099 1099
1100;; This is a simple-minded check for whether a file is under version control. 1100;; This is a simple-minded check for whether a file is under version control.
1101;; If file,v exists but file doesn't, this file is considered to be not checked 1101;; If file,v exists but file doesn't, this file is considered to be not checked
@@ -1131,7 +1131,7 @@ of the current buffer."
1131 ;; XEmacs has no vc-state 1131 ;; XEmacs has no vc-state
1132 (vc-locking-user file)) 1132 (vc-locking-user file))
1133 ))) 1133 )))
1134 1134
1135(defsubst ediff-file-checked-in-p (file) 1135(defsubst ediff-file-checked-in-p (file)
1136 (and (featurep 'vc-hooks) 1136 (and (featurep 'vc-hooks)
1137 ;; CVS files are considered not checked in 1137 ;; CVS files are considered not checked in
@@ -1151,7 +1151,7 @@ of the current buffer."
1151 (if (featurep 'jka-compr) 1151 (if (featurep 'jka-compr)
1152 (string-match (jka-compr-build-file-regexp) file))) 1152 (string-match (jka-compr-build-file-regexp) file)))
1153 1153
1154 1154
1155(defun ediff-swap-buffers () 1155(defun ediff-swap-buffers ()
1156 "Rotate the display of buffers A, B, and C." 1156 "Rotate the display of buffers A, B, and C."
1157 (interactive) 1157 (interactive)
@@ -1180,7 +1180,7 @@ of the current buffer."
1180 ediff-buffer-B buf) 1180 ediff-buffer-B buf)
1181 (setq ediff-buffer-A ediff-buffer-B 1181 (setq ediff-buffer-A ediff-buffer-B
1182 ediff-buffer-B buf)) 1182 ediff-buffer-B buf))
1183 1183
1184 ;; swap saved buffer characteristics 1184 ;; swap saved buffer characteristics
1185 (if ediff-3way-comparison-job 1185 (if ediff-3way-comparison-job
1186 (setq ediff-buffer-values-orig-A ediff-buffer-values-orig-C 1186 (setq ediff-buffer-values-orig-A ediff-buffer-values-orig-C
@@ -1188,7 +1188,7 @@ of the current buffer."
1188 ediff-buffer-values-orig-B values) 1188 ediff-buffer-values-orig-B values)
1189 (setq ediff-buffer-values-orig-A ediff-buffer-values-orig-B 1189 (setq ediff-buffer-values-orig-A ediff-buffer-values-orig-B
1190 ediff-buffer-values-orig-B values)) 1190 ediff-buffer-values-orig-B values))
1191 1191
1192 ;; swap diff vectors 1192 ;; swap diff vectors
1193 (if ediff-3way-comparison-job 1193 (if ediff-3way-comparison-job
1194 (setq ediff-difference-vector-A ediff-difference-vector-C 1194 (setq ediff-difference-vector-A ediff-difference-vector-C
@@ -1196,7 +1196,7 @@ of the current buffer."
1196 ediff-difference-vector-B diff-vec) 1196 ediff-difference-vector-B diff-vec)
1197 (setq ediff-difference-vector-A ediff-difference-vector-B 1197 (setq ediff-difference-vector-A ediff-difference-vector-B
1198 ediff-difference-vector-B diff-vec)) 1198 ediff-difference-vector-B diff-vec))
1199 1199
1200 ;; swap hide/focus regexp 1200 ;; swap hide/focus regexp
1201 (if ediff-3way-comparison-job 1201 (if ediff-3way-comparison-job
1202 (setq ediff-regexp-hide-A ediff-regexp-hide-C 1202 (setq ediff-regexp-hide-A ediff-regexp-hide-C
@@ -1209,7 +1209,7 @@ of the current buffer."
1209 ediff-regexp-hide-B hide-regexp 1209 ediff-regexp-hide-B hide-regexp
1210 ediff-regexp-focus-A ediff-regexp-focus-B 1210 ediff-regexp-focus-A ediff-regexp-focus-B
1211 ediff-regexp-focus-B focus-regexp)) 1211 ediff-regexp-focus-B focus-regexp))
1212 1212
1213 ;; The following is needed for XEmacs, since there one can't move 1213 ;; The following is needed for XEmacs, since there one can't move
1214 ;; overlay to another buffer. In Emacs, this swap is redundant. 1214 ;; overlay to another buffer. In Emacs, this swap is redundant.
1215 (if (ediff-has-face-support-p) 1215 (if (ediff-has-face-support-p)
@@ -1219,7 +1219,7 @@ of the current buffer."
1219 ediff-current-diff-overlay-B overlay) 1219 ediff-current-diff-overlay-B overlay)
1220 (setq ediff-current-diff-overlay-A ediff-current-diff-overlay-B 1220 (setq ediff-current-diff-overlay-A ediff-current-diff-overlay-B
1221 ediff-current-diff-overlay-B overlay))) 1221 ediff-current-diff-overlay-B overlay)))
1222 1222
1223 ;; swap wide bounds 1223 ;; swap wide bounds
1224 (setq ediff-wide-bounds 1224 (setq ediff-wide-bounds
1225 (cond (ediff-3way-comparison-job 1225 (cond (ediff-3way-comparison-job
@@ -1230,7 +1230,7 @@ of the current buffer."
1230 (list (nth 1 ediff-wide-bounds) 1230 (list (nth 1 ediff-wide-bounds)
1231 (nth 0 ediff-wide-bounds) 1231 (nth 0 ediff-wide-bounds)
1232 (nth 2 ediff-wide-bounds))) 1232 (nth 2 ediff-wide-bounds)))
1233 (t 1233 (t
1234 (list (nth 1 ediff-wide-bounds) 1234 (list (nth 1 ediff-wide-bounds)
1235 (nth 0 ediff-wide-bounds))))) 1235 (nth 0 ediff-wide-bounds)))))
1236 ;; swap narrow bounds 1236 ;; swap narrow bounds
@@ -1243,7 +1243,7 @@ of the current buffer."
1243 (list (nth 1 ediff-narrow-bounds) 1243 (list (nth 1 ediff-narrow-bounds)
1244 (nth 0 ediff-narrow-bounds) 1244 (nth 0 ediff-narrow-bounds)
1245 (nth 2 ediff-narrow-bounds))) 1245 (nth 2 ediff-narrow-bounds)))
1246 (t 1246 (t
1247 (list (nth 1 ediff-narrow-bounds) 1247 (list (nth 1 ediff-narrow-bounds)
1248 (nth 0 ediff-narrow-bounds))))) 1248 (nth 0 ediff-narrow-bounds)))))
1249 (if wide-visibility-p 1249 (if wide-visibility-p
@@ -1254,7 +1254,7 @@ of the current buffer."
1254 (ediff-set-state-of-all-diffs-in-all-buffers ediff-control-buffer)) 1254 (ediff-set-state-of-all-diffs-in-all-buffers ediff-control-buffer))
1255 (ediff-recenter 'no-rehighlight) 1255 (ediff-recenter 'no-rehighlight)
1256 ) 1256 )
1257 1257
1258 1258
1259(defun ediff-toggle-wide-display () 1259(defun ediff-toggle-wide-display ()
1260 "Toggle wide/regular display. 1260 "Toggle wide/regular display.
@@ -1283,7 +1283,7 @@ This is especially useful when comparing buffers side-by-side."
1283 (ediff-with-current-buffer ctl-buf 1283 (ediff-with-current-buffer ctl-buf
1284 (setq ediff-window-B nil) ; force update of window config 1284 (setq ediff-window-B nil) ; force update of window config
1285 (ediff-recenter 'no-rehighlight))))) 1285 (ediff-recenter 'no-rehighlight)))))
1286 1286
1287;;;###autoload 1287;;;###autoload
1288(defun ediff-toggle-multiframe () 1288(defun ediff-toggle-multiframe ()
1289 "Switch from multiframe display to single-frame display and back. 1289 "Switch from multiframe display to single-frame display and back.
@@ -1328,7 +1328,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see."
1328 (ediff-kill-bottom-toolbar)) 1328 (ediff-kill-bottom-toolbar))
1329 ;; do this only after killing the toolbar 1329 ;; do this only after killing the toolbar
1330 (setq ediff-use-toolbar-p (not ediff-use-toolbar-p)) 1330 (setq ediff-use-toolbar-p (not ediff-use-toolbar-p))
1331 1331
1332 (mapcar (lambda(buf) 1332 (mapcar (lambda(buf)
1333 (ediff-with-current-buffer buf 1333 (ediff-with-current-buffer buf
1334 ;; force redisplay 1334 ;; force redisplay
@@ -1346,7 +1346,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see."
1346 ;;(selected-frame). 1346 ;;(selected-frame).
1347 ;; The problem with this is that any previous bottom-toolbar 1347 ;; The problem with this is that any previous bottom-toolbar
1348 ;; will not re-appear after our cleanup here. Is there a way 1348 ;; will not re-appear after our cleanup here. Is there a way
1349 ;; to do "push" and "pop" toolbars ? --marcpa 1349 ;; to do "push" and "pop" toolbars ? --marcpa
1350 (if (ediff-use-toolbar-p) 1350 (if (ediff-use-toolbar-p)
1351 (ediff-cond-compile-for-xemacs-or-emacs 1351 (ediff-cond-compile-for-xemacs-or-emacs
1352 (progn ; xemacs 1352 (progn ; xemacs
@@ -1370,7 +1370,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see."
1370 bottom-toolbar 1370 bottom-toolbar
1371 (list frame (if (ediff-3way-comparison-job) 1371 (list frame (if (ediff-3way-comparison-job)
1372 ediff-toolbar-3way ediff-toolbar))) 1372 ediff-toolbar-3way ediff-toolbar)))
1373 (set-specifier bottom-toolbar-visible-p (list frame t)) 1373 (set-specifier bottom-toolbar-visible-p (list frame t))
1374 (set-specifier bottom-toolbar-height 1374 (set-specifier bottom-toolbar-height
1375 (list frame ediff-toolbar-height))) 1375 (list frame ediff-toolbar-height)))
1376 nil ; emacs 1376 nil ; emacs
@@ -1384,7 +1384,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see."
1384 ) 1384 )
1385 )) 1385 ))
1386 )) 1386 ))
1387 1387
1388;; Merging 1388;; Merging
1389 1389
1390(defun ediff-toggle-show-clashes-only () 1390(defun ediff-toggle-show-clashes-only ()
@@ -1409,7 +1409,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see."
1409 (message "Showing regions that differ from default setting"))) 1409 (message "Showing regions that differ from default setting")))
1410 1410
1411 1411
1412 1412
1413;; Widening/narrowing 1413;; Widening/narrowing
1414 1414
1415(defun ediff-toggle-narrow-region () 1415(defun ediff-toggle-narrow-region ()
@@ -1422,11 +1422,11 @@ Used in ediff-windows/regions only."
1422 (setq ediff-visible-bounds ediff-narrow-bounds) 1422 (setq ediff-visible-bounds ediff-narrow-bounds)
1423 (setq ediff-visible-bounds ediff-wide-bounds)) 1423 (setq ediff-visible-bounds ediff-wide-bounds))
1424 (ediff-recenter 'no-rehighlight)) 1424 (ediff-recenter 'no-rehighlight))
1425 1425
1426;; Narrow bufs A/B/C to ediff-visible-bounds. If this is currently set to 1426;; Narrow bufs A/B/C to ediff-visible-bounds. If this is currently set to
1427;; ediff-wide-bounds, then this actually widens. 1427;; ediff-wide-bounds, then this actually widens.
1428;; This function does nothing if job-name is not 1428;; This function does nothing if job-name is not
1429;; ediff-regions-wordwise/linewise or ediff-windows-wordwise/linewise. 1429;; ediff-regions-wordwise/linewise or ediff-windows-wordwise/linewise.
1430;; Does nothing if buffer-A = buffer-B since we can't narrow 1430;; Does nothing if buffer-A = buffer-B since we can't narrow
1431;; to two different regions in one buffer. 1431;; to two different regions in one buffer.
1432(defun ediff-visible-region () 1432(defun ediff-visible-region ()
@@ -1453,13 +1453,13 @@ Used in ediff-windows/regions only."
1453 (if (ediff-overlay-buffer overl-B) 1453 (if (ediff-overlay-buffer overl-B)
1454 (narrow-to-region 1454 (narrow-to-region
1455 (ediff-overlay-start overl-B) (ediff-overlay-end overl-B)))) 1455 (ediff-overlay-start overl-B) (ediff-overlay-end overl-B))))
1456 1456
1457 (if (and ediff-3way-job (ediff-overlay-buffer overl-C)) 1457 (if (and ediff-3way-job (ediff-overlay-buffer overl-C))
1458 (ediff-with-current-buffer ediff-buffer-C 1458 (ediff-with-current-buffer ediff-buffer-C
1459 (narrow-to-region 1459 (narrow-to-region
1460 (ediff-overlay-start overl-C) (ediff-overlay-end overl-C)))) 1460 (ediff-overlay-start overl-C) (ediff-overlay-end overl-C))))
1461 ))) 1461 )))
1462 1462
1463 1463
1464;; Window scrolling operations 1464;; Window scrolling operations
1465 1465
@@ -1468,7 +1468,7 @@ Used in ediff-windows/regions only."
1468;; Usually, errors come from scrolling off the 1468;; Usually, errors come from scrolling off the
1469;; beginning or end of the buffer, and this gives error messages. 1469;; beginning or end of the buffer, and this gives error messages.
1470(defun ediff-operate-on-windows (operation arg) 1470(defun ediff-operate-on-windows (operation arg)
1471 1471
1472 ;; make sure windows aren't dead 1472 ;; make sure windows aren't dead
1473 (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B))) 1473 (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B)))
1474 (ediff-recenter 'no-rehighlight)) 1474 (ediff-recenter 'no-rehighlight))
@@ -1477,7 +1477,7 @@ Used in ediff-windows/regions only."
1477 (or (not ediff-3way-job) ediff-buffer-C) 1477 (or (not ediff-3way-job) ediff-buffer-C)
1478 )) 1478 ))
1479 (error ediff-KILLED-VITAL-BUFFER)) 1479 (error ediff-KILLED-VITAL-BUFFER))
1480 1480
1481 (let* ((wind (selected-window)) 1481 (let* ((wind (selected-window))
1482 (wind-A ediff-window-A) 1482 (wind-A ediff-window-A)
1483 (wind-B ediff-window-B) 1483 (wind-B ediff-window-B)
@@ -1487,7 +1487,7 @@ Used in ediff-windows/regions only."
1487 (three-way ediff-3way-job) 1487 (three-way ediff-3way-job)
1488 (coefC (if three-way 1488 (coefC (if three-way
1489 (ediff-get-region-size-coefficient 'C operation)))) 1489 (ediff-get-region-size-coefficient 'C operation))))
1490 1490
1491 (select-window wind-A) 1491 (select-window wind-A)
1492 (condition-case nil 1492 (condition-case nil
1493 (funcall operation (round (* coefA arg))) 1493 (funcall operation (round (* coefA arg)))
@@ -1510,7 +1510,7 @@ With optional argument ARG, scroll ARG lines; otherwise scroll by nearly
1510the one half of the height of window-A." 1510the one half of the height of window-A."
1511 (interactive "P") 1511 (interactive "P")
1512 (ediff-barf-if-not-control-buffer) 1512 (ediff-barf-if-not-control-buffer)
1513 1513
1514 ;; make sure windows aren't dead 1514 ;; make sure windows aren't dead
1515 (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B))) 1515 (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B)))
1516 (ediff-recenter 'no-rehighlight)) 1516 (ediff-recenter 'no-rehighlight))
@@ -1520,10 +1520,10 @@ the one half of the height of window-A."
1520 (ediff-buffer-live-p ediff-buffer-C)) 1520 (ediff-buffer-live-p ediff-buffer-C))
1521 )) 1521 ))
1522 (error ediff-KILLED-VITAL-BUFFER)) 1522 (error ediff-KILLED-VITAL-BUFFER))
1523 1523
1524 (ediff-operate-on-windows 1524 (ediff-operate-on-windows
1525 (if (memq last-command-char '(?v ?\C-v)) 1525 (if (memq last-command-char '(?v ?\C-v))
1526 'scroll-up 1526 'scroll-up
1527 'scroll-down) 1527 'scroll-down)
1528 ;; calculate argument to scroll-up/down 1528 ;; calculate argument to scroll-up/down
1529 ;; if there is an explicit argument 1529 ;; if there is an explicit argument
@@ -1532,7 +1532,7 @@ the one half of the height of window-A."
1532 (prefix-numeric-value arg) 1532 (prefix-numeric-value arg)
1533 ;; if not, see if we can determine a default amount (the window height) 1533 ;; if not, see if we can determine a default amount (the window height)
1534 (let (default-amount) 1534 (let (default-amount)
1535 (setq default-amount 1535 (setq default-amount
1536 (- (/ (min (window-height ediff-window-A) 1536 (- (/ (min (window-height ediff-window-A)
1537 (window-height ediff-window-B) 1537 (window-height ediff-window-B)
1538 (if ediff-3way-job 1538 (if ediff-3way-job
@@ -1554,7 +1554,7 @@ If an argument is given, that is how many columns are scrolled, else nearly
1554the width of the A/B/C windows." 1554the width of the A/B/C windows."
1555 (interactive "P") 1555 (interactive "P")
1556 (ediff-barf-if-not-control-buffer) 1556 (ediff-barf-if-not-control-buffer)
1557 1557
1558 ;; make sure windows aren't dead 1558 ;; make sure windows aren't dead
1559 (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B))) 1559 (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B)))
1560 (ediff-recenter 'no-rehighlight)) 1560 (ediff-recenter 'no-rehighlight))
@@ -1564,14 +1564,14 @@ the width of the A/B/C windows."
1564 (ediff-buffer-live-p ediff-buffer-C)) 1564 (ediff-buffer-live-p ediff-buffer-C))
1565 )) 1565 ))
1566 (error ediff-KILLED-VITAL-BUFFER)) 1566 (error ediff-KILLED-VITAL-BUFFER))
1567 1567
1568 (ediff-operate-on-windows 1568 (ediff-operate-on-windows
1569 ;; Arrange for scroll-left and scroll-right being called 1569 ;; Arrange for scroll-left and scroll-right being called
1570 ;; interactively so that they set the window's min_hscroll. 1570 ;; interactively so that they set the window's min_hscroll.
1571 ;; Otherwise, automatic hscrolling will undo the effect of 1571 ;; Otherwise, automatic hscrolling will undo the effect of
1572 ;; hscrolling. 1572 ;; hscrolling.
1573 (if (= last-command-char ?<) 1573 (if (= last-command-char ?<)
1574 (lambda (arg) 1574 (lambda (arg)
1575 (let ((prefix-arg arg)) 1575 (let ((prefix-arg arg))
1576 (call-interactively 'scroll-left))) 1576 (call-interactively 'scroll-left)))
1577 (lambda (arg) 1577 (lambda (arg)
@@ -1606,7 +1606,7 @@ the width of the A/B/C windows."
1606 1606
1607;;BEG, END show the region to be positioned. 1607;;BEG, END show the region to be positioned.
1608;;JOB-NAME holds ediff-job-name. The ediff-windows job positions regions 1608;;JOB-NAME holds ediff-job-name. The ediff-windows job positions regions
1609;;differently. 1609;;differently.
1610(defun ediff-position-region (beg end pos job-name) 1610(defun ediff-position-region (beg end pos job-name)
1611 (if (> end (point-max)) 1611 (if (> end (point-max))
1612 (setq end (point-max))) 1612 (setq end (point-max)))
@@ -1706,7 +1706,7 @@ the width of the A/B/C windows."
1706 1706
1707 1707
1708(defun ediff-next-difference (&optional arg) 1708(defun ediff-next-difference (&optional arg)
1709 "Advance to the next difference. 1709 "Advance to the next difference.
1710With a prefix argument, go forward that many differences." 1710With a prefix argument, go forward that many differences."
1711 (interactive "p") 1711 (interactive "p")
1712 (ediff-barf-if-not-control-buffer) 1712 (ediff-barf-if-not-control-buffer)
@@ -1714,13 +1714,13 @@ With a prefix argument, go forward that many differences."
1714 (let ((n (min ediff-number-of-differences 1714 (let ((n (min ediff-number-of-differences
1715 (+ ediff-current-difference (or arg 1)))) 1715 (+ ediff-current-difference (or arg 1))))
1716 non-clash-skip skip-changed regexp-skip) 1716 non-clash-skip skip-changed regexp-skip)
1717 1717
1718 (ediff-visible-region) 1718 (ediff-visible-region)
1719 (or (>= n ediff-number-of-differences) 1719 (or (>= n ediff-number-of-differences)
1720 (setq regexp-skip (funcall ediff-skip-diff-region-function n)) 1720 (setq regexp-skip (funcall ediff-skip-diff-region-function n))
1721 ;; this won't exec if regexp-skip is t 1721 ;; this won't exec if regexp-skip is t
1722 (setq non-clash-skip (ediff-merge-region-is-non-clash n) 1722 (setq non-clash-skip (ediff-merge-region-is-non-clash n)
1723 skip-changed 1723 skip-changed
1724 (ediff-skip-merge-region-if-changed-from-default-p n)) 1724 (ediff-skip-merge-region-if-changed-from-default-p n))
1725 (ediff-install-fine-diff-if-necessary n)) 1725 (ediff-install-fine-diff-if-necessary n))
1726 ;; Skip loop 1726 ;; Skip loop
@@ -1756,20 +1756,20 @@ With a prefix argument, go forward that many differences."
1756 (error "At end of the difference list"))) 1756 (error "At end of the difference list")))
1757 1757
1758(defun ediff-previous-difference (&optional arg) 1758(defun ediff-previous-difference (&optional arg)
1759 "Go to the previous difference. 1759 "Go to the previous difference.
1760With a prefix argument, go back that many differences." 1760With a prefix argument, go back that many differences."
1761 (interactive "p") 1761 (interactive "p")
1762 (ediff-barf-if-not-control-buffer) 1762 (ediff-barf-if-not-control-buffer)
1763 (if (> ediff-current-difference -1) 1763 (if (> ediff-current-difference -1)
1764 (let ((n (max -1 (- ediff-current-difference (or arg 1)))) 1764 (let ((n (max -1 (- ediff-current-difference (or arg 1))))
1765 non-clash-skip skip-changed regexp-skip) 1765 non-clash-skip skip-changed regexp-skip)
1766 1766
1767 (ediff-visible-region) 1767 (ediff-visible-region)
1768 (or (< n 0) 1768 (or (< n 0)
1769 (setq regexp-skip (funcall ediff-skip-diff-region-function n)) 1769 (setq regexp-skip (funcall ediff-skip-diff-region-function n))
1770 ;; this won't exec if regexp-skip is t 1770 ;; this won't exec if regexp-skip is t
1771 (setq non-clash-skip (ediff-merge-region-is-non-clash n) 1771 (setq non-clash-skip (ediff-merge-region-is-non-clash n)
1772 skip-changed 1772 skip-changed
1773 (ediff-skip-merge-region-if-changed-from-default-p n)) 1773 (ediff-skip-merge-region-if-changed-from-default-p n))
1774 (ediff-install-fine-diff-if-necessary n)) 1774 (ediff-install-fine-diff-if-necessary n))
1775 (while (and (> n -1) 1775 (while (and (> n -1)
@@ -1822,7 +1822,7 @@ If the prefix is negative, count differences from the end."
1822 (ediff-unselect-and-select-difference difference-number) 1822 (ediff-unselect-and-select-difference difference-number)
1823 (error ediff-BAD-DIFF-NUMBER 1823 (error ediff-BAD-DIFF-NUMBER
1824 this-command (1+ difference-number) ediff-number-of-differences))) 1824 this-command (1+ difference-number) ediff-number-of-differences)))
1825 1825
1826(defun ediff-jump-to-difference-at-point (arg) 1826(defun ediff-jump-to-difference-at-point (arg)
1827 "Go to difference closest to the point in buffer A, B, or C. 1827 "Go to difference closest to the point in buffer A, B, or C.
1828The buffer depends on last command character \(a, b, or c\) that invoked this 1828The buffer depends on last command character \(a, b, or c\) that invoked this
@@ -1877,11 +1877,11 @@ in the specified buffer."
1877 (select-window ctl-wind) 1877 (select-window ctl-wind)
1878 )) 1878 ))
1879 )) 1879 ))
1880 1880
1881 1881
1882;; find region most related to the current point position (or POS, if given) 1882;; find region most related to the current point position (or POS, if given)
1883;; returns diff number as seen by the user (i.e., 1+ the internal 1883;; returns diff number as seen by the user (i.e., 1+ the internal
1884;; representation) 1884;; representation)
1885;; The optional argument WHICH-DIFF can be `after' or `before'. If `after', 1885;; The optional argument WHICH-DIFF can be `after' or `before'. If `after',
1886;; find the diff after the point. If `before', find the diff before the 1886;; find the diff after the point. If `before', find the diff before the
1887;; point. If the point is inside a diff, return that diff. 1887;; point. If the point is inside a diff, return that diff.
@@ -1894,7 +1894,7 @@ in the specified buffer."
1894 (prev-end 0) 1894 (prev-end 0)
1895 (beg 0) 1895 (beg 0)
1896 (end 0)) 1896 (end 0))
1897 1897
1898 (ediff-with-current-buffer buffer 1898 (ediff-with-current-buffer buffer
1899 (setq pos (or pos (point))) 1899 (setq pos (or pos (point)))
1900 (while (and (or (< pos prev-beg) (> pos beg)) 1900 (while (and (or (< pos prev-beg) (> pos beg))
@@ -1905,7 +1905,7 @@ in the specified buffer."
1905 (setq beg (ediff-get-diff-posn buf-type 'beg diff-no ctl-buffer) 1905 (setq beg (ediff-get-diff-posn buf-type 'beg diff-no ctl-buffer)
1906 end (ediff-get-diff-posn buf-type 'end diff-no ctl-buffer)) 1906 end (ediff-get-diff-posn buf-type 'end diff-no ctl-buffer))
1907 ) 1907 )
1908 1908
1909 ;; boost diff-no by 1, if past the last diff region 1909 ;; boost diff-no by 1, if past the last diff region
1910 (if (and (memq which-diff '(after before)) 1910 (if (and (memq which-diff '(after before))
1911 (> pos beg) (= diff-no max-dif-num)) 1911 (> pos beg) (= diff-no max-dif-num))
@@ -2003,20 +2003,20 @@ ARG is a prefix argument. If nil, copy the current difference region."
2003 messg 2003 messg
2004 ediff-verbose-p 2004 ediff-verbose-p
2005 reg-to-delete reg-to-delete-beg reg-to-delete-end) 2005 reg-to-delete reg-to-delete-beg reg-to-delete-end)
2006 2006
2007 (setq reg-to-delete-beg 2007 (setq reg-to-delete-beg
2008 (ediff-get-diff-posn to-buf-type 'beg n ctrl-buf)) 2008 (ediff-get-diff-posn to-buf-type 'beg n ctrl-buf))
2009 (setq reg-to-delete-end 2009 (setq reg-to-delete-end
2010 (ediff-get-diff-posn to-buf-type 'end n ctrl-buf)) 2010 (ediff-get-diff-posn to-buf-type 'end n ctrl-buf))
2011 2011
2012 (if reg-to-copy 2012 (if reg-to-copy
2013 (setq from-buf-type nil) 2013 (setq from-buf-type nil)
2014 (setq reg-to-copy (ediff-get-region-contents n from-buf-type ctrl-buf))) 2014 (setq reg-to-copy (ediff-get-region-contents n from-buf-type ctrl-buf)))
2015 2015
2016 (setq reg-to-delete (ediff-get-region-contents 2016 (setq reg-to-delete (ediff-get-region-contents
2017 n to-buf-type ctrl-buf 2017 n to-buf-type ctrl-buf
2018 reg-to-delete-beg reg-to-delete-end)) 2018 reg-to-delete-beg reg-to-delete-end))
2019 2019
2020 (if (string= reg-to-delete reg-to-copy) 2020 (if (string= reg-to-delete reg-to-copy)
2021 (setq saved-p nil) ; don't copy identical buffers 2021 (setq saved-p nil) ; don't copy identical buffers
2022 ;; seems ok to copy 2022 ;; seems ok to copy
@@ -2026,15 +2026,15 @@ ARG is a prefix argument. If nil, copy the current difference region."
2026 (ediff-with-current-buffer to-buf 2026 (ediff-with-current-buffer to-buf
2027 ;; to prevent flags from interfering if buffer is writable 2027 ;; to prevent flags from interfering if buffer is writable
2028 (let ((inhibit-read-only (null buffer-read-only))) 2028 (let ((inhibit-read-only (null buffer-read-only)))
2029 2029
2030 (goto-char reg-to-delete-end) 2030 (goto-char reg-to-delete-end)
2031 (insert reg-to-copy) 2031 (insert reg-to-copy)
2032 2032
2033 (if (> reg-to-delete-end reg-to-delete-beg) 2033 (if (> reg-to-delete-end reg-to-delete-beg)
2034 (kill-region reg-to-delete-beg reg-to-delete-end)) 2034 (kill-region reg-to-delete-beg reg-to-delete-end))
2035 )) 2035 ))
2036 (or batch-invocation 2036 (or batch-invocation
2037 (setq 2037 (setq
2038 messg 2038 messg
2039 (ediff-save-diff-region n to-buf-type reg-to-delete)))) 2039 (ediff-save-diff-region n to-buf-type reg-to-delete))))
2040 (error (message "ediff-copy-diff: %s %s" 2040 (error (message "ediff-copy-diff: %s %s"
@@ -2045,7 +2045,7 @@ ARG is a prefix argument. If nil, copy the current difference region."
2045 (setq saved-p nil) 2045 (setq saved-p nil)
2046 ))) 2046 )))
2047 ) 2047 )
2048 2048
2049 ;; adjust state of difference in case 3-way and diff was copied ok 2049 ;; adjust state of difference in case 3-way and diff was copied ok
2050 (if (and saved-p three-way) 2050 (if (and saved-p three-way)
2051 (ediff-set-state-of-diff-in-all-buffers n ctrl-buf)) 2051 (ediff-set-state-of-diff-in-all-buffers n ctrl-buf))
@@ -2056,9 +2056,9 @@ ARG is a prefix argument. If nil, copy the current difference region."
2056 ;; before reinserting flags (and thus before ediff-recenter). 2056 ;; before reinserting flags (and thus before ediff-recenter).
2057 (if (and saved-p three-way) 2057 (if (and saved-p three-way)
2058 (ediff-clear-fine-differences n)) 2058 (ediff-clear-fine-differences n))
2059 2059
2060 (ediff-refresh-mode-lines) 2060 (ediff-refresh-mode-lines)
2061 2061
2062 ;; For diff2 jobs, don't recompute fine diffs, since we know there 2062 ;; For diff2 jobs, don't recompute fine diffs, since we know there
2063 ;; aren't any. So we clear diffs after ediff-recenter. 2063 ;; aren't any. So we clear diffs after ediff-recenter.
2064 (if (and saved-p (not three-way)) 2064 (if (and saved-p (not three-way))
@@ -2067,7 +2067,7 @@ ARG is a prefix argument. If nil, copy the current difference region."
2067 ;; by the user 2067 ;; by the user
2068 (message messg)) 2068 (message messg))
2069 )) 2069 ))
2070 2070
2071;; Save Nth diff of buffer BUF-TYPE \(A, B, or C\). 2071;; Save Nth diff of buffer BUF-TYPE \(A, B, or C\).
2072;; That is to say, the Nth diff on the `ediff-killed-diffs-alist'. REG 2072;; That is to say, the Nth diff on the `ediff-killed-diffs-alist'. REG
2073;; is the region to save. It is redundant here, but is passed anyway, for 2073;; is the region to save. It is redundant here, but is passed anyway, for
@@ -2076,7 +2076,7 @@ ARG is a prefix argument. If nil, copy the current difference region."
2076 (let* ((n-th-diff-saved (assoc n ediff-killed-diffs-alist)) 2076 (let* ((n-th-diff-saved (assoc n ediff-killed-diffs-alist))
2077 (buf (ediff-get-buffer buf-type)) 2077 (buf (ediff-get-buffer buf-type))
2078 (this-buf-n-th-diff-saved (assoc buf (cdr n-th-diff-saved)))) 2078 (this-buf-n-th-diff-saved (assoc buf (cdr n-th-diff-saved))))
2079 2079
2080 (if this-buf-n-th-diff-saved 2080 (if this-buf-n-th-diff-saved
2081 ;; either nothing saved for n-th diff and buffer or we OK'ed 2081 ;; either nothing saved for n-th diff and buffer or we OK'ed
2082 ;; overriding 2082 ;; overriding
@@ -2091,22 +2091,22 @@ ARG is a prefix argument. If nil, copy the current difference region."
2091 (if ediff-merge-job 2091 (if ediff-merge-job
2092 "" (downcase (symbol-name buf-type)))) 2092 "" (downcase (symbol-name buf-type))))
2093 )) 2093 ))
2094 2094
2095;; Test if saving Nth difference region of buffer BUF-TYPE is possible. 2095;; Test if saving Nth difference region of buffer BUF-TYPE is possible.
2096(defun ediff-test-save-region (n buf-type) 2096(defun ediff-test-save-region (n buf-type)
2097 (let* ((n-th-diff-saved (assoc n ediff-killed-diffs-alist)) 2097 (let* ((n-th-diff-saved (assoc n ediff-killed-diffs-alist))
2098 (buf (ediff-get-buffer buf-type)) 2098 (buf (ediff-get-buffer buf-type))
2099 (this-buf-n-th-diff-saved (assoc buf (cdr n-th-diff-saved)))) 2099 (this-buf-n-th-diff-saved (assoc buf (cdr n-th-diff-saved))))
2100 2100
2101 (if this-buf-n-th-diff-saved 2101 (if this-buf-n-th-diff-saved
2102 (if (yes-or-no-p 2102 (if (yes-or-no-p
2103 (format 2103 (format
2104 "You've previously copied diff region %d to buffer %S. Confirm " 2104 "You've previously copied diff region %d to buffer %S. Confirm "
2105 (1+ n) buf-type)) 2105 (1+ n) buf-type))
2106 t 2106 t
2107 (error "Quit")) 2107 (error "Quit"))
2108 t))) 2108 t)))
2109 2109
2110(defun ediff-pop-diff (n buf-type) 2110(defun ediff-pop-diff (n buf-type)
2111 "Pop last killed Nth diff region from buffer BUF-TYPE." 2111 "Pop last killed Nth diff region from buffer BUF-TYPE."
2112 (let* ((n-th-record (assoc n ediff-killed-diffs-alist)) 2112 (let* ((n-th-record (assoc n ediff-killed-diffs-alist))
@@ -2116,33 +2116,33 @@ ARG is a prefix argument. If nil, copy the current difference region."
2116 (ctl-buf ediff-control-buffer) 2116 (ctl-buf ediff-control-buffer)
2117 ediff-verbose-p 2117 ediff-verbose-p
2118 saved-diff reg-beg reg-end recovered) 2118 saved-diff reg-beg reg-end recovered)
2119 2119
2120 (if (cdr saved-rec) 2120 (if (cdr saved-rec)
2121 (setq saved-diff (cdr saved-rec)) 2121 (setq saved-diff (cdr saved-rec))
2122 (if (> ediff-number-of-differences 0) 2122 (if (> ediff-number-of-differences 0)
2123 (error "Nothing saved for diff %d in buffer %S" (1+ n) buf-type) 2123 (error "Nothing saved for diff %d in buffer %S" (1+ n) buf-type)
2124 (error ediff-NO-DIFFERENCES))) 2124 (error ediff-NO-DIFFERENCES)))
2125 2125
2126 (setq reg-beg (ediff-get-diff-posn buf-type 'beg n ediff-control-buffer)) 2126 (setq reg-beg (ediff-get-diff-posn buf-type 'beg n ediff-control-buffer))
2127 (setq reg-end (ediff-get-diff-posn buf-type 'end n ediff-control-buffer)) 2127 (setq reg-end (ediff-get-diff-posn buf-type 'end n ediff-control-buffer))
2128 2128
2129 (condition-case conds 2129 (condition-case conds
2130 (ediff-with-current-buffer buf 2130 (ediff-with-current-buffer buf
2131 (let ((inhibit-read-only (null buffer-read-only))) 2131 (let ((inhibit-read-only (null buffer-read-only)))
2132 2132
2133 (goto-char reg-end) 2133 (goto-char reg-end)
2134 (insert saved-diff) 2134 (insert saved-diff)
2135 2135
2136 (if (> reg-end reg-beg) 2136 (if (> reg-end reg-beg)
2137 (kill-region reg-beg reg-end)) 2137 (kill-region reg-beg reg-end))
2138 2138
2139 (setq recovered t) 2139 (setq recovered t)
2140 )) 2140 ))
2141 (error (message "ediff-pop-diff: %s %s" 2141 (error (message "ediff-pop-diff: %s %s"
2142 (car conds) 2142 (car conds)
2143 (mapconcat 'prin1-to-string (cdr conds) " ")) 2143 (mapconcat 'prin1-to-string (cdr conds) " "))
2144 (beep 1))) 2144 (beep 1)))
2145 2145
2146 ;; Clearing fine diffs is necessary for 2146 ;; Clearing fine diffs is necessary for
2147 ;; ediff-unselect-and-select-difference to properly recompute them. We 2147 ;; ediff-unselect-and-select-difference to properly recompute them. We
2148 ;; can't rely on ediff-copy-diff to clear this vector, as the user might 2148 ;; can't rely on ediff-copy-diff to clear this vector, as the user might
@@ -2150,20 +2150,20 @@ ARG is a prefix argument. If nil, copy the current difference region."
2150 ;; fine diffs. 2150 ;; fine diffs.
2151 (if recovered 2151 (if recovered
2152 (ediff-clear-fine-differences n)) 2152 (ediff-clear-fine-differences n))
2153 2153
2154 ;; adjust state of difference 2154 ;; adjust state of difference
2155 (if (and three-way recovered) 2155 (if (and three-way recovered)
2156 (ediff-set-state-of-diff-in-all-buffers n ctl-buf)) 2156 (ediff-set-state-of-diff-in-all-buffers n ctl-buf))
2157 2157
2158 (ediff-refresh-mode-lines) 2158 (ediff-refresh-mode-lines)
2159 2159
2160 (if recovered 2160 (if recovered
2161 (progn 2161 (progn
2162 (setq n-th-record (delq saved-rec n-th-record)) 2162 (setq n-th-record (delq saved-rec n-th-record))
2163 (message "Diff region %d in buffer %S restored" (1+ n) buf-type) 2163 (message "Diff region %d in buffer %S restored" (1+ n) buf-type)
2164 )) 2164 ))
2165 )) 2165 ))
2166 2166
2167(defun ediff-restore-diff (arg &optional key) 2167(defun ediff-restore-diff (arg &optional key)
2168 "Restore ARGth diff from `ediff-killed-diffs-alist'. 2168 "Restore ARGth diff from `ediff-killed-diffs-alist'.
2169ARG is a prefix argument. If ARG is nil, restore the current-difference. 2169ARG is a prefix argument. If ARG is nil, restore the current-difference.
@@ -2173,7 +2173,7 @@ determine the target buffer instead of last-command-char"
2173 (ediff-barf-if-not-control-buffer) 2173 (ediff-barf-if-not-control-buffer)
2174 (if (numberp arg) 2174 (if (numberp arg)
2175 (ediff-jump-to-difference arg)) 2175 (ediff-jump-to-difference arg))
2176 (ediff-pop-diff ediff-current-difference 2176 (ediff-pop-diff ediff-current-difference
2177 (ediff-char-to-buftype (or key last-command-char))) 2177 (ediff-char-to-buftype (or key last-command-char)))
2178 ;; recenter with rehighlighting, but no messages 2178 ;; recenter with rehighlighting, but no messages
2179 (let (ediff-verbose-p) 2179 (let (ediff-verbose-p)
@@ -2184,8 +2184,8 @@ determine the target buffer instead of last-command-char"
2184ARG is a prefix argument. If nil, restore the current diff." 2184ARG is a prefix argument. If nil, restore the current diff."
2185 (interactive "P") 2185 (interactive "P")
2186 (ediff-restore-diff arg ?c)) 2186 (ediff-restore-diff arg ?c))
2187 2187
2188 2188
2189(defun ediff-toggle-regexp-match () 2189(defun ediff-toggle-regexp-match ()
2190 "Toggle between focusing and hiding of difference regions that match 2190 "Toggle between focusing and hiding of difference regions that match
2191a regular expression typed in by the user." 2191a regular expression typed in by the user."
@@ -2206,20 +2206,20 @@ a regular expression typed in by the user."
2206 (setq ediff-skip-diff-region-function 'ediff-show-all-diffs)) 2206 (setq ediff-skip-diff-region-function 'ediff-show-all-diffs))
2207 ((eq last-command-char ?h) 2207 ((eq last-command-char ?h)
2208 (setq ediff-skip-diff-region-function ediff-hide-regexp-matches-function 2208 (setq ediff-skip-diff-region-function ediff-hide-regexp-matches-function
2209 regexp-A 2209 regexp-A
2210 (read-string 2210 (read-string
2211 (format 2211 (format
2212 "Ignore A-regions matching this regexp (default \"%s\"): " 2212 "Ignore A-regions matching this regexp (default \"%s\"): "
2213 ediff-regexp-hide-A)) 2213 ediff-regexp-hide-A))
2214 regexp-B 2214 regexp-B
2215 (read-string 2215 (read-string
2216 (format 2216 (format
2217 "Ignore B-regions matching this regexp (default \"%s\"): " 2217 "Ignore B-regions matching this regexp (default \"%s\"): "
2218 ediff-regexp-hide-B))) 2218 ediff-regexp-hide-B)))
2219 (if ediff-3way-comparison-job 2219 (if ediff-3way-comparison-job
2220 (setq regexp-C 2220 (setq regexp-C
2221 (read-string 2221 (read-string
2222 (format 2222 (format
2223 "Ignore C-regions matching this regexp (default \"%s\"): " 2223 "Ignore C-regions matching this regexp (default \"%s\"): "
2224 ediff-regexp-hide-C)))) 2224 ediff-regexp-hide-C))))
2225 (if (eq ediff-hide-regexp-connective 'and) 2225 (if (eq ediff-hide-regexp-connective 'and)
@@ -2236,7 +2236,7 @@ a regular expression typed in by the user."
2236 (message "Will ignore regions that match %s regexps" msg-connective) 2236 (message "Will ignore regions that match %s regexps" msg-connective)
2237 (setq ediff-hide-regexp-connective alt-connective) 2237 (setq ediff-hide-regexp-connective alt-connective)
2238 (message "Will ignore regions that match %s regexps" 2238 (message "Will ignore regions that match %s regexps"
2239 alt-msg-connective)) 2239 alt-msg-connective))
2240 2240
2241 (or (string= regexp-A "") (setq ediff-regexp-hide-A regexp-A)) 2241 (or (string= regexp-A "") (setq ediff-regexp-hide-A regexp-A))
2242 (or (string= regexp-B "") (setq ediff-regexp-hide-B regexp-B)) 2242 (or (string= regexp-B "") (setq ediff-regexp-hide-B regexp-B))
@@ -2245,20 +2245,20 @@ a regular expression typed in by the user."
2245 ((eq last-command-char ?f) 2245 ((eq last-command-char ?f)
2246 (setq ediff-skip-diff-region-function 2246 (setq ediff-skip-diff-region-function
2247 ediff-focus-on-regexp-matches-function 2247 ediff-focus-on-regexp-matches-function
2248 regexp-A 2248 regexp-A
2249 (read-string 2249 (read-string
2250 (format 2250 (format
2251 "Focus on A-regions matching this regexp (default \"%s\"): " 2251 "Focus on A-regions matching this regexp (default \"%s\"): "
2252 ediff-regexp-focus-A)) 2252 ediff-regexp-focus-A))
2253 regexp-B 2253 regexp-B
2254 (read-string 2254 (read-string
2255 (format 2255 (format
2256 "Focus on B-regions matching this regexp (default \"%s\"): " 2256 "Focus on B-regions matching this regexp (default \"%s\"): "
2257 ediff-regexp-focus-B))) 2257 ediff-regexp-focus-B)))
2258 (if ediff-3way-comparison-job 2258 (if ediff-3way-comparison-job
2259 (setq regexp-C 2259 (setq regexp-C
2260 (read-string 2260 (read-string
2261 (format 2261 (format
2262 "Focus on C-regions matching this regexp (default \"%s\"): " 2262 "Focus on C-regions matching this regexp (default \"%s\"): "
2263 ediff-regexp-focus-C)))) 2263 ediff-regexp-focus-C))))
2264 (if (eq ediff-focus-regexp-connective 'and) 2264 (if (eq ediff-focus-regexp-connective 'and)
@@ -2275,13 +2275,13 @@ a regular expression typed in by the user."
2275 (message "Will focus on regions that match %s regexps" 2275 (message "Will focus on regions that match %s regexps"
2276 msg-connective) 2276 msg-connective)
2277 (setq ediff-focus-regexp-connective alt-connective) 2277 (setq ediff-focus-regexp-connective alt-connective)
2278 (message "Will focus on regions that match %s regexps" 2278 (message "Will focus on regions that match %s regexps"
2279 alt-msg-connective)) 2279 alt-msg-connective))
2280 2280
2281 (or (string= regexp-A "") (setq ediff-regexp-focus-A regexp-A)) 2281 (or (string= regexp-A "") (setq ediff-regexp-focus-A regexp-A))
2282 (or (string= regexp-B "") (setq ediff-regexp-focus-B regexp-B)) 2282 (or (string= regexp-B "") (setq ediff-regexp-focus-B regexp-B))
2283 (or (string= regexp-C "") (setq ediff-regexp-focus-C regexp-C)))))) 2283 (or (string= regexp-C "") (setq ediff-regexp-focus-C regexp-C))))))
2284 2284
2285(defun ediff-toggle-skip-similar () 2285(defun ediff-toggle-skip-similar ()
2286 (interactive) 2286 (interactive)
2287 (ediff-barf-if-not-control-buffer) 2287 (ediff-barf-if-not-control-buffer)
@@ -2293,10 +2293,10 @@ a regular expression typed in by the user."
2293 (message 2293 (message
2294 "Skipping regions that differ only in white space & line breaks") 2294 "Skipping regions that differ only in white space & line breaks")
2295 (message "Skipping over white-space differences turned off"))) 2295 (message "Skipping over white-space differences turned off")))
2296 2296
2297(defun ediff-focus-on-regexp-matches (n) 2297(defun ediff-focus-on-regexp-matches (n)
2298 "Focus on diffs that match regexp `ediff-regexp-focus-A/B'. 2298 "Focus on diffs that match regexp `ediff-regexp-focus-A/B'.
2299Regions to be ignored according to this function are those where 2299Regions to be ignored according to this function are those where
2300buf A region doesn't match `ediff-regexp-focus-A' and buf B region 2300buf A region doesn't match `ediff-regexp-focus-A' and buf B region
2301doesn't match `ediff-regexp-focus-B'. 2301doesn't match `ediff-regexp-focus-B'.
2302This function returns nil if the region number N (specified as 2302This function returns nil if the region number N (specified as
@@ -2335,8 +2335,8 @@ the number seen by the user."
2335 (list ediff-focus-regexp-connective 2335 (list ediff-focus-regexp-connective
2336 reg-A-match reg-B-match)))) 2336 reg-A-match reg-B-match))))
2337 ))) 2337 )))
2338 2338
2339(defun ediff-hide-regexp-matches (n) 2339(defun ediff-hide-regexp-matches (n)
2340 "Hide diffs that match regexp `ediff-regexp-hide-A/B/C'. 2340 "Hide diffs that match regexp `ediff-regexp-hide-A/B/C'.
2341Regions to be ignored are those where buf A region matches 2341Regions to be ignored are those where buf A region matches
2342`ediff-regexp-hide-A' and buf B region matches `ediff-regexp-hide-B'. 2342`ediff-regexp-hide-A' and buf B region matches `ediff-regexp-hide-B'.
@@ -2377,7 +2377,7 @@ the number seen by the user."
2377 reg-A-match reg-B-match reg-C-match) 2377 reg-A-match reg-B-match reg-C-match)
2378 (list ediff-hide-regexp-connective reg-A-match reg-B-match))) 2378 (list ediff-hide-regexp-connective reg-A-match reg-B-match)))
2379 ))) 2379 )))
2380 2380
2381 2381
2382 2382
2383;;; Quitting, suspending, etc. 2383;;; Quitting, suspending, etc.
@@ -2389,8 +2389,8 @@ flags of the compared file buffers, kills Ediff buffers for this session
2389\(but not buffers A, B, C\). 2389\(but not buffers A, B, C\).
2390 2390
2391If `ediff-keep-variants' is nil, the user will be asked whether the buffers 2391If `ediff-keep-variants' is nil, the user will be asked whether the buffers
2392containing the variants should be removed \(if they haven't been modified\). 2392containing the variants should be removed \(if they haven't been modified\).
2393If it is t, they will be preserved unconditionally. A prefix argument, 2393If it is t, they will be preserved unconditionally. A prefix argument,
2394temporarily reverses the meaning of this variable." 2394temporarily reverses the meaning of this variable."
2395 (interactive "P") 2395 (interactive "P")
2396 (ediff-barf-if-not-control-buffer) 2396 (ediff-barf-if-not-control-buffer)
@@ -2414,7 +2414,7 @@ temporarily reverses the meaning of this variable."
2414 (ediff-clear-diff-vector 'ediff-difference-vector-Ancestor 'fine-diffs-also) 2414 (ediff-clear-diff-vector 'ediff-difference-vector-Ancestor 'fine-diffs-also)
2415 2415
2416 (ediff-delete-temp-files) 2416 (ediff-delete-temp-files)
2417 2417
2418 ;; Restore the visibility range. This affects only ediff-*-regions/windows. 2418 ;; Restore the visibility range. This affects only ediff-*-regions/windows.
2419 ;; Since for other job names ediff-visible-region sets 2419 ;; Since for other job names ediff-visible-region sets
2420 ;; ediff-visible-bounds to ediff-wide-bounds, the settings below are 2420 ;; ediff-visible-bounds to ediff-wide-bounds, the settings below are
@@ -2422,7 +2422,7 @@ temporarily reverses the meaning of this variable."
2422 (if ediff-quit-widened 2422 (if ediff-quit-widened
2423 (setq ediff-visible-bounds ediff-wide-bounds) 2423 (setq ediff-visible-bounds ediff-wide-bounds)
2424 (setq ediff-visible-bounds ediff-narrow-bounds)) 2424 (setq ediff-visible-bounds ediff-narrow-bounds))
2425 2425
2426 ;; Apply selective display to narrow or widen 2426 ;; Apply selective display to narrow or widen
2427 (ediff-visible-region) 2427 (ediff-visible-region)
2428 (mapcar (lambda (overl) 2428 (mapcar (lambda (overl)
@@ -2441,32 +2441,32 @@ temporarily reverses the meaning of this variable."
2441 (session-number ediff-meta-session-number) 2441 (session-number ediff-meta-session-number)
2442 ;; suitable working frame 2442 ;; suitable working frame
2443 (warp-frame (if (and (ediff-window-display-p) (eq ediff-grab-mouse t)) 2443 (warp-frame (if (and (ediff-window-display-p) (eq ediff-grab-mouse t))
2444 (cond ((window-live-p ediff-window-A) 2444 (cond ((window-live-p ediff-window-A)
2445 (window-frame ediff-window-A)) 2445 (window-frame ediff-window-A))
2446 ((window-live-p ediff-window-B) 2446 ((window-live-p ediff-window-B)
2447 (window-frame ediff-window-B)) 2447 (window-frame ediff-window-B))
2448 (t (next-frame)))))) 2448 (t (next-frame))))))
2449 (condition-case nil 2449 (condition-case nil
2450 (ediff-with-current-buffer ediff-buffer-A 2450 (ediff-with-current-buffer ediff-buffer-A
2451 (setq ediff-this-buffer-ediff-sessions 2451 (setq ediff-this-buffer-ediff-sessions
2452 (delq control-buffer ediff-this-buffer-ediff-sessions)) 2452 (delq control-buffer ediff-this-buffer-ediff-sessions))
2453 (kill-local-variable 'mode-line-buffer-identification) 2453 (kill-local-variable 'mode-line-buffer-identification)
2454 (kill-local-variable 'mode-line-format) 2454 (kill-local-variable 'mode-line-format)
2455 ) 2455 )
2456 (error)) 2456 (error))
2457 2457
2458 (condition-case nil 2458 (condition-case nil
2459 (ediff-with-current-buffer ediff-buffer-B 2459 (ediff-with-current-buffer ediff-buffer-B
2460 (setq ediff-this-buffer-ediff-sessions 2460 (setq ediff-this-buffer-ediff-sessions
2461 (delq control-buffer ediff-this-buffer-ediff-sessions)) 2461 (delq control-buffer ediff-this-buffer-ediff-sessions))
2462 (kill-local-variable 'mode-line-buffer-identification) 2462 (kill-local-variable 'mode-line-buffer-identification)
2463 (kill-local-variable 'mode-line-format) 2463 (kill-local-variable 'mode-line-format)
2464 ) 2464 )
2465 (error)) 2465 (error))
2466 2466
2467 (condition-case nil 2467 (condition-case nil
2468 (ediff-with-current-buffer ediff-buffer-C 2468 (ediff-with-current-buffer ediff-buffer-C
2469 (setq ediff-this-buffer-ediff-sessions 2469 (setq ediff-this-buffer-ediff-sessions
2470 (delq control-buffer ediff-this-buffer-ediff-sessions)) 2470 (delq control-buffer ediff-this-buffer-ediff-sessions))
2471 (kill-local-variable 'mode-line-buffer-identification) 2471 (kill-local-variable 'mode-line-buffer-identification)
2472 (kill-local-variable 'mode-line-format) 2472 (kill-local-variable 'mode-line-format)
@@ -2475,7 +2475,7 @@ temporarily reverses the meaning of this variable."
2475 2475
2476 (condition-case nil 2476 (condition-case nil
2477 (ediff-with-current-buffer ediff-ancestor-buffer 2477 (ediff-with-current-buffer ediff-ancestor-buffer
2478 (setq ediff-this-buffer-ediff-sessions 2478 (setq ediff-this-buffer-ediff-sessions
2479 (delq control-buffer ediff-this-buffer-ediff-sessions)) 2479 (delq control-buffer ediff-this-buffer-ediff-sessions))
2480 (kill-local-variable 'mode-line-buffer-identification) 2480 (kill-local-variable 'mode-line-buffer-identification)
2481 (kill-local-variable 'mode-line-format) 2481 (kill-local-variable 'mode-line-format)
@@ -2540,8 +2540,8 @@ temporarily reverses the meaning of this variable."
2540 (if (string-match "Minibuf" buf-name) 2540 (if (string-match "Minibuf" buf-name)
2541 nil 2541 nil
2542 frame))) 2542 frame)))
2543 2543
2544 2544
2545(defun ediff-delete-temp-files () 2545(defun ediff-delete-temp-files ()
2546 (if (and (stringp ediff-temp-file-A) (file-exists-p ediff-temp-file-A)) 2546 (if (and (stringp ediff-temp-file-A) (file-exists-p ediff-temp-file-A))
2547 (delete-file ediff-temp-file-A)) 2547 (delete-file ediff-temp-file-A))
@@ -2549,7 +2549,7 @@ temporarily reverses the meaning of this variable."
2549 (delete-file ediff-temp-file-B)) 2549 (delete-file ediff-temp-file-B))
2550 (if (and (stringp ediff-temp-file-C) (file-exists-p ediff-temp-file-C)) 2550 (if (and (stringp ediff-temp-file-C) (file-exists-p ediff-temp-file-C))
2551 (delete-file ediff-temp-file-C))) 2551 (delete-file ediff-temp-file-C)))
2552 2552
2553 2553
2554;; Kill control buffer, other auxiliary Ediff buffers. 2554;; Kill control buffer, other auxiliary Ediff buffers.
2555;; Leave one of the frames split between buffers A/B/C 2555;; Leave one of the frames split between buffers A/B/C
@@ -2561,11 +2561,11 @@ temporarily reverses the meaning of this variable."
2561 (ctl-wind (ediff-get-visible-buffer-window ctl-buf)) 2561 (ctl-wind (ediff-get-visible-buffer-window ctl-buf))
2562 (ctl-frame ediff-control-frame) 2562 (ctl-frame ediff-control-frame)
2563 (three-way-job ediff-3way-job) 2563 (three-way-job ediff-3way-job)
2564 (main-frame (cond ((window-live-p ediff-window-A) 2564 (main-frame (cond ((window-live-p ediff-window-A)
2565 (window-frame ediff-window-A)) 2565 (window-frame ediff-window-A))
2566 ((window-live-p ediff-window-B) 2566 ((window-live-p ediff-window-B)
2567 (window-frame ediff-window-B))))) 2567 (window-frame ediff-window-B)))))
2568 2568
2569 (ediff-kill-buffer-carefully ediff-diff-buffer) 2569 (ediff-kill-buffer-carefully ediff-diff-buffer)
2570 (ediff-kill-buffer-carefully ediff-custom-diff-buffer) 2570 (ediff-kill-buffer-carefully ediff-custom-diff-buffer)
2571 (ediff-kill-buffer-carefully ediff-fine-diff-buffer) 2571 (ediff-kill-buffer-carefully ediff-fine-diff-buffer)
@@ -2587,10 +2587,10 @@ temporarily reverses the meaning of this variable."
2587 (ediff-kill-bottom-toolbar)) 2587 (ediff-kill-bottom-toolbar))
2588 2588
2589 (ediff-kill-buffer-carefully ctl-buf) 2589 (ediff-kill-buffer-carefully ctl-buf)
2590 2590
2591 (if (frame-live-p main-frame) 2591 (if (frame-live-p main-frame)
2592 (select-frame main-frame)) 2592 (select-frame main-frame))
2593 2593
2594 ;; display only if not visible 2594 ;; display only if not visible
2595 (condition-case nil 2595 (condition-case nil
2596 (or (ediff-get-visible-buffer-window buff-B) 2596 (or (ediff-get-visible-buffer-window buff-B)
@@ -2651,7 +2651,7 @@ delete this buffer in another session as well."
2651 ;; Kill indirect buffer even if it is modified, because the base buffer 2651 ;; Kill indirect buffer even if it is modified, because the base buffer
2652 ;; is still there. Note that if the base buffer is dead then so will be 2652 ;; is still there. Note that if the base buffer is dead then so will be
2653 ;; the indirect buffer 2653 ;; the indirect buffer
2654 (ediff-with-current-buffer buff 2654 (ediff-with-current-buffer buff
2655 (set-buffer-modified-p nil)) 2655 (set-buffer-modified-p nil))
2656 (ediff-kill-buffer-carefully buff) 2656 (ediff-kill-buffer-carefully buff)
2657 (ediff-with-current-buffer base 2657 (ediff-with-current-buffer base
@@ -2752,11 +2752,11 @@ only if this merge job is part of a group, i.e., was invoked from within
2752 (buf-diff ediff-diff-buffer) 2752 (buf-diff ediff-diff-buffer)
2753 (buf-custom-diff ediff-custom-diff-buffer) 2753 (buf-custom-diff ediff-custom-diff-buffer)
2754 (buf-fine-diff ediff-fine-diff-buffer)) 2754 (buf-fine-diff ediff-fine-diff-buffer))
2755 2755
2756 ;; hide the control panel 2756 ;; hide the control panel
2757 (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame)) 2757 (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
2758 (iconify-frame ediff-control-frame) 2758 (iconify-frame ediff-control-frame)
2759 (bury-buffer)) 2759 (bury-buffer))
2760 (if buf-err (bury-buffer buf-err)) 2760 (if buf-err (bury-buffer buf-err))
2761 (if buf-diff (bury-buffer buf-diff)) 2761 (if buf-diff (bury-buffer buf-diff))
2762 (if buf-custom-diff (bury-buffer buf-custom-diff)) 2762 (if buf-custom-diff (bury-buffer buf-custom-diff))
@@ -2792,7 +2792,7 @@ only if this merge job is part of a group, i.e., was invoked from within
2792 (bury-buffer)))) 2792 (bury-buffer))))
2793 )) 2793 ))
2794 2794
2795 2795
2796(defun ediff-suspend () 2796(defun ediff-suspend ()
2797 "Suspend Ediff. 2797 "Suspend Ediff.
2798To resume, switch to the appropriate `Ediff Control Panel' 2798To resume, switch to the appropriate `Ediff Control Panel'
@@ -2822,20 +2822,20 @@ Hit \\[ediff-recenter] to reset the windows afterward."
2822 (if buffer-file-name 2822 (if buffer-file-name
2823 (princ 2823 (princ
2824 (format "File A = %S\n" buffer-file-name)) 2824 (format "File A = %S\n" buffer-file-name))
2825 (princ 2825 (princ
2826 (format "Buffer A = %S\n" (buffer-name))))) 2826 (format "Buffer A = %S\n" (buffer-name)))))
2827 (ediff-with-current-buffer ediff-buffer-B 2827 (ediff-with-current-buffer ediff-buffer-B
2828 (if buffer-file-name 2828 (if buffer-file-name
2829 (princ 2829 (princ
2830 (format "File B = %S\n" buffer-file-name)) 2830 (format "File B = %S\n" buffer-file-name))
2831 (princ 2831 (princ
2832 (format "Buffer B = %S\n" (buffer-name))))) 2832 (format "Buffer B = %S\n" (buffer-name)))))
2833 (if ediff-3way-job 2833 (if ediff-3way-job
2834 (ediff-with-current-buffer ediff-buffer-C 2834 (ediff-with-current-buffer ediff-buffer-C
2835 (if buffer-file-name 2835 (if buffer-file-name
2836 (princ 2836 (princ
2837 (format "File C = %S\n" buffer-file-name)) 2837 (format "File C = %S\n" buffer-file-name))
2838 (princ 2838 (princ
2839 (format "Buffer C = %S\n" (buffer-name)))))) 2839 (format "Buffer C = %S\n" (buffer-name))))))
2840 (princ (format "Customized diff output %s\n" 2840 (princ (format "Customized diff output %s\n"
2841 (if (ediff-buffer-live-p ediff-custom-diff-buffer) 2841 (if (ediff-buffer-live-p ediff-custom-diff-buffer)
@@ -2847,7 +2847,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
2847 (concat "\tin buffer " 2847 (concat "\tin buffer "
2848 (buffer-name ediff-diff-buffer)) 2848 (buffer-name ediff-diff-buffer))
2849 " is not available"))) 2849 " is not available")))
2850 2850
2851 (let* ((A-line (ediff-with-current-buffer ediff-buffer-A 2851 (let* ((A-line (ediff-with-current-buffer ediff-buffer-A
2852 (1+ (count-lines (point-min) (point))))) 2852 (1+ (count-lines (point-min) (point)))))
2853 (B-line (ediff-with-current-buffer ediff-buffer-B 2853 (B-line (ediff-with-current-buffer ediff-buffer-B
@@ -2860,7 +2860,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
2860 (setq C-line (ediff-with-current-buffer ediff-buffer-C 2860 (setq C-line (ediff-with-current-buffer ediff-buffer-C
2861 (1+ (count-lines (point-min) (point))))) 2861 (1+ (count-lines (point-min) (point)))))
2862 (princ (format "Buffer C's point is on line %d\n" C-line))))) 2862 (princ (format "Buffer C's point is on line %d\n" C-line)))))
2863 2863
2864 (princ (format "\nCurrent difference number = %S\n" 2864 (princ (format "\nCurrent difference number = %S\n"
2865 (cond ((< ediff-current-difference 0) 'start) 2865 (cond ((< ediff-current-difference 0) 'start)
2866 ((>= ediff-current-difference 2866 ((>= ediff-current-difference
@@ -2877,7 +2877,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
2877 (if (and ediff-skip-merge-regions-that-differ-from-default ediff-merge-job) 2877 (if (and ediff-skip-merge-regions-that-differ-from-default ediff-merge-job)
2878 (princ 2878 (princ
2879 "\nSkipping merge regions that differ from default setting")) 2879 "\nSkipping merge regions that differ from default setting"))
2880 2880
2881 (cond ((eq ediff-skip-diff-region-function 'ediff-show-all-diffs) 2881 (cond ((eq ediff-skip-diff-region-function 'ediff-show-all-diffs)
2882 (princ "\nSelective browsing by regexp is off\n")) 2882 (princ "\nSelective browsing by regexp is off\n"))
2883 ((eq ediff-skip-diff-region-function 2883 ((eq ediff-skip-diff-region-function
@@ -2885,7 +2885,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
2885 (princ 2885 (princ
2886 "\nIgnoring regions that match") 2886 "\nIgnoring regions that match")
2887 (princ 2887 (princ
2888 (format 2888 (format
2889 "\n\t regexp `%s' in buffer A %S\n\t regexp `%s' in buffer B\n" 2889 "\n\t regexp `%s' in buffer A %S\n\t regexp `%s' in buffer B\n"
2890 ediff-regexp-hide-A ediff-hide-regexp-connective 2890 ediff-regexp-hide-A ediff-hide-regexp-connective
2891 ediff-regexp-hide-B))) 2891 ediff-regexp-hide-B)))
@@ -2899,7 +2899,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
2899 ediff-regexp-focus-A ediff-focus-regexp-connective 2899 ediff-regexp-focus-A ediff-focus-regexp-connective
2900 ediff-regexp-focus-B))) 2900 ediff-regexp-focus-B)))
2901 (t (princ "\nSelective browsing via a user-defined method.\n"))) 2901 (t (princ "\nSelective browsing via a user-defined method.\n")))
2902 2902
2903 (princ 2903 (princ
2904 (format "\nBugs/suggestions: type `%s' while in Ediff Control Panel." 2904 (format "\nBugs/suggestions: type `%s' while in Ediff Control Panel."
2905 (substitute-command-keys "\\[ediff-submit-report]"))) 2905 (substitute-command-keys "\\[ediff-submit-report]")))
@@ -2908,7 +2908,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
2908 (ediff-reset-mouse ediff-control-frame)) 2908 (ediff-reset-mouse ediff-control-frame))
2909 (if (window-live-p ediff-control-window) 2909 (if (window-live-p ediff-control-window)
2910 (select-window ediff-control-window))) 2910 (select-window ediff-control-window)))
2911 2911
2912 2912
2913 2913
2914 2914
@@ -2937,17 +2937,17 @@ Hit \\[ediff-recenter] to reset the windows afterward."
2937 (ediff-place-flags-in-buffer 2937 (ediff-place-flags-in-buffer
2938 'Ancestor ediff-ancestor-buffer 2938 'Ancestor ediff-ancestor-buffer
2939 ediff-control-buffer n)) 2939 ediff-control-buffer n))
2940 )) 2940 ))
2941 2941
2942 (ediff-install-fine-diff-if-necessary n) 2942 (ediff-install-fine-diff-if-necessary n)
2943 (run-hooks 'ediff-select-hook)))) 2943 (run-hooks 'ediff-select-hook))))
2944 2944
2945 2945
2946;; Unselect a difference by removing the ASCII flags in the buffers. 2946;; Unselect a difference by removing the ASCII flags in the buffers.
2947;; This may have to be modified for buffer C, when it will be supported. 2947;; This may have to be modified for buffer C, when it will be supported.
2948(defun ediff-unselect-difference (n) 2948(defun ediff-unselect-difference (n)
2949 (if (ediff-valid-difference-p n) 2949 (if (ediff-valid-difference-p n)
2950 (progn 2950 (progn
2951 (cond ((and (ediff-has-face-support-p) ediff-use-faces) 2951 (cond ((and (ediff-has-face-support-p) ediff-use-faces)
2952 (ediff-unhighlight-diff)) 2952 (ediff-unhighlight-diff))
2953 ((eq ediff-highlighting-style 'ascii) 2953 ((eq ediff-highlighting-style 'ascii)
@@ -2966,11 +2966,11 @@ Hit \\[ediff-recenter] to reset the windows afterward."
2966 ediff-ancestor-buffer 2966 ediff-ancestor-buffer
2967 (ediff-get-diff-overlay n 'Ancestor))) 2967 (ediff-get-diff-overlay n 'Ancestor)))
2968 )) 2968 ))
2969 2969
2970 ;; unhighlight fine diffs 2970 ;; unhighlight fine diffs
2971 (ediff-set-fine-diff-properties ediff-current-difference 'default) 2971 (ediff-set-fine-diff-properties ediff-current-difference 'default)
2972 (run-hooks 'ediff-unselect-hook)))) 2972 (run-hooks 'ediff-unselect-hook))))
2973 2973
2974 2974
2975;; Unselects prev diff and selects a new one, if FLAG has value other than 2975;; Unselects prev diff and selects a new one, if FLAG has value other than
2976;; 'select-only or 'unselect-only. If FLAG is 'select-only, the 2976;; 'select-only or 'unselect-only. If FLAG is 'select-only, the
@@ -2982,18 +2982,18 @@ Hit \\[ediff-recenter] to reset the windows afterward."
2982 (let ((ediff-current-difference n)) 2982 (let ((ediff-current-difference n))
2983 (or no-recenter 2983 (or no-recenter
2984 (ediff-recenter 'no-rehighlight))) 2984 (ediff-recenter 'no-rehighlight)))
2985 2985
2986 (let ((control-buf ediff-control-buffer)) 2986 (let ((control-buf ediff-control-buffer))
2987 (unwind-protect 2987 (unwind-protect
2988 (progn 2988 (progn
2989 (or (eq flag 'select-only) 2989 (or (eq flag 'select-only)
2990 (ediff-unselect-difference ediff-current-difference)) 2990 (ediff-unselect-difference ediff-current-difference))
2991 2991
2992 (or (eq flag 'unselect-only) 2992 (or (eq flag 'unselect-only)
2993 (ediff-select-difference n)) 2993 (ediff-select-difference n))
2994 (setq ediff-current-difference n) 2994 (setq ediff-current-difference n)
2995 ) ; end protected section 2995 ) ; end protected section
2996 2996
2997 (ediff-with-current-buffer control-buf (ediff-refresh-mode-lines))) 2997 (ediff-with-current-buffer control-buf (ediff-refresh-mode-lines)))
2998 )) 2998 ))
2999 2999
@@ -3133,8 +3133,8 @@ Hit \\[ediff-recenter] to reset the windows afterward."
3133 (file-name-nondirectory default-file) f))) 3133 (file-name-nondirectory default-file) f)))
3134 (if (and no-dirs (file-directory-p f)) 3134 (if (and no-dirs (file-directory-p f))
3135 (error "File %s is a directory" f)) 3135 (error "File %s is a directory" f))
3136 f)) 3136 f))
3137 3137
3138;; If PREFIX is given, then it is used as a prefix for the temp file 3138;; If PREFIX is given, then it is used as a prefix for the temp file
3139;; name. Otherwise, `ediff' is used. If FILE is given, use this 3139;; name. Otherwise, `ediff' is used. If FILE is given, use this
3140;; file and don't create a new one. 3140;; file and don't create a new one.
@@ -3151,7 +3151,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
3151 (not (msdos-long-file-names)) 3151 (not (msdos-long-file-names))
3152 (> (length p) 2)) 3152 (> (length p) 2))
3153 (setq short-p (substring p 0 2))) 3153 (setq short-p (substring p 0 2)))
3154 3154
3155 (setq f (concat ediff-temp-file-prefix p) 3155 (setq f (concat ediff-temp-file-prefix p)
3156 short-f (concat ediff-temp-file-prefix short-p) 3156 short-f (concat ediff-temp-file-prefix short-p)
3157 f (cond (given-file) 3157 f (cond (given-file)
@@ -3161,7 +3161,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
3161 ;; This is needed so that patches produced by ediff will 3161 ;; This is needed so that patches produced by ediff will
3162 ;; have more meaningful names 3162 ;; have more meaningful names
3163 (ediff-make-empty-tmp-file short-f)) 3163 (ediff-make-empty-tmp-file short-f))
3164 (prefix 3164 (prefix
3165 ;; Prefix is most often the same as the file name for the 3165 ;; Prefix is most often the same as the file name for the
3166 ;; variant. Here we are trying to use the original file 3166 ;; variant. Here we are trying to use the original file
3167 ;; name but in the temp directory. 3167 ;; name but in the temp directory.
@@ -3170,14 +3170,14 @@ Hit \\[ediff-recenter] to reset the windows afterward."
3170 ;; If don't care about name, add some random stuff 3170 ;; If don't care about name, add some random stuff
3171 ;; to proposed file name. 3171 ;; to proposed file name.
3172 (ediff-make-empty-tmp-file short-f)))) 3172 (ediff-make-empty-tmp-file short-f))))
3173 3173
3174 ;; create the file 3174 ;; create the file
3175 (ediff-with-current-buffer buff 3175 (ediff-with-current-buffer buff
3176 (write-region (if start start (point-min)) 3176 (write-region (if start start (point-min))
3177 (if end end (point-max)) 3177 (if end end (point-max))
3178 f 3178 f
3179 nil ; don't append---erase 3179 nil ; don't append---erase
3180 'no-message) 3180 'no-message)
3181 (set-file-modes f ediff-temp-file-mode) 3181 (set-file-modes f ediff-temp-file-mode)
3182 (expand-file-name f)))) 3182 (expand-file-name f))))
3183 3183
@@ -3232,7 +3232,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
3232 (if (verify-visited-file-modtime (current-buffer)) 3232 (if (verify-visited-file-modtime (current-buffer))
3233 (if (buffer-modified-p) 3233 (if (buffer-modified-p)
3234 ;; If buffer is not obsolete and is modified, offer to save 3234 ;; If buffer is not obsolete and is modified, offer to save
3235 (if (yes-or-no-p 3235 (if (yes-or-no-p
3236 (format "Buffer %s has been modified. Save it in file %s? " 3236 (format "Buffer %s has been modified. Save it in file %s? "
3237 (buffer-name) 3237 (buffer-name)
3238 buffer-file-name)) 3238 buffer-file-name))
@@ -3371,7 +3371,7 @@ Without an argument, it saves customized diff argument, if available
3371 (set-mark reg-end) 3371 (set-mark reg-end)
3372 (setq ediff-temp-indirect-buffer t)) 3372 (setq ediff-temp-indirect-buffer t))
3373 cloned-buff)) 3373 cloned-buff))
3374 3374
3375 3375
3376 3376
3377(defun ediff-make-cloned-buffer (buff region-name) 3377(defun ediff-make-cloned-buffer (buff region-name)
@@ -3399,7 +3399,7 @@ Without an argument, it saves customized diff argument, if available
3399 (setq buf-B-file-name (file-name-nondirectory buf-B-file-name))) 3399 (setq buf-B-file-name (file-name-nondirectory buf-B-file-name)))
3400 (setq file-A (ediff-make-temp-file ediff-buffer-A buf-A-file-name) 3400 (setq file-A (ediff-make-temp-file ediff-buffer-A buf-A-file-name)
3401 file-B (ediff-make-temp-file ediff-buffer-B buf-B-file-name)) 3401 file-B (ediff-make-temp-file ediff-buffer-B buf-B-file-name))
3402 3402
3403 (or (ediff-buffer-live-p ediff-custom-diff-buffer) 3403 (or (ediff-buffer-live-p ediff-custom-diff-buffer)
3404 (setq ediff-custom-diff-buffer 3404 (setq ediff-custom-diff-buffer
3405 (get-buffer-create 3405 (get-buffer-create
@@ -3498,7 +3498,7 @@ Ediff Control Panel to restore highlighting."
3498 nil) 3498 nil)
3499 ((equal answer "")) 3499 ((equal answer ""))
3500 (t (beep 1) 3500 (t (beep 1)
3501 (message 3501 (message
3502 "Valid values are %s" 3502 "Valid values are %s"
3503 (mapconcat 'char-to-string possibilities " or ")) 3503 (mapconcat 'char-to-string possibilities " or "))
3504 (sit-for 2) 3504 (sit-for 2)
@@ -3517,7 +3517,7 @@ Ediff Control Panel to restore highlighting."
3517 nil) 3517 nil)
3518 ((equal answer "")) 3518 ((equal answer ""))
3519 (t (beep 1) 3519 (t (beep 1)
3520 (message 3520 (message
3521 "Valid values are %s" 3521 "Valid values are %s"
3522 (mapconcat 'char-to-string possibilities " or ")) 3522 (mapconcat 'char-to-string possibilities " or "))
3523 (sit-for 2) 3523 (sit-for 2)
@@ -3577,8 +3577,8 @@ Ediff Control Panel to restore highlighting."
3577 ;; setup param to pass to ediff-setup 3577 ;; setup param to pass to ediff-setup
3578 (list (cons 'ediff-split-window-function ediff-split-window-function))) 3578 (list (cons 'ediff-split-window-function ediff-split-window-function)))
3579 )) 3579 ))
3580 3580
3581 3581
3582 3582
3583(defun ediff-remove-flags-from-buffer (buffer overlay) 3583(defun ediff-remove-flags-from-buffer (buffer overlay)
3584 (ediff-with-current-buffer buffer 3584 (ediff-with-current-buffer buffer
@@ -3586,7 +3586,7 @@ Ediff Control Panel to restore highlighting."
3586 (if ediff-xemacs-p 3586 (if ediff-xemacs-p
3587 (ediff-overlay-put overlay 'begin-glyph nil) 3587 (ediff-overlay-put overlay 'begin-glyph nil)
3588 (ediff-overlay-put overlay 'before-string nil)) 3588 (ediff-overlay-put overlay 'before-string nil))
3589 3589
3590 (if ediff-xemacs-p 3590 (if ediff-xemacs-p
3591 (ediff-overlay-put overlay 'end-glyph nil) 3591 (ediff-overlay-put overlay 'end-glyph nil)
3592 (ediff-overlay-put overlay 'after-string nil)) 3592 (ediff-overlay-put overlay 'after-string nil))
@@ -3604,32 +3604,32 @@ Ediff Control Panel to restore highlighting."
3604 (ediff-get-diff-overlay diff-no buf-type))) 3604 (ediff-get-diff-overlay diff-no buf-type)))
3605 (before (ediff-get-diff-posn buf-type 'beg diff-no ctl-buffer)) 3605 (before (ediff-get-diff-posn buf-type 'beg diff-no ctl-buffer))
3606 after beg-of-line flag) 3606 after beg-of-line flag)
3607 3607
3608 ;; insert flag before the difference 3608 ;; insert flag before the difference
3609 (goto-char before) 3609 (goto-char before)
3610 (setq beg-of-line (bolp)) 3610 (setq beg-of-line (bolp))
3611 3611
3612 (setq flag (ediff-with-current-buffer ctl-buffer 3612 (setq flag (ediff-with-current-buffer ctl-buffer
3613 (if (eq ediff-highlighting-style 'ascii) 3613 (if (eq ediff-highlighting-style 'ascii)
3614 (if beg-of-line 3614 (if beg-of-line
3615 ediff-before-flag-bol ediff-before-flag-mol)))) 3615 ediff-before-flag-bol ediff-before-flag-mol))))
3616 3616
3617 ;; insert the flag itself 3617 ;; insert the flag itself
3618 (if ediff-xemacs-p 3618 (if ediff-xemacs-p
3619 (ediff-overlay-put curr-overl 'begin-glyph flag) 3619 (ediff-overlay-put curr-overl 'begin-glyph flag)
3620 (ediff-overlay-put curr-overl 'before-string flag)) 3620 (ediff-overlay-put curr-overl 'before-string flag))
3621 3621
3622 ;; insert the flag after the difference 3622 ;; insert the flag after the difference
3623 ;; `after' must be set here, after the before-flag was inserted 3623 ;; `after' must be set here, after the before-flag was inserted
3624 (setq after (ediff-get-diff-posn buf-type 'end diff-no ctl-buffer)) 3624 (setq after (ediff-get-diff-posn buf-type 'end diff-no ctl-buffer))
3625 (goto-char after) 3625 (goto-char after)
3626 (setq beg-of-line (bolp)) 3626 (setq beg-of-line (bolp))
3627 3627
3628 (setq flag (ediff-with-current-buffer ctl-buffer 3628 (setq flag (ediff-with-current-buffer ctl-buffer
3629 (if (eq ediff-highlighting-style 'ascii) 3629 (if (eq ediff-highlighting-style 'ascii)
3630 (if beg-of-line 3630 (if beg-of-line
3631 ediff-after-flag-eol ediff-after-flag-mol)))) 3631 ediff-after-flag-eol ediff-after-flag-mol))))
3632 3632
3633 ;; insert the flag itself 3633 ;; insert the flag itself
3634 (if ediff-xemacs-p 3634 (if ediff-xemacs-p
3635 (ediff-overlay-put curr-overl 'end-glyph flag) 3635 (ediff-overlay-put curr-overl 'end-glyph flag)
@@ -3670,12 +3670,12 @@ Ediff Control Panel to restore highlighting."
3670 (buffer-substring 3670 (buffer-substring
3671 (or start (ediff-get-diff-posn buf-type 'beg n ctrl-buf)) 3671 (or start (ediff-get-diff-posn buf-type 'beg n ctrl-buf))
3672 (or end (ediff-get-diff-posn buf-type 'end n ctrl-buf))))) 3672 (or end (ediff-get-diff-posn buf-type 'end n ctrl-buf)))))
3673 3673
3674;; Returns positions of difference sectors in the BUF-TYPE buffer. 3674;; Returns positions of difference sectors in the BUF-TYPE buffer.
3675;; BUF-TYPE should be a symbol -- `A', `B', or `C'. 3675;; BUF-TYPE should be a symbol -- `A', `B', or `C'.
3676;; POS is either `beg' or `end'--it specifies whether you want the position at 3676;; POS is either `beg' or `end'--it specifies whether you want the position at
3677;; the beginning of a difference or at the end. 3677;; the beginning of a difference or at the end.
3678;; 3678;;
3679;; The optional argument N says which difference (default: 3679;; The optional argument N says which difference (default:
3680;; `ediff-current-difference'). N is the internal difference number (1- what 3680;; `ediff-current-difference'). N is the internal difference number (1- what
3681;; the user sees). The optional argument CONTROL-BUF says 3681;; the user sees). The optional argument CONTROL-BUF says
@@ -3706,21 +3706,21 @@ Ediff Control Panel to restore highlighting."
3706;; ediff-highlighting-style, and ediff-highlight-all-diffs variables. 3706;; ediff-highlighting-style, and ediff-highlight-all-diffs variables.
3707(defun ediff-restore-highlighting (&optional ctl-buf) 3707(defun ediff-restore-highlighting (&optional ctl-buf)
3708 (ediff-with-current-buffer (or ctl-buf (current-buffer)) 3708 (ediff-with-current-buffer (or ctl-buf (current-buffer))
3709 (if (and (ediff-has-face-support-p) 3709 (if (and (ediff-has-face-support-p)
3710 ediff-use-faces 3710 ediff-use-faces
3711 ediff-highlight-all-diffs) 3711 ediff-highlight-all-diffs)
3712 (ediff-paint-background-regions)) 3712 (ediff-paint-background-regions))
3713 (ediff-select-difference ediff-current-difference))) 3713 (ediff-select-difference ediff-current-difference)))
3714 3714
3715 3715
3716 3716
3717;; null out difference overlays so they won't slow down future 3717;; null out difference overlays so they won't slow down future
3718;; editing operations 3718;; editing operations
3719;; VEC is either a difference vector or a fine-diff vector 3719;; VEC is either a difference vector or a fine-diff vector
3720(defun ediff-clear-diff-vector (vec-var &optional fine-diffs-also) 3720(defun ediff-clear-diff-vector (vec-var &optional fine-diffs-also)
3721 (if (vectorp (symbol-value vec-var)) 3721 (if (vectorp (symbol-value vec-var))
3722 (mapcar (lambda (elt) 3722 (mapcar (lambda (elt)
3723 (ediff-delete-overlay 3723 (ediff-delete-overlay
3724 (ediff-get-diff-overlay-from-diff-record elt)) 3724 (ediff-get-diff-overlay-from-diff-record elt))
3725 (if fine-diffs-also 3725 (if fine-diffs-also
3726 (ediff-clear-fine-diff-vector elt)) 3726 (ediff-clear-fine-diff-vector elt))
@@ -3729,7 +3729,7 @@ Ediff Control Panel to restore highlighting."
3729 ;; allow them to be garbage collected 3729 ;; allow them to be garbage collected
3730 (set vec-var nil)) 3730 (set vec-var nil))
3731 3731
3732 3732
3733 3733
3734;;; Misc 3734;;; Misc
3735 3735
@@ -3749,13 +3749,13 @@ Ediff Control Panel to restore highlighting."
3749 (setq beg (eval beg))) 3749 (setq beg (eval beg)))
3750 (or (number-or-marker-p end) 3750 (or (number-or-marker-p end)
3751 (setq end (eval end))) 3751 (setq end (eval end)))
3752 (setq overl 3752 (setq overl
3753 (ediff-cond-compile-for-xemacs-or-emacs 3753 (ediff-cond-compile-for-xemacs-or-emacs
3754 (make-extent beg end buff) ; xemacs 3754 (make-extent beg end buff) ; xemacs
3755 ;; advance front and rear of the overlay 3755 ;; advance front and rear of the overlay
3756 (make-overlay beg end buff nil 'rear-advance) ; emacs 3756 (make-overlay beg end buff nil 'rear-advance) ; emacs
3757 )) 3757 ))
3758 3758
3759 ;; never detach 3759 ;; never detach
3760 (ediff-overlay-put 3760 (ediff-overlay-put
3761 overl (if ediff-emacs-p 'evaporate 'detachable) nil) 3761 overl (if ediff-emacs-p 'evaporate 'detachable) nil)
@@ -3763,7 +3763,7 @@ Ediff Control Panel to restore highlighting."
3763 ;; In emacs, it is made open ended at creation time 3763 ;; In emacs, it is made open ended at creation time
3764 (if ediff-xemacs-p 3764 (if ediff-xemacs-p
3765 (progn 3765 (progn
3766 (ediff-overlay-put overl 'start-open nil) 3766 (ediff-overlay-put overl 'start-open nil)
3767 (ediff-overlay-put overl 'end-open nil))) 3767 (ediff-overlay-put overl 'end-open nil)))
3768 (ediff-overlay-put overl 'ediff-diff-num 0) 3768 (ediff-overlay-put overl 'ediff-diff-num 0)
3769 overl)))) 3769 overl))))
@@ -3783,13 +3783,13 @@ Ediff Control Panel to restore highlighting."
3783 (ediff-set-overlay-face (symbol-value overlay) face) 3783 (ediff-set-overlay-face (symbol-value overlay) face)
3784 (ediff-overlay-put (symbol-value overlay) 'ediff ediff-control-buffer)) 3784 (ediff-overlay-put (symbol-value overlay) 'ediff ediff-control-buffer))
3785 )) 3785 ))
3786 3786
3787 3787
3788;; Like other-buffer, but prefers visible buffers and ignores temporary or 3788;; Like other-buffer, but prefers visible buffers and ignores temporary or
3789;; other insignificant buffers (those beginning with "^[ *]"). 3789;; other insignificant buffers (those beginning with "^[ *]").
3790;; Gets one arg--buffer name or a list of buffer names (it won't return 3790;; Gets one arg--buffer name or a list of buffer names (it won't return
3791;; these buffers). 3791;; these buffers).
3792;; EXCL-BUFF-LIST is an exclusion list. 3792;; EXCL-BUFF-LIST is an exclusion list.
3793(defun ediff-other-buffer (excl-buff-lst) 3793(defun ediff-other-buffer (excl-buff-lst)
3794 (or (listp excl-buff-lst) (setq excl-buff-lst (list excl-buff-lst))) 3794 (or (listp excl-buff-lst) (setq excl-buff-lst (list excl-buff-lst)))
3795 (let* ((all-buffers (nconc (ediff-get-selected-buffers) (buffer-list))) 3795 (let* ((all-buffers (nconc (ediff-get-selected-buffers) (buffer-list)))
@@ -3799,8 +3799,8 @@ Ediff Control Panel to restore highlighting."
3799 (selected-buffers (ediff-get-selected-buffers)) 3799 (selected-buffers (ediff-get-selected-buffers))
3800 (prefered-buffer (car all-buffers)) 3800 (prefered-buffer (car all-buffers))
3801 visible-dired-buffers 3801 visible-dired-buffers
3802 (excl-buff-name-list 3802 (excl-buff-name-list
3803 (mapcar 3803 (mapcar
3804 (lambda (b) (cond ((stringp b) b) 3804 (lambda (b) (cond ((stringp b) b)
3805 ((bufferp b) (buffer-name b)))) 3805 ((bufferp b) (buffer-name b))))
3806 excl-buff-lst)) 3806 excl-buff-lst))
@@ -3857,10 +3857,10 @@ Ediff Control Panel to restore highlighting."
3857 (clean-significant-buffers (delq nil significant-buffers)) 3857 (clean-significant-buffers (delq nil significant-buffers))
3858 less-significant-buffers) 3858 less-significant-buffers)
3859 3859
3860 (if (and (null clean-significant-buffers) 3860 (if (and (null clean-significant-buffers)
3861 (> (length visible-dired-buffers) 0)) 3861 (> (length visible-dired-buffers) 0))
3862 (setq clean-significant-buffers visible-dired-buffers)) 3862 (setq clean-significant-buffers visible-dired-buffers))
3863 3863
3864 (cond (clean-significant-buffers (car clean-significant-buffers)) 3864 (cond (clean-significant-buffers (car clean-significant-buffers))
3865 ;; try also buffers that are not displayed in windows 3865 ;; try also buffers that are not displayed in windows
3866 ((setq less-significant-buffers 3866 ((setq less-significant-buffers
@@ -3884,7 +3884,7 @@ Ediff Control Panel to restore highlighting."
3884 (car less-significant-buffers)) 3884 (car less-significant-buffers))
3885 (t "*scratch*")) 3885 (t "*scratch*"))
3886 )) 3886 ))
3887 3887
3888 3888
3889;; If current buffer is a Buffer-menu buffer, then take the selected buffers 3889;; If current buffer is a Buffer-menu buffer, then take the selected buffers
3890;; and append the buffer at the cursor to the end. 3890;; and append the buffer at the cursor to the end.
@@ -3902,9 +3902,9 @@ Ediff Control Panel to restore highlighting."
3902 (setq lis (cons (Buffer-menu-buffer t) lis))) 3902 (setq lis (cons (Buffer-menu-buffer t) lis)))
3903 lis)) 3903 lis))
3904 )) 3904 ))
3905 3905
3906;; Construct a unique buffer name. 3906;; Construct a unique buffer name.
3907;; The first one tried is prefixsuffix, then prefix<2>suffix, 3907;; The first one tried is prefixsuffix, then prefix<2>suffix,
3908;; prefix<3>suffix, etc. 3908;; prefix<3>suffix, etc.
3909(defun ediff-unique-buffer-name (prefix suffix) 3909(defun ediff-unique-buffer-name (prefix suffix)
3910 (if (null (get-buffer (concat prefix suffix))) 3910 (if (null (get-buffer (concat prefix suffix)))
@@ -3913,7 +3913,7 @@ Ediff Control Panel to restore highlighting."
3913 (while (get-buffer (format "%s<%d>%s" prefix n suffix)) 3913 (while (get-buffer (format "%s<%d>%s" prefix n suffix))
3914 (setq n (1+ n))) 3914 (setq n (1+ n)))
3915 (format "%s<%d>%s" prefix n suffix)))) 3915 (format "%s<%d>%s" prefix n suffix))))
3916 3916
3917 3917
3918(defun ediff-submit-report () 3918(defun ediff-submit-report ()
3919 "Submit bug report on Ediff." 3919 "Submit bug report on Ediff."
@@ -3926,7 +3926,7 @@ Ediff Control Panel to restore highlighting."
3926 (setq varlist '(ediff-diff-program ediff-diff-options 3926 (setq varlist '(ediff-diff-program ediff-diff-options
3927 ediff-patch-program ediff-patch-options 3927 ediff-patch-program ediff-patch-options
3928 ediff-shell 3928 ediff-shell
3929 ediff-use-faces 3929 ediff-use-faces
3930 ediff-auto-refine ediff-highlighting-style 3930 ediff-auto-refine ediff-highlighting-style
3931 ediff-buffer-A ediff-buffer-B ediff-control-buffer 3931 ediff-buffer-A ediff-buffer-B ediff-control-buffer
3932 ediff-forward-word-function 3932 ediff-forward-word-function
@@ -3948,10 +3948,10 @@ Please make a concise and accurate summary of what happened
3948and mail it to the address above. 3948and mail it to the address above.
3949----------------------------------------------------------- 3949-----------------------------------------------------------
3950") 3950")
3951 3951
3952 (ediff-skip-unsuitable-frames) 3952 (ediff-skip-unsuitable-frames)
3953 (ediff-reset-mouse) 3953 (ediff-reset-mouse)
3954 3954
3955 (switch-to-buffer ediff-msg-buffer) 3955 (switch-to-buffer ediff-msg-buffer)
3956 (erase-buffer) 3956 (erase-buffer)
3957 (delete-other-windows) 3957 (delete-other-windows)
@@ -3978,7 +3978,7 @@ byte-compilation may produce output like this:
3978 ** reference to free variable pm-color-alist 3978 ** reference to free variable pm-color-alist
3979 ........................ 3979 ........................
3980 While compiling the end of the data: 3980 While compiling the end of the data:
3981 ** The following functions are not known to be defined: 3981 ** The following functions are not known to be defined:
3982 ediff-valid-color-p, ediff-set-face, 3982 ediff-valid-color-p, ediff-set-face,
3983 ........................ 3983 ........................
3984 3984
@@ -3988,7 +3988,7 @@ Please do not report those and similar things. However, comments and
3988suggestions are always welcome. 3988suggestions are always welcome.
3989 3989
3990Mail anyway? (y or n) ") 3990Mail anyway? (y or n) ")
3991 3991
3992 (if (y-or-n-p "Mail anyway? ") 3992 (if (y-or-n-p "Mail anyway? ")
3993 (progn 3993 (progn
3994 (if (ediff-buffer-live-p ctl-buf) 3994 (if (ediff-buffer-live-p ctl-buf)
@@ -3998,7 +3998,7 @@ Mail anyway? (y or n) ")
3998 (reporter-submit-bug-report "kifer@cs.stonybrook.edu" 3998 (reporter-submit-bug-report "kifer@cs.stonybrook.edu"
3999 (ediff-version) 3999 (ediff-version)
4000 varlist 4000 varlist
4001 nil 4001 nil
4002 'delete-other-windows 4002 'delete-other-windows
4003 salutation)) 4003 salutation))
4004 (bury-buffer) 4004 (bury-buffer)
@@ -4018,16 +4018,16 @@ Mail anyway? (y or n) ")
4018(defun ediff-choose-syntax-table () 4018(defun ediff-choose-syntax-table ()
4019 (setq ediff-syntax-table 4019 (setq ediff-syntax-table
4020 (ediff-with-current-buffer ediff-buffer-A 4020 (ediff-with-current-buffer ediff-buffer-A
4021 (if (not (memq major-mode 4021 (if (not (memq major-mode
4022 '(fundamental-mode text-mode indented-text-mode))) 4022 '(fundamental-mode text-mode indented-text-mode)))
4023 (syntax-table)))) 4023 (syntax-table))))
4024 (if (not ediff-syntax-table) 4024 (if (not ediff-syntax-table)
4025 (setq ediff-syntax-table 4025 (setq ediff-syntax-table
4026 (ediff-with-current-buffer ediff-buffer-B 4026 (ediff-with-current-buffer ediff-buffer-B
4027 (syntax-table)))) 4027 (syntax-table))))
4028 ) 4028 )
4029 4029
4030 4030
4031(defun ediff-deactivate-mark () 4031(defun ediff-deactivate-mark ()
4032 (ediff-cond-compile-for-xemacs-or-emacs 4032 (ediff-cond-compile-for-xemacs-or-emacs
4033 (zmacs-deactivate-region) ; xemacs 4033 (zmacs-deactivate-region) ; xemacs
@@ -4062,7 +4062,7 @@ Mail anyway? (y or n) ")
4062 (setq selective-display nil))))) 4062 (setq selective-display nil)))))
4063 )) 4063 ))
4064 4064
4065 4065
4066;; The next two are modified versions from emerge.el. 4066;; The next two are modified versions from emerge.el.
4067;; VARS must be a list of symbols 4067;; VARS must be a list of symbols
4068;; ediff-save-variables returns an association list: ((var . val) ...) 4068;; ediff-save-variables returns an association list: ((var . val) ...)
@@ -4083,8 +4083,8 @@ Mail anyway? (y or n) ")
4083 (assoc-elt (assoc var assoc-list))) 4083 (assoc-elt (assoc var assoc-list)))
4084 (if assoc-elt 4084 (if assoc-elt
4085 (setcdr assoc-elt value)))) 4085 (setcdr assoc-elt value))))
4086 4086
4087 4087
4088;; must execute in control buf 4088;; must execute in control buf
4089(defun ediff-save-protected-variables () 4089(defun ediff-save-protected-variables ()
4090 (setq ediff-buffer-values-orig-A 4090 (setq ediff-buffer-values-orig-A
@@ -4144,7 +4144,7 @@ Mail anyway? (y or n) ")
4144 4144
4145(defsubst ediff-save-time () 4145(defsubst ediff-save-time ()
4146 (setq ediff-command-begin-time (current-time))) 4146 (setq ediff-command-begin-time (current-time)))
4147 4147
4148(defun ediff-profile () 4148(defun ediff-profile ()
4149 "Toggle profiling Ediff commands." 4149 "Toggle profiling Ediff commands."
4150 (interactive) 4150 (interactive)
@@ -4165,7 +4165,7 @@ Mail anyway? (y or n) ")
4165 (add-hook pre-hook 'ediff-save-time t 'local) 4165 (add-hook pre-hook 'ediff-save-time t 'local)
4166 (add-hook post-hook 'ediff-calc-command-time nil 'local) 4166 (add-hook post-hook 'ediff-calc-command-time nil 'local)
4167 (message "Ediff profiling enabled")))) 4167 (message "Ediff profiling enabled"))))
4168 4168
4169(defun ediff-print-diff-vector (diff-vector-var) 4169(defun ediff-print-diff-vector (diff-vector-var)
4170 (princ (format "\n*** %S ***\n" diff-vector-var)) 4170 (princ (format "\n*** %S ***\n" diff-vector-var))
4171 (mapcar (lambda (overl-vec) 4171 (mapcar (lambda (overl-vec)
@@ -4176,7 +4176,7 @@ Mail anyway? (y or n) ")
4176\t\tNo-fine-diff-flag: %S 4176\t\tNo-fine-diff-flag: %S
4177\t\tState-of-diff:\t %S 4177\t\tState-of-diff:\t %S
4178\t\tState-of-merge:\t %S 4178\t\tState-of-merge:\t %S
4179" 4179"
4180 (1+ (ediff-overlay-get (aref overl-vec 0) 'ediff-diff-num)) 4180 (1+ (ediff-overlay-get (aref overl-vec 0) 'ediff-diff-num))
4181 (aref overl-vec 0) 4181 (aref overl-vec 0)
4182 ;; fine-diff-vector 4182 ;; fine-diff-vector
@@ -4190,7 +4190,7 @@ Mail anyway? (y or n) ")
4190 ))) 4190 )))
4191 (eval diff-vector-var))) 4191 (eval diff-vector-var)))
4192 4192
4193 4193
4194 4194
4195(defun ediff-debug-info () 4195(defun ediff-debug-info ()
4196 (interactive) 4196 (interactive)
@@ -4233,7 +4233,7 @@ Mail anyway? (y or n) ")
4233 (nconc result (list (car lis1)))) 4233 (nconc result (list (car lis1))))
4234 (setq lis1 (cdr lis1))) 4234 (setq lis1 (cdr lis1)))
4235 (cdr result))) 4235 (cdr result)))
4236 4236
4237 4237
4238;; eliminates duplicates using comparison-func 4238;; eliminates duplicates using comparison-func
4239(defun ediff-union (lis1 lis2 comparison-func) 4239(defun ediff-union (lis1 lis2 comparison-func)
@@ -4278,7 +4278,7 @@ Mail anyway? (y or n) ")
4278;;(ediff-load-version-control 'silent) 4278;;(ediff-load-version-control 'silent)
4279 4279
4280(run-hooks 'ediff-load-hook) 4280(run-hooks 'ediff-load-hook)
4281 4281
4282 4282
4283;;; Local Variables: 4283;;; Local Variables:
4284;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) 4284;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
diff --git a/lisp/ediff-vers.el b/lisp/ediff-vers.el
index 03bc171a657..6438b4b380f 100644
--- a/lisp/ediff-vers.el
+++ b/lisp/ediff-vers.el
@@ -50,7 +50,7 @@
50 (load "ediff-init.el" nil nil 'nosuffix)) 50 (load "ediff-init.el" nil nil 'nosuffix))
51 ))) 51 )))
52;; end pacifier 52;; end pacifier
53 53
54;; VC.el support 54;; VC.el support
55 55
56(defun ediff-vc-latest-version (file) 56(defun ediff-vc-latest-version (file)
@@ -72,7 +72,7 @@
72 ;; If the current buffer is named `F', the version is named `F.~REV~'. 72 ;; If the current buffer is named `F', the version is named `F.~REV~'.
73 ;; If `F.~REV~' already exists, it is used instead of being re-created. 73 ;; If `F.~REV~' already exists, it is used instead of being re-created.
74 (let (file1 file2 rev1buf rev2buf) 74 (let (file1 file2 rev1buf rev2buf)
75 (if (string= rev1 "") 75 (if (string= rev1 "")
76 (setq rev1 (ediff-vc-latest-version (buffer-file-name)))) 76 (setq rev1 (ediff-vc-latest-version (buffer-file-name))))
77 (save-window-excursion 77 (save-window-excursion
78 (save-excursion 78 (save-excursion
@@ -93,12 +93,12 @@
93 rev1buf rev2buf 93 rev1buf rev2buf
94 startup-hooks 94 startup-hooks
95 'ediff-revision))) 95 'ediff-revision)))
96 96
97;; RCS.el support 97;; RCS.el support
98(defun rcs-ediff-view-revision (&optional rev) 98(defun rcs-ediff-view-revision (&optional rev)
99;; View previous RCS revision of current file. 99;; View previous RCS revision of current file.
100;; With prefix argument, prompts for a revision name. 100;; With prefix argument, prompts for a revision name.
101 (interactive (list (if current-prefix-arg 101 (interactive (list (if current-prefix-arg
102 (read-string "Revision: ")))) 102 (read-string "Revision: "))))
103 (let* ((filename (buffer-file-name (current-buffer))) 103 (let* ((filename (buffer-file-name (current-buffer)))
104 (switches (append '("-p") 104 (switches (append '("-p")
@@ -116,10 +116,10 @@
116 (apply 'call-process "co" nil t nil 116 (apply 'call-process "co" nil t nil
117 ;; -q: quiet (no diagnostics) 117 ;; -q: quiet (no diagnostics)
118 (append switches rcs-default-co-switches 118 (append switches rcs-default-co-switches
119 (list "-q" filename))))) 119 (list "-q" filename)))))
120 (message "") 120 (message "")
121 buff))) 121 buff)))
122 122
123(defun ediff-rcs-get-output-buffer (file name) 123(defun ediff-rcs-get-output-buffer (file name)
124 ;; Get a buffer for RCS output for FILE, make it writable and clean it up. 124 ;; Get a buffer for RCS output for FILE, make it writable and clean it up.
125 ;; Optional NAME is name to use instead of `*RCS-output*'. 125 ;; Optional NAME is name to use instead of `*RCS-output*'.
@@ -143,7 +143,7 @@
143 (current-buffer) 143 (current-buffer)
144 (rcs-ediff-view-revision rev2)) 144 (rcs-ediff-view-revision rev2))
145 rev1buf (rcs-ediff-view-revision rev1))) 145 rev1buf (rcs-ediff-view-revision rev1)))
146 146
147 ;; rcs.el doesn't create temp version files, so we don't have to delete 147 ;; rcs.el doesn't create temp version files, so we don't have to delete
148 ;; anything in startup hooks to ediff-buffers 148 ;; anything in startup hooks to ediff-buffers
149 (ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision) 149 (ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision)
@@ -177,7 +177,7 @@
177 177
178;;; Merge with Version Control 178;;; Merge with Version Control
179 179
180(defun ediff-vc-merge-internal (rev1 rev2 ancestor-rev 180(defun ediff-vc-merge-internal (rev1 rev2 ancestor-rev
181 &optional startup-hooks merge-buffer-file) 181 &optional startup-hooks merge-buffer-file)
182;; If ANCESTOR-REV non-nil, merge with ancestor 182;; If ANCESTOR-REV non-nil, merge with ancestor
183 (let (buf1 buf2 ancestor-buf) 183 (let (buf1 buf2 ancestor-buf)
@@ -195,9 +195,9 @@
195 (setq ancestor-rev (vc-workfile-version buffer-file-name))) 195 (setq ancestor-rev (vc-workfile-version buffer-file-name)))
196 (vc-version-other-window ancestor-rev) 196 (vc-version-other-window ancestor-rev)
197 (setq ancestor-buf (current-buffer)))) 197 (setq ancestor-buf (current-buffer))))
198 (setq startup-hooks 198 (setq startup-hooks
199 (cons 199 (cons
200 `(lambda () 200 `(lambda ()
201 (delete-file ,(buffer-file-name buf1)) 201 (delete-file ,(buffer-file-name buf1))
202 (or ,(string= rev2 "") 202 (or ,(string= rev2 "")
203 (delete-file ,(buffer-file-name buf2))) 203 (delete-file ,(buffer-file-name buf2)))
@@ -278,11 +278,11 @@
278 (default-directory 278 (default-directory
279 (file-name-as-directory (cvs-fileinfo->dir fileinfo))) 279 (file-name-as-directory (cvs-fileinfo->dir fileinfo)))
280 ancestor-file) 280 ancestor-file)
281 281
282 (or (memq type '(MERGED CONFLICT MODIFIED)) 282 (or (memq type '(MERGED CONFLICT MODIFIED))
283 (error 283 (error
284 "Can only merge `Modified', `Merged' or `Conflict' files")) 284 "Can only merge `Modified', `Merged' or `Conflict' files"))
285 285
286 (cond ((memq type '(MERGED CONFLICT)) 286 (cond ((memq type '(MERGED CONFLICT))
287 (setq ancestor-file 287 (setq ancestor-file
288 (cvs-retrieve-revision-to-tmpfile 288 (cvs-retrieve-revision-to-tmpfile
diff --git a/lisp/ediff-wind.el b/lisp/ediff-wind.el
index 9e959265390..f2a0ccdd790 100644
--- a/lisp/ediff-wind.el
+++ b/lisp/ediff-wind.el
@@ -24,7 +24,7 @@
24;;; Commentary: 24;;; Commentary:
25 25
26;;; Code: 26;;; Code:
27 27
28(provide 'ediff-wind) 28(provide 'ediff-wind)
29 29
30;; Compiler pacifier 30;; Compiler pacifier
@@ -281,7 +281,7 @@ into icons, regardless of the window manager."
281 ) 281 )
282 ) 282 )
283 )) 283 ))
284 284
285 285
286;; Select the lowest window on the frame. 286;; Select the lowest window on the frame.
287(defun ediff-select-lowest-window () 287(defun ediff-select-lowest-window ()
@@ -301,7 +301,7 @@ into icons, regardless of the window manager."
301 (progn 301 (progn
302 (setq bottom-edge next-bottom-edge) 302 (setq bottom-edge next-bottom-edge)
303 (setq lowest-window this-window))) 303 (setq lowest-window this-window)))
304 304
305 (select-window this-window) 305 (select-window this-window)
306 (if (eq last-window this-window) 306 (if (eq last-window this-window)
307 (progn 307 (progn
@@ -322,11 +322,11 @@ into icons, regardless of the window manager."
322 (run-hooks 'ediff-before-setup-windows-hook) 322 (run-hooks 'ediff-before-setup-windows-hook)
323 (if (eq (selected-window) (minibuffer-window)) 323 (if (eq (selected-window) (minibuffer-window))
324 (other-window 1)) 324 (other-window 1))
325 325
326 ;; in case user did a no-no on a tty 326 ;; in case user did a no-no on a tty
327 (or (ediff-window-display-p) 327 (or (ediff-window-display-p)
328 (setq ediff-window-setup-function 'ediff-setup-windows-plain)) 328 (setq ediff-window-setup-function 'ediff-setup-windows-plain))
329 329
330 (or (ediff-keep-window-config control-buffer) 330 (or (ediff-keep-window-config control-buffer)
331 (funcall 331 (funcall
332 (ediff-with-current-buffer control-buffer ediff-window-setup-function) 332 (ediff-with-current-buffer control-buffer ediff-window-setup-function)
@@ -344,7 +344,7 @@ into icons, regardless of the window manager."
344 buffer-A buffer-B buffer-C control-buffer) 344 buffer-A buffer-B buffer-C control-buffer)
345 (ediff-setup-windows-plain-compare 345 (ediff-setup-windows-plain-compare
346 buffer-A buffer-B buffer-C control-buffer))) 346 buffer-A buffer-B buffer-C control-buffer)))
347 347
348(defun ediff-setup-windows-plain-merge (buf-A buf-B buf-C control-buffer) 348(defun ediff-setup-windows-plain-merge (buf-A buf-B buf-C control-buffer)
349 ;; skip dedicated and unsplittable frames 349 ;; skip dedicated and unsplittable frames
350 (ediff-destroy-control-frame control-buffer) 350 (ediff-destroy-control-frame control-buffer)
@@ -360,43 +360,43 @@ into icons, regardless of the window manager."
360 (split-window-vertically) 360 (split-window-vertically)
361 (ediff-select-lowest-window) 361 (ediff-select-lowest-window)
362 (ediff-setup-control-buffer control-buffer) 362 (ediff-setup-control-buffer control-buffer)
363 363
364 ;; go to the upper window and split it betw A, B, and possibly C 364 ;; go to the upper window and split it betw A, B, and possibly C
365 (other-window 1) 365 (other-window 1)
366 (setq merge-window-lines 366 (setq merge-window-lines
367 (max 2 (round (* (window-height) merge-window-share)))) 367 (max 2 (round (* (window-height) merge-window-share))))
368 (switch-to-buffer buf-A) 368 (switch-to-buffer buf-A)
369 (setq wind-A (selected-window)) 369 (setq wind-A (selected-window))
370 370
371 ;; XEmacs used to have a lot of trouble with display 371 ;; XEmacs used to have a lot of trouble with display
372 ;; It did't set things right unless we tell it to sit still 372 ;; It did't set things right unless we tell it to sit still
373 ;; 19.12 seems ok. 373 ;; 19.12 seems ok.
374 ;;(if ediff-xemacs-p (sit-for 0)) 374 ;;(if ediff-xemacs-p (sit-for 0))
375 375
376 (split-window-vertically (max 2 (- (window-height) merge-window-lines))) 376 (split-window-vertically (max 2 (- (window-height) merge-window-lines)))
377 (if (eq (selected-window) wind-A) 377 (if (eq (selected-window) wind-A)
378 (other-window 1)) 378 (other-window 1))
379 (setq wind-C (selected-window)) 379 (setq wind-C (selected-window))
380 (switch-to-buffer buf-C) 380 (switch-to-buffer buf-C)
381 381
382 (select-window wind-A) 382 (select-window wind-A)
383 (funcall split-window-function) 383 (funcall split-window-function)
384 384
385 (if (eq (selected-window) wind-A) 385 (if (eq (selected-window) wind-A)
386 (other-window 1)) 386 (other-window 1))
387 (switch-to-buffer buf-B) 387 (switch-to-buffer buf-B)
388 (setq wind-B (selected-window)) 388 (setq wind-B (selected-window))
389 389
390 (ediff-with-current-buffer control-buffer 390 (ediff-with-current-buffer control-buffer
391 (setq ediff-window-A wind-A 391 (setq ediff-window-A wind-A
392 ediff-window-B wind-B 392 ediff-window-B wind-B
393 ediff-window-C wind-C)) 393 ediff-window-C wind-C))
394 394
395 (ediff-select-lowest-window) 395 (ediff-select-lowest-window)
396 (ediff-setup-control-buffer control-buffer) 396 (ediff-setup-control-buffer control-buffer)
397 )) 397 ))
398 398
399 399
400;; This function handles all comparison jobs, including 3way jobs 400;; This function handles all comparison jobs, including 3way jobs
401(defun ediff-setup-windows-plain-compare (buf-A buf-B buf-C control-buffer) 401(defun ediff-setup-windows-plain-compare (buf-A buf-B buf-C control-buffer)
402 ;; skip dedicated and unsplittable frames 402 ;; skip dedicated and unsplittable frames
@@ -419,7 +419,7 @@ into icons, regardless of the window manager."
419 (split-window-vertically) 419 (split-window-vertically)
420 (ediff-select-lowest-window) 420 (ediff-select-lowest-window)
421 (ediff-setup-control-buffer control-buffer) 421 (ediff-setup-control-buffer control-buffer)
422 422
423 ;; go to the upper window and split it betw A, B, and possibly C 423 ;; go to the upper window and split it betw A, B, and possibly C
424 (other-window 1) 424 (other-window 1)
425 (switch-to-buffer buf-A) 425 (switch-to-buffer buf-A)
@@ -430,19 +430,19 @@ into icons, regardless of the window manager."
430 (window-height wind-A) 430 (window-height wind-A)
431 (window-width wind-A)) 431 (window-width wind-A))
432 3))) 432 3)))
433 433
434 ;; XEmacs used to have a lot of trouble with display 434 ;; XEmacs used to have a lot of trouble with display
435 ;; It did't set things right unless we told it to sit still 435 ;; It did't set things right unless we told it to sit still
436 ;; 19.12 seems ok. 436 ;; 19.12 seems ok.
437 ;;(if ediff-xemacs-p (sit-for 0)) 437 ;;(if ediff-xemacs-p (sit-for 0))
438 438
439 (funcall split-window-function wind-width-or-height) 439 (funcall split-window-function wind-width-or-height)
440 440
441 (if (eq (selected-window) wind-A) 441 (if (eq (selected-window) wind-A)
442 (other-window 1)) 442 (other-window 1))
443 (switch-to-buffer buf-B) 443 (switch-to-buffer buf-B)
444 (setq wind-B (selected-window)) 444 (setq wind-B (selected-window))
445 445
446 (if three-way-comparison 446 (if three-way-comparison
447 (progn 447 (progn
448 (funcall split-window-function) ; equally 448 (funcall split-window-function) ; equally
@@ -450,24 +450,24 @@ into icons, regardless of the window manager."
450 (other-window 1)) 450 (other-window 1))
451 (switch-to-buffer buf-C) 451 (switch-to-buffer buf-C)
452 (setq wind-C (selected-window)))) 452 (setq wind-C (selected-window))))
453 453
454 (ediff-with-current-buffer control-buffer 454 (ediff-with-current-buffer control-buffer
455 (setq ediff-window-A wind-A 455 (setq ediff-window-A wind-A
456 ediff-window-B wind-B 456 ediff-window-B wind-B
457 ediff-window-C wind-C)) 457 ediff-window-C wind-C))
458 458
459 ;; It is unlikely that we will want to implement 3way window comparison. 459 ;; It is unlikely that we will want to implement 3way window comparison.
460 ;; So, only buffers A and B are used here. 460 ;; So, only buffers A and B are used here.
461 (if ediff-windows-job 461 (if ediff-windows-job
462 (progn 462 (progn
463 (set-window-start wind-A wind-A-start) 463 (set-window-start wind-A wind-A-start)
464 (set-window-start wind-B wind-B-start))) 464 (set-window-start wind-B wind-B-start)))
465 465
466 (ediff-select-lowest-window) 466 (ediff-select-lowest-window)
467 (ediff-setup-control-buffer control-buffer) 467 (ediff-setup-control-buffer control-buffer)
468 )) 468 ))
469 469
470 470
471;; dispatch an appropriate window setup function 471;; dispatch an appropriate window setup function
472(defun ediff-setup-windows-multiframe (buf-A buf-B buf-C control-buf) 472(defun ediff-setup-windows-multiframe (buf-A buf-B buf-C control-buf)
473 (ediff-with-current-buffer control-buf 473 (ediff-with-current-buffer control-buf
@@ -475,7 +475,7 @@ into icons, regardless of the window manager."
475 (if ediff-merge-job 475 (if ediff-merge-job
476 (ediff-setup-windows-multiframe-merge buf-A buf-B buf-C control-buf) 476 (ediff-setup-windows-multiframe-merge buf-A buf-B buf-C control-buf)
477 (ediff-setup-windows-multiframe-compare buf-A buf-B buf-C control-buf))) 477 (ediff-setup-windows-multiframe-compare buf-A buf-B buf-C control-buf)))
478 478
479(defun ediff-setup-windows-multiframe-merge (buf-A buf-B buf-C control-buf) 479(defun ediff-setup-windows-multiframe-merge (buf-A buf-B buf-C control-buf)
480;;; Algorithm: 480;;; Algorithm:
481;;; 1. Never use frames that have dedicated windows in them---it is bad to 481;;; 1. Never use frames that have dedicated windows in them---it is bad to
@@ -491,7 +491,7 @@ into icons, regardless of the window manager."
491 ;; Skip dedicated or iconified frames. 491 ;; Skip dedicated or iconified frames.
492 ;; Unsplittable frames are taken care of later. 492 ;; Unsplittable frames are taken care of later.
493 (ediff-skip-unsuitable-frames 'ok-unsplittable) 493 (ediff-skip-unsuitable-frames 'ok-unsplittable)
494 494
495 (let* ((window-min-height 1) 495 (let* ((window-min-height 1)
496 (wind-A (ediff-get-visible-buffer-window buf-A)) 496 (wind-A (ediff-get-visible-buffer-window buf-A))
497 (wind-B (ediff-get-visible-buffer-window buf-B)) 497 (wind-B (ediff-get-visible-buffer-window buf-B))
@@ -531,7 +531,7 @@ into icons, regardless of the window manager."
531 merge-window-lines 531 merge-window-lines
532 designated-minibuffer-frame 532 designated-minibuffer-frame
533 done-A done-B done-C) 533 done-A done-B done-C)
534 534
535 ;; buf-A on its own 535 ;; buf-A on its own
536 (if (and (window-live-p wind-A) 536 (if (and (window-live-p wind-A)
537 (null use-same-frame) ; implies wind-A is suitable 537 (null use-same-frame) ; implies wind-A is suitable
@@ -542,7 +542,7 @@ into icons, regardless of the window manager."
542 (delete-other-windows) 542 (delete-other-windows)
543 (setq wind-A (selected-window)) 543 (setq wind-A (selected-window))
544 (setq done-A t))) 544 (setq done-A t)))
545 545
546 ;; buf-B on its own 546 ;; buf-B on its own
547 (if (and (window-live-p wind-B) 547 (if (and (window-live-p wind-B)
548 (null use-same-frame) ; implies wind-B is suitable 548 (null use-same-frame) ; implies wind-B is suitable
@@ -553,7 +553,7 @@ into icons, regardless of the window manager."
553 (delete-other-windows) 553 (delete-other-windows)
554 (setq wind-B (selected-window)) 554 (setq wind-B (selected-window))
555 (setq done-B t))) 555 (setq done-B t)))
556 556
557 ;; buf-C on its own 557 ;; buf-C on its own
558 (if (and (window-live-p wind-C) 558 (if (and (window-live-p wind-C)
559 (ediff-window-ok-for-display wind-C) 559 (ediff-window-ok-for-display wind-C)
@@ -564,7 +564,7 @@ into icons, regardless of the window manager."
564 (delete-other-windows) 564 (delete-other-windows)
565 (setq wind-C (selected-window)) 565 (setq wind-C (selected-window))
566 (setq done-C t))) 566 (setq done-C t)))
567 567
568 (if (and use-same-frame-for-AB ; implies wind A and B are suitable 568 (if (and use-same-frame-for-AB ; implies wind A and B are suitable
569 (window-live-p wind-A)) 569 (window-live-p wind-A))
570 (progn 570 (progn
@@ -572,16 +572,16 @@ into icons, regardless of the window manager."
572 (select-window wind-A) 572 (select-window wind-A)
573 (delete-other-windows) 573 (delete-other-windows)
574 (setq wind-A (selected-window)) 574 (setq wind-A (selected-window))
575 575
576 (funcall split-window-function) 576 (funcall split-window-function)
577 (if (eq (selected-window) wind-A) 577 (if (eq (selected-window) wind-A)
578 (other-window 1)) 578 (other-window 1))
579 (switch-to-buffer buf-B) 579 (switch-to-buffer buf-B)
580 (setq wind-B (selected-window)) 580 (setq wind-B (selected-window))
581 581
582 (setq done-A t 582 (setq done-A t
583 done-B t))) 583 done-B t)))
584 584
585 (if use-same-frame 585 (if use-same-frame
586 (let ((window-min-height 1)) 586 (let ((window-min-height 1))
587 (if (and (eq frame-A frame-B) 587 (if (and (eq frame-A frame-B)
@@ -595,27 +595,27 @@ into icons, regardless of the window manager."
595 (max 2 (round (* (window-height) merge-window-share)))) 595 (max 2 (round (* (window-height) merge-window-share))))
596 (switch-to-buffer buf-A) 596 (switch-to-buffer buf-A)
597 (setq wind-A (selected-window)) 597 (setq wind-A (selected-window))
598 598
599 (split-window-vertically 599 (split-window-vertically
600 (max 2 (- (window-height) merge-window-lines))) 600 (max 2 (- (window-height) merge-window-lines)))
601 (if (eq (selected-window) wind-A) 601 (if (eq (selected-window) wind-A)
602 (other-window 1)) 602 (other-window 1))
603 (setq wind-C (selected-window)) 603 (setq wind-C (selected-window))
604 (switch-to-buffer buf-C) 604 (switch-to-buffer buf-C)
605 605
606 (select-window wind-A) 606 (select-window wind-A)
607 607
608 (funcall split-window-function) 608 (funcall split-window-function)
609 (if (eq (selected-window) wind-A) 609 (if (eq (selected-window) wind-A)
610 (other-window 1)) 610 (other-window 1))
611 (switch-to-buffer buf-B) 611 (switch-to-buffer buf-B)
612 (setq wind-B (selected-window)) 612 (setq wind-B (selected-window))
613 613
614 (setq done-A t 614 (setq done-A t
615 done-B t 615 done-B t
616 done-C t) 616 done-C t)
617 )) 617 ))
618 618
619 (or done-A ; Buf A to be set in its own frame, 619 (or done-A ; Buf A to be set in its own frame,
620 ;;; or it was set before because use-same-frame = 1 620 ;;; or it was set before because use-same-frame = 1
621 (progn 621 (progn
@@ -636,7 +636,7 @@ into icons, regardless of the window manager."
636 (switch-to-buffer buf-B) 636 (switch-to-buffer buf-B)
637 (setq wind-B (selected-window)) 637 (setq wind-B (selected-window))
638 )) 638 ))
639 639
640 (or done-C ; Buf C to be set in its own frame, 640 (or done-C ; Buf C to be set in its own frame,
641 ;;; or it was set before because use-same-frame = 1 641 ;;; or it was set before because use-same-frame = 1
642 (progn 642 (progn
@@ -647,7 +647,7 @@ into icons, regardless of the window manager."
647 (switch-to-buffer buf-C) 647 (switch-to-buffer buf-C)
648 (setq wind-C (selected-window)) 648 (setq wind-C (selected-window))
649 )) 649 ))
650 650
651 (ediff-with-current-buffer control-buf 651 (ediff-with-current-buffer control-buf
652 (setq ediff-window-A wind-A 652 (setq ediff-window-A wind-A
653 ediff-window-B wind-B 653 ediff-window-B wind-B
@@ -655,11 +655,11 @@ into icons, regardless of the window manager."
655 (setq frame-A (window-frame ediff-window-A) 655 (setq frame-A (window-frame ediff-window-A)
656 designated-minibuffer-frame 656 designated-minibuffer-frame
657 (window-frame (minibuffer-window frame-A)))) 657 (window-frame (minibuffer-window frame-A))))
658 658
659 (ediff-setup-control-frame control-buf designated-minibuffer-frame) 659 (ediff-setup-control-frame control-buf designated-minibuffer-frame)
660 )) 660 ))
661 661
662 662
663;; Window setup for all comparison jobs, including 3way comparisons 663;; Window setup for all comparison jobs, including 3way comparisons
664(defun ediff-setup-windows-multiframe-compare (buf-A buf-B buf-C control-buf) 664(defun ediff-setup-windows-multiframe-compare (buf-A buf-B buf-C control-buf)
665;;; Algorithm: 665;;; Algorithm:
@@ -673,11 +673,11 @@ into icons, regardless of the window manager."
673;;; and the selected frame isn't splittable, we create a new frame and 673;;; and the selected frame isn't splittable, we create a new frame and
674;;; put both buffers there, event if one of this buffers is visible in 674;;; put both buffers there, event if one of this buffers is visible in
675;;; another frame. 675;;; another frame.
676 676
677 ;; Skip dedicated or iconified frames. 677 ;; Skip dedicated or iconified frames.
678 ;; Unsplittable frames are taken care of later. 678 ;; Unsplittable frames are taken care of later.
679 (ediff-skip-unsuitable-frames 'ok-unsplittable) 679 (ediff-skip-unsuitable-frames 'ok-unsplittable)
680 680
681 (let* ((window-min-height 1) 681 (let* ((window-min-height 1)
682 (wind-A (ediff-get-visible-buffer-window buf-A)) 682 (wind-A (ediff-get-visible-buffer-window buf-A))
683 (wind-B (ediff-get-visible-buffer-window buf-B)) 683 (wind-B (ediff-get-visible-buffer-window buf-B))
@@ -716,7 +716,7 @@ into icons, regardless of the window manager."
716 wind-A-start wind-B-start 716 wind-A-start wind-B-start
717 designated-minibuffer-frame 717 designated-minibuffer-frame
718 done-A done-B done-C) 718 done-A done-B done-C)
719 719
720 (ediff-with-current-buffer control-buf 720 (ediff-with-current-buffer control-buf
721 (setq wind-A-start (ediff-overlay-start 721 (setq wind-A-start (ediff-overlay-start
722 (ediff-get-value-according-to-buffer-type 722 (ediff-get-value-according-to-buffer-type
@@ -724,7 +724,7 @@ into icons, regardless of the window manager."
724 wind-B-start (ediff-overlay-start 724 wind-B-start (ediff-overlay-start
725 (ediff-get-value-according-to-buffer-type 725 (ediff-get-value-according-to-buffer-type
726 'B ediff-narrow-bounds)))) 726 'B ediff-narrow-bounds))))
727 727
728 (if (and (window-live-p wind-A) (null use-same-frame)) ; buf-A on its own 728 (if (and (window-live-p wind-A) (null use-same-frame)) ; buf-A on its own
729 (progn 729 (progn
730 ;; buffer buf-A is seen in live wind-A 730 ;; buffer buf-A is seen in live wind-A
@@ -732,7 +732,7 @@ into icons, regardless of the window manager."
732 (delete-other-windows) 732 (delete-other-windows)
733 (setq wind-A (selected-window)) 733 (setq wind-A (selected-window))
734 (setq done-A t))) 734 (setq done-A t)))
735 735
736 (if (and (window-live-p wind-B) (null use-same-frame)) ; buf B on its own 736 (if (and (window-live-p wind-B) (null use-same-frame)) ; buf B on its own
737 (progn 737 (progn
738 ;; buffer buf-B is seen in live wind-B 738 ;; buffer buf-B is seen in live wind-B
@@ -740,7 +740,7 @@ into icons, regardless of the window manager."
740 (delete-other-windows) 740 (delete-other-windows)
741 (setq wind-B (selected-window)) 741 (setq wind-B (selected-window))
742 (setq done-B t))) 742 (setq done-B t)))
743 743
744 (if (and (window-live-p wind-C) (null use-same-frame)) ; buf C on its own 744 (if (and (window-live-p wind-C) (null use-same-frame)) ; buf C on its own
745 (progn 745 (progn
746 ;; buffer buf-C is seen in live wind-C 746 ;; buffer buf-C is seen in live wind-C
@@ -748,7 +748,7 @@ into icons, regardless of the window manager."
748 (delete-other-windows) 748 (delete-other-windows)
749 (setq wind-C (selected-window)) 749 (setq wind-C (selected-window))
750 (setq done-C t))) 750 (setq done-C t)))
751 751
752 (if use-same-frame 752 (if use-same-frame
753 (let (wind-width-or-height) ; this affects 3way setups only 753 (let (wind-width-or-height) ; this affects 3way setups only
754 (if (and (eq frame-A frame-B) (frame-live-p frame-A)) 754 (if (and (eq frame-A frame-B) (frame-live-p frame-A))
@@ -758,7 +758,7 @@ into icons, regardless of the window manager."
758 (delete-other-windows) 758 (delete-other-windows)
759 (switch-to-buffer buf-A) 759 (switch-to-buffer buf-A)
760 (setq wind-A (selected-window)) 760 (setq wind-A (selected-window))
761 761
762 (if three-way-comparison 762 (if three-way-comparison
763 (setq wind-width-or-height 763 (setq wind-width-or-height
764 (/ 764 (/
@@ -766,13 +766,13 @@ into icons, regardless of the window manager."
766 (window-height wind-A) 766 (window-height wind-A)
767 (window-width wind-A)) 767 (window-width wind-A))
768 3))) 768 3)))
769 769
770 (funcall split-window-function wind-width-or-height) 770 (funcall split-window-function wind-width-or-height)
771 (if (eq (selected-window) wind-A) 771 (if (eq (selected-window) wind-A)
772 (other-window 1)) 772 (other-window 1))
773 (switch-to-buffer buf-B) 773 (switch-to-buffer buf-B)
774 (setq wind-B (selected-window)) 774 (setq wind-B (selected-window))
775 775
776 (if three-way-comparison 776 (if three-way-comparison
777 (progn 777 (progn
778 (funcall split-window-function) ; equally 778 (funcall split-window-function) ; equally
@@ -784,7 +784,7 @@ into icons, regardless of the window manager."
784 done-B t 784 done-B t
785 done-C t) 785 done-C t)
786 )) 786 ))
787 787
788 (or done-A ; Buf A to be set in its own frame 788 (or done-A ; Buf A to be set in its own frame
789 ;;; or it was set before because use-same-frame = 1 789 ;;; or it was set before because use-same-frame = 1
790 (progn 790 (progn
@@ -805,7 +805,7 @@ into icons, regardless of the window manager."
805 (switch-to-buffer buf-B) 805 (switch-to-buffer buf-B)
806 (setq wind-B (selected-window)) 806 (setq wind-B (selected-window))
807 )) 807 ))
808 808
809 (if three-way-comparison 809 (if three-way-comparison
810 (or done-C ; Buf C to be set in its own frame 810 (or done-C ; Buf C to be set in its own frame
811 ;;; or it was set before because use-same-frame = 1 811 ;;; or it was set before because use-same-frame = 1
@@ -817,7 +817,7 @@ into icons, regardless of the window manager."
817 (switch-to-buffer buf-C) 817 (switch-to-buffer buf-C)
818 (setq wind-C (selected-window)) 818 (setq wind-C (selected-window))
819 ))) 819 )))
820 820
821 (ediff-with-current-buffer control-buf 821 (ediff-with-current-buffer control-buf
822 (setq ediff-window-A wind-A 822 (setq ediff-window-A wind-A
823 ediff-window-B wind-B 823 ediff-window-B wind-B
@@ -826,14 +826,14 @@ into icons, regardless of the window manager."
826 (setq frame-A (window-frame ediff-window-A) 826 (setq frame-A (window-frame ediff-window-A)
827 designated-minibuffer-frame 827 designated-minibuffer-frame
828 (window-frame (minibuffer-window frame-A)))) 828 (window-frame (minibuffer-window frame-A))))
829 829
830 ;; It is unlikely that we'll implement a version of ediff-windows that 830 ;; It is unlikely that we'll implement a version of ediff-windows that
831 ;; would compare 3 windows at once. So, we don't use buffer C here. 831 ;; would compare 3 windows at once. So, we don't use buffer C here.
832 (if ediff-windows-job 832 (if ediff-windows-job
833 (progn 833 (progn
834 (set-window-start wind-A wind-A-start) 834 (set-window-start wind-A wind-A-start)
835 (set-window-start wind-B wind-B-start))) 835 (set-window-start wind-B wind-B-start)))
836 836
837 (ediff-setup-control-frame control-buf designated-minibuffer-frame) 837 (ediff-setup-control-frame control-buf designated-minibuffer-frame)
838 )) 838 ))
839 839
@@ -868,7 +868,7 @@ into icons, regardless of the window manager."
868 868
869(defun ediff-frame-has-dedicated-windows (frame) 869(defun ediff-frame-has-dedicated-windows (frame)
870 (let (ans) 870 (let (ans)
871 (walk-windows 871 (walk-windows
872 (lambda (wind) (if (window-dedicated-p wind) 872 (lambda (wind) (if (window-dedicated-p wind)
873 (setq ans t))) 873 (setq ans t)))
874 'ignore-minibuffer 874 'ignore-minibuffer
@@ -896,7 +896,7 @@ into icons, regardless of the window manager."
896 ctl-frame old-ctl-frame lines 896 ctl-frame old-ctl-frame lines
897 ;; user-grabbed-mouse 897 ;; user-grabbed-mouse
898 fheight fwidth adjusted-parameters) 898 fheight fwidth adjusted-parameters)
899 899
900 (ediff-with-current-buffer ctl-buffer 900 (ediff-with-current-buffer ctl-buffer
901 (ediff-cond-compile-for-xemacs-or-emacs 901 (ediff-cond-compile-for-xemacs-or-emacs
902 (set-buffer-menubar nil) ; xemacs 902 (set-buffer-menubar nil) ; xemacs
@@ -904,7 +904,7 @@ into icons, regardless of the window manager."
904 ) 904 )
905 ;;(setq user-grabbed-mouse (ediff-user-grabbed-mouse)) 905 ;;(setq user-grabbed-mouse (ediff-user-grabbed-mouse))
906 (run-hooks 'ediff-before-setup-control-frame-hook)) 906 (run-hooks 'ediff-before-setup-control-frame-hook))
907 907
908 (setq old-ctl-frame (ediff-with-current-buffer ctl-buffer ediff-control-frame)) 908 (setq old-ctl-frame (ediff-with-current-buffer ctl-buffer ediff-control-frame))
909 (ediff-with-current-buffer ctl-buffer 909 (ediff-with-current-buffer ctl-buffer
910 (setq ctl-frame (if (frame-live-p old-ctl-frame) 910 (setq ctl-frame (if (frame-live-p old-ctl-frame)
@@ -920,28 +920,28 @@ into icons, regardless of the window manager."
920 ) 920 )
921 (error)) 921 (error))
922 ) 922 )
923 923
924 (setq ctl-frame-iconified-p (ediff-frame-iconified-p ctl-frame)) 924 (setq ctl-frame-iconified-p (ediff-frame-iconified-p ctl-frame))
925 (select-frame ctl-frame) 925 (select-frame ctl-frame)
926 (if (window-dedicated-p (selected-window)) 926 (if (window-dedicated-p (selected-window))
927 () 927 ()
928 (delete-other-windows) 928 (delete-other-windows)
929 (switch-to-buffer ctl-buffer)) 929 (switch-to-buffer ctl-buffer))
930 930
931 ;; must be before ediff-setup-control-buffer 931 ;; must be before ediff-setup-control-buffer
932 ;; just a precaution--we should be in ctl-buffer already 932 ;; just a precaution--we should be in ctl-buffer already
933 (ediff-with-current-buffer ctl-buffer 933 (ediff-with-current-buffer ctl-buffer
934 (make-local-variable 'frame-title-format) 934 (make-local-variable 'frame-title-format)
935 (make-local-variable 'frame-icon-title-format) ; XEmacs 935 (make-local-variable 'frame-icon-title-format) ; XEmacs
936 (make-local-variable 'icon-title-format)) ; Emacs 936 (make-local-variable 'icon-title-format)) ; Emacs
937 937
938 (ediff-setup-control-buffer ctl-buffer) 938 (ediff-setup-control-buffer ctl-buffer)
939 (setq dont-iconify-ctl-frame 939 (setq dont-iconify-ctl-frame
940 (not (string= ediff-help-message ediff-brief-help-message))) 940 (not (string= ediff-help-message ediff-brief-help-message)))
941 (setq deiconify-ctl-frame 941 (setq deiconify-ctl-frame
942 (and (eq this-command 'ediff-toggle-help) 942 (and (eq this-command 'ediff-toggle-help)
943 dont-iconify-ctl-frame)) 943 dont-iconify-ctl-frame))
944 944
945 ;; 1 more line for the modeline 945 ;; 1 more line for the modeline
946 (setq lines (1+ (count-lines (point-min) (point-max))) 946 (setq lines (1+ (count-lines (point-min) (point-max)))
947 fheight lines 947 fheight lines
@@ -963,7 +963,7 @@ into icons, regardless of the window manager."
963 '(auto-raise . nil) 963 '(auto-raise . nil)
964 '(auto-raise . t)) 964 '(auto-raise . t))
965 adjusted-parameters)) 965 adjusted-parameters))
966 966
967 ;; In XEmacs, buffer menubar needs to be killed before frame parameters 967 ;; In XEmacs, buffer menubar needs to be killed before frame parameters
968 ;; are changed. 968 ;; are changed.
969 (if (ediff-has-toolbar-support-p) 969 (if (ediff-has-toolbar-support-p)
@@ -980,7 +980,7 @@ into icons, regardless of the window manager."
980 nil ; emacs 980 nil ; emacs
981 ) 981 )
982 ) 982 )
983 983
984 ;; Under OS/2 (emx) we have to call modify frame parameters twice, in order 984 ;; Under OS/2 (emx) we have to call modify frame parameters twice, in order
985 ;; to make sure that at least once we do it for non-iconified frame. If 985 ;; to make sure that at least once we do it for non-iconified frame. If
986 ;; appears that in the OS/2 port of Emacs, one can't modify frame 986 ;; appears that in the OS/2 port of Emacs, one can't modify frame
@@ -988,28 +988,28 @@ into icons, regardless of the window manager."
988 ;; windows-nt. 988 ;; windows-nt.
989 (if (memq system-type '(emx windows-nt windows-95)) 989 (if (memq system-type '(emx windows-nt windows-95))
990 (modify-frame-parameters ctl-frame adjusted-parameters)) 990 (modify-frame-parameters ctl-frame adjusted-parameters))
991 991
992 ;; make or zap toolbar (if not requested) 992 ;; make or zap toolbar (if not requested)
993 (ediff-make-bottom-toolbar ctl-frame) 993 (ediff-make-bottom-toolbar ctl-frame)
994 994
995 (goto-char (point-min)) 995 (goto-char (point-min))
996 996
997 (modify-frame-parameters ctl-frame adjusted-parameters) 997 (modify-frame-parameters ctl-frame adjusted-parameters)
998 (make-frame-visible ctl-frame) 998 (make-frame-visible ctl-frame)
999 999
1000 ;; This works around a bug in 19.25 and earlier. There, if frame gets 1000 ;; This works around a bug in 19.25 and earlier. There, if frame gets
1001 ;; iconified, the current buffer changes to that of the frame that 1001 ;; iconified, the current buffer changes to that of the frame that
1002 ;; becomes exposed as a result of this iconification. 1002 ;; becomes exposed as a result of this iconification.
1003 ;; So, we make sure the current buffer doesn't change. 1003 ;; So, we make sure the current buffer doesn't change.
1004 (select-frame ctl-frame) 1004 (select-frame ctl-frame)
1005 (ediff-refresh-control-frame) 1005 (ediff-refresh-control-frame)
1006 1006
1007 (cond ((and ediff-prefer-iconified-control-frame 1007 (cond ((and ediff-prefer-iconified-control-frame
1008 (not ctl-frame-iconified-p) (not dont-iconify-ctl-frame)) 1008 (not ctl-frame-iconified-p) (not dont-iconify-ctl-frame))
1009 (iconify-frame ctl-frame)) 1009 (iconify-frame ctl-frame))
1010 ((or deiconify-ctl-frame (not ctl-frame-iconified-p)) 1010 ((or deiconify-ctl-frame (not ctl-frame-iconified-p))
1011 (raise-frame ctl-frame))) 1011 (raise-frame ctl-frame)))
1012 1012
1013 (set-window-dedicated-p (selected-window) t) 1013 (set-window-dedicated-p (selected-window) t)
1014 1014
1015 ;; Now move the frame. We must do it separately due to an obscure bug in 1015 ;; Now move the frame. We must do it separately due to an obscure bug in
@@ -1017,7 +1017,7 @@ into icons, regardless of the window manager."
1017 (modify-frame-parameters 1017 (modify-frame-parameters
1018 ctl-frame 1018 ctl-frame
1019 (funcall ediff-control-frame-position-function ctl-buffer fwidth fheight)) 1019 (funcall ediff-control-frame-position-function ctl-buffer fwidth fheight))
1020 1020
1021 ;; synchronize so the cursor will move to control frame 1021 ;; synchronize so the cursor will move to control frame
1022 ;; per RMS suggestion 1022 ;; per RMS suggestion
1023 (if (ediff-window-display-p) 1023 (if (ediff-window-display-p)
@@ -1032,7 +1032,7 @@ into icons, regardless of the window manager."
1032 (ediff-reset-mouse ctl-frame 1032 (ediff-reset-mouse ctl-frame
1033 (or (eq this-command 'ediff-quit) 1033 (or (eq this-command 'ediff-quit)
1034 (not (eq ediff-grab-mouse t))))) 1034 (not (eq ediff-grab-mouse t)))))
1035 1035
1036 (if ediff-xemacs-p 1036 (if ediff-xemacs-p
1037 (ediff-with-current-buffer ctl-buffer 1037 (ediff-with-current-buffer ctl-buffer
1038 (ediff-cond-compile-for-xemacs-or-emacs 1038 (ediff-cond-compile-for-xemacs-or-emacs
@@ -1042,12 +1042,12 @@ into icons, regardless of the window manager."
1042 (add-hook 1042 (add-hook
1043 'select-frame-hook 'ediff-xemacs-select-frame-hook nil 'local) 1043 'select-frame-hook 'ediff-xemacs-select-frame-hook nil 'local)
1044 )) 1044 ))
1045 1045
1046 (ediff-with-current-buffer ctl-buffer 1046 (ediff-with-current-buffer ctl-buffer
1047 (run-hooks 'ediff-after-setup-control-frame-hook)) 1047 (run-hooks 'ediff-after-setup-control-frame-hook))
1048 )) 1048 ))
1049 1049
1050 1050
1051(defun ediff-destroy-control-frame (ctl-buffer) 1051(defun ediff-destroy-control-frame (ctl-buffer)
1052 (ediff-with-current-buffer ctl-buffer 1052 (ediff-with-current-buffer ctl-buffer
1053 (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame)) 1053 (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
@@ -1062,7 +1062,7 @@ into icons, regardless of the window manager."
1062 (ediff-skip-unsuitable-frames) 1062 (ediff-skip-unsuitable-frames)
1063 ;;(ediff-reset-mouse nil) 1063 ;;(ediff-reset-mouse nil)
1064 ) 1064 )
1065 1065
1066 1066
1067;; finds a good place to clip control frame 1067;; finds a good place to clip control frame
1068(defun ediff-make-frame-position (ctl-buffer ctl-frame-width ctl-frame-height) 1068(defun ediff-make-frame-position (ctl-buffer ctl-frame-width ctl-frame-height)
@@ -1075,7 +1075,7 @@ into icons, regardless of the window manager."
1075 (ctl-frame ediff-control-frame) 1075 (ctl-frame ediff-control-frame)
1076 horizontal-adjustment upward-adjustment 1076 horizontal-adjustment upward-adjustment
1077 ctl-frame-top ctl-frame-left) 1077 ctl-frame-top ctl-frame-left)
1078 1078
1079 ;; Multiple control frames are clipped based on the value of 1079 ;; Multiple control frames are clipped based on the value of
1080 ;; ediff-control-buffer-number. This is done in order not to obscure 1080 ;; ediff-control-buffer-number. This is done in order not to obscure
1081 ;; other active control panels. 1081 ;; other active control panels.
@@ -1107,16 +1107,16 @@ into icons, regardless of the window manager."
1107 ;; keep ctl frame within the visible bounds 1107 ;; keep ctl frame within the visible bounds
1108 (setq ctl-frame-top (max ctl-frame-top 1) 1108 (setq ctl-frame-top (max ctl-frame-top 1)
1109 ctl-frame-left (max ctl-frame-left 1)) 1109 ctl-frame-left (max ctl-frame-left 1))
1110 1110
1111 (list (cons 'top ctl-frame-top) 1111 (list (cons 'top ctl-frame-top)
1112 (cons 'left ctl-frame-left)) 1112 (cons 'left ctl-frame-left))
1113 ))) 1113 )))
1114 1114
1115(defun ediff-xemacs-select-frame-hook () 1115(defun ediff-xemacs-select-frame-hook ()
1116 (if (and (equal (selected-frame) ediff-control-frame) 1116 (if (and (equal (selected-frame) ediff-control-frame)
1117 (not ediff-use-long-help-message)) 1117 (not ediff-use-long-help-message))
1118 (raise-frame ediff-control-frame))) 1118 (raise-frame ediff-control-frame)))
1119 1119
1120(defun ediff-make-wide-display () 1120(defun ediff-make-wide-display ()
1121 "Construct an alist of parameters for the wide display. 1121 "Construct an alist of parameters for the wide display.
1122Saves the old frame parameters in `ediff-wide-display-orig-parameters'. 1122Saves the old frame parameters in `ediff-wide-display-orig-parameters'.
@@ -1135,15 +1135,15 @@ It assumes that it is called from within the control buffer."
1135 ediff-wide-display-frame frame-A) 1135 ediff-wide-display-frame frame-A)
1136 (modify-frame-parameters frame-A (list (cons 'left cw) 1136 (modify-frame-parameters frame-A (list (cons 'left cw)
1137 (cons 'width wd))))) 1137 (cons 'width wd)))))
1138 1138
1139 1139
1140 1140
1141;; Revise the mode line to display which difference we have selected 1141;; Revise the mode line to display which difference we have selected
1142;; Also resets modelines of buffers A/B, since they may be clobbered by 1142;; Also resets modelines of buffers A/B, since they may be clobbered by
1143;; anothe invocations of Ediff. 1143;; anothe invocations of Ediff.
1144(defun ediff-refresh-mode-lines () 1144(defun ediff-refresh-mode-lines ()
1145 (let (buf-A-state-diff buf-B-state-diff buf-C-state-diff buf-C-state-merge) 1145 (let (buf-A-state-diff buf-B-state-diff buf-C-state-diff buf-C-state-merge)
1146 1146
1147 (if (ediff-valid-difference-p) 1147 (if (ediff-valid-difference-p)
1148 (setq 1148 (setq
1149 buf-C-state-diff (ediff-get-state-of-diff ediff-current-difference 'C) 1149 buf-C-state-diff (ediff-get-state-of-diff ediff-current-difference 'C)
@@ -1172,7 +1172,7 @@ It assumes that it is called from within the control buffer."
1172 (setq buf-A-state-diff "" 1172 (setq buf-A-state-diff ""
1173 buf-B-state-diff "" 1173 buf-B-state-diff ""
1174 buf-C-state-diff "")) 1174 buf-C-state-diff ""))
1175 1175
1176 ;; control buffer format 1176 ;; control buffer format
1177 (setq mode-line-format 1177 (setq mode-line-format
1178 (if (ediff-narrow-control-frame-p) 1178 (if (ediff-narrow-control-frame-p)
@@ -1185,10 +1185,10 @@ It assumes that it is called from within the control buffer."
1185 (ediff-make-wide-control-buffer-id))) 1185 (ediff-make-wide-control-buffer-id)))
1186 ;; Force mode-line redisplay 1186 ;; Force mode-line redisplay
1187 (force-mode-line-update) 1187 (force-mode-line-update)
1188 1188
1189 (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame)) 1189 (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
1190 (ediff-refresh-control-frame)) 1190 (ediff-refresh-control-frame))
1191 1191
1192 (ediff-with-current-buffer ediff-buffer-A 1192 (ediff-with-current-buffer ediff-buffer-A
1193 (setq ediff-diff-status buf-A-state-diff) 1193 (setq ediff-diff-status buf-A-state-diff)
1194 (ediff-strip-mode-line-format) 1194 (ediff-strip-mode-line-format)
@@ -1225,8 +1225,8 @@ It assumes that it is called from within the control buffer."
1225 (t "")) 1225 (t ""))
1226 mode-line-format)))) 1226 mode-line-format))))
1227 )) 1227 ))
1228 1228
1229 1229
1230(defun ediff-refresh-control-frame () 1230(defun ediff-refresh-control-frame ()
1231 (if ediff-emacs-p 1231 (if ediff-emacs-p
1232 ;; set frame/icon titles for Emacs 1232 ;; set frame/icon titles for Emacs
@@ -1240,8 +1240,8 @@ It assumes that it is called from within the control buffer."
1240 frame-icon-title-format (ediff-make-narrow-control-buffer-id)) 1240 frame-icon-title-format (ediff-make-narrow-control-buffer-id))
1241 ;; force an update of the frame title 1241 ;; force an update of the frame title
1242 (modify-frame-parameters ediff-control-frame '(())))) 1242 (modify-frame-parameters ediff-control-frame '(()))))
1243 1243
1244 1244
1245(defun ediff-make-narrow-control-buffer-id (&optional skip-name) 1245(defun ediff-make-narrow-control-buffer-id (&optional skip-name)
1246 (concat 1246 (concat
1247 (if skip-name 1247 (if skip-name
@@ -1260,7 +1260,7 @@ It assumes that it is called from within the control buffer."
1260 (concat 1260 (concat
1261 (cdr (assoc 'name ediff-control-frame-parameters)) 1261 (cdr (assoc 'name ediff-control-frame-parameters))
1262 ediff-control-buffer-suffix)) 1262 ediff-control-buffer-suffix))
1263 1263
1264(defun ediff-make-wide-control-buffer-id () 1264(defun ediff-make-wide-control-buffer-id ()
1265 (cond ((< ediff-current-difference 0) 1265 (cond ((< ediff-current-difference 0)
1266 (list (format "%%b At start of %d diffs" 1266 (list (format "%%b At start of %d diffs"
@@ -1281,10 +1281,10 @@ It assumes that it is called from within the control buffer."
1281 (if ediff-xemacs-p 1281 (if ediff-xemacs-p
1282 (get-buffer-window buff t) 1282 (get-buffer-window buff t)
1283 (get-buffer-window buff 'visible)))) 1283 (get-buffer-window buff 'visible))))
1284 1284
1285 1285
1286;;; Functions to decide when to redraw windows 1286;;; Functions to decide when to redraw windows
1287 1287
1288(defun ediff-keep-window-config (control-buf) 1288(defun ediff-keep-window-config (control-buf)
1289 (and (eq control-buf (current-buffer)) 1289 (and (eq control-buf (current-buffer))
1290 (/= (buffer-size) 0) 1290 (/= (buffer-size) 0)
@@ -1293,7 +1293,7 @@ It assumes that it is called from within the control buffer."
1293 (A-wind ediff-window-A) 1293 (A-wind ediff-window-A)
1294 (B-wind ediff-window-B) 1294 (B-wind ediff-window-B)
1295 (C-wind ediff-window-C)) 1295 (C-wind ediff-window-C))
1296 1296
1297 (and 1297 (and
1298 (ediff-window-visible-p A-wind) 1298 (ediff-window-visible-p A-wind)
1299 (ediff-window-visible-p B-wind) 1299 (ediff-window-visible-p B-wind)
diff --git a/lisp/ediff.el b/lisp/ediff.el
index 351809482aa..2525a07658e 100644
--- a/lisp/ediff.el
+++ b/lisp/ediff.el
@@ -7,7 +7,7 @@
7;; Keywords: comparing, merging, patching, tools, unix 7;; Keywords: comparing, merging, patching, tools, unix
8 8
9(defconst ediff-version "2.78" "The current version of Ediff") 9(defconst ediff-version "2.78" "The current version of Ediff")
10(defconst ediff-date "January 25, 2003" "Date of last update") 10(defconst ediff-date "January 25, 2003" "Date of last update")
11 11
12 12
13;; This file is part of GNU Emacs. 13;; This file is part of GNU Emacs.
@@ -200,13 +200,13 @@
200 dir-B f) 200 dir-B f)
201 (list (setq f (ediff-read-file-name 201 (list (setq f (ediff-read-file-name
202 "File A to compare" 202 "File A to compare"
203 dir-A 203 dir-A
204 (ediff-get-default-file-name) 204 (ediff-get-default-file-name)
205 'no-dirs)) 205 'no-dirs))
206 (ediff-read-file-name "File B to compare" 206 (ediff-read-file-name "File B to compare"
207 (setq dir-B 207 (setq dir-B
208 (if ediff-use-last-dir 208 (if ediff-use-last-dir
209 ediff-last-dir-B 209 ediff-last-dir-B
210 (file-name-directory f))) 210 (file-name-directory f)))
211 (progn 211 (progn
212 (setq file-name-history 212 (setq file-name-history
@@ -217,7 +217,7 @@
217 file-name-history)) 217 file-name-history))
218 (ediff-get-default-file-name f 1))) 218 (ediff-get-default-file-name f 1)))
219 ))) 219 )))
220 (ediff-files-internal file-A 220 (ediff-files-internal file-A
221 (if (file-directory-p file-B) 221 (if (file-directory-p file-B)
222 (expand-file-name 222 (expand-file-name
223 (file-name-nondirectory file-A) file-B) 223 (file-name-nondirectory file-A) file-B)
@@ -225,7 +225,7 @@
225 nil ; file-C 225 nil ; file-C
226 startup-hooks 226 startup-hooks
227 'ediff-files)) 227 'ediff-files))
228 228
229;;;###autoload 229;;;###autoload
230(defun ediff-files3 (file-A file-B file-C &optional startup-hooks) 230(defun ediff-files3 (file-A file-B file-C &optional startup-hooks)
231 "Run Ediff on three files, FILE-A, FILE-B, and FILE-C." 231 "Run Ediff on three files, FILE-A, FILE-B, and FILE-C."
@@ -239,7 +239,7 @@
239 dir-A 239 dir-A
240 (ediff-get-default-file-name) 240 (ediff-get-default-file-name)
241 'no-dirs)) 241 'no-dirs))
242 (setq ff (ediff-read-file-name "File B to compare" 242 (setq ff (ediff-read-file-name "File B to compare"
243 (setq dir-B 243 (setq dir-B
244 (if ediff-use-last-dir 244 (if ediff-use-last-dir
245 ediff-last-dir-B 245 ediff-last-dir-B
@@ -253,7 +253,7 @@
253 dir-B)) 253 dir-B))
254 file-name-history)) 254 file-name-history))
255 (ediff-get-default-file-name f 1)))) 255 (ediff-get-default-file-name f 1))))
256 (ediff-read-file-name "File C to compare" 256 (ediff-read-file-name "File C to compare"
257 (setq dir-C (if ediff-use-last-dir 257 (setq dir-C (if ediff-use-last-dir
258 ediff-last-dir-C 258 ediff-last-dir-C
259 (file-name-directory ff))) 259 (file-name-directory ff)))
@@ -266,7 +266,7 @@
266 file-name-history)) 266 file-name-history))
267 (ediff-get-default-file-name ff 2))) 267 (ediff-get-default-file-name ff 2)))
268 ))) 268 )))
269 (ediff-files-internal file-A 269 (ediff-files-internal file-A
270 (if (file-directory-p file-B) 270 (if (file-directory-p file-B)
271 (expand-file-name 271 (expand-file-name
272 (file-name-nondirectory file-A) file-B) 272 (file-name-nondirectory file-A) file-B)
@@ -282,7 +282,7 @@
282(defalias 'ediff3 'ediff-files3) 282(defalias 'ediff3 'ediff-files3)
283 283
284 284
285;; Visit FILE and arrange its buffer to Ediff's liking. 285;; Visit FILE and arrange its buffer to Ediff's liking.
286;; FILE is actually a variable symbol that must contain a true file name. 286;; FILE is actually a variable symbol that must contain a true file name.
287;; BUFFER-NAME is a variable symbol, which will get the buffer object into 287;; BUFFER-NAME is a variable symbol, which will get the buffer object into
288;; which FILE is read. 288;; which FILE is read.
@@ -299,17 +299,17 @@
299 (error "File `%s' does not exist or is not readable" file)) 299 (error "File `%s' does not exist or is not readable" file))
300 ((file-directory-p file) 300 ((file-directory-p file)
301 (error "File `%s' is a directory" file))) 301 (error "File `%s' is a directory" file)))
302 302
303 ;; some of the commands, below, require full file name 303 ;; some of the commands, below, require full file name
304 (setq file (expand-file-name file)) 304 (setq file (expand-file-name file))
305 305
306 ;; Record the directory of the file 306 ;; Record the directory of the file
307 (if last-dir 307 (if last-dir
308 (set last-dir (expand-file-name (file-name-directory file)))) 308 (set last-dir (expand-file-name (file-name-directory file))))
309 309
310 ;; Setup the buffer 310 ;; Setup the buffer
311 (set buffer-name (find-file-noselect file)) 311 (set buffer-name (find-file-noselect file))
312 312
313 (ediff-with-current-buffer (symbol-value buffer-name) 313 (ediff-with-current-buffer (symbol-value buffer-name)
314 (widen) ; Make sure the entire file is seen 314 (widen) ; Make sure the entire file is seen
315 (cond (file-magic ; file has a handler, such as jka-compr-handler or 315 (cond (file-magic ; file has a handler, such as jka-compr-handler or
@@ -362,7 +362,7 @@
362 startup-hooks 362 startup-hooks
363 (list (cons 'ediff-job-name job-name)) 363 (list (cons 'ediff-job-name job-name))
364 merge-buffer-file))) 364 merge-buffer-file)))
365 365
366 366
367;;;###autoload 367;;;###autoload
368(defalias 'ediff 'ediff-files) 368(defalias 'ediff 'ediff-files)
@@ -387,7 +387,7 @@ If this file is a backup, `ediff' it with its original."
387;;;###autoload 387;;;###autoload
388(defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name) 388(defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name)
389 "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B." 389 "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B."
390 (interactive 390 (interactive
391 (let (bf) 391 (let (bf)
392 (list (setq bf (read-buffer "Buffer A to compare: " 392 (list (setq bf (read-buffer "Buffer A to compare: "
393 (ediff-other-buffer "") t)) 393 (ediff-other-buffer "") t))
@@ -404,12 +404,12 @@ If this file is a backup, `ediff' it with its original."
404;;;###autoload 404;;;###autoload
405(defalias 'ebuffers 'ediff-buffers) 405(defalias 'ebuffers 'ediff-buffers)
406 406
407 407
408;;;###autoload 408;;;###autoload
409(defun ediff-buffers3 (buffer-A buffer-B buffer-C 409(defun ediff-buffers3 (buffer-A buffer-B buffer-C
410 &optional startup-hooks job-name) 410 &optional startup-hooks job-name)
411 "Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C." 411 "Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C."
412 (interactive 412 (interactive
413 (let (bf bff) 413 (let (bf bff)
414 (list (setq bf (read-buffer "Buffer A to compare: " 414 (list (setq bf (read-buffer "Buffer A to compare: "
415 (ediff-other-buffer "") t)) 415 (ediff-other-buffer "") t))
@@ -433,9 +433,9 @@ If this file is a backup, `ediff' it with its original."
433 433
434;;;###autoload 434;;;###autoload
435(defalias 'ebuffers3 'ediff-buffers3) 435(defalias 'ebuffers3 'ediff-buffers3)
436
437 436
438 437
438
439;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer 439;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer
440(defun ediff-buffers-internal (buf-A buf-B buf-C startup-hooks job-name 440(defun ediff-buffers-internal (buf-A buf-B buf-C startup-hooks job-name
441 &optional merge-buffer-file) 441 &optional merge-buffer-file)
@@ -459,12 +459,12 @@ If this file is a backup, `ediff' it with its original."
459 (setq buf-B-file-name (file-name-nondirectory buf-B-file-name))) 459 (setq buf-B-file-name (file-name-nondirectory buf-B-file-name)))
460 (if (stringp buf-C-file-name) 460 (if (stringp buf-C-file-name)
461 (setq buf-C-file-name (file-name-nondirectory buf-C-file-name))) 461 (setq buf-C-file-name (file-name-nondirectory buf-C-file-name)))
462 462
463 (setq file-A (ediff-make-temp-file buf-A buf-A-file-name) 463 (setq file-A (ediff-make-temp-file buf-A buf-A-file-name)
464 file-B (ediff-make-temp-file buf-B buf-B-file-name)) 464 file-B (ediff-make-temp-file buf-B buf-B-file-name))
465 (if buf-C-is-alive 465 (if buf-C-is-alive
466 (setq file-C (ediff-make-temp-file buf-C buf-C-file-name))) 466 (setq file-C (ediff-make-temp-file buf-C buf-C-file-name)))
467 467
468 (ediff-setup (get-buffer buf-A) file-A 468 (ediff-setup (get-buffer buf-A) file-A
469 (get-buffer buf-B) file-B 469 (get-buffer buf-B) file-B
470 (if buf-C-is-alive (get-buffer buf-C)) 470 (if buf-C-is-alive (get-buffer buf-C))
@@ -503,9 +503,9 @@ expression; only file names that match the regexp are considered."
503 (let ((dir-A (ediff-get-default-directory-name)) 503 (let ((dir-A (ediff-get-default-directory-name))
504 f) 504 f)
505 (list (setq f (ediff-read-file-name "Directory A to compare:" dir-A nil)) 505 (list (setq f (ediff-read-file-name "Directory A to compare:" dir-A nil))
506 (ediff-read-file-name "Directory B to compare:" 506 (ediff-read-file-name "Directory B to compare:"
507 (if ediff-use-last-dir 507 (if ediff-use-last-dir
508 ediff-last-dir-B 508 ediff-last-dir-B
509 (ediff-strip-last-dir f)) 509 (ediff-strip-last-dir f))
510 nil) 510 nil)
511 (read-string "Filter through regular expression: " 511 (read-string "Filter through regular expression: "
@@ -549,14 +549,14 @@ regular expression; only file names that match the regexp are considered."
549 (let ((dir-A (ediff-get-default-directory-name)) 549 (let ((dir-A (ediff-get-default-directory-name))
550 f) 550 f)
551 (list (setq f (ediff-read-file-name "Directory A to compare:" dir-A nil)) 551 (list (setq f (ediff-read-file-name "Directory A to compare:" dir-A nil))
552 (setq f (ediff-read-file-name "Directory B to compare:" 552 (setq f (ediff-read-file-name "Directory B to compare:"
553 (if ediff-use-last-dir 553 (if ediff-use-last-dir
554 ediff-last-dir-B 554 ediff-last-dir-B
555 (ediff-strip-last-dir f)) 555 (ediff-strip-last-dir f))
556 nil)) 556 nil))
557 (ediff-read-file-name "Directory C to compare:" 557 (ediff-read-file-name "Directory C to compare:"
558 (if ediff-use-last-dir 558 (if ediff-use-last-dir
559 ediff-last-dir-C 559 ediff-last-dir-C
560 (ediff-strip-last-dir f)) 560 (ediff-strip-last-dir f))
561 nil) 561 nil)
562 (read-string "Filter through regular expression: " 562 (read-string "Filter through regular expression: "
@@ -578,9 +578,9 @@ expression; only file names that match the regexp are considered."
578 (let ((dir-A (ediff-get-default-directory-name)) 578 (let ((dir-A (ediff-get-default-directory-name))
579 f) 579 f)
580 (list (setq f (ediff-read-file-name "Directory A to merge:" dir-A nil)) 580 (list (setq f (ediff-read-file-name "Directory A to merge:" dir-A nil))
581 (ediff-read-file-name "Directory B to merge:" 581 (ediff-read-file-name "Directory B to merge:"
582 (if ediff-use-last-dir 582 (if ediff-use-last-dir
583 ediff-last-dir-B 583 ediff-last-dir-B
584 (ediff-strip-last-dir f)) 584 (ediff-strip-last-dir f))
585 nil) 585 nil)
586 (read-string "Filter through regular expression: " 586 (read-string "Filter through regular expression: "
@@ -607,14 +607,14 @@ only file names that match the regexp are considered."
607 (let ((dir-A (ediff-get-default-directory-name)) 607 (let ((dir-A (ediff-get-default-directory-name))
608 f) 608 f)
609 (list (setq f (ediff-read-file-name "Directory A to merge:" dir-A nil)) 609 (list (setq f (ediff-read-file-name "Directory A to merge:" dir-A nil))
610 (setq f (ediff-read-file-name "Directory B to merge:" 610 (setq f (ediff-read-file-name "Directory B to merge:"
611 (if ediff-use-last-dir 611 (if ediff-use-last-dir
612 ediff-last-dir-B 612 ediff-last-dir-B
613 (ediff-strip-last-dir f)) 613 (ediff-strip-last-dir f))
614 nil)) 614 nil))
615 (ediff-read-file-name "Ancestor directory:" 615 (ediff-read-file-name "Ancestor directory:"
616 (if ediff-use-last-dir 616 (if ediff-use-last-dir
617 ediff-last-dir-C 617 ediff-last-dir-C
618 (ediff-strip-last-dir f)) 618 (ediff-strip-last-dir f))
619 nil) 619 nil)
620 (read-string "Filter through regular expression: " 620 (read-string "Filter through regular expression: "
@@ -670,7 +670,7 @@ names. Only the files that are under revision control are taken into account."
670;;;###autoload 670;;;###autoload
671(defalias 671(defalias
672 'edir-merge-revisions-with-ancestor 672 'edir-merge-revisions-with-ancestor
673 'ediff-merge-directory-revisions-with-ancestor) 673 'ediff-merge-directory-revisions-with-ancestor)
674 674
675;;;###autoload 675;;;###autoload
676(defalias 'edirs-merge-with-ancestor 'ediff-merge-directories-with-ancestor) 676(defalias 'edirs-merge-with-ancestor 'ediff-merge-directories-with-ancestor)
@@ -681,7 +681,7 @@ names. Only the files that are under revision control are taken into account."
681;; only file names that match the regexp are considered. 681;; only file names that match the regexp are considered.
682;; JOBNAME is the symbol indicating the meta-job to be performed. 682;; JOBNAME is the symbol indicating the meta-job to be performed.
683;; MERGE-AUTOSTORE-DIR is the directory in which to store merged files. 683;; MERGE-AUTOSTORE-DIR is the directory in which to store merged files.
684(defun ediff-directories-internal (dir1 dir2 dir3 regexp action jobname 684(defun ediff-directories-internal (dir1 dir2 dir3 regexp action jobname
685 &optional startup-hooks 685 &optional startup-hooks
686 merge-autostore-dir) 686 merge-autostore-dir)
687 ;; ediff-read-file-name is set to attach a previously entered file name if 687 ;; ediff-read-file-name is set to attach a previously entered file name if
@@ -705,7 +705,7 @@ names. Only the files that are under revision control are taken into account."
705 (or (stringp merge-autostore-dir) 705 (or (stringp merge-autostore-dir)
706 (error "%s: Directory for storing merged files must be a string" 706 (error "%s: Directory for storing merged files must be a string"
707 jobname))) 707 jobname)))
708 (let (;; dir-diff-struct is of the form (common-list diff-list) 708 (let (;; dir-diff-struct is of the form (common-list diff-list)
709 ;; It is a structure where ediff-intersect-directories returns 709 ;; It is a structure where ediff-intersect-directories returns
710 ;; commonalities and differences among directories 710 ;; commonalities and differences among directories
711 dir-diff-struct 711 dir-diff-struct
@@ -713,7 +713,7 @@ names. Only the files that are under revision control are taken into account."
713 (if (and ediff-autostore-merges 713 (if (and ediff-autostore-merges
714 (ediff-merge-metajob jobname) 714 (ediff-merge-metajob jobname)
715 (not merge-autostore-dir)) 715 (not merge-autostore-dir))
716 (setq merge-autostore-dir 716 (setq merge-autostore-dir
717 (read-file-name "Save merged files in directory: " 717 (read-file-name "Save merged files in directory: "
718 (if ediff-use-last-dir 718 (if ediff-use-last-dir
719 ediff-last-merge-autostore-dir 719 ediff-last-merge-autostore-dir
@@ -734,8 +734,8 @@ names. Only the files that are under revision control are taken into account."
734 (or (y-or-n-p 734 (or (y-or-n-p
735 "Directory for saving merged files = Ancestor Directory. Sure? ") 735 "Directory for saving merged files = Ancestor Directory. Sure? ")
736 (error "Directory merge aborted"))))) 736 (error "Directory merge aborted")))))
737 737
738 (setq dir-diff-struct (ediff-intersect-directories 738 (setq dir-diff-struct (ediff-intersect-directories
739 jobname 739 jobname
740 regexp dir1 dir2 dir3 merge-autostore-dir)) 740 regexp dir1 dir2 dir3 merge-autostore-dir))
741 (setq startup-hooks 741 (setq startup-hooks
@@ -744,11 +744,11 @@ names. Only the files that are under revision control are taken into account."
744 (cons `(lambda () 744 (cons `(lambda ()
745 ;; tell what to do if the user clicks on a session record 745 ;; tell what to do if the user clicks on a session record
746 (setq ediff-session-action-function (quote ,action)) 746 (setq ediff-session-action-function (quote ,action))
747 ;; set ediff-dir-difference-list 747 ;; set ediff-dir-difference-list
748 (setq ediff-dir-difference-list 748 (setq ediff-dir-difference-list
749 (cdr (quote ,dir-diff-struct)))) 749 (cdr (quote ,dir-diff-struct))))
750 startup-hooks)) 750 startup-hooks))
751 (setq meta-buf (ediff-prepare-meta-buffer 751 (setq meta-buf (ediff-prepare-meta-buffer
752 'ediff-filegroup-action 752 'ediff-filegroup-action
753 (car dir-diff-struct) 753 (car dir-diff-struct)
754 "*Ediff Session Group Panel" 754 "*Ediff Session Group Panel"
@@ -760,7 +760,7 @@ names. Only the files that are under revision control are taken into account."
760 760
761;; MERGE-AUTOSTORE-DIR can be given to tell ediff where to store the merged 761;; MERGE-AUTOSTORE-DIR can be given to tell ediff where to store the merged
762;; files 762;; files
763(defun ediff-directory-revisions-internal (dir1 regexp action jobname 763(defun ediff-directory-revisions-internal (dir1 regexp action jobname
764 &optional startup-hooks 764 &optional startup-hooks
765 merge-autostore-dir) 765 merge-autostore-dir)
766 (setq dir1 (if (file-directory-p dir1) dir1 (file-name-directory dir1))) 766 (setq dir1 (if (file-directory-p dir1) dir1 (file-name-directory dir1)))
@@ -770,10 +770,10 @@ names. Only the files that are under revision control are taken into account."
770 (error "%S: Directory for storing merged files must be a string" 770 (error "%S: Directory for storing merged files must be a string"
771 jobname))) 771 jobname)))
772 (let (file-list meta-buf) 772 (let (file-list meta-buf)
773 (if (and ediff-autostore-merges 773 (if (and ediff-autostore-merges
774 (ediff-merge-metajob jobname) 774 (ediff-merge-metajob jobname)
775 (not merge-autostore-dir)) 775 (not merge-autostore-dir))
776 (setq merge-autostore-dir 776 (setq merge-autostore-dir
777 (read-file-name "Save merged files in directory: " 777 (read-file-name "Save merged files in directory: "
778 (if ediff-use-last-dir 778 (if ediff-use-last-dir
779 ediff-last-merge-autostore-dir 779 ediff-last-merge-autostore-dir
@@ -787,7 +787,7 @@ names. Only the files that are under revision control are taken into account."
787 (or (y-or-n-p 787 (or (y-or-n-p
788 "Directory for saving merged file = directory A. Sure? ") 788 "Directory for saving merged file = directory A. Sure? ")
789 (error "Merge of directory revisions aborted"))) 789 (error "Merge of directory revisions aborted")))
790 790
791 (setq file-list 791 (setq file-list
792 (ediff-get-directory-files-under-revision 792 (ediff-get-directory-files-under-revision
793 jobname regexp dir1 merge-autostore-dir)) 793 jobname regexp dir1 merge-autostore-dir))
@@ -798,7 +798,7 @@ names. Only the files that are under revision control are taken into account."
798 ;; tell what to do if the user clicks on a session record 798 ;; tell what to do if the user clicks on a session record
799 (setq ediff-session-action-function (quote ,action))) 799 (setq ediff-session-action-function (quote ,action)))
800 startup-hooks)) 800 startup-hooks))
801 (setq meta-buf (ediff-prepare-meta-buffer 801 (setq meta-buf (ediff-prepare-meta-buffer
802 'ediff-filegroup-action 802 'ediff-filegroup-action
803 file-list 803 file-list
804 "*Ediff Session Group Panel" 804 "*Ediff Session Group Panel"
@@ -821,7 +821,7 @@ If WIND-B is nil, use window next to WIND-A."
821 (interactive "P") 821 (interactive "P")
822 (ediff-windows dumb-mode wind-A wind-B 822 (ediff-windows dumb-mode wind-A wind-B
823 startup-hooks 'ediff-windows-wordwise 'word-mode)) 823 startup-hooks 'ediff-windows-wordwise 'word-mode))
824 824
825;;;###autoload 825;;;###autoload
826(defun ediff-windows-linewise (dumb-mode &optional wind-A wind-B startup-hooks) 826(defun ediff-windows-linewise (dumb-mode &optional wind-A wind-B startup-hooks)
827 "Compare WIND-A and WIND-B, which are selected by clicking, linewise. 827 "Compare WIND-A and WIND-B, which are selected by clicking, linewise.
@@ -832,7 +832,7 @@ If WIND-B is nil, use window next to WIND-A."
832 (interactive "P") 832 (interactive "P")
833 (ediff-windows dumb-mode wind-A wind-B 833 (ediff-windows dumb-mode wind-A wind-B
834 startup-hooks 'ediff-windows-linewise nil)) 834 startup-hooks 'ediff-windows-linewise nil))
835 835
836;; Compare WIND-A and WIND-B, which are selected by clicking. 836;; Compare WIND-A and WIND-B, which are selected by clicking.
837;; With prefix argument, DUMB-MODE, or on a non-windowing display, 837;; With prefix argument, DUMB-MODE, or on a non-windowing display,
838;; works as follows: 838;; works as follows:
@@ -844,11 +844,11 @@ If WIND-B is nil, use window next to WIND-A."
844 wind-B (ediff-get-next-window wind-B wind-A)) 844 wind-B (ediff-get-next-window wind-B wind-A))
845 (setq wind-A (ediff-get-window-by-clicking wind-A nil 1) 845 (setq wind-A (ediff-get-window-by-clicking wind-A nil 1)
846 wind-B (ediff-get-window-by-clicking wind-B wind-A 2))) 846 wind-B (ediff-get-window-by-clicking wind-B wind-A 2)))
847 847
848 (let ((buffer-A (window-buffer wind-A)) 848 (let ((buffer-A (window-buffer wind-A))
849 (buffer-B (window-buffer wind-B)) 849 (buffer-B (window-buffer wind-B))
850 beg-A end-A beg-B end-B) 850 beg-A end-A beg-B end-B)
851 851
852 (save-excursion 852 (save-excursion
853 (save-window-excursion 853 (save-window-excursion
854 (sit-for 0) ; sync before using window-start/end -- a precaution 854 (sit-for 0) ; sync before using window-start/end -- a precaution
@@ -867,7 +867,7 @@ If WIND-B is nil, use window next to WIND-A."
867 (ediff-regions-internal 867 (ediff-regions-internal
868 buffer-A beg-A end-A buffer-B beg-B end-B 868 buffer-A beg-A end-A buffer-B beg-B end-B
869 startup-hooks job-name word-mode nil))) 869 startup-hooks job-name word-mode nil)))
870 870
871 871
872;;;###autoload 872;;;###autoload
873(defun ediff-regions-wordwise (buffer-A buffer-B &optional startup-hooks) 873(defun ediff-regions-wordwise (buffer-A buffer-B &optional startup-hooks)
@@ -878,7 +878,7 @@ In such a case the user is asked to interactively establish the second
878region. 878region.
879This function is effective only for relatively small regions, up to 200 879This function is effective only for relatively small regions, up to 200
880lines. For large regions, use `ediff-regions-linewise'." 880lines. For large regions, use `ediff-regions-linewise'."
881 (interactive 881 (interactive
882 (let (bf) 882 (let (bf)
883 (list (setq bf (read-buffer "Region's A buffer: " 883 (list (setq bf (read-buffer "Region's A buffer: "
884 (ediff-other-buffer "") t)) 884 (ediff-other-buffer "") t))
@@ -893,8 +893,8 @@ lines. For large regions, use `ediff-regions-linewise'."
893 (error "Buffer %S doesn't exist" buffer-A)) 893 (error "Buffer %S doesn't exist" buffer-A))
894 (if (not (ediff-buffer-live-p buffer-B)) 894 (if (not (ediff-buffer-live-p buffer-B))
895 (error "Buffer %S doesn't exist" buffer-B)) 895 (error "Buffer %S doesn't exist" buffer-B))
896 896
897 897
898 (let ((buffer-A 898 (let ((buffer-A
899 (ediff-clone-buffer-for-region-comparison buffer-A "-Region.A-")) 899 (ediff-clone-buffer-for-region-comparison buffer-A "-Region.A-"))
900 (buffer-B 900 (buffer-B
@@ -907,12 +907,12 @@ lines. For large regions, use `ediff-regions-linewise'."
907 (set-buffer buffer-B) 907 (set-buffer buffer-B)
908 (setq reg-B-beg (region-beginning) 908 (setq reg-B-beg (region-beginning)
909 reg-B-end (region-end))) 909 reg-B-end (region-end)))
910 910
911 (ediff-regions-internal 911 (ediff-regions-internal
912 (get-buffer buffer-A) reg-A-beg reg-A-end 912 (get-buffer buffer-A) reg-A-beg reg-A-end
913 (get-buffer buffer-B) reg-B-beg reg-B-end 913 (get-buffer buffer-B) reg-B-beg reg-B-end
914 startup-hooks 'ediff-regions-wordwise 'word-mode nil))) 914 startup-hooks 'ediff-regions-wordwise 'word-mode nil)))
915 915
916;;;###autoload 916;;;###autoload
917(defun ediff-regions-linewise (buffer-A buffer-B &optional startup-hooks) 917(defun ediff-regions-linewise (buffer-A buffer-B &optional startup-hooks)
918 "Run Ediff on a pair of regions in specified buffers. 918 "Run Ediff on a pair of regions in specified buffers.
@@ -923,7 +923,7 @@ region.
923Each region is enlarged to contain full lines. 923Each region is enlarged to contain full lines.
924This function is effective for large regions, over 100-200 924This function is effective for large regions, over 100-200
925lines. For small regions, use `ediff-regions-wordwise'." 925lines. For small regions, use `ediff-regions-wordwise'."
926 (interactive 926 (interactive
927 (let (bf) 927 (let (bf)
928 (list (setq bf (read-buffer "Region A's buffer: " 928 (list (setq bf (read-buffer "Region A's buffer: "
929 (ediff-other-buffer "") t)) 929 (ediff-other-buffer "") t))
@@ -938,7 +938,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
938 (error "Buffer %S doesn't exist" buffer-A)) 938 (error "Buffer %S doesn't exist" buffer-A))
939 (if (not (ediff-buffer-live-p buffer-B)) 939 (if (not (ediff-buffer-live-p buffer-B))
940 (error "Buffer %S doesn't exist" buffer-B)) 940 (error "Buffer %S doesn't exist" buffer-B))
941 941
942 (let ((buffer-A 942 (let ((buffer-A
943 (ediff-clone-buffer-for-region-comparison buffer-A "-Region.A-")) 943 (ediff-clone-buffer-for-region-comparison buffer-A "-Region.A-"))
944 (buffer-B 944 (buffer-B
@@ -949,41 +949,41 @@ lines. For small regions, use `ediff-regions-wordwise'."
949 (setq reg-A-beg (region-beginning) 949 (setq reg-A-beg (region-beginning)
950 reg-A-end (region-end)) 950 reg-A-end (region-end))
951 ;; enlarge the region to hold full lines 951 ;; enlarge the region to hold full lines
952 (goto-char reg-A-beg) 952 (goto-char reg-A-beg)
953 (beginning-of-line) 953 (beginning-of-line)
954 (setq reg-A-beg (point)) 954 (setq reg-A-beg (point))
955 (goto-char reg-A-end) 955 (goto-char reg-A-end)
956 (end-of-line) 956 (end-of-line)
957 (or (eobp) (forward-char)) ; include the newline char 957 (or (eobp) (forward-char)) ; include the newline char
958 (setq reg-A-end (point)) 958 (setq reg-A-end (point))
959 959
960 (set-buffer buffer-B) 960 (set-buffer buffer-B)
961 (setq reg-B-beg (region-beginning) 961 (setq reg-B-beg (region-beginning)
962 reg-B-end (region-end)) 962 reg-B-end (region-end))
963 ;; enlarge the region to hold full lines 963 ;; enlarge the region to hold full lines
964 (goto-char reg-B-beg) 964 (goto-char reg-B-beg)
965 (beginning-of-line) 965 (beginning-of-line)
966 (setq reg-B-beg (point)) 966 (setq reg-B-beg (point))
967 (goto-char reg-B-end) 967 (goto-char reg-B-end)
968 (end-of-line) 968 (end-of-line)
969 (or (eobp) (forward-char)) ; include the newline char 969 (or (eobp) (forward-char)) ; include the newline char
970 (setq reg-B-end (point)) 970 (setq reg-B-end (point))
971 ) ; save excursion 971 ) ; save excursion
972 972
973 (ediff-regions-internal 973 (ediff-regions-internal
974 (get-buffer buffer-A) reg-A-beg reg-A-end 974 (get-buffer buffer-A) reg-A-beg reg-A-end
975 (get-buffer buffer-B) reg-B-beg reg-B-end 975 (get-buffer buffer-B) reg-B-beg reg-B-end
976 startup-hooks 'ediff-regions-linewise nil nil))) ; no word mode 976 startup-hooks 'ediff-regions-linewise nil nil))) ; no word mode
977 977
978;; compare region beg-A to end-A of buffer-A 978;; compare region beg-A to end-A of buffer-A
979;; to regions beg-B -- end-B in buffer-B. 979;; to regions beg-B -- end-B in buffer-B.
980(defun ediff-regions-internal (buffer-A beg-A end-A buffer-B beg-B end-B 980(defun ediff-regions-internal (buffer-A beg-A end-A buffer-B beg-B end-B
981 startup-hooks job-name word-mode 981 startup-hooks job-name word-mode
982 setup-parameters) 982 setup-parameters)
983 (let ((tmp-buffer (get-buffer-create ediff-tmp-buffer)) 983 (let ((tmp-buffer (get-buffer-create ediff-tmp-buffer))
984 overl-A overl-B 984 overl-A overl-B
985 file-A file-B) 985 file-A file-B)
986 986
987 ;; in case beg/end-A/B aren't markers--make them into markers 987 ;; in case beg/end-A/B aren't markers--make them into markers
988 (ediff-with-current-buffer buffer-A 988 (ediff-with-current-buffer buffer-A
989 (setq beg-A (move-marker (make-marker) beg-A) 989 (setq beg-A (move-marker (make-marker) beg-A)
@@ -991,19 +991,19 @@ lines. For small regions, use `ediff-regions-wordwise'."
991 (ediff-with-current-buffer buffer-B 991 (ediff-with-current-buffer buffer-B
992 (setq beg-B (move-marker (make-marker) beg-B) 992 (setq beg-B (move-marker (make-marker) beg-B)
993 end-B (move-marker (make-marker) end-B))) 993 end-B (move-marker (make-marker) end-B)))
994 994
995 ;; make file-A 995 ;; make file-A
996 (if word-mode 996 (if word-mode
997 (ediff-wordify beg-A end-A buffer-A tmp-buffer) 997 (ediff-wordify beg-A end-A buffer-A tmp-buffer)
998 (ediff-copy-to-buffer beg-A end-A buffer-A tmp-buffer)) 998 (ediff-copy-to-buffer beg-A end-A buffer-A tmp-buffer))
999 (setq file-A (ediff-make-temp-file tmp-buffer "regA")) 999 (setq file-A (ediff-make-temp-file tmp-buffer "regA"))
1000 1000
1001 ;; make file-B 1001 ;; make file-B
1002 (if word-mode 1002 (if word-mode
1003 (ediff-wordify beg-B end-B buffer-B tmp-buffer) 1003 (ediff-wordify beg-B end-B buffer-B tmp-buffer)
1004 (ediff-copy-to-buffer beg-B end-B buffer-B tmp-buffer)) 1004 (ediff-copy-to-buffer beg-B end-B buffer-B tmp-buffer))
1005 (setq file-B (ediff-make-temp-file tmp-buffer "regB")) 1005 (setq file-B (ediff-make-temp-file tmp-buffer "regB"))
1006 1006
1007 (setq overl-A (ediff-make-bullet-proof-overlay beg-A end-A buffer-A)) 1007 (setq overl-A (ediff-make-bullet-proof-overlay beg-A end-A buffer-A))
1008 (setq overl-B (ediff-make-bullet-proof-overlay beg-B end-B buffer-B)) 1008 (setq overl-B (ediff-make-bullet-proof-overlay beg-B end-B buffer-B))
1009 (ediff-setup buffer-A file-A 1009 (ediff-setup buffer-A file-A
@@ -1019,13 +1019,13 @@ lines. For small regions, use `ediff-regions-wordwise'."
1019 (cons 'ediff-job-name job-name)) 1019 (cons 'ediff-job-name job-name))
1020 setup-parameters)) 1020 setup-parameters))
1021 )) 1021 ))
1022 1022
1023 1023
1024;;; Merge files and buffers 1024;;; Merge files and buffers
1025 1025
1026;;;###autoload 1026;;;###autoload
1027(defalias 'ediff-merge 'ediff-merge-files) 1027(defalias 'ediff-merge 'ediff-merge-files)
1028 1028
1029(defsubst ediff-merge-on-startup () 1029(defsubst ediff-merge-on-startup ()
1030 (ediff-do-merge 0) 1030 (ediff-do-merge 0)
1031 (ediff-with-current-buffer ediff-buffer-C 1031 (ediff-with-current-buffer ediff-buffer-C
@@ -1034,7 +1034,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
1034;;;###autoload 1034;;;###autoload
1035(defun ediff-merge-files (file-A file-B 1035(defun ediff-merge-files (file-A file-B
1036 ;; MERGE-BUFFER-FILE is the file to be 1036 ;; MERGE-BUFFER-FILE is the file to be
1037 ;; associated with the merge buffer 1037 ;; associated with the merge buffer
1038 &optional startup-hooks merge-buffer-file) 1038 &optional startup-hooks merge-buffer-file)
1039 "Merge two files without ancestor." 1039 "Merge two files without ancestor."
1040 (interactive 1040 (interactive
@@ -1047,10 +1047,10 @@ lines. For small regions, use `ediff-regions-wordwise'."
1047 dir-A 1047 dir-A
1048 (ediff-get-default-file-name) 1048 (ediff-get-default-file-name)
1049 'no-dirs)) 1049 'no-dirs))
1050 (ediff-read-file-name "File B to merge" 1050 (ediff-read-file-name "File B to merge"
1051 (setq dir-B 1051 (setq dir-B
1052 (if ediff-use-last-dir 1052 (if ediff-use-last-dir
1053 ediff-last-dir-B 1053 ediff-last-dir-B
1054 (file-name-directory f))) 1054 (file-name-directory f)))
1055 (progn 1055 (progn
1056 (setq file-name-history 1056 (setq file-name-history
@@ -1062,7 +1062,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
1062 (ediff-get-default-file-name f 1))) 1062 (ediff-get-default-file-name f 1)))
1063 ))) 1063 )))
1064 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks)) 1064 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
1065 (ediff-files-internal file-A 1065 (ediff-files-internal file-A
1066 (if (file-directory-p file-B) 1066 (if (file-directory-p file-B)
1067 (expand-file-name 1067 (expand-file-name
1068 (file-name-nondirectory file-A) file-B) 1068 (file-name-nondirectory file-A) file-B)
@@ -1071,7 +1071,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
1071 startup-hooks 1071 startup-hooks
1072 'ediff-merge-files 1072 'ediff-merge-files
1073 merge-buffer-file)) 1073 merge-buffer-file))
1074 1074
1075;;;###autoload 1075;;;###autoload
1076(defun ediff-merge-files-with-ancestor (file-A file-B file-ancestor 1076(defun ediff-merge-files-with-ancestor (file-A file-B file-ancestor
1077 &optional 1077 &optional
@@ -1091,10 +1091,10 @@ lines. For small regions, use `ediff-regions-wordwise'."
1091 dir-A 1091 dir-A
1092 (ediff-get-default-file-name) 1092 (ediff-get-default-file-name)
1093 'no-dirs)) 1093 'no-dirs))
1094 (setq ff (ediff-read-file-name "File B to merge" 1094 (setq ff (ediff-read-file-name "File B to merge"
1095 (setq dir-B 1095 (setq dir-B
1096 (if ediff-use-last-dir 1096 (if ediff-use-last-dir
1097 ediff-last-dir-B 1097 ediff-last-dir-B
1098 (file-name-directory f))) 1098 (file-name-directory f)))
1099 (progn 1099 (progn
1100 (setq file-name-history 1100 (setq file-name-history
@@ -1105,7 +1105,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
1105 dir-B)) 1105 dir-B))
1106 file-name-history)) 1106 file-name-history))
1107 (ediff-get-default-file-name f 1)))) 1107 (ediff-get-default-file-name f 1))))
1108 (ediff-read-file-name "Ancestor file" 1108 (ediff-read-file-name "Ancestor file"
1109 (setq dir-ancestor 1109 (setq dir-ancestor
1110 (if ediff-use-last-dir 1110 (if ediff-use-last-dir
1111 ediff-last-dir-ancestor 1111 ediff-last-dir-ancestor
@@ -1120,7 +1120,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
1120 (ediff-get-default-file-name ff 2))) 1120 (ediff-get-default-file-name ff 2)))
1121 ))) 1121 )))
1122 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks)) 1122 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
1123 (ediff-files-internal file-A 1123 (ediff-files-internal file-A
1124 (if (file-directory-p file-B) 1124 (if (file-directory-p file-B)
1125 (expand-file-name 1125 (expand-file-name
1126 (file-name-nondirectory file-A) file-B) 1126 (file-name-nondirectory file-A) file-B)
@@ -1129,10 +1129,10 @@ lines. For small regions, use `ediff-regions-wordwise'."
1129 startup-hooks 1129 startup-hooks
1130 'ediff-merge-files-with-ancestor 1130 'ediff-merge-files-with-ancestor
1131 merge-buffer-file)) 1131 merge-buffer-file))
1132 1132
1133;;;###autoload 1133;;;###autoload
1134(defalias 'ediff-merge-with-ancestor 'ediff-merge-files-with-ancestor) 1134(defalias 'ediff-merge-with-ancestor 'ediff-merge-files-with-ancestor)
1135 1135
1136;;;###autoload 1136;;;###autoload
1137(defun ediff-merge-buffers (buffer-A buffer-B 1137(defun ediff-merge-buffers (buffer-A buffer-B
1138 &optional 1138 &optional
@@ -1140,7 +1140,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
1140 ;; associated with the merge buffer 1140 ;; associated with the merge buffer
1141 startup-hooks job-name merge-buffer-file) 1141 startup-hooks job-name merge-buffer-file)
1142 "Merge buffers without ancestor." 1142 "Merge buffers without ancestor."
1143 (interactive 1143 (interactive
1144 (let (bf) 1144 (let (bf)
1145 (list (setq bf (read-buffer "Buffer A to merge: " 1145 (list (setq bf (read-buffer "Buffer A to merge: "
1146 (ediff-other-buffer "") t)) 1146 (ediff-other-buffer "") t))
@@ -1151,12 +1151,12 @@ lines. For small regions, use `ediff-regions-wordwise'."
1151 (save-window-excursion (other-window 1)) 1151 (save-window-excursion (other-window 1))
1152 (ediff-other-buffer bf)) 1152 (ediff-other-buffer bf))
1153 t)))) 1153 t))))
1154 1154
1155 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks)) 1155 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
1156 (or job-name (setq job-name 'ediff-merge-buffers)) 1156 (or job-name (setq job-name 'ediff-merge-buffers))
1157 (ediff-buffers-internal 1157 (ediff-buffers-internal
1158 buffer-A buffer-B nil startup-hooks job-name merge-buffer-file)) 1158 buffer-A buffer-B nil startup-hooks job-name merge-buffer-file))
1159 1159
1160;;;###autoload 1160;;;###autoload
1161(defun ediff-merge-buffers-with-ancestor (buffer-A buffer-B buffer-ancestor 1161(defun ediff-merge-buffers-with-ancestor (buffer-A buffer-B buffer-ancestor
1162 &optional 1162 &optional
@@ -1167,7 +1167,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
1167 ;; with the merge buffer 1167 ;; with the merge buffer
1168 merge-buffer-file) 1168 merge-buffer-file)
1169 "Merge buffers with ancestor." 1169 "Merge buffers with ancestor."
1170 (interactive 1170 (interactive
1171 (let (bf bff) 1171 (let (bf bff)
1172 (list (setq bf (read-buffer "Buffer A to merge: " 1172 (list (setq bf (read-buffer "Buffer A to merge: "
1173 (ediff-other-buffer "") t)) 1173 (ediff-other-buffer "") t))
@@ -1186,12 +1186,12 @@ lines. For small regions, use `ediff-regions-wordwise'."
1186 (ediff-other-buffer (list bf bff))) 1186 (ediff-other-buffer (list bf bff)))
1187 t) 1187 t)
1188 ))) 1188 )))
1189 1189
1190 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks)) 1190 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
1191 (or job-name (setq job-name 'ediff-merge-buffers-with-ancestor)) 1191 (or job-name (setq job-name 'ediff-merge-buffers-with-ancestor))
1192 (ediff-buffers-internal 1192 (ediff-buffers-internal
1193 buffer-A buffer-B buffer-ancestor startup-hooks job-name merge-buffer-file)) 1193 buffer-A buffer-B buffer-ancestor startup-hooks job-name merge-buffer-file))
1194 1194
1195 1195
1196;;;###autoload 1196;;;###autoload
1197(defun ediff-merge-revisions (&optional file startup-hooks merge-buffer-file) 1197(defun ediff-merge-revisions (&optional file startup-hooks merge-buffer-file)
@@ -1219,7 +1219,7 @@ buffer."
1219 (funcall 1219 (funcall
1220 (intern (format "ediff-%S-merge-internal" ediff-version-control-package)) 1220 (intern (format "ediff-%S-merge-internal" ediff-version-control-package))
1221 rev1 rev2 nil startup-hooks merge-buffer-file))) 1221 rev1 rev2 nil startup-hooks merge-buffer-file)))
1222 1222
1223 1223
1224;;;###autoload 1224;;;###autoload
1225(defun ediff-merge-revisions-with-ancestor (&optional 1225(defun ediff-merge-revisions-with-ancestor (&optional
@@ -1269,8 +1269,8 @@ file and then run `run-ediff-from-cvs-buffer'."
1269 (if tin 1269 (if tin
1270 (cvs-run-ediff-on-file-descriptor tin) 1270 (cvs-run-ediff-on-file-descriptor tin)
1271 (error "There is no file to merge")))) 1271 (error "There is no file to merge"))))
1272 1272
1273 1273
1274;;; Apply patch 1274;;; Apply patch
1275 1275
1276;;;###autoload 1276;;;###autoload
@@ -1294,7 +1294,7 @@ buffer. If odd -- assume it is in a file."
1294 (buffer-file-name patch-buf)))) 1294 (buffer-file-name patch-buf))))
1295 (t default-directory))) 1295 (t default-directory)))
1296 (setq source-file 1296 (setq source-file
1297 (read-file-name 1297 (read-file-name
1298 "File to patch (directory, if multifile patch): " 1298 "File to patch (directory, if multifile patch): "
1299 ;; use an explicit initial file 1299 ;; use an explicit initial file
1300 source-dir nil nil (ediff-get-default-file-name))) 1300 source-dir nil nil (ediff-get-default-file-name)))
@@ -1317,7 +1317,7 @@ With prefix arg=2: assumes the patch is in a buffer and prompts for the buffer."
1317 (read-buffer 1317 (read-buffer
1318 "Which buffer to patch? " 1318 "Which buffer to patch? "
1319 (current-buffer)))) 1319 (current-buffer))))
1320 1320
1321 1321
1322;;;###autoload 1322;;;###autoload
1323(defalias 'epatch 'ediff-patch-file) 1323(defalias 'epatch 'ediff-patch-file)
@@ -1327,8 +1327,8 @@ With prefix arg=2: assumes the patch is in a buffer and prompts for the buffer."
1327 1327
1328 1328
1329 1329
1330;;; Versions Control functions 1330;;; Versions Control functions
1331 1331
1332;;;###autoload 1332;;;###autoload
1333(defun ediff-revision (&optional file startup-hooks) 1333(defun ediff-revision (&optional file startup-hooks)
1334 "Run Ediff by comparing versions of a file. 1334 "Run Ediff by comparing versions of a file.
@@ -1344,7 +1344,7 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
1344 ediff-last-dir-A 1344 ediff-last-dir-A
1345 default-directory) 1345 default-directory)
1346 (ediff-get-default-file-name) 1346 (ediff-get-default-file-name)
1347 'no-dirs))) 1347 'no-dirs)))
1348 (find-file file) 1348 (find-file file)
1349 (if (and (buffer-modified-p) 1349 (if (and (buffer-modified-p)
1350 (y-or-n-p (message "Buffer %s is modified. Save buffer? " 1350 (y-or-n-p (message "Buffer %s is modified. Save buffer? "
@@ -1356,7 +1356,7 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
1356 (format "Revision 1 to compare (default: %s's latest revision): " 1356 (format "Revision 1 to compare (default: %s's latest revision): "
1357 (file-name-nondirectory file))) 1357 (file-name-nondirectory file)))
1358 rev2 1358 rev2
1359 (read-string 1359 (read-string
1360 (format "Revision 2 to compare (default: %s's current state): " 1360 (format "Revision 2 to compare (default: %s's current state): "
1361 (file-name-nondirectory file)))) 1361 (file-name-nondirectory file))))
1362 (ediff-load-version-control) 1362 (ediff-load-version-control)
@@ -1368,8 +1368,8 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
1368 1368
1369;;;###autoload 1369;;;###autoload
1370(defalias 'erevision 'ediff-revision) 1370(defalias 'erevision 'ediff-revision)
1371 1371
1372 1372
1373;; Test if version control package is loaded and load if not 1373;; Test if version control package is loaded and load if not
1374;; Is SILENT is non-nil, don't report error if package is not found. 1374;; Is SILENT is non-nil, don't report error if package is not found.
1375(defun ediff-load-version-control (&optional silent) 1375(defun ediff-load-version-control (&optional silent)
@@ -1420,7 +1420,7 @@ With optional NODE, goes to that node."
1420 (progn 1420 (progn
1421 (select-window ctl-window) 1421 (select-window ctl-window)
1422 (set-window-buffer ctl-window ctl-buf))))))) 1422 (set-window-buffer ctl-window ctl-buf)))))))
1423 1423
1424 1424
1425 1425
1426 1426
diff --git a/lisp/edmacro.el b/lisp/edmacro.el
index 2526d3bda63..4ec62152db5 100644
--- a/lisp/edmacro.el
+++ b/lisp/edmacro.el
@@ -32,7 +32,7 @@
32;; in a special buffer. It prompts you to type a key sequence, 32;; in a special buffer. It prompts you to type a key sequence,
33;; which should be one of: 33;; which should be one of:
34;; 34;;
35;; * RET or `C-x e' (call-last-kbd-macro), to edit the most 35;; * RET or `C-x e' (call-last-kbd-macro), to edit the most
36;; recently defined keyboard macro. 36;; recently defined keyboard macro.
37;; 37;;
38;; * `M-x' followed by a command name, to edit a named command 38;; * `M-x' followed by a command name, to edit a named command
@@ -105,7 +105,7 @@ With a prefix argument, format the macro in a more concise way."
105 (cond (store-hook 105 (cond (store-hook
106 (setq mac keys) 106 (setq mac keys)
107 (setq cmd nil)) 107 (setq cmd nil))
108 ((or (memq cmd '(call-last-kbd-macro kmacro-call-macro 108 ((or (memq cmd '(call-last-kbd-macro kmacro-call-macro
109 kmacro-end-or-call-macro kmacro-end-and-call-macro)) 109 kmacro-end-or-call-macro kmacro-end-and-call-macro))
110 (member keys '("\r" [return]))) 110 (member keys '("\r" [return])))
111 (or last-kbd-macro 111 (or last-kbd-macro
diff --git a/lisp/ehelp.el b/lisp/ehelp.el
index a2ea97688a5..f5996068842 100644
--- a/lisp/ehelp.el
+++ b/lisp/ehelp.el
@@ -181,7 +181,7 @@ BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit."
181 (condition-case () 181 (condition-case ()
182 (funcall (or default-major-mode 'fundamental-mode)) 182 (funcall (or default-major-mode 'fundamental-mode))
183 (error nil)) 183 (error nil))
184 184
185 (set-window-configuration config) 185 (set-window-configuration config)
186 (when bury 186 (when bury
187 ;;>> Perhaps this shouldn't be done, 187 ;;>> Perhaps this shouldn't be done,
@@ -211,8 +211,8 @@ BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit."
211 (Electric-command-loop 211 (Electric-command-loop
212 'exit 212 'exit
213 (function (lambda () 213 (function (lambda ()
214 (sit-for 0) ;necessary if last command was end-of-buffer or 214 (sit-for 0) ;necessary if last command was end-of-buffer or
215 ;beginning-of-buffer - otherwise pos-visible-in-window-p 215 ;beginning-of-buffer - otherwise pos-visible-in-window-p
216 ;will yield a wrong result. 216 ;will yield a wrong result.
217 (let ((min (pos-visible-in-window-p (point-min))) 217 (let ((min (pos-visible-in-window-p (point-min)))
218 (max (pos-visible-in-window-p (point-max)))) 218 (max (pos-visible-in-window-p (point-max))))
@@ -343,7 +343,7 @@ will select it.)"
343 343
344 344
345 345
346;; This is to be bound to M-x in ehelp mode. Retains ehelp buffer and then 346;; This is to be bound to M-x in ehelp mode. Retains ehelp buffer and then
347;; continues with execute-extended-command. 347;; continues with execute-extended-command.
348(defun electric-help-execute-extended (prefixarg) 348(defun electric-help-execute-extended (prefixarg)
349 (interactive "p") 349 (interactive "p")
@@ -407,7 +407,7 @@ will select it.)"
407(defvar ehelp-map ()) 407(defvar ehelp-map ())
408(if ehelp-map 408(if ehelp-map
409 nil 409 nil
410 (let ((map (copy-keymap help-map))) 410 (let ((map (copy-keymap help-map)))
411 (substitute-key-definition 'apropos 'electric-apropos map) 411 (substitute-key-definition 'apropos 'electric-apropos map)
412 (substitute-key-definition 'command-apropos 'electric-command-apropos map) 412 (substitute-key-definition 'command-apropos 'electric-command-apropos map)
413 (substitute-key-definition 'describe-key 'electric-describe-key map) 413 (substitute-key-definition 'describe-key 'electric-describe-key map)
@@ -421,6 +421,6 @@ will select it.)"
421 (setq ehelp-map map) 421 (setq ehelp-map map)
422 (fset 'ehelp-command map))) 422 (fset 'ehelp-command map)))
423 423
424(provide 'ehelp) 424(provide 'ehelp)
425 425
426;;; ehelp.el ends here 426;;; ehelp.el ends here
diff --git a/lisp/electric.el b/lisp/electric.el
index d4678a7e3e2..87a151b4808 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -55,8 +55,8 @@
55 &optional prompt inhibit-quit 55 &optional prompt inhibit-quit
56 loop-function loop-state) 56 loop-function loop-state)
57 57
58 (let (cmd 58 (let (cmd
59 (err nil) 59 (err nil)
60 (prompt-string prompt)) 60 (prompt-string prompt))
61 (while t 61 (while t
62 (if (not (or (stringp prompt) (eq prompt nil) (eq prompt 'noprompt))) 62 (if (not (or (stringp prompt) (eq prompt nil) (eq prompt 'noprompt)))
@@ -123,7 +123,7 @@
123 (ding) 123 (ding)
124 (throw return-tag nil)) 124 (throw return-tag nil))
125 125
126;; This function is like pop-to-buffer, sort of. 126;; This function is like pop-to-buffer, sort of.
127;; The algorithm is 127;; The algorithm is
128;; If there is a window displaying buffer 128;; If there is a window displaying buffer
129;; Select it 129;; Select it
diff --git a/lisp/emerge.el b/lisp/emerge.el
index 2fb47ee8ab7..170a907afae 100644
--- a/lisp/emerge.el
+++ b/lisp/emerge.el
@@ -64,11 +64,11 @@ Differs from `save-excursion' in that it doesn't save the point and mark."
64 ,@forms) 64 ,@forms)
65 (set-buffer StartBuffer)))) 65 (set-buffer StartBuffer))))
66 66
67(defmacro emerge-defvar-local (var value doc) 67(defmacro emerge-defvar-local (var value doc)
68 "Defines SYMBOL as an advertised variable. 68 "Defines SYMBOL as an advertised variable.
69Performs a defvar, then executes `make-variable-buffer-local' on 69Performs a defvar, then executes `make-variable-buffer-local' on
70the variable. Also sets the `preserved' property, so that 70the variable. Also sets the `preserved' property, so that
71`kill-all-local-variables' (called by major-mode setting commands) 71`kill-all-local-variables' (called by major-mode setting commands)
72won't destroy Emerge control variables." 72won't destroy Emerge control variables."
73 `(progn 73 `(progn
74 (defvar ,var ,value ,doc) 74 (defvar ,var ,value ,doc)
@@ -127,7 +127,7 @@ When called interactively, displays the version."
127;; to be provided (emerge-diff-options). The order in which the file names 127;; to be provided (emerge-diff-options). The order in which the file names
128;; are given is fixed. 128;; are given is fixed.
129;; The file names are always expanded (see expand-file-name) before being 129;; The file names are always expanded (see expand-file-name) before being
130;; passed to diff, thus they need not be invoked under a shell that 130;; passed to diff, thus they need not be invoked under a shell that
131;; understands `~'. 131;; understands `~'.
132;; The code which processes the diff/diff3 output depends on all the 132;; The code which processes the diff/diff3 output depends on all the
133;; finicky details of their output, including the somewhat strange 133;; finicky details of their output, including the somewhat strange
@@ -578,7 +578,7 @@ This is *not* a user option, since Emerge uses it for its own processing.")
578 (if output-file 578 (if output-file
579 (setq emerge-last-dir-output (file-name-directory output-file))) 579 (setq emerge-last-dir-output (file-name-directory output-file)))
580 ;; Make sure the entire files are seen, and they reflect what is on disk 580 ;; Make sure the entire files are seen, and they reflect what is on disk
581 (emerge-eval-in-buffer 581 (emerge-eval-in-buffer
582 buffer-A 582 buffer-A
583 (widen) 583 (widen)
584 (let ((temp (file-local-copy file-A))) 584 (let ((temp (file-local-copy file-A)))
@@ -842,7 +842,7 @@ This is *not* a user option, since Emerge uses it for its own processing.")
842 ;; if the A and B files are the same, ignore the difference 842 ;; if the A and B files are the same, ignore the difference
843 (if (not (string-equal agreement "2")) 843 (if (not (string-equal agreement "2"))
844 (setq list 844 (setq list
845 (cons 845 (cons
846 (let (group-1 group-3 pos) 846 (let (group-1 group-3 pos)
847 (setq pos (point)) 847 (setq pos (point))
848 (setq group-1 (emerge-get-diff3-group "1")) 848 (setq group-1 (emerge-get-diff3-group "1"))
@@ -1022,7 +1022,7 @@ This is *not* a user option, since Emerge uses it for its own processing.")
1022 (emerge-files-with-ancestor-internal 1022 (emerge-files-with-ancestor-internal
1023 file-a file-b file-anc nil 1023 file-a file-b file-anc nil
1024 (list `(lambda () (emerge-command-exit ,file-out)))))) 1024 (list `(lambda () (emerge-command-exit ,file-out))))))
1025 1025
1026(defun emerge-command-exit (file-out) 1026(defun emerge-command-exit (file-out)
1027 (emerge-write-and-delete file-out) 1027 (emerge-write-and-delete file-out)
1028 (kill-emacs (if emerge-prefix-argument 1 0))) 1028 (kill-emacs (if emerge-prefix-argument 1 0)))
@@ -1270,7 +1270,7 @@ Otherwise, the A or B file present is copied to the output file."
1270 (emerge-files (not (not file-out)) file-A file-B file-out 1270 (emerge-files (not (not file-out)) file-A file-B file-out
1271 nil 1271 nil
1272 ;; When done, return to this buffer. 1272 ;; When done, return to this buffer.
1273 (list 1273 (list
1274 `(lambda () 1274 `(lambda ()
1275 (switch-to-buffer ,(current-buffer)) 1275 (switch-to-buffer ,(current-buffer))
1276 (message "Merge done."))))) 1276 (message "Merge done.")))))
@@ -1294,7 +1294,7 @@ Otherwise, the A or B file present is copied to the output file."
1294 1294
1295;;;###autoload 1295;;;###autoload
1296(defun emerge-merge-directories (a-dir b-dir ancestor-dir output-dir) 1296(defun emerge-merge-directories (a-dir b-dir ancestor-dir output-dir)
1297 (interactive 1297 (interactive
1298 (list 1298 (list
1299 (read-file-name "A directory: " nil nil 'confirm) 1299 (read-file-name "A directory: " nil nil 'confirm)
1300 (read-file-name "B directory: " nil nil 'confirm) 1300 (read-file-name "B directory: " nil nil 'confirm)
@@ -1539,7 +1539,7 @@ These characteristics are restored by `emerge-restore-buffer-characteristics'."
1539 ;; fast access 1539 ;; fast access
1540 (setq emerge-difference-list (apply 'vector (nreverse marker-list))))) 1540 (setq emerge-difference-list (apply 'vector (nreverse marker-list)))))
1541 1541
1542;; If we have an ancestor, select all B variants that we prefer 1542;; If we have an ancestor, select all B variants that we prefer
1543(defun emerge-select-prefer-Bs () 1543(defun emerge-select-prefer-Bs ()
1544 (let ((n 0)) 1544 (let ((n 0))
1545 (while (< n emerge-number-of-differences) 1545 (while (< n emerge-number-of-differences)
@@ -1663,7 +1663,7 @@ the height of the merge window.
1663`C-u -' alone as argument scrolls half the height of the merge window." 1663`C-u -' alone as argument scrolls half the height of the merge window."
1664 (interactive "P") 1664 (interactive "P")
1665 (emerge-operate-on-windows 1665 (emerge-operate-on-windows
1666 'scroll-up 1666 'scroll-up
1667 ;; calculate argument to scroll-up 1667 ;; calculate argument to scroll-up
1668 ;; if there is an explicit argument 1668 ;; if there is an explicit argument
1669 (if (and arg (not (equal arg '-))) 1669 (if (and arg (not (equal arg '-)))
@@ -1906,7 +1906,7 @@ buffer after this will cause serious problems."
1906 (run-hooks 'emerge-quit-hook))) 1906 (run-hooks 'emerge-quit-hook)))
1907 1907
1908(defun emerge-select-A (&optional force) 1908(defun emerge-select-A (&optional force)
1909 "Select the A variant of this difference. 1909 "Select the A variant of this difference.
1910Refuses to function if this difference has been edited, i.e., if it 1910Refuses to function if this difference has been edited, i.e., if it
1911is neither the A nor the B variant. 1911is neither the A nor the B variant.
1912A prefix argument forces the variant to be selected 1912A prefix argument forces the variant to be selected
@@ -2579,15 +2579,15 @@ been edited."
2579 (if (= c ?%) 2579 (if (= c ?%)
2580 (progn 2580 (progn
2581 (setq i (1+ i)) 2581 (setq i (1+ i))
2582 (setq c 2582 (setq c
2583 (condition-case nil 2583 (condition-case nil
2584 (aref template i) 2584 (aref template i)
2585 (error ?%))) 2585 (error ?%)))
2586 (cond ((= c ?a) 2586 (cond ((= c ?a)
2587 (insert-buffer-substring emerge-A-buffer A-begin A-end)) 2587 (insert-buffer-substring emerge-A-buffer A-begin A-end))
2588 ((= c ?b) 2588 ((= c ?b)
2589 (insert-buffer-substring emerge-B-buffer B-begin B-end)) 2589 (insert-buffer-substring emerge-B-buffer B-begin B-end))
2590 ((= c ?%) 2590 ((= c ?%)
2591 (insert ?%)) 2591 (insert ?%))
2592 (t 2592 (t
2593 (insert c)))) 2593 (insert c))))
@@ -2848,7 +2848,7 @@ keymap. Leaves merge in fast mode."
2848 (while (< x-begin x-end) 2848 (while (< x-begin x-end)
2849 ;; bite off and compare no more than 1000 characters at a time 2849 ;; bite off and compare no more than 1000 characters at a time
2850 (let* ((compare-length (min (- x-end x-begin) 1000)) 2850 (let* ((compare-length (min (- x-end x-begin) 1000))
2851 (x-string (emerge-eval-in-buffer 2851 (x-string (emerge-eval-in-buffer
2852 buffer-x 2852 buffer-x
2853 (buffer-substring x-begin 2853 (buffer-substring x-begin
2854 (+ x-begin compare-length)))) 2854 (+ x-begin compare-length))))
@@ -2863,7 +2863,7 @@ keymap. Leaves merge in fast mode."
2863 t))) 2863 t)))
2864 2864
2865;; Construct a unique buffer name. 2865;; Construct a unique buffer name.
2866;; The first one tried is prefixsuffix, then prefix<2>suffix, 2866;; The first one tried is prefixsuffix, then prefix<2>suffix,
2867;; prefix<3>suffix, etc. 2867;; prefix<3>suffix, etc.
2868(defun emerge-unique-buffer-name (prefix suffix) 2868(defun emerge-unique-buffer-name (prefix suffix)
2869 (if (null (get-buffer (concat prefix suffix))) 2869 (if (null (get-buffer (concat prefix suffix)))
diff --git a/lisp/env.el b/lisp/env.el
index e19f9f7f5da..f41677fcf18 100644
--- a/lisp/env.el
+++ b/lisp/env.el
@@ -55,10 +55,10 @@ If it is also not t, RET does not exit if it does non-null completion."
55`$FOO' where FOO is an environment variable name means to substitute 55`$FOO' where FOO is an environment variable name means to substitute
56the value of that variable. The variable name should be terminated 56the value of that variable. The variable name should be terminated
57with a character not a letter, digit or underscore; otherwise, enclose 57with a character not a letter, digit or underscore; otherwise, enclose
58the entire variable name in braces. Use `$$' to insert a single 58the entire variable name in braces. Use `$$' to insert a single
59dollar sign." 59dollar sign."
60 (let ((start 0)) 60 (let ((start 0))
61 (while (string-match 61 (while (string-match
62 (rx (or (and "$" (submatch (1+ (in "a-zA-Z0-9_")))) 62 (rx (or (and "$" (submatch (1+ (in "a-zA-Z0-9_"))))
63 (and "${" (submatch (minimal-match (0+ anything))) "}") 63 (and "${" (submatch (minimal-match (0+ anything))) "}")
64 "$$")) 64 "$$"))
@@ -101,13 +101,13 @@ This function works by modifying `process-environment'."
101 (when value 101 (when value
102 (push value setenv-history)) 102 (push value setenv-history))
103 ;; Here finally we specify the args to give call setenv with. 103 ;; Here finally we specify the args to give call setenv with.
104 (list var 104 (list var
105 (read-from-minibuffer (format "Set %s to value: " var) 105 (read-from-minibuffer (format "Set %s to value: " var)
106 nil nil nil 'setenv-history 106 nil nil nil 'setenv-history
107 value) 107 value)
108 nil 108 nil
109 t)))) 109 t))))
110 (if unset 110 (if unset
111 (setq value nil) 111 (setq value nil)
112 (if substitute-env-vars 112 (if substitute-env-vars
113 (setq value (substitute-env-vars value)))) 113 (setq value (substitute-env-vars value))))
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 37399e0d901..78bdfc6115b 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -38,7 +38,7 @@
38;; insertion. It will be forgotten if you move point or make other 38;; insertion. It will be forgotten if you move point or make other
39;; modifications before inserting or typing anything. 39;; modifications before inserting or typing anything.
40;; 40;;
41;; Faces can be selected from the keyboard as well. 41;; Faces can be selected from the keyboard as well.
42;; The standard keybindings are M-g (or ESC g) + letter: 42;; The standard keybindings are M-g (or ESC g) + letter:
43;; M-g i = "set italic", M-g b = "set bold", etc. 43;; M-g i = "set italic", M-g b = "set bold", etc.
44 44
@@ -86,14 +86,14 @@
86 86
87;;; Code: 87;;; Code:
88 88
89(eval-when-compile 89(eval-when-compile
90 (require 'help) 90 (require 'help)
91 (require 'button)) 91 (require 'button))
92 92
93;;; Provide some binding for startup: 93;;; Provide some binding for startup:
94;;;###autoload (define-key global-map "\M-g" 'facemenu-keymap) 94;;;###autoload (define-key global-map "\M-g" 'facemenu-keymap)
95;;;###autoload (autoload 'facemenu-keymap "facemenu" "Keymap for face-changing commands." t 'keymap) 95;;;###autoload (autoload 'facemenu-keymap "facemenu" "Keymap for face-changing commands." t 'keymap)
96 96
97;; Global bindings: 97;; Global bindings:
98(define-key global-map [C-down-mouse-2] 'facemenu-menu) 98(define-key global-map [C-down-mouse-2] 'facemenu-menu)
99(define-key global-map "\M-g" 'facemenu-keymap) 99(define-key global-map "\M-g" 'facemenu-keymap)
@@ -116,7 +116,7 @@ the binding is made in `facemenu-keymap'.
116 116
117The faces specifically mentioned in this list are put at the top of 117The faces specifically mentioned in this list are put at the top of
118the menu, in the order specified. All other faces which are defined, 118the menu, in the order specified. All other faces which are defined,
119except for those in `facemenu-unlisted-faces', are listed after them, 119except for those in `facemenu-unlisted-faces', are listed after them,
120but get no keyboard equivalents. 120but get no keyboard equivalents.
121 121
122If you change this variable after loading facemenu.el, you will need to call 122If you change this variable after loading facemenu.el, you will need to call
@@ -164,7 +164,7 @@ when they are created."
164(defalias 'facemenu-face-menu facemenu-face-menu) 164(defalias 'facemenu-face-menu facemenu-face-menu)
165 165
166;;;###autoload 166;;;###autoload
167(defvar facemenu-foreground-menu 167(defvar facemenu-foreground-menu
168 (let ((map (make-sparse-keymap "Foreground Color"))) 168 (let ((map (make-sparse-keymap "Foreground Color")))
169 (define-key map "o" (cons "Other..." 'facemenu-set-foreground)) 169 (define-key map "o" (cons "Other..." 'facemenu-set-foreground))
170 map) 170 map)
@@ -182,7 +182,7 @@ when they are created."
182(defalias 'facemenu-background-menu facemenu-background-menu) 182(defalias 'facemenu-background-menu facemenu-background-menu)
183 183
184;;;###autoload 184;;;###autoload
185(defvar facemenu-special-menu 185(defvar facemenu-special-menu
186 (let ((map (make-sparse-keymap "Special"))) 186 (let ((map (make-sparse-keymap "Special")))
187 (define-key map [?s] (cons (purecopy "Remove Special") 187 (define-key map [?s] (cons (purecopy "Remove Special")
188 'facemenu-remove-special)) 188 'facemenu-remove-special))
@@ -213,7 +213,7 @@ when they are created."
213;;;###autoload 213;;;###autoload
214(defvar facemenu-indentation-menu 214(defvar facemenu-indentation-menu
215 (let ((map (make-sparse-keymap "Indentation"))) 215 (let ((map (make-sparse-keymap "Indentation")))
216 (define-key map [decrease-right-margin] 216 (define-key map [decrease-right-margin]
217 (cons (purecopy "Indent Right Less") 'decrease-right-margin)) 217 (cons (purecopy "Indent Right Less") 'decrease-right-margin))
218 (define-key map [increase-right-margin] 218 (define-key map [increase-right-margin]
219 (cons (purecopy "Indent Right More") 'increase-right-margin)) 219 (cons (purecopy "Indent Right More") 'increase-right-margin))
@@ -245,23 +245,23 @@ when they are created."
245 (define-key map [s1] (list (purecopy "--")))) 245 (define-key map [s1] (list (purecopy "--"))))
246;;;###autoload 246;;;###autoload
247(let ((map facemenu-menu)) 247(let ((map facemenu-menu))
248 (define-key map [in] (cons (purecopy "Indentation") 248 (define-key map [in] (cons (purecopy "Indentation")
249 'facemenu-indentation-menu)) 249 'facemenu-indentation-menu))
250 (define-key map [ju] (cons (purecopy "Justification") 250 (define-key map [ju] (cons (purecopy "Justification")
251 'facemenu-justification-menu)) 251 'facemenu-justification-menu))
252 (define-key map [s2] (list (purecopy "--"))) 252 (define-key map [s2] (list (purecopy "--")))
253 (define-key map [sp] (cons (purecopy "Special Properties") 253 (define-key map [sp] (cons (purecopy "Special Properties")
254 'facemenu-special-menu)) 254 'facemenu-special-menu))
255 (define-key map [bg] (cons (purecopy "Background Color") 255 (define-key map [bg] (cons (purecopy "Background Color")
256 'facemenu-background-menu)) 256 'facemenu-background-menu))
257 (define-key map [fg] (cons (purecopy "Foreground Color") 257 (define-key map [fg] (cons (purecopy "Foreground Color")
258 'facemenu-foreground-menu)) 258 'facemenu-foreground-menu))
259 (define-key map [fc] (cons (purecopy "Face") 259 (define-key map [fc] (cons (purecopy "Face")
260 'facemenu-face-menu))) 260 'facemenu-face-menu)))
261;;;###autoload 261;;;###autoload
262(defalias 'facemenu-menu facemenu-menu) 262(defalias 'facemenu-menu facemenu-menu)
263 263
264(defvar facemenu-keymap 264(defvar facemenu-keymap
265 (let ((map (make-sparse-keymap "Set face"))) 265 (let ((map (make-sparse-keymap "Set face")))
266 (define-key map "o" (cons (purecopy "Other...") 'facemenu-set-face)) 266 (define-key map "o" (cons (purecopy "Other...") 'facemenu-set-face))
267 map) 267 map)
@@ -328,7 +328,7 @@ requested face.
328 328
329Otherwise, this command specifies the face for the next character 329Otherwise, this command specifies the face for the next character
330inserted. Moving point or switching buffers before 330inserted. Moving point or switching buffers before
331typing a character to insert cancels the specification." 331typing a character to insert cancels the specification."
332 (interactive (list (progn 332 (interactive (list (progn
333 (barf-if-buffer-read-only) 333 (barf-if-buffer-read-only)
334 (read-face-name "Use face")) 334 (read-face-name "Use face"))
@@ -350,7 +350,7 @@ requested face.
350 350
351Otherwise, this command specifies the face for the next character 351Otherwise, this command specifies the face for the next character
352inserted. Moving point or switching buffers before 352inserted. Moving point or switching buffers before
353typing a character to insert cancels the specification." 353typing a character to insert cancels the specification."
354 (interactive (list (progn 354 (interactive (list (progn
355 (barf-if-buffer-read-only) 355 (barf-if-buffer-read-only)
356 (facemenu-read-color "Foreground color: ")) 356 (facemenu-read-color "Foreground color: "))
@@ -374,7 +374,7 @@ requested face.
374 374
375Otherwise, this command specifies the face for the next character 375Otherwise, this command specifies the face for the next character
376inserted. Moving point or switching buffers before 376inserted. Moving point or switching buffers before
377typing a character to insert cancels the specification." 377typing a character to insert cancels the specification."
378 (interactive (list (progn 378 (interactive (list (progn
379 (barf-if-buffer-read-only) 379 (barf-if-buffer-read-only)
380 (facemenu-read-color "Background color: ")) 380 (facemenu-read-color "Background color: "))
@@ -399,7 +399,7 @@ requested face.
399 399
400Otherwise, this command specifies the face for the next character 400Otherwise, this command specifies the face for the next character
401inserted. Moving point or switching buffers before 401inserted. Moving point or switching buffers before
402typing a character to insert cancels the specification." 402typing a character to insert cancels the specification."
403 (interactive (list last-command-event 403 (interactive (list last-command-event
404 (if (and mark-active (not current-prefix-arg)) 404 (if (and mark-active (not current-prefix-arg))
405 (region-beginning)) 405 (region-beginning))
@@ -407,7 +407,7 @@ typing a character to insert cancels the specification."
407 (region-end)))) 407 (region-end))))
408 (barf-if-buffer-read-only) 408 (barf-if-buffer-read-only)
409 (facemenu-get-face face) 409 (facemenu-get-face face)
410 (if start 410 (if start
411 (facemenu-add-face face start end) 411 (facemenu-add-face face start end)
412 (facemenu-add-face face))) 412 (facemenu-add-face face)))
413 413
@@ -440,7 +440,7 @@ This sets the `read-only' text property; it can be undone with
440 "Remove `face' and `mouse-face' text properties." 440 "Remove `face' and `mouse-face' text properties."
441 (interactive "*r") ; error if buffer is read-only despite the next line. 441 (interactive "*r") ; error if buffer is read-only despite the next line.
442 (let ((inhibit-read-only t)) 442 (let ((inhibit-read-only t))
443 (remove-text-properties 443 (remove-text-properties
444 start end '(face nil mouse-face nil)))) 444 start end '(face nil mouse-face nil))))
445 445
446;;;###autoload 446;;;###autoload
@@ -456,13 +456,13 @@ This sets the `read-only' text property; it can be undone with
456These special properties include `invisible', `intangible' and `read-only'." 456These special properties include `invisible', `intangible' and `read-only'."
457 (interactive "*r") ; error if buffer is read-only despite the next line. 457 (interactive "*r") ; error if buffer is read-only despite the next line.
458 (let ((inhibit-read-only t)) 458 (let ((inhibit-read-only t))
459 (remove-text-properties 459 (remove-text-properties
460 start end '(invisible nil intangible nil read-only nil)))) 460 start end '(invisible nil intangible nil read-only nil))))
461 461
462;;;###autoload 462;;;###autoload
463(defun facemenu-read-color (&optional prompt) 463(defun facemenu-read-color (&optional prompt)
464 "Read a color using the minibuffer." 464 "Read a color using the minibuffer."
465 (let ((col (completing-read (or prompt "Color: ") 465 (let ((col (completing-read (or prompt "Color: ")
466 (or facemenu-color-alist 466 (or facemenu-color-alist
467 (defined-colors)) 467 (defined-colors))
468 nil t))) 468 nil t)))
@@ -498,11 +498,11 @@ of colors that the current display can handle."
498 (setq s (point)) 498 (setq s (point))
499 (insert (car list)) 499 (insert (car list))
500 (indent-to 20) 500 (indent-to 20)
501 (put-text-property s (point) 'face 501 (put-text-property s (point) 'face
502 (cons 'background-color (car list))) 502 (cons 'background-color (car list)))
503 (setq s (point)) 503 (setq s (point))
504 (insert " " (car list) "\n") 504 (insert " " (car list) "\n")
505 (put-text-property s (point) 'face 505 (put-text-property s (point) 'face
506 (cons 'foreground-color (car list))) 506 (cons 'foreground-color (car list)))
507 (setq list (cdr list))))))) 507 (setq list (cdr list)))))))
508 508
@@ -652,7 +652,7 @@ This is called whenever you create a new face."
652 (define-key 'facemenu-keymap key (cons name function)) 652 (define-key 'facemenu-keymap key (cons name function))
653 (define-key menu key (cons name function))) 653 (define-key menu key (cons name function)))
654 ((facemenu-iterate ; check if equivalent face is already in the menu 654 ((facemenu-iterate ; check if equivalent face is already in the menu
655 (lambda (m) (and (listp m) 655 (lambda (m) (and (listp m)
656 (symbolp (car m)) 656 (symbolp (car m))
657 (face-equal (car m) symbol))) 657 (face-equal (car m) symbol)))
658 (cdr (symbol-function menu)))) 658 (cdr (symbol-function menu))))
@@ -693,7 +693,7 @@ This is called whenever you use a new color."
693 (format "Select background color %s for subsequent insertion." 693 (format "Select background color %s for subsequent insertion."
694 name)))) 694 name))))
695 (cond ((facemenu-iterate ; check if equivalent face is already in the menu 695 (cond ((facemenu-iterate ; check if equivalent face is already in the menu
696 (lambda (m) (and (listp m) 696 (lambda (m) (and (listp m)
697 (symbolp (car m)) 697 (symbolp (car m))
698 (stringp (cadr m)) 698 (stringp (cadr m))
699 (string-equal (cadr m) color))) 699 (string-equal (cadr m) color)))
@@ -711,13 +711,13 @@ This is called whenever you use a new color."
711 711
712(defun facemenu-complete-face-list (&optional oldlist) 712(defun facemenu-complete-face-list (&optional oldlist)
713 "Return list of all faces that look different. 713 "Return list of all faces that look different.
714Starts with given ALIST of faces, and adds elements only if they display 714Starts with given ALIST of faces, and adds elements only if they display
715differently from any face already on the list. 715differently from any face already on the list.
716The faces on ALIST will end up at the end of the returned list, in reverse 716The faces on ALIST will end up at the end of the returned list, in reverse
717order." 717order."
718 (let ((list (nreverse (mapcar 'car oldlist)))) 718 (let ((list (nreverse (mapcar 'car oldlist))))
719 (facemenu-iterate 719 (facemenu-iterate
720 (lambda (new-face) 720 (lambda (new-face)
721 (if (not (memq new-face list)) 721 (if (not (memq new-face list))
722 (setq list (cons new-face list))) 722 (setq list (cons new-face list)))
723 nil) 723 nil)
diff --git a/lisp/ffap.el b/lisp/ffap.el
index 60a700f03ca..56294cf6d81 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -69,7 +69,7 @@
69;; ffap uses `browse-url' (if found, else `w3-fetch') to fetch URL's. 69;; ffap uses `browse-url' (if found, else `w3-fetch') to fetch URL's.
70;; For a hairier `ffap-url-fetcher', try ffap-url.el (same ftp site). 70;; For a hairier `ffap-url-fetcher', try ffap-url.el (same ftp site).
71;; Also, you can add `ffap-menu-rescan' to various hooks to fontify 71;; Also, you can add `ffap-menu-rescan' to various hooks to fontify
72;; the file and URL references within a buffer. 72;; the file and URL references within a buffer.
73 73
74 74
75;;; Change Log: 75;;; Change Log:
diff --git a/lisp/find-dired.el b/lisp/find-dired.el
index 046a2b7dad6..8ea6bbc61da 100644
--- a/lisp/find-dired.el
+++ b/lisp/find-dired.el
@@ -109,7 +109,7 @@ as the final argument."
109 (delete-process find)) 109 (delete-process find))
110 (error nil)) 110 (error nil))
111 (error "Cannot have two processes in `%s' at once" (buffer-name))))) 111 (error "Cannot have two processes in `%s' at once" (buffer-name)))))
112 112
113 (widen) 113 (widen)
114 (kill-all-local-variables) 114 (kill-all-local-variables)
115 (setq buffer-read-only nil) 115 (setq buffer-read-only nil)
@@ -134,7 +134,7 @@ as the final argument."
134 ;; and later) 134 ;; and later)
135 (dired-simple-subdir-alist) 135 (dired-simple-subdir-alist)
136 ;; else we have an ancient tree dired (or classic dired, where 136 ;; else we have an ancient tree dired (or classic dired, where
137 ;; this does no harm) 137 ;; this does no harm)
138 (set (make-local-variable 'dired-subdir-alist) 138 (set (make-local-variable 'dired-subdir-alist)
139 (list (cons default-directory (point-min-marker))))) 139 (list (cons default-directory (point-min-marker)))))
140 (setq buffer-read-only nil) 140 (setq buffer-read-only nil)
@@ -142,7 +142,7 @@ as the final argument."
142 ;; subdir-alist points there. 142 ;; subdir-alist points there.
143 (insert " " dir ":\n") 143 (insert " " dir ":\n")
144 ;; Make second line a ``find'' line in analogy to the ``total'' or 144 ;; Make second line a ``find'' line in analogy to the ``total'' or
145 ;; ``wildcard'' line. 145 ;; ``wildcard'' line.
146 (insert " " args "\n") 146 (insert " " args "\n")
147 ;; Start the find process. 147 ;; Start the find process.
148 (let ((proc (start-process-shell-command find-dired-find-program (current-buffer) args))) 148 (let ((proc (start-process-shell-command find-dired-find-program (current-buffer) args)))
diff --git a/lisp/find-file.el b/lisp/find-file.el
index b4db74da756..259a85fa62a 100644
--- a/lisp/find-file.el
+++ b/lisp/find-file.el
@@ -70,9 +70,9 @@
70;; ("\\.hh$" ff-cc-hh-converter) 70;; ("\\.hh$" ff-cc-hh-converter)
71;; ("\\.c$" (".h")) 71;; ("\\.c$" (".h"))
72;; ("\\.h$" (".c" ".cc" ".C" ".CC" ".cxx" ".cpp")))) 72;; ("\\.h$" (".c" ".cc" ".C" ".CC" ".cxx" ".cpp"))))
73;; 73;;
74;; ff-cc-hh-converter is included at the end of this file as a reference. 74;; ff-cc-hh-converter is included at the end of this file as a reference.
75;; 75;;
76;; SEARCHING is carried out in a set of directories specified by the 76;; SEARCHING is carried out in a set of directories specified by the
77;; ff-search-directories variable: 77;; ff-search-directories variable:
78;; 78;;
@@ -500,12 +500,12 @@ If optional IN-OTHER-WINDOW is non-nil, find the file in another window."
500 (read-file-name 500 (read-file-name
501 (format "Find or create %s in: " default-name) 501 (format "Find or create %s in: " default-name)
502 default-directory default-name nil))) 502 default-directory default-name nil)))
503 503
504 (setq pathname 504 (setq pathname
505 (if (file-directory-p name) 505 (if (file-directory-p name)
506 (concat (file-name-as-directory name) default-name) 506 (concat (file-name-as-directory name) default-name)
507 (setq found name))) 507 (setq found name)))
508 508
509 (ff-find-file pathname in-other-window t))) 509 (ff-find-file pathname in-other-window t)))
510 510
511 (t ;; don't create the file, just whinge 511 (t ;; don't create the file, just whinge
@@ -619,7 +619,7 @@ If (optional) SUFFIX-LIST is nil, search for fname, otherwise search
619for fname with each of the given suffixes. Get the file or the buffer 619for fname with each of the given suffixes. Get the file or the buffer
620corresponding to the name of the first file found, or nil." 620corresponding to the name of the first file found, or nil."
621 (let ((filename (ff-get-file-name search-dirs filename suffix-list))) 621 (let ((filename (ff-get-file-name search-dirs filename suffix-list)))
622 622
623 (cond 623 (cond
624 ((not filename) 624 ((not filename)
625 nil) 625 nil)
@@ -627,7 +627,7 @@ corresponding to the name of the first file found, or nil."
627 ((bufferp (get-file-buffer filename)) 627 ((bufferp (get-file-buffer filename))
628 (ff-switch-to-buffer (get-file-buffer filename) other-window) 628 (ff-switch-to-buffer (get-file-buffer filename) other-window)
629 filename) 629 filename)
630 630
631 ((file-exists-p filename) 631 ((file-exists-p filename)
632 (ff-find-file filename other-window nil) 632 (ff-find-file filename other-window nil)
633 filename) 633 filename)
@@ -659,7 +659,7 @@ name of the first file found."
659 (setq this-suffix (car suffixes)) 659 (setq this-suffix (car suffixes))
660 (setq this-suffix "") 660 (setq this-suffix "")
661 (setq suffixes (list ""))) 661 (setq suffixes (list "")))
662 662
663 ;; find whether the file is in a buffer first 663 ;; find whether the file is in a buffer first
664 (while (and suffixes (not found)) 664 (while (and suffixes (not found))
665 (setq filename (concat fname-stub this-suffix)) 665 (setq filename (concat fname-stub this-suffix))
@@ -693,25 +693,25 @@ name of the first file found."
693 ;; if dir does not contain '/*', look for the file 693 ;; if dir does not contain '/*', look for the file
694 (if (and dir (not (string-match "\\([^*]*\\)/\\\*\\(/.*\\)*" dir))) 694 (if (and dir (not (string-match "\\([^*]*\\)/\\\*\\(/.*\\)*" dir)))
695 (progn 695 (progn
696 696
697 ;; suffixes is nil => fname-stub is the file we are looking for 697 ;; suffixes is nil => fname-stub is the file we are looking for
698 ;; otherwise fname-stub is a stub, and we append a suffix 698 ;; otherwise fname-stub is a stub, and we append a suffix
699 (if suffixes 699 (if suffixes
700 (setq this-suffix (car suffixes)) 700 (setq this-suffix (car suffixes))
701 (setq this-suffix "") 701 (setq this-suffix "")
702 (setq suffixes (list ""))) 702 (setq suffixes (list "")))
703 703
704 (while (and suffixes (not found)) 704 (while (and suffixes (not found))
705 705
706 (setq filename (concat fname-stub this-suffix)) 706 (setq filename (concat fname-stub this-suffix))
707 (setq file (concat dir "/" filename)) 707 (setq file (concat dir "/" filename))
708 708
709 (if (not ff-quiet-mode) 709 (if (not ff-quiet-mode)
710 (message "Finding %s..." file)) 710 (message "Finding %s..." file))
711 711
712 (if (file-exists-p file) 712 (if (file-exists-p file)
713 (setq found file)) 713 (setq found file))
714 714
715 (setq suffixes (cdr suffixes)) 715 (setq suffixes (cdr suffixes))
716 (setq this-suffix (car suffixes)))) 716 (setq this-suffix (car suffixes))))
717 717
@@ -935,7 +935,7 @@ and the name of the file passed in."
935 )) 935 ))
936 (t 936 (t
937 nil)) 937 nil))
938 938
939 return-list)) 939 return-list))
940 940
941;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 941;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/lisp/flow-ctrl.el b/lisp/flow-ctrl.el
index f98ecaa0fb9..44b496357a4 100644
--- a/lisp/flow-ctrl.el
+++ b/lisp/flow-ctrl.el
@@ -29,14 +29,14 @@
29;; Terminals that use XON/XOFF flow control can cause problems with 29;; Terminals that use XON/XOFF flow control can cause problems with
30;; GNU Emacs users. This file contains Emacs Lisp code that makes it 30;; GNU Emacs users. This file contains Emacs Lisp code that makes it
31;; easy for a user to deal with this problem, when using such a 31;; easy for a user to deal with this problem, when using such a
32;; terminal. 32;; terminal.
33;; 33;;
34;; To invoke these adjustments, a user need only invoke the function 34;; To invoke these adjustments, a user need only invoke the function
35;; enable-flow-control-on with a list of terminal types in his/her own 35;; enable-flow-control-on with a list of terminal types in his/her own
36;; .emacs file. As arguments, give it the names of one or more terminal 36;; .emacs file. As arguments, give it the names of one or more terminal
37;; types in use by that user which require flow control adjustments. 37;; types in use by that user which require flow control adjustments.
38;; Here's an example: 38;; Here's an example:
39;; 39;;
40;; (enable-flow-control-on "vt200" "vt300" "vt101" "vt131") 40;; (enable-flow-control-on "vt200" "vt300" "vt101" "vt131")
41 41
42;; Portability note: This uses (getenv "TERM"), and therefore probably 42;; Portability note: This uses (getenv "TERM"), and therefore probably
@@ -96,7 +96,7 @@ With arg, enable flow control mode if arg is positive, otherwise disable."
96 (aset keyboard-translate-table flow-control-c-q-replacement ?\^q) 96 (aset keyboard-translate-table flow-control-c-q-replacement ?\^q)
97 (aset keyboard-translate-table ?\^q flow-control-c-q-replacement) 97 (aset keyboard-translate-table ?\^q flow-control-c-q-replacement)
98 (message "XON/XOFF adjustment for %s: use %s for C-s, and use %s for C-q" 98 (message "XON/XOFF adjustment for %s: use %s for C-s, and use %s for C-q"
99 (getenv "TERM") 99 (getenv "TERM")
100 (single-key-description flow-control-c-s-replacement) 100 (single-key-description flow-control-c-s-replacement)
101 (single-key-description flow-control-c-q-replacement)) 101 (single-key-description flow-control-c-q-replacement))
102 (sleep-for 2))) ; Give user a chance to see message. 102 (sleep-for 2))) ; Give user a chance to see message.
diff --git a/lisp/foldout.el b/lisp/foldout.el
index f1905b79a73..21f2208723b 100644
--- a/lisp/foldout.el
+++ b/lisp/foldout.el
@@ -318,7 +318,7 @@ exited and text is left visible."
318 ;; catch a request to leave all folds 318 ;; catch a request to leave all folds
319 ((zerop num-folds) 319 ((zerop num-folds)
320 (setq num-folds (length foldout-fold-list))) 320 (setq num-folds (length foldout-fold-list)))
321 321
322 ;; have we been told not to hide the fold? 322 ;; have we been told not to hide the fold?
323 ((< num-folds 0) 323 ((< num-folds 0)
324 (setq hide-fold nil 324 (setq hide-fold nil
diff --git a/lisp/font-core.el b/lisp/font-core.el
index 0554d657497..c2c95bfe8a0 100644
--- a/lisp/font-core.el
+++ b/lisp/font-core.el
@@ -272,7 +272,7 @@ this function onto `change-major-mode-hook'."
272 (remove-hook 'after-change-functions 'font-lock-after-change-function t) 272 (remove-hook 'after-change-functions 'font-lock-after-change-function t)
273 (font-lock-unfontify-buffer) 273 (font-lock-unfontify-buffer)
274 (font-lock-turn-off-thing-lock)))) 274 (font-lock-turn-off-thing-lock))))
275 275
276(defun turn-on-font-lock () 276(defun turn-on-font-lock ()
277 "Turn on Font Lock mode (only if the terminal can display it)." 277 "Turn on Font Lock mode (only if the terminal can display it)."
278 (unless font-lock-mode 278 (unless font-lock-mode
diff --git a/lisp/format.el b/lisp/format.el
index 0d538c25df7..c9259fd31a4 100644
--- a/lisp/format.el
+++ b/lisp/format.el
@@ -258,7 +258,7 @@ For most purposes, consider using `format-decode-region' instead."
258 (unwind-protect 258 (unwind-protect
259 (progn 259 (progn
260 ;; Don't record undo information for the decoding. 260 ;; Don't record undo information for the decoding.
261 261
262 (if (null format) 262 (if (null format)
263 ;; Figure out which format it is in, remember list in `format'. 263 ;; Figure out which format it is in, remember list in `format'.
264 (let ((try format-alist)) 264 (let ((try format-alist))
@@ -296,7 +296,7 @@ For most purposes, consider using `format-decode-region' instead."
296 (setq format (reverse format))) 296 (setq format (reverse format)))
297 (if visit-flag 297 (if visit-flag
298 (setq buffer-file-format format))) 298 (setq buffer-file-format format)))
299 299
300 (set-buffer-modified-p mod)) 300 (set-buffer-modified-p mod))
301 301
302 ;; Return new length of region 302 ;; Return new length of region
@@ -486,7 +486,7 @@ the value of `foo'."
486 ;; Now (cdr p) is the cons to delete 486 ;; Now (cdr p) is the cons to delete
487 (setcdr p (cdr cons)) 487 (setcdr p (cdr cons))
488 list))) 488 list)))
489 489
490(defun format-make-relatively-unique (a b) 490(defun format-make-relatively-unique (a b)
491 "Delete common elements of lists A and B, return as pair. 491 "Delete common elements of lists A and B, return as pair.
492Compares using `equal'." 492Compares using `equal'."
diff --git a/lisp/forms-d2.el b/lisp/forms-d2.el
index e603927e027..ae338abf108 100644
--- a/lisp/forms-d2.el
+++ b/lisp/forms-d2.el
@@ -40,7 +40,7 @@ The optional FILL should be a character, used to fill to the column."
40 (concat "\n" (make-string target fill)) 40 (concat "\n" (make-string target fill))
41 (make-string (- target (current-column)) fill))) 41 (make-string (- target (current-column)) fill)))
42;; 42;;
43(defun arch-rj (target field &optional fill) 43(defun arch-rj (target field &optional fill)
44 "Produces a string to skip to column TARGET minus the width of field FIELD. 44 "Produces a string to skip to column TARGET minus the width of field FIELD.
45Prepends newline if needed. The optional FILL should be a character, 45Prepends newline if needed. The optional FILL should be a character,
46used to fill to the column." 46used to fill to the column."
diff --git a/lisp/forms.el b/lisp/forms.el
index 975b030ad56..c3cffa3d4e3 100644
--- a/lisp/forms.el
+++ b/lisp/forms.el
@@ -31,9 +31,9 @@
31;; Names which start with 'forms--' are intended for internal use, and 31;; Names which start with 'forms--' are intended for internal use, and
32;; should *NOT* be used from the outside. 32;; should *NOT* be used from the outside.
33;; 33;;
34;; All variables are buffer-local, to enable multiple forms visits 34;; All variables are buffer-local, to enable multiple forms visits
35;; simultaneously. 35;; simultaneously.
36;; Variable `forms--mode-setup' is local to *ALL* buffers, for it 36;; Variable `forms--mode-setup' is local to *ALL* buffers, for it
37;; controls if forms-mode has been enabled in a buffer. 37;; controls if forms-mode has been enabled in a buffer.
38;; 38;;
39;; === How it works === 39;; === How it works ===
@@ -60,9 +60,9 @@
60;; You may also visit the control file, and switch to forms mode by hand 60;; You may also visit the control file, and switch to forms mode by hand
61;; with M-x `forms-mode'. 61;; with M-x `forms-mode'.
62;; 62;;
63;; Automatic mode switching is supported if you specify 63;; Automatic mode switching is supported if you specify
64;; "-*- forms -*-" in the first line of the control file. 64;; "-*- forms -*-" in the first line of the control file.
65;; 65;;
66;; The control file is visited, evaluated using `eval-current-buffer', 66;; The control file is visited, evaluated using `eval-current-buffer',
67;; and should set at least the following variables: 67;; and should set at least the following variables:
68;; 68;;
@@ -79,17 +79,17 @@
79;; 79;;
80;; - a string, e.g. "hello". The string is inserted in the forms 80;; - a string, e.g. "hello". The string is inserted in the forms
81;; "as is". 81;; "as is".
82;; 82;;
83;; - an integer, denoting a field number. 83;; - an integer, denoting a field number.
84;; The contents of this field are inserted at this point. 84;; The contents of this field are inserted at this point.
85;; Fields are numbered starting with number one. 85;; Fields are numbered starting with number one.
86;; 86;;
87;; - a function call, e.g. (insert "text"). 87;; - a function call, e.g. (insert "text").
88;; This function call is dynamically evaluated and should return a 88;; This function call is dynamically evaluated and should return a
89;; string. It should *NOT* have side-effects on the forms being 89;; string. It should *NOT* have side-effects on the forms being
90;; constructed. The current fields are available to the function 90;; constructed. The current fields are available to the function
91;; in the variable `forms-fields', they should *NOT* be modified. 91;; in the variable `forms-fields', they should *NOT* be modified.
92;; 92;;
93;; - a lisp symbol, that must evaluate to one of the above. 93;; - a lisp symbol, that must evaluate to one of the above.
94;; 94;;
95;; Optional variables which may be set in the control file: 95;; Optional variables which may be set in the control file:
@@ -102,7 +102,7 @@
102;; Non-nil means that the data file is visited 102;; Non-nil means that the data file is visited
103;; read-only (view mode) as opposed to edit mode. 103;; read-only (view mode) as opposed to edit mode.
104;; If no write access to the data file is 104;; If no write access to the data file is
105;; possible, view mode is enforced. 105;; possible, view mode is enforced.
106;; 106;;
107;; forms-check-number-of-fields [bool, default t] 107;; forms-check-number-of-fields [bool, default t]
108;; If non-nil, a warning will be issued whenever 108;; If non-nil, a warning will be issued whenever
@@ -138,26 +138,26 @@
138;; first record. 138;; first record.
139;; 139;;
140;; forms-read-file-filter [symbol, default nil] 140;; forms-read-file-filter [symbol, default nil]
141;; If not nil: this should be the name of a 141;; If not nil: this should be the name of a
142;; function that is called after the forms data file 142;; function that is called after the forms data file
143;; has been read. It can be used to transform 143;; has been read. It can be used to transform
144;; the contents of the file into a format more suitable 144;; the contents of the file into a format more suitable
145;; for forms-mode processing. 145;; for forms-mode processing.
146;; 146;;
147;; forms-write-file-filter [symbol, default nil] 147;; forms-write-file-filter [symbol, default nil]
148;; If not nil: this should be the name of a 148;; If not nil: this should be the name of a
149;; function that is called before the forms data file 149;; function that is called before the forms data file
150;; is written (saved) to disk. It can be used to undo 150;; is written (saved) to disk. It can be used to undo
151;; the effects of `forms-read-file-filter', if any. 151;; the effects of `forms-read-file-filter', if any.
152;; 152;;
153;; forms-new-record-filter [symbol, default nil] 153;; forms-new-record-filter [symbol, default nil]
154;; If not nil: this should be the name of a 154;; If not nil: this should be the name of a
155;; function that is called when a new 155;; function that is called when a new
156;; record is created. It can be used to fill in 156;; record is created. It can be used to fill in
157;; the new record with default fields, for example. 157;; the new record with default fields, for example.
158;; 158;;
159;; forms-modified-record-filter [symbol, default nil] 159;; forms-modified-record-filter [symbol, default nil]
160;; If not nil: this should be the name of a 160;; If not nil: this should be the name of a
161;; function that is called when a record has 161;; function that is called when a record has
162;; been modified. It is called after the fields 162;; been modified. It is called after the fields
163;; are parsed. It can be used to register 163;; are parsed. It can be used to register
@@ -199,7 +199,7 @@
199;; Normal operation is to transfer one line (record) from the data file, 199;; Normal operation is to transfer one line (record) from the data file,
200;; split it into fields (into `forms--the-record-list'), and display it 200;; split it into fields (into `forms--the-record-list'), and display it
201;; using the specs in `forms-format-list'. 201;; using the specs in `forms-format-list'.
202;; A format routine `forms--format' is built upon startup to format 202;; A format routine `forms--format' is built upon startup to format
203;; the records according to `forms-format-list'. 203;; the records according to `forms-format-list'.
204;; 204;;
205;; When a form is changed the record is updated as soon as this form 205;; When a form is changed the record is updated as soon as this form
@@ -236,7 +236,7 @@
236;; contents of the buffer. 236;; contents of the buffer.
237;; 237;;
238;; Edit mode commands: 238;; Edit mode commands:
239;; 239;;
240;; TAB forms-next-field 240;; TAB forms-next-field
241;; \C-c TAB forms-next-field 241;; \C-c TAB forms-next-field
242;; \C-c < forms-first-record 242;; \C-c < forms-first-record
@@ -251,9 +251,9 @@
251;; \C-c \C-r forms-search-backward 251;; \C-c \C-r forms-search-backward
252;; \C-c \C-s forms-search-forward 252;; \C-c \C-s forms-search-forward
253;; \C-c \C-x forms-exit 253;; \C-c \C-x forms-exit
254;; 254;;
255;; Read-only mode commands: 255;; Read-only mode commands:
256;; 256;;
257;; SPC forms-next-record 257;; SPC forms-next-record
258;; DEL forms-prev-record 258;; DEL forms-prev-record
259;; ? describe-mode 259;; ? describe-mode
@@ -264,12 +264,12 @@
264;; r forms-search-backward 264;; r forms-search-backward
265;; s forms-search-forward 265;; s forms-search-forward
266;; x forms-exit 266;; x forms-exit
267;; 267;;
268;; Of course, it is also possible to use the \C-c prefix to obtain the 268;; Of course, it is also possible to use the \C-c prefix to obtain the
269;; same command keys as in edit mode. 269;; same command keys as in edit mode.
270;; 270;;
271;; The following bindings are available, independent of the mode: 271;; The following bindings are available, independent of the mode:
272;; 272;;
273;; [next] forms-next-record 273;; [next] forms-next-record
274;; [prior] forms-prev-record 274;; [prior] forms-prev-record
275;; [begin] forms-first-record 275;; [begin] forms-first-record
@@ -301,10 +301,10 @@
301(provide 'forms) ;;; official 301(provide 'forms) ;;; official
302(provide 'forms-mode) ;;; for compatibility 302(provide 'forms-mode) ;;; for compatibility
303 303
304(defconst forms-version (substring "$Revision: 2.43 $" 11 -2) 304(defconst forms-version (substring "$Revision: 2.44 $" 11 -2)
305 "The version number of forms-mode (as string). The complete RCS id is: 305 "The version number of forms-mode (as string). The complete RCS id is:
306 306
307 $Id: forms.el,v 2.43 2002/05/18 08:04:49 pj Exp $") 307 $Id: forms.el,v 2.44 2003/01/12 20:47:48 schwab Exp $")
308 308
309(defcustom forms-mode-hooks nil 309(defcustom forms-mode-hooks nil
310 "Hook run upon entering Forms mode." 310 "Hook run upon entering Forms mode."
@@ -368,7 +368,7 @@ This can be used to undo the effects of `form-read-file-hook'.")
368 368
369(defvar forms-fields nil 369(defvar forms-fields nil
370 "List with fields of the current forms. First field has number 1. 370 "List with fields of the current forms. First field has number 1.
371This variable is for use by the filter routines only. 371This variable is for use by the filter routines only.
372The contents may NOT be modified.") 372The contents may NOT be modified.")
373 373
374(defcustom forms-use-text-properties t 374(defcustom forms-use-text-properties t
@@ -417,7 +417,7 @@ Also, initial position is at last record."
417(defvar forms--dyntexts nil 417(defvar forms--dyntexts nil
418 "Dynamic texts (resulting from function calls) on the screen.") 418 "Dynamic texts (resulting from function calls) on the screen.")
419 419
420(defvar forms--the-record-list nil 420(defvar forms--the-record-list nil
421 "List of strings of the current record, as parsed from the file.") 421 "List of strings of the current record, as parsed from the file.")
422 422
423(defvar forms--search-regexp nil 423(defvar forms--search-regexp nil
@@ -445,13 +445,13 @@ Also, initial position is at last record."
445(defvar forms--rw-face nil 445(defvar forms--rw-face nil
446 "Face used to represent read-write data on the screen.") 446 "Face used to represent read-write data on the screen.")
447 447
448;;;###autoload 448;;;###autoload
449(defun forms-mode (&optional primary) 449(defun forms-mode (&optional primary)
450 "Major mode to visit files in a field-structured manner using a form. 450 "Major mode to visit files in a field-structured manner using a form.
451 451
452Commands: Equivalent keys in read-only mode: 452Commands: Equivalent keys in read-only mode:
453 TAB forms-next-field TAB 453 TAB forms-next-field TAB
454 C-c TAB forms-next-field 454 C-c TAB forms-next-field
455 C-c < forms-first-record < 455 C-c < forms-first-record <
456 C-c > forms-last-record > 456 C-c > forms-last-record >
457 C-c ? describe-mode ? 457 C-c ? describe-mode ?
@@ -510,7 +510,7 @@ Commands: Equivalent keys in read-only mode:
510 (setq forms-new-record-filter nil) 510 (setq forms-new-record-filter nil)
511 (setq forms-modified-record-filter nil) 511 (setq forms-modified-record-filter nil)
512 512
513 ;; If running Emacs 19 under X, setup faces to show read-only and 513 ;; If running Emacs 19 under X, setup faces to show read-only and
514 ;; read-write fields. 514 ;; read-write fields.
515 (if (fboundp 'make-face) 515 (if (fboundp 'make-face)
516 (progn 516 (progn
@@ -521,7 +521,7 @@ Commands: Equivalent keys in read-only mode:
521 ;;(message "forms: processing control file...") 521 ;;(message "forms: processing control file...")
522 ;; If enable-local-eval is not set to t the user is asked first. 522 ;; If enable-local-eval is not set to t the user is asked first.
523 (if (or (eq enable-local-eval t) 523 (if (or (eq enable-local-eval t)
524 (yes-or-no-p 524 (yes-or-no-p
525 (concat "Evaluate lisp code in buffer " 525 (concat "Evaluate lisp code in buffer "
526 (buffer-name) " to display forms "))) 526 (buffer-name) " to display forms ")))
527 (eval-current-buffer) 527 (eval-current-buffer)
@@ -529,7 +529,7 @@ Commands: Equivalent keys in read-only mode:
529 529
530 ;; Check if the mandatory variables make sense. 530 ;; Check if the mandatory variables make sense.
531 (or forms-file 531 (or forms-file
532 (error (concat "Forms control file error: " 532 (error (concat "Forms control file error: "
533 "`forms-file' has not been set"))) 533 "`forms-file' has not been set")))
534 534
535 ;; Check forms-field-sep first, since it can be needed to 535 ;; Check forms-field-sep first, since it can be needed to
@@ -554,13 +554,13 @@ Commands: Equivalent keys in read-only mode:
554 (if (and (stringp forms-multi-line) 554 (if (and (stringp forms-multi-line)
555 (eq (length forms-multi-line) 1)) 555 (eq (length forms-multi-line) 1))
556 (if (string= forms-multi-line forms-field-sep) 556 (if (string= forms-multi-line forms-field-sep)
557 (error (concat "Forms control file error: " 557 (error (concat "Forms control file error: "
558 "`forms-multi-line' is equal to 'forms-field-sep'"))) 558 "`forms-multi-line' is equal to 'forms-field-sep'")))
559 (error (concat "Forms control file error: " 559 (error (concat "Forms control file error: "
560 "`forms-multi-line' must be nil or a one-character string")))) 560 "`forms-multi-line' must be nil or a one-character string"))))
561 (or (fboundp 'set-text-properties) 561 (or (fboundp 'set-text-properties)
562 (setq forms-use-text-properties nil)) 562 (setq forms-use-text-properties nil))
563 563
564 ;; Validate and process forms-format-list. 564 ;; Validate and process forms-format-list.
565 ;;(message "forms: pre-processing format list...") 565 ;;(message "forms: pre-processing format list...")
566 (make-local-variable 'forms--elements) 566 (make-local-variable 'forms--elements)
@@ -699,7 +699,7 @@ Commands: Equivalent keys in read-only mode:
699 (if (= forms--total-records 0) 699 (if (= forms--total-records 0)
700 ;;(message "forms: proceeding setup (new file)...") 700 ;;(message "forms: proceeding setup (new file)...")
701 (progn 701 (progn
702 (insert 702 (insert
703 "GNU Emacs Forms Mode version " forms-version "\n\n" 703 "GNU Emacs Forms Mode version " forms-version "\n\n"
704 (if (file-exists-p forms-file) 704 (if (file-exists-p forms-file)
705 (concat "No records available in file `" forms-file "'\n\n") 705 (concat "No records available in file `" forms-file "'\n\n")
@@ -736,7 +736,7 @@ Commands: Equivalent keys in read-only mode:
736 ;; Symbols in the list are evaluated, and consecutive strings are 736 ;; Symbols in the list are evaluated, and consecutive strings are
737 ;; concatenated. 737 ;; concatenated.
738 ;; Array `forms--elements' is constructed that contains the order 738 ;; Array `forms--elements' is constructed that contains the order
739 ;; of the fields on the display. This array is used by 739 ;; of the fields on the display. This array is used by
740 ;; `forms--parser-using-text-properties' to extract the fields data 740 ;; `forms--parser-using-text-properties' to extract the fields data
741 ;; from the form on the screen. 741 ;; from the form on the screen.
742 ;; Upon completion, `forms-format-list' is guaranteed correct, so 742 ;; Upon completion, `forms-format-list' is guaranteed correct, so
@@ -759,7 +759,7 @@ Commands: Equivalent keys in read-only mode:
759 (let ((the-list forms-format-list) ; the list of format elements 759 (let ((the-list forms-format-list) ; the list of format elements
760 (this-item 0) ; element in list 760 (this-item 0) ; element in list
761 (prev-item nil) 761 (prev-item nil)
762 (field-num 0)) ; highest field number 762 (field-num 0)) ; highest field number
763 763
764 (setq forms-format-list nil) ; gonna rebuild 764 (setq forms-format-list nil) ; gonna rebuild
765 765
@@ -785,7 +785,7 @@ Commands: Equivalent keys in read-only mode:
785 (setq prev-item el))) 785 (setq prev-item el)))
786 786
787 ;; Try numeric ... 787 ;; Try numeric ...
788 ((numberp el) 788 ((numberp el)
789 789
790 ;; Validate range. 790 ;; Validate range.
791 (if (or (<= el 0) 791 (if (or (<= el 0)
@@ -862,8 +862,8 @@ Commands: Equivalent keys in read-only mode:
862(defun forms--iif-hook (begin end) 862(defun forms--iif-hook (begin end)
863 "`insert-in-front-hooks' function for read-only segments." 863 "`insert-in-front-hooks' function for read-only segments."
864 864
865 ;; Note start location. By making it a marker that points one 865 ;; Note start location. By making it a marker that points one
866 ;; character beyond the actual location, it is guaranteed to move 866 ;; character beyond the actual location, it is guaranteed to move
867 ;; correctly if text is inserted. 867 ;; correctly if text is inserted.
868 (or forms--iif-start 868 (or forms--iif-start
869 (setq forms--iif-start (copy-marker (1+ (point))))) 869 (setq forms--iif-start (copy-marker (1+ (point)))))
@@ -874,12 +874,12 @@ Commands: Equivalent keys in read-only mode:
874 'read-only)) 874 'read-only))
875 (progn 875 (progn
876 ;; Fetch current properties. 876 ;; Fetch current properties.
877 (setq forms--iif-properties 877 (setq forms--iif-properties
878 (text-properties-at (1- forms--iif-start))) 878 (text-properties-at (1- forms--iif-start)))
879 879
880 ;; Replace them. 880 ;; Replace them.
881 (let ((inhibit-read-only t)) 881 (let ((inhibit-read-only t))
882 (set-text-properties 882 (set-text-properties
883 (1- forms--iif-start) forms--iif-start 883 (1- forms--iif-start) forms--iif-start
884 (list 'face forms--rw-face 'front-sticky '(face)))) 884 (list 'face forms--rw-face 'front-sticky '(face))))
885 885
@@ -900,7 +900,7 @@ Commands: Equivalent keys in read-only mode:
900 ;; Restore properties. 900 ;; Restore properties.
901 (if forms--iif-start 901 (if forms--iif-start
902 (let ((inhibit-read-only t)) 902 (let ((inhibit-read-only t))
903 (set-text-properties 903 (set-text-properties
904 (1- forms--iif-start) forms--iif-start 904 (1- forms--iif-start) forms--iif-start
905 forms--iif-properties))) 905 forms--iif-properties)))
906 906
@@ -920,9 +920,9 @@ Commands: Equivalent keys in read-only mode:
920 920
921 (let ((forms--marker 0) 921 (let ((forms--marker 0)
922 (forms--dyntext 0)) 922 (forms--dyntext 0))
923 (setq 923 (setq
924 forms--format 924 forms--format
925 (if forms-use-text-properties 925 (if forms-use-text-properties
926 `(lambda (arg) 926 `(lambda (arg)
927 (let ((inhibit-read-only t)) 927 (let ((inhibit-read-only t))
928 ,@(apply 'append 928 ,@(apply 'append
@@ -957,9 +957,9 @@ Commands: Equivalent keys in read-only mode:
957 ;; (let ((inhibit-read-only t)) 957 ;; (let ((inhibit-read-only t))
958 ;; 958 ;;
959 ;; ;; A string, e.g. "text: ". 959 ;; ;; A string, e.g. "text: ".
960 ;; (set-text-properties 960 ;; (set-text-properties
961 ;; (point) 961 ;; (point)
962 ;; (progn (insert "text: ") (point)) 962 ;; (progn (insert "text: ") (point))
963 ;; (list 'face forms--ro-face 963 ;; (list 'face forms--ro-face
964 ;; 'read-only 1 964 ;; 'read-only 1
965 ;; 'insert-in-front-hooks 'forms--iif-hook 965 ;; 'insert-in-front-hooks 'forms--iif-hook
@@ -970,7 +970,7 @@ Commands: Equivalent keys in read-only mode:
970 ;; (aset forms--markers 0 (point-marker)) 970 ;; (aset forms--markers 0 (point-marker))
971 ;; (insert (elt arg 5)) 971 ;; (insert (elt arg 5))
972 ;; (or (= (point) here) 972 ;; (or (= (point) here)
973 ;; (set-text-properties 973 ;; (set-text-properties
974 ;; here (point) 974 ;; here (point)
975 ;; (list 'face forms--rw-face 975 ;; (list 'face forms--rw-face
976 ;; 'front-sticky '(face)))) 976 ;; 'front-sticky '(face))))
@@ -1008,8 +1008,8 @@ Commands: Equivalent keys in read-only mode:
1008 1008
1009 (cond 1009 (cond
1010 ((stringp el) 1010 ((stringp el)
1011 1011
1012 `((set-text-properties 1012 `((set-text-properties
1013 (point) ; start at point 1013 (point) ; start at point
1014 (progn ; until after insertion 1014 (progn ; until after insertion
1015 (insert ,el) 1015 (insert ,el)
@@ -1020,16 +1020,16 @@ Commands: Equivalent keys in read-only mode:
1020 'insert-in-front-hooks '(forms--iif-hook) 1020 'insert-in-front-hooks '(forms--iif-hook)
1021 'rear-nonsticky '(face read-only insert-in-front-hooks 1021 'rear-nonsticky '(face read-only insert-in-front-hooks
1022 intangible))))) 1022 intangible)))))
1023 1023
1024 ((numberp el) 1024 ((numberp el)
1025 `((let ((here (point))) 1025 `((let ((here (point)))
1026 (aset forms--markers 1026 (aset forms--markers
1027 ,(prog1 forms--marker 1027 ,(prog1 forms--marker
1028 (setq forms--marker (1+ forms--marker))) 1028 (setq forms--marker (1+ forms--marker)))
1029 (point-marker)) 1029 (point-marker))
1030 (insert (elt arg ,(1- el))) 1030 (insert (elt arg ,(1- el)))
1031 (or (= (point) here) 1031 (or (= (point) here)
1032 (set-text-properties 1032 (set-text-properties
1033 here (point) 1033 here (point)
1034 (list 'face forms--rw-face 1034 (list 'face forms--rw-face
1035 'front-sticky '(face))))))) 1035 'front-sticky '(face)))))))
@@ -1038,7 +1038,7 @@ Commands: Equivalent keys in read-only mode:
1038 `((set-text-properties 1038 `((set-text-properties
1039 (point) 1039 (point)
1040 (progn 1040 (progn
1041 (insert (aset forms--dyntexts 1041 (insert (aset forms--dyntexts
1042 ,(prog1 forms--dyntext 1042 ,(prog1 forms--dyntext
1043 (setq forms--dyntext (1+ forms--dyntext))) 1043 (setq forms--dyntext (1+ forms--dyntext)))
1044 ,el)) 1044 ,el))
@@ -1071,7 +1071,7 @@ Commands: Equivalent keys in read-only mode:
1071 ;; (insert (aset forms--dyntexts 0 (tocol 40))) 1071 ;; (insert (aset forms--dyntexts 0 (tocol 40)))
1072 ;; ... ) 1072 ;; ... )
1073 1073
1074 (cond 1074 (cond
1075 ((stringp el) 1075 ((stringp el)
1076 `((insert ,el))) 1076 `((insert ,el)))
1077 ((numberp el) 1077 ((numberp el)
@@ -1110,8 +1110,8 @@ Commands: Equivalent keys in read-only mode:
1110 (let (here) 1110 (let (here)
1111 (goto-char (point-min)) 1111 (goto-char (point-min))
1112 ,@(apply 'append 1112 ,@(apply 'append
1113 (mapcar 1113 (mapcar
1114 'forms--make-parser-elt 1114 'forms--make-parser-elt
1115 (append forms-format-list (list nil))))))))) 1115 (append forms-format-list (list nil)))))))))
1116 1116
1117 (forms--debug 'forms--parser)) 1117 (forms--debug 'forms--parser))
@@ -1128,7 +1128,7 @@ Commands: Equivalent keys in read-only mode:
1128 (goto-char (setq here (aref forms--markers i))) 1128 (goto-char (setq here (aref forms--markers i)))
1129 (if (get-text-property here 'read-only) 1129 (if (get-text-property here 'read-only)
1130 (aset forms--recordv (aref forms--elements i) nil) 1130 (aset forms--recordv (aref forms--elements i) nil)
1131 (if (setq there 1131 (if (setq there
1132 (next-single-property-change here 'read-only)) 1132 (next-single-property-change here 'read-only))
1133 (aset forms--recordv (aref forms--elements i) 1133 (aset forms--recordv (aref forms--elements i)
1134 (buffer-substring-no-properties here there)) 1134 (buffer-substring-no-properties here there))
@@ -1144,12 +1144,12 @@ Commands: Equivalent keys in read-only mode:
1144 ;; (lambda nil 1144 ;; (lambda nil
1145 ;; (let (here) 1145 ;; (let (here)
1146 ;; (goto-char (point-min)) 1146 ;; (goto-char (point-min))
1147 ;; 1147 ;;
1148 ;; ;; "text: " 1148 ;; ;; "text: "
1149 ;; (if (not (looking-at "text: ")) 1149 ;; (if (not (looking-at "text: "))
1150 ;; (error "Parse error: cannot find \"text: \"")) 1150 ;; (error "Parse error: cannot find \"text: \""))
1151 ;; (forward-char 6) ; past "text: " 1151 ;; (forward-char 6) ; past "text: "
1152 ;; 1152 ;;
1153 ;; ;; 6 1153 ;; ;; 6
1154 ;; ;; "\nmore text: " 1154 ;; ;; "\nmore text: "
1155 ;; (setq here (point)) 1155 ;; (setq here (point))
@@ -1163,7 +1163,7 @@ Commands: Equivalent keys in read-only mode:
1163 ;; (error "Parse error: not looking at \"%s\"" forms--dyntext)) 1163 ;; (error "Parse error: not looking at \"%s\"" forms--dyntext))
1164 ;; (forward-char (length forms--dyntext)) 1164 ;; (forward-char (length forms--dyntext))
1165 ;; (setq forms--dynamic-text (cdr-safe forms--dynamic-text))) 1165 ;; (setq forms--dynamic-text (cdr-safe forms--dynamic-text)))
1166 ;; ... 1166 ;; ...
1167 ;; ;; final flush (due to terminator sentinel, see below) 1167 ;; ;; final flush (due to terminator sentinel, see below)
1168 ;; (aset forms--recordv 7 (buffer-substring-no-properties (point) (point-max))) 1168 ;; (aset forms--recordv 7 (buffer-substring-no-properties (point) (point-max)))
1169 1169
@@ -1233,7 +1233,7 @@ Commands: Equivalent keys in read-only mode:
1233 (goto-char (point-min)) 1233 (goto-char (point-min))
1234 (forms--get-record))) 1234 (forms--get-record)))
1235 1235
1236 ;; This may be overkill, but try to avoid interference with 1236 ;; This may be overkill, but try to avoid interference with
1237 ;; the normal processing. 1237 ;; the normal processing.
1238 (kill-buffer forms--file-buffer) 1238 (kill-buffer forms--file-buffer)
1239 1239
@@ -1260,8 +1260,8 @@ Commands: Equivalent keys in read-only mode:
1260(defun forms--set-keymaps () 1260(defun forms--set-keymaps ()
1261 "Set the keymaps used in this mode." 1261 "Set the keymaps used in this mode."
1262 1262
1263 (use-local-map (if forms-read-only 1263 (use-local-map (if forms-read-only
1264 forms-mode-ro-map 1264 forms-mode-ro-map
1265 forms-mode-edit-map))) 1265 forms-mode-edit-map)))
1266 1266
1267(defun forms--mode-commands () 1267(defun forms--mode-commands ()
@@ -1403,7 +1403,7 @@ Commands: Equivalent keys in read-only mode:
1403 (put 'forms-delete-record 'menu-enable '(not forms-read-only)) 1403 (put 'forms-delete-record 'menu-enable '(not forms-read-only))
1404) 1404)
1405 1405
1406(defun forms--mode-commands1 (map) 1406(defun forms--mode-commands1 (map)
1407 "Helper routine to define keys." 1407 "Helper routine to define keys."
1408 (define-key map [TAB] 'forms-next-field) 1408 (define-key map [TAB] 'forms-next-field)
1409 (define-key map [S-tab] 'forms-prev-field) 1409 (define-key map [S-tab] 'forms-prev-field)
@@ -1526,10 +1526,10 @@ Commands: Equivalent keys in read-only mode:
1526 (message "Warning: this record has %d fields instead of %d" 1526 (message "Warning: this record has %d fields instead of %d"
1527 (length forms--the-record-list) forms-number-of-fields)) 1527 (length forms--the-record-list) forms-number-of-fields))
1528 (if (< (length forms--the-record-list) forms-number-of-fields) 1528 (if (< (length forms--the-record-list) forms-number-of-fields)
1529 (setq forms--the-record-list 1529 (setq forms--the-record-list
1530 (append forms--the-record-list 1530 (append forms--the-record-list
1531 (make-list 1531 (make-list
1532 (- forms-number-of-fields 1532 (- forms-number-of-fields
1533 (length forms--the-record-list)) 1533 (length forms--the-record-list))
1534 ""))))) 1534 "")))))
1535 1535
@@ -1549,7 +1549,7 @@ Commands: Equivalent keys in read-only mode:
1549 "Parse contents of form into list of strings." 1549 "Parse contents of form into list of strings."
1550 ;; The contents of the form are parsed, and a new list of strings 1550 ;; The contents of the form are parsed, and a new list of strings
1551 ;; is constructed. 1551 ;; is constructed.
1552 ;; A vector with the strings from the original record is 1552 ;; A vector with the strings from the original record is
1553 ;; constructed, which is updated with the new contents. Therefore 1553 ;; constructed, which is updated with the new contents. Therefore
1554 ;; fields which were not in the form are not modified. 1554 ;; fields which were not in the form are not modified.
1555 ;; Finally, the vector is transformed into a list for further processing. 1555 ;; Finally, the vector is transformed into a list for further processing.
@@ -1585,11 +1585,11 @@ As a side effect: sets `forms--the-record-list'."
1585 (setq forms--the-record-list (forms--parse-form)) 1585 (setq forms--the-record-list (forms--parse-form))
1586 (setq the-record 1586 (setq the-record
1587 (mapconcat 'identity forms--the-record-list forms-field-sep)) 1587 (mapconcat 'identity forms--the-record-list forms-field-sep))
1588 1588
1589 (if (string-match (regexp-quote forms-field-sep) 1589 (if (string-match (regexp-quote forms-field-sep)
1590 (mapconcat 'identity forms--the-record-list "")) 1590 (mapconcat 'identity forms--the-record-list ""))
1591 (error "Field separator occurs in record - update refused")) 1591 (error "Field separator occurs in record - update refused"))
1592 1592
1593 ;; Handle multi-line fields, if allowed. 1593 ;; Handle multi-line fields, if allowed.
1594 (if forms-multi-line 1594 (if forms-multi-line
1595 (forms--trans the-record "\n" forms-multi-line)) 1595 (forms--trans the-record "\n" forms-multi-line))
@@ -1713,7 +1713,7 @@ As a side effect: sets `forms--the-record-list'."
1713As a side effect: re-calculates the number of records in the data file." 1713As a side effect: re-calculates the number of records in the data file."
1714 (interactive) 1714 (interactive)
1715 (let 1715 (let
1716 ((numrec 1716 ((numrec
1717 (save-excursion 1717 (save-excursion
1718 (set-buffer forms--file-buffer) 1718 (set-buffer forms--file-buffer)
1719 (count-lines (point-min) (point-max))))) 1719 (count-lines (point-min) (point-max)))))
@@ -1769,7 +1769,7 @@ Otherwise enables edit mode if the visited file is writable."
1769(defun forms-insert-record (arg) 1769(defun forms-insert-record (arg)
1770 "Create a new record before the current one. 1770 "Create a new record before the current one.
1771With ARG: store the record after the current one. 1771With ARG: store the record after the current one.
1772If `forms-new-record-filter' contains the name of a function, 1772If `forms-new-record-filter' contains the name of a function,
1773it is called to fill (some of) the fields with default values. 1773it is called to fill (some of) the fields with default values.
1774If `forms-insert-after is non-nil, the default behavior is to insert 1774If `forms-insert-after is non-nil, the default behavior is to insert
1775after the current record." 1775after the current record."
@@ -1808,7 +1808,7 @@ after the current record."
1808 (open-line 1) 1808 (open-line 1)
1809 (insert the-record) 1809 (insert the-record)
1810 (beginning-of-line)) 1810 (beginning-of-line))
1811 1811
1812 (setq forms--current-record ln)) 1812 (setq forms--current-record ln))
1813 1813
1814 (setq forms--total-records (1+ forms--total-records)) 1814 (setq forms--total-records (1+ forms--total-records))
@@ -1841,8 +1841,8 @@ after the current record."
1841 1841
1842(defun forms-search-forward (regexp) 1842(defun forms-search-forward (regexp)
1843 "Search forward for record containing REGEXP." 1843 "Search forward for record containing REGEXP."
1844 (interactive 1844 (interactive
1845 (list (read-string (concat "Search forward for" 1845 (list (read-string (concat "Search forward for"
1846 (if forms--search-regexp 1846 (if forms--search-regexp
1847 (concat " (" 1847 (concat " ("
1848 forms--search-regexp 1848 forms--search-regexp
@@ -1877,8 +1877,8 @@ after the current record."
1877 1877
1878(defun forms-search-backward (regexp) 1878(defun forms-search-backward (regexp)
1879 "Search backward for record containing REGEXP." 1879 "Search backward for record containing REGEXP."
1880 (interactive 1880 (interactive
1881 (list (read-string (concat "Search backward for" 1881 (list (read-string (concat "Search backward for"
1882 (if forms--search-regexp 1882 (if forms--search-regexp
1883 (concat " (" 1883 (concat " ("
1884 forms--search-regexp 1884 forms--search-regexp
@@ -1925,8 +1925,8 @@ after writing out the data."
1925 (set-buffer forms--file-buffer) 1925 (set-buffer forms--file-buffer)
1926 (let ((inhibit-read-only t)) 1926 (let ((inhibit-read-only t))
1927 ;; Write file hooks are run via local-write-file-hooks. 1927 ;; Write file hooks are run via local-write-file-hooks.
1928 ;; (if write-file-filter 1928 ;; (if write-file-filter
1929 ;; (save-excursion 1929 ;; (save-excursion
1930 ;; (run-hooks 'write-file-filter))) 1930 ;; (run-hooks 'write-file-filter)))
1931 1931
1932 ;; If they have a write-file-filter, force the buffer to be 1932 ;; If they have a write-file-filter, force the buffer to be
@@ -2076,7 +2076,7 @@ Usage: (setq forms-number-of-fields
2076 (setq ret (concat ret (prin1-to-string vel) "\n"))) 2076 (setq ret (concat ret (prin1-to-string vel) "\n")))
2077 (setq ret (concat ret "<unbound>" "\n"))) 2077 (setq ret (concat ret "<unbound>" "\n")))
2078 (if (fboundp el) 2078 (if (fboundp el)
2079 (setq ret (concat ret (prin1-to-string (symbol-function el)) 2079 (setq ret (concat ret (prin1-to-string (symbol-function el))
2080 "\n")))))) 2080 "\n"))))))
2081 (save-excursion 2081 (save-excursion
2082 (set-buffer (get-buffer-create "*forms-mode debug*")) 2082 (set-buffer (get-buffer-create "*forms-mode debug*"))
diff --git a/lisp/gdb-ui.el b/lisp/gdb-ui.el
index a01a35e88c6..ad220ff8ec8 100644
--- a/lisp/gdb-ui.el
+++ b/lisp/gdb-ui.el
@@ -41,7 +41,7 @@
41;; developing the mode itself, then see the Annotations section in the GDB 41;; developing the mode itself, then see the Annotations section in the GDB
42;; info manual. 42;; info manual.
43;; 43;;
44;; Known Bugs: Does not auto-display arrays of structures or structures 44;; Known Bugs: Does not auto-display arrays of structures or structures
45;; containing arrays. 45;; containing arrays.
46 46
47;;; Code: 47;;; Code:
@@ -116,7 +116,7 @@ The following interactive lisp functions help control operation :
116 116
117`gdb-many-windows' - Toggle the number of windows gdb uses. 117`gdb-many-windows' - Toggle the number of windows gdb uses.
118`gdb-restore-windows' - To restore the window layout. 118`gdb-restore-windows' - To restore the window layout.
119`gdb-quit' - To delete (most) of the buffers used by GDB-UI and 119`gdb-quit' - To delete (most) of the buffers used by GDB-UI and
120 reset variables." 120 reset variables."
121 ;; 121 ;;
122 (interactive (list (gud-query-cmdline 'gdba))) 122 (interactive (list (gud-query-cmdline 'gdba)))
@@ -530,7 +530,7 @@ This filter may simply queue output for a later time."
530 ("display-end" gdb-display-end) 530 ("display-end" gdb-display-end)
531; GDB commands info stack, info locals and frame generate an error-begin 531; GDB commands info stack, info locals and frame generate an error-begin
532; annotation at start when there is no stack but this is a quirk/bug in 532; annotation at start when there is no stack but this is a quirk/bug in
533; annotations. 533; annotations.
534; ("error-begin" gdb-error-begin) 534; ("error-begin" gdb-error-begin)
535 ("display-number-end" gdb-display-number-end) 535 ("display-number-end" gdb-display-number-end)
536 ("array-section-begin" gdb-array-section-begin) 536 ("array-section-begin" gdb-array-section-begin)
@@ -582,7 +582,7 @@ output from a previous command if that happens to be in effect."
582 (let ((handler 582 (let ((handler
583 (car (cdr (gdb-get-current-item))))) 583 (car (cdr (gdb-get-current-item)))))
584 (save-excursion 584 (save-excursion
585 (set-buffer (gdb-get-create-buffer 585 (set-buffer (gdb-get-create-buffer
586 'gdb-partial-output-buffer)) 586 'gdb-partial-output-buffer))
587 (funcall handler)))) 587 (funcall handler))))
588 (t 588 (t
@@ -590,7 +590,7 @@ output from a previous command if that happens to be in effect."
590 (error "Output sink phase error 1"))))) 590 (error "Output sink phase error 1")))))
591 591
592(defun gdb-prompt (ignored) 592(defun gdb-prompt (ignored)
593 "An annotation handler for `prompt'. 593 "An annotation handler for `prompt'.
594This sends the next command (if any) to gdb." 594This sends the next command (if any) to gdb."
595 (let ((sink (gdb-get-output-sink))) 595 (let ((sink (gdb-get-output-sink)))
596 (cond 596 (cond
@@ -714,7 +714,7 @@ output from the current command if that happens to be appropriate."
714 (if (string-equal (frame-parameter frame 'name) 714 (if (string-equal (frame-parameter frame 'name)
715 gdb-expression-buffer-name) 715 gdb-expression-buffer-name)
716 (throw 'frame-exists nil))) 716 (throw 'frame-exists nil)))
717 (make-frame `((height . ,gdb-window-height) 717 (make-frame `((height . ,gdb-window-height)
718 (width . ,gdb-window-width) 718 (width . ,gdb-window-width)
719 (tool-bar-lines . nil) 719 (tool-bar-lines . nil)
720 (menu-bar-lines . nil) 720 (menu-bar-lines . nil)
@@ -1082,7 +1082,7 @@ output from the current command if that happens to be appropriate."
1082 ;; It is either concatenated to OUTPUT or directed 1082 ;; It is either concatenated to OUTPUT or directed
1083 ;; elsewhere. 1083 ;; elsewhere.
1084 (setq output 1084 (setq output
1085 (gdb-concat-output 1085 (gdb-concat-output
1086 output 1086 output
1087 (substring burst 0 (match-beginning 0)))) 1087 (substring burst 0 (match-beginning 0))))
1088 1088
@@ -1262,7 +1262,7 @@ output from the current command if that happens to be appropriate."
1262 gdb-info-breakpoints-custom) 1262 gdb-info-breakpoints-custom)
1263 1263
1264(defvar gdb-cdir nil "Compilation directory.") 1264(defvar gdb-cdir nil "Compilation directory.")
1265(defvar breakpoint-enabled-icon) 1265(defvar breakpoint-enabled-icon)
1266(defvar breakpoint-disabled-icon) 1266(defvar breakpoint-disabled-icon)
1267 1267
1268;;-put breakpoint icons in relevant margins (even those set in the GUD buffer) 1268;;-put breakpoint icons in relevant margins (even those set in the GUD buffer)
@@ -1299,7 +1299,7 @@ output from the current command if that happens to be appropriate."
1299 'mouse-face 'highlight) 1299 'mouse-face 'highlight)
1300 (save-excursion 1300 (save-excursion
1301 (set-buffer 1301 (set-buffer
1302 (find-file-noselect 1302 (find-file-noselect
1303 (if (file-exists-p file) file 1303 (if (file-exists-p file) file
1304 (expand-file-name file gdb-cdir)))) 1304 (expand-file-name file gdb-cdir))))
1305 (save-current-buffer 1305 (save-current-buffer
@@ -1315,14 +1315,14 @@ output from the current command if that happens to be appropriate."
1315 ;; only want one breakpoint icon at each location 1315 ;; only want one breakpoint icon at each location
1316 (save-excursion 1316 (save-excursion
1317 (goto-line (string-to-number line)) 1317 (goto-line (string-to-number line))
1318 (let ((start (progn (beginning-of-line) 1318 (let ((start (progn (beginning-of-line)
1319 (- (point) 1))) 1319 (- (point) 1)))
1320 (end (progn (end-of-line) (+ (point) 1)))) 1320 (end (progn (end-of-line) (+ (point) 1))))
1321 (if (display-graphic-p) 1321 (if (display-graphic-p)
1322 (progn 1322 (progn
1323 (remove-images start end) 1323 (remove-images start end)
1324 (if (eq ?y flag) 1324 (if (eq ?y flag)
1325 (put-image breakpoint-enabled-icon 1325 (put-image breakpoint-enabled-icon
1326 (point) 1326 (point)
1327 "breakpoint icon enabled" 1327 "breakpoint icon enabled"
1328 'left-margin) 1328 'left-margin)
@@ -1387,7 +1387,7 @@ output from the current command if that happens to be appropriate."
1387 (list 1387 (list
1388 (concat 1388 (concat
1389 (if (eq ?y (char-after (match-beginning 2))) 1389 (if (eq ?y (char-after (match-beginning 2)))
1390 "server disable " 1390 "server disable "
1391 "server enable ") 1391 "server enable ")
1392 (match-string 1) "\n") 1392 (match-string 1) "\n")
1393 'ignore))))) 1393 'ignore)))))
@@ -1564,7 +1564,7 @@ the source buffer."
1564 gdb-info-locals-handler 1564 gdb-info-locals-handler
1565 gdb-info-locals-custom) 1565 gdb-info-locals-custom)
1566 1566
1567;; Abbreviate for arrays and structures. 1567;; Abbreviate for arrays and structures.
1568;; These can be expanded using gud-display. 1568;; These can be expanded using gud-display.
1569(defun gdb-info-locals-handler nil 1569(defun gdb-info-locals-handler nil
1570 (gdb-set-pending-triggers (delq 'gdb-invalidate-locals 1570 (gdb-set-pending-triggers (delq 'gdb-invalidate-locals
@@ -1646,7 +1646,7 @@ the source buffer."
1646 (while (< (point) (- (point-max) 1)) 1646 (while (< (point) (- (point-max) 1))
1647 (forward-line 1) 1647 (forward-line 1)
1648 (if (looking-at "\\([0-9]+\\): \\([ny]\\)") 1648 (if (looking-at "\\([0-9]+\\): \\([ny]\\)")
1649 (setq display-list 1649 (setq display-list
1650 (cons (string-to-int (match-string 1)) display-list))) 1650 (cons (string-to-int (match-string 1)) display-list)))
1651 (end-of-line))) 1651 (end-of-line)))
1652 (if (not (display-graphic-p)) 1652 (if (not (display-graphic-p))
@@ -1654,10 +1654,10 @@ the source buffer."
1654 (dolist (buffer (buffer-list)) 1654 (dolist (buffer (buffer-list))
1655 (if (string-match "\\*display \\([0-9]+\\)\\*" (buffer-name buffer)) 1655 (if (string-match "\\*display \\([0-9]+\\)\\*" (buffer-name buffer))
1656 (progn 1656 (progn
1657 (let ((number 1657 (let ((number
1658 (match-string 1 (buffer-name buffer)))) 1658 (match-string 1 (buffer-name buffer))))
1659 (if (not (memq (string-to-int number) display-list)) 1659 (if (not (memq (string-to-int number) display-list))
1660 (kill-buffer 1660 (kill-buffer
1661 (get-buffer (concat "*display " number "*"))))))))) 1661 (get-buffer (concat "*display " number "*")))))))))
1662 (gdb-delete-frames display-list)))) 1662 (gdb-delete-frames display-list))))
1663 1663
@@ -2233,17 +2233,17 @@ BUFFER nil or omitted means use the current buffer."
2233 2233
2234(defun gdb-get-current-frame () 2234(defun gdb-get-current-frame ()
2235 (if (not (member 'gdb-get-current-frame (gdb-get-pending-triggers))) 2235 (if (not (member 'gdb-get-current-frame (gdb-get-pending-triggers)))
2236 (progn 2236 (progn
2237 (gdb-enqueue-idle-input 2237 (gdb-enqueue-idle-input
2238 (list (concat "server frame\n") 'gdb-frame-handler)) 2238 (list (concat "server frame\n") 'gdb-frame-handler))
2239 (gdb-set-pending-triggers 2239 (gdb-set-pending-triggers
2240 (cons 'gdb-get-current-frame 2240 (cons 'gdb-get-current-frame
2241 (gdb-get-pending-triggers)))))) 2241 (gdb-get-pending-triggers))))))
2242 2242
2243(defun gdb-frame-handler () 2243(defun gdb-frame-handler ()
2244 (gdb-set-pending-triggers 2244 (gdb-set-pending-triggers
2245 (delq 'gdb-get-current-frame (gdb-get-pending-triggers))) 2245 (delq 'gdb-get-current-frame (gdb-get-pending-triggers)))
2246 (save-excursion 2246 (save-excursion
2247 (set-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)) 2247 (set-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer))
2248 (goto-char (point-min)) 2248 (goto-char (point-min))
2249 (if (looking-at "^#[0-9]*\\s-*0x\\S-* in \\(\\S-*\\)") 2249 (if (looking-at "^#[0-9]*\\s-*0x\\S-* in \\(\\S-*\\)")
diff --git a/lisp/gud.el b/lisp/gud.el
index 862ecd3e38f..3ef5a7ad83c 100644
--- a/lisp/gud.el
+++ b/lisp/gud.el
@@ -1934,7 +1934,7 @@ nil)
1934 (setq gud-last-frame 1934 (setq gud-last-frame
1935 (cons file-found 1935 (cons file-found
1936 (string-to-int 1936 (string-to-int
1937 (let 1937 (let
1938 ((numstr (match-string 4 gud-marker-acc))) 1938 ((numstr (match-string 4 gud-marker-acc)))
1939 (if (string-match "," numstr) 1939 (if (string-match "," numstr)
1940 (replace-match "" nil nil numstr) 1940 (replace-match "" nil nil numstr)
@@ -2519,7 +2519,7 @@ Obeying it means displaying in another window the specified file and line."
2519 (if (not (or (verify-visited-file-modtime buffer) gud-keep-buffer)) 2519 (if (not (or (verify-visited-file-modtime buffer) gud-keep-buffer))
2520 (progn 2520 (progn
2521 (if 2521 (if
2522 (yes-or-no-p 2522 (yes-or-no-p
2523 (format "File %s changed on disk. Reread from disk? " 2523 (format "File %s changed on disk. Reread from disk? "
2524 (buffer-name))) 2524 (buffer-name)))
2525 (revert-buffer t t) 2525 (revert-buffer t t)
@@ -2576,8 +2576,8 @@ Obeying it means displaying in another window the specified file and line."
2576 ((eq key ?a) 2576 ((eq key ?a)
2577 (setq subst (gud-read-address))) 2577 (setq subst (gud-read-address)))
2578 ((eq key ?c) 2578 ((eq key ?c)
2579 (setq subst 2579 (setq subst
2580 (gud-find-class 2580 (gud-find-class
2581 (if insource 2581 (if insource
2582 (buffer-file-name) 2582 (buffer-file-name)
2583 (car frame)) 2583 (car frame))
@@ -2830,12 +2830,12 @@ class of the file (using s to separate nested class ids)."
2830 ;; While the c-syntactic information does not start 2830 ;; While the c-syntactic information does not start
2831 ;; with the 'topmost-intro symbol, there may be 2831 ;; with the 'topmost-intro symbol, there may be
2832 ;; nested classes... 2832 ;; nested classes...
2833 (while (not (eq 'topmost-intro 2833 (while (not (eq 'topmost-intro
2834 (car (car (c-guess-basic-syntax))))) 2834 (car (car (c-guess-basic-syntax)))))
2835 ;; Check if the current position c-syntactic 2835 ;; Check if the current position c-syntactic
2836 ;; analysis has 'inclass 2836 ;; analysis has 'inclass
2837 (setq syntax (c-guess-basic-syntax)) 2837 (setq syntax (c-guess-basic-syntax))
2838 (while 2838 (while
2839 (and (not (eq 'inclass (car (car syntax)))) 2839 (and (not (eq 'inclass (car (car syntax))))
2840 (cdr syntax)) 2840 (cdr syntax))
2841 (setq syntax (cdr syntax))) 2841 (setq syntax (cdr syntax)))
@@ -2855,7 +2855,7 @@ class of the file (using s to separate nested class ids)."
2855 (goto-char (cdr (car syntax))) 2855 (goto-char (cdr (car syntax)))
2856 )) 2856 ))
2857 (string-match (concat (car nclass) "$") class-found) 2857 (string-match (concat (car nclass) "$") class-found)
2858 (setq class-found 2858 (setq class-found
2859 (replace-match (mapconcat 'identity nclass "$") 2859 (replace-match (mapconcat 'identity nclass "$")
2860 t t class-found))))) 2860 t t class-found)))))
2861 (if (not class-found) 2861 (if (not class-found)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 2b61cd88d47..4b5a2e03208 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -91,7 +91,7 @@ With ARG, you are asked to choose which language."
91 (newline n)) 91 (newline n))
92 ;; Some people get confused by the large gap. 92 ;; Some people get confused by the large gap.
93 (newline (/ n 2)) 93 (newline (/ n 2))
94 94
95 ;; Skip the [...] line (don't delete it). 95 ;; Skip the [...] line (don't delete it).
96 (forward-line 1) 96 (forward-line 1)
97 (newline (- n (/ n 2))))) 97 (newline (- n (/ n 2)))))
diff --git a/lisp/help.el b/lisp/help.el
index 8d0be9b63cc..e6f9f173dea 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -483,7 +483,7 @@ or `keymap' property, return the binding of KEY in the string's keymap."
483 (if (equal string otherstring) 483 (if (equal string otherstring)
484 string 484 string
485 (format "%s (translated from %s)" string otherstring)))))) 485 (format "%s (translated from %s)" string otherstring))))))
486 486
487(defun describe-key-briefly (key &optional insert untranslated) 487(defun describe-key-briefly (key &optional insert untranslated)
488 "Print the name of the function KEY invokes. KEY is a string. 488 "Print the name of the function KEY invokes. KEY is a string.
489If INSERT (the prefix arg) is non-nil, insert the message in the buffer. 489If INSERT (the prefix arg) is non-nil, insert the message in the buffer.
diff --git a/lisp/hexl.el b/lisp/hexl.el
index 0844c697208..9330de1a600 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -130,10 +130,10 @@ A sample format:
130 00000050: 6162 6c65 2041 5343 4949 2063 6861 7261 able ASCII chara 130 00000050: 6162 6c65 2041 5343 4949 2063 6861 7261 able ASCII chara
131 00000060: 6374 6572 732e 2020 416e 7920 636f 6e74 cters. Any cont 131 00000060: 6374 6572 732e 2020 416e 7920 636f 6e74 cters. Any cont
132 00000070: 726f 6c20 6f72 206e 6f6e 2d41 5343 4949 rol or non-ASCII 132 00000070: 726f 6c20 6f72 206e 6f6e 2d41 5343 4949 rol or non-ASCII
133 00000080: 2063 6861 7261 6374 6572 730a 6172 6520 characters.are 133 00000080: 2063 6861 7261 6374 6572 730a 6172 6520 characters.are
134 00000090: 6469 7370 6c61 7965 6420 6173 2070 6572 displayed as per 134 00000090: 6469 7370 6c61 7965 6420 6173 2070 6572 displayed as per
135 000000a0: 696f 6473 2069 6e20 7468 6520 7072 696e iods in the prin 135 000000a0: 696f 6473 2069 6e20 7468 6520 7072 696e iods in the prin
136 000000b0: 7461 626c 6520 6368 6172 6163 7465 7220 table character 136 000000b0: 7461 626c 6520 6368 6172 6163 7465 7220 table character
137 000000c0: 7265 6769 6f6e 2e0a region.. 137 000000c0: 7265 6769 6f6e 2e0a region..
138 138
139Movement is as simple as movement in a normal emacs text buffer. Most 139Movement is as simple as movement in a normal emacs text buffer. Most
@@ -827,7 +827,7 @@ When following is enabled, the ASCII character corresponding to the
827element under the point is highlighted. 827element under the point is highlighted.
828Customize the variable `hexl-follow-ascii' to disable this feature." 828Customize the variable `hexl-follow-ascii' to disable this feature."
829 (interactive "P") 829 (interactive "P")
830 (let ((on-p (if arg 830 (let ((on-p (if arg
831 (> (prefix-numeric-value arg) 0) 831 (> (prefix-numeric-value arg) 0)
832 (not hexl-ascii-overlay)))) 832 (not hexl-ascii-overlay))))
833 833
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 85f44279525..2d96ac9848d 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -23,7 +23,7 @@
23;; Boston, MA 02111-1307, USA. 23;; Boston, MA 02111-1307, USA.
24 24
25;;; Commentary: 25;;; Commentary:
26;; 26;;
27;; With the hi-lock commands text matching interactively entered 27;; With the hi-lock commands text matching interactively entered
28;; regexp's can be highlighted. For example, `M-x highlight-regexp 28;; regexp's can be highlighted. For example, `M-x highlight-regexp
29;; RET clearly RET RET' will highlight all occurrences of `clearly' 29;; RET clearly RET RET' will highlight all occurrences of `clearly'
@@ -58,7 +58,7 @@
58;; to the edit menu. 58;; to the edit menu.
59;; 59;;
60;; (hi-lock-mode 1) 60;; (hi-lock-mode 1)
61;; 61;;
62;; You might also want to bind the hi-lock commands to more 62;; You might also want to bind the hi-lock commands to more
63;; finger-friendly sequences: 63;; finger-friendly sequences:
64 64
@@ -259,7 +259,7 @@ which can be called interactively, are:
259 Highlight matches of phrase PHRASE in current buffer with FACE. 259 Highlight matches of phrase PHRASE in current buffer with FACE.
260 (PHRASE can be any REGEXP, but spaces will be replaced by matches 260 (PHRASE can be any REGEXP, but spaces will be replaced by matches
261 to whitespace and initial lower-case letters will become case insensitive.) 261 to whitespace and initial lower-case letters will become case insensitive.)
262 262
263\\[highlight-lines-matching-regexp] REGEXP FACE 263\\[highlight-lines-matching-regexp] REGEXP FACE
264 Highlight lines containing matches of REGEXP in current buffer with FACE. 264 Highlight lines containing matches of REGEXP in current buffer with FACE.
265 265
diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index 6bffc6fb5cb..8eb3a6ea37e 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -36,7 +36,7 @@
36;; Highlight Changes mode in passive state while you make your changes, toggle 36;; Highlight Changes mode in passive state while you make your changes, toggle
37;; it on to active mode to see them, then toggle it back off to avoid 37;; it on to active mode to see them, then toggle it back off to avoid
38;; distraction. 38;; distraction.
39;; 39;;
40;; When active, changes are displayed in `highlight-changes-face'. When 40;; When active, changes are displayed in `highlight-changes-face'. When
41;; text is deleted, the following character is displayed in 41;; text is deleted, the following character is displayed in
42;; `highlight-changes-delete-face' face. 42;; `highlight-changes-delete-face' face.
@@ -75,18 +75,18 @@
75;; modes. The variable 75;; modes. The variable
76;; `highlight-changes-mode' contains the new 76;; `highlight-changes-mode' contains the new
77;; state (`active' or `passive'.) 77;; state (`active' or `passive'.)
78;;
79;; 78;;
80;; 79;;
80;;
81;; Example usage: 81;; Example usage:
82;; (defun my-highlight-changes-enable-hook () 82;; (defun my-highlight-changes-enable-hook ()
83;; (add-hook 'local-write-file-hooks 'highlight-changes-rotate-faces) 83;; (add-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)
84;; ) 84;; )
85;; 85;;
86;; (defun my-highlight-changes-disable-hook () 86;; (defun my-highlight-changes-disable-hook ()
87;; (remove-hook 'local-write-file-hooks 'highlight-changes-rotate-faces) 87;; (remove-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)
88;; ) 88;; )
89;; 89;;
90;; (add-hook 'highlight-changes-enable-hook 'my-highlight-changes-enable-hook) 90;; (add-hook 'highlight-changes-enable-hook 'my-highlight-changes-enable-hook)
91;; (add-hook 'highlight-changes-disable-hook 91;; (add-hook 'highlight-changes-disable-hook
92;; 'my-highlight-changes-disable-hook) 92;; 'my-highlight-changes-disable-hook)
@@ -99,29 +99,29 @@
99;; 99;;
100;; If you prefer to have it automatically invoked you can do it as 100;; If you prefer to have it automatically invoked you can do it as
101;; follows. 101;; follows.
102;; 102;;
103;; 1. Most modes have a major-hook, typically called MODE-hook. You 103;; 1. Most modes have a major-hook, typically called MODE-hook. You
104;; can use `add-hook' to call `highlight-changes-mode'. 104;; can use `add-hook' to call `highlight-changes-mode'.
105;; 105;;
106;; Example: 106;; Example:
107;; (add-hook 'c-mode-hook 'highlight-changes-mode) 107;; (add-hook 'c-mode-hook 'highlight-changes-mode)
108;; 108;;
109;; If you want to make it start up in passive mode (regardless of the 109;; If you want to make it start up in passive mode (regardless of the
110;; setting of highlight-changes-initial-state): 110;; setting of highlight-changes-initial-state):
111;; (add-hook 'emacs-lisp-mode-hook 111;; (add-hook 'emacs-lisp-mode-hook
112;; (lambda () 112;; (lambda ()
113;; (highlight-changes-mode 'passive))) 113;; (highlight-changes-mode 'passive)))
114;; 114;;
115;; However, this cannot be done for Fundamental mode for there is no 115;; However, this cannot be done for Fundamental mode for there is no
116;; such hook. 116;; such hook.
117;; 117;;
118;; 2. You can use the function `global-highlight-changes' 118;; 2. You can use the function `global-highlight-changes'
119;; 119;;
120;; This function, which is fashioned after the way `global-font-lock' works, 120;; This function, which is fashioned after the way `global-font-lock' works,
121;; toggles on or off global Highlight Changes mode. When activated, it turns 121;; toggles on or off global Highlight Changes mode. When activated, it turns
122;; on Highlight Changes mode in all "suitable" existing buffers and will turn 122;; on Highlight Changes mode in all "suitable" existing buffers and will turn
123;; it on in new "suitable" buffers to be created. 123;; it on in new "suitable" buffers to be created.
124;; 124;;
125;; A buffer's "suitability" is determined by variable 125;; A buffer's "suitability" is determined by variable
126;; `highlight-changes-global-modes', as follows. If the variable is 126;; `highlight-changes-global-modes', as follows. If the variable is
127;; * nil -- then no buffers are suitable; 127;; * nil -- then no buffers are suitable;
@@ -148,7 +148,7 @@
148;; highlight-changes-rotate-faces 148;; highlight-changes-rotate-faces
149;; highlight-compare-with-file 149;; highlight-compare-with-file
150 150
151;; 151;;
152;; You can automatically rotate faces when the buffer is saved; 152;; You can automatically rotate faces when the buffer is saved;
153;; see function `highlight-changes-rotate-faces' for how to do this. 153;; see function `highlight-changes-rotate-faces' for how to do this.
154;; 154;;
@@ -177,7 +177,7 @@
177;; R Sharman (rsharman@magma.ca) Feb 1998: 177;; R Sharman (rsharman@magma.ca) Feb 1998:
178;; - initial release as change-mode. 178;; - initial release as change-mode.
179;; Jari Aalto <jari.aalto@ntc.nokia.com> Mar 1998 179;; Jari Aalto <jari.aalto@ntc.nokia.com> Mar 1998
180;; - fixes for byte compile errors 180;; - fixes for byte compile errors
181;; - use eval-and-compile for autoload 181;; - use eval-and-compile for autoload
182;; Marijn Ros <J.M.Ros@fys.ruu.nl> Mar 98 182;; Marijn Ros <J.M.Ros@fys.ruu.nl> Mar 98
183;; - suggested turning it on by default 183;; - suggested turning it on by default
@@ -225,7 +225,7 @@
225 225
226;; A (not very good) default list of colours to rotate through. 226;; A (not very good) default list of colours to rotate through.
227;; 227;;
228(defcustom highlight-changes-colours 228(defcustom highlight-changes-colours
229 (if (eq (frame-parameter nil 'background-mode) 'light) 229 (if (eq (frame-parameter nil 'background-mode) 'light)
230 ;; defaults for light background: 230 ;; defaults for light background:
231 '( "magenta" "blue" "darkgreen" "chocolate" "sienna4" "NavyBlue") 231 '( "magenta" "blue" "darkgreen" "chocolate" "sienna4" "NavyBlue")
@@ -241,7 +241,7 @@ colours then use this, if you want fancier faces then set
241`highlight-changes-face-list'." 241`highlight-changes-face-list'."
242 :type '(repeat color) 242 :type '(repeat color)
243 :group 'highlight-changes) 243 :group 'highlight-changes)
244 244
245 245
246;; If you invoke highlight-changes-mode with no argument, should it start in 246;; If you invoke highlight-changes-mode with no argument, should it start in
247;; active or passive mode? 247;; active or passive mode?
@@ -299,7 +299,7 @@ Examples:
299 (c-mode c++-mode) 299 (c-mode c++-mode)
300means that Highlight Changes mode is turned on for buffers in C and C++ 300means that Highlight Changes mode is turned on for buffers in C and C++
301modes only." 301modes only."
302 :type '(choice 302 :type '(choice
303 (const :tag "all non-special buffers visiting files" t) 303 (const :tag "all non-special buffers visiting files" t)
304 (set :menu-tag "specific modes" :tag "modes" 304 (set :menu-tag "specific modes" :tag "modes"
305 :value (not) 305 :value (not)
@@ -377,7 +377,7 @@ don't just differ from `highlight-changes-face' by the foreground colour.
377Otherwise, this list will be constructed when needed from 377Otherwise, this list will be constructed when needed from
378`highlight-changes-colours'." 378`highlight-changes-colours'."
379 :type '(choice 379 :type '(choice
380 (repeat 380 (repeat
381 :notify hilit-chg-cust-fix-changes-face-list 381 :notify hilit-chg-cust-fix-changes-face-list
382 face ) 382 face )
383 (const :tag "Derive from highlight-changes-colours" nil) 383 (const :tag "Derive from highlight-changes-colours" nil)
@@ -513,15 +513,15 @@ the text properties of type `hilit-chg' ."
513 (hilit-chg-display-changes beg end))) 513 (hilit-chg-display-changes beg end)))
514 514
515;;;###autoload 515;;;###autoload
516(defun highlight-changes-remove-highlight (beg end) 516(defun highlight-changes-remove-highlight (beg end)
517 "Remove the change face from the region between BEG and END. 517 "Remove the change face from the region between BEG and END.
518This allows you to manually remove highlighting from uninteresting changes." 518This allows you to manually remove highlighting from uninteresting changes."
519 (interactive "r") 519 (interactive "r")
520 (let ((after-change-functions nil)) 520 (let ((after-change-functions nil))
521 (remove-text-properties beg end '(hilit-chg nil)) 521 (remove-text-properties beg end '(hilit-chg nil))
522 (hilit-chg-fixup beg end))) 522 (hilit-chg-fixup beg end)))
523 523
524(defun hilit-chg-set-face-on-change (beg end leng-before 524(defun hilit-chg-set-face-on-change (beg end leng-before
525 &optional no-property-change) 525 &optional no-property-change)
526 "Record changes and optionally display them in a distinctive face. 526 "Record changes and optionally display them in a distinctive face.
527`hilit-chg-set' adds this function to the `after-change-functions' hook." 527`hilit-chg-set' adds this function to the `after-change-functions' hook."
@@ -544,7 +544,7 @@ This allows you to manually remove highlighting from uninteresting changes."
544 ;; deletion 544 ;; deletion
545 (progn 545 (progn
546 ;; The eolp and bolp tests are a kludge! But they prevent 546 ;; The eolp and bolp tests are a kludge! But they prevent
547 ;; rather nasty looking displays when deleting text at the end 547 ;; rather nasty looking displays when deleting text at the end
548 ;; of line, such as normal corrections as one is typing and 548 ;; of line, such as normal corrections as one is typing and
549 ;; immediately makes a correction, and when deleting first 549 ;; immediately makes a correction, and when deleting first
550 ;; character of a line. 550 ;; character of a line.
@@ -601,7 +601,7 @@ This removes all saved change information."
601 (remove-hook 'after-change-functions 'hilit-chg-set-face-on-change t) 601 (remove-hook 'after-change-functions 'hilit-chg-set-face-on-change t)
602 (let ((after-change-functions nil)) 602 (let ((after-change-functions nil))
603 (hilit-chg-hide-changes) 603 (hilit-chg-hide-changes)
604 (hilit-chg-map-changes 604 (hilit-chg-map-changes
605 '(lambda (prop start stop) 605 '(lambda (prop start stop)
606 (remove-text-properties start stop '(hilit-chg nil)))) 606 (remove-text-properties start stop '(hilit-chg nil))))
607 ) 607 )
@@ -616,7 +616,7 @@ This removes all saved change information."
616(defun highlight-changes-mode (&optional arg) 616(defun highlight-changes-mode (&optional arg)
617 "Toggle (or initially set) Highlight Changes mode. 617 "Toggle (or initially set) Highlight Changes mode.
618 618
619Without an argument: 619Without an argument:
620 If Highlight Changes mode is not enabled, then enable it (in either active 620 If Highlight Changes mode is not enabled, then enable it (in either active
621 or passive state as determined by the variable 621 or passive state as determined by the variable
622 `highlight-changes-initial-state'); otherwise, toggle between active 622 `highlight-changes-initial-state'); otherwise, toggle between active
@@ -633,12 +633,12 @@ Passive state - means changes are kept and new ones recorded but are
633 633
634Functions: 634Functions:
635\\[highlight-changes-next-change] - move point to beginning of next change 635\\[highlight-changes-next-change] - move point to beginning of next change
636\\[highlight-changes-previous-change] - move to beginning of previous change 636\\[highlight-changes-previous-change] - move to beginning of previous change
637\\[highlight-compare-with-file] - mark text as changed by comparing this 637\\[highlight-compare-with-file] - mark text as changed by comparing this
638 buffer with the contents of a file 638 buffer with the contents of a file
639\\[highlight-changes-remove-highlight] - remove the change face from the region 639\\[highlight-changes-remove-highlight] - remove the change face from the region
640\\[highlight-changes-rotate-faces] - rotate different \"ages\" of changes \ 640\\[highlight-changes-rotate-faces] - rotate different \"ages\" of changes \
641through 641through
642 various faces. 642 various faces.
643 643
644Hook variables: 644Hook variables:
@@ -732,20 +732,20 @@ Hook variables:
732 ;; so we pick up any changes? 732 ;; so we pick up any changes?
733 (if (or (null highlight-changes-face-list) ; Don't do it if it 733 (if (or (null highlight-changes-face-list) ; Don't do it if it
734 force) ; already exists unless FORCE non-nil. 734 force) ; already exists unless FORCE non-nil.
735 (let ((p highlight-changes-colours) 735 (let ((p highlight-changes-colours)
736 (n 1) name) 736 (n 1) name)
737 (setq highlight-changes-face-list nil) 737 (setq highlight-changes-face-list nil)
738 (while p 738 (while p
739 (setq name (intern (format "highlight-changes-face-%d" n))) 739 (setq name (intern (format "highlight-changes-face-%d" n)))
740 (copy-face 'highlight-changes-face name) 740 (copy-face 'highlight-changes-face name)
741 (set-face-foreground name (car p)) 741 (set-face-foreground name (car p))
742 (setq highlight-changes-face-list 742 (setq highlight-changes-face-list
743 (append highlight-changes-face-list (list name))) 743 (append highlight-changes-face-list (list name)))
744 (setq p (cdr p)) 744 (setq p (cdr p))
745 (setq n (1+ n))))) 745 (setq n (1+ n)))))
746 (setq hilit-chg-list (list 'hilit-chg 'highlight-changes-face)) 746 (setq hilit-chg-list (list 'hilit-chg 'highlight-changes-face))
747 (let ((p highlight-changes-face-list) 747 (let ((p highlight-changes-face-list)
748 (n 1) 748 (n 1)
749 last-category last-face) 749 last-category last-face)
750 (while p 750 (while p
751 (setq last-category (intern (format "change-%d" n))) 751 (setq last-category (intern (format "change-%d" n)))
@@ -829,7 +829,7 @@ changes are made, so \\[highlight-changes-next-change] and
829 "" ;; directory 829 "" ;; directory
830 nil ;; default 830 nil ;; default
831 'yes ;; must exist 831 'yes ;; must exist
832 (let ((f (make-backup-file-name 832 (let ((f (make-backup-file-name
833 (or (buffer-file-name (current-buffer)) 833 (or (buffer-file-name (current-buffer))
834 (error "no file for this buffer"))))) 834 (error "no file for this buffer")))))
835 (if (file-exists-p f) f ""))))) 835 (if (file-exists-p f) f "")))))
@@ -885,7 +885,7 @@ changes are made, so \\[highlight-changes-next-change] and
885 (setq p (cdr p)) 885 (setq p (cdr p))
886 (setq q (cdr q))) 886 (setq q (cdr q)))
887 (if existing-buf 887 (if existing-buf
888 (set-buffer-modified-p nil) 888 (set-buffer-modified-p nil)
889 (kill-buffer buf-b)))) 889 (kill-buffer buf-b))))
890 890
891 891
@@ -901,7 +901,7 @@ changes are made, so \\[highlight-changes-next-change] and
901 901
902 902
903(defun hilit-chg-get-diff-list-hk () 903(defun hilit-chg-get-diff-list-hk ()
904 ;; x and y are dynamically bound by hilit-chg-get-diff-info 904 ;; x and y are dynamically bound by hilit-chg-get-diff-info
905 ;; which calls this function as a hook 905 ;; which calls this function as a hook
906 (defvar x) ;; placate the byte-compiler 906 (defvar x) ;; placate the byte-compiler
907 (defvar y) 907 (defvar y)
@@ -971,12 +971,12 @@ changes are made, so \\[highlight-changes-next-change] and
971 ;; This is called after changing a major mode, but also after each 971 ;; This is called after changing a major mode, but also after each
972 ;; M-x command, in which case the current buffer is a minibuffer. 972 ;; M-x command, in which case the current buffer is a minibuffer.
973 ;; In that case, do not act on it here, but don't turn it off 973 ;; In that case, do not act on it here, but don't turn it off
974 ;; either, we will get called here again soon-after. 974 ;; either, we will get called here again soon-after.
975 ;; Also, don't enable it for other special buffers. 975 ;; Also, don't enable it for other special buffers.
976 (if (string-match "^[ *]" (buffer-name)) 976 (if (string-match "^[ *]" (buffer-name))
977 nil ;; (message "ignoring this post-command-hook") 977 nil ;; (message "ignoring this post-command-hook")
978 (remove-hook 'post-command-hook 'hilit-chg-post-command-hook) 978 (remove-hook 'post-command-hook 'hilit-chg-post-command-hook)
979 ;; The following check isn't necessary, since 979 ;; The following check isn't necessary, since
980 ;; hilit-chg-turn-on-maybe makes this check too. 980 ;; hilit-chg-turn-on-maybe makes this check too.
981 (or highlight-changes-mode ;; don't turn it on if it already is 981 (or highlight-changes-mode ;; don't turn it on if it already is
982 (hilit-chg-turn-on-maybe highlight-changes-global-initial-state)))) 982 (hilit-chg-turn-on-maybe highlight-changes-global-initial-state))))
@@ -1000,14 +1000,14 @@ When called from a program:
1000- if ARG is nil or omitted, turn it off 1000- if ARG is nil or omitted, turn it off
1001- if ARG is `active', turn it on in active mode 1001- if ARG is `active', turn it on in active mode
1002- if ARG is `passive', turn it on in passive mode 1002- if ARG is `passive', turn it on in passive mode
1003- otherwise just turn it on 1003- otherwise just turn it on
1004 1004
1005When global Highlight Changes mode is enabled, Highlight Changes mode is turned 1005When global Highlight Changes mode is enabled, Highlight Changes mode is turned
1006on for future \"suitable\" buffers (and for \"suitable\" existing buffers if 1006on for future \"suitable\" buffers (and for \"suitable\" existing buffers if
1007variable `highlight-changes-global-changes-existing-buffers' is non-nil). 1007variable `highlight-changes-global-changes-existing-buffers' is non-nil).
1008\"Suitability\" is determined by variable `highlight-changes-global-modes'." 1008\"Suitability\" is determined by variable `highlight-changes-global-modes'."
1009 1009
1010 (interactive 1010 (interactive
1011 (list 1011 (list
1012 (cond 1012 (cond
1013 ((null current-prefix-arg) 1013 ((null current-prefix-arg)
@@ -1023,7 +1023,7 @@ variable `highlight-changes-global-changes-existing-buffers' is non-nil).
1023 'passive) 1023 'passive)
1024 ;; negative interactive arg - turn it off 1024 ;; negative interactive arg - turn it off
1025 (t 1025 (t
1026 (setq global-highlight-changes nil) 1026 (setq global-highlight-changes nil)
1027 nil)))) 1027 nil))))
1028 1028
1029 (if arg 1029 (if arg
@@ -1038,9 +1038,9 @@ variable `highlight-changes-global-changes-existing-buffers' is non-nil).
1038 (add-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook) 1038 (add-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
1039 (add-hook 'find-file-hooks 'hilit-chg-check-global) 1039 (add-hook 'find-file-hooks 'hilit-chg-check-global)
1040 (if highlight-changes-global-changes-existing-buffers 1040 (if highlight-changes-global-changes-existing-buffers
1041 (hilit-chg-update-all-buffers 1041 (hilit-chg-update-all-buffers
1042 highlight-changes-global-initial-state))) 1042 highlight-changes-global-initial-state)))
1043 1043
1044 (message "Turning OFF global Highlight Changes mode") 1044 (message "Turning OFF global Highlight Changes mode")
1045 (remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook) 1045 (remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
1046 (remove-hook 'find-file-hooks 'hilit-chg-check-global) 1046 (remove-hook 'find-file-hooks 'hilit-chg-check-global)
@@ -1055,13 +1055,13 @@ variable `highlight-changes-global-changes-existing-buffers' is non-nil).
1055 "Turn on Highlight Changes mode if it is appropriate for this buffer. 1055 "Turn on Highlight Changes mode if it is appropriate for this buffer.
1056 1056
1057A buffer is appropriate for Highlight Changes mode if all these are true: 1057A buffer is appropriate for Highlight Changes mode if all these are true:
1058- the buffer is not a special buffer (one whose name begins with 1058- the buffer is not a special buffer (one whose name begins with
1059 `*' or ` ') 1059 `*' or ` ')
1060- the buffer's mode is suitable as per variable 1060- the buffer's mode is suitable as per variable
1061 `highlight-changes-global-modes' 1061 `highlight-changes-global-modes'
1062- Highlight Changes mode is not already on for this buffer. 1062- Highlight Changes mode is not already on for this buffer.
1063 1063
1064This function is called from `hilit-chg-update-all-buffers' or 1064This function is called from `hilit-chg-update-all-buffers' or
1065from `global-highlight-changes' when turning on global Highlight Changes mode." 1065from `global-highlight-changes' when turning on global Highlight Changes mode."
1066 (or highlight-changes-mode ; do nothing if already on 1066 (or highlight-changes-mode ; do nothing if already on
1067 (if 1067 (if
@@ -1075,13 +1075,13 @@ from `global-highlight-changes' when turning on global Highlight Changes mode."
1075 (not (memq major-mode (cdr highlight-changes-global-modes))) 1075 (not (memq major-mode (cdr highlight-changes-global-modes)))
1076 (memq major-mode highlight-changes-global-modes))) 1076 (memq major-mode highlight-changes-global-modes)))
1077 (t 1077 (t
1078 (and 1078 (and
1079 (not (string-match "^[ *]" (buffer-name))) 1079 (not (string-match "^[ *]" (buffer-name)))
1080 (buffer-file-name)))) 1080 (buffer-file-name))))
1081 (progn 1081 (progn
1082 (hilit-chg-set value) 1082 (hilit-chg-set value)
1083 (run-hooks 'highlight-changes-enable-hook))))) 1083 (run-hooks 'highlight-changes-enable-hook)))))
1084 1084
1085 1085
1086(defun hilit-chg-turn-off-maybe () 1086(defun hilit-chg-turn-off-maybe ()
1087 (if highlight-changes-mode 1087 (if highlight-changes-mode
@@ -1111,7 +1111,7 @@ from `global-highlight-changes' when turning on global Highlight Changes mode."
1111;; ) 1111;; )
1112;; beg end 1112;; beg end
1113;; )) 1113;; ))
1114;; 1114;;
1115;; ================== end of debug =============== 1115;; ================== end of debug ===============
1116 1116
1117(provide 'hilit-chg) 1117(provide 'hilit-chg)
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 4aa1ec0874f..902b2f7cfbb 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -88,7 +88,7 @@ regardless of any active filters in this buffer."
88 88
89(defvar ibuffer-tmp-hide-regexps nil 89(defvar ibuffer-tmp-hide-regexps nil
90 "A list of regexps which should match buffer names to not show.") 90 "A list of regexps which should match buffer names to not show.")
91 91
92(defvar ibuffer-tmp-show-regexps nil 92(defvar ibuffer-tmp-show-regexps nil
93 "A list of regexps which should match buffer names to always show.") 93 "A list of regexps which should match buffer names to always show.")
94 94
@@ -112,7 +112,7 @@ Do not set this variable directly! Use the function
112 (mode . java-mode) 112 (mode . java-mode)
113 (mode . idl-mode) 113 (mode . idl-mode)
114 (mode . lisp-mode))))) 114 (mode . lisp-mode)))))
115 115
116 "An alist of filter qualifiers to switch between. 116 "An alist of filter qualifiers to switch between.
117 117
118This variable should look like ((\"STRING\" QUALIFIERS) 118This variable should look like ((\"STRING\" QUALIFIERS)
@@ -170,7 +170,7 @@ The QUALIFIER should be the same as QUALIFIER in
170 :group 'ibuffer) 170 :group 'ibuffer)
171 171
172(defcustom ibuffer-saved-filter-groups nil 172(defcustom ibuffer-saved-filter-groups nil
173 173
174 "An alist of filtering groups to switch between. 174 "An alist of filtering groups to switch between.
175 175
176This variable should look like ((\"STRING\" QUALIFIERS) 176This variable should look like ((\"STRING\" QUALIFIERS)
@@ -921,7 +921,7 @@ of replacing the current filters."
921 (concat "Filter: " (mapconcat #'ibuffer-format-qualifier 921 (concat "Filter: " (mapconcat #'ibuffer-format-qualifier
922 (cdr (assq filter ibuffer-filter-groups)) 922 (cdr (assq filter ibuffer-filter-groups))
923 " ") "\n"))) 923 " ") "\n")))
924 924
925(defun ibuffer-format-qualifier (qualifier) 925(defun ibuffer-format-qualifier (qualifier)
926 (if (eq (car-safe qualifier) 'not) 926 (if (eq (car-safe qualifier) 'not)
927 (concat " [NOT" (ibuffer-format-qualifier-1 (cdr qualifier)) "]") 927 (concat " [NOT" (ibuffer-format-qualifier-1 (cdr qualifier)) "]")
@@ -939,7 +939,7 @@ of replacing the current filters."
939 (unless qualifier 939 (unless qualifier
940 (error "Ibuffer: bad qualifier %s" qualifier)) 940 (error "Ibuffer: bad qualifier %s" qualifier))
941 (concat " [" (cadr type) ": " (format "%s]" (cdr qualifier))))))) 941 (concat " [" (cadr type) ": " (format "%s]" (cdr qualifier)))))))
942 942
943 943
944(defun ibuffer-list-buffer-modes () 944(defun ibuffer-list-buffer-modes ()
945 "Create an alist of buffer modes currently in use. 945 "Create an alist of buffer modes currently in use.
diff --git a/lisp/ibuf-macs.el b/lisp/ibuf-macs.el
index 03ef2404f4e..e12a1199939 100644
--- a/lisp/ibuf-macs.el
+++ b/lisp/ibuf-macs.el
@@ -125,7 +125,7 @@ change its definition, you should explicitly call
125 125
126;;;###autoload 126;;;###autoload
127(defmacro* define-ibuffer-sorter (name documentation 127(defmacro* define-ibuffer-sorter (name documentation
128 (&key 128 (&key
129 description) 129 description)
130 &rest body) 130 &rest body)
131 "Define a method of sorting named NAME. 131 "Define a method of sorting named NAME.
@@ -152,7 +152,7 @@ value if and only if `a' is \"less than\" `b'."
152;;;###autoload 152;;;###autoload
153(defmacro* define-ibuffer-op (op args 153(defmacro* define-ibuffer-op (op args
154 documentation 154 documentation
155 (&key 155 (&key
156 interactive 156 interactive
157 mark 157 mark
158 modifier-p 158 modifier-p
@@ -253,7 +253,7 @@ macro for exactly what it does."
253 253
254;;;###autoload 254;;;###autoload
255(defmacro* define-ibuffer-filter (name documentation 255(defmacro* define-ibuffer-filter (name documentation
256 (&key 256 (&key
257 reader 257 reader
258 description) 258 description)
259 &rest body) 259 &rest body)
@@ -267,7 +267,7 @@ not a particular buffer should be displayed or not. The forms in BODY
267will be evaluated with BUF bound to the buffer object, and QUALIFIER 267will be evaluated with BUF bound to the buffer object, and QUALIFIER
268bound to the current value of the filter." 268bound to the current value of the filter."
269 (let ((fn-name (intern (concat "ibuffer-filter-by-" (symbol-name name))))) 269 (let ((fn-name (intern (concat "ibuffer-filter-by-" (symbol-name name)))))
270 `(progn 270 `(progn
271 (defun ,fn-name (qualifier) 271 (defun ,fn-name (qualifier)
272 ,(concat (or documentation "This filter is not documented.")) 272 ,(concat (or documentation "This filter is not documented."))
273 (interactive (list ,reader)) 273 (interactive (list ,reader))
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 9fa551e3718..dca5667d4a3 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -364,12 +364,12 @@ directory, like `default-directory'."
364 (define-key map (kbd "* e") 'ibuffer-mark-dissociated-buffers) 364 (define-key map (kbd "* e") 'ibuffer-mark-dissociated-buffers)
365 (define-key map (kbd "* h") 'ibuffer-mark-help-buffers) 365 (define-key map (kbd "* h") 'ibuffer-mark-help-buffers)
366 (define-key map (kbd ".") 'ibuffer-mark-old-buffers) 366 (define-key map (kbd ".") 'ibuffer-mark-old-buffers)
367 367
368 (define-key map (kbd "d") 'ibuffer-mark-for-delete) 368 (define-key map (kbd "d") 'ibuffer-mark-for-delete)
369 (define-key map (kbd "C-d") 'ibuffer-mark-for-delete-backwards) 369 (define-key map (kbd "C-d") 'ibuffer-mark-for-delete-backwards)
370 (define-key map (kbd "k") 'ibuffer-mark-for-delete) 370 (define-key map (kbd "k") 'ibuffer-mark-for-delete)
371 (define-key map (kbd "x") 'ibuffer-do-kill-on-deletion-marks) 371 (define-key map (kbd "x") 'ibuffer-do-kill-on-deletion-marks)
372 372
373 ;; immediate operations 373 ;; immediate operations
374 (define-key map (kbd "n") 'ibuffer-forward-line) 374 (define-key map (kbd "n") 'ibuffer-forward-line)
375 (define-key map (kbd "<down>") 'ibuffer-forward-line) 375 (define-key map (kbd "<down>") 'ibuffer-forward-line)
@@ -425,7 +425,7 @@ directory, like `default-directory'."
425 (define-key map (kbd "/ R") 'ibuffer-switch-to-saved-filter-groups) 425 (define-key map (kbd "/ R") 'ibuffer-switch-to-saved-filter-groups)
426 (define-key map (kbd "/ X") 'ibuffer-delete-saved-filter-groups) 426 (define-key map (kbd "/ X") 'ibuffer-delete-saved-filter-groups)
427 (define-key map (kbd "/ \\") 'ibuffer-clear-filter-groups) 427 (define-key map (kbd "/ \\") 'ibuffer-clear-filter-groups)
428 428
429 (define-key map (kbd "q") 'ibuffer-quit) 429 (define-key map (kbd "q") 'ibuffer-quit)
430 (define-key map (kbd "h") 'describe-mode) 430 (define-key map (kbd "h") 'describe-mode)
431 (define-key map (kbd "?") 'describe-mode) 431 (define-key map (kbd "?") 'describe-mode)
@@ -433,7 +433,7 @@ directory, like `default-directory'."
433 (define-key map (kbd "% n") 'ibuffer-mark-by-name-regexp) 433 (define-key map (kbd "% n") 'ibuffer-mark-by-name-regexp)
434 (define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp) 434 (define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp)
435 (define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp) 435 (define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp)
436 436
437 (define-key map (kbd "C-t") 'ibuffer-visit-tags-table) 437 (define-key map (kbd "C-t") 'ibuffer-visit-tags-table)
438 438
439 (define-key map (kbd "|") 'ibuffer-do-shell-command-pipe) 439 (define-key map (kbd "|") 'ibuffer-do-shell-command-pipe)
@@ -458,7 +458,7 @@ directory, like `default-directory'."
458 (define-key map (kbd "V") 'ibuffer-do-revert) 458 (define-key map (kbd "V") 'ibuffer-do-revert)
459 (define-key map (kbd "W") 'ibuffer-do-view-and-eval) 459 (define-key map (kbd "W") 'ibuffer-do-view-and-eval)
460 (define-key map (kbd "X") 'ibuffer-do-shell-command-pipe) 460 (define-key map (kbd "X") 'ibuffer-do-shell-command-pipe)
461 461
462 (define-key map (kbd "k") 'ibuffer-do-kill-lines) 462 (define-key map (kbd "k") 'ibuffer-do-kill-lines)
463 (define-key map (kbd "w") 'ibuffer-copy-filename-as-kill) 463 (define-key map (kbd "w") 'ibuffer-copy-filename-as-kill)
464 464
@@ -683,10 +683,10 @@ directory, like `default-directory'."
683 :help "Mark buffers which have not been viewed recently")) 683 :help "Mark buffers which have not been viewed recently"))
684 (define-key-after map [menu-bar mark unmark-all] 684 (define-key-after map [menu-bar mark unmark-all]
685 '(menu-item "Unmark All" ibuffer-unmark-all)) 685 '(menu-item "Unmark All" ibuffer-unmark-all))
686 686
687 (define-key-after map [menu-bar mark dashes] 687 (define-key-after map [menu-bar mark dashes]
688 '("--")) 688 '("--"))
689 689
690 (define-key-after map [menu-bar mark mark-by-name-regexp] 690 (define-key-after map [menu-bar mark mark-by-name-regexp]
691 '(menu-item "Mark by buffer name (regexp)..." ibuffer-mark-by-name-regexp 691 '(menu-item "Mark by buffer name (regexp)..." ibuffer-mark-by-name-regexp
692 :help "Mark buffers whose name matches a regexp")) 692 :help "Mark buffers whose name matches a regexp"))
@@ -744,7 +744,7 @@ directory, like `default-directory'."
744 (define-key-after operate-map [do-view-and-eval] 744 (define-key-after operate-map [do-view-and-eval]
745 '(menu-item "Eval (viewing buffer)..." ibuffer-do-view-and-eval 745 '(menu-item "Eval (viewing buffer)..." ibuffer-do-view-and-eval
746 :help "Evaluate a Lisp form in each marked buffer while viewing it")) 746 :help "Evaluate a Lisp form in each marked buffer while viewing it"))
747 747
748 (setq ibuffer-mode-map map 748 (setq ibuffer-mode-map map
749 ibuffer-mode-operate-map operate-map 749 ibuffer-mode-operate-map operate-map
750 ibuffer-mode-groups-popup (copy-keymap groups-map)))) 750 ibuffer-mode-groups-popup (copy-keymap groups-map))))
@@ -1094,7 +1094,7 @@ a new window in the current frame, splitting vertically."
1094 ;; Handle a failure 1094 ;; Handle a failure
1095 (if (or (> (incf attempts) 4) 1095 (if (or (> (incf attempts) 4)
1096 (and (stringp (cadr err)) 1096 (and (stringp (cadr err))
1097 ;; This definitely falls in the 1097 ;; This definitely falls in the
1098 ;; ghetto hack category... 1098 ;; ghetto hack category...
1099 (not (string-match "too small" (cadr err))))) 1099 (not (string-match "too small" (cadr err)))))
1100 (apply #'signal err) 1100 (apply #'signal err)
@@ -1338,7 +1338,7 @@ If point is on a group name, this function operates on that group."
1338 (if uncompiledp 1338 (if uncompiledp
1339 ibuffer-filter-format-alist 1339 ibuffer-filter-format-alist
1340 ibuffer-compiled-filter-formats)))))) 1340 ibuffer-compiled-filter-formats))))))
1341 1341
1342(defun ibuffer-current-format (&optional uncompiledp) 1342(defun ibuffer-current-format (&optional uncompiledp)
1343 (or ibuffer-current-format 1343 (or ibuffer-current-format
1344 (setq ibuffer-current-format 0)) 1344 (setq ibuffer-current-format 0))
@@ -1366,7 +1366,7 @@ If point is on a group name, this function operates on that group."
1366 elide nil)) 1366 elide nil))
1367 (list sym min max align elide))) 1367 (list sym min max align elide)))
1368 form)) 1368 form))
1369 1369
1370(defun ibuffer-compile-make-eliding-form (strvar elide from-end-p) 1370(defun ibuffer-compile-make-eliding-form (strvar elide from-end-p)
1371 (let ((ellipsis (propertize ibuffer-eliding-string 'font-lock-face 'bold))) 1371 (let ((ellipsis (propertize ibuffer-eliding-string 'font-lock-face 'bold)))
1372 (if (or elide ibuffer-elide-long-columns) 1372 (if (or elide ibuffer-elide-long-columns)
@@ -1566,7 +1566,7 @@ If point is on a group name, this function operates on that group."
1566 (ibuffer-awhen (and (consp form) 1566 (ibuffer-awhen (and (consp form)
1567 (get (car form) 'ibuffer-column-summarizer)) 1567 (get (car form) 'ibuffer-column-summarizer))
1568 (put (car form) 'ibuffer-column-summary nil)))) 1568 (put (car form) 'ibuffer-column-summary nil))))
1569 1569
1570(defun ibuffer-check-formats () 1570(defun ibuffer-check-formats ()
1571 (when (null ibuffer-formats) 1571 (when (null ibuffer-formats)
1572 (error "No formats!")) 1572 (error "No formats!"))
@@ -1614,7 +1614,7 @@ If point is on a group name, this function operates on that group."
1614 'ibuffer-name-column t 1614 'ibuffer-name-column t
1615 'help-echo "mouse-1: mark this buffer\nmouse-2: select this buffer\nmouse-3: operate on this buffer")) 1615 'help-echo "mouse-1: mark this buffer\nmouse-2: select this buffer\nmouse-3: operate on this buffer"))
1616 (propertize (buffer-name) 'font-lock-face (ibuffer-buffer-name-face buffer mark))) 1616 (propertize (buffer-name) 'font-lock-face (ibuffer-buffer-name-face buffer mark)))
1617 1617
1618(define-ibuffer-column size (:inline t) 1618(define-ibuffer-column size (:inline t)
1619 (format "%s" (buffer-size))) 1619 (format "%s" (buffer-size)))
1620 1620
@@ -1698,7 +1698,7 @@ If point is on a group name, this function operates on that group."
1698 (ibuffer-current-format))) 1698 (ibuffer-current-format)))
1699 (when ibuffer-shrink-to-minimum-size 1699 (when ibuffer-shrink-to-minimum-size
1700 (ibuffer-shrink-to-fit))))))) 1700 (ibuffer-shrink-to-fit)))))))
1701 1701
1702(defun ibuffer-map-on-mark (mark func) 1702(defun ibuffer-map-on-mark (mark func)
1703 (ibuffer-map-lines 1703 (ibuffer-map-lines
1704 #'(lambda (buf mk) 1704 #'(lambda (buf mk)
@@ -1817,7 +1817,7 @@ the value of point at the beginning of the line for that buffer."
1817 (funcall pred buf)) 1817 (funcall pred buf))
1818 (setq hit t))) 1818 (setq hit t)))
1819 hit)) 1819 hit))
1820 1820
1821(defun ibuffer-filter-buffers (ibuffer-buf last bmarklist all) 1821(defun ibuffer-filter-buffers (ibuffer-buf last bmarklist all)
1822 (let ((ext-loaded (featurep 'ibuf-ext))) 1822 (let ((ext-loaded (featurep 'ibuf-ext)))
1823 (delq nil 1823 (delq nil
@@ -2300,7 +2300,7 @@ Filter group commands:
2300 '\\[ibuffer-save-filter-groups]' - Save the current groups with a name. 2300 '\\[ibuffer-save-filter-groups]' - Save the current groups with a name.
2301 '\\[ibuffer-switch-to-saved-filter-groups]' - Restore previously saved groups. 2301 '\\[ibuffer-switch-to-saved-filter-groups]' - Restore previously saved groups.
2302 '\\[ibuffer-delete-saved-filter-groups]' - Delete previously saved groups. 2302 '\\[ibuffer-delete-saved-filter-groups]' - Delete previously saved groups.
2303 2303
2304Sorting commands: 2304Sorting commands:
2305 2305
2306 '\\[ibuffer-toggle-sorting-mode]' - Rotate between the various sorting modes. 2306 '\\[ibuffer-toggle-sorting-mode]' - Rotate between the various sorting modes.
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 786c0a55228..4e368c8c806 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -71,7 +71,7 @@
71 71
72(defcustom icomplete-mode nil 72(defcustom icomplete-mode nil
73 "*Toggle incremental minibuffer completion. 73 "*Toggle incremental minibuffer completion.
74As text is typed into the minibuffer, prospective completions are indicated 74As text is typed into the minibuffer, prospective completions are indicated
75in the minibuffer. 75in the minibuffer.
76Setting this variable directly does not take effect; 76Setting this variable directly does not take effect;
77use either \\[customize] or the function `icomplete-mode'." 77use either \\[customize] or the function `icomplete-mode'."
diff --git a/lisp/ido.el b/lisp/ido.el
index 0391ec68b4a..eda6827eb2c 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -26,7 +26,7 @@
26;;; Acknowledgements 26;;; Acknowledgements
27 27
28;; Infinite amounts of gratitude goes to Stephen Eglen <stephen@cns.ed.ac.uk> 28;; Infinite amounts of gratitude goes to Stephen Eglen <stephen@cns.ed.ac.uk>
29;; who wrote iswitch-buffer mode - from which I ripped off 99% of the code 29;; who wrote iswitch-buffer mode - from which I ripped off 99% of the code
30;; for ido-switch-buffer and found the inspiration for ido-find-file. 30;; for ido-switch-buffer and found the inspiration for ido-find-file.
31;; The ido package would never have existed without his work. 31;; The ido package would never have existed without his work.
32 32
@@ -92,7 +92,7 @@
92;; most recent, when I use ido-switch-buffer, I first of all get 92;; most recent, when I use ido-switch-buffer, I first of all get
93;; presented with the list of all the buffers 93;; presented with the list of all the buffers
94;; 94;;
95;; Buffer: {123456,123} 95;; Buffer: {123456,123}
96;; 96;;
97;; If I then press 2: 97;; If I then press 2:
98;; Buffer: 2[3]{123456,123} 98;; Buffer: 2[3]{123456,123}
@@ -156,7 +156,7 @@
156;; drive, enter X:/ where X is the drive letter. You can also visit 156;; drive, enter X:/ where X is the drive letter. You can also visit
157;; files on other hosts using the ange-ftp notations `/host:' and 157;; files on other hosts using the ange-ftp notations `/host:' and
158;; `/user@host:'. See the variable `ido-slow-ftp-hosts' if you want 158;; `/user@host:'. See the variable `ido-slow-ftp-hosts' if you want
159;; to inhibit the ido substring matching for ftp access. 159;; to inhibit the ido substring matching for ftp access.
160;; 160;;
161;; If for some reason you cannot specify the proper file using 161;; If for some reason you cannot specify the proper file using
162;; ido-find-file, you can press C-f to enter the normal find-file. 162;; ido-find-file, you can press C-f to enter the normal find-file.
@@ -345,7 +345,7 @@
345 "Determines for which functional group \(buffer and files) ido behavior 345 "Determines for which functional group \(buffer and files) ido behavior
346should be enabled. The following values are possible: 346should be enabled. The following values are possible:
347- `buffer': Turn only on ido buffer behavior \(switching, killing, 347- `buffer': Turn only on ido buffer behavior \(switching, killing,
348 displaying...) 348 displaying...)
349- `file': Turn only on ido file behavior \(finding, writing, inserting...) 349- `file': Turn only on ido file behavior \(finding, writing, inserting...)
350- `both': Turn on ido buffer and file behavior. 350- `both': Turn on ido buffer and file behavior.
351- `nil': Turn off any ido switching. 351- `nil': Turn off any ido switching.
@@ -359,7 +359,7 @@ use either \\[customize] or the function `ido-mode'."
359 :link '(emacs-commentary-link "ido.el") 359 :link '(emacs-commentary-link "ido.el")
360 :set-after '(ido-save-directory-list-file) 360 :set-after '(ido-save-directory-list-file)
361 :version "21.4" 361 :version "21.4"
362 :type '(choice (const :tag "Turn on only buffer" buffer) 362 :type '(choice (const :tag "Turn on only buffer" buffer)
363 (const :tag "Turn on only file" file) 363 (const :tag "Turn on only file" file)
364 (const :tag "Turn on both buffer and file" both) 364 (const :tag "Turn on both buffer and file" both)
365 (const :tag "Switch off all" nil)) 365 (const :tag "Switch off all" nil))
@@ -446,10 +446,10 @@ Possible values:
446 frame or in the other frame. 446 frame or in the other frame.
447`always-frame' If a file is visible in another frame, raise that 447`always-frame' If a file is visible in another frame, raise that
448 frame. Otherwise, visit the file in the same window." 448 frame. Otherwise, visit the file in the same window."
449 :type '(choice (const samewindow) 449 :type '(choice (const samewindow)
450 (const otherwindow) 450 (const otherwindow)
451 (const display) 451 (const display)
452 (const otherframe) 452 (const otherframe)
453 (const maybe-frame) 453 (const maybe-frame)
454 (const always-frame)) 454 (const always-frame))
455 :group 'ido) 455 :group 'ido)
@@ -457,10 +457,10 @@ Possible values:
457(defcustom ido-default-buffer-method 'always-frame 457(defcustom ido-default-buffer-method 'always-frame
458 "*How to switch to new buffer when using `ido-switch-buffer'. 458 "*How to switch to new buffer when using `ido-switch-buffer'.
459See ido-default-file-method for details." 459See ido-default-file-method for details."
460 :type '(choice (const samewindow) 460 :type '(choice (const samewindow)
461 (const otherwindow) 461 (const otherwindow)
462 (const display) 462 (const display)
463 (const otherframe) 463 (const otherframe)
464 (const maybe-frame) 464 (const maybe-frame)
465 (const always-frame)) 465 (const always-frame))
466 :group 'ido) 466 :group 'ido)
@@ -646,7 +646,7 @@ See also `ido-dir-file-cache' and `ido-save-directory-list-file'."
646(defcustom ido-enter-single-matching-directory 'slash 646(defcustom ido-enter-single-matching-directory 'slash
647 "*Automatically enter sub-directory if it is the only matching item, if non-nil. 647 "*Automatically enter sub-directory if it is the only matching item, if non-nil.
648If value is 'slash, only enter if typing final slash, else do it always." 648If value is 'slash, only enter if typing final slash, else do it always."
649 :type '(choice (const :tag "Never" nil) 649 :type '(choice (const :tag "Never" nil)
650 (const :tag "When typing /" slash) 650 (const :tag "When typing /" slash)
651 (other :tag "Always" t)) 651 (other :tag "Always" t))
652 :group 'ido) 652 :group 'ido)
@@ -655,7 +655,7 @@ If value is 'slash, only enter if typing final slash, else do it always."
655 "*Specify whether a new buffer is created if no buffer matches substring. 655 "*Specify whether a new buffer is created if no buffer matches substring.
656Choices are 'always to create new buffers unconditionally, 'prompt to 656Choices are 'always to create new buffers unconditionally, 'prompt to
657ask user whether to create buffer, or 'never to never create new buffer." 657ask user whether to create buffer, or 'never to never create new buffer."
658 :type '(choice (const always) 658 :type '(choice (const always)
659 (const prompt) 659 (const prompt)
660 (const never)) 660 (const never))
661 :group 'ido) 661 :group 'ido)
@@ -679,7 +679,7 @@ There are 8 elements in this list, each is a pair of strings:
6794th element is the string inserted at the end of a truncated list of prospects, 6794th element is the string inserted at the end of a truncated list of prospects,
6805th and 6th elements are used as brackets around the common match string which 6805th and 6th elements are used as brackets around the common match string which
681can be completed using TAB, 681can be completed using TAB,
6827th element is the string displayed when there are a no matches, and 6827th element is the string displayed when there are a no matches, and
6838th element displayed if there is a single match (and faces are not used)." 6838th element displayed if there is a single match (and faces are not used)."
684 :type '(repeat string) 684 :type '(repeat string)
685 :group 'ido) 685 :group 'ido)
@@ -694,19 +694,19 @@ subdirs in the alternatives."
694 "*Font used by ido for highlighting first match." 694 "*Font used by ido for highlighting first match."
695 :group 'ido) 695 :group 'ido)
696 696
697(defface ido-only-match-face '((((class color)) 697(defface ido-only-match-face '((((class color))
698 (:foreground "ForestGreen")) 698 (:foreground "ForestGreen"))
699 (t (:italic t))) 699 (t (:italic t)))
700 "*Font used by ido for highlighting only match." 700 "*Font used by ido for highlighting only match."
701 :group 'ido) 701 :group 'ido)
702 702
703(defface ido-subdir-face '((((class color)) 703(defface ido-subdir-face '((((class color))
704 (:foreground "red")) 704 (:foreground "red"))
705 (t (:underline t))) 705 (t (:underline t)))
706 "*Font used by ido for highlighting subdirs in the alternatives." 706 "*Font used by ido for highlighting subdirs in the alternatives."
707 :group 'ido) 707 :group 'ido)
708 708
709(defface ido-indicator-face '((((class color)) 709(defface ido-indicator-face '((((class color))
710 (:foreground "yellow" 710 (:foreground "yellow"
711 :background "red" 711 :background "red"
712 :width condensed)) 712 :width condensed))
@@ -786,7 +786,7 @@ This hook is run during minibuffer setup iff `ido' will be active.
786It is intended for use in customizing ido for interoperation 786It is intended for use in customizing ido for interoperation
787with other packages. For instance: 787with other packages. For instance:
788 788
789 \(add-hook 'ido-minibuffer-setup-hook 789 \(add-hook 'ido-minibuffer-setup-hook
790 \(function 790 \(function
791 \(lambda () 791 \(lambda ()
792 \(make-local-variable 'max-mini-window-height) 792 \(make-local-variable 'max-mini-window-height)
@@ -884,8 +884,8 @@ Copied from `icomplete-eoinput'.")
884(defvar ido-report-no-match t 884(defvar ido-report-no-match t
885 "Report [No Match] when no completions matches ido-text.") 885 "Report [No Match] when no completions matches ido-text.")
886 886
887(defvar ido-exit nil 887(defvar ido-exit nil
888 "Flag to monitor how `ido-find-file' exits. 888 "Flag to monitor how `ido-find-file' exits.
889If equal to `takeprompt', we use the prompt as the file name to be 889If equal to `takeprompt', we use the prompt as the file name to be
890selected.") 890selected.")
891 891
@@ -896,7 +896,7 @@ selected.")
896 "Delay timer for auto merge.") 896 "Delay timer for auto merge.")
897 897
898(defvar ido-use-mycompletion-depth 0 898(defvar ido-use-mycompletion-depth 0
899 "Non-nil means use `ido' completion feedback. 899 "Non-nil means use `ido' completion feedback.
900Is set by ido functions to the current minibuffer-depth, so that 900Is set by ido functions to the current minibuffer-depth, so that
901it doesn't interfere with other minibuffer usage.") 901it doesn't interfere with other minibuffer usage.")
902 902
@@ -1008,7 +1008,7 @@ it doesn't interfere with other minibuffer usage.")
1008 (string-match "\\`/[^:/][^:/]+:\\'" dir)))) 1008 (string-match "\\`/[^:/][^:/]+:\\'" dir))))
1009 1009
1010(defun ido-is-ftp-directory (&optional dir) 1010(defun ido-is-ftp-directory (&optional dir)
1011 (string-match 1011 (string-match
1012 (if ido-enable-tramp-completion 1012 (if ido-enable-tramp-completion
1013 "\\`/[^/:][^/:]+:" ;; like tramp-file-name-regexp-unified, but doesn't match single drive letters 1013 "\\`/[^/:][^/:]+:" ;; like tramp-file-name-regexp-unified, but doesn't match single drive letters
1014 "\\`/[^/:][^/:]+:/") 1014 "\\`/[^/:][^/:]+:/")
@@ -1019,7 +1019,7 @@ it doesn't interfere with other minibuffer usage.")
1019 (setq dir (or dir ido-current-directory)) 1019 (setq dir (or dir ido-current-directory))
1020 ;; (featurep 'ange-ftp) 1020 ;; (featurep 'ange-ftp)
1021 ;; (ange-ftp-ftp-name dir) 1021 ;; (ange-ftp-ftp-name dir)
1022 (string-match 1022 (string-match
1023 (if ido-enable-tramp-completion 1023 (if ido-enable-tramp-completion
1024 "\\`/\\([^/]+[@:]\\)*\\([^@/:][^@/:]+\\):" 1024 "\\`/\\([^/]+[@:]\\)*\\([^@/:][^@/:]+\\):"
1025 "\\`/\\([^/:]*@\\)?\\([^@/:][^@/:]+\\):/") 1025 "\\`/\\([^/:]*@\\)?\\([^@/:][^@/:]+\\):/")
@@ -1130,7 +1130,7 @@ Removes badly formatted data and ignored directories."
1130 (setq r (cons (car l) r))) 1130 (setq r (cons (car l) r)))
1131 (setq l (cdr l))) 1131 (setq l (cdr l)))
1132 (nreverse r)))) 1132 (nreverse r))))
1133 (setq ido-work-directory-list 1133 (setq ido-work-directory-list
1134 (and (listp ido-work-directory-list) 1134 (and (listp ido-work-directory-list)
1135 (let ((l ido-work-directory-list) r) 1135 (let ((l ido-work-directory-list) r)
1136 (while l 1136 (while l
@@ -1140,7 +1140,7 @@ Removes badly formatted data and ignored directories."
1140 (setq r (cons (car l) r))) 1140 (setq r (cons (car l) r)))
1141 (setq l (cdr l))) 1141 (setq l (cdr l)))
1142 (nreverse r)))) 1142 (nreverse r))))
1143 (setq ido-work-file-list 1143 (setq ido-work-file-list
1144 (and (listp ido-work-file-list) 1144 (and (listp ido-work-file-list)
1145 (let ((l ido-work-file-list) r) 1145 (let ((l ido-work-file-list) r)
1146 (while l 1146 (while l
@@ -1148,7 +1148,7 @@ Removes badly formatted data and ignored directories."
1148 (setq r (cons (car l) r))) 1148 (setq r (cons (car l) r)))
1149 (setq l (cdr l))) 1149 (setq l (cdr l)))
1150 (nreverse r)))) 1150 (nreverse r))))
1151 (setq ido-dir-file-cache 1151 (setq ido-dir-file-cache
1152 (and (listp ido-dir-file-cache) 1152 (and (listp ido-dir-file-cache)
1153 (let ((l ido-dir-file-cache) r) 1153 (let ((l ido-dir-file-cache) r)
1154 (while l 1154 (while l
@@ -1223,15 +1223,15 @@ Removes badly formatted data and ignored directories."
1223 "Toggle ido speed-ups on or off. 1223 "Toggle ido speed-ups on or off.
1224With ARG, turn ido speed-up on if arg is positive, off otherwise. 1224With ARG, turn ido speed-up on if arg is positive, off otherwise.
1225If second argument NOBIND is non-nil, no keys are rebound; otherwise, 1225If second argument NOBIND is non-nil, no keys are rebound; otherwise,
1226turning on ido-mode will modify the default keybindings for the 1226turning on ido-mode will modify the default keybindings for the
1227find-file and switch-to-buffer families of commands to the ido 1227find-file and switch-to-buffer families of commands to the ido
1228versions of these functions. 1228versions of these functions.
1229However, if second arg equals 'files, bind only for files, or if it 1229However, if second arg equals 'files, bind only for files, or if it
1230equals 'buffers, bind only for buffers. 1230equals 'buffers, bind only for buffers.
1231This function also adds a hook to the minibuffer." 1231This function also adds a hook to the minibuffer."
1232 (interactive "P") 1232 (interactive "P")
1233 (setq ido-mode 1233 (setq ido-mode
1234 (cond 1234 (cond
1235 ((null arg) (if ido-mode nil 'both)) 1235 ((null arg) (if ido-mode nil 'both))
1236 ((eq arg t) 'both) 1236 ((eq arg t) 'both)
1237 ((eq arg 'files) 'file) 1237 ((eq arg 'files) 'file)
@@ -1279,9 +1279,9 @@ This function also adds a hook to the minibuffer."
1279 "Enable ido everywhere file and directory names are read." 1279 "Enable ido everywhere file and directory names are read."
1280 (interactive "P") 1280 (interactive "P")
1281 (setq ido-everywhere (if arg 1281 (setq ido-everywhere (if arg
1282 (> (prefix-numeric-value arg) 0) 1282 (> (prefix-numeric-value arg) 0)
1283 (not ido-everywhere))) 1283 (not ido-everywhere)))
1284 (setq read-file-name-function 1284 (setq read-file-name-function
1285 (and ido-everywhere (memq ido-mode '(both file)) 1285 (and ido-everywhere (memq ido-mode '(both file))
1286 'ido-read-file-name)) 1286 'ido-read-file-name))
1287 (setq read-buffer-function 1287 (setq read-buffer-function
@@ -1289,7 +1289,7 @@ This function also adds a hook to the minibuffer."
1289 'ido-read-buffer))) 1289 'ido-read-buffer)))
1290 1290
1291 1291
1292;;; IDO KEYMAP 1292;;; IDO KEYMAP
1293(defun ido-define-mode-map () 1293(defun ido-define-mode-map ()
1294 "Set up the keymap for `ido'." 1294 "Set up the keymap for `ido'."
1295 (let (map) 1295 (let (map)
@@ -1421,14 +1421,14 @@ This function also adds a hook to the minibuffer."
1421 (funcall (cdr (car rule)) dirname)))) 1421 (funcall (cdr (car rule)) dirname))))
1422 (setq rule (cdr rule)))) 1422 (setq rule (cdr rule))))
1423 (run-hooks 'ido-rewrite-file-prompt-functions) 1423 (run-hooks 'ido-rewrite-file-prompt-functions)
1424 (concat prompt 1424 (concat prompt
1425 ; (if ido-process-ignore-lists "" "&") 1425 ; (if ido-process-ignore-lists "" "&")
1426 (or literal "") 1426 (or literal "")
1427 (or vc-off "") 1427 (or vc-off "")
1428 (or prefix "") 1428 (or prefix "")
1429 (let ((l (length dirname))) 1429 (let ((l (length dirname)))
1430 (if (and max-width (> max-width 0) (> l max-width)) 1430 (if (and max-width (> max-width 0) (> l max-width))
1431 (let* ((s (substring dirname (- max-width))) 1431 (let* ((s (substring dirname (- max-width)))
1432 (i (string-match "/" s))) 1432 (i (string-match "/" s)))
1433 (concat "..." (if i (substring s i) s))) 1433 (concat "..." (if i (substring s i) s)))
1434 dirname))))) 1434 dirname)))))
@@ -1468,7 +1468,7 @@ This function also adds a hook to the minibuffer."
1468 1468
1469(defun ido-read-internal (item prompt history &optional default require-match initial) 1469(defun ido-read-internal (item prompt history &optional default require-match initial)
1470 "Perform the ido-read-buffer and ido-read-file-name functions. 1470 "Perform the ido-read-buffer and ido-read-file-name functions.
1471Return the name of a buffer or file selected. 1471Return the name of a buffer or file selected.
1472PROMPT is the prompt to give to the user. 1472PROMPT is the prompt to give to the user.
1473DEFAULT if given is the default directory to start with. 1473DEFAULT if given is the default directory to start with.
1474If REQUIRE-MATCH is non-nil, an existing file must be selected. 1474If REQUIRE-MATCH is non-nil, an existing file must be selected.
@@ -1512,7 +1512,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1512 (if (bufferp default) (buffer-name default) default)) 1512 (if (bufferp default) (buffer-name default) default))
1513 ((stringp default) default) 1513 ((stringp default) default)
1514 ((eq item 'file) 1514 ((eq item 'file)
1515 (and ido-enable-last-directory-history 1515 (and ido-enable-last-directory-history
1516 (let ((d (assoc ido-current-directory ido-last-directory-list))) 1516 (let ((d (assoc ido-current-directory ido-last-directory-list)))
1517 (and d (cdr d))))))) 1517 (and d (cdr d)))))))
1518 (if (member ido-default-item ido-ignore-item-temp-list) 1518 (if (member ido-default-item ido-ignore-item-temp-list)
@@ -1562,7 +1562,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1562 ido-use-merged-list t) 1562 ido-use-merged-list t)
1563 (ido-trace "Merged" t) 1563 (ido-trace "Merged" t)
1564 )))) 1564 ))))
1565 1565
1566 (cond 1566 (cond
1567 (ido-keep-item-list 1567 (ido-keep-item-list
1568 (setq ido-keep-item-list nil 1568 (setq ido-keep-item-list nil
@@ -1586,7 +1586,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1586 (ido-set-matches) 1586 (ido-set-matches)
1587 (if (and ido-matches (eq ido-try-merged-list 'auto)) 1587 (if (and ido-matches (eq ido-try-merged-list 'auto))
1588 (setq ido-try-merged-list t)) 1588 (setq ido-try-merged-list t))
1589 (let 1589 (let
1590 ((minibuffer-local-completion-map ido-mode-map) 1590 ((minibuffer-local-completion-map ido-mode-map)
1591 (max-mini-window-height (or ido-max-window-height 1591 (max-mini-window-height (or ido-max-window-height
1592 (and (boundp 'max-mini-window-height) max-mini-window-height))) 1592 (and (boundp 'max-mini-window-height) max-mini-window-height)))
@@ -1598,7 +1598,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1598 (setq ido-exit nil) 1598 (setq ido-exit nil)
1599 (setq ido-final-text 1599 (setq ido-final-text
1600 (catch 'ido 1600 (catch 'ido
1601 (completing-read 1601 (completing-read
1602 (ido-make-prompt item prompt) 1602 (ido-make-prompt item prompt)
1603 '(("dummy" . 1)) nil nil ; table predicate require-match 1603 '(("dummy" . 1)) nil nil ; table predicate require-match
1604 (prog1 ido-text-init (setq ido-text-init nil)) ;initial-contents 1604 (prog1 ido-text-init (setq ido-text-init nil)) ;initial-contents
@@ -1611,7 +1611,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1611 1611
1612 (cond 1612 (cond
1613 ((eq ido-exit 'refresh) 1613 ((eq ido-exit 'refresh)
1614 (if (and (eq ido-use-merged-list 'auto) 1614 (if (and (eq ido-use-merged-list 'auto)
1615 (or (input-pending-p))) 1615 (or (input-pending-p)))
1616 (setq ido-use-merged-list nil 1616 (setq ido-use-merged-list nil
1617 ido-keep-item-list t)) 1617 ido-keep-item-list t))
@@ -1623,7 +1623,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1623 ido-exit nil)) 1623 ido-exit nil))
1624 1624
1625 ((memq ido-exit '(edit chdir)) 1625 ((memq ido-exit '(edit chdir))
1626 (cond 1626 (cond
1627 ((memq ido-cur-item '(file dir)) 1627 ((memq ido-cur-item '(file dir))
1628 (let* ((process-environment (cons "HOME=/" process-environment)) ;; cheat read-file-name 1628 (let* ((process-environment (cons "HOME=/" process-environment)) ;; cheat read-file-name
1629 (read-file-name-function nil) 1629 (read-file-name-function nil)
@@ -1639,10 +1639,10 @@ If INITIAL is non-nil, it specifies the initial input string."
1639 d (or (file-name-directory new) "/") 1639 d (or (file-name-directory new) "/")
1640 f (file-name-nondirectory new) 1640 f (file-name-nondirectory new)
1641 edit t) 1641 edit t)
1642 (if (or 1642 (if (or
1643 (file-directory-p d) 1643 (file-directory-p d)
1644 (and (yes-or-no-p (format "Create directory %s? " d)) 1644 (and (yes-or-no-p (format "Create directory %s? " d))
1645 (condition-case nil 1645 (condition-case nil
1646 (progn (make-directory d t) t) 1646 (progn (make-directory d t) t)
1647 (error 1647 (error
1648 (message "Could not create directory") 1648 (message "Could not create directory")
@@ -1748,7 +1748,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1748 ;; Choose the buffer name: either the text typed in, or the head 1748 ;; Choose the buffer name: either the text typed in, or the head
1749 ;; of the list of matches 1749 ;; of the list of matches
1750 1750
1751 (cond 1751 (cond
1752 ((eq ido-exit 'findfile) 1752 ((eq ido-exit 'findfile)
1753 (ido-file-internal ido-default-file-method nil nil nil nil ido-text)) 1753 (ido-file-internal ido-default-file-method nil nil nil nil ido-text))
1754 1754
@@ -1786,7 +1786,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1786;;;###autoload 1786;;;###autoload
1787(defun ido-read-buffer (prompt &optional default require-match initial) 1787(defun ido-read-buffer (prompt &optional default require-match initial)
1788 "Replacement for the built-in `read-buffer'. 1788 "Replacement for the built-in `read-buffer'.
1789Return the name of a buffer selected. 1789Return the name of a buffer selected.
1790PROMPT is the prompt to give to the user. DEFAULT if given is the default 1790PROMPT is the prompt to give to the user. DEFAULT if given is the default
1791buffer to be selected, which will go to the front of the list. 1791buffer to be selected, which will go to the front of the list.
1792If REQUIRE-MATCH is non-nil, an existing-buffer must be selected. 1792If REQUIRE-MATCH is non-nil, an existing-buffer must be selected.
@@ -1820,7 +1820,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1820 ido-text-init ido-text 1820 ido-text-init ido-text
1821 ido-rotate-temp t) 1821 ido-rotate-temp t)
1822 (exit-minibuffer)))) 1822 (exit-minibuffer))))
1823 1823
1824(defun ido-record-work-file (name) 1824(defun ido-record-work-file (name)
1825 ;; Save NAME in ido-work-file-list 1825 ;; Save NAME in ido-work-file-list
1826 (when (and (numberp ido-max-work-file-list) (> ido-max-work-file-list 0)) 1826 (when (and (numberp ido-max-work-file-list) (> ido-max-work-file-list 0))
@@ -1924,7 +1924,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1924 ((eq method 'insert) 1924 ((eq method 'insert)
1925 (ido-record-work-file filename) 1925 (ido-record-work-file filename)
1926 (setq filename (concat ido-current-directory filename)) 1926 (setq filename (concat ido-current-directory filename))
1927 (ido-record-command 1927 (ido-record-command
1928 (if ido-find-literal 'insert-file-literally 'insert-file) 1928 (if ido-find-literal 'insert-file-literally 'insert-file)
1929 filename) 1929 filename)
1930 (ido-record-work-directory) 1930 (ido-record-work-directory)
@@ -1962,7 +1962,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1962 "Try and complete the current pattern amongst the file names." 1962 "Try and complete the current pattern amongst the file names."
1963 (interactive) 1963 (interactive)
1964 (let (res) 1964 (let (res)
1965 (cond 1965 (cond
1966 ((and (memq ido-cur-item '(file dir)) 1966 ((and (memq ido-cur-item '(file dir))
1967 (string-match "[$]" ido-text)) 1967 (string-match "[$]" ido-text))
1968 (let ((evar (substitute-in-file-name (concat ido-current-directory ido-text)))) 1968 (let ((evar (substitute-in-file-name (concat ido-current-directory ido-text))))
@@ -1981,14 +1981,14 @@ If INITIAL is non-nil, it specifies the initial input string."
1981 ((not ido-matches) 1981 ((not ido-matches)
1982 (when ido-completion-buffer 1982 (when ido-completion-buffer
1983 (call-interactively (setq this-command ido-cannot-complete-command)))) 1983 (call-interactively (setq this-command ido-cannot-complete-command))))
1984 1984
1985 ((and (= 1 (length ido-matches)) 1985 ((and (= 1 (length ido-matches))
1986 (not (and ido-enable-tramp-completion 1986 (not (and ido-enable-tramp-completion
1987 (string-equal ido-current-directory "/") 1987 (string-equal ido-current-directory "/")
1988 (string-match "..[@:]\\'" (car ido-matches))))) 1988 (string-match "..[@:]\\'" (car ido-matches)))))
1989 ;; only one choice, so select it. 1989 ;; only one choice, so select it.
1990 (exit-minibuffer)) 1990 (exit-minibuffer))
1991 1991
1992 (t ;; else there could be some completions 1992 (t ;; else there could be some completions
1993 (setq res ido-common-match-string) 1993 (setq res ido-common-match-string)
1994 (if (and (not (memq res '(t nil))) 1994 (if (and (not (memq res '(t nil)))
@@ -2050,7 +2050,7 @@ If no merge has yet taken place, toggle automatic merging option."
2050 (setq ido-try-merged-list t)) 2050 (setq ido-try-merged-list t))
2051 ((not ido-use-merged-list) 2051 ((not ido-use-merged-list)
2052 (ido-merge-work-directories)))) 2052 (ido-merge-work-directories))))
2053 2053
2054;;; TOGGLE FUNCTIONS 2054;;; TOGGLE FUNCTIONS
2055 2055
2056(defun ido-toggle-case () 2056(defun ido-toggle-case ()
@@ -2087,7 +2087,7 @@ If no merge has yet taken place, toggle automatic merging option."
2087 (interactive) 2087 (interactive)
2088 (if (and ido-mode (eq ido-cur-item 'file)) 2088 (if (and ido-mode (eq ido-cur-item 'file))
2089 (progn 2089 (progn
2090 (setq vc-master-templates 2090 (setq vc-master-templates
2091 (if vc-master-templates nil ido-saved-vc-mt)) 2091 (if vc-master-templates nil ido-saved-vc-mt))
2092 (setq ido-text-init ido-text) 2092 (setq ido-text-init ido-text)
2093 (setq ido-exit 'keep) 2093 (setq ido-exit 'keep)
@@ -2323,8 +2323,8 @@ If repeated, insert text from buffer instead."
2323 (let* ((bfname (buffer-file-name ido-entry-buffer)) 2323 (let* ((bfname (buffer-file-name ido-entry-buffer))
2324 (name (and bfname (file-name-nondirectory bfname)))) 2324 (name (and bfname (file-name-nondirectory bfname))))
2325 (when name 2325 (when name
2326 (setq ido-text-init 2326 (setq ido-text-init
2327 (if (or all 2327 (if (or all
2328 (not (equal (file-name-directory bfname) ido-current-directory)) 2328 (not (equal (file-name-directory bfname) ido-current-directory))
2329 (not (string-match "\\.[^.]*\\'" name))) 2329 (not (string-match "\\.[^.]*\\'" name)))
2330 name 2330 name
@@ -2332,7 +2332,7 @@ If repeated, insert text from buffer instead."
2332 (setq ido-exit 'refresh 2332 (setq ido-exit 'refresh
2333 ido-try-merged-list nil) 2333 ido-try-merged-list nil)
2334 (exit-minibuffer)))) 2334 (exit-minibuffer))))
2335 2335
2336(defun ido-copy-current-word (all) 2336(defun ido-copy-current-word (all)
2337 "Insert current word (file or directory name) from current buffer." 2337 "Insert current word (file or directory name) from current buffer."
2338 (interactive "P") 2338 (interactive "P")
@@ -2367,7 +2367,7 @@ If repeated, insert text from buffer instead."
2367 ido-exit 'refresh))) 2367 ido-exit 'refresh)))
2368 (exit-minibuffer)))) 2368 (exit-minibuffer))))
2369 2369
2370(defun ido-next-match () 2370(defun ido-next-match ()
2371 "Put first element of `ido-matches' at the end of the list." 2371 "Put first element of `ido-matches' at the end of the list."
2372 (interactive) 2372 (interactive)
2373 (if ido-matches 2373 (if ido-matches
@@ -2376,7 +2376,7 @@ If repeated, insert text from buffer instead."
2376 (setq ido-rescan t) 2376 (setq ido-rescan t)
2377 (setq ido-rotate t)))) 2377 (setq ido-rotate t))))
2378 2378
2379(defun ido-prev-match () 2379(defun ido-prev-match ()
2380 "Put last element of `ido-matches' at the front of the list." 2380 "Put last element of `ido-matches' at the front of the list."
2381 (interactive) 2381 (interactive)
2382 (if ido-matches 2382 (if ido-matches
@@ -2385,7 +2385,7 @@ If repeated, insert text from buffer instead."
2385 (setq ido-rescan t) 2385 (setq ido-rescan t)
2386 (setq ido-rotate t)))) 2386 (setq ido-rotate t))))
2387 2387
2388(defun ido-next-match-dir () 2388(defun ido-next-match-dir ()
2389 "Find next directory in match list. 2389 "Find next directory in match list.
2390If work directories have been merged, cycle through directories for 2390If work directories have been merged, cycle through directories for
2391first matching file." 2391first matching file."
@@ -2404,7 +2404,7 @@ first matching file."
2404 (if (< i cnt) 2404 (if (< i cnt)
2405 (setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches))))))) 2405 (setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches)))))))
2406 2406
2407(defun ido-prev-match-dir () 2407(defun ido-prev-match-dir ()
2408 "Find previous directory in match list. 2408 "Find previous directory in match list.
2409If work directories have been merged, cycle through directories 2409If work directories have been merged, cycle through directories
2410for first matching file." 2410for first matching file."
@@ -2423,7 +2423,7 @@ for first matching file."
2423 (if (> i 0) 2423 (if (> i 0)
2424 (setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches))))))) 2424 (setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches)))))))
2425 2425
2426(defun ido-restrict-to-matches () 2426(defun ido-restrict-to-matches ()
2427 "Set current item list to the currently matched items." 2427 "Set current item list to the currently matched items."
2428 (interactive) 2428 (interactive)
2429 (when ido-matches 2429 (when ido-matches
@@ -2492,8 +2492,8 @@ for first matching file."
2492 2492
2493(defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir) 2493(defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir)
2494 ;; As ido-run-find-command, but returns a list of cons pairs ("file" . "dir") 2494 ;; As ido-run-find-command, but returns a list of cons pairs ("file" . "dir")
2495 (let ((filenames 2495 (let ((filenames
2496 (split-string 2496 (split-string
2497 (shell-command-to-string 2497 (shell-command-to-string
2498 (concat "find " dir " -name \"" (if prefix "" "*") file "*\" -type " (if finddir "d" "f") " -print")))) 2498 (concat "find " dir " -name \"" (if prefix "" "*") file "*\" -type " (if finddir "d" "f") " -print"))))
2499 filename d f 2499 filename d f
@@ -2598,7 +2598,7 @@ for first matching file."
2598 2598
2599(defun ido-make-buffer-list1 (&optional frame visible) 2599(defun ido-make-buffer-list1 (&optional frame visible)
2600 ;; Return list of non-ignored buffer names 2600 ;; Return list of non-ignored buffer names
2601 (delq nil 2601 (delq nil
2602 (mapcar 2602 (mapcar
2603 (lambda (x) 2603 (lambda (x)
2604 (let ((name (buffer-name x))) 2604 (let ((name (buffer-name x)))
@@ -2609,7 +2609,7 @@ for first matching file."
2609(defun ido-make-buffer-list (default) 2609(defun ido-make-buffer-list (default)
2610 ;; Return the current list of buffers. 2610 ;; Return the current list of buffers.
2611 ;; Currently visible buffers are put at the end of the list. 2611 ;; Currently visible buffers are put at the end of the list.
2612 ;; The hook `ido-make-buflist-hook' is run after the list has been 2612 ;; The hook `ido-make-buflist-hook' is run after the list has been
2613 ;; created to allow the user to further modify the order of the buffer names 2613 ;; created to allow the user to further modify the order of the buffer names
2614 ;; in this list. If DEFAULT is non-nil, and corresponds to an existing buffer, 2614 ;; in this list. If DEFAULT is non-nil, and corresponds to an existing buffer,
2615 ;; it is put to the start of the list. 2615 ;; it is put to the start of the list.
@@ -2620,17 +2620,17 @@ for first matching file."
2620 (setq ido-temp-list ido-current-buffers)) 2620 (setq ido-temp-list ido-current-buffers))
2621 (if default 2621 (if default
2622 (progn 2622 (progn
2623 (setq ido-temp-list 2623 (setq ido-temp-list
2624 (delete default ido-temp-list)) 2624 (delete default ido-temp-list))
2625 (setq ido-temp-list 2625 (setq ido-temp-list
2626 (cons default ido-temp-list)))) 2626 (cons default ido-temp-list))))
2627 (run-hooks 'ido-make-buffer-list-hook) 2627 (run-hooks 'ido-make-buffer-list-hook)
2628 ido-temp-list)) 2628 ido-temp-list))
2629 2629
2630(defun ido-to-end (items) 2630(defun ido-to-end (items)
2631 ;; Move the elements from ITEMS to the end of `ido-temp-list' 2631 ;; Move the elements from ITEMS to the end of `ido-temp-list'
2632 (mapcar 2632 (mapcar
2633 (lambda (elem) 2633 (lambda (elem)
2634 (setq ido-temp-list (delq elem ido-temp-list))) 2634 (setq ido-temp-list (delq elem ido-temp-list)))
2635 items) 2635 items)
2636 (if ido-temp-list 2636 (if ido-temp-list
@@ -2670,7 +2670,7 @@ for first matching file."
2670 (stringp dir) (> (length dir) 0) 2670 (stringp dir) (> (length dir) 0)
2671 (ido-may-cache-directory dir)) 2671 (ido-may-cache-directory dir))
2672 (let* ((cached (assoc dir ido-dir-file-cache)) 2672 (let* ((cached (assoc dir ido-dir-file-cache))
2673 (ctime (nth 1 cached)) 2673 (ctime (nth 1 cached))
2674 (ftp (ido-is-ftp-directory dir)) 2674 (ftp (ido-is-ftp-directory dir))
2675 (attr (if ftp nil (file-attributes dir))) 2675 (attr (if ftp nil (file-attributes dir)))
2676 (mtime (nth 5 attr)) 2676 (mtime (nth 5 attr))
@@ -2710,7 +2710,7 @@ for first matching file."
2710 ;; Return list of non-ignored files in DIR 2710 ;; Return list of non-ignored files in DIR
2711 ;; If MERGED is non-nil, each file is cons'ed with DIR 2711 ;; If MERGED is non-nil, each file is cons'ed with DIR
2712 (and (or (ido-is-tramp-root dir) (file-directory-p dir)) 2712 (and (or (ido-is-tramp-root dir) (file-directory-p dir))
2713 (delq nil 2713 (delq nil
2714 (mapcar 2714 (mapcar
2715 (lambda (name) 2715 (lambda (name)
2716 (if (not (ido-ignore-item-p name ido-ignore-files t)) 2716 (if (not (ido-ignore-item-p name ido-ignore-files t))
@@ -2720,20 +2720,20 @@ for first matching file."
2720(defun ido-make-file-list (default) 2720(defun ido-make-file-list (default)
2721 ;; Return the current list of files. 2721 ;; Return the current list of files.
2722 ;; Currently visible files are put at the end of the list. 2722 ;; Currently visible files are put at the end of the list.
2723 ;; The hook `ido-make-file-list-hook' is run after the list has been 2723 ;; The hook `ido-make-file-list-hook' is run after the list has been
2724 ;; created to allow the user to further modify the order of the file names 2724 ;; created to allow the user to further modify the order of the file names
2725 ;; in this list. 2725 ;; in this list.
2726 (let ((ido-temp-list (ido-make-file-list1 ido-current-directory))) 2726 (let ((ido-temp-list (ido-make-file-list1 ido-current-directory)))
2727 (setq ido-temp-list (ido-sort-list ido-temp-list)) 2727 (setq ido-temp-list (ido-sort-list ido-temp-list))
2728 (let ((default-directory ido-current-directory)) 2728 (let ((default-directory ido-current-directory))
2729 (ido-to-end ;; move ftp hosts and visited files to end 2729 (ido-to-end ;; move ftp hosts and visited files to end
2730 (delq nil (mapcar 2730 (delq nil (mapcar
2731 (lambda (x) (if (or (string-match "..:\\'" x) 2731 (lambda (x) (if (or (string-match "..:\\'" x)
2732 (and (not (ido-final-slash x)) 2732 (and (not (ido-final-slash x))
2733 (get-file-buffer x))) x)) 2733 (get-file-buffer x))) x))
2734 ido-temp-list)))) 2734 ido-temp-list))))
2735 (ido-to-end ;; move . files to end 2735 (ido-to-end ;; move . files to end
2736 (delq nil (mapcar 2736 (delq nil (mapcar
2737 (lambda (x) (if (string-equal (substring x 0 1) ".") x)) 2737 (lambda (x) (if (string-equal (substring x 0 1) ".") x))
2738 ido-temp-list))) 2738 ido-temp-list)))
2739 (if (and default (member default ido-temp-list)) 2739 (if (and default (member default ido-temp-list))
@@ -2746,9 +2746,9 @@ for first matching file."
2746 (setcdr l nil) 2746 (setcdr l nil)
2747 (nconc k ido-temp-list) 2747 (nconc k ido-temp-list)
2748 (setq ido-temp-list k))) 2748 (setq ido-temp-list k)))
2749 (setq ido-temp-list 2749 (setq ido-temp-list
2750 (delete default ido-temp-list)) 2750 (delete default ido-temp-list))
2751 (setq ido-temp-list 2751 (setq ido-temp-list
2752 (cons default ido-temp-list)))) 2752 (cons default ido-temp-list))))
2753 (when ido-show-dot-for-dired 2753 (when ido-show-dot-for-dired
2754 (setq ido-temp-list (delete "." ido-temp-list)) 2754 (setq ido-temp-list (delete "." ido-temp-list))
@@ -2760,7 +2760,7 @@ for first matching file."
2760 ;; Return list of non-ignored subdirs in DIR 2760 ;; Return list of non-ignored subdirs in DIR
2761 ;; If MERGED is non-nil, each subdir is cons'ed with DIR 2761 ;; If MERGED is non-nil, each subdir is cons'ed with DIR
2762 (and (or (ido-is-tramp-root dir) (file-directory-p dir)) 2762 (and (or (ido-is-tramp-root dir) (file-directory-p dir))
2763 (delq nil 2763 (delq nil
2764 (mapcar 2764 (mapcar
2765 (lambda (name) 2765 (lambda (name)
2766 (and (ido-final-slash name) (not (ido-ignore-item-p name ido-ignore-directories)) 2766 (and (ido-final-slash name) (not (ido-ignore-item-p name ido-ignore-directories))
@@ -2769,13 +2769,13 @@ for first matching file."
2769 2769
2770(defun ido-make-dir-list (default) 2770(defun ido-make-dir-list (default)
2771 ;; Return the current list of directories. 2771 ;; Return the current list of directories.
2772 ;; The hook `ido-make-dir-list-hook' is run after the list has been 2772 ;; The hook `ido-make-dir-list-hook' is run after the list has been
2773 ;; created to allow the user to further modify the order of the 2773 ;; created to allow the user to further modify the order of the
2774 ;; directory names in this list. 2774 ;; directory names in this list.
2775 (let ((ido-temp-list (ido-make-dir-list1 ido-current-directory))) 2775 (let ((ido-temp-list (ido-make-dir-list1 ido-current-directory)))
2776 (setq ido-temp-list (ido-sort-list ido-temp-list)) 2776 (setq ido-temp-list (ido-sort-list ido-temp-list))
2777 (ido-to-end ;; move . files to end 2777 (ido-to-end ;; move . files to end
2778 (delq nil (mapcar 2778 (delq nil (mapcar
2779 (lambda (x) (if (string-equal (substring x 0 1) ".") x)) 2779 (lambda (x) (if (string-equal (substring x 0 1) ".") x))
2780 ido-temp-list))) 2780 ido-temp-list)))
2781 (if (and default (member default ido-temp-list)) 2781 (if (and default (member default ido-temp-list))
@@ -2788,9 +2788,9 @@ for first matching file."
2788 (setcdr l nil) 2788 (setcdr l nil)
2789 (nconc k ido-temp-list) 2789 (nconc k ido-temp-list)
2790 (setq ido-temp-list k))) 2790 (setq ido-temp-list k)))
2791 (setq ido-temp-list 2791 (setq ido-temp-list
2792 (delete default ido-temp-list)) 2792 (delete default ido-temp-list))
2793 (setq ido-temp-list 2793 (setq ido-temp-list
2794 (cons default ido-temp-list)))) 2794 (cons default ido-temp-list))))
2795 (setq ido-temp-list (delete "." ido-temp-list)) 2795 (setq ido-temp-list (delete "." ido-temp-list))
2796 (setq ido-temp-list (cons "." ido-temp-list)) 2796 (setq ido-temp-list (cons "." ido-temp-list))
@@ -2807,7 +2807,7 @@ for first matching file."
2807 ;; `ido-all-frames'. 2807 ;; `ido-all-frames'.
2808 (let ((ido-bufs-in-frame nil)) 2808 (let ((ido-bufs-in-frame nil))
2809 (walk-windows 'ido-get-bufname nil 2809 (walk-windows 'ido-get-bufname nil
2810 (if current 2810 (if current
2811 nil 2811 nil
2812 ido-all-frames)) 2812 ido-all-frames))
2813 ido-bufs-in-frame)) 2813 ido-bufs-in-frame))
@@ -2869,14 +2869,14 @@ for first matching file."
2869 (setq matches (cons item matches))))) 2869 (setq matches (cons item matches)))))
2870 items)) 2870 items))
2871 matches)) 2871 matches))
2872 2872
2873 2873
2874(defun ido-set-matches () 2874(defun ido-set-matches ()
2875 ;; Set `ido-matches' to the list of items matching prompt 2875 ;; Set `ido-matches' to the list of items matching prompt
2876 (when ido-rescan 2876 (when ido-rescan
2877 (setq ido-matches (ido-set-matches1 (reverse ido-cur-list) (not ido-rotate)) 2877 (setq ido-matches (ido-set-matches1 (reverse ido-cur-list) (not ido-rotate))
2878 ido-rotate nil))) 2878 ido-rotate nil)))
2879 2879
2880(defun ido-ignore-item-p (name re-list &optional ignore-ext) 2880(defun ido-ignore-item-p (name re-list &optional ignore-ext)
2881 ;; Return t if the buffer or file NAME should be ignored. 2881 ;; Return t if the buffer or file NAME should be ignored.
2882 (or (member name ido-ignore-item-temp-list) 2882 (or (member name ido-ignore-item-temp-list)
@@ -2885,7 +2885,7 @@ for first matching file."
2885 (let ((data (match-data)) 2885 (let ((data (match-data))
2886 (ext-list (and ignore-ext ido-ignore-extensions 2886 (ext-list (and ignore-ext ido-ignore-extensions
2887 completion-ignored-extensions)) 2887 completion-ignored-extensions))
2888 ignorep nextstr 2888 ignorep nextstr
2889 (flen (length name)) slen) 2889 (flen (length name)) slen)
2890 (while ext-list 2890 (while ext-list
2891 (setq nextstr (car ext-list)) 2891 (setq nextstr (car ext-list))
@@ -2941,7 +2941,7 @@ for first matching file."
2941(defun ido-word-matching-substring (word) 2941(defun ido-word-matching-substring (word)
2942 ;; Return part of WORD before 1st match to `ido-change-word-sub'. 2942 ;; Return part of WORD before 1st match to `ido-change-word-sub'.
2943 ;; If `ido-change-word-sub' cannot be found in WORD, return nil. 2943 ;; If `ido-change-word-sub' cannot be found in WORD, return nil.
2944 (let ((case-fold-search ido-case-fold)) 2944 (let ((case-fold-search ido-case-fold))
2945 (let ((m (string-match ido-change-word-sub (ido-name word)))) 2945 (let ((m (string-match ido-change-word-sub (ido-name word))))
2946 (if m 2946 (if m
2947 (substring (ido-name word) m) 2947 (substring (ido-name word) m)
@@ -3009,7 +3009,7 @@ for first matching file."
3009 (let ((f 'display-completion-list)) 3009 (let ((f 'display-completion-list))
3010 (funcall f completion-list 3010 (funcall f completion-list
3011 :help-string "ido " 3011 :help-string "ido "
3012 :activate-callback 3012 :activate-callback
3013 '(lambda (x y z) (message "doesn't work yet, sorry!")))) 3013 '(lambda (x y z) (message "doesn't work yet, sorry!"))))
3014 ;; else running Emacs 3014 ;; else running Emacs
3015 ;;(add-hook 'completion-setup-hook 'completion-setup-function) 3015 ;;(add-hook 'completion-setup-hook 'completion-setup-function)
@@ -3026,7 +3026,7 @@ for first matching file."
3026 ;; Check if buffer still exists. 3026 ;; Check if buffer still exists.
3027 (if (get-buffer buf) 3027 (if (get-buffer buf)
3028 ;; buffer couldn't be killed. 3028 ;; buffer couldn't be killed.
3029 (setq ido-rescan t) 3029 (setq ido-rescan t)
3030 ;; else buffer was killed so remove name from list. 3030 ;; else buffer was killed so remove name from list.
3031 (setq ido-cur-list (delq buf ido-cur-list)))))) 3031 (setq ido-cur-list (delq buf ido-cur-list))))))
3032 3032
@@ -3047,7 +3047,7 @@ for first matching file."
3047 ;; Check if file still exists. 3047 ;; Check if file still exists.
3048 (if (file-exists-p file) 3048 (if (file-exists-p file)
3049 ;; file could not be deleted 3049 ;; file could not be deleted
3050 (setq ido-rescan t) 3050 (setq ido-rescan t)
3051 ;; else file was killed so remove name from list. 3051 ;; else file was killed so remove name from list.
3052 (setq ido-cur-list (delq (car ido-matches) ido-cur-list)))))) 3052 (setq ido-cur-list (delq (car ido-matches) ido-cur-list))))))
3053 3053
@@ -3140,7 +3140,7 @@ If no buffer is found, prompt for a new one.
3140 3140
3141\\[ido-next-match] Put the first element at the end of the list. 3141\\[ido-next-match] Put the first element at the end of the list.
3142\\[ido-prev-match] Put the last element at the start of the list. 3142\\[ido-prev-match] Put the last element at the start of the list.
3143\\[ido-complete] Complete a common suffix to the current string that 3143\\[ido-complete] Complete a common suffix to the current string that
3144matches all buffers. If there is only one match, select that buffer. 3144matches all buffers. If there is only one match, select that buffer.
3145If there is no common suffix, show a list of all matching buffers 3145If there is no common suffix, show a list of all matching buffers
3146in a separate window. 3146in a separate window.
@@ -3228,7 +3228,7 @@ If no buffer or file is found, prompt for a new one.
3228 3228
3229\\[ido-next-match] Put the first element at the end of the list. 3229\\[ido-next-match] Put the first element at the end of the list.
3230\\[ido-prev-match] Put the last element at the start of the list. 3230\\[ido-prev-match] Put the last element at the start of the list.
3231\\[ido-complete] Complete a common suffix to the current string that 3231\\[ido-complete] Complete a common suffix to the current string that
3232matches all files. If there is only one match, select that file. 3232matches all files. If there is only one match, select that file.
3233If there is no common suffix, show a list of all matching files 3233If there is no common suffix, show a list of all matching files
3234in a separate window. 3234in a separate window.
@@ -3429,7 +3429,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3429 3429
3430 ((ido-final-slash contents) ;; xxx/ 3430 ((ido-final-slash contents) ;; xxx/
3431 (ido-trace "final slash" contents) 3431 (ido-trace "final slash" contents)
3432 (cond 3432 (cond
3433 ((string-equal contents "~/") 3433 ((string-equal contents "~/")
3434 (ido-set-current-home) 3434 (ido-set-current-home)
3435 (setq refresh t)) 3435 (setq refresh t))
@@ -3458,7 +3458,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3458 (ido-set-current-directory (file-name-directory contents)) 3458 (ido-set-current-directory (file-name-directory contents))
3459 (setq refresh t)) 3459 (setq refresh t))
3460 ((string-equal (substring contents -2 -1) "/") 3460 ((string-equal (substring contents -2 -1) "/")
3461 (ido-set-current-directory 3461 (ido-set-current-directory
3462 (if (memq system-type '(windows-nt ms-dos)) 3462 (if (memq system-type '(windows-nt ms-dos))
3463 (expand-file-name "/" ido-current-directory) 3463 (expand-file-name "/" ido-current-directory)
3464 "/")) 3464 "/"))
@@ -3513,7 +3513,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3513 (or try-single-dir-match 3513 (or try-single-dir-match
3514 (eq ido-enter-single-matching-directory t))) 3514 (eq ido-enter-single-matching-directory t)))
3515 (ido-trace "single match" (car ido-matches)) 3515 (ido-trace "single match" (car ido-matches))
3516 (ido-set-current-directory 3516 (ido-set-current-directory
3517 (concat ido-current-directory (car ido-matches))) 3517 (concat ido-current-directory (car ido-matches)))
3518 (setq ido-exit 'refresh) 3518 (setq ido-exit 'refresh)
3519 (exit-minibuffer)) 3519 (exit-minibuffer))
@@ -3554,10 +3554,10 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3554 (ido-trace "\n*start timer*") 3554 (ido-trace "\n*start timer*")
3555 (setq ido-auto-merge-timer 3555 (setq ido-auto-merge-timer
3556 (run-with-timer ido-auto-merge-delay-time nil 'ido-initiate-auto-merge (current-buffer)))))) 3556 (run-with-timer ido-auto-merge-delay-time nil 'ido-initiate-auto-merge (current-buffer))))))
3557 3557
3558 (setq ido-rescan t) 3558 (setq ido-rescan t)
3559 3559
3560 (if (and ido-use-merged-list 3560 (if (and ido-use-merged-list
3561 ido-matches 3561 ido-matches
3562 (not (string-equal (car (cdr (car ido-matches))) ido-current-directory))) 3562 (not (string-equal (car (cdr (car ido-matches))) ido-current-directory)))
3563 (progn 3563 (progn
@@ -3569,7 +3569,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3569 3569
3570 ;; Insert the match-status information: 3570 ;; Insert the match-status information:
3571 (ido-set-common-completion) 3571 (ido-set-common-completion)
3572 (let ((inf (ido-completions 3572 (let ((inf (ido-completions
3573 contents 3573 contents
3574 minibuffer-completion-table 3574 minibuffer-completion-table
3575 minibuffer-completion-predicate 3575 minibuffer-completion-predicate
@@ -3581,7 +3581,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3581(defun ido-completions (name candidates predicate require-match) 3581(defun ido-completions (name candidates predicate require-match)
3582 ;; Return the string that is displayed after the user's text. 3582 ;; Return the string that is displayed after the user's text.
3583 ;; Modified from `icomplete-completions'. 3583 ;; Modified from `icomplete-completions'.
3584 3584
3585 (let* ((comps ido-matches) 3585 (let* ((comps ido-matches)
3586 (ind (and (consp (car comps)) (> (length (cdr (car comps))) 1) 3586 (ind (and (consp (car comps)) (> (length (cdr (car comps))) 1)
3587 ido-merged-indicator)) 3587 ido-merged-indicator))
@@ -3589,7 +3589,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3589 3589
3590 (if (and ind ido-use-faces) 3590 (if (and ind ido-use-faces)
3591 (put-text-property 0 1 'face 'ido-indicator-face ind)) 3591 (put-text-property 0 1 'face 'ido-indicator-face ind))
3592 3592
3593 (if (and ido-use-faces comps) 3593 (if (and ido-use-faces comps)
3594 (let* ((fn (ido-name (car comps))) 3594 (let* ((fn (ido-name (car comps)))
3595 (ln (length fn))) 3595 (ln (length fn)))
@@ -3619,7 +3619,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3619 (let* ((items (if (> ido-max-prospects 0) (1+ ido-max-prospects) 999)) 3619 (let* ((items (if (> ido-max-prospects 0) (1+ ido-max-prospects) 999))
3620 (alternatives 3620 (alternatives
3621 (apply 3621 (apply
3622 #'concat 3622 #'concat
3623 (cdr (apply 3623 (cdr (apply
3624 #'nconc 3624 #'nconc
3625 (mapcar 3625 (mapcar
@@ -3654,7 +3654,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3654(defun ido-minibuffer-setup () 3654(defun ido-minibuffer-setup ()
3655 "Minibuffer setup hook for `ido'." 3655 "Minibuffer setup hook for `ido'."
3656 ;; Copied from `icomplete-minibuffer-setup-hook'. 3656 ;; Copied from `icomplete-minibuffer-setup-hook'.
3657 (when (and (boundp 'ido-completing-read) 3657 (when (and (boundp 'ido-completing-read)
3658 (or (featurep 'xemacs) 3658 (or (featurep 'xemacs)
3659 (= ido-use-mycompletion-depth (minibuffer-depth)))) 3659 (= ido-use-mycompletion-depth (minibuffer-depth))))
3660 (add-hook 'pre-command-hook 'ido-tidy nil t) 3660 (add-hook 'pre-command-hook 'ido-tidy nil t)
@@ -3679,13 +3679,13 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3679 (= ido-use-mycompletion-depth (minibuffer-depth))) 3679 (= ido-use-mycompletion-depth (minibuffer-depth)))
3680 (if (and (boundp 'ido-eoinput) 3680 (if (and (boundp 'ido-eoinput)
3681 ido-eoinput) 3681 ido-eoinput)
3682 3682
3683 (if (> ido-eoinput (point-max)) 3683 (if (> ido-eoinput (point-max))
3684 ;; Oops, got rug pulled out from under us - reinit: 3684 ;; Oops, got rug pulled out from under us - reinit:
3685 (setq ido-eoinput (point-max)) 3685 (setq ido-eoinput (point-max))
3686 (let ((buffer-undo-list t)) 3686 (let ((buffer-undo-list t))
3687 (delete-region ido-eoinput (point-max)))) 3687 (delete-region ido-eoinput (point-max))))
3688 3688
3689 ;; Reestablish the local variable 'cause minibuffer-setup is weird: 3689 ;; Reestablish the local variable 'cause minibuffer-setup is weird:
3690 (make-local-variable 'ido-eoinput) 3690 (make-local-variable 'ido-eoinput)
3691 (setq ido-eoinput 1)))) 3691 (setq ido-eoinput 1))))
@@ -3695,9 +3695,9 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3695 ;; This is an example function which can be hooked on to 3695 ;; This is an example function which can be hooked on to
3696 ;; `ido-make-buffer-list-hook'. Any buffer matching the regexps 3696 ;; `ido-make-buffer-list-hook'. Any buffer matching the regexps
3697 ;; `Summary' or `output\*$'are put to the end of the list. 3697 ;; `Summary' or `output\*$'are put to the end of the list.
3698 (let ((summaries (delq nil (mapcar 3698 (let ((summaries (delq nil (mapcar
3699 (lambda (x) 3699 (lambda (x)
3700 (if (or 3700 (if (or
3701 (string-match "Summary" x) 3701 (string-match "Summary" x)
3702 (string-match "output\\*\\'" x)) 3702 (string-match "output\\*\\'" x))
3703 x)) 3703 x))
diff --git a/lisp/ielm.el b/lisp/ielm.el
index ad8bb547cbb..16235f065e2 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -114,7 +114,7 @@ such as `edebug-defun' to work with such inputs."
114 "During IELM evaluation, most recent value evaluated in IELM. 114 "During IELM evaluation, most recent value evaluated in IELM.
115Normally identical to `*'. However, if the working buffer is an IELM 115Normally identical to `*'. However, if the working buffer is an IELM
116buffer, distinct from the process buffer, then `*' gives the value in 116buffer, distinct from the process buffer, then `*' gives the value in
117the working buffer, `*1' the value in the process buffer. 117the working buffer, `*1' the value in the process buffer.
118The intended value is only accessible during IELM evaluation.") 118The intended value is only accessible during IELM evaluation.")
119 119
120(defvar *2 nil 120(defvar *2 nil
@@ -505,7 +505,7 @@ Customised bindings may be defined in `ielm-map', which currently contains:
505 (file-error (start-process "ielm" (current-buffer) "cat"))) 505 (file-error (start-process "ielm" (current-buffer) "cat")))
506 (process-kill-without-query (ielm-process)) 506 (process-kill-without-query (ielm-process))
507 (goto-char (point-max)) 507 (goto-char (point-max))
508 508
509 ;; Lisp output can include raw characters that confuse comint's 509 ;; Lisp output can include raw characters that confuse comint's
510 ;; carriage control code. 510 ;; carriage control code.
511 (set (make-local-variable 'comint-inhibit-carriage-motion) t) 511 (set (make-local-variable 'comint-inhibit-carriage-motion) t)
diff --git a/lisp/image.el b/lisp/image.el
index ac1ef557edc..346c2e72a01 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -66,7 +66,7 @@ We accept the tag Exif because that is the same format."
66 (code (aref data i))) 66 (code (aref data i)))
67 (when (and (>= code #xe0) (<= code #xef)) 67 (when (and (>= code #xe0) (<= code #xef))
68 ;; APP0 LEN1 LEN2 "JFIF\0" 68 ;; APP0 LEN1 LEN2 "JFIF\0"
69 (throw 'jfif 69 (throw 'jfif
70 (string-match "JFIF\\|Exif" (substring data i (+ i nbytes))))) 70 (string-match "JFIF\\|Exif" (substring data i (+ i nbytes)))))
71 (setq i (+ i 1 nbytes)))))))) 71 (setq i (+ i 1 nbytes))))))))
72 72