]> code.delx.au - gnu-emacs/blobdiff - lisp/pcvs.el
(display_tool_bar_line): Skip glyphs which are too big
[gnu-emacs] / lisp / pcvs.el
index b9d04522181df5f4dd7678b0d982c5d1cb692102..89aeef53b8045099fc07c08196a967c56dfc20dc 100644 (file)
@@ -467,7 +467,7 @@ If non-nil, NEW means to create a new buffer no matter what."
         (cvs-mode)
         (set (make-local-variable 'list-buffers-directory) buffer-name)
         ;;(set (make-local-variable 'cvs-temp-buffer) (cvs-temp-buffer))
-        (let ((cookies (ewoc-create 'cvs-fileinfo-pp "\n" "")))
+        (let ((cookies (ewoc-create 'cvs-fileinfo-pp "\n\n" "\n" t)))
           (set (make-local-variable 'cvs-cookies) cookies)
           (add-hook 'kill-buffer-hook
                     (lambda ()
@@ -618,7 +618,7 @@ If non-nil, NEW means to create a new buffer no matter what."
         (str (car hf))
         (done "")
         (tin (ewoc-nth cvs-cookies 0)))
-    (if (eq (length str) 1) (setq str ""))
+    (if (eq (length str) 2) (setq str ""))
     ;; look for the first *real* fileinfo (to determine emptyness)
     (while
        (and tin
@@ -633,6 +633,7 @@ If non-nil, NEW means to create a new buffer no matter what."
        (setq str (replace-match "" t t str))
        (if (zerop (length str)) (setq str "\n"))
        (setq done (concat "-- last cmd: " cmd " --"))))
+    (setq str (concat str "\n") done (concat done "\n"))
     ;; set the new header and footer
     (ewoc-set-hf cvs-cookies
                 str (concat "\n--------------------- "
@@ -1722,16 +1723,22 @@ Signal an error if there is no backup file."
          (message "Retrieving revision %s..." rev)
          ;; Discard stderr output to work around the CVS+SSH+libc
          ;; problem when stdout and stderr are the same.
-         (let ((res (apply 'call-process cvs-program nil '(t nil) nil
-                           "-q" "update" "-p"
-                           ;; If `rev' is HEAD, don't pass it at all:
-                           ;; the default behavior is to get the head
-                           ;; of the current branch whereas "-r HEAD"
-                           ;; stupidly gives you the head of the trunk.
-                           (append (unless (equal rev "HEAD") (list "-r" rev))
-                                   (list file)))))
+         (let ((res
+                 (let ((coding-system-for-read 'binary))
+                   (apply 'call-process cvs-program nil '(t nil) nil
+                          "-q" "update" "-p"
+                          ;; If `rev' is HEAD, don't pass it at all:
+                          ;; the default behavior is to get the head
+                          ;; of the current branch whereas "-r HEAD"
+                          ;; stupidly gives you the head of the trunk.
+                          (append (unless (equal rev "HEAD") (list "-r" rev))
+                                  (list file))))))
            (when (and res (not (and (equal 0 res))))
              (error "Something went wrong retrieving revision %s: %s" rev res))
+            ;; Figure out the encoding used and decode the byte-sequence
+            ;; into a sequence of chars.
+            (decode-coding-inserted-region
+             (point-min) (point-max) file t nil nil t)
            (set-buffer-modified-p nil)
            (let ((buffer-file-name (expand-file-name file)))
              (after-find-file))