From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Fu Yuan Newsgroups: gmane.emacs.devel Subject: Re: Writing manuals Date: Thu, 19 Aug 2021 09:29:28 -0700 Message-ID: References: <83lf4x1kme.fsf@gnu.org> Mime-Version: 1.0 (1.0) Content-Type: multipart/alternative; boundary=Apple-Mail-68269FCB-E4EE-4CCB-A657-A32AA0A65ADC Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23999"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 19 18:30:28 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 1mGkw0-00061F-De for ged-emacs-devel@m.gmane-mx.org; Thu, 19 Aug 2021 18:30:28 +0200 Original-Received: from localhost ([::1]:58734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGkvz-0000eg-7b for ged-emacs-devel@m.gmane-mx.org; Thu, 19 Aug 2021 12:30:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGkvA-0008OW-8k for emacs-devel@gnu.org; Thu, 19 Aug 2021 12:29:36 -0400 Original-Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:41726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGkv8-0002WX-B7; Thu, 19 Aug 2021 12:29:36 -0400 Original-Received: by mail-pj1-x102f.google.com with SMTP id fa24-20020a17090af0d8b0290178bfa69d97so5232862pjb.0; Thu, 19 Aug 2021 09:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=mQUd3TuWoYqNAFvdN5j5HvtfMtmSblNHsWzGSiF/0o0=; b=tJqjsVgdiHDVat5a8hpByfNKzj+Dzvj0A384DFSMAQAhaRFJP2whIN79Z0Y853ia1X o/kZJMrAeqNHU7+ZpNxKRUlOzdWNyQRy1SSabvnB+itqriH1DcDn8/0tUsOJmvoxH+Yu /ziD4UPqQ+KwSRpJOSsSMLpDJTbF0QbaJjJJ9bpx+waMDAun4WdVkvuAYr1REJr3ZQ3X W8glY4rFoXV31wOEWlOPOTkWj6eE2DK1tPsKcG3Kx72yhI0zHOL3+qkZ88o2/0Rzt6Zx VFTMGsxkjenTmBzNyR6kLkFRGCc0sy4hg4Kh3uAYw3wVYasqStKoAyM7HAQ6M37OYLzn G6sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=mQUd3TuWoYqNAFvdN5j5HvtfMtmSblNHsWzGSiF/0o0=; b=pqTIi1Lv0aInyDV/TUmII3+hX+YXGV8ChLStGL1NMst4wwzY4nJEz2fpoRMnNjKCeW Q5wT+QYXZmA7GSJSclSmhEO6jjS+J1mMRzJ/f41kOeQ2dSsnIO0mspCLBAqp3in5RoAP Cv4pr+dM69qQYOKmrDKrLl/b8cqMgQ/Bnx0TKGW296E2HS2733Xm86QadiTSveCjqOj7 H/nBiY1hUayxDI9TpGdewzQvKKnn2Hwwtpefx2GEXh5pPMOyEujmQ2pT8Z+G3Brr36bE OM/aWQWvFEQymo8+kFQBEqVCnDtSQl0i6R61Azr/6RxY2Z6XQYQ/Ya9KYccb7i6/DoiB RJpA== X-Gm-Message-State: AOAM530o+3TTMGv6U0SjStu+4D/5GaMCloySxqzufWN6ZCEpYqYSCax7 fs7ik7C7tM2SDJYwAK2gK2Lw+So7PD8= X-Google-Smtp-Source: ABdhPJzY39IgTluBZLKZEsCdHModhh0X9N7SJxGLS6P+FUaLHj4q1kT5NFyX6+MNiKJYOSqOsz+GSQ== X-Received: by 2002:a17:90b:210:: with SMTP id fy16mr15962425pjb.119.1629390571575; Thu, 19 Aug 2021 09:29:31 -0700 (PDT) Original-Received: from ?IPv6:2607:fb90:21da:e21c:eddb:8d49:7a44:b9c? ([2607:fb90:21da:e21c:eddb:8d49:7a44:b9c]) by smtp.gmail.com with ESMTPSA id fa21sm9014367pjb.20.2021.08.19.09.29.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Aug 2021 09:29:31 -0700 (PDT) In-Reply-To: <83lf4x1kme.fsf@gnu.org> X-Mailer: iPhone Mail (17H35) Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=casouri@gmail.com; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:272680 Archived-At: --Apple-Mail-68269FCB-E4EE-4CCB-A657-A32AA0A65ADC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > =E5=9C=A8 2021=E5=B9=B48=E6=9C=8819=E6=97=A5=EF=BC=8C=E4=B8=8A=E5=8D=889:1= 0=EF=BC=8CEli Zaretskii =E5=86=99=E9=81=93=EF=BC=9A >=20 > =EF=BB=BF >>=20 >> From: Yuan Fu >> Date: Thu, 19 Aug 2021 08:59:32 -0700 >> Cc: Emacs Devel >>=20 >>>> * Language definitions:: Loading tree-sitter language definitions. >>>> * Using parsers:: Introduction to parsers. >>>> * Accessing nodes:: Accessing syntax nodes. >>>> * Pattern matching:: Pattern matching with query patterns. >>>> * Query syntax:: Introducing pattern matching query syntax. >>>> * Multiple languages:: Parse buffers written in multiple languages= . >>>> * API correspondence:: Correspondence between C API and ELisp API.= >>>> * Parse a string:: Parse a single string. >>>>=20 >>>> They are all tree-sitter specific. >>>=20 >>> What's wrong with the section names you show above? >>=20 >> Nothing wrong, just that if we want to add manual for other parsing tools= , there could be clashes in title: maybe LSP returns syntax nodes, too, but =E2= =80=9CAccessing nodes=E2=80=9D section is all about tree-sitter nodes. But w= e=E2=80=99ll worry about that later, as you suggested. >=20 > My idea is to put the documentation of other APIs for the same purpose > in the same section, so there shouldn't be a clash, because there > won't be multiple sections describing similar facilities, there will > be just one. Ok >=20 >> Another problem I discovered when writing the manual is that, my explanat= ion of the query syntax is similar to the official documentation of tree-sit= ter. Will there by copyright concerns? I=E2=80=99ve written the section desc= ribing query syntax, and I=E2=80=99ll write another section describing the g= rammar definition, these two sections will be similar to their tree-sitter o= fficial documentation counterparts, because they cover exactly the same thin= g. >=20 > Well, I can only suggest to use different wording. Since you are > describing Lisp interfaces, some phrases will be different by > necessity, and others because we have a certain style when we describe > APIs (you should be able to pick up that style by looking in the > existing descriptions in the manual). For ELisp functions, definitely, and I wasn=E2=80=99t talking about that par= t. For query syntax and language definition syntax, because I and tree-sitte= r doc are talking about the exact same thing, it is harder. I certainly reph= rased, and I tried to come up with different examples. I=E2=80=99m just not s= ure if that is enough (INAL). >=20 >> Perhaps it is best if you can see what I=E2=80=99ve write and compare tha= t with the official documentation. I (force) pushed the latest code to GitHu= b. I put the manual in parsing.texi. The section describing the query syntax= is (elisp)Parsing Program Source > Pattern matching. The official documenta= tion is at https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-m= atching-with-queries >=20 > What is the URL for parsing.texi? I don't think I have it. I have it on =E2=80=9Cts=E2=80=9D branch. https://github.com/casouri/emacs/blob/ts/doc/lispref/parsing.texi Thanks Yuan= --Apple-Mail-68269FCB-E4EE-4CCB-A657-A32AA0A65ADC Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

