emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/ediff-mult.el


From: Michael Kifer
Subject: [Emacs-diffs] Changes to emacs/lisp/ediff-mult.el
Date: Mon, 07 Jan 2002 23:36:02 -0500

Index: emacs/lisp/ediff-mult.el
diff -c emacs/lisp/ediff-mult.el:1.26 emacs/lisp/ediff-mult.el:1.27
*** emacs/lisp/ediff-mult.el:1.26       Mon Dec 24 00:50:31 2001
--- emacs/lisp/ediff-mult.el    Mon Jan  7 23:36:01 2002
***************
*** 1,8 ****
  ;;; ediff-mult.el --- support for multi-file/multi-buffer processing in Ediff
  
! ;; Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
  
! ;; Author: Michael Kifer <address@hidden>
  
  ;; This file is part of GNU Emacs.
  
--- 1,8 ----
  ;;; ediff-mult.el --- support for multi-file/multi-buffer processing in Ediff
  
! ;; Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02 Free Software Foundation, 
Inc.
  
! ;; Author: Michael Kifer <address@hidden>
  
  ;; This file is part of GNU Emacs.
  
***************
*** 815,823 ****
        (erase-buffer)
        ;; delete phony overlays that used to represent sessions before the buff
        ;; was redrawn
!       (if ediff-emacs-p
!         (mapcar 'delete-overlay (overlays-in 1 1))
!       (map-extents 'delete-extent))
        
        (insert (format ediff-meta-buffer-message
                      (ediff-abbrev-jobname ediff-metajob-name)))
--- 815,824 ----
        (erase-buffer)
        ;; delete phony overlays that used to represent sessions before the buff
        ;; was redrawn
!       (ediff-cond-compile-for-xemacs-or-emacs
!        (map-extents 'delete-extent)   ; xemacs
!        (mapcar 'delete-overlay (overlays-in 1 1))  ; emacs
!        )
        
        (insert (format ediff-meta-buffer-message
                      (ediff-abbrev-jobname ediff-metajob-name)))
***************
*** 918,947 ****
  (defun ediff-update-session-marker-in-dir-meta-buffer (session-num)
    (let (buffer-meta-overlays session-info overl buffer-read-only)
      (setq overl
!         (if ediff-xemacs-p
!             (map-extents
!              (lambda (ext maparg)
!                (if (and
!                     (ediff-overlay-get ext 'ediff-meta-info)
!                     (eq (ediff-overlay-get ext 'ediff-meta-session-number)
!                         session-num))
!                    ext)))
            ;; Emacs doesn't have map-extents, so try harder
            ;; Splice overlay lists to get all buffer overlays
!           (setq buffer-meta-overlays (overlay-lists)
!                 buffer-meta-overlays (append (car buffer-meta-overlays)
!                                              (cdr buffer-meta-overlays)))
!           (car
!            (delq nil
!                  (mapcar
!                   (lambda (overl)
!                     (if (and
!                          (ediff-overlay-get overl 'ediff-meta-info)
!                          (eq (ediff-overlay-get
!                               overl 'ediff-meta-session-number)
!                              session-num))
!                         overl))
!                   buffer-meta-overlays)))))
      (or overl
        (error
         "Bug in ediff-update-session-marker-in-dir-meta-buffer: no overlay 
with given number %S"
--- 919,950 ----
  (defun ediff-update-session-marker-in-dir-meta-buffer (session-num)
    (let (buffer-meta-overlays session-info overl buffer-read-only)
      (setq overl
!         (ediff-cond-compile-for-xemacs-or-emacs
!          (map-extents ; xemacs
!           (lambda (ext maparg)
!             (if (and
!                  (ediff-overlay-get ext 'ediff-meta-info)
!                  (eq (ediff-overlay-get ext 'ediff-meta-session-number)
!                      session-num))
!                 ext)))
            ;; Emacs doesn't have map-extents, so try harder
            ;; Splice overlay lists to get all buffer overlays
!          (progn
!            (setq buffer-meta-overlays (overlay-lists)
!                  buffer-meta-overlays (append (car buffer-meta-overlays)
!                                               (cdr buffer-meta-overlays)))
!            (car
!             (delq nil
!                   (mapcar
!                    (lambda (overl)
!                      (if (and
!                           (ediff-overlay-get overl 'ediff-meta-info)
!                           (eq (ediff-overlay-get
!                                overl 'ediff-meta-session-number)
!                               session-num))
!                          overl))
!                    buffer-meta-overlays))))
!          ))
      (or overl
        (error
         "Bug in ediff-update-session-marker-in-dir-meta-buffer: no overlay 
with given number %S"
***************
*** 1179,1187 ****
        (erase-buffer)
        ;; delete phony overlays that used to represent sessions before the buff
        ;; was redrawn
!       (if ediff-emacs-p
!         (mapcar 'delete-overlay (overlays-in 1 1))
!       (map-extents 'delete-extent))
  
        (insert "This is a registry of all active Ediff sessions.
  
--- 1182,1191 ----
        (erase-buffer)
        ;; delete phony overlays that used to represent sessions before the buff
        ;; was redrawn
!       (ediff-cond-compile-for-xemacs-or-emacs
!        (map-extents 'delete-extent) ; xemacs
!        (mapcar 'delete-overlay (overlays-in 1 1)) ; emacs
!        )
  
        (insert "This is a registry of all active Ediff sessions.
  
***************
*** 1507,1513 ****
              
  ;; This function executes in meta buffer.  It knows where event happened.
  (defun ediff-filegroup-action ()
!   "Execute appropriate action for the selected session."
    (interactive)
    (let* ((pos (ediff-event-point last-command-event))
         (meta-buf (ediff-event-buffer last-command-event))
--- 1511,1517 ----
              
  ;; This function executes in meta buffer.  It knows where event happened.
  (defun ediff-filegroup-action ()
!   "Execute appropriate action for a selected session."
    (interactive)
    (let* ((pos (ediff-event-point last-command-event))
         (meta-buf (ediff-event-buffer last-command-event))
***************
*** 1795,1800 ****
--- 1799,1806 ----
          (setq frame (window-frame wind))
          (raise-frame frame)
          (ediff-reset-mouse frame)))
+     (sit-for 0) ; sometimes needed to synch the display and ensure that the
+               ; point ends up after the just completed session
      (run-hooks 'ediff-show-session-group-hook)
      ))
  
***************
*** 1975,1993 ****
    (let (result olist tmp)
      (if (and point (ediff-buffer-live-p buf))
        (ediff-with-current-buffer buf
!         (if ediff-xemacs-p
!             (setq result
!                   (if (setq tmp (extent-at point buf 'ediff-meta-info))
!                       (ediff-overlay-get tmp 'ediff-meta-info)))
!           (setq olist (overlays-at point))
!           (setq olist
!                 (mapcar (lambda (elt)
!                           (unless (overlay-get elt 'invisible)
!                             (overlay-get elt 'ediff-meta-info)))
!                         olist))
!           (while (and olist (null (car olist)))
!             (setq olist (cdr olist)))
!           (setq result (car olist)))))
      (if result
        result
        (if noerror
--- 1981,2002 ----
    (let (result olist tmp)
      (if (and point (ediff-buffer-live-p buf))
        (ediff-with-current-buffer buf
!         (ediff-cond-compile-for-xemacs-or-emacs
!          (setq result  ; xemacs
!                (if (setq tmp (extent-at point buf 'ediff-meta-info))
!                    (ediff-overlay-get tmp 'ediff-meta-info)))
!          (progn ; emacs
!            (setq olist (overlays-at point))
!            (setq olist
!                  (mapcar (lambda (elt)
!                            (unless (overlay-get elt 'invisible)
!                              (overlay-get elt 'ediff-meta-info)))
!                          olist))
!            (while (and olist (null (car olist)))
!              (setq olist (cdr olist)))
!            (setq result (car olist)))
!          )
!         ))
      (if result
        result
        (if noerror
***************
*** 1997,2010 ****
  
  
  (defun ediff-get-meta-overlay-at-pos (point)
!   (if ediff-xemacs-p
!       (extent-at point (current-buffer) 'ediff-meta-info)
!     (let* ((overl-list (overlays-at point))
!          (overl (car overl-list)))
!       (while (and overl (null (overlay-get overl 'ediff-meta-info)))
!       (setq overl-list (cdr overl-list)
!             overl (car overl-list)))
!       overl)))
  
  (defsubst ediff-get-session-number-at-pos (point &optional meta-buffer)
    (setq meta-buffer (if (ediff-buffer-live-p meta-buffer)
--- 2006,2022 ----
  
  
  (defun ediff-get-meta-overlay-at-pos (point)
!   (ediff-cond-compile-for-xemacs-or-emacs
!    (extent-at point (current-buffer) 'ediff-meta-info) ; xemacs
!    ;; emacs
!    (let* ((overl-list (overlays-at point))
!         (overl (car overl-list)))
!      (while (and overl (null (overlay-get overl 'ediff-meta-info)))
!        (setq overl-list (cdr overl-list)
!            overl (car overl-list)))
!      overl)
!    )
!   )
  
  (defsubst ediff-get-session-number-at-pos (point &optional meta-buffer)
    (setq meta-buffer (if (ediff-buffer-live-p meta-buffer)
***************
*** 2020,2037 ****
    (if (eobp)
        (goto-char (point-min))
      (let ((overl (ediff-get-meta-overlay-at-pos point)))
!       (if ediff-xemacs-p
!         (progn
!           (if overl
!               (setq overl (next-extent overl))
!             (setq overl (next-extent (current-buffer))))
!           (if overl
!               (extent-start-position overl)
!             (point-max)))
!       (if overl
!           ;; note: end of current overlay is the beginning of the next one
!           (overlay-end overl)
!         (next-overlay-change point))))
      ))
  
  
--- 2032,2052 ----
    (if (eobp)
        (goto-char (point-min))
      (let ((overl (ediff-get-meta-overlay-at-pos point)))
!       (ediff-cond-compile-for-xemacs-or-emacs
!        (progn ; xemacs
!        (if overl
!            (setq overl (next-extent overl))
!          (setq overl (next-extent (current-buffer))))
!        (if overl
!            (extent-start-position overl)
!          (point-max)))
!        ;; emacs
!        (if overl
!          ;; note: end of current overlay is the beginning of the next one
!          (overlay-end overl)
!        (next-overlay-change point))
!        )
!       )
      ))
  
  
***************
*** 2039,2065 ****
    (if (bobp)
        (goto-char (point-max))
      (let ((overl (ediff-get-meta-overlay-at-pos point)))
!       (if ediff-xemacs-p
!         (progn
!           (if overl
!               (setq overl (previous-extent overl))
!             (setq overl (previous-extent (current-buffer))))
!           (if overl
!               (extent-start-position overl)
!             (point-min)))
!       (if overl (setq point (overlay-start overl)))
!       ;; to get to the beginning of prev overlay
!       (if (not (bobp))
!           ;; trick to overcome an emacs bug--doesn't always find previous
!           ;; overlay change correctly
!           (setq point (1- point)))
!       (setq point (previous-overlay-change point))
!       ;; If we are not over an overlay after subtracting 1, it means we are
!       ;; in the description area preceding session records.  In this case,
!       ;; goto the top of the registry buffer.
!       (or (car (overlays-at point))
!           (setq point (point-min)))
!       point))))
  
  ;; this is the action invoked when the user selects a patch from the meta
  ;; buffer.
--- 2054,2083 ----
    (if (bobp)
        (goto-char (point-max))
      (let ((overl (ediff-get-meta-overlay-at-pos point)))
!       (ediff-cond-compile-for-xemacs-or-emacs
!        (progn
!        (if overl
!            (setq overl (previous-extent overl))
!          (setq overl (previous-extent (current-buffer))))
!        (if overl
!            (extent-start-position overl)
!          (point-min)))
!        (progn
!        (if overl (setq point (overlay-start overl)))
!        ;; to get to the beginning of prev overlay
!        (if (not (bobp))
!            ;; trick to overcome an emacs bug--doesn't always find previous
!            ;; overlay change correctly
!            (setq point (1- point)))
!        (setq point (previous-overlay-change point))
!        ;; If we are not over an overlay after subtracting 1, it means we are
!        ;; in the description area preceding session records.  In this case,
!        ;; goto the top of the registry buffer.
!        (or (car (overlays-at point))
!            (setq point (point-min)))
!        point)
!        )
!       )))
  
  ;; this is the action invoked when the user selects a patch from the meta
  ;; buffer.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]