From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Branham Newsgroups: gmane.emacs.bugs Subject: bug#32504: [PATCH] syntax-is-{comment|string}-p Date: Thu, 30 Aug 2018 21:50:37 -0500 Message-ID: <87bm9js0zm.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> <87bm9js53h.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1535683569 4710 195.159.176.226 (31 Aug 2018 02:46:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 31 Aug 2018 02:46:09 +0000 (UTC) User-Agent: mu4e 1.0; emacs 26.1 Cc: 32504@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 31 04:46:05 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 1fvZRk-00018I-Vd for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Aug 2018 04:46:05 +0200 Original-Received: from localhost ([::1]:51636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvZTr-0002Kk-8z for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Aug 2018 22:48:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvZTh-0002JY-J6 for bug-gnu-emacs@gnu.org; Thu, 30 Aug 2018 22:48:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fvZTe-0007hh-AI for bug-gnu-emacs@gnu.org; Thu, 30 Aug 2018 22:48:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34616) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fvZTe-0007hQ-5S for bug-gnu-emacs@gnu.org; Thu, 30 Aug 2018 22:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fvZTd-0006in-VR for bug-gnu-emacs@gnu.org; Thu, 30 Aug 2018 22:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Branham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 Aug 2018 02:48: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.153568362325754 (code B ref 32504); Fri, 31 Aug 2018 02:48:01 +0000 Original-Received: (at 32504) by debbugs.gnu.org; 31 Aug 2018 02:47:03 +0000 Original-Received: from localhost ([127.0.0.1]:39634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvZSh-0006hK-HE for submit@debbugs.gnu.org; Thu, 30 Aug 2018 22:47:03 -0400 Original-Received: from mail-oi0-f52.google.com ([209.85.218.52]:47014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvZSg-0006gs-CF for 32504@debbugs.gnu.org; Thu, 30 Aug 2018 22:47:02 -0400 Original-Received: by mail-oi0-f52.google.com with SMTP id y207-v6so19139659oie.13 for <32504@debbugs.gnu.org>; Thu, 30 Aug 2018 19:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=VH4r9yxN5KEckSANnmlA/jgEWC1DqDcTesPYEU4Wn9U=; b=ZbcAoGzFWanhCWSAn3KizQdVdgV7iWuc4XzTsftB/zBGu90ldhzl4ieK95wEwqDCCR fDCauQQC5vJtHsEu6IzL8uY0adOKNNytINJU13zhan5ptT7aPLNCYL0gAYtDun8gVUPO 0eiwD3xWC8d2eyKOsK+P07//KH+9lJ5MWcXRNSpbR5O4db03DyG3e+SDp/SfLulqDBVl NcFFHs4SjV3/R03ANM7qvrL+TAnNjAc51GasJFfGHRz+1HHoYSe9Z07JPIulvBYuaTSW IEI8t5rW8SXG9AjGTS9T9JtZpxvFwMIqbHnFQAPB8eviIHlcxJTkV/VVerVZqVbJhVfg yq9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=VH4r9yxN5KEckSANnmlA/jgEWC1DqDcTesPYEU4Wn9U=; b=fC86bvtKHvYjo/lFBZdnCH1qgeWrn/mLs9FRaGHNHyfzkY0hkaDOREm6+wKvSJDjzY saH7OCnM8ED6WLa7mnfbL2fQK4SEpWW6/QwQUEO3pVE72diawmtwsrqjgYfGLtmZqnpT QxPdbbpcPw5RzwAHRpQ05LVoW12kd6UgcaKXgSUnf/6/KPUQH3tR2daYQYfHgwB8SLqP mWY9dcnNpbMtjyz83IUcR8VAoWtmCKPfPHTROcOQqjhH1YHtmWTTAVf+QpsUeCHTnT15 Rs7aCyP1G1+4e2Apf6JWEPtmd1dvnjKjqfXrzDJ83GQjVE8SvcgnDj4NvOWEnXMvlFrl 9WQg== X-Gm-Message-State: APzg51A/4tSL+pV6FTVt+w7fK8wnw9WafrNlLkdDy9PuDaDszuuMFb/x a7FTueGZ3NX1b8jGcPth75qPoUfV X-Google-Smtp-Source: ANB0VdYeEZkmDAoj84uQjqNb/R60dM+wxhVn3YqKc2NmXU8RQXpKcllM43j/pV+FSDS4XTlYXcoBMg== X-Received: by 2002:aca:4d56:: with SMTP id a83-v6mr4870718oib.205.1535683616567; Thu, 30 Aug 2018 19:46:56 -0700 (PDT) Original-Received: from mars (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id r10-v6sm10306960oif.37.2018.08.30.19.46.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Aug 2018 19:46:55 -0700 (PDT) In-reply-to: <87bm9js53h.fsf@gmail.com> 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:149907 Archived-At: On Thu 30 Aug 2018 at 20:21, Noam Postavsky wrote: >> 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. Fair enough. > 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). That makes sense, but the -p predicate seems more discoverable to me. We can always note in the docstring that the actual return value is usable. I don't have a super strong opinion though. >> 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 ...)) Right, but whenever I want to call on these functions, 90% of the time the question I'm trying to answer is "Is point in a comment/string?" And the 3rd party ***-is-comment/string-p functions I've looked at usually (always?) look at positions. Thanks, Alex