From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Hopkins Newsgroups: gmane.emacs.bugs Subject: bug#58029: 28.2; Struct boundaries ignored by bounds-of-thing-at-point Date: Fri, 23 Sep 2022 16:14:31 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36576"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Roundcube Webmail/1.4.12 To: 58029@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 23 18:43:43 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oblmA-0009Ns-R5 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Sep 2022 18:43:43 +0200 Original-Received: from localhost ([::1]:34594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oblm9-0008Ik-QQ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Sep 2022 12:43:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oblXy-00059I-9v for bug-gnu-emacs@gnu.org; Fri, 23 Sep 2022 12:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42513) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oblXy-0000jk-1i for bug-gnu-emacs@gnu.org; Fri, 23 Sep 2022 12:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oblXx-0000hE-PN for bug-gnu-emacs@gnu.org; Fri, 23 Sep 2022 12:29:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Richard Hopkins Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Sep 2022 16:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58029 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16639505372663 (code B ref -1); Fri, 23 Sep 2022 16:29:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Sep 2022 16:28:57 +0000 Original-Received: from localhost ([127.0.0.1]:41591 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oblXs-0000gs-Ec for submit@debbugs.gnu.org; Fri, 23 Sep 2022 12:28:57 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:50542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obkO6-0002gr-Hd for submit@debbugs.gnu.org; Fri, 23 Sep 2022 11:14:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obkO5-0000YU-Tf for bug-gnu-emacs@gnu.org; Fri, 23 Sep 2022 11:14:46 -0400 Original-Received: from bird.elm.relay.mailchannels.net ([23.83.212.17]:12232) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obkNy-0005Xh-7D for bug-gnu-emacs@gnu.org; Fri, 23 Sep 2022 11:14:45 -0400 X-Sender-Id: 9wt3zsp42r|x-authuser|emacs@unbit.co.uk Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id EEB4F802709 for ; Fri, 23 Sep 2022 15:14:33 +0000 (UTC) Original-Received: from apollo.krystal.co.uk (unknown [127.0.0.6]) (Authenticated sender: 9wt3zsp42r) by relay.mailchannels.net (Postfix) with ESMTPA id 150EB80318C for ; Fri, 23 Sep 2022 15:14:32 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1663946073; a=rsa-sha256; cv=none; b=aKKfav72aUUZoY3X6b1RLiRWisc80s2NSXT3vTCUSOOJiuFU1caVUKXhRzwJHXiQh0sswR uBT8u07A3Ynl0068x3x4VeWYYlbSjQgu1CaPuz77ZWuqwfBp3rUGmGFsIDBwxbgNorZbXE HXvwfssWa5ZXKIviHt6sTldWSNanTFdm3rSWFbyVWsIwtpq2lKpDnXDlc7lzWQluI0Iip/ 1EQY2TeaZkciG5CL4i/iUif7v8SE3sCouyiRs8tcOoG9RezI4UIzIJ1o8/9H4gYrtW0qoX G2qS/CXFaWX38kNpDTTYcF0+w0nOABdTJ96TkUT5dpJKSBTDHT40CTdYNJKCHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1663946073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=wxf8kHnp/YuZ6OaIh8PKrKEz5xDDUykx4AH8GDaTN7o=; b=cJiM1iL1hFBh34Qe4h6npQIO1Bl2rPJOFwpDU5ZeBawQdiCMgO2T/FgGIi7ack4mLnzlNd nHywfQnIFvarmvCFH4pxvaMj93hm/Iqnw+AKQjHARKTsXeBh7NzuXKK1MdqDHwPGqc2vtP ttj99YH6PEDOe78QEGaMZW76BBX3UaPczruhUB7JG4vSatZFLVChC32yUnVd8qMoy16KX9 I76S3Dqks3UVqraXNeZ4JAIY9qw4sXZOSiix922R0EMXOY/Otq5lZOqrjLjHgO/LXlsReV y6VNrulV8tUX3nLBRfnd/OnPxz7Ev/7Tm+DoEEUt/PQnb0IipbvGa0Fzmk1T+A== ARC-Authentication-Results: i=1; rspamd-64f49dbfc4-xdwjn; auth=pass smtp.auth=9wt3zsp42r smtp.mailfrom=emacs@unbit.co.uk X-Sender-Id: 9wt3zsp42r|x-authuser|emacs@unbit.co.uk X-MC-Relay: Neutral X-MailChannels-SenderId: 9wt3zsp42r|x-authuser|emacs@unbit.co.uk X-MailChannels-Auth-Id: 9wt3zsp42r X-Abortive-Lettuce: 47e34a932f68afc6_1663946073597_2365345598 X-MC-Loop-Signature: 1663946073597:82375273 X-MC-Ingress-Time: 1663946073596 Original-Received: from apollo.krystal.co.uk (apollo.krystal.co.uk [77.72.0.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.115.125.86 (trex/6.7.1); Fri, 23 Sep 2022 15:14:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=unbit.co.uk ; s=default; h=Content-Transfer-Encoding:Content-Type:Message-ID:Subject:To: From:Date:MIME-Version:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=wxf8kHnp/YuZ6OaIh8PKrKEz5xDDUykx4AH8GDaTN7o=; b=myDNnkHz1v6ZMdpGfKfD+Gd+vg Ph1XqDbl3vy6IK8pRIUGzgdrJu7dSXqiBT1BERAMlJ+fEaeAzczJA3reZpmfFwXMMfoE+yc5etMgL OHgXP1gssg/syhp5UX5ReEcx7djSq9G11HcMa5yxeaDPj6W5ytzyW4U25BBLIqqIIfJ1xSRei8ULt eDb8FLXlcGFSBiUGSWGPjH54VYi1N/ABKtLdZSJJaRaZZxC/ASuHIgbQJJyB+LK2Q37vkvtf49Qvp 58vQe8lGtcDgl2B6suSaJFWmOE3iAaZVgyNHI0XPtL4tEMGuBPIURt4qZnQ81lS8oHuAQmVrXUR5m hOtWIESg==; Original-Received: from [::1] (port=45584 helo=apollo.krystal.co.uk) by apollo.krystal.co.uk with esmtpa (Exim 4.95) (envelope-from ) id 1obkNt-008bRi-8B for bug-gnu-emacs@gnu.org; Fri, 23 Sep 2022 16:14:31 +0100 X-Sender: emacs@unbit.co.uk X-AuthUser: emacs@unbit.co.uk Received-SPF: pass client-ip=23.83.212.17; envelope-from=emacs@unbit.co.uk; helo=bird.elm.relay.mailchannels.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 23 Sep 2022 12:28:55 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:243489 Archived-At: I think this is a bug - any thoughts on the following? The initial "#s" as part of printed structures are ignored by `bounds-of-thing-at-point' which means it will a) pick up the wrong expression when inside the printed struct; and b) ignore the struct even when point is on the initial "#" The following `emacs -Q` recipe should help show the interaction between the struct representation and whether it's picked up by `bounds-of-thing-at-point'. (require 'cl-lib) (cl-defstruct foo a) (make-foo :a 1) ;; => #s(foo 1) ;; Bounds should be found starting from 1, but is nil (with-temp-buffer (insert (prin1-to-string (make-foo :a 1))) (goto-char (point-min)) (list (buffer-string) (bounds-of-thing-at-point 'sexp) (prin1-to-string (read (current-buffer))))) ;; => ("#s(foo 1)" nil "#s(foo 1)") ;; Whilst there is a list from point, the boundary should be ;; adjusted backwards as it's part of a struct. (with-temp-buffer (insert (prin1-to-string (make-foo :a 1))) (goto-char (point-min)) (forward-char 2) (list (buffer-string) (bounds-of-thing-at-point 'sexp) (prin1-to-string (read (current-buffer))))) ;; => ("#s(foo 1)" (3 . 10) "(foo 1)") In GNU Emacs 28.2 (build 1, x86_64-pc-cygwin) of 2022-09-15 built on fv-az140-985 Repository revision: 70134aa8264ded36d80248204b2ba43ae3d8f599 Repository branch: master Windowing system distributor 'Microsoft Corp.', version 10.0.19044 Configured using: 'configure --srcdir=/cygdrive/d/a/scallywag/emacs/emacs-28.2-1.x86_64/src/emacs-28.2 --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --docdir=/usr/share/doc/emacs --htmldir=/usr/share/doc/emacs/html -C --with-w32 'CFLAGS=-ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/cygdrive/d/a/scallywag/emacs/emacs-28.2-1.x86_64/build=/usr/src/debug/emacs-28.2-1 -fdebug-prefix-map=/cygdrive/d/a/scallywag/emacs/emacs-28.2-1.x86_64/src/emacs-28.2=/usr/src/debug/emacs-28.2-1' CPPFLAGS= LDFLAGS=' Configured features: ACL DBUS GIF GLIB GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY GFILENOTIFY PDUMPER PNG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XIM XPM ZLIB Important settings: value of $LC_CTYPE: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs auth-source eieio eieio-core eieio-loaddefs password-cache json map text-property-search seq byte-opt bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt cl-seq cl-macs gv time-date subr-x cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind gfilenotify w32 lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 53485 7761) (symbols 48 6799 1) (strings 32 19933 2170) (string-bytes 1 623050) (vectors 16 13667) (vector-slots 8 177937 11466) (floats 8 28 287) (intervals 56 293 24) (buffers 992 11))