From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#32504: [PATCH] syntax-is-{comment|string}-p Date: Thu, 30 Aug 2018 21:21:54 -0400 Message-ID: <87bm9js53h.fsf@gmail.com> References: <87o9dup3ow.fsf@gmail.com> <871sapwzbp.fsf@gmail.com> <87lg8xtexb.fsf@gmail.com> <83a7pdb2x4.fsf@gnu.org> <87d0u7n3r0.fsf@gmail.com> <87bm9ruqok.fsf@gmail.com> <87efefgbpj.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1535678477 4997 195.159.176.226 (31 Aug 2018 01:21:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 31 Aug 2018 01:21:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 32504@debbugs.gnu.org To: Alex Branham Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 31 03:21:13 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvY7b-000179-6k for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Aug 2018 03:21:11 +0200 Original-Received: from localhost ([::1]:51472 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvY9h-0006IZ-FO for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Aug 2018 21:23:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvY9X-0006C8-Ce for bug-gnu-emacs@gnu.org; Thu, 30 Aug 2018 21:23:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fvY9O-00028T-F1 for bug-gnu-emacs@gnu.org; Thu, 30 Aug 2018 21:23:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34586) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fvY9O-00027o-0Y for bug-gnu-emacs@gnu.org; Thu, 30 Aug 2018 21:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fvY9N-0002Uv-RA for bug-gnu-emacs@gnu.org; Thu, 30 Aug 2018 21:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 Aug 2018 01:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32504 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 32504-submit@debbugs.gnu.org id=B32504.15356785249510 (code B ref 32504); Fri, 31 Aug 2018 01:23:01 +0000 Original-Received: (at 32504) by debbugs.gnu.org; 31 Aug 2018 01:22:04 +0000 Original-Received: from localhost ([127.0.0.1]:39604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvY8S-0002TK-AQ for submit@debbugs.gnu.org; Thu, 30 Aug 2018 21:22:04 -0400 Original-Received: from mail-it0-f52.google.com ([209.85.214.52]:54585) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvY8Q-0002Sq-Im for 32504@debbugs.gnu.org; Thu, 30 Aug 2018 21:22:02 -0400 Original-Received: by mail-it0-f52.google.com with SMTP id f14-v6so5150902ita.4 for <32504@debbugs.gnu.org>; Thu, 30 Aug 2018 18:22:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=eDTPTQEyE5r5OAF2VpNzDfrRQDXJMmY4eQWNXckSTPQ=; b=kfbZ3j1OSKkpzLEXZL+Ph6imggk3ZxRvA+Txzy+2UgMAFl4+wlbMuXe7vqxensiYzs uBJ6Y8kTUNsXqjiLqgePmrRs1F7N0764kj8YSOVfEzbzta++KxSqyrzvnfKaII7zh+D+ wtf8/a9Loqg5tBKtQCjrKuGYH8VRRTnay6lwCRZzBrRug40KeXw6Qj1CLP46cSv2fYua 94DPXoH57iWdEfaFpBChLu53LjTOSdqMNxBxEvXeUPni+xvpJGyO/0YvSRPlXF/9IjeY /bqKgM9XK6ygzVOXEsr9zVVY0USla1luWGCGs90vNS5JK1Fu5aSt5jheLE1Y0inYL2+6 T0Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=eDTPTQEyE5r5OAF2VpNzDfrRQDXJMmY4eQWNXckSTPQ=; b=naipM0bhCWE1E1qNyNVCyIVC5Dm7q2+td51R3Szpl8Z5YT2vc4bQG+MGtoEaLx8I0S L6Jj5mBoC90In3eEnCOUZ+Kc82xIjUCx4pCWMJRtoEOHMHDhtxd5WzFYyJRo+3WAlaav 2jx7iltSl3eenDQ60fkSx3KzNdFf+QS/h3c/K2ZZ5STO4WYnFgZbnY/jDPx0jOnEPXvz rQtiZOCJyiHHITtrTejdXrVbI8oxk+0pjJdKzTiiCIB/SKlrisXrKcHLF9WcxczNbNwY SnQ/axYPIvCvdtyQPXXjjajCO9PzO2LHj/iHBTtNNy2GKjFrxUc5mdiclhy2+V1veCxc guDQ== X-Gm-Message-State: APzg51CBnXEBn+zf/GPV3I75kjtO5Vey9WkASAq39s/rcE7jRecU4BBX vCCLaLtk1dosJiR9qbxjIaZjcNFM X-Google-Smtp-Source: ANB0VdbFNOctV07gm/w/EXCow1jXCPJa1Q1aFIdk5zRmnEvGqjAX7zlnt3WSVAw1FU4UGuzc2On6Fw== X-Received: by 2002:a24:1d52:: with SMTP id 79-v6mr3682943itj.142.1535678517114; Thu, 30 Aug 2018 18:21:57 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id o22-v6sm3543475iob.4.2018.08.30.18.21.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Aug 2018 18:21:56 -0700 (PDT) In-Reply-To: <87efefgbpj.fsf@gmail.com> (Alex Branham's message of "Thu, 30 Aug 2018 09:39:52 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:149903 Archived-At: Alex Branham writes: >> (cl-defstruct (syntax-state (:constructor nil) >> (:type list)) >> depth list-start sexp-end >> string-start comment quoted ^^^^^^^^^^^^ That should be string-terminator >> min-depth comment-style comment-or-string-start >> open-parens syntax-sequence) > > I'm not a big fan of the docstrings generated by this, is there a way to > change them to be more helpful? Hmm, doesn't look like it. Well, that's just a convenient way of defining them all quickly for discussion, it wouldn't be that much harder to write out defuns I guess. > But it would be a lot better (in my eyes, anyway) if it looked something > like this, had the -p suffix, and made CL-X default to point: > Return non-nil if the syntax of CL-X is a comment. I don't think it should be a -p predicate, because there is meaningful distinction between non-nil values: 4. nil if outside a comment, t if inside a non-nestable comment, else an integer (the current comment nesting). > CL-X defaults to point. And, my intention is to operate on the return value of syntax-ppss, not give a point to call it with. So it could be used as: (syntax-state-comment (syntax-ppss)) or (let ((ppss (syntax-ppss))) (and (syntax-state-comment ppss) (syntax-state-comment-or-string-start ppss))) or (syntax-state-comment (parse-partial-sexp ...))