Show
Ignore:
Timestamp:
07/01/06 08:27:06 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/diff.el

    r4037 r4098  
    6868  (save-excursion 
    6969    (goto-char (point-max)) 
    70     (insert (format "\nDiff finished%s.  %s\n" 
    71                     (if (equal 0 code) " (no differences)" "") 
    72                     (current-time-string))))) 
     70    (let ((inhibit-read-only t)) 
     71      (insert (format "\nDiff finished%s.  %s\n" 
     72                      (if (equal 0 code) " (no differences)" "") 
     73                      (current-time-string)))))) 
    7374 
    7475;;;###autoload 
     
    120121      (setq buffer-read-only nil) 
    121122      (buffer-disable-undo (current-buffer)) 
    122       (erase-buffer) 
     123      (let ((inhibit-read-only t)) 
     124        (erase-buffer)) 
    123125      (buffer-enable-undo (current-buffer)) 
    124126      (diff-mode) 
     
    129131      (set (make-local-variable 'diff-new-temp-file) new-alt) 
    130132      (setq default-directory thisdir) 
    131       (insert command "\n") 
     133      (let ((inhibit-read-only t)) 
     134        (insert command "\n")) 
    132135      (if (and (not no-async) (fboundp 'start-process)) 
    133136          (progn 
    134137            (setq proc (start-process "Diff" buf shell-file-name 
    135138                                      shell-command-switch command)) 
     139            (set-process-filter proc 'diff-process-filter) 
    136140            (set-process-sentinel 
    137141             proc (lambda (proc msg) 
     
    139143                      (diff-sentinel (process-exit-status proc)))))) 
    140144        ;; Async processes aren't available. 
    141         (diff-sentinel 
    142          (call-process shell-file-name nil buf nil 
    143                        shell-command-switch command)))) 
     145        (let ((inhibit-read-only t)) 
     146          (diff-sentinel 
     147           (call-process shell-file-name nil buf nil 
     148                         shell-command-switch command))))) 
    144149    buf)) 
     150 
     151(defun diff-process-filter (proc string) 
     152  (with-current-buffer (process-buffer proc) 
     153    (let ((moving (= (point) (process-mark proc)))) 
     154      (save-excursion 
     155        ;; Insert the text, advancing the process marker. 
     156        (goto-char (process-mark proc)) 
     157        (let ((inhibit-read-only t)) 
     158          (insert string)) 
     159        (set-marker (process-mark proc) (point))) 
     160      (if moving (goto-char (process-mark proc)))))) 
    145161 
    146162;;;###autoload