From unknown Fri Jun 20 07:14:58 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#29499 <29499@debbugs.gnu.org> To: bug#29499 <29499@debbugs.gnu.org> Subject: Status: 25.3; bounds-of-thing-at-point for nested s-expressions? Reply-To: bug#29499 <29499@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:14:58 +0000 retitle 29499 25.3; bounds-of-thing-at-point for nested s-expressions? reassign 29499 emacs submitter 29499 James Nguyen severity 29499 minor tag 29499 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 29 02:54:37 2017 Received: (at submit) by debbugs.gnu.org; 29 Nov 2017 07:54:37 +0000 Received: from localhost ([127.0.0.1]:35630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJxCW-0005De-Ne for submit@debbugs.gnu.org; Wed, 29 Nov 2017 02:54:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJxCU-0005DP-G9 for submit@debbugs.gnu.org; Wed, 29 Nov 2017 02:54:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJxCO-0005EU-1q for submit@debbugs.gnu.org; Wed, 29 Nov 2017 02:54:29 -0500 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]:59370) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eJxCN-0005EO-UO for submit@debbugs.gnu.org; Wed, 29 Nov 2017 02:54:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJxCM-0000cP-GU for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2017 02:54:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJxCH-0005Bi-LC for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2017 02:54:26 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:44681) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eJxCH-0005BE-AL for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2017 02:54:21 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 91CA220AE2 for ; Wed, 29 Nov 2017 02:54:19 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 29 Nov 2017 02:54:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=x5AuLHFa5S0CuzmzQ90GmlMoG7T6ze4kmklQY8f+mOg=; b=qqk0asex RRvClKVK6fLmdug4wfA93DhttExasUo+PXk3bPpMUN8Pimy7jIOFjuQJWHSvc+GU RaoNxRDOGLF/+81uOpfyM5qj27NegxR4uQ1oKRIkZONBRswhnKFmA8fC+ZceGGY5 3vebccwn75dwERBz89rpxaa+elAUQPmvjNGWS+W5wFJYvEPNdhRGMpIu85DUtwLc 8Pu+CVyD8LJjDQKwhRChQGH2Hp5zLs6Fhcrfkjr+pdNcmlik/IcL3CQX2Ug8xjuF DIgS7HlgzWz+yt7Y2i+g+Mdzx/5vDQ3PoP1jFn7unUOeIOyDOgXZRL1mXAbT70Gl Hl9UH+cb7p0iBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=x5AuLHFa5S0CuzmzQ90GmlMoG7T6z e4kmklQY8f+mOg=; b=KGi5BzDN0/z8UVU8gYYqdP/HYPQhD4i4/mlpsK1IAbntm V7qOfswfRZXtSacZ44wWSL0B0OFXZksOAsxpX2+QYxa2noRvVnH7fpxyhaJZFPJk 3DkMKopNamGjvPSJGzzVBj+NI0Q3efTp6kPyOwwI4SUcJWz6rxN0sIWkgLk3LpYt YsyUZ4aAd5JPpML6X58nFrLgrV7B+jVTLal7ZCiWpzN2yZNgsdDgLsnNp/36umEN zyEFMJEOrwUBNgKKiMbMnGppJHvLrcf/gJUD/YqNV2k9P1d9ndjSqqT5YZe8IF+z 55wTq7gDdGPNhIBp5V2CFVSgAC9eGFcyCBxVSIp1w== X-ME-Sender: Received: from [10.0.1.47] (c-73-231-191-86.hsd1.ca.comcast.net [73.231.191.86]) by mail.messagingengine.com (Postfix) with ESMTPA id 303D97F8DE for ; Wed, 29 Nov 2017 02:54:19 -0500 (EST) From: James Nguyen Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: 25.3; bounds-of-thing-at-point for nested s-expressions? Message-Id: <2531AEF4-EEAD-467E-A598-6621696E0CC1@fastmail.com> Date: Tue, 28 Nov 2017 23:54:17 -0800 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3273) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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.4 (----) 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: -4.4 (----) I=E2=80=99m curious if this is expected? ;; (bounds-of-thing-at-point =E2=80=98sexp) Cursor is after ending paren of line. (+ 1 1) ;; M-: (bounds-of-thing-at-point =E2=80=98sexp) -> returns (x . = y) (+ 1 1 (+ 1 1) ;; M-: (bounds-of-thing-at-point =E2=80=98sexp) -> returns = nil ) In GNU Emacs 25.3.1 (x86_64-apple-darwin16.7.0, NS appkit-1504.83 = Version 10.12.6 (Build 16G29)) of 2017-09-14 built on d12frosted.local Windowing system distributor 'Apple', version 10.3.1504 Configured using: 'configure --disable-dependency-tracking --disable-silent-rules --enable-locallisppath=3D/usr/local/share/emacs/site-lisp --infodir=3D/usr/local/Cellar/emacs-plus/25.3/share/info/emacs --prefix=3D/usr/local/Cellar/emacs-plus/25.3 --with-xml2 --without-dbus --with-gnutls --with-imagemagick --with-modules --with-rsvg --with-ns --disable-ns-self-contained' Configured features: JPEG RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES Important settings: value of $LC_ALL: C value of $LC_COLLATE: C value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-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 transient-mark-mode: t Recent messages: Mark activated C-h C-g is undefined Quit Starting new Ispell process /usr/local/bin/ispell with default = dictionary... Spell-checking *scratch* using ispell with default dictionary... Spell-checking suspended; use C-u M-$ to resume Type C-x 1 to delete the help window. nil [2 times] (179 . 194) nil (203 . 210) Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-extra help-fns help-mode easymenu cl-loaddefs pcase cl-lib ispell thingatpt time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win ucs-normalize term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame 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 charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 199060 6158) (symbols 48 20009 0) (miscs 40 66 230) (strings 32 16544 6055) (string-bytes 1 474807) (vectors 16 33203) (vector-slots 8 653079 5045) (floats 8 161 225) (intervals 56 240 18) (buffers 976 18)) From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 14 14:42:58 2019 Received: (at 29499) by debbugs.gnu.org; 14 Jul 2019 18:42:58 +0000 Received: from localhost ([127.0.0.1]:45967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmjSc-0003rx-8v for submit@debbugs.gnu.org; Sun, 14 Jul 2019 14:42:58 -0400 Received: from quimby.gnus.org ([80.91.231.51]:56716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmjSb-0003rl-9Z for 29499@debbugs.gnu.org; Sun, 14 Jul 2019 14:42:57 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmjSW-0004u1-Ov; Sun, 14 Jul 2019 20:42:55 +0200 From: Lars Ingebrigtsen To: James Nguyen Subject: Re: bug#29499: 25.3; bounds-of-thing-at-point for nested s-expressions? References: <2531AEF4-EEAD-467E-A598-6621696E0CC1@fastmail.com> Date: Sun, 14 Jul 2019 20:42:52 +0200 In-Reply-To: <2531AEF4-EEAD-467E-A598-6621696E0CC1@fastmail.com> (James Nguyen's message of "Tue, 28 Nov 2017 23:54:17 -0800") Message-ID: <87ims4wj83.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: James Nguyen writes: > I’m curious if this is expected? > > ;; (bounds-of-thing-at-point ‘sexp) > > Cursor is after ending paren of line. > > (+ 1 1) ;; M-: (bounds-of-thing-at-point ‘sexp) -> returns (x . y) > > (+ [...] 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: 29499 Cc: 29499@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 (-) James Nguyen writes: > I=E2=80=99m curious if this is expected? > > ;; (bounds-of-thing-at-point =E2=80=98sexp) > > Cursor is after ending paren of line. > > (+ 1 1) ;; M-: (bounds-of-thing-at-point =E2=80=98sexp) -> returns (x . y) > > (+ 1 1 > (+ 1 1) ;; M-: (bounds-of-thing-at-point =E2=80=98sexp) -> returns nil > ) The problem is that thingatpt wants to go to the end of the current sexp, and uses forward-sexp for that. The amusing thing about forward-sexp is that it won't error if there's nothing to advance to (like at the end of a buffer), but if it hits a ")" immediately, it signals an error, making bounds-of-thing-at-point return nil. The patch below fixes the problem, but I'm not very familiar with the thingatpt code. Does anybody think this makes sense? diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 60a20e2d18..319f4b2cf8 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -194,7 +194,9 @@ thing-at-point--end-of-sexp (if (or (eq char-syntax ?\)) (and (eq char-syntax ?\") (nth 3 (syntax-ppss)))) (forward-char 1) - (forward-sexp 1)))) + (condition-case _ + (forward-sexp 1) + (scan-error nil))))) =20 (define-obsolete-function-alias 'end-of-sexp 'thing-at-point--end-of-sexp "25.1" --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 26 02:00:23 2019 Received: (at 29499) by debbugs.gnu.org; 26 Jul 2019 06:00:23 +0000 Received: from localhost ([127.0.0.1]:40715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqtHD-0001oT-It for submit@debbugs.gnu.org; Fri, 26 Jul 2019 02:00:23 -0400 Received: from quimby.gnus.org ([80.91.231.51]:55784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqtHB-0001oK-Ck for 29499@debbugs.gnu.org; Fri, 26 Jul 2019 02:00:22 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hqtH4-0003Xn-WD; Fri, 26 Jul 2019 08:00:18 +0200 From: Lars Ingebrigtsen To: James Nguyen Subject: Re: bug#29499: 25.3; bounds-of-thing-at-point for nested s-expressions? References: <2531AEF4-EEAD-467E-A598-6621696E0CC1@fastmail.com> <87ims4wj83.fsf@mouse.gnus.org> Date: Fri, 26 Jul 2019 08:00:14 +0200 In-Reply-To: <87ims4wj83.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Sun, 14 Jul 2019 20:42:52 +0200") Message-ID: <87wog5pc7l.fsf@mouse.gnus.org> 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: Lars Ingebrigtsen writes: > The problem is that thingatpt wants to go to the end of the current > sexp, and uses forward-sexp for that. The amusing thing about > forward-sexp is that it won't error if there's nothing to advanc [...] 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: 29499 Cc: 29499@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 (-) Lars Ingebrigtsen writes: > The problem is that thingatpt wants to go to the end of the current > sexp, and uses forward-sexp for that. The amusing thing about > forward-sexp is that it won't error if there's nothing to advance to > (like at the end of a buffer), but if it hits a ")" immediately, it > signals an error, making bounds-of-thing-at-point return nil. > > The patch below fixes the problem, but I'm not very familiar with the > thingatpt code. Does anybody think this makes sense? There weren't any comments, but it does seem to fix the reported issue, so I've applied the patch. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 26 02:00:30 2019 Received: (at control) by debbugs.gnu.org; 26 Jul 2019 06:00:30 +0000 Received: from localhost ([127.0.0.1]:40718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqtHJ-0001om-RK for submit@debbugs.gnu.org; Fri, 26 Jul 2019 02:00:30 -0400 Received: from quimby.gnus.org ([80.91.231.51]:55798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqtHE-0001oa-IO for control@debbugs.gnu.org; Fri, 26 Jul 2019 02:00:24 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hqtHB-0003Xt-V1 for control@debbugs.gnu.org; Fri, 26 Jul 2019 08:00:23 +0200 Date: Fri, 26 Jul 2019 08:00:21 +0200 Message-Id: <87v9vppc7e.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #29499 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 29499 fixed close 29499 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 29499 fixed close 29499 27.1 quit From unknown Fri Jun 20 07:14:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 23 Aug 2019 11:24:07 +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