bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24451: grep -Tn misbehaves under Emacs shell


From: Paul Eggert
Subject: bug#24451: grep -Tn misbehaves under Emacs shell
Date: Fri, 16 Sep 2016 13:07:45 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

Tags: patch

While looking into something else I noticed that 'grep -T' does not work under an Emacs shell window. grep outputs tab-backspace-':'-C to align C to the next tab stop, but under Emacs the backspace undoes the tab and so the output is not aligned. Arguably this is a problem with Emacs, but even if Emacs were changed the grep approach is not portable: Vim displays "^H:" instead, for example, and this also breaks alignment. grep should use a tab character to go to the next tab stop; this is more reliable and is simpler.

While in the neighborhood I noticed that -Tn alignment does not work for files that are sufficiently large (10,000 lines, say). Plus, nowadays we can rely on PRIuMAX to simplify printf.

Proposed patches attached. Normally I'd just install this sort of thing, but since we have a release candidate out I thought I'd ask first.

Attachment: 0001-grep-simplify-by-using-PRIuMAX.patch
Description: Source code patch

Attachment: 0002-grep-T-no-longer-outputs-BS.patch
Description: Source code patch

Attachment: 0003-grep-T-now-adjusts-number-widths-for-worst-case.patch
Description: Source code patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]