FS#79094 - [groff] hyphen in manpages is unsearchable

Attached to Project: Arch Linux
Opened by Tadeas Uhlir (rahlir) - Thursday, 13 July 2023, 17:21 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 18 July 2023, 23:28 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description: the commit 958e73c5086d99c87c0d2319088931e1771a42d8 for groff introduced a bug where hyphens
and apostrophes are no longer searchable. Moreover, they do not show up on terminals without utf-8 fonts.
This bug seemed to have been introduced by removing the entire content of site.tmac from the configs
mdoc.local and man.local (putting it back fixes this). I understand this was done because sgr is no longer part
of groff, but for some reason the entire file was scrapped by the maintainer. The sections relating to char \-, char -, and
char ' should still be included in the local configs.


Additional info:
Relates to groff 1.23.0-2

Steps to reproduce:
Open `man man` and search for `man-recode`. The search will not find anything even though there is a reference in the text
to the man-recode command
This task depends upon

Closed by  Toolybird (Toolybird)
Tuesday, 18 July 2023, 23:28 GMT
Reason for closing:  Fixed
Additional comments about closing:  groff 1.23.0-3
Comment by Toolybird (Toolybird) - Thursday, 13 July 2023, 21:53 GMT
> hyphens and apostrophes are no longer searchable

Not quite correct. hyphens are still searchable, but not when preceded by some other text. e.g. searching for "-k" works fine.

Have you reported this upstream to ask them about it?

Comment by Tadeas Uhlir (rahlir) - Friday, 14 July 2023, 05:11 GMT
> Not quite correct. hyphens are still searchable, but not when preceded by some other text. e.g. searching for "-k" works fine.

That’s because those are not hyphens, those are minus signs. In groff you typeset hyphen with “-“ and minus signs with “\-“. Options are typically typeset as minus signs, but hyphens within text are usually typeset as hyphens (zsh manpages are a notable exception, you can search everything there just fine, but that’s because hyphens are not really hyphens there).

> Have you reported this upstream to ask them about it?

There is nothing to report upstream, this is a well known peculiarity of groff. See for instance here: https://opensource.apple.com/source/groff/groff-32/groff/PROBLEMS.auto.html or here https://lists.gnu.org/archive/html/groff/2021-01/msg00074.html
Comment by Toolybird (Toolybird) - Friday, 14 July 2023, 06:03 GMT
> There is nothing to report upstream

Ok, I misunderstood. Sorry! I thought you were referring to an upstream commit :/

Anyway, I assume you have seen  FS#79053  which was the reason for the change.
Comment by Benoit Pierre (bpierre) - Saturday, 15 July 2023, 10:26 GMT
```diff
PKGBUILD | 13 ++++++++++---
site.tmac | 5 -----
2 files changed, 10 insertions(+), 8 deletions(-)

diff --git i/PKGBUILD w/PKGBUILD
index 996983c..fd06019 100644
--- i/PKGBUILD
+++ w/PKGBUILD
@@ -2,7 +2,7 @@

pkgname=groff
pkgver=1.23.0
-pkgrel=2
+pkgrel=3
pkgdesc='GNU troff text-formatting system'
arch=('x86_64')
url='https://www.gnu.org/software/groff/groff.html'
@@ -16,10 +16,12 @@ optdepends=('netpbm: for use together with man -H command interaction in browser
options=('!docs' '!emptydirs' '!makeflags')
validpgpkeys=('2D0C08D2B0AD0D3D8626670272D23FBAC99D4E75') # Bertrand Garrigues <bertrand.garrigues@laposte.net>
source=("https://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz"{,.sig}
- display-utc-times.patch)
+ display-utc-times.patch
+ 'site.tmac')
sha256sums=('6b9757f592b7518b4902eb6af7e54570bdccba37a871fddb2d30ae3863511c13'
'SKIP'
- '489bb32bbd1c7bced33bf187611219527914ae46ce05238fe80dc11c4b1bb909')
+ '489bb32bbd1c7bced33bf187611219527914ae46ce05238fe80dc11c4b1bb909'
+ 'f0b8a69d8dc51fe6812d3c7adbdba59b8206cfa952f2ce3ee7ff7f5412903018')

prepare() {
cd $pkgname-$pkgver
@@ -51,4 +53,9 @@ package() {
ln -s eqn "$pkgdir"/usr/bin/geqn
ln -s tbl "$pkgdir"/usr/bin/gtbl
ln -s soelim "$pkgdir"/usr/bin/zsoelim
+
+ cat "$srcdir"/site.tmac >> \
+ "$pkgdir"/usr/share/groff/site-tmac/man.local
+ cat "$srcdir"/site.tmac >> \
+ "$pkgdir"/usr/share/groff/site-tmac/mdoc.local
}
diff --git i/site.tmac w/site.tmac
index 7bd28aa..7c04fdc 100644
--- i/site.tmac
+++ w/site.tmac
@@ -7,9 +7,4 @@
. char - \N'45'
. char ' \N'39'
. \}
-.
-. \" Shut off SGR by default (groff colors)
-. \" Require GROFF_SGR envvar defined to turn it on
-. if '\V[GROFF_SGR]'' \
-. output x X tty: sgr 0
.\}
```
Comment by Tobias Powalowski (tpowa) - Tuesday, 18 July 2023, 14:21 GMT
1.23.0-3 should fix it.

Loading...