aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Spiegel2002-10-14 15:13:59 +0000
committerAndré Spiegel2002-10-14 15:13:59 +0000
commit685e7bcac04706f9199a9861685685034fdfebb2 (patch)
tree4934404add499402deb782a72c1a1c151d6e7478
parent41a48e45f57cfc1a27401c2b4442e5ac2653a54a (diff)
downloademacs-685e7bcac04706f9199a9861685685034fdfebb2.tar.gz
emacs-685e7bcac04706f9199a9861685685034fdfebb2.zip
(vc-dired-reformat-line): Simplified. Handles text properties
correctly now.
-rw-r--r--lisp/vc.el34
1 files changed, 8 insertions, 26 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index f900fc05d26..3b44db25a7b 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -6,7 +6,7 @@
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.342 2002/10/08 15:31:43 monnier Exp $ 9;; $Id: vc.el,v 1.343 2002/10/11 09:36:00 spiegel Exp $
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12 12
@@ -2176,31 +2176,13 @@ There is a special command, `*l', to mark all files currently locked."
2176Replace various columns with version control information, VC-INFO. 2176Replace various columns with version control information, VC-INFO.
2177This code, like dired, assumes UNIX -l format." 2177This code, like dired, assumes UNIX -l format."
2178 (beginning-of-line) 2178 (beginning-of-line)
2179 (let ((pos (point)) limit) 2179 (when (re-search-forward
2180 (end-of-line) 2180 ;; Match link count, owner, group, size. Group may be missing,
2181 (setq limit (point)) 2181 ;; and only the size is present in OS/2 -l format.
2182 (goto-char pos) 2182 "^..[drwxlts-]+ \\( *[0-9]+\\( [^ ]+ +\\([^ ]+ +\\)?[0-9]+\\)?\\) "
2183 (when 2183 (line-end-position) t)
2184 (or 2184 (replace-match (substring (concat vc-info " ") 0 10)
2185 (re-search-forward ;; owner and group 2185 t t nil 1)))
2186 "^\\(..[drwxlts-]+ \\) *[0-9]+ [^ ]+ +[^ ]+ +[0-9]+\\( .*\\)"
2187 limit t)
2188 (re-search-forward ;; only owner displayed
2189 "^\\(..[drwxlts-]+ \\) *[0-9]+ [^ ]+ +[0-9]+\\( .*\\)"
2190 limit t)
2191 (re-search-forward ;; OS/2 -l format, no links, owner, group
2192 "^\\(..[drwxlts-]+ \\) *[0-9]+\\( .*\\)"
2193 limit t))
2194 (let ((replacement (concat (match-string 1)
2195 (substring (concat vc-info " ")
2196 0 10)
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)))))
2204 2186
2205(defun vc-dired-hook () 2187(defun vc-dired-hook ()
2206 "Reformat the listing according to version control. 2188 "Reformat the listing according to version control.