aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-07-07 20:37:19 +0000
committerStefan Monnier2007-07-07 20:37:19 +0000
commit7c33af856e7f8a8158cd29f1cfea0377dd91af42 (patch)
tree9e74a456873fad0dfd21004e96f442f1a2ba169e
parentfc70e90f985e1d8c567385396b14bda1b1e51831 (diff)
downloademacs-7c33af856e7f8a8158cd29f1cfea0377dd91af42.tar.gz
emacs-7c33af856e7f8a8158cd29f1cfea0377dd91af42.zip
(vc-exec-after): Don't move point from the sentinel.
Forcefully read all the remaining text in the pipe upon process exit. (vc-annotate-display-autoscale, vc-annotate-lines): Don't stop at the first unrecognized line. (vc-annotate-display-select): Run autoscale after the process is done since it depends on the whole result.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/vc.el81
2 files changed, 51 insertions, 39 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f58d41ec070..bf45b3524f4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12007-07-07 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * vc.el (vc-exec-after): Don't move point from the sentinel.
4 Forcefully read all the remaining text in the pipe upon process exit.
5 (vc-annotate-display-autoscale, vc-annotate-lines):
6 Don't stop at the first unrecognized line.
7 (vc-annotate-display-select): Run autoscale after the process is done
8 since it depends on the whole result.
9
12007-07-07 Eli Zaretskii <eliz@gnu.org> 102007-07-07 Eli Zaretskii <eliz@gnu.org>
2 11
3 * term/w32-win.el (menu-bar-open): New function. 12 * term/w32-win.el (menu-bar-open): New function.
diff --git a/lisp/vc.el b/lisp/vc.el
index cf546c0173f..8342a86a4f7 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -952,6 +952,8 @@ Else, add CODE to the process' sentinel."
952 ;; lost. Terminated processes get deleted automatically 952 ;; lost. Terminated processes get deleted automatically
953 ;; anyway. -- cyd 953 ;; anyway. -- cyd
954 ((or (null proc) (eq (process-status proc) 'exit)) 954 ((or (null proc) (eq (process-status proc) 'exit))
955 ;; Make sure we've read the process's output before going further.
956 (if proc (accept-process-output proc))
955 (eval code)) 957 (eval code))
956 ;; If a process is running, add CODE to the sentinel 958 ;; If a process is running, add CODE to the sentinel
957 ((eq (process-status proc) 'run) 959 ((eq (process-status proc) 'run)
@@ -959,12 +961,13 @@ Else, add CODE to the process' sentinel."
959 (set-process-sentinel proc 961 (set-process-sentinel proc
960 `(lambda (p s) 962 `(lambda (p s)
961 (with-current-buffer ',(current-buffer) 963 (with-current-buffer ',(current-buffer)
962 (goto-char (process-mark p)) 964 (save-excursion
963 ,@(append (cdr (cdr (cdr ;strip off `with-current-buffer buf 965 (goto-char (process-mark p))
964 ; (goto-char...)' 966 ,@(append (cdr (cdr (car ;Strip off (save-exc (goto-char...)
965 (car (cdr (cdr ;strip off `lambda (p s)' 967 (cdr (cdr ;Strip off (with-current-buffer buf
966 sentinel)))))) 968 (car (cdr (cdr ;Strip off (lambda (p s)
967 (list `(vc-exec-after ',code)))))))) 969 sentinel))))))))
970 (list `(vc-exec-after ',code)))))))))
968 (t (error "Unexpected process state")))) 971 (t (error "Unexpected process state"))))
969 nil) 972 nil)
970 973
@@ -3056,13 +3059,13 @@ cover the range from the oldest annotation to the newest."
3056 ;; Run through this file and find the oldest and newest dates annotated. 3059 ;; Run through this file and find the oldest and newest dates annotated.
3057 (save-excursion 3060 (save-excursion
3058 (goto-char (point-min)) 3061 (goto-char (point-min))
3059 (while (setq date (prog1 (vc-call-backend vc-annotate-backend 3062 (while (not (eobp))
3060 'annotate-time) 3063 (when (setq date (vc-call-backend vc-annotate-backend 'annotate-time))
3061 (forward-line 1))) 3064 (if (> date newest)
3062 (if (> date newest) 3065 (setq newest date))
3063 (setq newest date)) 3066 (if (< date oldest)
3064 (if (< date oldest) 3067 (setq oldest date)))
3065 (setq oldest date)))) 3068 (forward-line 1)))
3066 (vc-annotate-display 3069 (vc-annotate-display
3067 (/ (- (if full newest current) oldest) 3070 (/ (- (if full newest current) oldest)
3068 (vc-annotate-oldest-in-map vc-annotate-color-map)) 3071 (vc-annotate-oldest-in-map vc-annotate-color-map))
@@ -3127,9 +3130,9 @@ use; you may override this using the second optional arg MODE."
3127 (vc-annotate-display-default (or vc-annotate-ratio 1.0))) 3130 (vc-annotate-display-default (or vc-annotate-ratio 1.0)))
3128 ;; One of the auto-scaling modes 3131 ;; One of the auto-scaling modes
3129 ((eq vc-annotate-display-mode 'scale) 3132 ((eq vc-annotate-display-mode 'scale)
3130 (vc-annotate-display-autoscale)) 3133 (vc-exec-after `(vc-annotate-display-autoscale)))
3131 ((eq vc-annotate-display-mode 'fullscale) 3134 ((eq vc-annotate-display-mode 'fullscale)
3132 (vc-annotate-display-autoscale t)) 3135 (vc-exec-after `(vc-annotate-display-autoscale t)))
3133 ((numberp vc-annotate-display-mode) ; A fixed number of days lookback 3136 ((numberp vc-annotate-display-mode) ; A fixed number of days lookback
3134 (vc-annotate-display-default 3137 (vc-annotate-display-default
3135 (/ vc-annotate-display-mode 3138 (/ vc-annotate-display-mode
@@ -3383,30 +3386,30 @@ The annotations are relative to the current time, unless overridden by OFFSET."
3383 (font-lock-mode 1)) 3386 (font-lock-mode 1))
3384 3387
3385(defun vc-annotate-lines (limit) 3388(defun vc-annotate-lines (limit)
3386 (let (difference) 3389 (while (< (point) limit)
3387 (while (and (< (point) limit) 3390 (let ((difference (vc-annotate-difference vc-annotate-offset))
3388 (setq difference (vc-annotate-difference vc-annotate-offset))) 3391 (start (point))
3389 (let* ((color (or (vc-annotate-compcar difference vc-annotate-color-map) 3392 (end (progn (forward-line 1) (point))))
3390 (cons nil vc-annotate-very-old-color))) 3393 (when difference
3391 ;; substring from index 1 to remove any leading `#' in the name 3394 (let* ((color (or (vc-annotate-compcar difference vc-annotate-color-map)
3392 (face-name (concat "vc-annotate-face-" 3395 (cons nil vc-annotate-very-old-color)))
3393 (if (string-equal 3396 ;; substring from index 1 to remove any leading `#' in the name
3394 (substring (cdr color) 0 1) "#") 3397 (face-name (concat "vc-annotate-face-"
3395 (substring (cdr color) 1) 3398 (if (string-equal
3396 (cdr color)))) 3399 (substring (cdr color) 0 1) "#")
3397 ;; Make the face if not done. 3400 (substring (cdr color) 1)
3398 (face (or (intern-soft face-name) 3401 (cdr color))))
3399 (let ((tmp-face (make-face (intern face-name)))) 3402 ;; Make the face if not done.
3400 (set-face-foreground tmp-face (cdr color)) 3403 (face (or (intern-soft face-name)
3401 (if vc-annotate-background 3404 (let ((tmp-face (make-face (intern face-name))))
3402 (set-face-background tmp-face 3405 (set-face-foreground tmp-face (cdr color))
3403 vc-annotate-background)) 3406 (if vc-annotate-background
3404 tmp-face))) ; Return the face 3407 (set-face-background tmp-face
3405 (point (point))) 3408 vc-annotate-background))
3406 (forward-line 1) 3409 tmp-face)))) ; Return the face
3407 (put-text-property point (point) 'face face))) 3410 (put-text-property start end 'face face)))))
3408 ;; Pretend to font-lock there were no matches. 3411 ;; Pretend to font-lock there were no matches.
3409 nil)) 3412 nil)
3410 3413
3411;; Collect back-end-dependent stuff here 3414;; Collect back-end-dependent stuff here
3412 3415