Commit e756eb9f authored by Michael Kifer's avatar Michael Kifer
Browse files

new version

parent c6c0c4b1
......@@ -212,7 +212,7 @@ one optional arguments, diff-number to refine.")
ediff-diff-options file1 file2)
;;(message "Computing differences ... done")
(message "")
(ediff-eval-in-buffer diff-buffer
(ediff-with-current-buffer diff-buffer
(buffer-size))))))
......@@ -283,15 +283,15 @@ one optional arguments, diff-number to refine.")
(setq ediff-error-buffer
(get-buffer-create (ediff-unique-buffer-name
"*ediff-errors" "*"))))
(ediff-eval-in-buffer ediff-error-buffer
(ediff-with-current-buffer ediff-error-buffer
(erase-buffer)
(insert (ediff-eval-in-buffer diff-buff (buffer-string)))
(insert (ediff-with-current-buffer diff-buff (buffer-string)))
(goto-char (point-min))
(delete-matching-lines ok-regexp)
(if (memq system-type '(vax-vms axp-vms))
(delete-matching-lines "^$")))
;; If diff reports errors, show them then quit.
(if (/= 0 (ediff-eval-in-buffer ediff-error-buffer (buffer-size)))
(if (/= 0 (ediff-with-current-buffer ediff-error-buffer (buffer-size)))
(let ((ctl-buf ediff-control-buffer)
(error-buf ediff-error-buffer))
(ediff-skip-unsuitable-frames)
......@@ -328,15 +328,15 @@ one optional arguments, diff-number to refine.")
(ediff-get-value-according-to-buffer-type 'B bounds))))
;; reset point in buffers A/B/C
(ediff-eval-in-buffer A-buffer
(ediff-with-current-buffer A-buffer
(goto-char (if shift-A shift-A (point-min))))
(ediff-eval-in-buffer B-buffer
(ediff-with-current-buffer B-buffer
(goto-char (if shift-B shift-B (point-min))))
(if (ediff-buffer-live-p C-buffer)
(ediff-eval-in-buffer C-buffer
(ediff-with-current-buffer C-buffer
(goto-char (point-min))))
(ediff-eval-in-buffer diff-buffer
(ediff-with-current-buffer diff-buffer
(goto-char (point-min))
(while (re-search-forward ediff-match-diff-line nil t)
(let* ((a-begin (string-to-int (buffer-substring (match-beginning 1)
......@@ -404,20 +404,20 @@ one optional arguments, diff-number to refine.")
b-prev b-end
c-prev c-end)
;; else convert lines to points
(ediff-eval-in-buffer A-buffer
(ediff-with-current-buffer A-buffer
(forward-line (- a-begin a-prev))
(setq a-begin-pt (point))
(forward-line (- a-end a-begin))
(setq a-end-pt (point)
a-prev a-end))
(ediff-eval-in-buffer B-buffer
(ediff-with-current-buffer B-buffer
(forward-line (- b-begin b-prev))
(setq b-begin-pt (point))
(forward-line (- b-end b-begin))
(setq b-end-pt (point)
b-prev b-end))
(if (ediff-buffer-live-p C-buffer)
(ediff-eval-in-buffer C-buffer
(ediff-with-current-buffer C-buffer
(forward-line (- c-begin c-prev))
(setq c-begin-pt (point))
(forward-line (- c-end c-begin))
......@@ -447,7 +447,7 @@ one optional arguments, diff-number to refine.")
)))
)))
))) ; end ediff-eval-in-buffer
))) ; end ediff-with-current-buffer
diff-list
))
......@@ -495,7 +495,7 @@ one optional arguments, diff-number to refine.")
(setq total-diffs (length diff-list))
;; shift, if necessary
(ediff-eval-in-buffer buff (setq pt-saved shift))
(ediff-with-current-buffer buff (setq pt-saved shift))
(while diff-list
(setq current-diff (1+ current-diff)
......@@ -524,12 +524,12 @@ one optional arguments, diff-number to refine.")
;; convert word numbers to points, if necessary
(if (eq diff-list-type 'words)
(progn
(ediff-eval-in-buffer buff (goto-char pt-saved))
(ediff-with-current-buffer buff (goto-char pt-saved))
(setq begin (ediff-goto-word (1+ begin) buff)
end (ediff-goto-word end buff 'end))
(if (> end limit) (setq end limit))
(if (> begin end) (setq begin end))
(setq pt-saved (ediff-eval-in-buffer buff (point)))))
(setq pt-saved (ediff-with-current-buffer buff (point)))))
(setq overlay (ediff-make-bullet-proof-overlay begin end buff))
(ediff-overlay-put overlay 'priority ediff-shadow-overlay-priority)
......@@ -553,7 +553,7 @@ one optional arguments, diff-number to refine.")
(cdr diff-list))
) ; while
(set (intern (format "ediff-difference-vector-%S" buf-type))
(set (ediff-get-symbol-from-alist buf-type ediff-difference-vector-alist)
(vconcat diff-overlay-list))
))
......@@ -761,14 +761,15 @@ one optional arguments, diff-number to refine.")
(face (if default
'default
(face-name
(intern (format "ediff-fine-diff-face-%S" buf-type)))))
(ediff-get-symbol-from-alist
buf-type ediff-fine-diff-face-alist))))
(priority (if default
0
(1+ (or (ediff-overlay-get
(symbol-value
(intern
(format
"ediff-current-diff-overlay-%S" buf-type)))
(ediff-get-symbol-from-alist
buf-type
ediff-current-diff-overlay-alist))
'priority)
0)))))
(mapcar
......@@ -806,7 +807,7 @@ one optional arguments, diff-number to refine.")
(ediff-clear-fine-differences-in-one-buffer region-num buf-type)
(setq diff-list (cdr diff-list)) ; discard list type (words or points)
(ediff-eval-in-buffer buff (goto-char reg-start))
(ediff-with-current-buffer buff (goto-char reg-start))
;; if it is a combined merge then set overlays in buff C specially
(if (and ediff-merge-job (eq buf-type 'C)
......@@ -909,18 +910,18 @@ one optional arguments, diff-number to refine.")
(ediff-get-value-according-to-buffer-type 'C bounds)))))
;; reset point in buffers A, B, C
(ediff-eval-in-buffer A-buffer
(ediff-with-current-buffer A-buffer
(goto-char (if shift-A shift-A (point-min))))
(ediff-eval-in-buffer B-buffer
(ediff-with-current-buffer B-buffer
(goto-char (if shift-B shift-B (point-min))))
(if three-way-comp
(ediff-eval-in-buffer C-buffer
(ediff-with-current-buffer C-buffer
(goto-char (if shift-C shift-C (point-min)))))
(if (ediff-buffer-live-p anc-buffer)
(ediff-eval-in-buffer anc-buffer
(ediff-with-current-buffer anc-buffer
(goto-char (point-min))))
(ediff-eval-in-buffer diff-buffer
(ediff-with-current-buffer diff-buffer
(goto-char (point-min))
(while (re-search-forward ediff-match-diff3-line nil t)
;; leave point after matched line
......@@ -983,26 +984,26 @@ one optional arguments, diff-number to refine.")
b-prev b-end
c-prev c-end)
;; else convert lines to points
(ediff-eval-in-buffer A-buffer
(ediff-with-current-buffer A-buffer
(forward-line (- a-begin a-prev))
(setq a-begin-pt (point))
(forward-line (- a-end a-begin))
(setq a-end-pt (point)
a-prev a-end))
(ediff-eval-in-buffer B-buffer
(ediff-with-current-buffer B-buffer
(forward-line (- b-begin b-prev))
(setq b-begin-pt (point))
(forward-line (- b-end b-begin))
(setq b-end-pt (point)
b-prev b-end))
(ediff-eval-in-buffer C-buffer
(ediff-with-current-buffer C-buffer
(forward-line (- c-begin c-prev))
(setq c-begin-pt (point))
(forward-line (- c-end c-begin))
(setq c-end-pt (point)
c-prev c-end))
(if (ediff-buffer-live-p anc-buffer)
(ediff-eval-in-buffer anc-buffer
(ediff-with-current-buffer anc-buffer
(forward-line (- c-or-anc-begin anc-prev))
(setq anc-begin-pt (point))
(forward-line (- c-or-anc-end c-or-anc-begin))
......@@ -1034,7 +1035,7 @@ one optional arguments, diff-number to refine.")
)))
))
))) ; end ediff-eval-in-buffer
))) ; end ediff-with-current-buffer
diff-list
))
......@@ -1065,15 +1066,15 @@ one optional arguments, diff-number to refine.")
;; Execute PROGRAM asynchronously, unless OS/2, Windows-*, or DOS, or unless
;; SYNCH is non-nil. BUFFER must be a buffer object, and must be alive. All
;; arguments in ARGS must be strings. The first arg may be a blank string, in
;; which case we delete it from ARGS list. We also delete nil from args.
(defun ediff-exec-process (program buffer synch &rest args)
(let ((data (match-data)))
(if (string-match "^[ \t]*$" (car args)) ; delete blank string
(setq args (cdr args)))
(setq args (delq nil args)) ; delete nil from arguments
(setq args (ediff-split-string (mapconcat 'identity args " ")))
;; SYNCH is non-nil. BUFFER must be a buffer object, and must be alive. The
;; OPTIONS arg is a list of options to pass to PROGRAM. It may be a blank
;; string. All elements in FILES must be strings. We also delete nil from
;; args.
(defun ediff-exec-process (program buffer synch options &rest files)
(let ((data (match-data))
args)
(setq args (append (split-string options) files))
(setq args (delete "" (delq nil args))) ; delete nil and "" from arguments
(unwind-protect
(let ((directory default-directory)
proc)
......@@ -1191,7 +1192,7 @@ argument to `skip-chars-forward'."
(let (sv-point string)
(save-excursion
(set-buffer in-buffer)
(setq string (buffer-substring beg end))
(setq string (buffer-substring-no-properties beg end))
(set-buffer out-buffer)
(erase-buffer)
......@@ -1205,7 +1206,7 @@ argument to `skip-chars-forward'."
;; different invocations
(if control-buf
(funcall
(ediff-eval-in-buffer control-buf ediff-forward-word-function))
(ediff-with-current-buffer control-buf ediff-forward-word-function))
(funcall ediff-forward-word-function))
(setq sv-point (point))
(skip-chars-forward ediff-whitespace)
......@@ -1232,7 +1233,7 @@ argument to `skip-chars-forward'."
(defun ediff-goto-word (n buf &optional flag)
;; remember val ediff-forward-word-function has in ctl buf
(let ((fwd-word-fun ediff-forward-word-function))
(ediff-eval-in-buffer buf
(ediff-with-current-buffer buf
(skip-chars-forward ediff-whitespace)
(while (> n 1)
(funcall fwd-word-fun)
......@@ -1245,8 +1246,8 @@ argument to `skip-chars-forward'."
;;; Local Variables:
;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
;;; End:
......
......@@ -97,6 +97,13 @@ that Ediff doesn't know about.")
;; The Ediff control buffer
(ediff-defvar-local ediff-control-buffer nil "")
;; Association between buff-type and ediff-buffer-*
(defconst ediff-buffer-alist
'((?A . ediff-buffer-A)
(?B . ediff-buffer-B)
(?C . ediff-buffer-C)))
;;; Macros
(defmacro ediff-odd-p (arg)
(` (eq (logand (, arg) 1) 1)))
......@@ -123,11 +130,26 @@ that Ediff doesn't know about.")
((memq (, arg) '(?c ?C)) 'C)
)
))
;; A-list is supposed to be of the form (A . symb) (B . symb)...)
;; where the first part of any association is a buffer type and the second is
;; an appropriate symbol. Given buffer-type, this function returns the
;; symbol. This is used to avoid using `intern'
(defsubst ediff-get-symbol-from-alist (buf-type alist)
(cdr (assoc buf-type alist)))
(defconst ediff-difference-vector-alist
'((A . ediff-difference-vector-A)
(B . ediff-difference-vector-B)
(C . ediff-difference-vector-C)
(Ancestor . ediff-difference-vector-Ancestor)))
(defmacro ediff-get-difference (n buf-type)
(` (aref
(symbol-value
(intern (format "ediff-difference-vector-%S" (, buf-type)))) (, n))))
(ediff-get-symbol-from-alist
(, buf-type) ediff-difference-vector-alist))
(, n))))
;; Tell if it has been previously determined that the region has
;; no diffs other than the white space and newlines
......@@ -189,21 +211,18 @@ that Ediff doesn't know about.")
(` (ediff-get-fine-diff-vector-from-diff-record
(ediff-get-difference (, n) (, buf-type)))))
;; Macro to switch to BUFFER, evaluate FORMS, returns to original buffer.
;; Differs from `save-excursion' in that it doesn't save the point and mark.
;; This is essentially `emerge-eval-in-buffer' with the test for live buffers."
(defmacro ediff-eval-in-buffer (buffer &rest forms)
(` (let ((StartBuffer (current-buffer)))
(if (ediff-buffer-live-p (, buffer))
(unwind-protect
(progn
(set-buffer (, buffer))
(,@ forms))
(set-buffer StartBuffer))
(or (eq this-command 'ediff-quit)
(error ediff-KILLED-VITAL-BUFFER))
))))
;; Macro to switch to BUFFER, evaluate BODY, returns to original buffer.
;; Doesn't save the point and mark.
;; This is `with-current-buffer' with the added test for live buffers."
(defmacro ediff-with-current-buffer (buffer &rest body)
(` (if (ediff-buffer-live-p (, buffer))
(save-current-buffer
(set-buffer (, buffer))
(,@ body))
(or (eq this-command 'ediff-quit)
(error ediff-KILLED-VITAL-BUFFER))
)))
(defsubst ediff-multiframe-setup-p ()
(and (ediff-window-display-p) ediff-multiframe))
......@@ -561,6 +580,13 @@ ediff-toggle-hilit. Use `setq-default' to set it.")
;; The original values of ediff-protected-variables for buffer Ancestor
(ediff-defvar-local ediff-buffer-values-orig-Ancestor nil "")
;; association between buff-type and ediff-buffer-values-orig-*
(defconst ediff-buffer-values-orig-alist
'((A . ediff-buffer-values-orig-A)
(B . ediff-buffer-values-orig-B)
(C . ediff-buffer-values-orig-C)
(Ancestor . ediff-buffer-values-orig-Ancestor)))
;; Buffer-local variables to be saved then restored during Ediff sessions
(defconst ediff-protected-variables '(
;;buffer-read-only
......@@ -585,6 +611,12 @@ ediff-toggle-hilit. Use `setq-default' to set it.")
(ediff-defvar-local ediff-difference-vector-B nil "")
(ediff-defvar-local ediff-difference-vector-C nil "")
(ediff-defvar-local ediff-difference-vector-Ancestor nil "")
;; A-list of diff vector types associated with buffer types
(defconst ediff-difference-vector-alist
'((A . ediff-difference-vector-A)
(B . ediff-difference-vector-B)
(C . ediff-difference-vector-C)
(Ancestor . ediff-difference-vector-Ancestor)))
;; [ status status status ...]
;; Each status: [state-of-merge state-of-ancestor]
......@@ -743,14 +775,30 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
(fset 'ediff-display-pixel-height
(symbol-function 'x-display-pixel-height))))
;; A-list of current-diff-overlay symbols asssociated with buf types
(defconst ediff-current-diff-overlay-alist
'((A . ediff-current-diff-overlay-A)
(B . ediff-current-diff-overlay-B)
(C . ediff-current-diff-overlay-C)
(Ancestor . ediff-current-diff-overlay-Ancestor)))
;; A-list of current-diff-face-* symbols asssociated with buf types
(defconst ediff-current-diff-face-alist
'((A . ediff-current-diff-face-A)
(B . ediff-current-diff-face-B)
(C . ediff-current-diff-face-C)
(Ancestor . ediff-current-diff-face-Ancestor)))
(defun ediff-make-current-diff-overlay (type)
(if (ediff-has-face-support-p)
(let ((overlay (intern (format "ediff-current-diff-overlay-%S" type)))
(let ((overlay (ediff-get-symbol-from-alist
type ediff-current-diff-overlay-alist))
(buffer (ediff-get-buffer type))
(face (face-name
(symbol-value
(intern (format "ediff-current-diff-face-%S" type))))))
(ediff-get-symbol-from-alist
type ediff-current-diff-face-alist)))))
(set overlay
(ediff-make-bullet-proof-overlay (point-max) (point-max) buffer))
(ediff-set-overlay-face (symbol-value overlay) face)
......@@ -1032,7 +1080,14 @@ ancestor buffer.")
ediff-even-diff-pixmap)))
'ediff-even-diff-face-Ancestor))
"Face highlighting even-numbered differences in the ancestor buffer.")
;; Association between buffer types and even-diff-face symbols
(defconst ediff-even-diff-face-alist
'((A . ediff-even-diff-face-A)
(B . ediff-even-diff-face-B)
(C . ediff-even-diff-face-C)
(Ancestor . ediff-even-diff-face-Ancestor)))
(defvar ediff-odd-diff-face-A
(if (ediff-has-face-support-p)
(progn
......@@ -1097,6 +1152,20 @@ ancestor buffer.")
'ediff-odd-diff-face-Ancestor))
"Face used to highlight even-numbered differences in the ancestor buffer.")
;; Association between buffer types and odd-diff-face symbols
(defconst ediff-odd-diff-face-alist
'((A . ediff-odd-diff-face-A)
(B . ediff-odd-diff-face-B)
(C . ediff-odd-diff-face-C)
(Ancestor . ediff-odd-diff-face-Ancestor)))
;; A-list of fine-diff face symbols associated with buffer types
(defconst ediff-fine-diff-face-alist
'((A . ediff-fine-diff-face-A)
(B . ediff-fine-diff-face-B)
(C . ediff-fine-diff-face-C)
(Ancestor . ediff-fine-diff-face-Ancestor)))
;; Help echo
(put 'ediff-fine-diff-face-A 'ediff-help-echo
"A `refinement' of the current difference region")
......@@ -1118,14 +1187,14 @@ ancestor buffer.")
"Overlay for the current difference region in buffer C.")
(ediff-defvar-local ediff-current-diff-overlay-Ancestor nil
"Overlay for the current difference region in the ancestor buffer.")
;; Compute priority of ediff overlay.
(defun ediff-highest-priority (start end buffer)
(let ((pos (max 1 (1- start)))
ovr-list)
(if ediff-xemacs-p
(1+ ediff-shadow-overlay-priority)
(ediff-eval-in-buffer buffer
(ediff-with-current-buffer buffer
(while (< pos (min (point-max) (1+ end)))
(setq ovr-list (append (overlays-at pos) ovr-list))
(setq pos (next-overlay-change pos)))
......@@ -1240,16 +1309,18 @@ More precisely, a regexp to match any one such character.")
(defsubst ediff-background-face (buf-type dif-num)
;; The value of dif-num is always 1- the one that user sees.
;; This is why even face is used when dif-num is odd.
(intern (format (if (ediff-odd-p dif-num)
"ediff-even-diff-face-%S"
"ediff-odd-diff-face-%S")
buf-type)))
(ediff-get-symbol-from-alist
buf-type (if (ediff-odd-p dif-num)
ediff-even-diff-face-alist
ediff-odd-diff-face-alist)
))
;; activate faces on diff regions in buffer
(defun ediff-paint-background-regions-in-one-buffer (buf-type unhighlight)
(let ((diff-vector
(eval (intern (format "ediff-difference-vector-%S" buf-type))))
(eval (ediff-get-symbol-from-alist
buf-type ediff-difference-vector-alist)))
overl diff-num)
(mapcar (function
(lambda (rec)
......@@ -1279,14 +1350,15 @@ More precisely, a regexp to match any one such character.")
(defun ediff-highlight-diff-in-one-buffer (n buf-type)
(if (ediff-buffer-live-p (ediff-get-buffer buf-type))
(let* ((buff (ediff-get-buffer buf-type))
(last (ediff-eval-in-buffer buff (point-max)))
(last (ediff-with-current-buffer buff (point-max)))
(begin (ediff-get-diff-posn buf-type 'beg n))
(end (ediff-get-diff-posn buf-type 'end n))
(xtra (if (equal begin end) 1 0))
(end-hilit (min last (+ end xtra)))
(current-diff-overlay
(symbol-value
(intern (format "ediff-current-diff-overlay-%S" buf-type)))))
(ediff-get-symbol-from-alist
buf-type ediff-current-diff-overlay-alist))))
(if ediff-xemacs-p
(ediff-move-overlay current-diff-overlay begin end-hilit)
......@@ -1305,7 +1377,8 @@ More precisely, a regexp to match any one such character.")
(if (ediff-buffer-live-p (ediff-get-buffer buf-type))
(let ((current-diff-overlay
(symbol-value
(intern (format "ediff-current-diff-overlay-%S" buf-type))))
(ediff-get-symbol-from-alist
buf-type ediff-current-diff-overlay-alist)))
(overlay
(ediff-get-diff-overlay ediff-current-difference buf-type))
)
......@@ -1326,7 +1399,8 @@ More precisely, a regexp to match any one such character.")
(if (and (ediff-has-face-support-p) ediff-use-faces)
(let* ((inhibit-quit t)
(current-diff-overlay-var
(intern (format "ediff-current-diff-overlay-%S" buf-type)))
(ediff-get-symbol-from-alist
buf-type ediff-current-diff-overlay-alist))
(current-diff-overlay (symbol-value current-diff-overlay-var)))
(ediff-paint-background-regions 'unhighlight)
(if (ediff-overlayp current-diff-overlay)
......@@ -1557,7 +1631,7 @@ Checks if overlay's buffer exists."
(ediff-empty-diff-region-p n buf-type)
(let ((beg (ediff-get-diff-posn buf-type 'beg n))
(end (ediff-get-diff-posn buf-type 'end n)))
(ediff-eval-in-buffer (ediff-get-buffer buf-type)
(ediff-with-current-buffer (ediff-get-buffer buf-type)
(save-excursion
(goto-char beg)
(skip-chars-forward ediff-whitespace)
......@@ -1632,8 +1706,8 @@ Checks if overlay's buffer exists."
(defsubst ediff-get-region-contents (n buf-type ctrl-buf &optional start end)
(ediff-eval-in-buffer
(ediff-eval-in-buffer ctrl-buf (ediff-get-buffer buf-type))
(ediff-with-current-buffer
(ediff-with-current-buffer ctrl-buf (ediff-get-buffer buf-type))
(buffer-substring
(or start (ediff-get-diff-posn buf-type 'beg n ctrl-buf))
(or end (ediff-get-diff-posn buf-type 'end n ctrl-buf)))))
......@@ -1678,8 +1752,8 @@ Checks if overlay's buffer exists."
;;; Local Variables:
;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
;;; End:
(provide 'ediff-init)
......
......@@ -281,7 +281,7 @@ Combining is done according to the specifications in variable
reg-a-beg reg-a-end reg-b-beg reg-b-end reg-c-beg reg-c-end)
(if combined
(ediff-eval-in-buffer ediff-buffer-C
(ediff-with-current-buffer ediff-buffer-C
(goto-char reg-beg)
(search-forward pat1 reg-end 'noerror)
(setq reg-a-beg (match-beginning 0))
......@@ -300,8 +300,8 @@ Combining is done according to the specifications in variable
;;; Local Variables:
;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
;;; End:
;; ediff-merg.el ends here
......@@ -559,7 +559,7 @@ Moves in circular fashion. With numeric prefix arg, skip this many items."
(let* ((meta-buffer-name
(ediff-unique-buffer-name meta-buffer-name "*"))
(meta-buffer (get-buffer-create meta-buffer-name)))
(ediff-eval-in-buffer meta-buffer
(ediff-with-current-buffer meta-buffer
;; comes first
(ediff-meta-mode)
......@@ -662,7 +662,7 @@ Moves in circular fashion. With numeric prefix arg, skip this many items."
regexp elt session-buf f1 f2 f3 pt
merge-autostore-dir
point tmp-list buffer-read-only)
(ediff-eval-in-buffer meta-buf
(ediff-with-current-buffer meta-buf
(setq point (point))
(erase-buffer)
(insert (format ediff-meta-buffer-message
......@@ -828,7 +828,7 @@ Moves in circular fashion. With numeric prefix arg, skip this many items."
;; skip the directory part
(setq diff-list (cdr diff-list))
(setq ediff-dir-diffs-buffer (get-buffer-create buf-name))
(ediff-eval-in-buffer ediff-dir-diffs-buffer
(ediff-with-current-buffer ediff-dir-diffs-buffer
(use-local-map ediff-dir-diffs-buffer-map)
(erase-buffer)
(setq ediff-meta-buffer meta-buf)
......@@ -938,7 +938,7 @@ Useful commands:
;; argument is ignored
(defun ediff-redraw-registry-buffer (&optional ignore)
(ediff-eval-in-buffer ediff-registry-buffer
(ediff-with-current-buffer ediff-registry-buffer
(let ((point (point))
elt bufAname bufBname bufCname cur-diff total-diffs pt
job-name meta-list registry-list buffer-read-only)
......@@ -975,7 +975,7 @@ Useful commands:
registry-list (cdr registry-list))
(if (ediff-buffer-live-p elt)
(if (ediff-eval-in-buffer elt
(if (ediff-with-current-buffer elt
(setq job-name ediff-metajob-name
meta-list ediff-meta-list)
(and ediff-metajob-name
......@@ -1000,7 +1000,7 @@ Useful commands:
""))))
(ediff-set-meta-overlay pt (point) elt))
(progn
(ediff-eval-in-buffer elt
(ediff-with-current-buffer elt
(setq bufAname (if (ediff-buffer-live-p ediff-buffer-A)
(buffer-name ediff-buffer-A)
"!!!killed buffer!!!")
......@@ -1143,7 +1143,7 @@ Useful commands:
(metajob ediff-metajob-name)
tmp-buf custom-diff-buf)
(if (ediff-buffer-live-p session-buf)
(ediff-eval-in-buffer session-buf
(ediff-with-current-buffer session-buf
(if (eq ediff-control-buffer session-buf) ; individual session
(progn
(ediff-compute-custom-diffs-maybe)
......@@ -1191,7 +1191,7 @@ all marked sessions must be active."
(setq ediff-meta-diff-buffer
(get-buffer-create
(ediff-unique-buffer-name "*Ediff Multifile Diffs" "*"))))
(ediff-eval-in-buffer ediff-meta-diff-buffer
(ediff-with-current-buffer ediff-meta-diff-buffer
(erase-buffer))
(if (> (ediff-operate-on-marked-sessions 'ediff-append-custom-diff) 0)
;; did something
......@@ -1207,7 +1207,7 @@ all marked sessions must be active."