unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Yuri Khan <yuri.v.khan@gmail.com>,
	Stefan Kangas <stefan@marxist.se>,
	Manuel Giraud <manuel@ledu-giraud.fr>,
	Emacs developers <emacs-devel@gnu.org>,
	martin rudalics <rudalics@gmx.at>,
	Gregory Heytings <gregory@heytings.org>,
	Dmitry Gutov <dgutov@yandex.ru>, Eli Zaretskii <eliz@gnu.org>,
	Juri Linkov <juri@linkov.net>,
	Lars Magne Ingebrigtsen <larsi@gnus.org>
Subject: RE: [External] : Re: master ff4de1b: Fix quoting style in Lisp comments
Date: Sat, 18 Sep 2021 23:22:37 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488980F1DC00D4F85E9697DF3DE9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <jwvlf3t6bp4.fsf-monnier+emacs@gnu.org>

> > > > it is useful to have distinct characters to
> > > > represent opening and closing quote.
> > > 
> > > The usefulness is that it resolves some ambiguities.
> > > But those can resolved in other ways (e.g. by
> > > disallowing newlines between the opening and closing
> > > quote).
> >
> > Why would we want to impose such a restriction?
> 
> E.g. because multiline constructs are fundamentally
> harder to handle in many cases, such as in font-lock?

Sure, font-locking such things (but not only such
things) isn't 100% perfect.

Having distinct open and close delimiters makes
things easier not only for fontifying but also
for users.

> Or because of things like
>     ;; foo `bar
>     ;; baz' toto

Looks like a pretty concocted example.  Ever seen
that in the wild?

We don't currently font-lock even `...' with space
chars in the ..., in Lisp comments.  (I mentioned
earlier that we could.)

