From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andreas =?UTF-8?Q?R=C3=B6hler?= Newsgroups: gmane.emacs.bugs Subject: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string without a list Date: Sat, 15 Oct 2016 12:26:11 +0200 Message-ID: <42cf0703-980e-7a80-8547-4e3160bf1993@easy-emacs.de> 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1476526768 11619 195.159.176.226 (15 Oct 2016 10:19:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 15 Oct 2016 10:19:28 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 Cc: 24627@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 15 12:19:20 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvM3f-0001OV-2y for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Oct 2016 12:19:15 +0200 Original-Received: from localhost ([::1]:51223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvM3d-0007WT-Ml for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Oct 2016 06:19:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvM3W-0007WO-TI for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2016 06:19:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvM3S-0006Kp-Kz for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2016 06:19:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52640) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvM3S-0006Kj-H6 for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2016 06:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bvM3S-0001fZ-BD for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2016 06:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Oct 2016 10:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24627 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24627-submit@debbugs.gnu.org id=B24627.14765267156378 (code B ref 24627); Sat, 15 Oct 2016 10:19:02 +0000 Original-Received: (at 24627) by debbugs.gnu.org; 15 Oct 2016 10:18:35 +0000 Original-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 Original-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 Original-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 In-Reply-To: <87vawuc5fi.fsf@gmail.com> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124501 Archived-At: 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.