emacs-pretest-bug
[Top][All Lists]
Advanced

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

ediff on osx


From: Bruce Ingalls
Subject: ediff on osx
Date: Mon, 26 Apr 2004 21:33:50 -0400
User-agent: Mozilla Thunderbird 0.5 (Windows/20040207)

I wrote the following code, which works fine on other OSes. However, on the
Aqua port on Mac OS X, closing ediff fails.

;;__________________________________________________________________________
;;}}}
;;{{{        Ediff Setup

;;(setq-default ediff-highlight-all-diffs 'nil) ;only hilight current diff

(when (and window-system
      (or (not (boundp 'ecb-minor-mode)) (not (ecb-minor-mode))))
 (progn
   ;; no control window:
   (setq ediff-window-setup-function 'ediff-setup-windows-plain
     ediff-split-window-function 'split-window-horizontally
     ediff-diff-options "-w")    ;turn off whitespace

   (add-hook 'ediff-cleanup-hook 'ediff-toggle-wide-display) ;ret win size
   (add-hook 'ediff-cleanup-hook 'ediff-janitor) ;close ediff windows @exit

   (add-hook
    'ediff-startup-hook
    (lambda ()
      (ediff-toggle-wide-display)        ;wide by default

      (cache-locate-library
   use-cache 'cache-scroll-all "scroll-all"
"For multi window scrolling and better gui ediffs, get scroll-all.el from Emacs distribution.")
      (when cache-scroll-all
    (progn
      (require 'scroll-all)
      (scroll-all-mode)))))))    ;end when window-system

(defun my-ediff-scroll-up (&optional arg) (interactive)
 (setq last-command-char ?V)
 (ediff-scroll-vertically arg))
(defun my-ediff-scroll-down (&optional arg) (interactive)
 (setq last-command-char ?v)
 (ediff-scroll-vertically arg))
(defun my-ediff-page-up (&optional arg) (interactive)
 (setq last-command-char ?V)
 (ediff-scroll-vertically arg)
 (ediff-scroll-vertically arg))
(defun my-ediff-page-down (&optional arg) (interactive)
 (setq last-command-char ?v)
 (ediff-scroll-vertically arg)
 (ediff-scroll-vertically arg))
(defun my-ediff-scroll-1-up () (interactive)
 (setq last-command-char ?V)
 (ediff-scroll-vertically 1))
(defun my-ediff-scroll-1-down () (interactive)
 (setq last-command-char ?v)
 (ediff-scroll-vertically 1))
(defun my-ediff-scroll-left (&optional arg) (interactive)
 (setq last-command-char ?>)
 (ediff-scroll-horizontally arg))
(defun my-ediff-scroll-right (&optional arg) (interactive)
 (setq last-command-char ?<)
 (ediff-scroll-horizontally arg))
(defun my-ediff-scroll-1-left () (interactive)
 (setq last-command-char ?>)
 (let ((current-prefix-arg 1))
   (call-interactively 'ediff-scroll-horizontally)))
(defun my-ediff-scroll-1-right () (interactive)
 (setq last-command-char ?<)
 (let ((current-prefix-arg 1))
   (call-interactively 'ediff-scroll-horizontally)))

(add-hook
'ediff-keymap-setup-hook
(lambda ()
  (define-key ediff-mode-map [left] 'my-ediff-scroll-1-left)
  (define-key ediff-mode-map [right] 'my-ediff-scroll-1-right)
  (define-key ediff-mode-map [up] 'my-ediff-scroll-1-up)
  (define-key ediff-mode-map [down] 'my-ediff-scroll-1-down)
  (define-key ediff-mode-map [(control left)] 'my-ediff-scroll-left)
  (define-key ediff-mode-map [(control right)] 'my-ediff-scroll-right)
  (define-key ediff-mode-map [(control up)] 'my-ediff-scroll-up)
  (define-key ediff-mode-map [(control down)] 'my-ediff-scroll-down)
  (define-key ediff-mode-map [(next)] 'my-ediff-page-up)
  (define-key ediff-mode-map [(prior)] 'my-ediff-page-down)
  (define-key ediff-mode-map (kbd "d") 'ediff-toggle-wide-display)))





reply via email to

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