From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Display of em dashes in our documentation Date: Fri, 08 Oct 2021 19:12:02 +0300 Message-ID: <83o87zxzql.fsf@gnu.org> References: <4209edd83cfee7c84b2d75ebfcd38784fa21b23c.camel@crossproduct.net> <87v92ft9z6.fsf@db48x.net> <87o885tyle.fsf@db48x.net> <83k0it6lu5.fsf@gnu.org> <87k0isu7hz.fsf_-_@db48x.net> <87a6jotszy.fsf@db48x.net> <877der8smr.fsf@mail.linkov.net> <83y2772y0s.fsf@gnu.org> <83sfxd1g05.fsf@gnu.org> <83tuhtyn46.fsf@gnu.org> <83o880zuxs.fsf@gnu.org> <838rz4ypkt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10209"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, yuri.v.khan@gmail.com, juri@linkov.net, db48x@db48x.net, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 08 18:13:46 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYsVF-0002Tb-IS for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Oct 2021 18:13:45 +0200 Original-Received: from localhost ([::1]:48958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYsVE-0006E0-2g for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Oct 2021 12:13:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYsU2-0005TG-TU for emacs-devel@gnu.org; Fri, 08 Oct 2021 12:12:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43898) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYsU0-0006W8-NC; Fri, 08 Oct 2021 12:12:28 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1462 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYsTu-0002je-Bv; Fri, 08 Oct 2021 12:12:22 -0400 In-Reply-To: (message from Stefan Kangas on Fri, 8 Oct 2021 11:09:13 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:276568 Archived-At: > From: Stefan Kangas > Date: Fri, 8 Oct 2021 11:09:13 -0400 > Cc: rms@gnu.org, db48x@db48x.net, yuri.v.khan@gmail.com, emacs-devel@gnu.org, > monnier@iro.umontreal.ca, juri@linkov.net > > > So I'd prefer to deal with this differently: introduce a new > > (buffer-local) minor mode, which will install a display-table, whereby > > "problematic" Unicode characters will be displayed as their ASCII > > equivalents or equivalent ASCII strings. We already set that up > > automatically on terminals that are incapable of displaying those > > characters, but nothing precludes us from having such a feature on > > demand for capable displays as well. Then users who don't want the > > effects of these characters on display could activate such a mode, and > > solve their problems without affecting the actual contents of the Info > > files. > > That's an interesting idea. So you propose that this minor mode could > display many more problematic Unicode characters in a different way, and > that it would not necessarily be limited to info? Yes. > I guess it doesn't take much coding, but the interesting question is > which other Unicode characters it should cover. I only know about em > dash; are there others? We could let users customize the list in some way. > One drawback is that em dash is only confirmed to be problematic in some > situations; that is when they are written "like—this" with no space in > between, whereas in situations "like — this" I think it is much > preferable to show the actual Unicode character. That's splitting hair, IMO. The latter should never happen in a well-written manual. > Actually, this gives me another way of how we could do it: in our info > manuals, as the final step before displaying it, we do something like > this (here quickly coded up as a hook): > > (defun sk/Info-fix-em-dashes () > (save-excursion > (goto-char (point-min)) > (let ((case-fold-search t) > (buffer-read-only nil)) > (while (re-search-forward "\\([a-z”’']\\)—\\([a-z]“‘`'\\)" nil t) > (replace-match "\\1 — \\2" t))))) > > (add-hook 'Info-selection-hook #'sk/Info-fix-em-dashes) What will that do to byte offsets in Info tag tables? I'd rather avoid modifying the buffer contents. > In any monospace font, I certainly prefer this: > > When ‘recover-session’ is done, the files you’ve chosen to recover > are present in Emacs buffers. You should then save them. Only > this — saving them — updates the files themselves. > > To this: > > When ‘recover-session’ is done, the files you’ve chosen to recover > are present in Emacs buffers. You should then save them. Only > this—saving them—updates the files themselves. But that's against our style of writing documents, isn't it? I believe the usual US English style is not to leave whitespace around em dash.