=E5=9C=A8 2021=E5=B9=B48=E6=9C=8819=E6=97=A5=EF=BC=8C=E4=B8=8A=E5=8D=88= 9:10=EF=BC=8CEli Zaretskii <eliz@gnu.org> =E5=86=99=E9=81=93=EF=BC=9A<= br>
=EF=BB=BF=
From: Yuan Fu <casouri@gmail.com>
Date: Thu, 19 Aug 2021 08= :59:32 -0700
Cc: Emac= s Devel <emacs-devel@gnu.org>

* Language definitions::  =   Loading tree-sitter language definitions.
* Using parsers::     = ;      Introduction to parsers.
* Accessing nodes::   &= nbsp;     Accessing syntax nodes.
* Pattern matching::   &nbs= p;    Pattern matching with query patterns.
* Query syntax::   &n= bsp;        Introducing pattern matc= hing query syntax.
= * Multiple languages::      Parse buffers written i= n multiple languages.
* API correspondence::      Correspondence betwe= en C API and ELisp API.
<= span>* Parse a string::         &nbs= p;Parse a single string.
=
They are all= tree-sitter specific.

Wha= t's wrong with the section names you show above?

Nothing wrong, just that if we want to add manual for o= ther parsing tools, there could be clashes in title: maybe LSP returns synta= x nodes, too, but =E2=80=9CAccessing nodes=E2=80=9D section is all about tre= e-sitter nodes. But we=E2=80=99ll worry about that later, as you suggested.<= /span>

My idea is to put the document= ation of other APIs for the same purpose
in the same section= , so there shouldn't be a clash, because there
won't be mult= iple sections describing similar facilities, there will
be j= ust one.

Ok

Ano= ther problem I discovered when writing the manual is that, my explanation of= the query syntax is similar to the official documentation of tree-sitter. W= ill there by copyright concerns? I=E2=80=99ve written the section describing= query syntax, and I=E2=80=99ll write another section describing the grammar= definition, these two sections will be similar to their tree-sitter officia= l documentation counterparts, because they cover exactly the same thing.

Well, I can only suggest to use d= ifferent wording.  Since you are
describing Lisp interf= aces, some phrases will be different by
necessity, and other= s because we have a certain style when we describe
APIs (you= should be able to pick up that style by looking in the
exis= ting descriptions in the manual).

For ELisp functions, definitely, and I wasn=E2=80=99t talking about t= hat part. For query syntax and language definition syntax, because I and tre= e-sitter doc are talking about the exact same thing, it is harder. I certain= ly rephrased, and I tried to come up with different examples. I=E2=80=99m ju= st not sure if that is enough (INAL).

Perhaps it is bes= t if you can see what I=E2=80=99ve write and compare that with the official d= ocumentation. I (force) pushed the latest code to GitHub. I put the manual i= n parsing.texi. The section describing the query syntax is (elisp)Parsing Pr= ogram Source > Pattern matching. The official documentation is at https:/= /tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queri= es

What is the URL for parsing= .texi?  I don't think I have it.

=
I have it on =E2=80=9Cts=E2=80=9D branch.

https://= github.com/casouri/emacs/blob/ts/doc/lispref/parsing.texi

Thanks

Yuan
= --Apple-Mail-68269FCB-E4EE-4CCB-A657-A32AA0A65ADC--