I do that in Info, for example (but emacs -Q
doesn't).

In the Emacs and Elisp manuals there are plenty of
occurrences of '...' where the ... contains space
chars - instances ranging from shell commands, such
as 'cp -r', to key bindings, such as 'a +', to font
names, such as 'song ti', to programming constructs,
such as 'else if', to VC commands, such as
'svn switch', to key sequences, such as 'M-x diary'
and '100 C-f', to key bindings, such as 'C-c C-c',
to patterns, such as 'C-x v r BRANCH-NAME <RET>'
and 'MONTHNAME DAY', to file extensions, such as
'.elc', to menu items, such as 'Other calendars'.

(Those are all from the Emacs manual, and there
are zillions more.)

But sure, it's more problematic to allow for
newline chars.  In my code (`info+.el') that's
optional, and not on by default (except for "...").
But it can by useful, to cover things like these:

'C-x
<RET>' 

'MONTHNAME DAY,
YEAR'

'ls
-l'

'xdvi
OUTPUT-FILE-NAME'

"newline
characters"

All of those occurrences, and many such more,
are in the Emacs manual, and they all fontify
nicely.  (And of course the same was true with
`...', before the change to curly quotes.)

I haven't done the same for `...' in Elisp
comments - only symbol constituents are
fontified there still.  But more could be done.

> where the opener is not in the same comment
> as the closer.

Yes, that would be a minor hiccup.  Fontifying
would need to disregard the comment-starts.
But as I say, that's a pretty uncommon case.

Font-locking need not aim to be perfect, even
in the default case.  But best is to make it
easy for users to switch among different
degrees of font-locking such things.

By default, `info+.el' fontifies all such
quotations.  For all except "..." (strings),
it does so only if the pattern is all on the
same line.  (By default, <...> text is also
fontified.)  Change the value of an option to
get multiline fontifying of all such.

You can also fontify isolated backquote and
quote chars, which is helpful for Lisp code
snippets (including in strings: "the `foo'").

It's easy to change such behavior on the fly.



  parent reply	other threads:[~2021-09-18 23:22 UTC|newest]

Thread overview: 159+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210912165141.9491.52637@vcs0.savannah.gnu.org>
     [not found] ` <20210912165143.5BC1E20A5E@vcs0.savannah.gnu.org>
2021-09-12 22:42   ` master ff4de1b: Fix quoting style in Lisp comments Dmitry Gutov
2021-09-13  8:06     ` Lars Ingebrigtsen
2021-09-13 12:01       ` Eli Zaretskii
2021-09-14  2:14         ` Phil Sainty
2021-09-13 11:34     ` Eli Zaretskii
2021-09-13 11:41       ` Lars Ingebrigtsen
2021-09-13 12:23         ` Eli Zaretskii
2021-09-13 12:36         ` martin rudalics
2021-09-13 16:53           ` Stefan Monnier
2021-09-13 18:25             ` Stefan Monnier
2021-09-15  9:27               ` martin rudalics
2021-09-15 12:42                 ` Stefan Monnier
2021-09-15 18:46                   ` martin rudalics
2021-09-15 16:02                 ` Juri Linkov
2021-09-15 16:30                   ` Eli Zaretskii
2021-09-15 18:07                     ` Dmitry Gutov
2021-09-15 18:16                       ` Eli Zaretskii
2021-09-15 18:20                         ` Dmitry Gutov
2021-09-15 21:12                           ` [External] : " Drew Adams
2021-09-15 18:40                         ` Stefan Kangas
2021-09-15 18:52                           ` Eli Zaretskii
2021-09-15 20:01                             ` Dmitry Gutov
2021-09-15 20:15                               ` Stefan Monnier
2021-09-15 21:24                                 ` [External] : " Drew Adams
2021-09-16  5:08                                 ` Eli Zaretskii
2021-09-16 10:39                                   ` Dmitry Gutov
2021-09-16 12:32                                     ` Lars Ingebrigtsen
2021-09-16 12:53                                       ` Eli Zaretskii
2021-09-16 13:37                                         ` Dmitry Gutov
2021-09-16 23:20                                           ` Phil Sainty
2021-09-18  0:15                                             ` Dmitry Gutov
2021-09-16 16:19                                         ` [External] : " Drew Adams
2021-09-17 14:12                                         ` Lars Ingebrigtsen
2021-09-17 15:58                                           ` Eli Zaretskii
2021-09-17 19:21                                             ` Stefan Kangas
2021-09-18  5:42                                               ` Eli Zaretskii
2021-09-18  8:17                                                 ` Stefan Kangas
2021-09-18  8:26                                                   ` Eli Zaretskii
2021-09-18 13:30                                             ` Lars Ingebrigtsen
2021-09-18 13:34                                               ` Eli Zaretskii
2021-09-18 16:03                                                 ` [External] : " Drew Adams
2021-09-18 16:13                                                   ` Eli Zaretskii
2021-09-18 16:52                                                     ` Drew Adams
2021-09-18 16:54                                                       ` Lars Ingebrigtsen
2021-09-18 17:07                                                         ` Drew Adams
2021-09-16 13:31                                       ` Eli Zaretskii
2021-09-16 16:20                                         ` [External] : " Drew Adams
2021-09-16 14:15                                       ` Eli Zaretskii
2021-09-16 14:18                                         ` Dmitry Gutov
2021-09-16 15:22                                           ` Eli Zaretskii
2021-09-16 16:20                                         ` [External] : " Drew Adams
2021-09-17  9:17                                       ` Gregory Heytings
2021-09-17 10:26                                         ` Stefan Kangas
2021-09-17 10:39                                           ` Eli Zaretskii
2021-09-17 22:46                                             ` Stefan Kangas
2021-09-18  6:19                                               ` Eli Zaretskii
2021-09-18  7:32                                                 ` Andreas Schwab
2021-09-18  8:20                                                   ` Eli Zaretskii
2021-09-18  8:37                                                     ` Adam Sjøgren
2021-09-18  8:44                                                     ` Gregory Heytings
2021-09-18  8:48                                                     ` Yuri Khan
2021-09-18 11:50                                                       ` Phil Sainty
2021-09-18 11:54                                                         ` Yuri Khan
2021-09-18 16:03                                                           ` [External] : " Drew Adams
2021-09-18 16:02                                                         ` Drew Adams
2021-09-18 16:02                                                       ` Drew Adams
2021-09-18 16:01                                                     ` Drew Adams
2021-09-18 16:01                                                   ` Drew Adams
2021-09-18  8:17                                                 ` Stefan Kangas
2021-09-18  8:25                                                   ` Eli Zaretskii
2021-09-18  9:18                                                     ` Stefan Kangas
2021-09-18 11:00                                                       ` Eli Zaretskii
2021-09-18 16:02                                                     ` [External] : " Drew Adams
2021-09-18  9:28                                                   ` Yuri Khan
2021-09-18 10:05                                                     ` Stefan Kangas
2021-09-18 10:27                                                       ` Yuri Khan
2021-09-18 10:51                                                         ` Stefan Kangas
2021-09-18 18:40                                                           ` Juri Linkov
2021-09-18 18:56                                                             ` Eli Zaretskii
2021-09-18 19:34                                                               ` Stefan Kangas
2021-09-18 23:22                                                                 ` [External] : " Drew Adams
2021-09-19  5:44                                                                   ` Eli Zaretskii
2021-09-19 10:00                                                                     ` Stefan Kangas
2021-09-19 17:30                                                                     ` Drew Adams
2021-09-19 17:42                                                                       ` Eli Zaretskii
2021-09-19 17:54                                                                         ` Drew Adams
2021-09-21 14:38                                                                           ` Jean Louis
2021-09-21 17:04                                                                             ` tomas
2021-09-21 17:09                                                                               ` tomas
2021-09-24 20:42                                                                               ` Richard Stallman
2021-09-19  5:30                                                                 ` Eli Zaretskii
2021-09-17 10:55                                           ` Gregory Heytings
2021-09-17 11:16                                             ` Eli Zaretskii
2021-09-17 11:30                                               ` Gregory Heytings
2021-09-17 12:11                                                 ` Eli Zaretskii
2021-09-17 12:30                                                   ` Gregory Heytings
2021-09-17 16:21                                                     ` Yuri Khan
2021-09-17 16:40                                                       ` João Távora
2021-09-17 16:44                                                       ` Alan Mackenzie
2021-09-17 17:47                                                       ` Eli Zaretskii
2021-09-17 18:42                                                         ` Yuri Khan
2021-09-17 18:51                                                           ` Eli Zaretskii
2021-09-17 19:14                                                       ` Gregory Heytings
2021-09-17 19:22                                                         ` Stefan Monnier
2021-09-17 20:32                                                           ` Manuel Giraud
2021-09-17 22:16                                                             ` [External] : " Drew Adams
2021-09-18 13:45                                                             ` Stefan Monnier
2021-09-18 16:03                                                               ` [External] : " Drew Adams
2021-09-18 17:25                                                                 ` Stefan Monnier
2021-09-18 17:46                                                                   ` Stefan Kangas
2021-09-18 23:11                                                                     ` Stefan Monnier
2021-09-18 23:22                                                                   ` Drew Adams [this message]
2021-09-19 12:26                                                                     ` Stefan Monnier
2021-09-18  5:43                                                           ` Eli Zaretskii
2021-09-18  8:33                                                             ` Stefan Kangas
2021-09-18  8:53                                                               ` Gregory Heytings
2021-09-17 18:09                                                   ` [External] : " Drew Adams
2021-09-17 18:09                                           ` Drew Adams
2021-09-16 16:18                                   ` Drew Adams
2021-09-16 10:50                                 ` Dmitry Gutov
2021-09-16 11:39                                   ` Eli Zaretskii
2021-09-16 14:12                                     ` Dmitry Gutov
2021-09-16 16:20                                       ` [External] : " Drew Adams
2021-09-16 16:18                                     ` Drew Adams
2021-09-16 11:25                                 ` Stefan Kangas
2021-09-17  0:16                                 ` Richard Stallman
2021-09-17  0:27                                   ` Alexandre Garreau
2021-09-17  6:34                                   ` Eli Zaretskii
2021-09-17 10:44                                     ` Dmitry Gutov
2021-09-17 11:11                                       ` Eli Zaretskii
2021-09-17 11:25                                         ` Dmitry Gutov
2021-09-17 12:09                                           ` Eli Zaretskii
2021-09-17 12:38                                             ` Phil Sainty
2021-09-17 12:59                                               ` Tassilo Horn
2021-09-17 15:45                                               ` Eli Zaretskii
2021-09-17 13:07                                             ` Dmitry Gutov
2021-09-17 13:44                                               ` João Távora
2021-09-17 15:49                                               ` Eli Zaretskii
2021-09-17 16:33                                                 ` Dmitry Gutov
2021-09-17 18:10                                               ` [External] : " Drew Adams
2021-09-17 13:18                                           ` Amin Bandali
2021-09-17 18:09                                       ` [External] : " Drew Adams
2021-09-16  4:53                               ` Eli Zaretskii
2021-09-16  8:51                                 ` Dmitry Gutov
2021-09-16  9:11                                   ` Eli Zaretskii
2021-09-16 10:34                                     ` Dmitry Gutov
2021-09-16 11:35                                       ` Eli Zaretskii
2021-09-16 13:38                                         ` Dmitry Gutov
2021-09-15 18:48                     ` martin rudalics
2021-09-15 19:05                       ` Eli Zaretskii
2021-09-16  6:56                         ` martin rudalics
2021-09-16  7:11                           ` Eli Zaretskii
2021-09-16 16:18                             ` [External] : " Drew Adams
2021-09-13 11:51       ` Dmitry Gutov
2021-09-13 12:05         ` Lars Ingebrigtsen
2021-09-13 12:28           ` Eli Zaretskii
2021-09-13 12:29             ` Lars Ingebrigtsen
2021-09-13 12:26         ` Eli Zaretskii
2021-09-13 12:56           ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB5488980F1DC00D4F85E9697DF3DE9@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=gregory@heytings.org \
    --cc=juri@linkov.net \
    --cc=larsi@gnus.org \
    --cc=manuel@ledu-giraud.fr \
    --cc=monnier@iro.umontreal.ca \
    --cc=rudalics@gmx.at \
    --cc=stefan@marxist.se \
    --cc=yuri.v.khan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).