From unknown Fri Jun 13 10:24:27 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#24627 <24627@debbugs.gnu.org> To: bug#24627 <24627@debbugs.gnu.org> Subject: Status: 24.5; (thing-at-point 'list) may return a non-empty string without a list Reply-To: bug#24627 <24627@debbugs.gnu.org> Date: Fri, 13 Jun 2025 17:24:27 +0000 retitle 24627 24.5; (thing-at-point 'list) may return a non-empty string wi= thout a list reassign 24627 emacs submitter 24627 Tino Calancha severity 24627 normal tag 24627 confirmed thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 06 05:44:05 2016 Received: (at submit) by debbugs.gnu.org; 6 Oct 2016 09:44:05 +0000 Received: from localhost ([127.0.0.1]:46241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bs5Dg-0002K9-Ny for submit@debbugs.gnu.org; Thu, 06 Oct 2016 05:44:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bs5Df-0002JZ-2e for submit@debbugs.gnu.org; Thu, 06 Oct 2016 05:44:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bs5DZ-0004Uf-0O for submit@debbugs.gnu.org; Thu, 06 Oct 2016 05:43:58 -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]:43500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bs5DY-0004US-T7 for submit@debbugs.gnu.org; Thu, 06 Oct 2016 05:43:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bs5DX-0004ac-Ff for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 05:43:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bs5DS-0004R2-M9 for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 05:43:55 -0400 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]:36839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bs5DS-0004Qv-FW for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 05:43:50 -0400 Received: by mail-pf0-x22a.google.com with SMTP id i85so7122768pfa.3 for ; Thu, 06 Oct 2016 02:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:user-agent:mime-version; bh=3CYg3RiQAW6Ey8DASOf3yDWuqima6sADEP9FckbF9Mk=; b=lO++rURHSjtceKCrbHjgwBsKpIn7SCEbSAs3oUXwtMuoQBsz0ONTTMS3gZPxVFXdzr Wdlsdo8bT+lqYtaZ7Drhd5kxctrFbCJRYgpU2K24OpZ2DeU/DW+8DRSMEEFut0G/LbZX 3fvOToo1APNAZ+akdqsRI6fDjH6yIG8jP4pYC34xG/YoNFjYg7aqidmZD8B9gKRjuTyZ F9e26BkH5GYklEnhw+tje1wIx3ubEstu3+4Yhz29SU2M5aAgI5iOeIkfMsqWfO8Jnism HjAeiEDyiXO410bKUdOBDgdYhrGhlfjOWxE1Jet1+VDMFnW7bMy+HYHlmsS+S4FyowAE GwZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:user-agent :mime-version; bh=3CYg3RiQAW6Ey8DASOf3yDWuqima6sADEP9FckbF9Mk=; b=epZIbxraY9k2jwTZQRM8yyx212OcY6Pr5SRzuAvNH9/fUC8k+7Bi47auCsZaSiq6Bj 53OiOKZ4yOkgbHYsUzUfbjRAnn4uTHJZGHyiqwcgolf8d6I+44raoYFgvBFd5VykOTnX JQexkNwc08cMxZqIc5BpyDdG+0VmRFeq9kba9kecndeSXp+1G41YrW9p57wbP+FWYfp7 kOxcPuDGzkCjXrGV+ittlHD8sIAdCLyXDcOmFRfWctRHf2b6LGw78EBqDXJJ2quHuJpl JxTKRGW8uRqx3fi1uCio0UBmzFDCQXgv+v8hDCIAuXmR0DvKKn2zIp/xPc2bMtgk6EVW BewA== X-Gm-Message-State: AA6/9RmqR1wh9ik2LwCuz2mRzBSgU3bl1UD/d8S4EIHBYi0lwyweR+rHps7AmI70x2TyDg== X-Received: by 10.98.194.133 with SMTP id w5mr17446961pfk.4.1475747029678; Thu, 06 Oct 2016 02:43:49 -0700 (PDT) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id c198sm3973589pfb.51.2016.10.06.02.43.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Oct 2016 02:43:49 -0700 (PDT) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Thu, 6 Oct 2016 18:43:46 +0900 (JST) X-X-Sender: calancha@calancha-pc To: bug-gnu-emacs@gnu.org Subject: 24.5; (thing-at-point 'list) may return a non-empty string without a list Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII 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: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: tino-emacs@gmail.com 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.0 (----) From: Tino Calancha To: bug-gnu-emacs@gnu.org Subject: 24.5; (thing-at-point 'list) make return a non-empty string without a list --text follows this line-- emacs -Q thingatpt.el > C-p M-: (thing-at-point 'list t) RET => ";;; thingatpt.el ends here\n" (list-at-point) returns nil as it should. Same behavior in master branch. In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.5) of 2016-06-02 on calancha-pc Windowing system distributor `The X.Org Foundation', version 11.0.11804000 System Description: Debian GNU/Linux testing (stretch) Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: tooltip-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: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set ";;; thingatpt.el ends here " Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils thingatpt time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer 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 make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 72272 4417) (symbols 48 17618 0) (miscs 40 40 138) (strings 32 9497 4205) (string-bytes 1 260150) (vectors 16 8998) (vector-slots 8 384193 16741) (floats 8 64 85) (intervals 56 290 1) (buffers 960 12) (heap 1024 9017 976)) From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 07 02:35:26 2016 Received: (at submit) by debbugs.gnu.org; 7 Oct 2016 06:35:26 +0000 Received: from localhost ([127.0.0.1]:47121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsOkf-0006F8-TK for submit@debbugs.gnu.org; Fri, 07 Oct 2016 02:35:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40299) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsOkd-0006El-OP for submit@debbugs.gnu.org; Fri, 07 Oct 2016 02:35:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsOkX-0000WC-JS for submit@debbugs.gnu.org; Fri, 07 Oct 2016 02:35:18 -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.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsOkX-0000Ve-HX for submit@debbugs.gnu.org; Fri, 07 Oct 2016 02:35:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsOkV-0001oz-6D for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2016 02:35:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsOkP-0000Nj-2b for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2016 02:35:14 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:53262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsOkO-0000MN-Nr for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2016 02:35:09 -0400 Received: from [192.168.178.35] ([95.119.32.173]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0M8u6u-1bkkJb1Nee-00CCED for ; Fri, 07 Oct 2016 08:35:07 +0200 Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list To: bug-gnu-emacs@gnu.org References: From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> Date: Fri, 7 Oct 2016 08:42:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:FtMQte3cu66WkElL3R0PkYpmcKfz9KJ8j1Zpd5gHb9346mvwoLA P59nCcajuKbD+5QgEHFoxZehAn+UFaGVjyoQVy5fXsDxtZ0IMIp+KurF/n8JR6xXxz9Ku7w x1ID4o4xhl1IQEhX+w8ydduj/q5DbznFQ+LEBXnf3/zP63Wx+5dycGiPsLkLbPk8haziINP m3ZcgArF9R/YsEbIR8EYg== X-UI-Out-Filterresults: notjunk:1;V01:K0:Z9MCxpRu8ak=:G+fPg3dxLKYF8M4suuVs3I /BmL6leUdpN17Z0SsC6P+jlptxb3bgd6zHYFJ83v3guTsIHFZzeNUW9HJpAB3sp0i88jS6lca GM87K8rQFV9qqRF1ly2911s3cpM2txyAIDgyfp0t2KUBIeEdSC9yzZ4ZzFWs5YJQbaodxNtP/ 5l9U9JALUqKrk9pmG/9aQ7DpKuyhTOKGOhf/BaD5UkjVcWSf36vTxTda7t1zjXh7gR/61Riiw cG+K3m445DAmOUFgSxDuEqkbmxSRKZmrGMHkOPWmPX46wpW4vaUHBG9kQgaHd7rdJzHJsB4rK iFXeS4+uVD/pOEi+bBwtVLznskcCqsI72jjXbnF9zQTwKuLZ5Pbeyi4N8p2PqO+6LW3Dn6bD9 2Lr3EvEV5ZH8v4Hk5R/4WnGPYbY1Ok2wUCQqGCWW2fSofZFnS8paulGRjSFyneQe2icDHnXBQ BN0UPZkhXAdwmN5C++0h8JBoE/HzWhTy5SL9Fg3DgqiAJeL7e1IOapZEFzzTQHAwdjMDOoGe4 rJxyAwIE4SB4tcVxXNTijxYzpCCk5t7FQjpK3GtXz91F9FDUcl9/JqCKdiTZvOkpQEJZ3jzUC 3p29FpAzK/l851jBOn8a4Xtvk/0Ictq+FxoneSF73tUuDDwYjRYGR/GaRq2qqwfH249LK705y 1rVJuC/yruaU09LLzR8OK7X7fc2a9yDEYda29Ga/RMyf5bWKd4CH3FA82dqtFYfIJglhj2Y54 WkMVEqC/SlMLLPoG 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: -4.5 (----) 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.5 (----) On 06.10.2016 11:43, Tino Calancha wrote: bounds-of-thing-at-point: ;; Try moving forward, then back. (funcall ;; First move to end. (or (get thing 'end-op) Still think bounds-of-thing-at-point should move backward first parse-partial-sexp offers some handy info for beginning, not end From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 10 23:43:09 2016 Received: (at 24627) by debbugs.gnu.org; 11 Oct 2016 03:43:09 +0000 Received: from localhost ([127.0.0.1]:51606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btny9-0004iT-8x for submit@debbugs.gnu.org; Mon, 10 Oct 2016 23:43:09 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:36565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btny7-0004iD-Hy for 24627@debbugs.gnu.org; Mon, 10 Oct 2016 23:43:08 -0400 Received: by mail-pa0-f47.google.com with SMTP id ry6so7152569pac.3 for <24627@debbugs.gnu.org>; Mon, 10 Oct 2016 20:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=s3i/Ikfg4wic0tU2033hlzQU9iZyK/QBbqABE7ZHzB0=; b=q9ZhxClZIboeTvux8wwd8+PE0DZKTLoIl2ygIg1acdObI20C326PZ7iUduMeEVbaQo BzEwTAyVwzHfiouDteXmQQTea3BJQwIOrwGjDgdZwP/FbF+TVZ/aoHE1jTz5L8phwTXV maDA+ZQY+SwVePYhBVUjisfQB4Qw1J9HNRs8ZUthG49221UHNsmW/NZy0YEw8aXUXtNC AUNaRMmTcCnwGZObA903xbVtYQtOBa9I7nlj1I51I9Yf5otX0nPAEu8R6kWYyPwiI91a BSXEsHigxS0ge2ZM/pfIWZIjsssTVigpvNQM8BbDPAChhnfMtmgC/Z1mKWaaQmu7VOli 6dFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=s3i/Ikfg4wic0tU2033hlzQU9iZyK/QBbqABE7ZHzB0=; b=A/fcx9JthKsCmSY78Y95+C+H/c2RYBtTE/GChKy6G2C3q9VVdMarh2u6xgsRzK5tHO 1qJ6c2REF/qFhXaajq3nrqpkZROzOgiofIKVj+inEL98/dCs7348UN4eRCRMXlgIuSxc OpENe7LUnLxsa+WjmVQo8gwPYz9Sax/z6UpsaQpjw1ki8BIESXW2ym667qB2pYVGjV49 8ep35zJr7/P+2vJKz/8+oTCuOnHLT2NqDnYo934jcDhkQ6uWyWIjCKgztz/fP5iChY/1 iOCXL0umth7IIBCpLFx0ke1dS3riguvY+wRUFAyv71rMW6ECrnxiXAhP4N70Vq9BhXlm a8xQ== X-Gm-Message-State: AA6/9RmdWTLg5AA8erw3HZ8Zhi+BnR6SgGn7Fw4OmXxogJCtnEqKxAA2SN2PdGw4t+gMvA== X-Received: by 10.66.141.134 with SMTP id ro6mr3124450pab.14.1476157381531; Mon, 10 Oct 2016 20:43:01 -0700 (PDT) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id z6sm1141327pay.31.2016.10.10.20.42.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Oct 2016 20:43:00 -0700 (PDT) From: Tino Calancha To: Andreas =?utf-8?Q?R=C3=B6hler?= Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> Date: Tue, 11 Oct 2016 12:42:35 +0900 In-Reply-To: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> ("Andreas \=\?utf-8\?Q\?R\=C3\=B6hler\=22's\?\= message of "Fri, 7 Oct 2016 08:42:36 +0200") Message-ID: <87fuo3r1p0.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) 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: 24627 Cc: 24627@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.0 (/) Andreas R=C3=B6hler writes: > On 06.10.2016 11:43, Tino Calancha wrote: > > bounds-of-thing-at-point: > > ;; Try moving forward, then back. > (funcall ;; First move to end. > (or (get thing 'end-op) > > Still think bounds-of-thing-at-point should move backward first > > parse-partial-sexp offers some handy info for beginning, not end I agree with you that `bounds-of-thing-at-point' needs some work. I have noticed other issues with it. We might work on them once we fix this bug. In the example in this thread the problem arise because `thing-at-point-bounds-of-list-at-point', which is the actual function doing the job here. We need to fix this function. Without it, the previous example works: emacs -Q thingatpt.el -eval "(require 'thingatpt)" M-: (put 'list 'bounds-of-thing-at-point nil) RET > C-p M-: (thing-at-point 'list t) RET =3D> nil From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 11 11:29:47 2016 Received: (at 24627) by debbugs.gnu.org; 11 Oct 2016 15:29:47 +0000 Received: from localhost ([127.0.0.1]:52308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btyzy-0004k1-Rm for submit@debbugs.gnu.org; Tue, 11 Oct 2016 11:29:47 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:59460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btyzx-0004jm-Eg for 24627@debbugs.gnu.org; Tue, 11 Oct 2016 11:29:46 -0400 Received: from [192.168.178.35] ([95.119.246.214]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0Mch4z-1bcAzo1iVN-00HxtR; Tue, 11 Oct 2016 17:29:37 +0200 Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list To: Tino Calancha References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> Date: Tue, 11 Oct 2016 17:37:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <87fuo3r1p0.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:KvQEM0cPAx2hfXfHymDglpsodYc1vs3XCCiGdCjXecvMixQczWV 3r+JCJy3xn+Q7BzpCSOCa/yCUC7XiXSWGXZyiv9lhf0qw9lHkKds4pfYokmOqSZY63sUgDE hi3wle/1qdsyn4jjXDp3O7i8Vs29y8aCBtOYhTBtvMHmYOiNahTlNHFFwTeygr6YHHl6vfn XqZNRUaUvfHjPydSn7PLw== X-UI-Out-Filterresults: notjunk:1;V01:K0:cU58GHUN554=:ectRAGLjFUcNPSiv9tKD2H vIV2mVQd+H0h033X8kvDTe7bahFkKqWfKdm7qgJZlNlr0M4Kp6OUSg2Yt0nM3dFsjv137QQTz F/rRNcXYQySQ/Jp0xNw83NU1MJyiiFrrSFSgClAoeJOk5d4pm7ciovNvLF1xBjbZvaRVtZwDK 4n0Nilue9A4eCJ60MAOCNyWvqjM2gxc1pN7BaHKE7QQZCPIX7raf95hSIjEe/Dq68uk46oS5m 1lcsmsgHf800Ms8V0AWW7ITjzJe9hkrEiqPViAB682UXdkO+z26wnARKzMxx4a/DXDkOr1ZQE 2lR6Ph1AFd729tuV8pueHsH+jl3QANH/lDOG656P/h8+4RrA6892TXbSwZ1EAooIOrQv/IM3W YU3b/XhQCwlpGfGv0rG0sm8ZwZLdtRI9Qgc64RHpEn+o+rSMt9H7W7RxDPOpqWtwnCo4125b3 3Ia4jjcPVJk5oFfbiTb+wyNBaE3vhvqtqQLS5mZcIS5bnZwvqHlTHHTa1oeWBz65wtlzgLKhu cOLHlEAMBzTRX0rBixMEZzRziwNkqvAh1VcU3NvHo8iAnmKJ3F8bs/WsC6foQzEvxp+a2cvzD wfNd6UpvcBbdsi7j0za1T1DXK6kvfKveu5HOYZwvtVsN4YhD9rUZnke94e1vxtfaeQQY3Tw/B BfRCCtsBmiNVRiFgjnvtHNH/LvxbvAES2zU2rwuKvjpUjiOqmdslptQbG8qjad7XovDdT/4l7 tfpAUJHBCk+QhOYTb95bfenW6tMxc29hmaIk0A== X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 24627 Cc: 24627@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.5 (/) On 11.10.2016 05:42, Tino Calancha wrote: > Andreas Röhler writes: > >> On 06.10.2016 11:43, Tino Calancha wrote: >> >> bounds-of-thing-at-point: >> >> ;; Try moving forward, then back. >> (funcall ;; First move to end. >> (or (get thing 'end-op) >> >> Still think bounds-of-thing-at-point should move backward first >> >> parse-partial-sexp offers some handy info for beginning, not end > I agree with you that `bounds-of-thing-at-point' needs some work. I have > noticed other issues with it. We might work on them once we fix this bug. > > In the example in this thread the problem arise because > `thing-at-point-bounds-of-list-at-point', which is the actual > function doing the job here. We need to fix this function. > Without it, the previous example works: > > emacs -Q thingatpt.el -eval "(require 'thingatpt)" > M-: (put 'list 'bounds-of-thing-at-point nil) RET >> C-p > M-: (thing-at-point 'list t) RET > => nil With (defun foo ()) at first open paren M-: (thing-at-point 'list t) RET returns the whole thing, right. But at second open paren returns the whole function too - where it should return the empty arg-list From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 11 12:29:25 2016 Received: (at 24627) by debbugs.gnu.org; 11 Oct 2016 16:29:25 +0000 Received: from localhost ([127.0.0.1]:52348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btzvh-00067t-Km for submit@debbugs.gnu.org; Tue, 11 Oct 2016 12:29:25 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:35884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btzvf-00067f-PS for 24627@debbugs.gnu.org; Tue, 11 Oct 2016 12:29:24 -0400 Received: by mail-pa0-f44.google.com with SMTP id ry6so17484783pac.3 for <24627@debbugs.gnu.org>; Tue, 11 Oct 2016 09:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:cc:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=WcHWNuRM4Iha7FDwNqOGjSy65XVjiIRapt9KftJKAhw=; b=nae+9T20dZkoalBBdHItqO+XUdjoVTUXJTFVfb+XiqHuCCq5HMK6O+9X7HpmxOpblV FNAz3r9j6r2YKj9SwjBduEwT5oNvIVs5vHG++aC+QmNncg/rw55p1TGX/NjNtVKtLWPx xjk48k22V8ZW4kADPYeIfeh2fJmbZo6F4WdFvxbUqF0yRfbPpZxCoSJHeqD8c/Q1ppnf y0iPW2HaAUGDq42jGsPZ26ULPuCHEHru53yUD2hHj352TaCpP4LIHS3BciCIfzPu2I6n Vb1iZLLYw33q9yfWXVM2r5ZEAPBbj4OVJe42ZDiBj+GX97EUx8BGufZJMS2NxYlcOZhJ yVZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:references:cc:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=WcHWNuRM4Iha7FDwNqOGjSy65XVjiIRapt9KftJKAhw=; b=OV0jx+2xsw7Z30p6S0WAfZqPZrB6An0WY9MSuSqSMSIb9jQvR5T99ugk0vodJg7M3G EF4WaO8p+mk2D1gB5tgjYz3vL+tWokRRFen1xRsA088C+vMOI6Q7OCcBkZGwf15cMZL4 ILl2lbvmLvSDfUL36iHW+X37aFZNI+/Tub8xgjJSLuhAFcXcW/8TycFFpEHlW/fJFEIc UmZ5el9HY5V6oKLKROl1vn8kTKgXJLrz1z/olx58ChPLx4kZlSUGl3enPiJUoyzK6K0q +iK8Z1P1G4PmqvmHUx8AdOgEN8EcxioMNKnpN/jutJSZXiURKGrJ+Oo8s5ZydC+yt1gl RGlg== X-Gm-Message-State: AA6/9Rn50tnh27/aglldg9XdC7lf4dxxN8KKu3xA5QkWQd3KFO8POmBzdMu2Jp40kh0DNg== X-Received: by 10.66.72.225 with SMTP id g1mr8228555pav.166.1476203357931; Tue, 11 Oct 2016 09:29:17 -0700 (PDT) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id sa1sm5426295pac.34.2016.10.11.09.29.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Oct 2016 09:29:17 -0700 (PDT) From: Tino Calancha To: Andreas =?utf-8?Q?R=C3=B6hler?= Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> Date: Wed, 12 Oct 2016 01:29:08 +0900 In-Reply-To: <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> ("Andreas \=\?utf-8\?Q\?R\=C3\=B6hler\=22's\?\= message of "Tue, 11 Oct 2016 17:37:14 +0200") Message-ID: <878ttu97e3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24627 Cc: 24627@debbugs.gnu.org, tino.calancha@gmail.com 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.7 (/) Andreas R=C3=B6hler writes: > With > > (defun foo ()) > > at first open paren > > M-: (thing-at-point 'list t) RET > > returns the whole thing, right. > > But at second open paren returns the whole function too - where it > should return the empty arg-list Following patch do the right thing in my example and your example. Feel free to check it with some other examples that you may have: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;; >From dc2703a43a7b5dae60f7e88805971472253d4600 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Wed, 12 Oct 2016 01:16:52 +0900 Subject: [PATCH] (thing-at-point 'list) return nil if no list at point * lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): Check first if we are at the beginning of a top-level sexp (Bug#24627). Escape '[' and ']' in doc string. --- lisp/thingatpt.el | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 6d1014b..acacff2 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -219,22 +219,18 @@ 'beginning-of-sexp =20 (defun thing-at-point-bounds-of-list-at-point () "Return the bounds of the list at point. -[Internal function used by `bounds-of-thing-at-point'.]" +\[Internal function used by `bounds-of-thing-at-point'.\]" (save-excursion (let ((opoint (point)) - (beg (ignore-errors - (up-list -1) - (point)))) + (beg (if (looking-at-p "(") + (point) + (ignore-errors + (up-list -1) + (point))))) (ignore-errors - (if beg - (progn (forward-sexp) - (cons beg (point))) - ;; Are we are at the beginning of a top-level sexp? - (forward-sexp) - (let ((end (point))) - (backward-sexp) - (if (>=3D opoint (point)) - (cons opoint end)))))))) + (when beg + (forward-sexp) + (cons beg (point))))))) =20 ;; Defuns =20 --=20 2.9.3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;; In GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.1) of 2016-10-11 Repository revision: 9640e9f4e95cd95c04875e90a4ff638e1e51f977 From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 11 12:47:21 2016 Received: (at 24627) by debbugs.gnu.org; 11 Oct 2016 16:47:21 +0000 Received: from localhost ([127.0.0.1]:52365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0D3-0006Yg-2R for submit@debbugs.gnu.org; Tue, 11 Oct 2016 12:47:21 -0400 Received: from mail-oi0-f45.google.com ([209.85.218.45]:34733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0D2-0006YU-2H for 24627@debbugs.gnu.org; Tue, 11 Oct 2016 12:47:20 -0400 Received: by mail-oi0-f45.google.com with SMTP id t73so30570764oie.1 for <24627@debbugs.gnu.org>; Tue, 11 Oct 2016 09:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nLji4asj9Dsf549GIIEta1uBFpW8FgActFm2y/ukY74=; b=xktJtQWh8ZWvu1SR4bcx1HE4QhxE2GCf67rhDX1MslPfujRCCNliSYRn7fwBd4umqT DEUsw5iL+gRldSmMgO5VLW4J8NGeG2ubGEtyPqAYI718VAG1JTXvq7SaXrJMQAHe4QfP xQT+KefHc/s+zedPHtdqkMrV2DGFOe6Lq+/Pr+5ES66CmCKZj+iFqv7LR9FeVzhsSm2H MdRperv3AqVdirTMcuKeQG88eIIhSjEco67nraMU4gOf53NtI+fYohzt3AV1iEoaMBQb 71k1ZXqsF6OBKClOsIEG9qtdz33NFpN0OnmilYHfV/9VT/lXM91cv6d81kCpFY5qowSe 4zUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nLji4asj9Dsf549GIIEta1uBFpW8FgActFm2y/ukY74=; b=Fkg5tHtNU1HnpOSHI2F1CELmLsGtC1Rb2CiUNA/71Y26kw6KiN2xVghS7otbOMGGCi uOgFsrdkLDSMpj5LVMi8Gvbzi4xjNjLCg9B6j7dMkY/ahLGS7o23uMp/Jm1D6Q/f5vIC IR6cjvT/Gh0sCzHnfz18W2zET/2eUTrl7eCjUfAP8YUjY6zQOGxj4exfwrDyimZ85CYT S/rtUdG00lBqRqFFaxxCa5hHYKfqJmHfps6f/5IsG3RCDCNl9CsKMytV5nKtX+OdkM8z kwtEvmpFUd9mMeOI2u6eVvHZfcQE6isitJv6HFJ86XH6sIkQllOr/OpZ4CeKZ5h6aeap wp1g== X-Gm-Message-State: AA6/9RmQrx+UZsrwce8UB6RXDmRJm2ayMMopFYDQ7DoRX/cSmaYkoNWFFroQG9FdRq7BJcAPNqYZY1A8DvBa0w== X-Received: by 10.202.83.198 with SMTP id h189mr1374136oib.89.1476204434434; Tue, 11 Oct 2016 09:47:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.42.16 with HTTP; Tue, 11 Oct 2016 09:47:13 -0700 (PDT) In-Reply-To: <878ttu97e3.fsf@gmail.com> References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> From: Noam Postavsky Date: Tue, 11 Oct 2016 12:47:13 -0400 X-Google-Sender-Auth: qcIyzgCdpFcFh2gpHxdqMRV2Fic Message-ID: Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list To: Tino Calancha Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 24627 Cc: =?UTF-8?Q?Andreas_R=C3=B6hler?= , 24627@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.5 (/) On Tue, Oct 11, 2016 at 12:29 PM, Tino Calancha wrote: > Escape '[' and ']' in doc string. Huh? Why? > -[Internal function used by `bounds-of-thing-at-point'.]" > +\[Internal function used by `bounds-of-thing-at-point'.\]" From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 11 13:09:16 2016 Received: (at 24627) by debbugs.gnu.org; 11 Oct 2016 17:09:16 +0000 Received: from localhost ([127.0.0.1]:52385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0YF-000757-QJ for submit@debbugs.gnu.org; Tue, 11 Oct 2016 13:09:15 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:33439) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0YE-00074t-18 for 24627@debbugs.gnu.org; Tue, 11 Oct 2016 13:09:14 -0400 Received: by mail-pa0-f44.google.com with SMTP id vu5so18034251pab.0 for <24627@debbugs.gnu.org>; Tue, 11 Oct 2016 10:09:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=VprFDLdqWcvd6KNKFNobq2RArws8GgXjInqmRfsVK8Y=; b=DIgiYnmabQbC7MkSdoyX9YSag6iVafBo//jcR7MT1NwvBanVV5b1n27/mdCK7IO7yX vd0BGOK+icol9uRaJmwo49G+7mn6Q+RrOjUfZrhju6QDaezlZMwyRMmkjK5LGIeGfc8B mw2YvzT4vOCBRtVQqa6bdOFr8taJI9+TVse2+HZTf3TVrw+gtwuDIUJEqlAcncoB3SSF /J/asombPNTFR6GESdSw7pvM8FSrP+1+JhjS0LcwEYZsd6BeoLUrm/GBdtmKee+8XYqI Zm5FHmld304RaLLTNB47pU0Bowsk0O2bFDxJ4V1VUrjXwBgl/OKgtg68NEeqSyfMQ0It R7HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=VprFDLdqWcvd6KNKFNobq2RArws8GgXjInqmRfsVK8Y=; b=UIIRZxdGdpdc6fCqwAeW53VQf0E3cr/gRh685r1sNWbdphEEd1d3kIUe1Vm8jBaYzB XLUCxc7vCgSb7OSS6DeWIVhSgwliSLmricOwMekHn0q/h3+/GDG4xmK1+lNruKwWcTKX 3ogZ+egpcsgwJrgtnOh/FFqJu/z5CxAJCoFYu7qWSWmLqLux2fQC9W+izRhQSDGNPVdK a9uaAAu1GoJHoqcSyw9gL5hciTCDma5doJNGKcIqEJjLjDbDgI7TrxjyOMWvZpnV1hsC KXMpvTU4PnOZ1h96Lay4m3OpuSnfDJ1CSZNDw/AjioXlBO8AScYtDD5ypGOEtc/YuhXi mnCQ== X-Gm-Message-State: AA6/9RmlN3KpFggmyJIVUoHY1MqQLBK/yrljmgyPEZOaqfb0OMz6NwFemz8zYrkz8lgaHA== X-Received: by 10.66.6.3 with SMTP id w3mr8596899paw.172.1476205748306; Tue, 11 Oct 2016 10:09:08 -0700 (PDT) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id i63sm5594090pfi.64.2016.10.11.10.09.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Oct 2016 10:09:07 -0700 (PDT) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Wed, 12 Oct 2016 02:09:04 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Noam Postavsky Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list In-Reply-To: Message-ID: References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24627 Cc: =?ISO-8859-15?Q?Andreas_R=F6hler?= , 24627@debbugs.gnu.org, Tino Calancha 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.7 (/) On Tue, 11 Oct 2016, Noam Postavsky wrote: > On Tue, Oct 11, 2016 at 12:29 PM, Tino Calancha wrote: >> Escape '[' and ']' in doc string. > > Huh? Why? > >> -[Internal function used by `bounds-of-thing-at-point'.]" >> +\[Internal function used by `bounds-of-thing-at-point'.\]" Right, i should just escape the open '[', as follows: +\[Internal function used by `bounds-of-thing-at-point'.]" From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 11 13:15:35 2016 Received: (at 24627) by debbugs.gnu.org; 11 Oct 2016 17:15:35 +0000 Received: from localhost ([127.0.0.1]:52389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0eN-0007E1-GD for submit@debbugs.gnu.org; Tue, 11 Oct 2016 13:15:35 -0400 Received: from mail-oi0-f44.google.com ([209.85.218.44]:33701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0eL-0007Dp-TR for 24627@debbugs.gnu.org; Tue, 11 Oct 2016 13:15:34 -0400 Received: by mail-oi0-f44.google.com with SMTP id y2so31665667oie.0 for <24627@debbugs.gnu.org>; Tue, 11 Oct 2016 10:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=/Fu7b0xF4jhkasur0NwATY+E01RJ9TX9WkC9i9QxZts=; b=tCnvwkyM4mkHi83G9cxE78EXORgJF/ATRgVPSQTrqcKZbZGx7rbBKF4uocH4rZQNsh 8o/OgeYfuutIXxmytuBQO1hVtJqeFKaAIrggNT4cls/yR5MYZ0HEIMF15TLjpO3ElCDA 9sE/ObAa26AD+Ypkiqfiz/NMoomvuI+td1Wg/RkwqRlDDNGuL5MnNnjPoDsdS9tZs0PV soNS61pHpoQH5j+QJoyufny8WUMhKQGtKw8EkDa533WOOE10pVW/uJDF8F+CELmZzHEI L8C0VtL4VflOG0Pop7DddzI2uToA3mjnVmU3vpA+UUlLc0JGsPSp8giEL6plGQh/Ujsc ZV6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=/Fu7b0xF4jhkasur0NwATY+E01RJ9TX9WkC9i9QxZts=; b=GlXywLq4qcJ1A/TByBldPF+ptQaDTffOnom1an48EVwMp03oI9lgWBH3fX7k3fQMzc s5+w4ebl8ZdisicMnOZ6AbPuY6pqAhQBekcgzN7uhPxMkdBgdoeclwjdGtGxcTjgK+eW 80q9Kvzzy1LnnYtyHZNkOa0ma7pFlgYCXKCtyIHXTPMQX/0JlWxF761Pe/i3APqF2g1I qHVVJ4yglMTaWpCDzi0Y4dLD3ZuNMSX7p/A1zvWwNJIza4kl5MNbCwldW2XdK0Q4WKC0 v8vQJu1Ql+MaLMVLoIRw3ubx63mIcUkqylAgK/GyA4SAaLoMUiPRwBxeueYkxnNYOtBO ASHw== X-Gm-Message-State: AA6/9Rn0lVuPHRPLGTK4sOwFpLOvryKyOZFxAxDJawTWfmc6opiI5+S2El0XfY5sD8X8v2ixGw5kWRR7S4X0Dw== X-Received: by 10.157.53.17 with SMTP id o17mr2464529otc.37.1476206128467; Tue, 11 Oct 2016 10:15:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.42.16 with HTTP; Tue, 11 Oct 2016 10:15:27 -0700 (PDT) In-Reply-To: References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> From: Noam Postavsky Date: Tue, 11 Oct 2016 13:15:27 -0400 X-Google-Sender-Auth: k2BzmcuonS_8CtI1I6teyZd8XHY Message-ID: Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list To: Tino Calancha Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 24627 Cc: =?UTF-8?Q?Andreas_R=C3=B6hler?= , 24627@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.5 (/) On Tue, Oct 11, 2016 at 1:09 PM, Tino Calancha wrote: > > > On Tue, 11 Oct 2016, Noam Postavsky wrote: > >> On Tue, Oct 11, 2016 at 12:29 PM, Tino Calancha >> wrote: >>> >>> Escape '[' and ']' in doc string. >> >> >> Huh? Why? >> >>> -[Internal function used by `bounds-of-thing-at-point'.]" >>> +\[Internal function used by `bounds-of-thing-at-point'.\]" > > Right, i should just escape the open '[', as follows: > +\[Internal function used by `bounds-of-thing-at-point'.]" Oh, I thought only round parens need to be escaped in the 1st column. Is there something that looks for square brackets too? From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 11 13:16:45 2016 Received: (at 24627) by debbugs.gnu.org; 11 Oct 2016 17:16:45 +0000 Received: from localhost ([127.0.0.1]:52393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0fU-0007GD-Q3 for submit@debbugs.gnu.org; Tue, 11 Oct 2016 13:16:45 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:22896) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0fT-0007Fx-5N for 24627@debbugs.gnu.org; Tue, 11 Oct 2016 13:16:43 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u9BHGYPE013379 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Oct 2016 17:16:35 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.14.4) with ESMTP id u9BHGXaE013392 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Oct 2016 17:16:34 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u9BHGV16031293; Tue, 11 Oct 2016 17:16:32 GMT MIME-Version: 1.0 Message-ID: <664b1d26-9a9e-4294-a216-d1a26f792927@default> Date: Tue, 11 Oct 2016 10:16:30 -0700 (PDT) From: Drew Adams To: Tino Calancha , =?utf-8?B?QW5kcmVhcyBSw7ZobGVy?= Subject: "internal" designation [was: bug#24627: 24.5; (thing-at-point 'list) ...] References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> In-Reply-To: <878ttu97e3.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 24627 Cc: 24627@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: -2.6 (--) > (defun thing-at-point-bounds-of-list-at-point () > "Return the bounds of the list at point. > -[Internal function used by `bounds-of-thing-at-point'.]" > +\[Internal function used by `bounds-of-thing-at-point'.\]" FWIW: I object to such an "internal" designation being in that doc string. What's the point of that? What makes this function particularly "internal"? Seems like a gratuitous characterization (at best). That the function is used by `bounds-of-thing-at-point' is obvious, and anyway that fact does not belong in its doc string. IMHO, there is too much of this trying to wall off this or that as beomg in some sense "internal" (with no explanation, including no code comment, as to what makes it internal). The definition typically given for this characterization is that the thing so designated is _liable to change_. Big deal - lots of stuff is liable to change. Saying that doesn't help anyone. How liable? Why liable? And when such a thing does change, it is likely that other things, not designated as "internal" also change, including user-visible behavior. IOW, the thing walled off is often not really internal at all - the code is not just one implementation of a given (stable, non-internal) interface. Typically, there is nothing special or tentative about the code. Emacs and Emacs Lisp are things that invite users to dig into and change them. Emacs is not your typical software use and development. (Likewise, free software, BTW: there is no solid separation between user and developer.) For Emacs, this "internal" designation is generally a useless crutch, IMO. And my impression is that recently (the last several years) its use has been spread much more. In the more distant past it was very rarely resorted to, if at all. And I don't think anyone suffered from its lack of use. No one needed to be warned that this or that might change. My sense is that this has been used more and more simply as a way of warding off users from offering suggestions about the thing that is so "protected", whether it be requesting better doc or something else. My estimation of the "internal" label contagion is this: from useless to nefarious. It seems unemacsy, trying to put an unnecessary wall between Emacs development and Emacs users. There should be little or no reason for Emacs to tell users "don't use this". Removing the "internal" nonsense for this function would be a start... From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 11 13:21:22 2016 Received: (at 24627) by debbugs.gnu.org; 11 Oct 2016 17:21:22 +0000 Received: from localhost ([127.0.0.1]:52397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0jx-0007N1-Qc for submit@debbugs.gnu.org; Tue, 11 Oct 2016 13:21:22 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:36282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0jw-0007Mp-7R for 24627@debbugs.gnu.org; Tue, 11 Oct 2016 13:21:20 -0400 Received: by mail-pf0-f177.google.com with SMTP id e6so5214815pfk.3 for <24627@debbugs.gnu.org>; Tue, 11 Oct 2016 10:21:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=uH9sMiFksgj7IYiMuDAPrwq4thx5eaL8xEbRHm6xqnk=; b=gGqT6P342OPTzHNLYA1lE4TZ6g1nYAQ7mHVLY1yhFFXJ+iMRjSSCdaKTYxMIk2I7lT rV03vsvnVh+NL7fLIa3tsARD6wN5yl+780iThPatZ38ydYS56ZSa5kD4XtQyDioBmVhU 5GC2SdDEyXKRLs13h131z6HHqSruXGPjAoMAbbWqb6lJsvSj1DsCqc/ixzgV5h+mI4QZ TSqCNZXLro8qICWd06zsY8uJnr7UiiITrGqpza1+xZqwVQaZKI7jZVoWy6ybWVTvUNF0 ezXxEKIrQV6kWcIqULAJpfs6bC3apHoxhBVJQZjh6A/cga2JGFx7ADBTTXofsQtnWfo4 EKBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=uH9sMiFksgj7IYiMuDAPrwq4thx5eaL8xEbRHm6xqnk=; b=M8L92bJxSPWbD9HKoC6+TLkihX44n4zykiFTrk9gVZsunltOdxhcN/A2+vE6Jmx5QM LR1OTYu8ajG/Uzjj4K8IwC8luJ1zsB4zGDgWgX4Jx6MNsw2tlyXrT3bd+K2PLL6y0nfs OTKWBa+C2ViQbmgLBEShARZtgNW+EFLEbnDjrfcapMZEKcLAQFMVdNFq/FcT6EQj18z3 /TKpZXDDhLoKTzmABmH4jyp71FJDpynUVnZplLVJjTTBAgx/8W/QjPmqCMwc5qOiJw3O 6Rx9NMMKAKyCBmtbViIFMNcZlpvYtDbcdB2bQ7ojB6apuCJ9VY4w728hX6ZwnuWi2PxS wxLw== X-Gm-Message-State: AA6/9RlcRve/v3VbOoF4AoOFtEPfv6/2dGZo057Ivuv54t+w/yP7WLUeH143LIlcl6UsZg== X-Received: by 10.99.2.214 with SMTP id 205mr2641925pgc.1.1476206474537; Tue, 11 Oct 2016 10:21:14 -0700 (PDT) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id h87sm5644015pfj.78.2016.10.11.10.21.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Oct 2016 10:21:14 -0700 (PDT) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Wed, 12 Oct 2016 02:21:11 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Noam Postavsky Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list In-Reply-To: Message-ID: References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 24627 Cc: =?ISO-8859-15?Q?Andreas_R=F6hler?= , 24627@debbugs.gnu.org, Tino Calancha 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.0 (/) On Tue, 11 Oct 2016, Noam Postavsky wrote: > On Tue, Oct 11, 2016 at 1:09 PM, Tino Calancha wrote: >> >> >> On Tue, 11 Oct 2016, Noam Postavsky wrote: >> >>> On Tue, Oct 11, 2016 at 12:29 PM, Tino Calancha >>> wrote: >>>> >>>> Escape '[' and ']' in doc string. >>> >>> >>> Huh? Why? >>> >>>> -[Internal function used by `bounds-of-thing-at-point'.]" >>>> +\[Internal function used by `bounds-of-thing-at-point'.\]" >> >> Right, i should just escape the open '[', as follows: >> +\[Internal function used by `bounds-of-thing-at-point'.]" > > Oh, I thought only round parens need to be escaped in the 1st column. > Is there something that looks for square brackets too? I thought the same than you. I just discovered in this bug that square parens also matters: Compare I), II) w/o and w/ escaped '[': I) It confuses `beginning-of-defun': emacs -Q thingatpt.el M-g g 229 RET C-M-a ; go to line 222 instead of line 220. II) It confuses `indent-for-tab-command': emacs -Q thingatpt.el M-g g 220 RET C-SPC C-M-e TAB ; indentation doesn't change and it looks wrong. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 11 13:21:36 2016 Received: (at 24627) by debbugs.gnu.org; 11 Oct 2016 17:21:36 +0000 Received: from localhost ([127.0.0.1]:52400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0kC-0007NW-2n for submit@debbugs.gnu.org; Tue, 11 Oct 2016 13:21:36 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:26155) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0kA-0007NH-E7 for 24627@debbugs.gnu.org; Tue, 11 Oct 2016 13:21:34 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u9BHLQY5019951 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Oct 2016 17:21:27 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u9BHLQom021059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Oct 2016 17:21:26 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u9BHLOjF001504; Tue, 11 Oct 2016 17:21:25 GMT MIME-Version: 1.0 Message-ID: Date: Tue, 11 Oct 2016 10:21:23 -0700 (PDT) From: Drew Adams To: Tino Calancha , =?utf-8?B?QW5kcmVhcyBSw7ZobGVy?= Subject: RE: bug#24627: "internal" designation [was: bug#24627: 24.5; (thing-at-point 'list) ...] References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> <664b1d26-9a9e-4294-a216-d1a26f792927@default> In-Reply-To: <664b1d26-9a9e-4294-a216-d1a26f792927@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 24627 Cc: 24627@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: -2.6 (--) Sorry - I meant to send my reply about "internal" to emacs-devel, not here. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 11 14:32:46 2016 Received: (at 24627) by debbugs.gnu.org; 11 Oct 2016 18:32:46 +0000 Received: from localhost ([127.0.0.1]:52441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu1r4-0000fi-7b for submit@debbugs.gnu.org; Tue, 11 Oct 2016 14:32:46 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:49659) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu1r3-0000fW-2h for 24627@debbugs.gnu.org; Tue, 11 Oct 2016 14:32:45 -0400 Received: from [192.168.178.35] ([95.119.246.214]) by mrelayeu.kundenserver.de (mreue001) with ESMTPSA (Nemesis) id 0LtzWQ-1au3sZ1oD0-011VfB; Tue, 11 Oct 2016 20:32:37 +0200 Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list To: Tino Calancha References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: <781dea94-9f15-8bd2-66f5-055b55497471@easy-emacs.de> Date: Tue, 11 Oct 2016 20:40:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <878ttu97e3.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:KH2Yze80dfuthZV18xBqd0x21NUFtORTkKHMFxUgn9P5jIyZlnv RNcNkVnPRmnj8fVZz7K9N3+AoE8YzgR2HuOuBDdQxwTLJSlGiceaX1HHirhXIc8csSOOn1t H8eb3vd997Nv1VYaQnCRcBCxMkY4jfuG2gTf2wuv/8YP/dueUeNBTf4N64CuZl7E+F3tMpy aUMt6XPkv+aPXssAMIFug== X-UI-Out-Filterresults: notjunk:1;V01:K0:MEl87KZQOr4=:qG6gzWdjg1U/wvbiFhNk7/ /G6enPxT3YS0AeBt3HyJdE2DpLEOmydPrAa0iKegMeOaDxV5LWqXBKsm8LA/SjjF+GQJSgwqp aoJiS3ILxq4VAlkBAYboy/V/xZ6jyXvwze/vWy+OmWgF/rXvdJh4kW8lPmpoIPN3/ycU6hqKX jhTcIX3G+Y8QrwZkvwDMlW0CMoFIJSa/MDUsSTF1M7HtwEOHle0JAXxbBNNkrIKFFcqgZpOtM kLwg5U86I3UfghTUQMfQUY3j/qrsHLeZ7aYG2JTVjHxWHz394Drm4SITG5gzlY6RNLWImc7sr gOI+8yxRH3pK3PmKPQLghGjjVa8mZOibDzg3YyGVzYDiDjC7SeQkBKcuzfh7BvOsIihdpLtRB fhPWlnUWWDQQnNV+23+/dATvmsIAdENuDWe+pG3V7VHWs5Hzokwvkk9AX/m14aK5BvklhU0iW t5RzwUP41TaEnGCvDjcW4HmziDwK1HG+PYeuQj1ZI3hoqtcTWRH/l96x3ewnp6lh2m+/3L5RS QqD3EQ1BtPSOUk2MQL3E+zuygN374fHcROHIYGZkMnPigIvBjw0EB/Fm+3p10hpT+iQMiy+xq K/S7vaPyJ+s4GfVBmqRz3j50cWmPFW0uAKVtShVhTqva1k6mCH2y7i+/3Kwg1QuUn0vTnJOaW FJEjSWBjM4Q2QGDZ1N8v5xz6IT1dCfXorustS9ZHV+zvPwwU9U/FkVI+oWv2ql3s+YSx0S9zX DK0h0G8PqT+1itoOdH1K9i0VdUzMVg6iFwzigA== X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 24627 Cc: 24627@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.5 (/) On 11.10.2016 18:29, Tino Calancha wrote: > Andreas Röhler writes: > >> With >> >> (defun foo ()) >> >> at first open paren >> >> M-: (thing-at-point 'list t) RET >> >> returns the whole thing, right. >> >> But at second open paren returns the whole function too - where it >> should return the empty arg-list > Following patch do the right thing in my example and your example. > Feel free to check it with some other examples that you may have: > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > From dc2703a43a7b5dae60f7e88805971472253d4600 Mon Sep 17 00:00:00 2001 > From: Tino Calancha > Date: Wed, 12 Oct 2016 01:16:52 +0900 > Subject: [PATCH] (thing-at-point 'list) return nil if no list at point > > * lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): > Check first if we are at the beginning of a top-level sexp (Bug#24627). > Escape '[' and ']' in doc string. > --- > lisp/thingatpt.el | 22 +++++++++------------- > 1 file changed, 9 insertions(+), 13 deletions(-) > > diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el > index 6d1014b..acacff2 100644 > --- a/lisp/thingatpt.el > +++ b/lisp/thingatpt.el > @@ -219,22 +219,18 @@ 'beginning-of-sexp > > (defun thing-at-point-bounds-of-list-at-point () > "Return the bounds of the list at point. > -[Internal function used by `bounds-of-thing-at-point'.]" > +\[Internal function used by `bounds-of-thing-at-point'.\]" > (save-excursion > (let ((opoint (point)) > - (beg (ignore-errors > - (up-list -1) > - (point)))) > + (beg (if (looking-at-p "(") > + (point) > + (ignore-errors > + (up-list -1) > + (point))))) > (ignore-errors > - (if beg > - (progn (forward-sexp) > - (cons beg (point))) > - ;; Are we are at the beginning of a top-level sexp? > - (forward-sexp) > - (let ((end (point))) > - (backward-sexp) > - (if (>= opoint (point)) > - (cons opoint end)))))))) > + (when beg > + (forward-sexp) > + (cons beg (point))))))) > > ;; Defuns > Hmm, what if cursor is inside a string or comment? BTW "list" might be more universal if understood syntactically What about writing (eq 4 (car (syntax-after (point)))) From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 12 00:58:18 2016 Received: (at 24627) by debbugs.gnu.org; 12 Oct 2016 04:58:18 +0000 Received: from localhost ([127.0.0.1]:52618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buBcQ-0000H7-Aq for submit@debbugs.gnu.org; Wed, 12 Oct 2016 00:58:18 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:35960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buBcP-0000Gu-6b for 24627@debbugs.gnu.org; Wed, 12 Oct 2016 00:58:17 -0400 Received: by mail-pf0-f178.google.com with SMTP id e6so12704313pfk.3 for <24627@debbugs.gnu.org>; Tue, 11 Oct 2016 21:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:cc:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=pZ2ttU+hgIS/59Are0ts0RlxdBevmYuRKY9bJQ03Gbc=; b=t8VHM3O5XWzKKXMkxqJ/Xo/685NliBibzvK5O/TMSypLpSwvIM2Jcng0LCCfRYRZTG pJ6UAImRPo8qdAq9zbnCxnBmfxgLIGcXRe9SBphoYD2isu2FS83H2pjevSre1kZLY452 SEe6gq8u90z7dBK2T4uRr3hYxD3t4vyzc+oqpkMhnaebobxtjcO29WW2UZO4nGvxiwHd y3Hp6atCwAXZceHX+dql9YbVX2aVv4g8nNKIrtEaufwlZhJsBYnqxs8QNjX1Hz2bRR0f diLZemPJW31l+IGh6rPA43AAq+qvmO3ZwZjTLkTBlGLi5z2+3+w572+QNQsJ1sWiHc5j Ky8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:references:cc:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=pZ2ttU+hgIS/59Are0ts0RlxdBevmYuRKY9bJQ03Gbc=; b=ICX9l5tFyXb7PsX2iKNFNfdKPPld6ogp/P1jQXjE0/DnZS8FIovU8Ana9A9VFwiEQ0 qU4q6eAljchk28KqqtYTwUCYTo6LhbXzwiwwXvseabkh0LQ1Ro4ApXHlh72e/p+4/RH/ WZLpbLX+pT3f4fxFUsq2zw9n/Mho5180/+WWR74G9yw6i05GsASxg3ZacQ0goQtBnZ3J ZS3GXNf6yvT2mCqLli98PN05sdfKRtE4owxhCBNQCBBYn2aAG/Ics286UNebn2v/TK/F 45/zi8B6CrfzXYo3A5XRCuVsdscPLRRw2YkFprwhFQNgX+zS1rJJIE1FHsJl1X0VC5eO ZsTg== X-Gm-Message-State: AA6/9Rnw9m2fn5Inq9LUlhGRwvamEEMs0u1Zre2er68iphifhWg9NSEx2qtFfWbxJGA9FA== X-Received: by 10.99.124.72 with SMTP id l8mr6116715pgn.63.1476248291260; Tue, 11 Oct 2016 21:58:11 -0700 (PDT) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id z6sm8057615pay.31.2016.10.11.21.58.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Oct 2016 21:58:10 -0700 (PDT) From: Tino Calancha To: Andreas =?utf-8?Q?R=C3=B6hler?= Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> <781dea94-9f15-8bd2-66f5-055b55497471@easy-emacs.de> Date: Wed, 12 Oct 2016 13:58:03 +0900 In-Reply-To: <781dea94-9f15-8bd2-66f5-055b55497471@easy-emacs.de> ("Andreas \=\?utf-8\?Q\?R\=C3\=B6hler\=22's\?\= message of "Tue, 11 Oct 2016 20:40:12 +0200") Message-ID: <87r37mupt0.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 24627 Cc: 24627@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.5 (/) Andreas R=C3=B6hler writes: > Hmm, what if cursor is inside a string or comment? The list will be returned anyway as thingatpt always does. AFAICT, skipping lists inside comments/strings would be a new feature for this lib: better request that in a separated bug report. > BTW "list" might be more universal if understood syntactically > What about writing > > (eq 4 (car (syntax-after (point)))) Agreed. Thank you! Here is the new patch: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;; >From 71da9ad4f6bbc307c5fb3f8bd0c6621312b2d4f4 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Wed, 12 Oct 2016 13:49:32 +0900 Subject: [PATCH] (thing-at-point 'list) return nil if no list at point * lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): Check first if we are at the beginning of a top-level sexp (Bug#24627). Escape '[' in doc string. --- lisp/thingatpt.el | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 6d1014b..421dcde 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -219,22 +219,18 @@ 'beginning-of-sexp =20 (defun thing-at-point-bounds-of-list-at-point () "Return the bounds of the list at point. -[Internal function used by `bounds-of-thing-at-point'.]" +\[Internal function used by `bounds-of-thing-at-point'.]" (save-excursion (let ((opoint (point)) - (beg (ignore-errors - (up-list -1) - (point)))) + (beg (if (eq 4 (car (syntax-after (point)))) + (point) + (ignore-errors + (up-list -1) + (point))))) (ignore-errors - (if beg - (progn (forward-sexp) - (cons beg (point))) - ;; Are we are at the beginning of a top-level sexp? - (forward-sexp) - (let ((end (point))) - (backward-sexp) - (if (>=3D opoint (point)) - (cons opoint end)))))))) + (when beg + (forward-sexp) + (cons beg (point))))))) =20 ;; Defuns =20 --=20 2.9.3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;; In GNU Emacs 26.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.1) of 2016-10-12 Repository revision: 9640e9f4e95cd95c04875e90a4ff638e1e51f977 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 12 03:03:17 2016 Received: (at 24627) by debbugs.gnu.org; 12 Oct 2016 07:03:17 +0000 Received: from localhost ([127.0.0.1]:52660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buDZM-0003JE-Q8 for submit@debbugs.gnu.org; Wed, 12 Oct 2016 03:03:16 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:50367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buDZI-0003Ix-Sm for 24627@debbugs.gnu.org; Wed, 12 Oct 2016 03:03:15 -0400 Received: from [192.168.178.35] ([77.12.110.26]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0MAuhQ-1bkHvy0XEy-00A0Jb; Wed, 12 Oct 2016 09:03:06 +0200 Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list To: Tino Calancha References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> <781dea94-9f15-8bd2-66f5-055b55497471@easy-emacs.de> <87r37mupt0.fsf@gmail.com> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: Date: Wed, 12 Oct 2016 09:10:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <87r37mupt0.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:5L0gbUjONshu7BPHjn3lb5eksTeBHtrQaQHt2UAfYMBMj/M/hB1 j7fXPmtkUirhxpRGiYGmX1J43CiG64jdwOqfRIdeilg+fZ50ROT6oDI056seJc+zEB4W5A2 EG8KtX5qcjoMJUT8Y8c8vffEm0RdW1WgcUT8qmlmybObzsuPxRxg+gR9zBdECZUUoV/bG7D XP2OMwyr7Zg3t2eOYluaA== X-UI-Out-Filterresults: notjunk:1;V01:K0:udoZiQbxaS0=:vBE87xaoKNQbGtKE9w+iBl Hxe5faeJPNxX/RfA15jMuHExn5y2H30h6dNAJYmCT2jNt57359NO8MvihPper8QtVRmgmVaHa MVg//ZTtCrUIc20ox09Z4lHJJKoKUEmkHgtDO/AA/u0ndW1pt5rzcLgAcD1urlVDCj5+YckzG wcQQsGQ5JcnavJsOtP4Jg46LNUNsgigeJCWStyMulAlm5+mqua0PF7Y06xkjK5xBDyCXKfyrz cU7qgsiX+37Ws11SjIxJYdcqTzn8Y6wZjLnqeVqpNB30AvS/j30pYAPc8WEFsih34flpfMoZG syVSvGBFdmf/RFg13c+QD06EFumjbZ2YznUgslV8rCs8Z6bOpVDJ1cCAvEm7wzfOw+WaQYL11 +yUCjapDdrvZ5E023t7MPw2JmKPJyK4x04XRyjaTBXD1VSQ+tfui9/LjxNmfIqcLxfMfVcTHy hOrlQwC3p7cNYu1EUqvShBWJ0n+7YKWntgd208rYwCGp06raW0GUZoA2UjkXN7IAtd5mMzq4S jIwHtWi5/NYK8CWdXFnV3SQbpEDAAyDwP2loxxWfdy8Tfg0SsPzs93YZjHXXfkhdKuBCWLgEK hZZVQcY5myPhWZGd8eDpeMO/ByPZ1lP5oM9qfZKIDFdrS/hbfkbcKI+MjzkvpzPMZaL9BfXd3 Ki5+OgLBJ48Rn55JDL5WsKkAwzkaKmR/5NpbWWQPMe1ERPrfprajYTGdDkkdwhpdZ0vKyBKcG x1Tqdl1wm4+QQwTa X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 24627 Cc: 24627@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.0 (/) On 12.10.2016 06:58, Tino Calancha wrote: > Andreas Röhler writes: > >> Hmm, what if cursor is inside a string or comment? > The list will be returned anyway as thingatpt always does. > AFAICT, skipping lists inside comments/strings would be a new feature > for this lib: better request that in a separated bug report. > > >> BTW "list" might be more universal if understood syntactically >> What about writing >> >> (eq 4 (car (syntax-after (point)))) > Agreed. Thank you! > Here is the new patch: > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > From 71da9ad4f6bbc307c5fb3f8bd0c6621312b2d4f4 Mon Sep 17 00:00:00 2001 > From: Tino Calancha > Date: Wed, 12 Oct 2016 13:49:32 +0900 > Subject: [PATCH] (thing-at-point 'list) return nil if no list at point > > * lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): > Check first if we are at the beginning of a top-level sexp (Bug#24627). > Escape '[' in doc string. > --- > lisp/thingatpt.el | 22 +++++++++------------- > 1 file changed, 9 insertions(+), 13 deletions(-) > > diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el > index 6d1014b..421dcde 100644 > --- a/lisp/thingatpt.el > +++ b/lisp/thingatpt.el > @@ -219,22 +219,18 @@ 'beginning-of-sexp > > (defun thing-at-point-bounds-of-list-at-point () > "Return the bounds of the list at point. > -[Internal function used by `bounds-of-thing-at-point'.]" > +\[Internal function used by `bounds-of-thing-at-point'.]" > (save-excursion > (let ((opoint (point)) > - (beg (ignore-errors > - (up-list -1) > - (point)))) > + (beg (if (eq 4 (car (syntax-after (point)))) > + (point) > + (ignore-errors > + (up-list -1) > + (point))))) > (ignore-errors > - (if beg > - (progn (forward-sexp) > - (cons beg (point))) > - ;; Are we are at the beginning of a top-level sexp? > - (forward-sexp) > - (let ((end (point))) > - (backward-sexp) > - (if (>= opoint (point)) > - (cons opoint end)))))))) > + (when beg > + (forward-sexp) > + (cons beg (point))))))) > > ;; Defuns > beg still needs a check like (not (nth 8 (parse-partial-sexp (point-min) (point)))) otherwise it could match inside a string or comment From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 13 04:50:16 2016 Received: (at 24627) by debbugs.gnu.org; 13 Oct 2016 08:50:16 +0000 Received: from localhost ([127.0.0.1]:53703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bubiS-00042Z-8w for submit@debbugs.gnu.org; Thu, 13 Oct 2016 04:50:16 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:35778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bubiQ-00042K-AB for 24627@debbugs.gnu.org; Thu, 13 Oct 2016 04:50:15 -0400 Received: by mail-pf0-f174.google.com with SMTP id s8so32261187pfj.2 for <24627@debbugs.gnu.org>; Thu, 13 Oct 2016 01:50:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=vFy5OVPBGQ3lKnN4BCwMgzbeVXptZ3q+Ulw0AezDQ2I=; b=gT9azstyGbIYQWXDgGEsvWXktIXG/Iz0RY4QTkfad+5JSRwALkke0qK+8UtpjQxzUY xNGb3T/7MZA9l+xTJB2M1Ze4D5/KSUQpZGW5xTFbJAjB122KQcheRp8S7O0Ce5PxEg2m 9lJPI/2u2jShIlxG2/it+Lm9X5K7isZvw1WpmLTHiB/ye3MEeCSfH1R8B73Yn6u/HCCS Fs4+EXK4H/C4NUAFh9Q2NKYa9vn/j+QD2Zd+9rJ4sstCGILJtOLloHcb6HWTi4j6Bml6 yjFEjBcbgLUoBnSGo2KOTb7GWCZxDJnyTm2uKXlgoQkGsrhWx9nzb/LvNYrMEAtJFsQ7 AeIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=vFy5OVPBGQ3lKnN4BCwMgzbeVXptZ3q+Ulw0AezDQ2I=; b=EmKbR9o31LgmG63xKSnJF1k6YYZoHeazW3ea1LITzX9ZkvpeuTu4c8cXy4SJciWbWq BX+WACSlMo3Qrvhs5cBeCTAY8P0LP3Kp0jfvV8aVhEssXyeOSHeB+IaKOaG4MM5tyE7X 682SYAF02DR3tiTDHwNcYfH79YfYA5anbHjPqRz1NEOU4VxQiqM01cStJbjAkkM4MU80 fY6Muh6UMF9AvTiEizLJi61izjZ+Q+BtcCqf2B1l5DGUS+zmmRz9E3XQi9m4TQHd66BV GAb734g6MuVbbTGqNb5N/c6O24X+dvcSjjm+L1YRCC+JSsgrEpczweW/O49X3aXVm8pK qtGw== X-Gm-Message-State: AA6/9RmnlKlqB/pP9dMyWYxOlc+gt7AK19XDsABVJq+yCckgGxFpBs9S9WebkG4M1fd/+g== X-Received: by 10.98.99.197 with SMTP id x188mr8348067pfb.121.1476348608659; Thu, 13 Oct 2016 01:50:08 -0700 (PDT) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id g21sm17618659pfb.43.2016.10.13.01.50.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Oct 2016 01:50:08 -0700 (PDT) From: Tino Calancha To: Andreas =?utf-8?Q?R=C3=B6hler?= Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> <781dea94-9f15-8bd2-66f5-055b55497471@easy-emacs.de> <87r37mupt0.fsf@gmail.com> Date: Thu, 13 Oct 2016 17:50:05 +0900 In-Reply-To: ("Andreas \=\?utf-8\?Q\?R\=C3\=B6hler\=22's\?\= message of "Wed, 12 Oct 2016 09:10:42 +0200") Message-ID: <87eg3keipu.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 24627 Cc: 24627@debbugs.gnu.org, Tino Calancha 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.5 (/) Andreas R=C3=B6hler writes: > beg still needs a check like > > (not (nth 8 (parse-partial-sexp (point-min) (point)))) > > otherwise it could match inside a string or comment I have the feeling that this should return the local list at point, even if inside a string or comment. Then, if point is inside a comment/string and there is no list there, the function might look for a list around (i.e., outside) that comment/string region. See patch below. Anyway, neither the doc string of `thing-at-point' nor `thing-at-point-bounds-of-list-at-point' mention what expect when point is inside a comment/string. That's why i believe it might be better to request that in a different bug report. Writting additional tests also might be helpful to find a robust implementa= tion. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;; >From bfc9b7fb739dfeab09c2ffd064a6ebe65a28b686 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Thu, 13 Oct 2016 16:34:35 +0900 Subject: [PATCH] (thing-at-point 'list) return nil if no list at point * lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): Check first if we are at the beginning of a top-level sexp (Bug#24627). If found a list inside a comment or string return it. Otherwise, look for a list around the comment/string. Escape '[' in doc string. --- lisp/thingatpt.el | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 6d1014b..656d2c7 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -219,22 +219,26 @@ 'beginning-of-sexp =20 (defun thing-at-point-bounds-of-list-at-point () "Return the bounds of the list at point. -[Internal function used by `bounds-of-thing-at-point'.]" +\[Internal function used by `bounds-of-thing-at-point'.]" (save-excursion - (let ((opoint (point)) - (beg (ignore-errors - (up-list -1) - (point)))) + (let* ((opoint (point)) + (st (syntax-ppss)) + (find-list-fn (lambda () + (ignore-errors + (up-list -1) + (point)))) + (beg (if (eq 4 (car (syntax-after (point)))) + (point) + (funcall find-list-fn)))) + ;; If inside a string or comment and there is no list + ;; at point, check for a list surrounding the string/comment region. + (when (and (nth 8 st) (=3D opoint (point))) + (goto-char (nth 8 st)) + (setq beg (funcall find-list-fn))) (ignore-errors - (if beg - (progn (forward-sexp) - (cons beg (point))) - ;; Are we are at the beginning of a top-level sexp? - (forward-sexp) - (let ((end (point))) - (backward-sexp) - (if (>=3D opoint (point)) - (cons opoint end)))))))) + (when beg + (forward-sexp) + (cons beg (point))))))) =20 ;; Defuns =20 --=20 2.9.3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;; In GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.1) of 2016-10-13 Repository revision: 1dd54e3eef7543720eff161457677a35fae2435c From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 13 13:42:54 2016 Received: (at 24627) by debbugs.gnu.org; 13 Oct 2016 17:42:54 +0000 Received: from localhost ([127.0.0.1]:54459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buk1u-00045V-4n for submit@debbugs.gnu.org; Thu, 13 Oct 2016 13:42:54 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:63968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buk1s-00045I-64 for 24627@debbugs.gnu.org; Thu, 13 Oct 2016 13:42:52 -0400 Received: from [192.168.178.35] ([77.3.37.31]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0MVZ1v-1bLnq72n3H-00Ywgs; Thu, 13 Oct 2016 19:42:44 +0200 Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list To: Tino Calancha References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> <781dea94-9f15-8bd2-66f5-055b55497471@easy-emacs.de> <87r37mupt0.fsf@gmail.com> <87eg3keipu.fsf@gmail.com> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: <18783e9f-e834-bb49-61f4-8eaf7b684590@easy-emacs.de> Date: Thu, 13 Oct 2016 19:50:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <87eg3keipu.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:Wkw5I99m4d4O3OKcQ8qq2Y12rl8OuFH1SRpVU49MeBACZPmZImE iwwsQZNq+DM6iomyPMKOu7CBPEAEqYpe1TmKjKDH+k3ViTIr3DSMLytxQpEyvpp66E5Ss7C VCwTw16LaRtcYfxNDK6ZS8W7cCjfGKEBOONUlrF7msDlwZ5x7NX+cblPjmrsztyczsLOJwY CldYqNAdWIk0MbkQqSmzg== X-UI-Out-Filterresults: notjunk:1;V01:K0:lUszLOytPaU=:A/mhF7XsAnwQGuVuWnN70B nxzW/w8RxcRDsRpaF5FAq5V//QRGqbWIa+O569nOyweDmgYIIwwZ4gX4TlGccdlqB81lnkyiz EmgtzA1XY/+5iKor0iPZqPpJ+I2s6omQ5oPDkuIqpHwdUMW+Owd8ePScAzeBe4dKNK1MD8E+I MdUKQpRVy1zZDHjx84ny8Sxjg4nzry7vH/HLKaEDlVzXoU/F0d/HdYhMX+E9078iG2EgZJWso qSS8Qno9wpB5gdBKASamT5p53lXnmg3JhwCjNy6Lla0Xwtb5y+7NWFIFpy5QSKqb97CMZZOm8 ffAvz52IMH5PjpJY93R59wwGKn9ayr9fbg8meq7Zd4eFnFJ7vu0BSW2UoVTxPe2sTiX4hSqLA X6E0p1jcc8JsfOMXIxk7zhEKtwBJcqx0YrU9yQTX6P91vAmNHYuWNBFUdh7s4eE9fOT6S4TdN tywk0YXYv3CtbetvQwivtk90EDmHbcTzPzZ2/6P4ZTl4e+xwIRdH3rvYnEP5dggrhjHhspRRe 1aE0zvwIk1G7ybyHEvpwoNN6RjnngVPS6jNmvQ1DiLRfc+aOLsvO1DK2X71RX3WYOgjD9qxLw rXj25tj3h/wkRYnOUF6CCET63pI0ER3kypAfuD8swwC31uZUhMLDuJMj9cr2br7ML+KZuU3N8 ygySWnuRm0Mtl6+WpUeDlUCLx953mPX9reZ4RgvIFD5jgjWPQE0uivYezVrZvhm58+dIgv1LR TopVIgU/o8oy4Q++ X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 24627 Cc: 24627@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.5 (/) On 13.10.2016 10:50, Tino Calancha wrote: > Andreas Röhler writes: > >> beg still needs a check like >> >> (not (nth 8 (parse-partial-sexp (point-min) (point)))) >> >> otherwise it could match inside a string or comment > I have the feeling that this should return the local list > at point, even if inside a string or comment. Yes, but that would be reported by pps. However, when point is at opening delimiter, this is not recognised by pps. Then we must be sure not being inside a string or comment, where an opening delimiter is meaningless, i.e. just a literal. IMO all needed is something like (beg (or (nth 1 (parse-partial-sexp...)) (and (eq 4 (car (syntax-after (point)))) (not (nth 8 (parse-partial-sexp...)) (point))))) Should both fail, there is not list at point. > Then, if > point is inside a comment/string and there is no list there, > the function might look for a list around (i.e., outside) that > comment/string region. See patch below. > > Anyway, neither the doc string of `thing-at-point' nor > `thing-at-point-bounds-of-list-at-point' mention what expect > when point is inside a comment/string. That's why i believe it > might be better to request that in a different bug report. > Writting additional tests also might be helpful to find a robust implementation. > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > From bfc9b7fb739dfeab09c2ffd064a6ebe65a28b686 Mon Sep 17 00:00:00 2001 > From: Tino Calancha > Date: Thu, 13 Oct 2016 16:34:35 +0900 > Subject: [PATCH] (thing-at-point 'list) return nil if no list at point > > * lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): > Check first if we are at the beginning of a top-level sexp (Bug#24627). > If found a list inside a comment or string return it. Otherwise, look > for a list around the comment/string. > Escape '[' in doc string. > --- > lisp/thingatpt.el | 32 ++++++++++++++++++-------------- > 1 file changed, 18 insertions(+), 14 deletions(-) > > diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el > index 6d1014b..656d2c7 100644 > --- a/lisp/thingatpt.el > +++ b/lisp/thingatpt.el > @@ -219,22 +219,26 @@ 'beginning-of-sexp > > (defun thing-at-point-bounds-of-list-at-point () > "Return the bounds of the list at point. > -[Internal function used by `bounds-of-thing-at-point'.]" > +\[Internal function used by `bounds-of-thing-at-point'.]" > (save-excursion > - (let ((opoint (point)) > - (beg (ignore-errors > - (up-list -1) > - (point)))) > + (let* ((opoint (point)) > + (st (syntax-ppss)) > + (find-list-fn (lambda () > + (ignore-errors > + (up-list -1) > + (point)))) > + (beg (if (eq 4 (car (syntax-after (point)))) > + (point) > + (funcall find-list-fn)))) > + ;; If inside a string or comment and there is no list > + ;; at point, check for a list surrounding the string/comment region. > + (when (and (nth 8 st) (= opoint (point))) > + (goto-char (nth 8 st)) > + (setq beg (funcall find-list-fn))) > (ignore-errors > - (if beg > - (progn (forward-sexp) > - (cons beg (point))) > - ;; Are we are at the beginning of a top-level sexp? > - (forward-sexp) > - (let ((end (point))) > - (backward-sexp) > - (if (>= opoint (point)) > - (cons opoint end)))))))) > + (when beg > + (forward-sexp) > + (cons beg (point))))))) > > ;; Defuns > From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 15 05:44:51 2016 Received: (at 24627) by debbugs.gnu.org; 15 Oct 2016 09:44:51 +0000 Received: from localhost ([127.0.0.1]:58633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvLWN-0000km-3Y for submit@debbugs.gnu.org; Sat, 15 Oct 2016 05:44:51 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:33488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvLWL-0000kU-BD for 24627@debbugs.gnu.org; Sat, 15 Oct 2016 05:44:49 -0400 Received: by mail-pf0-f169.google.com with SMTP id 128so60387992pfz.0 for <24627@debbugs.gnu.org>; Sat, 15 Oct 2016 02:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:cc:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=6Xk4CMFExQ7ePNJW+w95xfPF96ALSRNkpofg6rC+wFk=; b=cIOQZMtYU1NQagTNtMfUhtL3wDJcLAhvi/gbKNQeiia2Gx9bIyNvUATVloBtVj2KZy qZT8JbPkQOc8jHIlqfHWeVG8jNEH/NPAAG91wt7x0SmQQjobw9MOXci2bcNBq5DTbRcN ArOy2DCCpRdd/TUrIvg/FLaj2n9HxnDczwiSjen12mA400dXvxjnhwjZ/hSIpCkMqCzy QbpbG1V1JG48VWUsnHwdnrpU8WpyF3626z0diS4ta0PQJ5HRJsnhFdN48z1qtEnAjTr5 tSsCdm8KK7HlhbwmtLR/YJ7WiTEejp/sGtw+NSYhAyLAT53u0d0YO+7iTbjjRZMfUy9N /Lvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:references:cc:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=6Xk4CMFExQ7ePNJW+w95xfPF96ALSRNkpofg6rC+wFk=; b=U2gNaNdrb/uZ+eToiRNgv0JdRjomn+1n7gIL6RPpyFbsCwwwRDwRXYkra+nVlgbT7P +SmYWL5KVwwTCg1YNV2sLq4tZfiC0kiCQw0HUDKYe212I8vpK38VR5kGxsrPE6Ru43y5 2+07c5dIjxQXHAg670pVS3PSgNYeGgo5cPkr+5KUpsPilkmxfhuCQvo0lqptvd6W/sNQ 5ogjJij47M2+mwrdOnzOefJ3uDYVAwPguNJk5UkgNQVP6vqCS/vnALAqqCOtlOl8lsQh +6bYTydVpcIgklIy77TyXOjLz8ZyCy6iz2LuqIE9sfigOvMenOCJKL2Ko2REOp3HlBhf VDzw== X-Gm-Message-State: AA6/9RkfDjgfqtgKVUoFSysae5oSpslRf8Lt0sWKRRz920OhzMQU/a2A4FPKDM0o4oy12g== X-Received: by 10.98.14.197 with SMTP id 66mr24300257pfo.123.1476524683337; Sat, 15 Oct 2016 02:44:43 -0700 (PDT) Received: from calancha-pc ([240f:6e:c00e:1:6875:2e94:598b:96cb]) by smtp.gmail.com with ESMTPSA id 74sm33480901pfp.77.2016.10.15.02.44.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Oct 2016 02:44:42 -0700 (PDT) From: Tino Calancha To: Andreas =?utf-8?Q?R=C3=B6hler?= Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> <781dea94-9f15-8bd2-66f5-055b55497471@easy-emacs.de> <87r37mupt0.fsf@gmail.com> <87eg3keipu.fsf@gmail.com> <18783e9f-e834-bb49-61f4-8eaf7b684590@easy-emacs.de> Date: Sat, 15 Oct 2016 18:44:33 +0900 In-Reply-To: <18783e9f-e834-bb49-61f4-8eaf7b684590@easy-emacs.de> ("Andreas \=\?utf-8\?Q\?R\=C3\=B6hler\=22's\?\= message of "Thu, 13 Oct 2016 19:50:22 +0200") Message-ID: <87vawuc5fi.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24627 Cc: 24627@debbugs.gnu.org, tino.calancha@gmail.com 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.7 (/) Andreas R=C3=B6hler writes: > On 13.10.2016 10:50, Tino Calancha wrote: >> Andreas R=C3=B6hler writes: >> >>> beg still needs a check like >>> >>> (not (nth 8 (parse-partial-sexp (point-min) (point)))) >>> >>> otherwise it could match inside a string or comment >> I have the feeling that this should return the local list >> at point, even if inside a string or comment. > > Yes, but that would be reported by pps. However, when point is at > opening delimiter, this is not recognised by pps. Then we must be sure > not being inside a string or comment, where an opening delimiter is > meaningless, i.e. just a literal. > > IMO all needed is something like > > (beg (or (nth 1 (parse-partial-sexp...)) > > (and (eq 4 (car (syntax-after (point)))) > (not (nth 8 (parse-partial-sexp...)) > (point))))) >=20=20=20=20=20=20 > > Should both fail, there is not list at point. Thank you. I think i got what you mean. I need to invert the order of the above `or': (nth 1 (parse-partial-sexp...)) need to appear the second. Otherwise, (with-temp-buffer (insert "(foo (a b) bar)") (goto-char 6) (list-at-point)) will return: (foo (a b) bar) instead of: (a b) The new patch pass following test: (We might want to add this test into test/lisp/thingatpt-tests.el) (ert-deftest list-at-point-tests () "Test `list-at-point'." (let ((string-result '(("(a \"b\" c)" . (a "b" c)) (";(a \"b\" c)") ("(a \"b\" c\n)" . (a "b" c)) ("\"(a b c)\"") ("(a ;(b c d)\ne)" . (a e)) ("(foo\n(a ;(b c d)\ne) bar)" . (a e)) ("(foo\na ;(b c d)\ne bar)" . (foo a e bar)) ("(foo\n(a \"(b c d)\"\ne) bar)" . (a "(b c d)" e)) ("(b\n(a ;(foo c d)\ne) bar)" . (a e)) ("(princ \"(a b c)\")" . (princ "(a b c)")) ("(defun foo ()\n \"Test function.\"\n ;;(a b)\n= nil)" . (defun foo nil "Test function." nil))))) (dolist (str-res string-result) (with-temp-buffer (emacs-lisp-mode) (insert (car str-res)) (re-search-backward "\\((a\\|^a\\)") (should (equal (list-at-point) (cdr str-res))))))) This is the new patch: please, let me know if it's OK for you and feel free to suggest additional tests. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;; >From 693aeed2a7251d23885ee53db9bf7026c7c1af3f Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Sat, 15 Oct 2016 18:21:36 +0900 Subject: [PATCH] (thing-at-point 'list) return nil if no list at point * lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): Check first if we are at the beginning of a top-level sexp (Bug#24627). If point is inside a comment or string, look for a list out of the comment/string. Escape '[' in doc string. --- lisp/thingatpt.el | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 6d1014b..e423630 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -219,22 +219,17 @@ 'beginning-of-sexp =20 (defun thing-at-point-bounds-of-list-at-point () "Return the bounds of the list at point. -[Internal function used by `bounds-of-thing-at-point'.]" +\[Internal function used by `bounds-of-thing-at-point'.]" (save-excursion - (let ((opoint (point)) - (beg (ignore-errors - (up-list -1) - (point)))) - (ignore-errors - (if beg - (progn (forward-sexp) - (cons beg (point))) - ;; Are we are at the beginning of a top-level sexp? - (forward-sexp) - (let ((end (point))) - (backward-sexp) - (if (>=3D opoint (point)) - (cons opoint end)))))))) + (let* ((st (parse-partial-sexp (point-min) (point))) + (beg (or (and (eq 4 (car (syntax-after (point)))) + (not (nth 8 st)) + (point)) + (nth 1 st)))) + (when beg + (goto-char beg) + (forward-sexp) + (cons beg (point)))))) =20 ;; Defuns =20 --=20 2.9.3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;; In GNU Emacs 26.0.50.4 (x86_64-pc-linux-gnu, GTK+ Version 3.22.1) of 2016-10-15 Repository revision: b0f1d23ec482aa71a0ae0251f6f44f4b8d261259 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 15 06:18:35 2016 Received: (at 24627) by debbugs.gnu.org; 15 Oct 2016 10:18:35 +0000 Received: from localhost ([127.0.0.1]:58828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvM31-0001eo-7F for submit@debbugs.gnu.org; Sat, 15 Oct 2016 06:18:35 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:53947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvM30-0001ec-H8 for 24627@debbugs.gnu.org; Sat, 15 Oct 2016 06:18:34 -0400 Received: from [192.168.178.35] ([77.12.48.160]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0MCMOD-1c4Sqg2KSP-0099Un; Sat, 15 Oct 2016 12:18:27 +0200 Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list To: Tino Calancha References: <48df5626-be32-ffb0-55f5-1b6f116a6940@easy-emacs.de> <87fuo3r1p0.fsf@gmail.com> <08d6c55e-f060-fabc-5657-2e80a1d06ab0@easy-emacs.de> <878ttu97e3.fsf@gmail.com> <781dea94-9f15-8bd2-66f5-055b55497471@easy-emacs.de> <87r37mupt0.fsf@gmail.com> <87eg3keipu.fsf@gmail.com> <18783e9f-e834-bb49-61f4-8eaf7b684590@easy-emacs.de> <87vawuc5fi.fsf@gmail.com> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: <42cf0703-980e-7a80-8547-4e3160bf1993@easy-emacs.de> Date: Sat, 15 Oct 2016 12:26:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <87vawuc5fi.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:fQgtecsw/aCVFoRsQAQys8Pdj67138TFTeDKz0rFaGvkfwcqX2P lD0bS03Wm3MS+xQS5D/9NmtvaWf8g35GlYEoNNsPZy/nVGavcV30xz1ZcuRqHVDUd/wLT9U n48hW8MCCdyklh0dO4wVgL0Oaoqkijf/B5JMJgmewSQ2JjvG18BPH7g79busR44QVpOBbl8 UD8q3UtC3KVu+F9PrWANw== X-UI-Out-Filterresults: notjunk:1;V01:K0:d984ligpIDQ=:wsZUczF8MdBx1pfanwsXhY EC2sTxkNVntw3OpWddeFrAdno9zUIUjQVmpgLM6ib3OtealE3Sg/VWIOjNHJx8Zq7oTefa1RE qrPre6GPkFuy00jCl0G6y/d3yBb4K4sgfg8Dc1Zxfuy6TwGgdbHYXVnOsLY5nijaCsJG8KvAq cxlvbechfQvRZwn0a9J8XJjzBlMM84FJcztfQmJb9NxLX7YDhuHhFOdwwoP6jA5TiSnJkQEzb q95jG5g1G68UYZ+Pgp2F46GMHRB84X02EZYwsiVQwkh4P3up+yWmUQERamE06lrXkEq+N9e97 I32HMm+mTagdZlLnyJexhSlw2kFuAUUT34Y29kVKH5thYpnsYk/eDCaDXKiy4DVmmNIcXChFv JRahqMAVUVba6iuPEQViyn1gxKZDodRF7O0vFkTaGnselDSnpjcGWd1jnMpED1PvLz5CFJzrG toZv3pnPbWokRerEFmxvbxAXDFF+QDRPIaiRL3PWDxYoP2zEZ/0bH3hPpJ/VLje839fe5j0SW Ska8Ht+hf2JW0cc0hCNU+QXSQ0sT2D6byyWfcwqK/khRZAKY3lmf1SC4LiR+siq4ZPgFXF6VZ QfQ1EK7rmoMHk1j9k9kxhUQgW3VMF4tLfToUUcNzh2dUxz/HfipQQfZfCnGMXdp5QxUg+Y+dj 5NuWC7+A1kn2nQz9xMOs4QcFYHCwz0xhCuqBZOtpwfhxUzQ2cvhke+KMoWN1M4348/Ci8qki0 B5RqTnhSQq1+Odlp X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 24627 Cc: 24627@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.5 (/) On 15.10.2016 11:44, Tino Calancha wrote: > Andreas Röhler writes: > >> On 13.10.2016 10:50, Tino Calancha wrote: >>> Andreas Röhler writes: >>> >>>> beg still needs a check like >>>> >>>> (not (nth 8 (parse-partial-sexp (point-min) (point)))) >>>> >>>> otherwise it could match inside a string or comment >>> I have the feeling that this should return the local list >>> at point, even if inside a string or comment. >> Yes, but that would be reported by pps. However, when point is at >> opening delimiter, this is not recognised by pps. Then we must be sure >> not being inside a string or comment, where an opening delimiter is >> meaningless, i.e. just a literal. >> >> IMO all needed is something like >> >> (beg (or (nth 1 (parse-partial-sexp...)) >> >> (and (eq 4 (car (syntax-after (point)))) >> (not (nth 8 (parse-partial-sexp...)) >> (point))))) >> >> >> Should both fail, there is not list at point. > Thank you. I think i got what you mean. > I need to invert the order of the above `or': > (nth 1 (parse-partial-sexp...)) > need to appear the second. Otherwise, > (with-temp-buffer > (insert "(foo (a b) bar)") > (goto-char 6) > (list-at-point)) > > will return: > (foo (a b) bar) > instead of: > (a b) Ah, good catch. Thanks back. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 03 07:48:24 2016 Received: (at 24627-done) by debbugs.gnu.org; 3 Nov 2016 11:48:24 +0000 Received: from localhost ([127.0.0.1]:41177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2GVM-0000RA-9b for submit@debbugs.gnu.org; Thu, 03 Nov 2016 07:48:24 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:33491) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2GVL-0000Qw-6E for 24627-done@debbugs.gnu.org; Thu, 03 Nov 2016 07:48:23 -0400 Received: by mail-pf0-f178.google.com with SMTP id d2so30868382pfd.0 for <24627-done@debbugs.gnu.org>; Thu, 03 Nov 2016 04:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=JPyhWYU9SlQHYvW//QU0l3Qz5grRNozhyp2lgjm1gSo=; b=WP2G4KNucrGSKCe41qn7uJL84uPjfQ7Kl9TNP2wF+aaZCtS7S28qq4358crEIMT2D/ kEihGRKReTG+MYauT9JvsOitWpy7p2D9yUFThnbc4Nxn2Pw58kygU0ESL/tzaUaTRSia z+ozwGw/eZIYaGNi8AEEbP2PTDzk2cjJRNgo+5mitJuG7mFUvY9Y4OVf0I6iPbHJvZI2 9QeI/gD7RDoS2VynOqMRSshdoY2ZBQd3QMwegmYLafw9StMELp0E48LnVl4/78obeNLx Co7JR/+kbEQ/qYyZqXCFmuDKHCgipzJ5TxmLZ0Z1rdbYGaI2IH1CRtYpaHDisYI1b4ua /R0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=JPyhWYU9SlQHYvW//QU0l3Qz5grRNozhyp2lgjm1gSo=; b=UX46qDG3hT89g5TT7ePVnXW8nCWRPHLdvZIiKO8sraf+HKNMa7x5LRD4bmKPslPHH4 ESv8nb2TrQlmvQjH4n4N7VkYcrqN+1uA91jR4ojOlfuX6Qffc5/DZEiJhnUkZ3D9l8Fb PB4ZtHW4eMmzlnHgrvus7wg4J3aRCnRf3MlL8Gv1OIckzOcznEHoNXc3jNl8jxeEnbp5 iTJJaMdiMSfJndJOb0pte0L1pH3mwN4LRKEni+FjoBpsOS6mJmCytg67O+lxCsgz+pnO Q0wbvxtslOt0c9rB6DU71OOPVvhMfWRqeaOv9O4BteDBoJ4VH8f3TJJx/226iP+8xnTv rhAw== X-Gm-Message-State: ABUngveiGXljSjBn6epkP4561q8cH2aN4xNdjjc8oM26A1WsmzzMBafcm8CRbwkH7XNbJw== X-Received: by 10.98.10.198 with SMTP id 67mr15572983pfk.157.1478173697393; Thu, 03 Nov 2016 04:48:17 -0700 (PDT) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id h85sm12171753pfj.89.2016.11.03.04.48.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Nov 2016 04:48:16 -0700 (PDT) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Thu, 3 Nov 2016 20:48:13 +0900 (JST) X-X-Sender: calancha@calancha-pc To: 24627-done@debbugs.gnu.org Subject: Re: Proposed patch for Bug#24627 In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 24627-done Cc: Tino Calancha , Emacs developers 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.0 (/) On Thu, 27 Oct 2016, Tino Calancha wrote: > > Dear all, > > if no further comments in ~1 week, then i will push following fix > into master branch. Pushed to master branch as commit 76e297c1 From unknown Fri Jun 13 10:24:27 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, 01 Dec 2016 12:24:03 +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 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 14 21:24:43 2018 Received: (at control) by debbugs.gnu.org; 15 Jun 2018 01:24:43 +0000 Received: from localhost ([127.0.0.1]:48709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fTdTl-0005Xv-O0 for submit@debbugs.gnu.org; Thu, 14 Jun 2018 21:24:43 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:34869) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fTdTk-0005Xf-F1; Thu, 14 Jun 2018 21:24:40 -0400 Received: by mail-io0-f181.google.com with SMTP id u4-v6so9221219iof.2; Thu, 14 Jun 2018 18:24:40 -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:content-transfer-encoding; bh=PVxoogD6OUj/8t+il8rsabLPDvcPov+lwaVWxryOjHg=; b=NoAWZK7NMORtYxFig2/Arw3MhKsDuD7YLR6rjBHvukBfgnx5ZL7Tt4q+6id8lBtxKx C9XJGL2aNuL+9ebEBoEtLGb7xlJSvCI4dJfSH1GQtjNbL1NCjBq86qlIy5WFH7dxvfsF 8BWFoKEA2M966mgLnzOZZ6/kWiA1vCCpDgbPPmTzFY4b32CFdKUrnWxzobJmdV1ytt6j c33si8E3Tx8eqA5fx2fPDV1n4AjuLbfnxKWjD21KGoFhy9jk43rVGftbogXeXrEgvjrc N0/X9VJrFoJM4+PdFtSoLhGLNlBynsSWKJmx4ZYC39KPSb+qujpaJLh+5sjY5bmVjTq0 a2tw== 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:content-transfer-encoding; bh=PVxoogD6OUj/8t+il8rsabLPDvcPov+lwaVWxryOjHg=; b=dCFS150Xk15t3RO/h5YXAgzPAFtKqaRcw2z3HcGdyeBUYEkB8UFWp7rXcKCNheS7p/ i7CamDIGfnQR78wkCFPm6hzF+tggP97LKmDaUJwUgbVZKiOdep7Ige75ViBYuLtwQHeE 3Sh0TXyo0YIi6CN0gusfRwfGwfF7dPtBhMyuW/NG/Ldc9L3CtgVUrP2aIA9kOaXNzfxh Jfo0jdagGc/tW2J0g396NlrfItrYT9uL9tdfOZWUALLjZDBAyBStj21gpoy4Ci3w8V18 PoBcBVsgRWd5IWqo4YINpoHnpx5KE1QyWtcFNW7cFTzT7hDHckbBhH78W8TpiguVGigj atYQ== X-Gm-Message-State: APt69E1RJifMGRS217Iphe/3bqeNL0Y0JaxDeCeZQ2a180rLtASeqN9S BXYwgk4aANNBU8KqwwN/FveB6Q== X-Google-Smtp-Source: ADUXVKJZeR5hbIUXQeE6HJ/Mv5WkDBGB3aasQqvdRJ3AjiNkcoJSAes6VzMczyikWecSYHAZu5GD2Q== X-Received: by 2002:a6b:31a:: with SMTP id 26-v6mr4922296iod.66.1529025874882; Thu, 14 Jun 2018 18:24:34 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id g26-v6sm1480984iti.0.2018.06.14.18.24.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Jun 2018 18:24:33 -0700 (PDT) From: Noam Postavsky To: Nicolas Petton Subject: Re: bug#13955: Subject: 24.3; (thing-at-point 'list) fails References: <5141D287.3060506@easy-emacs.de> <5141EC38.1070306@easy-emacs.de> <51430116.90000@easy-emacs.de> <51434409.4070103@easy-emacs.de> <86lgdhlj1f.fsf@petton.fr> Date: Thu, 14 Jun 2018 21:24:32 -0400 In-Reply-To: <86lgdhlj1f.fsf@petton.fr> (Nicolas Petton's message of "Fri, 20 Apr 2018 22:28:12 +0200") Message-ID: <87602kx2nj.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) 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: control Cc: 13955@debbugs.gnu.org, Andreas =?utf-8?Q?R=C3=B6hler?= 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 (-) close 13955 26.1 unarchive 24627 merge 13955 24627 quit Nicolas Petton writes: > Andreas R=C3=B6hler writes: > >> As for the trivial patch, you will find a way to fix it with an alternat= ive triviality, >> should my decent piece not being accepted. > > I cannot reproduce the issue on master today, should I close this > ticket? Yes, it's fixed in 26.1. See also Bug#31772 for discussion over the new behaviour. From unknown Fri Jun 13 10:24:27 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, 13 Jul 2018 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