From: André Spiegel Date: Mon, 14 Oct 2002 15:13:59 +0000 (+0000) Subject: (vc-dired-reformat-line): Simplified. Handles text properties X-Git-Tag: ttn-vms-21-2-B4~12832 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=685e7bcac04706f9199a9861685685034fdfebb2;p=emacs.git (vc-dired-reformat-line): Simplified. Handles text properties correctly now. --- 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 @@ ;; Maintainer: Andre Spiegel ;; Keywords: tools -;; $Id: vc.el,v 1.342 2002/10/08 15:31:43 monnier Exp $ +;; $Id: vc.el,v 1.343 2002/10/11 09:36:00 spiegel Exp $ ;; This file is part of GNU Emacs. @@ -2176,31 +2176,13 @@ There is a special command, `*l', to mark all files currently locked." Replace various columns with version control information, VC-INFO. This code, like dired, assumes UNIX -l format." (beginning-of-line) - (let ((pos (point)) limit) - (end-of-line) - (setq limit (point)) - (goto-char pos) - (when - (or - (re-search-forward ;; owner and group - "^\\(..[drwxlts-]+ \\) *[0-9]+ [^ ]+ +[^ ]+ +[0-9]+\\( .*\\)" - limit t) - (re-search-forward ;; only owner displayed - "^\\(..[drwxlts-]+ \\) *[0-9]+ [^ ]+ +[0-9]+\\( .*\\)" - limit t) - (re-search-forward ;; OS/2 -l format, no links, owner, group - "^\\(..[drwxlts-]+ \\) *[0-9]+\\( .*\\)" - limit t)) - (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))))) + (when (re-search-forward + ;; Match link count, owner, group, size. Group may be missing, + ;; and only the size is present in OS/2 -l format. + "^..[drwxlts-]+ \\( *[0-9]+\\( [^ ]+ +\\([^ ]+ +\\)?[0-9]+\\)?\\) " + (line-end-position) t) + (replace-match (substring (concat vc-info " ") 0 10) + t t nil 1))) (defun vc-dired-hook () "Reformat the listing according to version control.