7 ms·
Hyphens, minus, and dashes in Debian man pages
- zeofig 3y agoI recently experienced this firsthand searching some manpages. It lead to extreme confusion.
- goosedragons 3y agoThis reminds me in a bug of website my school uses for homework. It only accepts negative numbers using hyphen-minus as found on US layout keyboards. Some students would enter minus because of their layout or IME and come to me as a TA for help wondering what they were doing wrong. Really was confusing figuring out what was going wrong the first time.
- arp242 3y agoIsn't this pretty common? str to int conversions don't commonly support this (quick test: Go, JavaScript, and Python – all throw an error on "str to int −10"). Are there keyboard layouts that have a "minus sign"? I can't find any (standard) keyboard layout that doesn't have - and has − instead (you will need - anyway for lots of contexts).
- rtpg 3y agoIt’s probably almost entirely IME stuff (I’ve had similar issues with some other dashes in MacOS, with one kind of dash being replaced by a “better” dash, but not the one I was typing, with a Japanese layout)
- deleted 3y ago[deleted]
- butlerm 3y agoIf an IME doesn't enter a standard hyphen-minus by default, no matter what the language is, that is basically engineering malpractice. How could anyone not know that would fail hard more often than not?
- Dalewyn 3y agoI type Japanese frequently, and hitting the dash/minus key results in "ー" instead of "-". The reason is justified too, namely in that Japanese is almost always typed monospaced so a normal "-" screws up the formatting. The same goes with numbers too, like "3" instead of "3". I always switch to English input if I need to type in lots of numbers since converting to half-space everytime gets annoying and feeding mono-/full-spaced numbers into text fields usually leads to the program on the backend crapping the water closet.
- butlerm 3y agoA dash is definitely not the same as a minus. A hyphen however is so close as to cause a serious ambiguity, so much so that they call the standard character a hyphen minus. So if someone comes along and invents a minus or a hyphen that is distinct from a hyphen minus, and can't even be visually distinguished most of the time, that is not particularly helpful for general use. People want to use Unicode for everything, when some things are really typesetting abstractions that should be avoided in general purpose computing. Groff and troff have their peculiar exceptions for historical reasons, but surely in retrospect it would have been better for a hyphen minus to render as a hyphen minus rather than as a hyphen. As far as Japanese goes, the keyboard mapping there is unfortunate. Perhaps they should have considered using a shift key or something to shift between hyphen minus and dash. And in my view those ought to be two characters with typesetting variations, not six or seven.
- layer8 3y agoMaybe they were pasting from a man page?
- Y_Y 3y agoThis is a good joke, but I do remember a course I took that required homework assignments in Mathematica. I definitely copied some of those from the help files. This was down to unimaginative assignments and fairly comprehensive examples in the docs. It even worked in exams, e.g. we were asked to compute and 3d plot a particular Lorenz attractor, this exact problem was in the (available in exam) help files.
- layer8 3y agoIt’s a difficult issue. If you write a calculator app as a web page, you might want to use the minus sign for the rendering to look typographically nice. But someone copying the output then might have trouble getting it working when pasting into some number input. A native app of course can convert to hyphen-minus on copying. But really, maybe it should become more common to accept the minus sign for minus in UI input.
- BlueTemplar 3y agoClose enough : New Azerty has 4 of them on the same key ? https://norme-azerty.fr/en/ https://norme-azerty.fr/en/ Technically, if not practically standard. (Yet ?)
- arp242 3y agoClassic "everyone is using the software wrong, but it's the fault of everyone, and not the software". Some distros like Void seem to patch this out.[1] From mandoc/mdocml's mandoc_char(7) [2] In roff(7) documents, the minus sign is normally written as ‘\-’. In manual pages, some style guides recommend to also use ‘\-’ if an ASCII 0x2d “hyphen-minus” output glyph that can be copied and pasted is desired in output modes supporting it, for example in -T utf8 and -T html. But currently, no practically relevant manual page formatter requires that subtlety, so in manual pages, it is sufficient to write plain ‘-’ to represent hyphen, minus, and hyphen-minus. Which is the common-sense thing to do. Meanwhile, GNU projects become increasingly less relevant due to obnoxiousness like this. In general the amount of wankery of "the correct hyphen" is staggering. [1]: https://man.openbsd.org/mandoc_char https://man.openbsd.org/mandoc_char [2]: https://github.com/void-linux/void-packages/blob/20c66829134a24719349228f6c8dce62d0e4f458/srcpkgs/groff/files/site.tmac https://github.com/void-linux/void-packages/blob/20c66829134...
- Elucalidavah 3y ago> everyone is using the software wrong, but it's the fault of everyone, and not the software > GNU projects There's a way more popular thing that breaks commandline snippets: auto-replace from `--` (double hyphen-minus) to `—` (emdash), in many chat applications and, particularly, on Mac OS. The argument for having such problem is the same: "everyone is using the software wrong", but alas, some people just forget to backtick their snippets (when that's even supported). So it's not just GNU projects; it's GNU projects where there's a good chance to actually fix such problems despite the opinion of some code authors.
- brirec 3y agoOn iOS it’s really almost impossible to type -- in an input that isn’t explicitly defined to allow it. In this comment box for instance, I had to type `- -` (dash space dash), and then delete the space in the middle. I’m not sure if it’s possible to disable this behavior on a web text box. Virtually any other method of inputting -- automatically, invariably converts it to a single em dash. The best part about this is that it happens silently and automatically, unlike every other autocorrect on the platform. “Smart punctuation” can be disabled globally for the entire device, but I don’t think that’s particularly reasonable, either.
- eichin 3y agoHmm. "ronn" doesn't get mentioned, I should make sure it does the sensible thing (because it's 2023 not 1983 and I don't expect anyone to use an obscure typesetting-ish notation to write very stylized man pages that are almost exclusively consumed in monospace terminals...)
- aezart 3y agoThe existence of multiple dashes, hyphens, etc. in English typography should be considered a bug, not a feature. Modern typesetting should standardize on a single glyph instead of perpetuating this nonsense, and it should be hyphen-minus because that's the one that's on keyboards. The same goes for curly quotes.
- WillAdams 3y agoAesthetics argues against that, as well as tradition. (and you failed to note the use of primes and double primes) It's also a meaningful differentiation to be able to communicate a sentence such as: “’struth,” he said, “she’s 5′2″ with eyes of blue.” or, “Usually, 35–40 m.p.h. is a workable and safe speed for travel—unless pedestrians are involved, in which case adjust by −20 m.p.h.” which are far less intelligible when set with unidirectional/same width characters. It's also useful to have the uni-directional versions ' and " for special usages in computer science contexts, while the curly forms can be used within say a .csv without the need to be escaped.
- mikepurvis 3y agoI really appreciate the use of proper em-dashes aesthetically— I use them for parentheticals, interruptions, and to join related thoughts. iOS and MacOS have native means of inputting the character and on Windows I have a small utility that replaces "--=" with an en-dash and "==-" with an en-dash.
- perilunar 3y agoSame. Once you learn the appropriate uses for each and how to input them, it becomes easy to just use the correct dash.
- asplake 3y ago> Just use the correct dash Except that spaced vs unspaced and en vs em dashes are issues of British vs US English. Differences in usage as well as appearance.
- gorgoiler 3y agoThis comment from the package maintainer caught my eye. It is in response to the upstream author’s proposal to turn the hyphens problem — caused by man page authors but felt by anyone who uses man — into everyone’s problem. The suggestion was that doing so is the right way to persuade man page authors to fix their “bugs”. ”Externalizing costs onto relatively powerless consumers in the hope of using them to relay complaints to the people in power offends my sense of natural justice.” It reminds me of the “Knee Defender” — plastic blocks designed to help airline passengers disable the recline feature not on their own seat, but on the seat in front of them. Part of the marketing copy from the manufacturer was that if your fellow passengers complain about you using these blocks then you should encourage them to complain to the airline with you, to appeal together for more space for everyone on board. What a selfish and asinine suggestion that was. The upstream groff maintainer’s position is not dissimilar.
- ghusto 3y ago> What a selfish and asinine suggestion that was Why? Isn't it essentially just a stronger way of turning to the person and asking them not to recline their chair? Are you saying the person in front is entitled to to, since the chair has that function?
- lifthrasiir 3y agoThat's what you get when you don't think WYSIWYG as a necessity. Troff is not really unique in that there are many other markup languages with hyphen-minus-dash distinctions, which may be detected contextually, distinguished from various states, or have to be manually marked as such. Any such distinction is a potential mistake open for users, but WYSIWYG provides an immediate feedback so that many mistakes can be readily corrected. Even a semi-WYSIWYG interface like a side-by-side preview would work great, to slightly lesser extent---it is rare to see a Markdown editor not paired with a preview. To my knowledge this is never a norm in troff, I'm not even sure if there does exist a preview editor for troff (contrary to TeX and friends!), and unless such editor can be made a norm, troff should be better shelved for good.
- cultureswitch 3y agoWYSIWYG editors make this problem worse, not better. It is extremely common, if not expected, for a WYSIWYG editor to change the character that has been typed by the user to a different character which the editor thinks better corresponds to the intention of the user. That very principle is essentially wrong. And in a WYSIWYG editor, the user is not necessarily aware that this "helpful" change has taken place. In particular, the user will not be aware if the characters are visually identical. Typesetting concerns only belong to typesetting tools. And even then, almost all these typesetting rules relating to quotes and dashes are obscure, actively debated, dependent on language and most important of all, completely useless.
- bertman 3y agoDiscussion from 3 weeks ago: https://news.ycombinator.com/item?id=37892654 https://news.ycombinator.com/item?id=37892654
- cultureswitch 3y agoIt's funny we're having this conversation when the real, _actual_ bug is this: > The specified behavior of groff is that an ASCII "-" (Hyphen-Minus) in the input becomes a Hyphen in the output. This makes no sense and virtually any program that does similar things (ligatures, auto-emoji, formatting...) on output that will realistically be copy-pasted should burn in hell.
- deleted 3y ago[deleted]
- kevin_thibedeau 3y agoIt makes sense for typeset output. It doesn't make sense for man pages and the tool should make that distinction easy to select.
- HankB99 3y agoThis sounds like the same issue that caused me to switch from Google Docs to Markdown for my notes. One day I spent way too much time trying to figure out why I was getting errors when copy/pasting a command back to the command line. IIRC I finally copied the command to a `vim` window and found that GD was replacing consecutive spaces with some other character that the shell didn't interpret as a space.
- lelanthran 3y agoI hear you. I had the same damn good experience and it was only after pasting into vim that I realised what was going on.
- bxparks 3y agoDoes turning off "Automatic Substitutions" (under Tools > Preferences > Substitutions) fix the problem? I have that turned off, as well as turning off "Smart quotes" (under the General tab) which drove me nuts with code fragments. They may also add new options every now and then. I don't remember seeing the "Insert emojis using the colon character" option. Turned that damn thing off.
- kardos 3y agoFixing the man pages to have the right dashes seems like something a LLM could do