User: scop
Date: 06/04/16 16:19:45
Modified: packages/unsupported/scop/vc ChangeLog vc-xemacs.el vc.el
Log:
Sync vc with upstream.
Revision Changes Path
1.58 +1 -1 XEmacs/packages/unsupported/scop/STATUS
Index: STATUS
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/unsupported/scop/STATUS,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -p -r1.57 -r1.58
--- STATUS 2006/03/25 09:55:10 1.57
+++ STATUS 2006/04/16 14:19:42 1.58
@@ -17,5 +17,5 @@ generic-modes: generic.el and generic-x.
- Compiles, seems to work, auto-mode-alist and autoloads may need spanking.
vc: vc*.el and a few other related files from GNU Emacs
-- Up to date with GNU Emacs CVS HEAD as of 2006-02-11.
+- Up to date with GNU Emacs CVS HEAD as of 2006-04-16.
- Compiles, something even works.
1.42 +7 -0 XEmacs/packages/unsupported/scop/vc/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/unsupported/scop/vc/ChangeLog,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -p -r1.41 -r1.42
--- ChangeLog 2006/02/10 23:25:42 1.41
+++ ChangeLog 2006/04/16 14:19:44 1.42
@@ -1,3 +1,10 @@
+2006-04-16 Ville Skyttä <scop(a)xemacs.org>
+
+ * vc.el: Sync with upstream.
+
+ * vc-xemacs.el (line-number-at-pos): Sync compat implementation
+ with XEmacs 21.5.
+
2006-02-11 Ville Skyttä <scop(a)xemacs.org>
* *.el: Sync with upstream.
1.6 +3 -3 XEmacs/packages/unsupported/scop/vc/vc-xemacs.el
Index: vc-xemacs.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/unsupported/scop/vc/vc-xemacs.el,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- vc-xemacs.el 2005/12/05 11:26:29 1.5
+++ vc-xemacs.el 2006/04/16 14:19:45 1.6
@@ -46,14 +46,14 @@
nil)
file)))
-;; These two are present in XEmacs >= 21.5
+;; These three are present in XEmacs >= 21.5
(unless (fboundp 'line-end-position)
(defalias 'line-end-position 'point-at-eol))
(unless (fboundp 'line-beginning-position)
(defalias 'line-beginning-position 'point-at-bol))
-
(unless (fboundp 'line-number-at-pos)
- (defalias 'line-number-at-pos 'line-number))
+ (defun line-number-at-pos (&optional pos)
+ (line-number pos t)))
(unless (fboundp 'subst-char-in-string)
(defun subst-char-in-string (fromchar tochar string &optional inplace)
1.24 +90 -43 XEmacs/packages/unsupported/scop/vc/vc.el
Index: vc.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/unsupported/scop/vc/vc.el,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -p -r1.23 -r1.24
--- vc.el 2006/02/10 23:25:43 1.23
+++ vc.el 2006/04/16 14:19:45 1.24
@@ -588,9 +588,9 @@ See `run-hooks'."
:group 'vc
:version "21.1")
-(defcustom vc-annotate-display-mode nil
+(defcustom vc-annotate-display-mode 'fullscale
"Which mode to color the output of \\[vc-annotate] with by default."
-:type '(choice (const :tag "Default" nil)
+:type '(choice (const :tag "By Color Map Range" nil)
(const :tag "Scale to Oldest" scale)
(const :tag "Scale Oldest->Newest" fullscale)
(number :tag "Specify Fractional Number of Days"
@@ -621,30 +621,66 @@ version control backend imposes itself."
;; Annotate customization
(defcustom vc-annotate-color-map
- '(( 20. . "#FFCC00")
- ( 40. . "#FF6666")
- ( 60. . "#FF6600")
- ( 80. . "#FF3300")
- (100. . "#FF00FF")
- (120. . "#FF0000")
- (140. . "#CCCC00")
- (160. . "#CC00CC")
- (180. . "#BC8F8F")
- (200. . "#99CC00")
- (220. . "#999900")
- (240. . "#7AC5CD")
- (260. . "#66CC00")
- (280. . "#33CC33")
- (300. . "#00CCFF")
- (320. . "#00CC99")
- (340. . "#0099FF"))
+ ;; XEmacs change: disabled, at least tty-display-color-p and tty-color-alist
+ ;; don't exist in XEmacs
+ (if (and nil (tty-display-color-p) (<= (display-color-cells) 8))
+ ;; A custom sorted TTY colormap
+ (let* ((colors
+ (sort
+ (delq nil
+ (mapcar (lambda (x)
+ (if (not (or
+ (string-equal (car x) "white")
+ (string-equal (car x) "black") ))
+ (car x)))
+ (tty-color-alist)))
+ (lambda (a b)
+ (cond
+ ((or (string-equal a "red") (string-equal b "blue")) t)
+ ((or (string-equal b "red") (string-equal a "blue")) nil)
+ ((string-equal a "yellow") t)
+ ((string-equal b "yellow") nil)
+ ((string-equal a "cyan") t)
+ ((string-equal b "cyan") nil)
+ ((string-equal a "green") t)
+ ((string-equal b "green") nil)
+ ((string-equal a "magenta") t)
+ ((string-equal b "magenta") nil)
+ (t (string< a b))))))
+ (date 20.)
+ (delta (/ (- 360. date) (1- (length colors)))))
+ (mapcar (lambda (x)
+ (prog1
+ (cons date x)
+ (setq date (+ date delta)))) colors))
+ ;; Normal colormap: hue stepped from 0-240deg, value=1., saturation=0.75
+ '(( 20. . "#FF3F3F")
+ ( 40. . "#FF6C3F")
+ ( 60. . "#FF993F")
+ ( 80. . "#FFC63F")
+ (100. . "#FFF33F")
+ (120. . "#DDFF3F")
+ (140. . "#B0FF3F")
+ (160. . "#83FF3F")
+ (180. . "#56FF3F")
+ (200. . "#3FFF56")
+ (220. . "#3FFF83")
+ (240. . "#3FFFB0")
+ (260. . "#3FFFDD")
+ (280. . "#3FF3FF")
+ (300. . "#3FC6FF")
+ (320. . "#3F99FF")
+ (340. . "#3F6CFF")
+ (360. . "#3F3FFF")))
"Association list of age versus color, for \\[vc-annotate].
-Ages are given in units of fractional days. Default is eighteen steps
-using a twenty day increment."
+Ages are given in units of fractional days. Default is eighteen
+steps using a twenty day increment, from red to blue. For TTY
+displays with 8 or fewer colors, the default is red to blue with
+all other colors between (excluding black and white)."
:type 'alist
:group 'vc)
-(defcustom vc-annotate-very-old-color "#0046FF"
+(defcustom vc-annotate-very-old-color "#3F3FFF"
"Color for lines older than the current color range in \\[vc-annotate]]."
:type 'string
:group 'vc)
@@ -856,7 +892,7 @@ However, before executing BODY, find FIL
(if vc-dired-mode
(set-buffer (find-file-noselect (dired-get-filename)))
(while vc-parent-buffer
- (pop-to-buffer vc-parent-buffer))
+ (set-buffer vc-parent-buffer))
(if (not buffer-file-name)
(error "Buffer %s is not associated with a file" (buffer-name))
(if (not (vc-backend buffer-file-name))
@@ -2987,7 +3023,7 @@ cover the range from the oldest annotati
(easy-menu-define vc-annotate-mode-menu vc-annotate-mode-map
"VC Annotate Display Menu"
`("VC-Annotate"
- ["Default" (unless (null vc-annotate-display-mode)
+ ["By Color Map Range" (unless (null vc-annotate-display-mode)
(setq vc-annotate-display-mode nil)
(vc-annotate-display-select))
:style toggle :selected (null vc-annotate-display-mode)]
@@ -3029,11 +3065,7 @@ BUFFER. `vc-annotate-display-mode' spec
use; you may override this using the second optional arg MODE."
(interactive)
(if mode (setq vc-annotate-display-mode mode))
- (when buffer
- (set-buffer buffer)
- (display-buffer buffer))
- (if (not vc-annotate-parent-rev)
- (vc-annotate-mode))
+ (pop-to-buffer (or buffer (current-buffer)))
(cond ((null vc-annotate-display-mode)
;; The ratio is global, thus relative to the global color-map.
(kill-local-variable 'vc-annotate-color-map)
@@ -3093,7 +3125,11 @@ colors. `vc-annotate-background' specifi
(vc-ensure-vc-buffer)
(setq vc-annotate-display-mode display-mode) ;Not sure why. --Stef
(let* ((temp-buffer-name (format "*Annotate %s (rev %s)*" (buffer-name)
rev))
- (temp-buffer-show-function 'vc-annotate-display-select))
+ (temp-buffer-show-function 'vc-annotate-display-select)
+ ;; If BUF is specified, we presume the caller maintains current line,
+ ;; so we don't need to do it here. This implementation may give
+ ;; strange results occasionally in the case of REV != WORKFILE-REV.
+ (current-line (unless buf (line-number-at-pos))))
(message "Annotating...")
;; If BUF is specified it tells in which buffer we should put the
;; annotations. This is used when switching annotations to another
@@ -3103,15 +3139,21 @@ colors. `vc-annotate-background' specifi
;; In case it had to be uniquified.
(setq temp-buffer-name (buffer-name))))
(with-output-to-temp-buffer temp-buffer-name
- (vc-call annotate-command file (get-buffer temp-buffer-name) rev))
- (with-current-buffer temp-buffer-name
- (set (make-local-variable 'vc-annotate-backend) (vc-backend file))
- (set (make-local-variable 'vc-annotate-parent-file) file)
- (set (make-local-variable 'vc-annotate-parent-rev) rev)
- (set (make-local-variable 'vc-annotate-parent-display-mode)
- display-mode))
-
- (message "Annotating... done")))
+ (vc-call annotate-command file (get-buffer temp-buffer-name) rev)
+ ;; we must setup the mode first, and then set our local
+ ;; variables before the show-function is called at the exit of
+ ;; with-output-to-temp-buffer
+ (with-current-buffer temp-buffer-name
+ (if (not (equal major-mode 'vc-annotate-mode))
+ (vc-annotate-mode))
+ (set (make-local-variable 'vc-annotate-backend) (vc-backend file))
+ (set (make-local-variable 'vc-annotate-parent-file) file)
+ (set (make-local-variable 'vc-annotate-parent-rev) rev)
+ (set (make-local-variable 'vc-annotate-parent-display-mode)
+ display-mode)))
+ (when current-line
+ (goto-line current-line temp-buffer-name))
+ (message "Annotating... done")))
(defun vc-annotate-prev-version (prefix)
"Visit the annotation of the version previous to this one.
@@ -3207,7 +3249,8 @@ string, then it describes a revision num
revision."
(if (not (equal major-mode 'vc-annotate-mode))
(message "Cannot be invoked outside of a vc annotate buffer")
- (let* ((oldline (line-number-at-pos))
+ (let* ((buf (current-buffer))
+ (oldline (line-number-at-pos))
(revspeccopy revspec)
(newrev nil))
(cond
@@ -3234,11 +3277,11 @@ revision."
(when newrev
(vc-annotate vc-annotate-parent-file newrev
vc-annotate-parent-display-mode
- (current-buffer))
+ buf)
(goto-line (min oldline (progn (goto-char (point-max))
;; XEmacs: previous-line needs 1 arg
(previous-line 1)
- (line-number-at-pos))))))))
+ (line-number-at-pos))) buf)))))
(defun vc-annotate-compcar (threshold a-list)
"Test successive cons cells of A-LIST against THRESHOLD.
@@ -3292,7 +3335,11 @@ The annotations are relative to the curr
(let* ((color (or (vc-annotate-compcar difference vc-annotate-color-map)
(cons nil vc-annotate-very-old-color)))
;; substring from index 1 to remove any leading `#' in the name
- (face-name (concat "vc-annotate-face-" (substring (cdr color) 1)))
+ (face-name (concat "vc-annotate-face-"
+ (if (string-equal
+ (substring (cdr color) 0 1) "#")
+ (substring (cdr color) 1)
+ (cdr color))))
;; Make the face if not done.
(face (or (intern-soft face-name)
(let ((tmp-face (make-face (intern face-name))))