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: master ff4de1b: Fix quoting style in Lisp comments Date: Sat, 18 Sep 2021 09:19:40 +0300 Message-ID: <83czp676df.fsf@gnu.org> References: <20210912165141.9491.52637@vcs0.savannah.gnu.org> <83v934emk7.fsf@gnu.org> <87sfy8d7oo.fsf@gnus.org> <9194fc93-fb9c-000f-a35a-321ddd259893@gmx.at> <8735q5yi63.fsf@mail.linkov.net> <83czp9by3s.fsf@gnu.org> <05cbffe0-f89b-ff54-64f5-cd1d11bac4f5@yandex.ru> <831r5pbt7j.fsf@gnu.org> <83wnnhacy4.fsf@gnu.org> <40937e22-994f-466c-87be-4f70a522118a@yandex.ru> <83o88t9kgb.fsf@gnu.org> <9672aeae-a969-1526-003b-abb1b00b5b49@yandex.ru> <87sfy43dlt.fsf@gnus.org> <1a0f9230b7d75e426474@heytings.org> <838rzv8ozz.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="4263"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, rudalics@gmx.at, gregory@heytings.org, monnier@iro.umontreal.ca, dgutov@yandex.ru, larsi@gnus.org, juri@linkov.net To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 18 08:22:22 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 1mRTjy-0000vJ-Ks for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Sep 2021 08:22:22 +0200 Original-Received: from localhost ([::1]:52870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRTjx-0000Fi-Cl for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Sep 2021 02:22:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRThe-0007Rw-RP for emacs-devel@gnu.org; Sat, 18 Sep 2021 02:20:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41610) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRThb-00041Y-H9; Sat, 18 Sep 2021 02:19:55 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1068 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 1mRThb-0005Pt-4j; Sat, 18 Sep 2021 02:19:55 -0400 In-Reply-To: (message from Stefan Kangas on Fri, 17 Sep 2021 15:46:25 -0700) 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:274959 Archived-At: > From: Stefan Kangas > Date: Fri, 17 Sep 2021 15:46:25 -0700 > Cc: emacs-devel@gnu.org, rudalics@gmx.at, gregory@heytings.org, > monnier@iro.umontreal.ca, dgutov@yandex.ru, larsi@gnus.org, juri@linkov.net > > Eli Zaretskii writes: > > > Patches welcome to make that happen. One idea for implementation > > would be to use the display-table feature. > > I can't see any way to limit `buffer-display-table' to docstrings. You can't. > (define-minor-mode emacs-lisp-fancy-docstring-mode > "Minor mode for fancy display of Emacs Lisp `docstrings'." > :init-value nil > (if emacs-lisp-fancy-docstring-mode > (let ((table (or (copy-sequence standard-display-table) > (make-display-table)))) > (aset table ?` `[,(string-to-char (substitute-command-keys "`"))]) > (aset table ?' `[,(string-to-char (substitute-command-keys "'"))]) > (setq buffer-display-table table)) > (setq buffer-display-table nil))) > > It does the job in the sense that it correctly displays these quotes in > docstrings, but it also does it in code, which makes things hard to > read. If it makes things harder to read, then my idea won't fly. I thought that since ‘ and ’ look so very similar to ` and ', the effect on readability of code will be negligible. If this idea is a non-starter, and we want to do this only in comments and strings, I guess the only reasonable alternative is to do it as part of font-lock? Which means people who turn off font-lock will not be able to have the feature. Or maybe we could introduce a 'display-table' text property, which would then make it possible to do this only for some parts of the buffer text.