comparison lisp/vc.el @ 47842:f7c7cc74fde2

(vc-dired-reformat-line): As a temporary fix, remove all text properties from the reformatted line.
author André Spiegel <spiegel@gnu.org>
date Fri, 11 Oct 2002 09:36:00 +0000
parents cf312195338d
children 2a95bf2d8eaf
comparison
equal deleted inserted replaced
47841:923a9008aba3 47842:f7c7cc74fde2
4 4
5 ;; Author: FSF (see below for full credits) 5 ;; Author: FSF (see below for full credits)
6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> 6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
7 ;; Keywords: tools 7 ;; Keywords: tools
8 8
9 ;; $Id: vc.el,v 1.341 2002/10/07 16:50:43 monnier Exp $ 9 ;; $Id: vc.el,v 1.342 2002/10/08 15:31:43 monnier Exp $
10 10
11 ;; This file is part of GNU Emacs. 11 ;; This file is part of GNU Emacs.
12 12
13 ;; GNU Emacs is free software; you can redistribute it and/or modify 13 ;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by 14 ;; it under the terms of the GNU General Public License as published by
2169 ((eq state 'edited) (concat "(" (vc-user-login-name) ")")) 2169 ((eq state 'edited) (concat "(" (vc-user-login-name) ")"))
2170 ((eq state 'needs-merge) "(merge)") 2170 ((eq state 'needs-merge) "(merge)")
2171 ((eq state 'needs-patch) "(patch)") 2171 ((eq state 'needs-patch) "(patch)")
2172 ((eq state 'unlocked-changes) "(stale)")))) 2172 ((eq state 'unlocked-changes) "(stale)"))))
2173 2173
2174 (defun vc-dired-reformat-line (x) 2174 (defun vc-dired-reformat-line (vc-info)
2175 "Reformat a directory-listing line. 2175 "Reformat a directory-listing line.
2176 Replace various columns with version control information. 2176 Replace various columns with version control information, VC-INFO.
2177 This code, like dired, assumes UNIX -l format." 2177 This code, like dired, assumes UNIX -l format."
2178 (beginning-of-line) 2178 (beginning-of-line)
2179 (let ((pos (point)) limit perm date-and-file) 2179 (let ((pos (point)) limit)
2180 (end-of-line) 2180 (end-of-line)
2181 (setq limit (point)) 2181 (setq limit (point))
2182 (goto-char pos) 2182 (goto-char pos)
2183 (when 2183 (when
2184 (or 2184 (or
2189 "^\\(..[drwxlts-]+ \\) *[0-9]+ [^ ]+ +[0-9]+\\( .*\\)" 2189 "^\\(..[drwxlts-]+ \\) *[0-9]+ [^ ]+ +[0-9]+\\( .*\\)"
2190 limit t) 2190 limit t)
2191 (re-search-forward ;; OS/2 -l format, no links, owner, group 2191 (re-search-forward ;; OS/2 -l format, no links, owner, group
2192 "^\\(..[drwxlts-]+ \\) *[0-9]+\\( .*\\)" 2192 "^\\(..[drwxlts-]+ \\) *[0-9]+\\( .*\\)"
2193 limit t)) 2193 limit t))
2194 (setq perm (match-string 1) 2194 (let ((replacement (concat (match-string 1)
2195 date-and-file (match-string 2)) 2195 (substring (concat vc-info " ")
2196 (setq x (substring (concat x " ") 0 10)) 2196 0 10)
2197 (replace-match (concat perm x date-and-file))))) 2197 (match-string 2))))
2198 ;; FIXME: Clear the text properties to make it work, because with
2199 ;; a straightforward replacement, they will get messed up.
2200 ;; Eventually, the text properties should be transformed correctly,
2201 ;; not removed.
2202 (set-text-properties 0 (length replacement) nil replacement)
2203 (replace-match replacement)))))
2198 2204
2199 (defun vc-dired-hook () 2205 (defun vc-dired-hook ()
2200 "Reformat the listing according to version control. 2206 "Reformat the listing according to version control.
2201 Called by dired after any portion of a vc-dired buffer has been read in." 2207 Called by dired after any portion of a vc-dired buffer has been read in."
2202 (message "Getting version information... ") 2208 (message "Getting version information... ")