diff options
| -rw-r--r-- | lisp/vc-hooks.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index ceae9bfe715..092084f6906 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el | |||
| @@ -157,7 +157,8 @@ visiting FILE." | |||
| 157 | ;; If FILE is registered but not locked, return " REV" if there is a head | 157 | ;; If FILE is registered but not locked, return " REV" if there is a head |
| 158 | ;; revision and " @@" otherwise. | 158 | ;; revision and " @@" otherwise. |
| 159 | ;; If FILE is locked then return all locks in a string of the | 159 | ;; If FILE is locked then return all locks in a string of the |
| 160 | ;; form " LOCKER1:REV1 LOCKER2:REV2 ...". | 160 | ;; form " LOCKER1:REV1 LOCKER2:REV2 ...", where "LOCKERi:" is empty if you |
| 161 | ;; are the locker, and otherwise is the name of the locker followed by ":". | ||
| 161 | 162 | ||
| 162 | ;; Algorithm: | 163 | ;; Algorithm: |
| 163 | 164 | ||
| @@ -205,12 +206,16 @@ visiting FILE." | |||
| 205 | (setq found (re-search-forward "^locks\\([^;]*\\);" nil t))) | 206 | (setq found (re-search-forward "^locks\\([^;]*\\);" nil t))) |
| 206 | 207 | ||
| 207 | (if found | 208 | (if found |
| 208 | ;; Clean control characters from text. | 209 | ;; Clean control characters and self-locks from text. |
| 209 | (let* ((locks | 210 | (let* ((lock-pattern |
| 211 | (concat "[ \b\t\n\v\f\r]+\\(" | ||
| 212 | (regexp-quote (user-login-name)) | ||
| 213 | ":\\|\\)")) | ||
| 214 | (locks | ||
| 210 | (save-restriction | 215 | (save-restriction |
| 211 | (narrow-to-region (match-beginning 1) (match-end 1)) | 216 | (narrow-to-region (match-beginning 1) (match-end 1)) |
| 212 | (goto-char (point-min)) | 217 | (goto-char (point-min)) |
| 213 | (while (re-search-forward "[ \b\t\n\v\f\r]+" nil t) | 218 | (while (re-search-forward lock-pattern nil t) |
| 214 | (replace-match " " t t)) | 219 | (replace-match " " t t)) |
| 215 | (buffer-string))) | 220 | (buffer-string))) |
| 216 | (status | 221 | (status |