From f3423ce275dc739042c77432f6492826356fcab6 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 28 Jan 2021 17:56:51 -0800 Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=98vc-p4-dir-extra-headers=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function shows extra information in the header of VC dir buffers. --- CHANGELOG.org | 4 ++++ vc-p4.el | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/CHANGELOG.org b/CHANGELOG.org index 7684815..33659b5 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -28,6 +28,10 @@ This interactive command lets you log in to Perforce when your session has expir VC expects the status to be reported as ~needs-update~, not ~needs-patch~. +** ADDED Extra headers in ~vc-dir~ + +Specifically the Server, root directory, client, and stream are shown in the headers. + * 0.2.1 -- 2020-05-27 ** FIXED Recognition of sub-directories of Perforce repos diff --git a/vc-p4.el b/vc-p4.el index 316080c..8ee0a59 100644 --- a/vc-p4.el +++ b/vc-p4.el @@ -1034,4 +1034,27 @@ The difference to vc-do-command is that this function always invokes `p4'." "Check if there is an active session for Perforce." (p4-lowlevel-login :status t)) +(defun vc-p4-dir-extra-headers (dir) + (let ((extra-info (p4-lowlevel-info :client vc-p4-client))) + (concat + (propertize "Client :" 'face 'font-lock-type-face) + " " + (propertize (alist-get "Client name" extra-info nil nil #'string=) + 'face 'font-lock-variable-name-face) + "\n" + (propertize "Stream :" 'face 'font-lock-type-face) + " " + (propertize (alist-get "Client stream" extra-info nil nil #'string=) + 'face 'font-lock-variable-name-face) + "\n" + (propertize "Root :" 'face 'font-lock-type-face) + " " + (propertize (alist-get "Client root" extra-info nil nil #'string=) + 'face 'font-lock-variable-name-face) + "\n" + (propertize "Server :" 'face 'font-lock-type-face) + " " + (propertize (alist-get "Server address" extra-info nil nil #'string=) + 'face 'font-lock-variable-name-face)))) + (provide 'vc-p4)