# ------------------------------------------------------------------------------
# button.c | 15 +++++++++++++--
# charproc.c | 28 +++++++++++++++++++++-------
# ptyx.h | 1 +
# resize.c | 5 +++++
# version.h | 4 ++--
# xterm.log.html | 19 +++++++++++++++++++
# xterm.man | 13 +++++++++++++
# 7 files changed, 74 insertions, 11 deletions
# ------------------------------------------------------------------------------
Index: button.c
--- xterm-104+/button.c Sat May 29 13:01:58 1999
+++ xterm-105/button.c Thu Jun 3 20:32:15 1999
@@ -1274,7 +1274,7 @@
}
*lp = '\0'; /* make sure we have end marked */
- TRACE(("Salted TEXT:%.*s\n", lp - line, line))
+ TRACE(("Salted TEXT:%.*s\n", (char *)lp - line, line))
screen->selection_length = ((char *)lp - line);
_OwnSelection(term, params, num_params);
}
@@ -1548,6 +1548,7 @@
{
int i = 0;
unsigned c;
+ Char *result = lp;
i = Length(screen, row, scol, ecol);
ecol = scol + i;
@@ -1576,8 +1577,18 @@
else
#endif
*lp++ = c;
+ if (c != ' ')
+ result = lp;
}
- return(lp);
+
+ /*
+ * If requested, trim trailing blanks from selected lines. Do not do this
+ * if the line is wrapped.
+ */
+ if (!*eol || !screen->trim_selection)
+ result = lp;
+
+ return(result);
}
static int
Index: charproc.c
--- xterm-104+/charproc.c Sat May 29 12:51:24 1999
+++ xterm-105/charproc.c Sat Jun 5 22:17:12 1999
@@ -247,6 +247,7 @@
#define XtNtekSmall "tekSmall"
#define XtNtekStartup "tekStartup"
#define XtNtiteInhibit "titeInhibit"
+#define XtNtrimSelection "trimSelection"
#define XtNunderLine "underLine"
#define XtNutf8 "utf8"
#define XtNvisualBell "visualBell"
@@ -313,6 +314,7 @@
#define XtCTekSmall "TekSmall"
#define XtCTekStartup "TekStartup"
#define XtCTiteInhibit "TiteInhibit"
+#define XtCTrimSelection "TrimSelection"
#define XtCUnderLine "UnderLine"
#define XtCUtf8 "Utf8"
#define XtCVisualBell "VisualBell"
@@ -547,6 +549,9 @@
{XtNhighlightSelection,XtCHighlightSelection,XtRBoolean,
sizeof(Boolean),XtOffsetOf(XtermWidgetRec, screen.highlight_selection),
XtRBoolean, (XtPointer) &defaultFALSE},
+{XtNtrimSelection,XtCTrimSelection,XtRBoolean,
+ sizeof(Boolean),XtOffsetOf(XtermWidgetRec, screen.trim_selection),
+ XtRBoolean, (XtPointer) &defaultFALSE},
{XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, core.background_pixel),
XtRString, "XtDefaultBackground"},
@@ -1220,7 +1225,7 @@
string_used = 0;
}
- TRACE(("parse %d -> %d\n", c, nextstate))
+ TRACE(("parse %04X -> %d\n", c, nextstate))
switch (nextstate) {
case CASE_PRINT:
@@ -3974,6 +3979,7 @@
wnew->screen.cutNewline = request->screen.cutNewline;
wnew->screen.cutToBeginningOfLine = request->screen.cutToBeginningOfLine;
wnew->screen.highlight_selection = request->screen.highlight_selection;
+ wnew->screen.trim_selection = request->screen.trim_selection;
wnew->screen.always_highlight = request->screen.always_highlight;
wnew->screen.pointer_cursor = request->screen.pointer_cursor;
@@ -4592,9 +4598,12 @@
chi = SCRN_BUF_WIDEC(screen, screen->cursor_row)[screen->cursor_col];
})
- if (clo == 0) {
+ if (clo == 0
+#if OPT_WIDE_CHARS
+ && chi == 0
+#endif
+ ) {
clo = ' ';
- if_OPT_WIDE_CHARS(screen,{chi = 0;})
}
/*
@@ -4675,7 +4684,8 @@
}
}
- TRACE(("%s @%d, ShowCursor calling drawXtermText\n", __FILE__, __LINE__))
+ TRACE(("%s @%d, ShowCursor calling drawXtermText cur(%d,%d)\n", __FILE__, __LINE__,
+ screen->cur_row, screen->cur_col))
drawXtermText(screen, flags, currentGC,
x = CurCursorX(screen, screen->cur_row, screen->cur_col),
@@ -4745,12 +4755,16 @@
currentGC = updatedXtermGC(screen, flags, fg_bg, in_selection);
- if (clo == 0) {
+ if (clo == 0
+#if OPT_WIDE_CHARS
+ && chi == 0
+#endif
+ ) {
clo = ' ';
- if_OPT_WIDE_CHARS(screen,{chi = 0;})
}
- TRACE(("%s @%d, HideCursor calling drawXtermText\n", __FILE__, __LINE__))
+ TRACE(("%s @%d, HideCursor calling drawXtermText cur(%d,%d)\n", __FILE__, __LINE__,
+ screen->cursor_row, screen->cursor_col))
drawXtermText(screen, flags, currentGC,
CurCursorX(screen, screen->cursor_row, screen->cursor_col),
CursorY(screen, screen->cursor_row),
Index: ptyx.h
--- xterm-104+/ptyx.h Sun May 16 15:55:44 1999
+++ xterm-105/ptyx.h Thu Jun 3 20:20:42 1999
@@ -920,6 +920,7 @@
Boolean cutNewline; /* whether or not line cut has \n */
Boolean cutToBeginningOfLine; /* line cuts to BOL? */
Boolean highlight_selection; /* controls appearance of selection */
+ Boolean trim_selection; /* controls trimming of selection */
char *selection_data; /* the current selection */
int selection_size; /* size of allocated buffer */
int selection_length; /* number of significant bytes */
Index: resize.c
--- xterm-104+/resize.c Sun May 16 15:55:44 1999
+++ xterm-105/resize.c Thu Jun 3 19:49:05 1999
@@ -79,6 +79,11 @@
#define USE_SYSV_UTMP
#endif
+#ifdef __OpenBSD__
+#define USE_TERMINFO
+#include <term.h>
+#endif
+
#ifndef USE_TERMINFO
#if defined(SCO) || defined(linux)
#define USE_TERMINFO
Index: version.h
--- xterm-104+/version.h Sun May 30 07:45:53 1999
+++ xterm-105/version.h Sat Jun 5 22:29:44 1999
@@ -6,5 +6,5 @@
* XFree86 to which this version of xterm has been built. The number in
* parentheses is my patch number (T.Dickey).
*/
-#define XTERM_PATCH 104
-#define XFREE86_VERSION "XFree86 3.9Pn"
+#define XTERM_PATCH 105
+#define XFREE86_VERSION "XFree86 3.9Pp"
Index: xterm.log.html
--- xterm-104+/xterm.log.html Sun May 30 08:01:20 1999
+++ xterm-105/xterm.log.html Sat Jun 5 22:30:56 1999
@@ -41,6 +41,7 @@
xc/programs/Xserver/hw/xfree86).
<UL>
+<LI><A HREF="#xterm_105">Patch #105 - 1999/6/5 - XFree86 3.9Pp</A>
<LI><A HREF="#xterm_104">Patch #104 - 1999/5/30 - XFree86 3.9Pn</A>
<LI><A HREF="#xterm_103">Patch #103 - 1999/5/14 - XFree86 3.9Pm</A>
<LI><A HREF="#xterm_102">Patch #102 - 1999/5/12 - XFree86 3.9Pm</A>
@@ -147,6 +148,24 @@
<LI><A HREF="#xterm_02">Patch #2 - 1996/1/7</A>
<LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
</UL>
+
+<H1><A NAME="xterm_105">Patch #105 - 1999/6/5 - XFree86 3.9Pp</A></H1>
+<ul>
+ <li>implement new resource <em>trimSelection</em>, which allows xterm
+ to trim trailing blanks from selected lines. This does not affect
+ the highlighting. (reported by several people using <em>mutt</em>,
+ including
+ Hans Morten Kind <edphk@uib.no>,
+ Jeremy <jeremy@exit109.com>
+ and (Michael Fuller <msf@mds.rmit.edu.au>).
+
+ <li>add patch by Matthieu Herrb to include term.h in resize for OpenBSD.
+
+ <li>correct logic for UTF-8 in functions that hide and show the cursor;
+ it was displaying a space whenever the low byte of the character at
+ the cursor position was zero (reported by Thomas Wolff
+ <Thomas.Wolff@icn.siemens.de>).
+</ul>
<H1><A NAME="xterm_104">Patch #104 - 1999/5/30 - XFree86 3.9Pn</A></H1>
This is a resync patch against XFree86 3.9Pn, reflecting changes which were
Index: xterm.man
--- xterm-104+/xterm.man Sun May 16 15:55:44 1999
+++ xterm-105/xterm.man Thu Jun 3 20:49:55 1999
@@ -1261,6 +1261,19 @@
Specifies the key and button bindings for menus, selections, ``programmed
strings,'' etc. See \fBACTIONS\fP below.
.TP 8
+.B "trimSelection (\fPclass\fB TrimSelection)"
+If you set \fBhighlightSelection\fP,
+you can see the text which is selected, including any trailing spaces.
+Clearing the screen (or a line) resets it to a state containing no spaces.
+Some lines may contain trailing spaces when an application writes them to
+the screen.
+However, you may not wish to paste lines with trailing spaces.
+If this resource is true, \fIxterm\fP will trim trailing spaces from
+text which is selected.
+It does not affect spaces which result in a wrapped line, nor will it
+trim the trailing newline from your selection.
+The default is ``false.''
+.TP 8
.B "underLine (\fPclass\fB UnderLine)"
This specifies whether or not text with the underline attribute should be
underlined. It may be desirable to disable underlining when color is being