4 source/windowTitle.c | 23 ++++++++++++++++++++++-
5 2 files changed, 24 insertions(+), 2 deletions(-)
7 diff --quilt old/source/windowTitle.c new/source/windowTitle.c
8 --- old/source/windowTitle.c
9 +++ new/source/windowTitle.c
10 @@ -244,11 +244,12 @@ static void compressWindowTitle(char *ti
12 ** %[n]d : directory, with one optional digit specifying the max number
13 ** of trailing directory components to display. Skipped components are
14 ** replaced by an ellipsis (...).
17 +** %[n]h : host name, with one optional digit specifying the max number
18 + of leading hosts components to dispaly.
22 ** if the ClearCase view tag and server name are identical, only the first one
23 ** specified in the formatting string will be displayed.
24 @@ -347,10 +348,30 @@ char *FormatWindowTitle(const char* file
25 if (trailingPath > path) {
26 titlePtr = safeStrCpy(titlePtr, titleEnd, "...");
28 titlePtr = safeStrCpy(titlePtr, titleEnd, trailingPath);
30 + } else if (*titleFormat == 'h') {
31 + int comps = c - '0';
32 + char* hostname = strdup(GetNameOfHost());
34 + hostNamePresent = True;
35 + titleFormat++; /* delete the argument */
38 + if ((n = strchr(n, '.'))) {
41 + while (*n && *n == '.')
48 + titlePtr = safeStrCpy(titlePtr, titleEnd, hostname);
53 case 'f': /* file name */
54 fileNamePresent = True;
55 diff --quilt old/doc/help.etx new/doc/help.etx
58 @@ -1076,11 +1076,12 @@ Tabs/Emulated Tabs
59 .. %[n]d directory, with one optional numeric digit n
60 .. specifying the maximum number of trailing directory
61 .. components to display. Skipped components are
62 .. replaced by an ellipsis (...).
63 .. %f file name, without the path name
65 +.. %[n]h host name, with one optional digit specifying the max number
66 +.. of leading hosts components to dispaly.
67 .. %s NEdit server name (server mode only)
68 .. %[*]S file status, either verbose (%S) or brief (%*S).
69 .. In verbose mode the file status is spelled out:
70 .. read-only, locked, and modified. In brief mode,
71 .. abbreviations and an asterisk are used for the