From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 22 16:19:54 2018 Received: (at submit) by debbugs.gnu.org; 22 Aug 2018 20:19:54 +0000 Received: from localhost ([127.0.0.1]:58046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsZbb-0003jy-Rh for submit@debbugs.gnu.org; Wed, 22 Aug 2018 16:19:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsZbZ-0003jj-4u for submit@debbugs.gnu.org; Wed, 22 Aug 2018 16:19:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsZbR-0003Zd-4H for submit@debbugs.gnu.org; Wed, 22 Aug 2018 16:19:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59399) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsZbN-0003Y3-Q2 for submit@debbugs.gnu.org; Wed, 22 Aug 2018 16:19:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsZbK-0007EN-Fs for bug-gnu-emacs@gnu.org; Wed, 22 Aug 2018 16:19:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsZNr-00039x-ST for bug-gnu-emacs@gnu.org; Wed, 22 Aug 2018 16:05:42 -0400 Received: from mail-oi0-x231.google.com ([2607:f8b0:4003:c06::231]:34156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fsZNr-00039l-Gt for bug-gnu-emacs@gnu.org; Wed, 22 Aug 2018 16:05:39 -0400 Received: by mail-oi0-x231.google.com with SMTP id 13-v6so5361528ois.1 for ; Wed, 22 Aug 2018 13:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=CZ5khE9WPz9OSl885R2DBo9emQC/bttzwxUvxNOrxpE=; b=k60szJLe1xzxMZzR3pR7nt+ABcRqep9hOmpW6F7WoQnXOvFUqXv+drlOdNSV9u0Ccr XpS8qrIFBuR+u+zLGYSj/udnfVfYkVQTxdkBJMOAs5EqVGT0ayAdJrioafKu2V2NYnAX D6WgW8zUUbtD0aG26F5x3vONwC2KVelbxiN09+Aab6r7xOS4h2wlLkh7Ciaml7NQMF4I OxnXt46tA+oWIHwcX3eXlg/AY7N2dEWx/+0Dr78fIvEgzeNC/3kfxMJ5bBI4tfJYy15v iODQwRghieaFLbGtjI5chU4NPnpYaZ9r1m782hSbyI2x3dTHSplul+UuCqnhBZ5+3Uyd 7SKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=CZ5khE9WPz9OSl885R2DBo9emQC/bttzwxUvxNOrxpE=; b=tQJNZYlpS2EAhfD2wVkdcb+2jbQKtgIvIibxCtGD6j0+48YEF3MYFV3bOfMDjV9DYk LZ6INupO7JRGAx1XWmYq+B1LqQCob/RHSsPFjU2owJ/+bK78q0Njr4u4vkDx+YtTwA0q xZs/6fZZ1KjW0G7gjjWVw5AOK043tH0BD2YW8rC1V+I33pT1a5UNHDknEPhtNVFASqq9 EBIsZPAsqy0tIT66cFtXxqSkdVgk4xUVt2TMMAQi7gxfxM+yDdQSoOnVykBJJcJb6+rh iyxRp8po7pc4M0PfszXGp694XGuwRGFlmnAXOP87GC5PxcmAUXmK36UXdmEUzIyX93vw 2PYg== X-Gm-Message-State: APzg51Ag8PRMtTw9Q86gYG3IUTOxmE1Q86vWH5H44+EhfnTUj4jtM0Bg /Knlhz+bFN9HBDo1u08brrW2tsd3 X-Google-Smtp-Source: ANB0VdY3gpyfD3DQ1ErxInwyIKR70m/nW9/Zu4UTRfQwRQPwpI9JWhWuOyAGuFRmhNzr9M9ph7pAMg== X-Received: by 2002:aca:56d1:: with SMTP id k200-v6mr5858527oib.319.1534968338278; Wed, 22 Aug 2018 13:05:38 -0700 (PDT) Received: from earth (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id s145-v6sm4604510oih.16.2018.08.22.13.05.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Aug 2018 13:05:37 -0700 (PDT) User-agent: mu4e 1.0; emacs 26.1 From: Alex Branham To: bug-gnu-emacs@gnu.org Subject: [PATCH] syntax-is-{comment|string}-p Date: Wed, 22 Aug 2018 15:05:35 -0500 Message-ID: <87o9dup3ow.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain Hello - I got tired of checking/remembering whether (nth 3 (syntax-ppss)) was a string or a comment, so I've created two simple functions that wrap that in a more descriptive name. I've noticed that there are a handful of these that other modes have written, so evidently others wanted them as well at some point. There are two patches attached. The first creates new functions syntax-is-comment-p and syntax-is-string-p. The second changes most of the uses of (nth 3 (syntax-ppss)) and (nth 4 (syntax-ppss)) to use these new functions. I'm attaching it as a separate patch since I'm not sure if yall will want it or not; it's easy to squash if you do. Thanks, Alex ------------------------------------------------------------ >From 393f55de705513f5514a3e0250d81053e838c447 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Wed, 22 Aug 2018 14:44:26 -0500 Subject: [PATCH 1/2] Add new functions syntax-is-{comment|string}-p * lisp/emacs-lisp/syntax.el (syntax-is-comment-p, syntax-is-string-p): New functions * doc/lispref/syntax.texi: Add documentation for new functions --- doc/lispref/syntax.texi | 10 ++++++++++ etc/NEWS | 4 ++++ lisp/emacs-lisp/syntax.el | 12 ++++++++++++ 3 files changed, 26 insertions(+) diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index dcfade3f67..e6220e5cf9 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi @@ -790,6 +790,16 @@ Position Parse Hooks}). @end defun +@defun syntax-is-comment-p &optional pos +This function returns non-nil when @code{POS} (which defaults to +point) is in a comment accord to @code{syntax-ppss} +@end defun + +@defun syntax-is-string-p &optional pos +This function returns non-nil when @code{POS} (which defaults to +point) is in a string accord to @code{syntax-ppss} +@end defun + @node Parser State @subsection Parser State @cindex parser state diff --git a/etc/NEWS b/etc/NEWS index d757f52466..e138105e72 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -963,6 +963,10 @@ versions. The new variable 'comment-use-syntax-ppss' can be set to nil to recover the old behavior if needed. +** New functions 'syntax-is-comment-p' and 'syntax-is-string-p'. +These can be used as a shorthand instead of checking, for example, +(nth 3 (syntax-ppss)). + ** The 'server-name' and 'server-socket-dir' variables are set when a socket has been passed to Emacs. diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index ad1a9665ff..2a262c6036 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -616,6 +616,18 @@ syntax-ppss ;; a nil state. (parse-partial-sexp (point-min) pos)))))) +(defun syntax-is-comment-p (&optional pos) + "Return non-nil if POS is inside a comment. +POS defaults to `point'." + (let ((pos (or pos (point)))) + (nth 4 (syntax-ppss pos)))) + +(defun syntax-is-string-p (&optional pos) + "Return non-nil if POS is inside a string. +POS defaults to `point'." + (let ((pos (or pos (point)))) + (nth 3 (syntax-ppss pos)))) + ;; Debugging functions (defun syntax-ppss-debug () -- 2.18.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-new-functions-syntax-is-comment-string-p.patch >From 393f55de705513f5514a3e0250d81053e838c447 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Wed, 22 Aug 2018 14:44:26 -0500 Subject: [PATCH 1/2] Add new functions syntax-is-{comment|string}-p * lisp/emacs-lisp/syntax.el (syntax-is-comment-p, syntax-is-string-p): New functions * doc/lispref/syntax.texi: Add documentation for new functions --- doc/lispref/syntax.texi | 10 ++++++++++ etc/NEWS | 4 ++++ lisp/emacs-lisp/syntax.el | 12 ++++++++++++ 3 files changed, 26 insertions(+) diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index dcfade3f67..e6220e5cf9 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi @@ -790,6 +790,16 @@ Position Parse Hooks}). @end defun +@defun syntax-is-comment-p &optional pos +This function returns non-nil when @code{POS} (which defaults to +point) is in a comment accord to @code{syntax-ppss} +@end defun + +@defun syntax-is-string-p &optional pos +This function returns non-nil when @code{POS} (which defaults to +point) is in a string accord to @code{syntax-ppss} +@end defun + @node Parser State @subsection Parser State @cindex parser state diff --git a/etc/NEWS b/etc/NEWS index d757f52466..e138105e72 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -963,6 +963,10 @@ versions. The new variable 'comment-use-syntax-ppss' can be set to nil to recover the old behavior if needed. +** New functions 'syntax-is-comment-p' and 'syntax-is-string-p'. +These can be used as a shorthand instead of checking, for example, +(nth 3 (syntax-ppss)). + ** The 'server-name' and 'server-socket-dir' variables are set when a socket has been passed to Emacs. diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index ad1a9665ff..2a262c6036 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -616,6 +616,18 @@ syntax-ppss ;; a nil state. (parse-partial-sexp (point-min) pos)))))) +(defun syntax-is-comment-p (&optional pos) + "Return non-nil if POS is inside a comment. +POS defaults to `point'." + (let ((pos (or pos (point)))) + (nth 4 (syntax-ppss pos)))) + +(defun syntax-is-string-p (&optional pos) + "Return non-nil if POS is inside a string. +POS defaults to `point'." + (let ((pos (or pos (point)))) + (nth 3 (syntax-ppss pos)))) + ;; Debugging functions (defun syntax-ppss-debug () -- 2.18.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Prefer-using-new-syntax-is-comment-string-p-function.patch >From eff51e05fef4d452e52c81ed7259b51612d7917a Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Wed, 22 Aug 2018 14:51:58 -0500 Subject: [PATCH 2/2] Prefer using new syntax-is-{comment|string}-p functions * lisp/emacs-lisp/smie.el: * lisp/ffap.el: * lisp/progmodes/js.el: * lisp/progmodes/meta-mode.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/pascal.el: * lisp/progmodes/perl-mode.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/simple.el: * lisp/textmodes/tex-mode.el: * lisp/thingatpt.el: * lisp/vc/smerge-mode.el: Use new syntax-is-{comment|string}-p functions rather than checking (nth 3|4 (syntax-ppss)) --- lisp/emacs-lisp/smie.el | 8 ++++---- lisp/ffap.el | 2 +- lisp/progmodes/js.el | 4 ++-- lisp/progmodes/meta-mode.el | 4 ++-- lisp/progmodes/octave.el | 10 ++++------ lisp/progmodes/opascal.el | 2 +- lisp/progmodes/pascal.el | 2 +- lisp/progmodes/perl-mode.el | 4 ++-- lisp/progmodes/prolog.el | 4 ++-- lisp/progmodes/ruby-mode.el | 2 +- lisp/progmodes/sh-script.el | 10 +++++----- lisp/simple.el | 2 +- lisp/textmodes/tex-mode.el | 4 ++-- lisp/thingatpt.el | 12 +++--------- lisp/vc/smerge-mode.el | 2 +- 15 files changed, 32 insertions(+), 40 deletions(-) diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index c01a40172b..a82a6e2c99 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -1644,7 +1644,7 @@ smie-indent-comment-continue (let ((continue (and comment-continue (comment-string-strip comment-continue t t)))) (and (< 0 (length continue)) - (looking-at (regexp-quote continue)) (nth 4 (syntax-ppss)) + (looking-at (regexp-quote continue)) (syntax-is-comment-p) (let ((ppss (syntax-ppss))) (save-excursion (forward-line -1) @@ -1660,7 +1660,7 @@ smie-indent-comment-close (not (looking-at " \t*$")) ;Not just a \n comment-closer. (looking-at comment-end-skip) (let ((end (match-string 0))) - (and (nth 4 (syntax-ppss)) + (and (syntax-is-comment-p) (save-excursion (goto-char (nth 8 (syntax-ppss))) (and (looking-at comment-start-skip) @@ -1674,11 +1674,11 @@ smie-indent-comment-close (current-column))))))))) (defun smie-indent-comment-inside () - (and (nth 4 (syntax-ppss)) + (and (syntax-is-comment-p) 'noindent)) (defun smie-indent-inside-string () - (and (nth 3 (syntax-ppss)) + (and (syntax-is-string-p) 'noindent)) (defun smie-indent-after-keyword () diff --git a/lisp/ffap.el b/lisp/ffap.el index b51929d260..5272735147 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1161,7 +1161,7 @@ ffap-string-at-point (null region-selected) ;; Check if END character is part of a comment. (save-excursion - (nth 4 (syntax-ppss end)))) + (syntax-is-comment-p end))) ;; Move BEG to beginning of comment (after the comment start ;; characters), or END, whichever comes first. (save-excursion diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index f30e591b15..49020fec05 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -1837,7 +1837,7 @@ js--continued-expression-p (if (js--looking-at-operator-p) (if (eq (char-after) ?/) (prog1 - (not (nth 3 (syntax-ppss (1+ (point))))) + (not (syntax-is-string-p (1+ (point)))) (forward-char -1)) (or (not (memq (char-after) '(?- ?+))) @@ -1982,7 +1982,7 @@ js--multi-line-declaration-indentation (when (looking-at js--indent-operator-re) (goto-char (match-end 0))) ;; The "operator" is probably a regexp literal opener. - (when (nth 3 (syntax-ppss)) + (when (syntax-is-string-p) (goto-char pt))) (while (and (not at-opening-bracket) (not (bobp)) diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index e207d22ff4..2475867adc 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el @@ -562,7 +562,7 @@ meta-indent-calculate (defun meta-indent-in-string-p () "Tell if the point is in a string." - (or (nth 3 (syntax-ppss)) + (or (syntax-is-string-p) (eq (get-text-property (point) 'face) font-lock-string-face))) (defun meta-indent-looking-at-code (regexp) @@ -636,7 +636,7 @@ meta-indent-current-nesting nil t) ;; If we aren't in a string or in a comment, we've found something. (unless (or (meta-indent-in-string-p) - (nth 4 (syntax-ppss))) + (syntax-is-comment-p)) (cond ((= (char-after) ?\() (setq to-add (+ to-add meta-indent-level))) ((= (char-after) ?\)) diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 984bb73c73..ec4eaa5fe5 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -995,13 +995,11 @@ inferior-octave-track-window-width-change ;;; Miscellaneous useful functions -(defun octave-in-comment-p () - "Return non-nil if point is inside an Octave comment." - (nth 4 (syntax-ppss))) +(defalias 'octave-in-comment-p 'syntax-is-comment-p + "Return non-nil if point is inside an Octave comment.") -(defun octave-in-string-p () - "Return non-nil if point is inside an Octave string." - (nth 3 (syntax-ppss))) +(defalias 'octave-in-string-p 'syntax-is-string-p + "Return non-nil if point is inside an Octave string.") (defun octave-in-string-or-comment-p () "Return non-nil if point is inside an Octave string or comment." diff --git a/lisp/progmodes/opascal.el b/lisp/progmodes/opascal.el index 4606621951..7f5f5f4dea 100644 --- a/lisp/progmodes/opascal.el +++ b/lisp/progmodes/opascal.el @@ -1705,7 +1705,7 @@ opascal--syntax-propertize ("(\\(\\/\\)" (1 (prog1 ". 1c" (forward-char -1) nil))) ;; Pascal uses '' and "" rather than \' and \" to escape quotes. ("''\\|\"\"" (0 (if (save-excursion - (nth 3 (syntax-ppss (match-beginning 0)))) + (syntax-is-string-p (match-beginning 0))) (string-to-syntax ".") ;; In case of 3 or more quotes in a row, only advance ;; one quote at a time. diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el index 6d13d328c5..f196bcdeb4 100644 --- a/lisp/progmodes/pascal.el +++ b/lisp/progmodes/pascal.el @@ -190,7 +190,7 @@ pascal--syntax-propertize ("(\\(\\/\\)" (1 (prog1 ". 1c" (forward-char -1) nil))) ;; Pascal uses '' and "" rather than \' and \" to escape quotes. ("''\\|\"\"" (0 (if (save-excursion - (nth 3 (syntax-ppss (match-beginning 0)))) + (syntax-is-string-p (match-beginning 0))) (string-to-syntax ".") ;; In case of 3 or more quotes in a row, only advance ;; one quote at a time. diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index b96aad7a6e..a217d4f85a 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -231,8 +231,8 @@ perl-syntax-propertize-function ;; check that it occurs inside a '..' string. ("\\(\\$\\)[{']" (1 (unless (and (eq ?\' (char-after (match-end 1))) (save-excursion - (not (nth 3 (syntax-ppss - (match-beginning 0)))))) + (not (syntax-is-string-p + (match-beginning 0))))) (string-to-syntax ". p")))) ;; Handle funny names like $DB'stop. ("\\$ ?{?^?[_[:alpha:]][_[:alnum:]]*\\('\\)[_[:alpha:]]" (1 "_")) diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index a895a77796..23aed9bafe 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -2291,7 +2291,7 @@ prolog-guess-fill-prefix ;; fill 'txt entities? (when (save-excursion (end-of-line) - (nth 4 (syntax-ppss))) + (syntax-is-comment-p)) (let* ((bounds (prolog-comment-limits)) (cbeg (car bounds)) (type (nth 2 bounds)) @@ -2755,7 +2755,7 @@ prolog-get-predspec (let ((state (prolog-clause-info)) (object (prolog-in-object))) (if (or (equal (nth 0 state) "") - (nth 4 (syntax-ppss))) + (syntax-is-comment-p)) nil (if (and (eq prolog-system 'sicstus) object) diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index fad7bc1fb8..abc66d3f85 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1849,7 +1849,7 @@ ruby-syntax-propertize ;; ?' ?" ?` are character literals (one-char strings in 1.9+). ("\\([?$]\\)[#\"'`:?]" (1 (if (save-excursion - (nth 3 (syntax-ppss (match-beginning 0)))) + (syntax-is-string-p (match-beginning 0))) ;; Within a string, skip. (ignore (goto-char (match-end 1))) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index aaa86b5816..26c276504c 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1882,7 +1882,7 @@ sh-smie-sh-forward-token (save-excursion (skip-chars-backward " \t") (not (bolp)))) - (if (and (match-end 1) (not (nth 3 (syntax-ppss)))) + (if (and (match-end 1) (not (syntax-is-string-p))) ;; Right before a here-doc. (let ((forward-sexp-function nil)) (forward-sexp 1) @@ -1931,7 +1931,7 @@ sh-smie-sh-backward-token (cond ((and (bolp) (not (bobp)) (equal (syntax-after (1- (point))) (string-to-syntax "|")) - (not (nth 3 (syntax-ppss)))) + (not (syntax-is-string-p))) ;; Right after a here-document. (let ((forward-sexp-function nil)) (forward-sexp -1) @@ -2169,7 +2169,7 @@ sh-smie-rc-forward-token (save-excursion (skip-chars-backward " \t") (not (bolp)))) - (if (and (match-end 1) (not (nth 3 (syntax-ppss)))) + (if (and (match-end 1) (not (syntax-is-string-p))) ;; Right before a here-doc. (let ((forward-sexp-function nil)) (forward-sexp 1) @@ -2211,7 +2211,7 @@ sh-smie-rc-backward-token (cond ((and (bolp) (not (bobp)) (equal (syntax-after (1- (point))) (string-to-syntax "|")) - (not (nth 3 (syntax-ppss)))) + (not (syntax-is-string-p))) ;; Right after a here-document. (let ((forward-sexp-function nil)) (forward-sexp -1) @@ -2827,7 +2827,7 @@ sh-get-indent-info ;; Note: setting result to t means we are done and will return nil. ;;(This function never returns just t.) (cond - ((or (nth 3 (syntax-ppss (point))) + ((or (syntax-is-string-p) (eq (get-text-property (point) 'face) 'sh-heredoc)) ;; String continuation -- don't indent (setq result t) diff --git a/lisp/simple.el b/lisp/simple.el index 0ccf2f1d22..fb44c4fac9 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -7264,7 +7264,7 @@ internal-auto-fill "The function called by `self-insert-command' to perform auto-filling." (when (or (not comment-start) (not comment-auto-fill-only-comments) - (nth 4 (syntax-ppss))) + (syntax-is-comment-p)) (funcall auto-fill-function))) (defvar normal-auto-fill-function 'do-auto-fill diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index c223af4769..b6ebc1e3be 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1328,7 +1328,7 @@ tex-insert-quote ;; (if (or arg (memq (char-syntax (preceding-char)) '(?/ ?\\)) (eq (get-text-property (point) 'face) 'tex-verbatim) - (nth 4 (syntax-ppss)) ; non-nil if point is in a TeX comment + (syntax-is-comment-p) ;; Discover if a preceding occurrence of `tex-open-quote' ;; should be morphed to a normal double quote. ;; @@ -1487,7 +1487,7 @@ tex-handle-newline unless prefix arg INHIBIT-VALIDATION is non-nil to inhibit the checking. Otherwise (in a comment), just insert a single continued comment line." (interactive "*P") - (if (nth 4 (syntax-ppss)) ; non-nil if point is in a TeX comment + (if (syntax-is-comment-p) (comment-indent-new-line) (tex-terminate-paragraph inhibit-validation))) diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 679401eef1..41185a778e 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -180,19 +180,13 @@ end-of-thing ;; Sexps -(defun in-string-p () - "Return non-nil if point is in a string." - (declare (obsolete "use (nth 3 (syntax-ppss)) instead." "25.1")) - (let ((orig (point))) - (save-excursion - (beginning-of-defun) - (nth 3 (parse-partial-sexp (point) orig))))) +(define-obsolete-function-alias 'in-string-p 'syntax-is-string-p "25.1") (defun thing-at-point--end-of-sexp () "Move point to the end of the current sexp." (let ((char-syntax (syntax-after (point)))) (if (or (eq char-syntax ?\)) - (and (eq char-syntax ?\") (nth 3 (syntax-ppss)))) + (and (eq char-syntax ?\") (syntax-is-string-p))) (forward-char 1) (forward-sexp 1)))) @@ -206,7 +200,7 @@ thing-at-point--beginning-of-sexp "Move point to the beginning of the current sexp." (let ((char-syntax (char-syntax (char-before)))) (if (or (eq char-syntax ?\() - (and (eq char-syntax ?\") (nth 3 (syntax-ppss)))) + (and (eq char-syntax ?\") (syntax-is-string-p))) (forward-char -1) (forward-sexp -1)))) diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index ff41473435..056bb4f46d 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -621,7 +621,7 @@ smerge-resolve ;; Idem, when the conflict is contained within a single comment. ((save-excursion (and m2e - (nth 4 (syntax-ppss m0b)) + (syntax-is-comment-p m0b) ;; If there's a conflict earlier in the file, ;; syntax-ppss is not reliable. (not (re-search-backward smerge-begin-re nil t)) -- 2.18.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 22 23:12:54 2018 Received: (at 32504) by debbugs.gnu.org; 23 Aug 2018 03:12:54 +0000 Received: from localhost ([127.0.0.1]:58226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsg3K-00026p-DI for submit@debbugs.gnu.org; Wed, 22 Aug 2018 23:12:54 -0400 Received: from mail-it0-f49.google.com ([209.85.214.49]:54030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsg3G-00026a-AC for 32504@debbugs.gnu.org; Wed, 22 Aug 2018 23:12:52 -0400 Received: by mail-it0-f49.google.com with SMTP id k188-v6so1059282itk.3 for <32504@debbugs.gnu.org>; Wed, 22 Aug 2018 20:12:50 -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=MHjF/m4gAV2E1ouXsuK8luSuBmVYTzp5EaiE2HYrVVM=; b=AWcvMSgaPGFDjlTCywincLFMJxjyVsyl/13K59CLeJT1/ZlGoMDAa6eUoGau9Yw+uw tLOcuPYO4WvdTig4rHBLQFc32WjWVO9xN0DfTTl4oB1t6A+ehHPoUOC2Y77ptrDVc2xa 6MpSt2dlSf4MbsPmGRvoj9ZKn5x9o2yQIKFvWSPSqohWjfE/2a7uOc4Lw+D0r0DxFhi5 yLKGIsVgspS7ppVyqSoQhsc3Pa6dvSCFHYWCRbJQYi5eC50+8YUBxyySsc4JTGqPKv6z 0emRM8Pi5JyJyWeJhxXk1zYH0/XoaZUTAZTvHC0bhJnOBigJLWAlsCQncdZVW1zULoHs 5kyQ== 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=MHjF/m4gAV2E1ouXsuK8luSuBmVYTzp5EaiE2HYrVVM=; b=MeAzGxYbXkoqDud+Qw14OJZe/JTMmQy15o4ZzdLRMXmsU1KiD2Vp1CiiZtf4eIo/kY 8Lvmro9OoD8eby49pGO3ogZ7fU6Br0Lu7FP5PCD4UTpzqHzQ6VsJGdc9HlNWWW4MzPlH nLmc2DthZ5SGox/pit7KyhgEb6L3RCNlzqghusxUHj7W4XRkZIR7jnxvlheh+/pL8lCH Yr6cSx5aiMozTzVzuyAazZUUgmQ1xBI6KUF2+6xuJmRIMUbEjOcc3NlPct7svpFKymBJ QC0XbVZv4V8QPzQxdXul+tzALv+JoEDHF8w5Ykh2ucb4k9Ge3by7uQwizyyt8sHW3VqI 2ZOQ== X-Gm-Message-State: APzg51BBef+syDUCS/9I0VvNbYquUJ5sZ0AMNFe26ebzsecnAcvi+UB8 hn+4AUcmWdvAX92ZllYFhXFSS9PE X-Google-Smtp-Source: ANB0Vdazs1cxTRzedTvGHR6ZoRkOPe8PU+yh+0mE7WrPSxFwGPw4ILUN4D5/bBloCHxCnmnafwVgBQ== X-Received: by 2002:a24:cb02:: with SMTP id u2-v6mr5732860itg.107.1534993964412; Wed, 22 Aug 2018 20:12:44 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id v14-v6sm259170iog.42.2018.08.22.20.12.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Aug 2018 20:12:43 -0700 (PDT) From: Noam Postavsky To: Alex Branham Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p References: <87o9dup3ow.fsf@gmail.com> Date: Wed, 22 Aug 2018 23:12:42 -0400 In-Reply-To: <87o9dup3ow.fsf@gmail.com> (Alex Branham's message of "Wed, 22 Aug 2018 15:05:35 -0500") Message-ID: <871sapwzbp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32504 Cc: 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alex Branham writes: > I got tired of checking/remembering whether (nth 3 (syntax-ppss)) was a > string or a comment, so I've created two simple functions that wrap that > in a more descriptive name. I've noticed that there are a handful of > these that other modes have written, so evidently others wanted them as > well at some point. What about syntax-ppss-context in syntax.el? From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 23 09:01:46 2018 Received: (at 32504) by debbugs.gnu.org; 23 Aug 2018 13:01:46 +0000 Received: from localhost ([127.0.0.1]:58349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fspFC-0003VK-Eb for submit@debbugs.gnu.org; Thu, 23 Aug 2018 09:01:46 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:40654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fspFA-0003V8-SF for 32504@debbugs.gnu.org; Thu, 23 Aug 2018 09:01:45 -0400 Received: by mail-oi0-f49.google.com with SMTP id l202-v6so2180911oig.7 for <32504@debbugs.gnu.org>; Thu, 23 Aug 2018 06:01:44 -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=B7lZMHQsdXconY0v5CrVnHVcvtvjL+ltDYA+X3ic9ik=; b=eHHuiRMkidXtM6Tb9zG0P1FA8LTRGGZMhfmkG9/GvLTZaUIBkctaNpogM7rOeJz2V+ eikNWBgQQ+kHwboF+CLzwf1uHD+Wpgin3QYa2O0FqESJAkRB+Au9+FYVn7AUnbDctFGe +Czl2Iz2IfQnGY1G8TLDiL8rs+sa+F53QvJNgZKp5oFvGpUxZXZ4I6ZcnWc20taHz7Ue 4NCU9LbKNp4pS1u+RonZ4tKKUIzSh5YEpP21yvSEfCYzlxkhi6nJ5eH4s0dqxJR+9JAZ at3VbJPghCr0fZbcDG7U+TVJoaoJ+8XP+47KnFimu1TjK6GrZZjxNkaSKF6ZlbWg5S+H MiKA== 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=B7lZMHQsdXconY0v5CrVnHVcvtvjL+ltDYA+X3ic9ik=; b=e3EwAgqzJLiFBHYt8FvR/uZZh+I7OKXVovy0KnBO6TzyvOs4uhVoaBrs6SFZ8RbdBK kzdeYgsIp2V9ip4lbxhXV/UuXfLViu/BlGbO196a06e6pcm372FWq5gAAF5FJKmE4K98 0xdSQ5gy7JLo7nuiJ7Ou/tysFbW4iLyut+mj6C6SaShNw2zrinX6cQ3xKtoVVtxsLu/h 44RTbKj6iFbtj4wB+8AlS61CuaYbbEGIe82YzukZ5woq9+xpW/MyneuHOHoaPXNhy+1+ uNy+ZKAYwwXncaJaSQGFBJi5ZtUxIu9YpEwFI+KEa0P1Gzlusd73xKaZ4LpWWJ7UW1R6 epeQ== X-Gm-Message-State: APzg51AYC1udjf+vk1M/vtX/Kv8KAzlLl8deiZgGj4r3sZC5vhbxUVb1 cXKfgs4eQCVhkg/wt1GznF7JwDN+ X-Google-Smtp-Source: ANB0VdbwFKFbtF2YuodenbBypd9mRsGT7b/ddtTbBALI+Hkgidv/uRyWBT3hNebp2KktqvUfuJts6g== X-Received: by 2002:aca:de08:: with SMTP id v8-v6mr8990000oig.124.1535029298778; Thu, 23 Aug 2018 06:01:38 -0700 (PDT) Received: from earth (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id w84-v6sm2510432oie.40.2018.08.23.06.01.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Aug 2018 06:01:38 -0700 (PDT) References: <87o9dup3ow.fsf@gmail.com> <871sapwzbp.fsf@gmail.com> User-agent: mu4e 1.0; emacs 26.1 From: Alex Branham To: Noam Postavsky Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p In-reply-to: <871sapwzbp.fsf@gmail.com> Date: Thu, 23 Aug 2018 08:01:36 -0500 Message-ID: <87lg8xtexb.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32504 Cc: 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed 22 Aug 2018 at 22:12, Noam Postavsky wrote: > Alex Branham writes: > >> I got tired of checking/remembering whether (nth 3 (syntax-ppss)) was a >> string or a comment, so I've created two simple functions that wrap that >> in a more descriptive name. I've noticed that there are a handful of >> these that other modes have written, so evidently others wanted them as >> well at some point. > > What about syntax-ppss-context in syntax.el? Thanks, I didn't know about syntax-ppss-context. It doesn't seem to be documented anywhere. I think I still slightly prefer having these two functions since when searching for something like "syntax string" syntax-is-string-p will pop up but syntax-ppss-context won't. Thanks again, Alex From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 23 09:58:39 2018 Received: (at 32504) by debbugs.gnu.org; 23 Aug 2018 13:58:39 +0000 Received: from localhost ([127.0.0.1]:58958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsq8F-00052O-Er for submit@debbugs.gnu.org; Thu, 23 Aug 2018 09:58:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsq8E-00052C-CH for 32504@debbugs.gnu.org; Thu, 23 Aug 2018 09:58:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsq86-0001p6-J8 for 32504@debbugs.gnu.org; Thu, 23 Aug 2018 09:58:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsq86-0001oh-Ek; Thu, 23 Aug 2018 09:58:30 -0400 Received: from [176.228.60.248] (port=4163 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fsq86-0006x9-2J; Thu, 23 Aug 2018 09:58:30 -0400 Date: Thu, 23 Aug 2018 16:58:15 +0300 Message-Id: <83a7pdb2x4.fsf@gnu.org> From: Eli Zaretskii To: Alex Branham In-reply-to: <87lg8xtexb.fsf@gmail.com> (message from Alex Branham on Thu, 23 Aug 2018 08:01:36 -0500) Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p References: <87o9dup3ow.fsf@gmail.com> <871sapwzbp.fsf@gmail.com> <87lg8xtexb.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32504 Cc: npostavs@gmail.com, 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Alex Branham > Date: Thu, 23 Aug 2018 08:01:36 -0500 > Cc: 32504@debbugs.gnu.org > > > What about syntax-ppss-context in syntax.el? > > Thanks, I didn't know about syntax-ppss-context. It doesn't seem to be > documented anywhere. If it's useful, we could document it. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 23 19:18:57 2018 Received: (at 32504) by debbugs.gnu.org; 23 Aug 2018 23:18:57 +0000 Received: from localhost ([127.0.0.1]:59174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsysR-00026E-1l for submit@debbugs.gnu.org; Thu, 23 Aug 2018 19:18:57 -0400 Received: from smtp-3.orcon.net.nz ([60.234.4.44]:35531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsysO-000264-GF for 32504@debbugs.gnu.org; Thu, 23 Aug 2018 19:18:53 -0400 Received: from [10.253.37.70] (port=59030 helo=webmail.orcon.net.nz) by smtp-3.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1fsysL-00081E-QS; Fri, 24 Aug 2018 11:18:49 +1200 Received: from wlgwil-nat-office.catalyst.net.nz ([202.78.240.7]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Fri, 24 Aug 2018 11:18:49 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 24 Aug 2018 11:18:49 +1200 From: Phil Sainty To: Alex Branham Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p In-Reply-To: <87lg8xtexb.fsf@gmail.com> References: <87o9dup3ow.fsf@gmail.com> <871sapwzbp.fsf@gmail.com> <87lg8xtexb.fsf@gmail.com> Message-ID: <44e3dd5a61a4bd8e34cf6ca5246ef6cc@webmail.orcon.net.nz> X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32504 Cc: bug-gnu-emacs , Noam Postavsky , 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Note also the "Todo" item in syntax.el: ;; - new functions `syntax-state', ... to replace uses of parse-partial-state ;; with something higher-level (similar to syntax-ppss-context). Presumably that comment should be removed in any patch for this bug. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 24 12:11:58 2018 Received: (at 32504) by debbugs.gnu.org; 24 Aug 2018 16:11:58 +0000 Received: from localhost ([127.0.0.1]:59914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftEgo-00036X-06 for submit@debbugs.gnu.org; Fri, 24 Aug 2018 12:11:58 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:38154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftEgm-00036J-3x for 32504@debbugs.gnu.org; Fri, 24 Aug 2018 12:11:56 -0400 Received: by mail-oi0-f41.google.com with SMTP id z185-v6so15767563oia.5 for <32504@debbugs.gnu.org>; Fri, 24 Aug 2018 09:11:56 -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=XaYKLkXIO+K5RjS78wC0mXDQE0b9/2Eh2+hZSRDsBFs=; b=YrGxeqfz70H/CYyIYuGbAcSTVHIzTBWdwv0s9YjcOqackMvbgPyDscZjuIISmQ+cr8 MR3nk7SLSHyLpuRyrH4O83xzUpgz1JuMAlU9kCEfjCzNSrPT8RAuE5Y0TyEaohdRhBiG 08Hpxsp8ZbEyKGYvadg10i6CdUWd9FSKJSTk9pKSw2CPyp9qgtPFjdC/Z71g6U6INJnP CKYHTbeOftiB0zZzj6sd/873YMCu0HKFRgiC4lp+8EwJ14mvgmUOLfwk515J3Z8FhP3v LMK8rh9k31vY93kO2ODkBvO5XU/eep0EvVWOq7lfYHA8mXiRUIf/FxuN5xERBldZb5mQ SJ7w== 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=XaYKLkXIO+K5RjS78wC0mXDQE0b9/2Eh2+hZSRDsBFs=; b=OoI5P/8AmT4THUo6HkMGdByA6IxrTLxjsqKttNYoOZpNwYEQbUSbStRkOaC0K97TPW xTFU/HMSFM8wA2cAp1U0/HPMw+jGH2mIqIUJbhiAScHPlifNIpcUUFCyqkoMvxzDY838 9jLDi3J1w+Q94NNO8cDftBK3VCkk9vrV6tzBH3PRj1bUqPvj9v2w/L5pp/A/BmBjjgjb fqoi1ZYSpv7fH11z8sO/zHzTLapOV5M7887KGmoQ7n3IL4uNZ5QLB3hwSOfyoOIDfW5/ lQkluHC/9AhmcoO3xCFEFHxxyRvJIvjDR9HmxyHwQxw4gJkL6dY4y55bcIUU4tji6D6T 8MxA== X-Gm-Message-State: APzg51BKxXVzYBBw89MMVckwDDjPzwLroVnMaXw8SLig6pttQdgTCKB5 cGyKEahH6wYmWXKIBZp5Nz55JSQW X-Google-Smtp-Source: ANB0VdadejFVuYcc9YIUKOBqVbNCo0juAE9zPT+J3/Qegjjj18IqKZu0LHfLWrhASRwoJrFO+u4F1w== X-Received: by 2002:aca:4994:: with SMTP id w142-v6mr1916759oia.114.1535127110264; Fri, 24 Aug 2018 09:11:50 -0700 (PDT) Received: from earth (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id p132-v6sm6578965oia.31.2018.08.24.09.11.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Aug 2018 09:11:49 -0700 (PDT) References: <87o9dup3ow.fsf@gmail.com> <871sapwzbp.fsf@gmail.com> <87lg8xtexb.fsf@gmail.com> <83a7pdb2x4.fsf@gnu.org> User-agent: mu4e 1.0; emacs 26.1 From: Alex Branham To: Eli Zaretskii Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p In-reply-to: <83a7pdb2x4.fsf@gnu.org> Date: Fri, 24 Aug 2018 11:11:47 -0500 Message-ID: <87d0u7n3r0.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32504 Cc: npostavs@gmail.com, 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Thu 23 Aug 2018 at 08:58, Eli Zaretskii wrote: >> From: Alex Branham >> Date: Thu, 23 Aug 2018 08:01:36 -0500 >> Cc: 32504@debbugs.gnu.org >> >> > What about syntax-ppss-context in syntax.el? >> >> Thanks, I didn't know about syntax-ppss-context. It doesn't seem to be >> documented anywhere. > > If it's useful, we could document it. I'm ambivalent about its usefulness - I don't see it used anywhere in Emacs's code and only once in the packages I have installed. Alex From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 24 15:28:33 2018 Received: (at 32504) by debbugs.gnu.org; 24 Aug 2018 19:28:33 +0000 Received: from localhost ([127.0.0.1]:59980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftHl2-00087O-RN for submit@debbugs.gnu.org; Fri, 24 Aug 2018 15:28:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftHl0-000879-Qv for 32504@debbugs.gnu.org; Fri, 24 Aug 2018 15:28:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ftHkr-0006hn-7O for 32504@debbugs.gnu.org; Fri, 24 Aug 2018 15:28:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53997) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ftHkp-0006hB-BD; Fri, 24 Aug 2018 15:28:19 -0400 Received: from [176.228.60.248] (port=1353 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ftHko-0003Bd-Sb; Fri, 24 Aug 2018 15:28:19 -0400 Date: Fri, 24 Aug 2018 22:28:07 +0300 Message-Id: <83r2in8szc.fsf@gnu.org> From: Eli Zaretskii To: Alex Branham In-reply-to: <87d0u7n3r0.fsf@gmail.com> (message from Alex Branham on Fri, 24 Aug 2018 11:11:47 -0500) Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p References: <87o9dup3ow.fsf@gmail.com> <871sapwzbp.fsf@gmail.com> <87lg8xtexb.fsf@gmail.com> <83a7pdb2x4.fsf@gnu.org> <87d0u7n3r0.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32504 Cc: npostavs@gmail.com, 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Alex Branham > Cc: npostavs@gmail.com, 32504@debbugs.gnu.org > Date: Fri, 24 Aug 2018 11:11:47 -0500 > > >> > What about syntax-ppss-context in syntax.el? > >> > >> Thanks, I didn't know about syntax-ppss-context. It doesn't seem to be > >> documented anywhere. > > > > If it's useful, we could document it. > > I'm ambivalent about its usefulness - I don't see it used anywhere in > Emacs's code and only once in the packages I have installed. That could be because it isn't documented. After all, that was your reason for not knowing about it, right? From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 24 15:49:31 2018 Received: (at 32504) by debbugs.gnu.org; 24 Aug 2018 19:49:31 +0000 Received: from localhost ([127.0.0.1]:59990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftI5K-0000BU-SI for submit@debbugs.gnu.org; Fri, 24 Aug 2018 15:49:31 -0400 Received: from mail-oi0-f50.google.com ([209.85.218.50]:46046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftI5J-0000BH-TQ for 32504@debbugs.gnu.org; Fri, 24 Aug 2018 15:49:30 -0400 Received: by mail-oi0-f50.google.com with SMTP id t68-v6so6082584oie.12 for <32504@debbugs.gnu.org>; Fri, 24 Aug 2018 12:49:29 -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=bISk4uKkd83LRz9Dfg9hJZYBRaRZuHjHNhGuViWM7Sk=; b=vWO2/Oa4jncZP32zg2sl6s7P6aqouJAYdny0PMkIwB9n28w6cOWyBsjHxlOnBgvR6d bDqdnaQj96kRQt50TDVTfuWeyUNQqY5psgsJiQLNU1Vh6l/O4C8Gej+riz0jqDvuoClG pZXvZ/VAB/+tcjWRyNJtinYMBkAww/tpZDOKw8k5x6rvM+MhkSIwsOXgyi+vJTRY9ClA /K/DApQoFI32moKFMAb/VyoiOqHf7ZgAuJRzohfhFF1piryfbC1BcsDyw0Qyc3yZPs0k Fs3T3QP1LfwswOtcaKMvXLD1W7laJUrnLHAPdtsGv5f5mrw/yLbGAwZs/NPPiN9TBB9k Gr4w== 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=bISk4uKkd83LRz9Dfg9hJZYBRaRZuHjHNhGuViWM7Sk=; b=bk/1JlT9zEXz4AXEX8rYfd142CbR85WqqBB/zYukhRlP5D+ISeB+u0BFt/CPgLynDv JbRstg9hpXMjBf2/6O9VNfeqbaTcOPcMRE04Nt138SV0p6oUxdssQDGc5TxT1Pc1EaXd YfzDNFrdn0IpGx/TmA4/uIcnUSFBRNRzVrkopE0ZV+Wwvbe4fhbhPWYcjUAE+F0+GFoH 7unuv2QxEVw52tT/6Ran5liaAONFDbWyMNtKi4HeUvs8AKDQSgprQ/0+Sv7nPQzFAJbA zIAgx3mEBrLk7Rn6BFWEYTItEG7ZpdQ3mXPXLsdjuewXpjrHlpyOWi1bGlOJL6oWMq5A HlOg== X-Gm-Message-State: APzg51AVujwofFGMzC0rXwE3MfX594F5WxWtoWXIG/73WVnYHkzn3Q93 4DxoNOKU1tLZlzEcCHILHo+f3oNR X-Google-Smtp-Source: ANB0VdYrv4EQXUVgJg5vkbQLzCaS76AvCBeVg6kjX1u6eNImA/yIhIZeDJxGC5aAZnjAukmyS6HwSQ== X-Received: by 2002:aca:5c56:: with SMTP id q83-v6mr2800238oib.255.1535140164043; Fri, 24 Aug 2018 12:49:24 -0700 (PDT) Received: from earth (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id k85-v6sm14277769oiy.2.2018.08.24.12.49.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Aug 2018 12:49:23 -0700 (PDT) References: <87o9dup3ow.fsf@gmail.com> <871sapwzbp.fsf@gmail.com> <87lg8xtexb.fsf@gmail.com> <83a7pdb2x4.fsf@gnu.org> <87d0u7n3r0.fsf@gmail.com> <83r2in8szc.fsf@gnu.org> User-agent: mu4e 1.0; emacs 26.1 From: Alex Branham To: Eli Zaretskii Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p In-reply-to: <83r2in8szc.fsf@gnu.org> Date: Fri, 24 Aug 2018 14:49:21 -0500 Message-ID: <87k1ofsfy6.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32504 Cc: npostavs@gmail.com, 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri 24 Aug 2018 at 14:28, Eli Zaretskii wrote: > That could be because it isn't documented. After all, that was your > reason for not knowing about it, right? Yes, absolutely. I meant I'm ambivalent about its usefulness versus syntax-is-comment/string-p, which seem more descriptive to me. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 24 22:27:01 2018 Received: (at 32504) by debbugs.gnu.org; 25 Aug 2018 02:27:01 +0000 Received: from localhost ([127.0.0.1]:60118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftOI1-00057f-EJ for submit@debbugs.gnu.org; Fri, 24 Aug 2018 22:27:01 -0400 Received: from mail-it0-f53.google.com ([209.85.214.53]:39836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftOHz-00057P-B6 for 32504@debbugs.gnu.org; Fri, 24 Aug 2018 22:26:59 -0400 Received: by mail-it0-f53.google.com with SMTP id t69-v6so4256118itb.4 for <32504@debbugs.gnu.org>; Fri, 24 Aug 2018 19:26:59 -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=AYZQo0OITzYKWlRrQt2c80y9ILnVFpAcn9GsZfmB6Q0=; b=BaFzt36bw54CqGcW7ZwKE9oLPHyfZ7kbSa7low62p2DeeJ/Gx3yxQeZl6ImWkGLseA HQcZJGmOlKcAt/h/ym9Gha9GLWT6UTbYs6vd9vcxtYNsABbVhR6cGfNqN9rLmhg/rH8D FKFlnXtjFyjjZrCeYrKwzgOFbgf8lEsE9OHXBkfWNwpH9C51odukBMtSzj+63FTG1Zx7 r7mvzsAAk//qFgGlKSRGcamZzZdFLA6HPMZ+VngJKwT/swqlUIWlfHGL1r+HXWCYGgoZ OzZwmvsEJXR0y5kbVX1dH2es1jtBz1FmMD55xKgttIu72r+1O7BmIFpXLFBLhuYi/ngr JCGA== 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=AYZQo0OITzYKWlRrQt2c80y9ILnVFpAcn9GsZfmB6Q0=; b=jmkkG9iQnRyd4ZXkpzEv2FpfyscpWSUKj4qcCJeyZQss7absYaltEVVOiluJDo9Rod 550163gIUi9z1gzzaa4SN8lnSAJ0KMLC/5pbbgfjMIyLMP5tUcIK9DuSI6DCOiwZaAci n4lrdU1sKjhdJNjAgcjNICgqmjFbFPe9pmbTA6WmvhloXUURCG6hT6RhIy/d/Yl+UcxI 23QKQom0EyBRlR5Y1g3YMtmJL82fqZ0Nq4DH74Oz1MB9V86KthDfxCjsya/yx1FLL/mw gY0Zl6ZV3GCSDDZKZyMswYJtj011+QoeR3Sl6/MPXE+VoDXzjx4PR9TP6V+ePV6dKtus SsVA== X-Gm-Message-State: APzg51B1afQLNohbVOPBk3+ylBX1/1JCX8w71xr8OGyITP27hks2gFiL R4r6CUUHHbH9K3nQwUBS+DwLHdeg X-Google-Smtp-Source: ANB0VdbxVLACmOvkKAz4GkcWIgIXSxBVWSScFcFTWKtx93BozI/ZW1tnH8yIpfs2E9y2OmJ6HSPMPQ== X-Received: by 2002:a24:be8f:: with SMTP id i137-v6mr220936itf.113.1535164013625; Fri, 24 Aug 2018 19:26:53 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id k5-v6sm2932680ioj.59.2018.08.24.19.26.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Aug 2018 19:26:52 -0700 (PDT) From: Noam Postavsky To: Alex Branham Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p References: <87o9dup3ow.fsf@gmail.com> <871sapwzbp.fsf@gmail.com> <87lg8xtexb.fsf@gmail.com> <83a7pdb2x4.fsf@gnu.org> <87d0u7n3r0.fsf@gmail.com> Date: Fri, 24 Aug 2018 22:26:51 -0400 In-Reply-To: <87d0u7n3r0.fsf@gmail.com> (Alex Branham's message of "Fri, 24 Aug 2018 11:11:47 -0500") Message-ID: <87bm9ruqok.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32504 Cc: Eli Zaretskii , 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alex Branham writes: >>> Thanks, I didn't know about syntax-ppss-context. It doesn't seem to be >>> documented anywhere. >> >> If it's useful, we could document it. > > I'm ambivalent about its usefulness - I don't see it used anywhere in > Emacs's code and only once in the packages I have installed. For a bit of prior art, there are some similar functions in python.el: python-syntax-context, python-syntax-context-type, python-syntax-comment-or-string-p, python-syntax-closing-paren-p. Also, syntax.el has a couple of commented out "XEmacs compatibility functions": buffer-syntactic-context, buffer-syntactic-context-depth. I think it would make sense to provide symbolic names for all the elements returned by syntax-ppss, maybe like this: (cl-defstruct (syntax-state (:constructor nil) (:type list)) depth list-start sexp-end string-start comment quoted min-depth comment-style comment-or-string-start open-parens syntax-sequence) From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 26 02:30:03 2018 Received: (at submit) by debbugs.gnu.org; 26 Aug 2018 06:30:03 +0000 Received: from localhost ([127.0.0.1]:60884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftoYk-0003GA-Ig for submit@debbugs.gnu.org; Sun, 26 Aug 2018 02:30:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55965) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftoYj-0003FM-32 for submit@debbugs.gnu.org; Sun, 26 Aug 2018 02:30:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ftoYc-0003kW-7b for submit@debbugs.gnu.org; Sun, 26 Aug 2018 02:29:54 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48789) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ftoYb-0003h4-20 for submit@debbugs.gnu.org; Sun, 26 Aug 2018 02:29:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ftoYa-0005q1-7o for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2018 02:29:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ftoYU-0003c5-DQ for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2018 02:29:52 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:49075) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ftoYS-0003UY-9k for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2018 02:29:46 -0400 Received: from [192.168.178.35] ([188.103.25.117]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MMamg-1g0ykt41La-008LNu for ; Sun, 26 Aug 2018 08:29:42 +0200 Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p To: bug-gnu-emacs@gnu.org References: <87o9dup3ow.fsf@gmail.com> <871sapwzbp.fsf@gmail.com> <87lg8xtexb.fsf@gmail.com> <83a7pdb2x4.fsf@gnu.org> <87d0u7n3r0.fsf@gmail.com> <83r2in8szc.fsf@gnu.org> <87k1ofsfy6.fsf@gmail.com> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: <56559cc9-4833-9886-205c-8c48c9934827@easy-emacs.de> Date: Sun, 26 Aug 2018 08:33:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <87k1ofsfy6.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:OwVHy/Gr4gVNISHD4zS+AIOEbUS75kp8up43G31y7ku6H8OlUif YR3XitgDRLMIVXLepghzqdbX3jpj/tJ1ViJgsFpecMZI/wUHVBHhTACD/awFanFyhaup2Do VlLj10OPhqyOu0Ked0QdIARx4JPxSYmTgz9MOUFTvBTn14NYHXQY0Qef3AXaHevE1JZX4zS D2RjIn7NYOFhtoY1DIcPQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:0jBCWbSupP8=:HUcPiqAiss/FIaREy59huq vX+fDToLXPS9wiEeeSkgiYVazYGv2Qo1j+OuSKz8f72WSAPxezBcybMvMFgrS9u4g3/rkzFKS 1CmG13Ps0oi5PKLw9nKjPQJTW1dbeZcGv9t5nHG2Mi4ZMr/cLpFOrahcN/AxcoVTNZq2YhO9Q cv4Z3HtuUGOqT1i0XBdeeGUcp9E//JYJhcf8za/LITxhW46VqO2PqXlit051/DbZZctzzmMdT Hj7GjRSuCvrUcgCARrglkIDw5XG/BlcM7BmDVvUW/yGEmpa2Cn6gChL2YD+z9IyOStfPhxV1a UvWRognNWNZeSgDRRHGHcddSTK4/4k9QIXMoZr5why7iSOvtZHgAfTHbVohuWPzjOZ38NYQpI oX7I3phwoapRcXn1gS0FTaZuEt+aHoSdGe7fplt1MKmmQxg+CPte9OkWmj/yEHFFdS0nN/8yv LJqn9KwunassK6RaSUIseoYvf+wpOleju2Wz5sF1WulNF9t3E9d5cGxOkcTHoX0gNIrY2/AHg gVPVUTg0mDR2NyHnocU/+M4k5V5k+WiEpadWXQXO8Sd2qebtuQ4G45SeWmKM0nb2LuCwVaoN9 ITG6JSYvkdD8YsXYkRHGBwiXRomheQ6CKlw+nIJvR6fk9gLXWX5DrnHzulXZCL5nMQWmxAn63 yuPNc/e0mHwG4lMsHDtiloY5EeGGMtbMX89RPxOM/mMgH4TygjUMM2R7v0tjvn/+PSNfucOFe jdnaqm91iNFPfIXk X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) On 24.08.2018 21:49, Alex Branham wrote: > > On Fri 24 Aug 2018 at 14:28, Eli Zaretskii wrote: > >> That could be because it isn't documented. After all, that was your >> reason for not knowing about it, right? > > Yes, absolutely. I meant I'm ambivalent about its usefulness versus > syntax-is-comment/string-p, which seem more descriptive to me. > > > +1 Using here my home-made ar-in-comment-p, ar-in-string-p But there is another thing, syntax-ppss-context isn't that convenient: it requires still a check for eq instead of simply delivering a boolean. Andreas From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 30 10:40:03 2018 Received: (at 32504) by debbugs.gnu.org; 30 Aug 2018 14:40:03 +0000 Received: from localhost ([127.0.0.1]:39289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvO79-0001Zm-5Z for submit@debbugs.gnu.org; Thu, 30 Aug 2018 10:40:03 -0400 Received: from mail-oi0-f45.google.com ([209.85.218.45]:37186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fvO77-0001Z7-Ja for 32504@debbugs.gnu.org; Thu, 30 Aug 2018 10:40:01 -0400 Received: by mail-oi0-f45.google.com with SMTP id p84-v6so15836732oic.4 for <32504@debbugs.gnu.org>; Thu, 30 Aug 2018 07:40:01 -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:content-transfer-encoding; bh=5OJdWJFqNPoze1LiGVRHyr6DpcoAUm1T0sX9qY4nyjg=; b=R6RMGnqkJoevQ+Sn3Ilk3Tt5Nh20sByaEtgmWvDNV9ga9EGj0ie02p+r2N7eimB6HA iuWssS9WTdRCvs0H6bwuEyboHL725a4q8ryEgK9O6oloOeigOCHALAM1YPJoGMb7jKtG SKErCSRy9oCqr3O26IWH/90yErVt/euYBTUj17240VSJrHumSvKSqCthCoF/3i0FG218 UkSLzTTSL92Re8TcBRpqh6yJms7lXVccH6Ctei+xt+33KADkyeQuRtyTGxvTeaf+KVPm ht0sib70Ww7yQwQk0i3z2sS+nF0VtXUCfr1MJJq2nAOBcM9hOIeUTFiJa6OrEl/q2XsP ksIg== 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:content-transfer-encoding; bh=5OJdWJFqNPoze1LiGVRHyr6DpcoAUm1T0sX9qY4nyjg=; b=dzDJoNgYLD4tm61l1ioug3x19pliLkOSvr5rfuhZKOweiA/UWcD2rutqHOMn/qrvez f7CHtG2TyfGJ74Q93H6bWURm9cD5j1OPOKQ2dJK1b3mRtS0TCxV3U0ITsZj/QgX257+V tK8gdN3ce4MCSkN7wUKuwVHNWA88l6oWc93Oaa3VNfSCkPLqL8cgaRjN1zesE7Sd7ahU YJqfiQmLhpQXnGvBFK2JTk/8hCd+UbV0GZPlc6vF5i2FPoeidj+EH5/T0omWSecA1B5d 3KJm9IEYjlWGFpwNOovpuGFO8aj3cd9u0/57/HA7BaELJ/nlqm01X5STgMcGKp7D3rEG C6kQ== X-Gm-Message-State: APzg51A1h29qpL7r5nZ/7ne49Y9kfSsFIKYHHllMMBags+KfhoEc2pmX +L/8vB4dHGhvPu2f4FrbIRUIYzc6 X-Google-Smtp-Source: ANB0VdZh65n5UUpf7wTzIVCZH4XkC4sD/qB2FSwqodrCY/p2OFHqW/fk6LmkJRkTZmGfPWXjBORCOw== X-Received: by 2002:aca:3606:: with SMTP id d6-v6mr2952195oia.327.1535639995874; Thu, 30 Aug 2018 07:39:55 -0700 (PDT) Received: from earth (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id f144-v6sm6593458oib.39.2018.08.30.07.39.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Aug 2018 07:39:54 -0700 (PDT) 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> User-agent: mu4e 1.0; emacs 26.1 From: Alex Branham To: Noam Postavsky Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p In-reply-to: <87bm9ruqok.fsf@gmail.com> Date: Thu, 30 Aug 2018 09:39:52 -0500 Message-ID: <87efefgbpj.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32504 Cc: Eli Zaretskii , 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I think it would make sense to provide symbolic names for all the > elements returned by syntax-ppss, maybe like this: That makes sense to me. > (cl-defstruct (syntax-state (:constructor nil) > (:type list)) > depth list-start sexp-end > string-start comment quoted > 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? For example, syntax-state-comment looks like this: syntax-state-comment is a Lisp function. (syntax-state-comment CL-X) This function has a compiler macro =E2=80=98syntax-state-comment--cmacro=E2= =80=99. Access slot "comment" of =E2=80=98(syntax-state (:constructor nil) (:type l= ist))=E2=80=99 struct CL-X. 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: syntax-state-comment-p is a Lisp function. (syntax-state-comment-p &optional CL-X) This function has a compiler macro =E2=80=98syntax-state-comment-p--cmacro= =E2=80=99. Return non-nil if the syntax of CL-X is a comment. CL-X defaults to point. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 30 21:22:04 2018 Received: (at 32504) by debbugs.gnu.org; 31 Aug 2018 01:22:04 +0000 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 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 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) 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) From: Noam Postavsky To: Alex Branham Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p 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> Date: Thu, 30 Aug 2018 21:21:54 -0400 In-Reply-To: <87efefgbpj.fsf@gmail.com> (Alex Branham's message of "Thu, 30 Aug 2018 09:39:52 -0500") Message-ID: <87bm9js53h.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32504 Cc: Eli Zaretskii , 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 ...)) From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 30 22:47:03 2018 Received: (at 32504) by debbugs.gnu.org; 31 Aug 2018 02:47:03 +0000 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 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 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) 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) 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> User-agent: mu4e 1.0; emacs 26.1 From: Alex Branham To: Noam Postavsky Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p In-reply-to: <87bm9js53h.fsf@gmail.com> Date: Thu, 30 Aug 2018 21:50:37 -0500 Message-ID: <87bm9js0zm.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32504 Cc: Eli Zaretskii , 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 23 18:05:17 2019 Received: (at 32504) by debbugs.gnu.org; 23 Jun 2019 22:05:18 +0000 Received: from localhost ([127.0.0.1]:55246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfAbt-0003xv-Li for submit@debbugs.gnu.org; Sun, 23 Jun 2019 18:05:17 -0400 Received: from quimby.gnus.org ([80.91.231.51]:47888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfAbr-0003xh-FA for 32504@debbugs.gnu.org; Sun, 23 Jun 2019 18:05:15 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfAbn-0002ed-AE; Mon, 24 Jun 2019 00:05:13 +0200 From: Lars Ingebrigtsen To: Noam Postavsky Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p References: <87o9dup3ow.fsf@gmail.com> <871sapwzbp.fsf@gmail.com> Date: Mon, 24 Jun 2019 00:05:11 +0200 In-Reply-To: <871sapwzbp.fsf@gmail.com> (Noam Postavsky's message of "Wed, 22 Aug 2018 23:12:42 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Noam Postavsky writes: > Alex Branham writes: > >> I got tired of checking/remembering whether (nth 3 (syntax-ppss)) was a >> string or a comment, so I've created two simple functions that wrap that [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32504 Cc: Alex Branham , 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Noam Postavsky writes: > Alex Branham writes: > >> I got tired of checking/remembering whether (nth 3 (syntax-ppss)) was a >> string or a comment, so I've created two simple functions that wrap that >> in a more descriptive name. I've noticed that there are a handful of >> these that other modes have written, so evidently others wanted them as >> well at some point. > > What about syntax-ppss-context in syntax.el? I went ahead and documented it; if I read this thread right, it's sufficient for the use case presented. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 23 18:05:23 2019 Received: (at control) by debbugs.gnu.org; 23 Jun 2019 22:05:23 +0000 Received: from localhost ([127.0.0.1]:55250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfAby-0003yF-UY for submit@debbugs.gnu.org; Sun, 23 Jun 2019 18:05:23 -0400 Received: from quimby.gnus.org ([80.91.231.51]:47910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfAbw-0003y5-Ea for control@debbugs.gnu.org; Sun, 23 Jun 2019 18:05:20 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfAbu-0002ek-02 for control@debbugs.gnu.org; Mon, 24 Jun 2019 00:05:19 +0200 Date: Mon, 24 Jun 2019 00:05:17 +0200 Message-Id: To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #32504 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 32504 fixed close 32504 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 32504 fixed close 32504 27.1 quit From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 08 20:05:25 2019 Received: (at 32504) by debbugs.gnu.org; 9 Jul 2019 00:05:25 +0000 Received: from localhost ([127.0.0.1]:60007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkddM-0000LK-Rp for submit@debbugs.gnu.org; Mon, 08 Jul 2019 20:05:25 -0400 Received: from mail-io1-f47.google.com ([209.85.166.47]:34364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkddK-0000L7-PD for 32504@debbugs.gnu.org; Mon, 08 Jul 2019 20:05:23 -0400 Received: by mail-io1-f47.google.com with SMTP id k8so39402729iot.1 for <32504@debbugs.gnu.org>; Mon, 08 Jul 2019 17:05:22 -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=MexDXb54Px03kThy6wkn8wA4LC8y7Hh5f+gHkcnCUH0=; b=HBfYMPdJDLYhPPufC9IptfPmpnvnqhG1W2WsXB09Gaq7Wx5LyOncELaNTlraOJtm+7 um9xXvR125JyAwnjJcMF0+uFpIlwSPtT/QtK54RYGs39UPVu/AKjIygj7jngpTw36m8R WzfN1E+rISC60spaROC5+id/ziybqA/KKA3RL/4gBYiwF1YdRb8B3h1Q7LE+KdJd9aOH +qx6XEX+Kal2IvNn299ltzwkzRGbryxJ4S4jGL3tycnst6yZqlWBhT6vOTPtkVogFV3m lZIHKDtPLwSNN2XZJdP9ldX3fDtTvIAwoXBpm219zJSZavIdHnJhGqNnSUxie8UOBPP4 Wl4w== 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=MexDXb54Px03kThy6wkn8wA4LC8y7Hh5f+gHkcnCUH0=; b=cF5YI/qmO8vCpzOmd6AVkXT9nH1IgNh0ZuQ6LcgoUvNcpuvdfdreIsgOapQpM8W/zS kdB95mO+ulzxXiZxoTjI183fxQgwVcBeV0HDKZ5XXA+OPClNNsmHFZWeF6sM4rKTMz7r IZdf3mgVm32meFwWu4XNpiEeOvXy/TlK91UMg4aqHNO6L0JC4+Uys9PXIZtfR3DFY4dB WOGePNOnzFz4E+G/+gw1ee9QYtw5V1IQhs4WwLm9vfZYlneT5MjOE92yJyXkVbH8/f5Q +54bFNnpMbpEn3xi9WkkoC1gAhS5EAUsuqVJ4Ji1EodaBlXNgpSWtteSVttHLbBIRCxi xHlQ== X-Gm-Message-State: APjAAAUaYNchnwHIGQkN7odmpI/fR5DJB0WEPZ75rxUXPyLj8AbMBsEs gNFU4RljMPzEarK0utD0iRn5YvYR X-Google-Smtp-Source: APXvYqxDvj50tpzjNWYAaoBgb2baG9zPzeSuingLCaNFjMKVHkJvjetenbU4uWS1eA72/29+SEYZRQ== X-Received: by 2002:a5d:9e49:: with SMTP id i9mr22318957ioi.290.1562630716857; Mon, 08 Jul 2019 17:05:16 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id s10sm10276299iod.46.2019.07.08.17.05.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Jul 2019 17:05:16 -0700 (PDT) From: Noam Postavsky To: Alex Branham Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p 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> <87bm9js0zm.fsf@gmail.com> Date: Mon, 08 Jul 2019 20:05:15 -0400 In-Reply-To: <87bm9js0zm.fsf@gmail.com> (Alex Branham's message of "Thu, 30 Aug 2018 21:50:37 -0500") Message-ID: <87imsc2htw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Alex Branham writes: > 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 i [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.166.47 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (npostavs[at]gmail.com) 1.3 PDS_NO_HELO_DNS High profile HELO but no A record X-Debbugs-Envelope-To: 32504 Cc: Eli Zaretskii , 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) --=-=-= Content-Type: text/plain Alex Branham writes: > 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. The recent talk about accessors for decoded time reminded me of this. Here's an initial patch. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Add-named-accessors-for-syntax-ppss-state-Bug-32504.patch Content-Description: patch >From 0d09658a33aed36b0b647dc8dbfd08d8aa2dc535 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Mon, 8 Jul 2019 18:45:53 -0400 Subject: [PATCH] Add named accessors for syntax-ppss state (Bug#32504) * lisp/emacs-lisp/syntax.el (syntax-ppss-depth, syntax-ppss-list-start) (syntax-ppss-last-sexp-start, syntax-ppss-string-terminator) (syntax-ppss-comment, syntax-ppss-quoted-p, syntax-ppss-min-depth) (syntax-ppss-comment-style, syntax-ppss-context-start) (syntax-ppss-open-parens, syntax-ppss-syntax-sequence): New functions. (syntax-ppss-toplevel-pos, syntax-ppss-context): Use them. --- lisp/emacs-lisp/syntax.el | 62 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index 6464e2a52d..b7a5e585b7 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -358,7 +358,61 @@ internal--syntax-propertize ;;; Incrementally compute and memoize parser state. (defsubst syntax-ppss-depth (ppss) + "Depth in parens according to PPSS. +PPSS is the return value `parse-partial-sexp' or `syntax-ppss'." (nth 0 ppss)) +(defsubst syntax-ppss-list-start (ppss) + "Start of innermost containing list according to PPSS; nil if none. +PPSS is the return value `parse-partial-sexp' or `syntax-ppss'." + (nth 1 ppss)) +(defsubst syntax-ppss-last-sexp-start (ppss) + "Start of last complete sexp terminated according to PPSS. +PPSS is the return value `parse-partial-sexp' or `syntax-ppss'." + (nth 2 ppss)) +(defsubst syntax-ppss-string-terminator (ppss) + "Terminating character of current string according to PPSS. +Return t if the string should be terminated by generic string +delimiter, or nil if not in a string. +PPSS is the return value `parse-partial-sexp' or `syntax-ppss'." + (nth 3 ppss)) +(defsubst syntax-ppss-comment (ppss) + "Non-nil if inside a comment according to PPSS. +Return t if inside a non-nestable comment, else an integer (the comment +nesting depth). +PPSS is the return value `parse-partial-sexp' or `syntax-ppss'." + (nth 4 ppss)) +(defsubst syntax-ppss-quoted-p (ppss) + "Non-nil if PPSS points to a position following a quote. +PPSS is the return value `parse-partial-sexp' or `syntax-ppss'." + (nth 5 ppss)) +(defsubst syntax-ppss-min-depth (ppss) + "Minimum parenthesis depth of the scan according to PPSS. +PPSS is the return value `parse-partial-sexp' or `syntax-ppss'." + (nth 6 ppss)) +(defsubst syntax-ppss-comment-style (ppss) + ;; FIXME: What is comment style exactly? + "Comment style according to PPSS. +PPSS is the return value `parse-partial-sexp' or `syntax-ppss'." + (nth 7 ppss)) +(defsubst syntax-ppss-context-start (ppss) + "Start of comment or string according to PPSS. +Return nil if not in one. +PPSS is the return value `parse-partial-sexp' or `syntax-ppss'." + (nth 8 ppss)) +(defsubst syntax-ppss-open-parens (ppss) + "List of open parens according to PPSS. +PPSS is the return value `parse-partial-sexp' or `syntax-ppss'." + (nth 9 ppss)) +(defsubst syntax-ppss-syntax-sequence (ppss) + "Syntax of the 1st of a two character sequence according to PPSS. +When the last position scanned holds the first character of a +\(potential) two character construct, the syntax of that +position, otherwise nil. That construct can be a two character +comment delimiter or an Escaped or Char-quoted character. +PPSS is the return value `parse-partial-sexp' or `syntax-ppss'." + (nth 10 ppss)) + + (defun syntax-ppss-toplevel-pos (ppss) "Get the latest syntactically outermost position found in a syntactic scan. @@ -367,8 +421,8 @@ syntax-ppss-toplevel-pos outside of any parentheses, comments, or strings encountered in the scan. If no such position is recorded in PPSS (because the end of the scan was itself at the outermost level), return nil." - (or (car (nth 9 ppss)) - (nth 8 ppss))) + (or (car (syntax-ppss-open-parens ppss)) + (syntax-ppss-context-start ppss))) (defsubst syntax-ppss-context (ppss) "Say whether PPSS is a string, a comment, or something else. @@ -376,8 +430,8 @@ syntax-ppss-context comment, the symbol `comment' is returned. If it's something else, nil is returned." (cond - ((nth 3 ppss) 'string) - ((nth 4 ppss) 'comment) + ((syntax-ppss-string-terminator ppss) 'string) + ((syntax-ppss-comment ppss) 'comment) (t nil))) (defvar syntax-ppss-max-span 20000 -- 2.11.0 --=-=-= Content-Type: text/plain >>> 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. > > 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. Well, for me I just want to stop having to look up the docstring of parse-partial-sexp every damn time I see (nth X PPSS). But I wouldn't be against having syntax-is-comment/string-p which take a position as well. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 11 01:11:48 2019 Received: (at 32504) by debbugs.gnu.org; 11 Jul 2019 05:11:49 +0000 Received: from localhost ([127.0.0.1]:36936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlRMy-0003J1-Lo for submit@debbugs.gnu.org; Thu, 11 Jul 2019 01:11:48 -0400 Received: from mail-pg1-f170.google.com ([209.85.215.170]:41584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlRMu-0003Il-6S for 32504@debbugs.gnu.org; Thu, 11 Jul 2019 01:11:47 -0400 Received: by mail-pg1-f170.google.com with SMTP id q4so2315894pgj.8 for <32504@debbugs.gnu.org>; Wed, 10 Jul 2019 22:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version; bh=cBpncW1/YZAfEfo+uH89vJ8scSlQDZ2g60m0gv/MO5k=; b=jvAtuaY9vNN1lSh1p8MF+YP5tsIskIRO4/Sb8wbwlV72A5oOlA+trUhfnysdsS53RK ziw/1JnXskIrJmZTMNP3Kv7O3N/zUumb7JdyXG7vwZdQGgu5yimExmWynVirgyCoAIZk KwrqZACsEYHYkumNngmLcpTqEme+XO4obGnPSB+WQ2NHRs4w8Kz3bIZXUBtI1wW9w2YP JYSnXO9oQJo6IBL1LHnBX7wCI2ujm730r53WzjY4LZzFp+xesH/wfW1IYqf2kN7n4ycx WvbTZe9gDX491lGQg62rgLJUPtdQveAavbNJqGVbBbEGWzZq7EL2byVjHfmCNaqzZDRt 9hXQ== 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:face:date :in-reply-to:message-id:user-agent:mime-version; bh=cBpncW1/YZAfEfo+uH89vJ8scSlQDZ2g60m0gv/MO5k=; b=hnfdSb4mcH5/tNHRcykshyAAK/8khNPKfCmNdF/3ly5vsQYv8RWLz1l17nlCzg0GJY 1rASq1xuKx4ekRnpyyAbeHRMXMtKBoSKDfXzYWlHlpMgczjs9E5cTvoia3hGi9EZ/Prs 9fOj0IxvsNhVjn5MV4bzx01H5+hgQVF5bszb38XGWYTbzhx0ND0aheaa15WdGWZ5y+KO tm0M2lYky0EA9Ki5ZU8ySmc4FXyV+IxWVSk6J6yEEzWLB43GcmJgkBxuKYHjNVpwQjO2 xmC3AR8j4VS3nc7LgwQyyRxcV5bpEr+jFX/qbMSg9CEyOy/d3ZSAZmD15qSeyuIejTYZ dQ4A== X-Gm-Message-State: APjAAAW6ZPDP3c6Hyrsl1+5UIDdI5kHdamX3mwC/6ysxyO+kI7Ros+HS 6L03WEU+V0SdpNxxLMMyFboYEHPaeSs= X-Google-Smtp-Source: APXvYqxTU7mclh668OhpL4nIWAKh1fWaIUaqkb1JuQOoA5iIx1k/XnFKYJgDreq2N2cjBwjADfEXBg== X-Received: by 2002:a63:69c1:: with SMTP id e184mr2265475pgc.198.1562821897460; Wed, 10 Jul 2019 22:11:37 -0700 (PDT) Received: from Zeuss-MacBook-Air.local ([112.208.238.203]) by smtp.gmail.com with ESMTPSA id j21sm3719876pfh.86.2019.07.10.22.11.35 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 10 Jul 2019 22:11:36 -0700 (PDT) From: Leo Liu To: Noam Postavsky Subject: Re: bug#32504: [PATCH] syntax-is-{comment|string}-p 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> <87bm9js0zm.fsf@gmail.com> <87imsc2htw.fsf@gmail.com> Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAGFBMVEUzRVhbQj4eZqO6SjnT eWpxnMetm5b6/PmidmqrAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1F B9cBBwMLBfKABCMAAAFoSURBVCjPtZI9a8MwEIaFoc7aYDdelQMna0Em3tsSr0XUeE2Q6a22a+v+ fk8fSSBkbDUI6dHpfe9OEvRgiD+ApqKPJgJeB6iUUXWESjUe/ig38AJrhqqvaU2nTIXbNvOQ40fe qdry4kyGoVWsfCQalXpHnJGM01wjWdYbMlXNFdsZDO69m9aqNqxEJqTEgbM5OF7wlEfIoll1Ked4 LbM5X2EdILLokEdmI8z7g5cKED0cuTC930TYhy7ZDekkXVGw/L60TguJePPxcJF48lpsSUWEA/Ju jGFNgJOXc4Hz7TmAdBeu5Ve4AEjOi2/2jfd3cAJZ+IbNrvdjgBZY01b+HTuG3cLws6BJZqVOj/pp T0OqVwx3rFq+QmJwx3loK5JSLEhDIt62+mtC2C+SrAUxEbV6C6v2BRbd6pILBKFpepKZJHgGgrKF sptSUUoczpwg2pQ7ZH1tgs0ou/917mzz6Cs2//C978cv5l07L02orIEAAAAASUVORK5CYII= Date: Thu, 11 Jul 2019 13:11:33 +0800 In-Reply-To: <87imsc2htw.fsf@gmail.com> (Noam Postavsky's message of "Mon, 08 Jul 2019 20:05:15 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (macOS 10.14.5) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On 2019-07-08 20:05 -0400, Noam Postavsky wrote: > Well, for me I just want to stop having to look up the docstring of > parse-partial-sexp every damn time I see (nth X PPSS). But I wouldn't > be agai [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sdl.web[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.215.170 listed in list.dnswl.org] 1.3 PDS_NO_HELO_DNS High profile HELO but no A record X-Debbugs-Envelope-To: 32504 Cc: Alex Branham , 32504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) On 2019-07-08 20:05 -0400, Noam Postavsky wrote: > Well, for me I just want to stop having to look up the docstring of > parse-partial-sexp every damn time I see (nth X PPSS). But I wouldn't > be against having syntax-is-comment/string-p which take a position as > well. syntax-ppss-context looks better. It is there for a long time and I have personally used it many times (13 times in one of my projects). Introduce a new set seems overkill at this point. BTW, please don't name functions combining -is- and -p. They sound odd. From unknown Tue Jun 17 01:49:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 08 Aug 2019 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator