summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorAndré Spiegel <spiegel@gnu.org>2002-10-11 09:36:00 +0000
committerAndré Spiegel <spiegel@gnu.org>2002-10-11 09:36:00 +0000
commitb9a35ba58aa485460e2afd2a52ad86c3efb34065 (patch)
tree7a6c2c760e4f9a4741e6d8f8524f0cb96665e3a7 /lisp
parent6c150da9f5f6353dc8cc92df81989b7d5325dcd4 (diff)
downloademacs-b9a35ba58aa485460e2afd2a52ad86c3efb34065.tar.gz
(vc-dired-reformat-line): As a temporary fix, remove all text
properties from the reformatted line.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/vc.el22
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index da128e5320e..f900fc05d26 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -6,7 +6,7 @@
;; Maintainer: Andre Spiegel <spiegel@gnu.org>
;; Keywords: tools
-;; $Id: vc.el,v 1.341 2002/10/07 16:50:43 monnier Exp $
+;; $Id: vc.el,v 1.342 2002/10/08 15:31:43 monnier Exp $
;; This file is part of GNU Emacs.
@@ -2171,12 +2171,12 @@ There is a special command, `*l', to mark all files currently locked."
((eq state 'needs-patch) "(patch)")
((eq state 'unlocked-changes) "(stale)"))))
-(defun vc-dired-reformat-line (x)
+(defun vc-dired-reformat-line (vc-info)
"Reformat a directory-listing line.
-Replace various columns with version control information.
+Replace various columns with version control information, VC-INFO.
This code, like dired, assumes UNIX -l format."
(beginning-of-line)
- (let ((pos (point)) limit perm date-and-file)
+ (let ((pos (point)) limit)
(end-of-line)
(setq limit (point))
(goto-char pos)
@@ -2191,10 +2191,16 @@ This code, like dired, assumes UNIX -l format."
(re-search-forward ;; OS/2 -l format, no links, owner, group
"^\\(..[drwxlts-]+ \\) *[0-9]+\\( .*\\)"
limit t))
- (setq perm (match-string 1)
- date-and-file (match-string 2))
- (setq x (substring (concat x " ") 0 10))
- (replace-match (concat perm x date-and-file)))))
+ (let ((replacement (concat (match-string 1)
+ (substring (concat vc-info " ")
+ 0 10)
+ (match-string 2))))
+ ;; FIXME: Clear the text properties to make it work, because with
+ ;; a straightforward replacement, they will get messed up.
+ ;; Eventually, the text properties should be transformed correctly,
+ ;; not removed.
+ (set-text-properties 0 (length replacement) nil replacement)
+ (replace-match replacement)))))
(defun vc-dired-hook ()
"Reformat the listing according to version control.